tva.class.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. <?php
  2. /* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@zendsi.com>
  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 3 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. */
  19. /**
  20. * \file htdocs/compta/tva/class/tva.class.php
  21. * \ingroup tax
  22. * \author Laurent Destailleur
  23. */
  24. // Put here all includes required by your class file
  25. require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
  26. /**
  27. * Put here description of your class
  28. */
  29. class Tva extends CommonObject
  30. {
  31. //public $element='tva'; //!< Id that identify managed objects
  32. //public $table_element='tva'; //!< Name of table without prefix where object is stored
  33. public $picto='payment';
  34. var $tms;
  35. var $datep;
  36. var $datev;
  37. var $amount;
  38. var $type_payment;
  39. var $num_payment;
  40. var $label;
  41. var $fk_bank;
  42. var $fk_user_creat;
  43. var $fk_user_modif;
  44. /**
  45. * Constructor
  46. *
  47. * @param DoliDB $db Database handler
  48. */
  49. function __construct($db)
  50. {
  51. $this->db = $db;
  52. $this->element = 'tva';
  53. $this->table_element = 'tva';
  54. return 1;
  55. }
  56. /**
  57. * Create in database
  58. *
  59. * @param User $user User that create
  60. * @return int <0 if KO, >0 if OK
  61. */
  62. function create($user)
  63. {
  64. global $conf, $langs;
  65. $error=0;
  66. $now=dol_now();
  67. // Clean parameters
  68. $this->amount=trim($this->amount);
  69. $this->label=trim($this->label);
  70. $this->note=trim($this->note);
  71. $this->fk_bank=trim($this->fk_bank);
  72. $this->fk_user_creat=trim($this->fk_user_creat);
  73. $this->fk_user_modif=trim($this->fk_user_modif);
  74. // Check parameters
  75. // Put here code to add control on parameters values
  76. $this->db->begin();
  77. // Insert request
  78. $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva(";
  79. $sql.= "datec,";
  80. $sql.= "datep,";
  81. $sql.= "datev,";
  82. $sql.= "amount,";
  83. $sql.= "label,";
  84. $sql.= "note,";
  85. $sql.= "fk_bank,";
  86. $sql.= "fk_user_creat,";
  87. $sql.= "fk_user_modif";
  88. $sql.= ") VALUES (";
  89. $sql.= " '".$this->db->idate($now)."',";
  90. $sql.= " '".$this->db->idate($this->datep)."',";
  91. $sql.= " '".$this->db->idate($this->datev)."',";
  92. $sql.= " '".$this->amount."',";
  93. $sql.= " '".$this->label."',";
  94. $sql.= " '".$this->note."',";
  95. $sql.= " ".($this->fk_bank <= 0 ? "NULL" : "'".$this->fk_bank."'").",";
  96. $sql.= " '".$this->fk_user_creat."',";
  97. $sql.= " '".$this->fk_user_modif."'";
  98. $sql.= ")";
  99. dol_syslog(get_class($this)."::create", LOG_DEBUG);
  100. $resql=$this->db->query($sql);
  101. if ($resql)
  102. {
  103. $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva");
  104. // Call trigger
  105. $result=$this->call_trigger('TVA_CREATE',$user);
  106. if ($result < 0) $error++;
  107. // End call triggers
  108. if (! $error)
  109. {
  110. $this->db->commit();
  111. return $this->id;
  112. }
  113. else
  114. {
  115. $this->db->rollback();
  116. return -1;
  117. }
  118. }
  119. else
  120. {
  121. $this->error="Error ".$this->db->lasterror();
  122. $this->db->rollback();
  123. return -1;
  124. }
  125. }
  126. /**
  127. * Update database
  128. *
  129. * @param User $user User that modify
  130. * @param int $notrigger 0=no, 1=yes (no update trigger)
  131. * @return int <0 if KO, >0 if OK
  132. */
  133. function update($user=null, $notrigger=0)
  134. {
  135. global $conf, $langs;
  136. $error=0;
  137. // Clean parameters
  138. $this->amount=trim($this->amount);
  139. $this->label=trim($this->label);
  140. $this->note=trim($this->note);
  141. $this->fk_bank=trim($this->fk_bank);
  142. $this->fk_user_creat=trim($this->fk_user_creat);
  143. $this->fk_user_modif=trim($this->fk_user_modif);
  144. // Check parameters
  145. // Put here code to add control on parameters values
  146. $this->db->begin();
  147. // Update request
  148. $sql = "UPDATE ".MAIN_DB_PREFIX."tva SET";
  149. $sql.= " tms=".$this->db->idate($this->tms).",";
  150. $sql.= " datep=".$this->db->idate($this->datep).",";
  151. $sql.= " datev=".$this->db->idate($this->datev).",";
  152. $sql.= " amount=".price2num($this->amount).",";
  153. $sql.= " label='".$this->db->escape($this->label)."',";
  154. $sql.= " note='".$this->db->escape($this->note)."',";
  155. $sql.= " fk_bank=".$this->fk_bank.",";
  156. $sql.= " fk_user_creat=".$this->fk_user_creat.",";
  157. $sql.= " fk_user_modif=".$this->fk_user_modif."";
  158. $sql.= " WHERE rowid=".$this->id;
  159. dol_syslog(get_class($this)."::update", LOG_DEBUG);
  160. $resql = $this->db->query($sql);
  161. if (! $resql)
  162. {
  163. $this->error="Error ".$this->db->lasterror();
  164. $error++;
  165. }
  166. if (! $error && ! $notrigger)
  167. {
  168. // Call trigger
  169. $result=$this->call_trigger('TVA_MODIFY',$user);
  170. if ($result < 0) $error++;
  171. // End call triggers
  172. }
  173. if (! $error)
  174. {
  175. $this->db->commit();
  176. return 1;
  177. }
  178. else
  179. {
  180. $this->db->rollback();
  181. return -1;
  182. }
  183. }
  184. /**
  185. * Load object in memory from database
  186. *
  187. * @param int $id id object
  188. * @param User $user User that load
  189. * @return int <0 if KO, >0 if OK
  190. */
  191. function fetch($id, $user=null)
  192. {
  193. global $langs;
  194. $sql = "SELECT";
  195. $sql.= " t.rowid,";
  196. $sql.= " t.tms,";
  197. $sql.= " t.datep,";
  198. $sql.= " t.datev,";
  199. $sql.= " t.amount,";
  200. $sql.= " t.fk_typepayment,";
  201. $sql.= " t.num_payment,";
  202. $sql.= " t.label,";
  203. $sql.= " t.note,";
  204. $sql.= " t.fk_bank,";
  205. $sql.= " t.fk_user_creat,";
  206. $sql.= " t.fk_user_modif,";
  207. $sql.= " b.fk_account,";
  208. $sql.= " b.fk_type,";
  209. $sql.= " b.rappro";
  210. $sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
  211. $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON t.fk_bank = b.rowid";
  212. $sql.= " WHERE t.rowid = ".$id;
  213. dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
  214. $resql=$this->db->query($sql);
  215. if ($resql)
  216. {
  217. if ($this->db->num_rows($resql))
  218. {
  219. $obj = $this->db->fetch_object($resql);
  220. $this->id = $obj->rowid;
  221. $this->ref = $obj->rowid;
  222. $this->tms = $this->db->jdate($obj->tms);
  223. $this->datep = $this->db->jdate($obj->datep);
  224. $this->datev = $this->db->jdate($obj->datev);
  225. $this->amount = $obj->amount;
  226. $this->type_payment = $obj->fk_typepayment;
  227. $this->num_payment = $obj->num_payment;
  228. $this->label = $obj->label;
  229. $this->note = $obj->note;
  230. $this->fk_bank = $obj->fk_bank;
  231. $this->fk_user_creat = $obj->fk_user_creat;
  232. $this->fk_user_modif = $obj->fk_user_modif;
  233. $this->fk_account = $obj->fk_account;
  234. $this->fk_type = $obj->fk_type;
  235. $this->rappro = $obj->rappro;
  236. }
  237. $this->db->free($resql);
  238. return 1;
  239. }
  240. else
  241. {
  242. $this->error="Error ".$this->db->lasterror();
  243. return -1;
  244. }
  245. }
  246. /**
  247. * Delete object in database
  248. *
  249. * @param User $user User that delete
  250. * @return int <0 if KO, >0 if OK
  251. */
  252. function delete($user)
  253. {
  254. global $conf, $langs;
  255. $error=0;
  256. // Call trigger
  257. $result=$this->call_trigger('TVA_DELETE',$user);
  258. if ($result < 0) return -1;
  259. // End call triggers
  260. $sql = "DELETE FROM ".MAIN_DB_PREFIX."tva";
  261. $sql.= " WHERE rowid=".$this->id;
  262. dol_syslog(get_class($this)."::delete", LOG_DEBUG);
  263. $resql = $this->db->query($sql);
  264. if (! $resql)
  265. {
  266. $this->error="Error ".$this->db->lasterror();
  267. return -1;
  268. }
  269. return 1;
  270. }
  271. /**
  272. * Initialise an instance with random values.
  273. * Used to build previews or test instances.
  274. * id must be 0 if object instance is a specimen.
  275. *
  276. * @return void
  277. */
  278. function initAsSpecimen()
  279. {
  280. $this->id=0;
  281. $this->tms='';
  282. $this->datep='';
  283. $this->datev='';
  284. $this->amount='';
  285. $this->label='';
  286. $this->note='';
  287. $this->fk_bank='';
  288. $this->fk_user_creat='';
  289. $this->fk_user_modif='';
  290. }
  291. /**
  292. * Balance of VAT
  293. *
  294. * @param int $year Year
  295. * @return double Amount
  296. */
  297. function solde($year = 0)
  298. {
  299. $reglee = $this->tva_sum_reglee($year);
  300. $payee = $this->tva_sum_payee($year);
  301. $collectee = $this->tva_sum_collectee($year);
  302. $solde = $reglee - ($collectee - $payee);
  303. return $solde;
  304. }
  305. /**
  306. * Total of the VAT from invoices emitted by the thirdparty.
  307. *
  308. * @param int $year Year
  309. * @return double Amount
  310. */
  311. function tva_sum_collectee($year = 0)
  312. {
  313. $sql = "SELECT sum(f.tva) as amount";
  314. $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
  315. if ($year)
  316. {
  317. $sql .= " AND f.datef >= '".$year."-01-01' AND f.datef <= '".$year."-12-31' ";
  318. }
  319. $result = $this->db->query($sql);
  320. if ($result)
  321. {
  322. if ($this->db->num_rows($result))
  323. {
  324. $obj = $this->db->fetch_object($result);
  325. $ret = $obj->amount;
  326. $this->db->free($result);
  327. return $ret;
  328. }
  329. else
  330. {
  331. $this->db->free($result);
  332. return 0;
  333. }
  334. }
  335. else
  336. {
  337. print $this->db->lasterror();
  338. return -1;
  339. }
  340. }
  341. /**
  342. * VAT payed
  343. *
  344. * @param int $year Year
  345. * @return double Amount
  346. */
  347. function tva_sum_payee($year = 0)
  348. {
  349. $sql = "SELECT sum(f.total_tva) as total_tva";
  350. $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
  351. if ($year)
  352. {
  353. $sql .= " WHERE f.datef >= '".$year."-01-01' AND f.datef <= '".$year."-12-31' ";
  354. }
  355. $result = $this->db->query($sql);
  356. if ($result)
  357. {
  358. if ($this->db->num_rows($result))
  359. {
  360. $obj = $this->db->fetch_object($result);
  361. $ret = $obj->total_tva;
  362. $this->db->free($result);
  363. return $ret;
  364. }
  365. else
  366. {
  367. $this->db->free($result);
  368. return 0;
  369. }
  370. }
  371. else
  372. {
  373. print $this->db->lasterror();
  374. return -1;
  375. }
  376. }
  377. /**
  378. * Total of the VAT payed
  379. *
  380. * @param int $year Year
  381. * @return double Amount
  382. */
  383. function tva_sum_reglee($year = 0)
  384. {
  385. $sql = "SELECT sum(f.amount) as amount";
  386. $sql .= " FROM ".MAIN_DB_PREFIX."tva as f";
  387. if ($year)
  388. {
  389. $sql .= " WHERE f.datev >= '".$year."-01-01' AND f.datev <= '".$year."-12-31' ";
  390. }
  391. $result = $this->db->query($sql);
  392. if ($result)
  393. {
  394. if ($this->db->num_rows($result))
  395. {
  396. $obj = $this->db->fetch_object($result);
  397. $ret = $obj->amount;
  398. $this->db->free($result);
  399. return $ret;
  400. }
  401. else
  402. {
  403. $this->db->free($result);
  404. return 0;
  405. }
  406. }
  407. else
  408. {
  409. print $this->db->lasterror();
  410. return -1;
  411. }
  412. }
  413. /**
  414. * Create in database
  415. *
  416. * @param User $user Object user that insert
  417. * @return int <0 if KO, rowid in tva table if OK
  418. */
  419. function addPayment($user)
  420. {
  421. global $conf,$langs;
  422. $this->db->begin();
  423. // Clean parameters
  424. $this->amount=price2num(trim($this->amount));
  425. $this->label=trim($this->label);
  426. $this->note=trim($this->note);
  427. $this->fk_bank=trim($this->fk_bank);
  428. $this->fk_user_creat=trim($this->fk_user_creat);
  429. $this->fk_user_modif=trim($this->fk_user_modif);
  430. // Check parameters
  431. if (! $this->label)
  432. {
  433. $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Label"));
  434. return -3;
  435. }
  436. if ($this->amount == '')
  437. {
  438. $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
  439. return -4;
  440. }
  441. if (! empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0))
  442. {
  443. $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account"));
  444. return -5;
  445. }
  446. if (! empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0))
  447. {
  448. $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
  449. return -5;
  450. }
  451. // Insert into llx_tva
  452. $sql = "INSERT INTO ".MAIN_DB_PREFIX."tva (datep";
  453. $sql.= ", datev";
  454. $sql.= ", amount";
  455. $sql.= ", fk_typepayment";
  456. $sql.= ", num_payment";
  457. if ($this->note) $sql.= ", note";
  458. if ($this->label) $sql.= ", label";
  459. $sql.= ", fk_user_creat";
  460. $sql.= ", fk_bank";
  461. $sql.= ", entity";
  462. $sql.= ") ";
  463. $sql.= " VALUES (";
  464. $sql.= "'".$this->db->idate($this->datep)."'";
  465. $sql.= ", '".$this->db->idate($this->datev)."'";
  466. $sql.= ", ".$this->amount;
  467. $sql.= ", '".$this->type_payment."'";
  468. $sql.= ", '".$this->num_payment."'";
  469. if ($this->note) $sql.=", '".$this->db->escape($this->note)."'";
  470. if ($this->label) $sql.=", '".$this->db->escape($this->label)."'";
  471. $sql.= ", '".$user->id."'";
  472. $sql.= ", NULL";
  473. $sql.= ", ".$conf->entity;
  474. $sql.= ")";
  475. dol_syslog(get_class($this)."::addPayment", LOG_DEBUG);
  476. $result = $this->db->query($sql);
  477. if ($result)
  478. {
  479. $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."tva"); // TODO should be called 'payment_vat'
  480. // Call trigger
  481. //XXX: Should be done just befor commit no ?
  482. $result=$this->call_trigger('TVA_ADDPAYMENT',$user);
  483. if ($result < 0)
  484. {
  485. $this->id = 0;
  486. $ok = 0;
  487. }
  488. // End call triggers
  489. if ($this->id > 0)
  490. {
  491. $ok=1;
  492. if (! empty($conf->banque->enabled) && ! empty($this->amount))
  493. {
  494. // Insert into llx_bank
  495. require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
  496. $acc = new Account($this->db);
  497. $result=$acc->fetch($this->accountid);
  498. if ($result <= 0) dol_print_error($this->db);
  499. if ($this->amount > 0) {
  500. $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, -abs($this->amount), '', '', $user);
  501. } else {
  502. $bank_line_id = $acc->addline($this->datep, $this->type_payment, $this->label, abs($this->amount), '', '', $user);
  503. }
  504. // Update fk_bank into llx_tva. So we know vat line used to generate bank transaction
  505. if ($bank_line_id > 0)
  506. {
  507. $this->update_fk_bank($bank_line_id);
  508. }
  509. else
  510. {
  511. $this->error=$acc->error;
  512. $ok=0;
  513. }
  514. // Update links
  515. $result=$acc->add_url_line($bank_line_id, $this->id, DOL_URL_ROOT.'/compta/tva/card.php?id=', "(VATPayment)", "payment_vat");
  516. if ($result < 0)
  517. {
  518. $this->error=$acc->error;
  519. $ok=0;
  520. }
  521. }
  522. if ($ok)
  523. {
  524. $this->db->commit();
  525. return $this->id;
  526. }
  527. else
  528. {
  529. $this->db->rollback();
  530. return -3;
  531. }
  532. }
  533. else
  534. {
  535. $this->db->rollback();
  536. return -2;
  537. }
  538. }
  539. else
  540. {
  541. $this->error=$this->db->error();
  542. $this->db->rollback();
  543. return -1;
  544. }
  545. }
  546. /**
  547. * Update link between payment tva and line generate into llx_bank
  548. *
  549. * @param int $id_bank Id bank account
  550. * @return int <0 if KO, >0 if OK
  551. */
  552. function update_fk_bank($id_bank)
  553. {
  554. $sql = 'UPDATE '.MAIN_DB_PREFIX.'tva SET fk_bank = '.$id_bank;
  555. $sql.= ' WHERE rowid = '.$this->id;
  556. $result = $this->db->query($sql);
  557. if ($result)
  558. {
  559. return 1;
  560. }
  561. else
  562. {
  563. dol_print_error($this->db);
  564. return -1;
  565. }
  566. }
  567. /**
  568. * Send name clicable (with possibly the picto)
  569. *
  570. * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
  571. * @param string $option link option
  572. * @return string Chaine with URL
  573. */
  574. function getNomUrl($withpicto=0,$option='')
  575. {
  576. global $langs;
  577. $result='';
  578. $label=$langs->trans("ShowVatPayment").': '.$this->ref;
  579. $link = '<a href="'.DOL_URL_ROOT.'/compta/tva/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
  580. $linkend='</a>';
  581. $picto='payment';
  582. if ($withpicto) $result.=($link.img_object($label, $picto, 'class="classfortooltip"').$linkend);
  583. if ($withpicto && $withpicto != 2) $result.=' ';
  584. if ($withpicto != 2) $result.=$link.$this->ref.$linkend;
  585. return $result;
  586. }
  587. /**
  588. * Informations of vat payment object
  589. *
  590. * @param int $id Id of vat payment
  591. * @return int <0 if KO, >0 if OK
  592. */
  593. function info($id)
  594. {
  595. $sql = "SELECT t.rowid, t.tms, t.datec, t.fk_user_creat";
  596. $sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
  597. $sql.= " WHERE t.rowid = ".$id;
  598. dol_syslog(get_class($this)."::info", LOG_DEBUG);
  599. $result=$this->db->query($sql);
  600. if ($result)
  601. {
  602. if ($this->db->num_rows($result))
  603. {
  604. $obj = $this->db->fetch_object($result);
  605. $this->id = $obj->rowid;
  606. if ($obj->fk_user_creat) {
  607. $cuser = new User($this->db);
  608. $cuser->fetch($obj->fk_user_creat);
  609. $this->user_creation = $cuser;
  610. }
  611. if ($obj->fk_user_modif) {
  612. $muser = new User($this->db);
  613. $muser->fetch($obj->fk_user_modif);
  614. $this->user_modification = $muser;
  615. }
  616. $this->date_creation = $this->db->jdate($obj->datec);
  617. $this->date_modification = $this->db->jdate($obj->tms);
  618. $this->import_key = $obj->import_key;
  619. }
  620. $this->db->free($result);
  621. }
  622. else
  623. {
  624. dol_print_error($this->db);
  625. }
  626. }
  627. /**
  628. * Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
  629. *
  630. * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
  631. * @return string Libelle
  632. */
  633. function getLibStatut($mode=0)
  634. {
  635. return $this->LibStatut($this->statut,$mode);
  636. }
  637. /**
  638. * Renvoi le libelle d'un statut donne
  639. *
  640. * @param int $status Statut
  641. * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
  642. * @return string Libelle du statut
  643. */
  644. function LibStatut($status,$mode=0)
  645. {
  646. global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
  647. return '';
  648. }
  649. }