modules_payment.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. /* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. * or see https://www.gnu.org/
  17. */
  18. /**
  19. * \class ModeleNumRefPayments
  20. * \brief Payment numbering references mother class
  21. */
  22. abstract class ModeleNumRefPayments
  23. {
  24. /**
  25. * @var string Error code (or message)
  26. */
  27. public $error = '';
  28. /**
  29. * Return if a module can be used or not
  30. *
  31. * @return boolean true if module can be used
  32. */
  33. public function isEnabled()
  34. {
  35. return true;
  36. }
  37. /**
  38. * Return the default description of numbering module
  39. *
  40. * @return string Texte descripif
  41. */
  42. public function info()
  43. {
  44. global $langs;
  45. $langs->load("bills");
  46. return $langs->trans("NoDescription");
  47. }
  48. /**
  49. * Return numbering example
  50. *
  51. * @return string Example
  52. */
  53. public function getExample()
  54. {
  55. global $langs;
  56. $langs->load("bills");
  57. return $langs->trans("NoExample");
  58. }
  59. /**
  60. * Checks if the numbers already in the database do not
  61. * cause conflicts that would prevent this numbering working.
  62. *
  63. * @return boolean false if conflict, true if ok
  64. */
  65. public function canBeActivated()
  66. {
  67. return true;
  68. }
  69. /**
  70. * Returns the next value
  71. *
  72. * @param Societe $objsoc Object thirdparty
  73. * @param Object $object Object we need next value for
  74. * @return string Valeur
  75. */
  76. public function getNextValue($objsoc, $object)
  77. {
  78. global $langs;
  79. return $langs->trans("NotAvailable");
  80. }
  81. /**
  82. * Returns the module numbering version
  83. *
  84. * @return string Value
  85. */
  86. public function getVersion()
  87. {
  88. global $langs;
  89. $langs->load("admin");
  90. if ($this->version == 'development') {
  91. return $langs->trans("VersionDevelopment");
  92. } elseif ($this->version == 'experimental') {
  93. return $langs->trans("VersionExperimental");
  94. } elseif ($this->version == 'dolibarr') {
  95. return DOL_VERSION;
  96. } elseif ($this->version) {
  97. return $this->version;
  98. } else {
  99. return $langs->trans("NotAvailable");
  100. }
  101. }
  102. }