PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/htdocs/core/lib/prelevement.lib.php

https://github.com/asterix14/dolibarr
PHP | 96 lines | 46 code | 14 blank | 36 comment | 4 complexity | 1b69652796c7eb6a0edd08533d4f8059 MD5 | raw file
Possible License(s): LGPL-2.0
  1. <?php
  2. /* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
  3. * Copyright (C) 2010 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2011 Regis Houssin <regis@dolibarr.fr>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. * or see http://www.gnu.org/
  19. */
  20. /**
  21. * \file htdocs/core/lib/prelevement.lib.php
  22. * \brief Ensemble de fonctions de base pour le module prelevement
  23. * \ingroup propal
  24. */
  25. /**
  26. * Prepare head for prelevement screen and return it
  27. * @param object Object BonPrelevement
  28. * @return array head
  29. */
  30. function prelevement_prepare_head($object)
  31. {
  32. global $langs, $conf, $user;
  33. $langs->load("withdrawals");
  34. $h = 0;
  35. $head = array();
  36. $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$object->id;
  37. $head[$h][1] = $langs->trans("Card");
  38. $head[$h][2] = 'prelevement';
  39. $h++;
  40. if ($conf->use_preview_tabs)
  41. {
  42. $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/bon.php?id='.$object->id;
  43. $head[$h][1] = $langs->trans("Preview");
  44. $head[$h][2] = 'preview';
  45. $h++;
  46. }
  47. $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/lignes.php?id='.$object->id;
  48. $head[$h][1] = $langs->trans("Lines");
  49. $head[$h][2] = 'lines';
  50. $h++;
  51. $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$object->id;
  52. $head[$h][1] = $langs->trans("Bills");
  53. $head[$h][2] = 'invoices';
  54. $h++;
  55. $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-rejet.php?id='.$object->id;
  56. $head[$h][1] = $langs->trans("Rejects");
  57. $head[$h][2] = 'rejects';
  58. $h++;
  59. $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$object->id;
  60. $head[$h][1] = $langs->trans("Statistics");
  61. $head[$h][2] = 'statistics';
  62. $h++;
  63. // Show more tabs from modules
  64. // Entries must be declared in modules descriptor with line
  65. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  66. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  67. complete_head_from_modules($conf,$langs,$object,$head,$h,'prelevement');
  68. return $head;
  69. }
  70. /**
  71. * Check need data to create standigns orders receipt file
  72. * @return int -1 if ko 0 if ok
  73. */
  74. function prelevement_check_config()
  75. {
  76. global $conf;
  77. if(empty($conf->global->PRELEVEMENT_USER)) return -1;
  78. if(empty($conf->global->PRELEVEMENT_ID_BANKACCOUNT)) return -1;
  79. if(empty($conf->global->PRELEVEMENT_NUMERO_NATIONAL_EMETTEUR)) return -1;
  80. return 0;
  81. }
  82. ?>