dolibarr  16.0.5
paymentvarious.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2017-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
3  * Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 // Put here all includes required by your class file
26 require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
27 
28 
33 {
37  public $element = 'variouspayment';
38 
42  public $table_element = 'payment_various';
43 
47  public $picto = 'payment';
48 
52  public $id;
53 
57  public $ref;
58 
62  public $tms;
63  public $datep;
64  public $datev;
65 
69  public $sens;
70  public $amount;
71  public $type_payment;
72  public $num_payment;
73  public $chqemetteur;
74  public $chqbank;
75  public $category_transaction;
76 
80  public $label;
81 
85  public $accountancy_code;
86 
90  public $subledger_account;
91 
95  public $fk_project;
96 
100  public $fk_account;
101 
106  public $accountid;
107 
111  public $fk_bank;
112 
116  public $categorie_transaction;
117 
121  public $fk_user_author;
122 
126  public $fk_user_modif;
127 
128 
132  public $fk_type;
133 
137  public $rappro;
138 
142  public $bank_num_releve;
143 
144 
170  // BEGIN MODULEBUILDER PROPERTIES
174  public $fields = array(
175  // TODO: fill this array
176  );
177  // END MODULEBUILDER PROPERTIES
178 
184  public function __construct(DoliDB $db)
185  {
186  $this->db = $db;
187  $this->element = 'payment_various';
188  $this->table_element = 'payment_various';
189  }
190 
198  public function update($user = null, $notrigger = 0)
199  {
200  global $conf, $langs;
201 
202  $error = 0;
203 
204  // Clean parameters
205  $this->amount = trim($this->amount);
206  $this->label = trim($this->label);
207  $this->note = trim($this->note);
208  $this->fk_bank = (int) $this->fk_bank;
209  $this->fk_user_author = (int) $this->fk_user_author;
210  $this->fk_user_modif = (int) $this->fk_user_modif;
211 
212  $this->db->begin();
213 
214  // Update request
215  $sql = "UPDATE ".MAIN_DB_PREFIX."payment_various SET";
216  if ($this->tms) {
217  $sql .= " tms='".$this->db->idate($this->tms)."',";
218  }
219  $sql .= " datep='".$this->db->idate($this->datep)."',";
220  $sql .= " datev='".$this->db->idate($this->datev)."',";
221  $sql .= " sens=".(int) $this->sens.",";
222  $sql .= " amount=".price2num($this->amount).",";
223  $sql .= " fk_typepayment=".(int) $this->type_payment.",";
224  $sql .= " num_payment='".$this->db->escape($this->num_payment)."',";
225  $sql .= " label='".$this->db->escape($this->label)."',";
226  $sql .= " note='".$this->db->escape($this->note)."',";
227  $sql .= " accountancy_code='".$this->db->escape($this->accountancy_code)."',";
228  $sql .= " subledger_account='".$this->db->escape($this->subledger_account)."',";
229  $sql .= " fk_projet='".$this->db->escape($this->fk_project)."',";
230  $sql .= " fk_bank=".($this->fk_bank > 0 ? $this->fk_bank : "null").",";
231  $sql .= " fk_user_author=".(int) $this->fk_user_author.",";
232  $sql .= " fk_user_modif=".(int) $this->fk_user_modif;
233  $sql .= " WHERE rowid=".((int) $this->id);
234 
235  dol_syslog(get_class($this)."::update", LOG_DEBUG);
236  $resql = $this->db->query($sql);
237  if (!$resql) {
238  $this->error = "Error ".$this->db->lasterror();
239  return -1;
240  }
241 
242  if (!$notrigger) {
243  // Call trigger
244  $result = $this->call_trigger('PAYMENT_VARIOUS_MODIFY', $user);
245  if ($result < 0) {
246  $error++;
247  }
248  // End call triggers
249  }
250 
251  if (!$error) {
252  $this->db->commit();
253  return 1;
254  } else {
255  $this->db->rollback();
256  return -1;
257  }
258  }
259 
260 
268  public function fetch($id, $user = null)
269  {
270  $sql = "SELECT";
271  $sql .= " v.rowid,";
272  $sql .= " v.tms,";
273  $sql .= " v.datep,";
274  $sql .= " v.datev,";
275  $sql .= " v.sens,";
276  $sql .= " v.amount,";
277  $sql .= " v.fk_typepayment,";
278  $sql .= " v.num_payment,";
279  $sql .= " v.label,";
280  $sql .= " v.note as note_private,";
281  $sql .= " v.accountancy_code,";
282  $sql .= " v.subledger_account,";
283  $sql .= " v.fk_projet as fk_project,";
284  $sql .= " v.fk_bank,";
285  $sql .= " v.fk_user_author,";
286  $sql .= " v.fk_user_modif,";
287  $sql .= " b.fk_account,";
288  $sql .= " b.fk_type,";
289  $sql .= " b.rappro,";
290  $sql .= " b.num_releve as bank_num_releve";
291  $sql .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
292  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
293  $sql .= " WHERE v.rowid = ".((int) $id);
294 
295  dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
296  $resql = $this->db->query($sql);
297  if ($resql) {
298  if ($this->db->num_rows($resql)) {
299  $obj = $this->db->fetch_object($resql);
300 
301  $this->id = $obj->rowid;
302  $this->ref = $obj->rowid;
303  $this->tms = $this->db->jdate($obj->tms);
304  $this->datep = $this->db->jdate($obj->datep);
305  $this->datev = $this->db->jdate($obj->datev);
306  $this->sens = $obj->sens;
307  $this->amount = $obj->amount;
308  $this->type_payment = $obj->fk_typepayment;
309  $this->num_payment = $obj->num_payment;
310  $this->label = $obj->label;
311  $this->note = $obj->note_private; // For backward compatibility
312  $this->note_private = $obj->note_private;
313  $this->subledger_account = $obj->subledger_account;
314  $this->accountancy_code = $obj->accountancy_code;
315  $this->fk_project = $obj->fk_project;
316  $this->fk_bank = $obj->fk_bank;
317  $this->fk_user_author = $obj->fk_user_author;
318  $this->fk_user_modif = $obj->fk_user_modif;
319  $this->fk_account = $obj->fk_account;
320  $this->fk_type = $obj->fk_type;
321  $this->rappro = $obj->rappro;
322  $this->bank_num_releve = $obj->bank_num_releve;
323  }
324  $this->db->free($resql);
325 
326  return 1;
327  } else {
328  $this->error = "Error ".$this->db->lasterror();
329  return -1;
330  }
331  }
332 
333 
340  public function delete($user)
341  {
342  global $conf, $langs;
343 
344  $error = 0;
345 
346  // Call trigger
347  $result = $this->call_trigger('PAYMENT_VARIOUS_DELETE', $user);
348  if ($result < 0) {
349  return -1;
350  }
351  // End call triggers
352 
353 
354  $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_various";
355  $sql .= " WHERE rowid=".((int) $this->id);
356 
357  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
358  $resql = $this->db->query($sql);
359  if (!$resql) {
360  $this->error = "Error ".$this->db->lasterror();
361  return -1;
362  }
363 
364  return 1;
365  }
366 
367 
375  public function initAsSpecimen()
376  {
377  $this->id = 0;
378 
379  $this->tms = '';
380  $this->datep = '';
381  $this->datev = '';
382  $this->sens = '';
383  $this->amount = '';
384  $this->label = '';
385  $this->accountancy_code = '';
386  $this->subledger_account = '';
387  $this->note = '';
388  $this->fk_bank = '';
389  $this->fk_user_author = '';
390  $this->fk_user_modif = '';
391  }
392 
398  public function check()
399  {
400  $newamount = price2num($this->amount, 'MT');
401 
402  // Validation of parameters
403  if (!($newamount) > 0 || empty($this->datep)) {
404  return false;
405  }
406 
407  return true;
408  }
409 
416  public function create($user)
417  {
418  global $conf, $langs;
419 
420  $error = 0;
421  $now = dol_now();
422 
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 = (int) $this->fk_bank;
428  $this->fk_user_author = (int) $this->fk_user_author;
429  $this->fk_user_modif = (int) $this->fk_user_modif;
430  $this->fk_account = (int) $this->fk_account;
431  if (empty($this->fk_account) && isset($this->accountid)) { // For compatibility
432  $this->fk_account = $this->accountid;
433  }
434 
435  // Check parameters
436  if (!$this->label) {
437  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
438  return -3;
439  }
440  if ($this->amount < 0 || $this->amount == '') {
441  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
442  return -5;
443  }
444  if (isModEnabled('banque') && (empty($this->fk_account) || $this->fk_account <= 0)) {
445  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount"));
446  return -6;
447  }
448  if (isModEnabled('banque') && (empty($this->type_payment) || $this->type_payment <= 0)) {
449  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
450  return -7;
451  }
452 
453  $this->db->begin();
454 
455  // Insert into llx_payment_various
456  $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_various (";
457  $sql .= " datep";
458  $sql .= ", datev";
459  $sql .= ", sens";
460  $sql .= ", amount";
461  $sql .= ", fk_typepayment";
462  $sql .= ", num_payment";
463  if ($this->note) {
464  $sql .= ", note";
465  }
466  $sql .= ", label";
467  $sql .= ", accountancy_code";
468  $sql .= ", subledger_account";
469  $sql .= ", fk_projet";
470  $sql .= ", fk_user_author";
471  $sql .= ", datec";
472  $sql .= ", fk_bank";
473  $sql .= ", entity";
474  $sql .= ")";
475  $sql .= " VALUES (";
476  $sql .= "'".$this->db->idate($this->datep)."'";
477  $sql .= ", '".$this->db->idate($this->datev)."'";
478  $sql .= ", '".$this->db->escape($this->sens)."'";
479  $sql .= ", ".price2num($this->amount);
480  $sql .= ", '".$this->db->escape($this->type_payment)."'";
481  $sql .= ", '".$this->db->escape($this->num_payment)."'";
482  if ($this->note) {
483  $sql .= ", '".$this->db->escape($this->note)."'";
484  }
485  $sql .= ", '".$this->db->escape($this->label)."'";
486  $sql .= ", '".$this->db->escape($this->accountancy_code)."'";
487  $sql .= ", '".$this->db->escape($this->subledger_account)."'";
488  $sql .= ", ".($this->fk_project > 0 ? ((int) $this->fk_project) : 0);
489  $sql .= ", ".((int) $user->id);
490  $sql .= ", '".$this->db->idate($now)."'";
491  $sql .= ", NULL"; // Filled later
492  $sql .= ", ".((int) $conf->entity);
493  $sql .= ")";
494 
495  dol_syslog(get_class($this)."::create", LOG_DEBUG);
496  $result = $this->db->query($sql);
497  if ($result) {
498  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_various");
499  $this->ref = $this->id;
500 
501  if ($this->id > 0) {
502  if (isModEnabled('banque') && !empty($this->amount)) {
503  // Insert into llx_bank
504  require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
505 
506  $acc = new Account($this->db);
507  $result = $acc->fetch($this->fk_account);
508  if ($result <= 0) {
509  dol_print_error($this->db);
510  }
511 
512  // Insert payment into llx_bank
513  // Add link 'payment_various' in bank_url between payment and bank transaction
514  $sign = 1;
515  if ($this->sens == '0') {
516  $sign = -1;
517  }
518 
519  $bank_line_id = $acc->addline(
520  $this->datep,
521  $this->type_payment,
522  $this->label,
523  $sign * abs($this->amount),
524  $this->num_payment,
525  ($this->category_transaction > 0 ? $this->category_transaction : 0),
526  $user,
527  $this->chqemetteur,
528  $this->chqbank,
529  '',
530  $this->datev
531  );
532 
533  // Update fk_bank into llx_payment_various
534  // So we know the payment which has generate the banking ecriture
535  if ($bank_line_id > 0) {
536  $this->update_fk_bank($bank_line_id);
537  } else {
538  $this->error = $acc->error;
539  $error++;
540  }
541 
542  if (!$error) {
543  // Add link 'payment_various' in bank_url between payment and bank transaction
544  $url = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id=';
545 
546  $result = $acc->add_url_line($bank_line_id, $this->id, $url, "(VariousPayment)", "payment_various");
547  if ($result <= 0) {
548  $this->error = $acc->error;
549  $error++;
550  }
551  }
552 
553  if ($result <= 0) {
554  $this->error = $acc->error;
555  $error++;
556  }
557  }
558 
559  // Call trigger
560  $result = $this->call_trigger('PAYMENT_VARIOUS_CREATE', $user);
561  if ($result < 0) {
562  $error++;
563  }
564  // End call triggers
565  } else {
566  $error++;
567  }
568 
569  if (!$error) {
570  $this->db->commit();
571  return $this->id;
572  } else {
573  $this->db->rollback();
574  return -2;
575  }
576  } else {
577  $this->error = $this->db->error();
578  $this->db->rollback();
579  return -1;
580  }
581  }
582 
583  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
590  public function update_fk_bank($id_bank)
591  {
592  // phpcs:enable
593  $sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_various SET fk_bank = '.((int) $id_bank);
594  $sql .= " WHERE rowid = ".((int) $this->id);
595  $result = $this->db->query($sql);
596  if ($result) {
597  return 1;
598  } else {
599  dol_print_error($this->db);
600  return -1;
601  }
602  }
603 
604 
611  public function getLibStatut($mode = 0)
612  {
613  return $this->LibStatut($this->statut, $mode);
614  }
615 
616  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
624  public function LibStatut($status, $mode = 0)
625  {
626  // phpcs:enable
627  if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
628  global $langs;
629  //$langs->load("mymodule@mymodule");
630  /*$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
631  $this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
632  $this->labelStatus[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');
633  $this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Draft');
634  $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
635  $this->labelStatusShort[self::STATUS_CANCELED] = $langs->transnoentitiesnoconv('Disabled');*/
636  }
637 
638  $statusType = 'status'.$status;
639 
640  return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
641  }
642 
643 
654  public function getNomUrl($withpicto = 0, $option = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '')
655  {
656  global $db, $conf, $langs, $hookmanager;
657  global $langs;
658 
659  if (!empty($conf->dol_no_mouse_hover)) {
660  $notooltip = 1; // Force disable tooltips
661  }
662 
663  $result = '';
664 
665  $label = '<u>'.$langs->trans("ShowVariousPayment").'</u>';
666  $label .= '<br>';
667  $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
668 
669  $url = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$this->id;
670 
671  if ($option != 'nolink') {
672  // Add param to save lastsearch_values or not
673  $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
674  if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
675  $add_save_lastsearch_values = 1;
676  }
677  if ($add_save_lastsearch_values) {
678  $url .= '&save_lastsearch_values=1';
679  }
680  }
681 
682  $linkclose = '';
683  if (empty($notooltip)) {
684  if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
685  $label = $langs->trans("ShowMyObject");
686  $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
687  }
688  $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
689  $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
690  } else {
691  $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
692  }
693 
694  $linkstart = '<a href="'.$url.'"';
695  $linkstart .= $linkclose.'>';
696  $linkend = '</a>';
697 
698  $result .= $linkstart;
699  if ($withpicto) {
700  $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
701  }
702  if ($withpicto != 2) {
703  $result .= $this->ref;
704  }
705  $result .= $linkend;
706  //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
707 
708  global $action;
709  $hookmanager->initHooks(array('variouspayment'));
710  $parameters = array('id'=>$this->id, 'getnomurl' => &$result);
711  $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
712  if ($reshook > 0) {
713  $result = $hookmanager->resPrint;
714  } else {
715  $result .= $hookmanager->resPrint;
716  }
717 
718  return $result;
719  }
720 
727  public function info($id)
728  {
729  $sql = 'SELECT v.rowid, v.datec, v.fk_user_author';
730  $sql .= ' FROM '.MAIN_DB_PREFIX.'payment_various as v';
731  $sql .= ' WHERE v.rowid = '.((int) $id);
732 
733  dol_syslog(get_class($this).'::info', LOG_DEBUG);
734  $result = $this->db->query($sql);
735 
736  if ($result) {
737  if ($this->db->num_rows($result)) {
738  $obj = $this->db->fetch_object($result);
739  $this->id = $obj->rowid;
740  if ($obj->fk_user_author) {
741  $cuser = new User($this->db);
742  $cuser->fetch($obj->fk_user_author);
743  $this->user_creation = $cuser;
744  }
745  $this->date_creation = $this->db->jdate($obj->datec);
746  if ($obj->fk_user_modif) {
747  $muser = new User($this->db);
748  $muser->fetch($obj->fk_user_modif);
749  $this->user_modif = $muser;
750  }
751  $this->date_modif = $this->db->jdate($obj->tms);
752  }
753  $this->db->free($result);
754  } else {
755  dol_print_error($this->db);
756  }
757  }
758 
764  public function getVentilExportCompta()
765  {
766  $banklineid = $this->fk_bank;
767 
768  $alreadydispatched = 0;
769 
770  $type = 'bank';
771 
772  $sql = " SELECT COUNT(ab.rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='".$this->db->escape($type)."' AND ab.fk_doc = ".((int) $banklineid);
773  $resql = $this->db->query($sql);
774  if ($resql) {
775  $obj = $this->db->fetch_object($resql);
776  if ($obj) {
777  $alreadydispatched = $obj->nb;
778  }
779  } else {
780  $this->error = $this->db->lasterror();
781  return -1;
782  }
783 
784  if ($alreadydispatched) {
785  return 1;
786  }
787  return 0;
788  }
789 }
PaymentVarious\update_fk_bank
update_fk_bank($id_bank)
Update link between payment various and line generate into llx_bank.
Definition: paymentvarious.class.php:590
PaymentVarious\getVentilExportCompta
getVentilExportCompta()
Return if a various payment linked to a bank line id was dispatched into bookkeeping.
Definition: paymentvarious.class.php:764
db
$conf db
API class for accounts.
Definition: inc.php:41
DoliDB
Class to manage Dolibarr database access.
Definition: DoliDB.class.php:30
PaymentVarious\check
check()
Check if a miscellaneous payment can be created into database.
Definition: paymentvarious.class.php:398
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
PaymentVarious\__construct
__construct(DoliDB $db)
Constructor.
Definition: paymentvarious.class.php:184
PaymentVarious\getLibStatut
getLibStatut($mode=0)
Retourne le libelle du statut.
Definition: paymentvarious.class.php:611
PaymentVarious\create
create($user)
Create in database.
Definition: paymentvarious.class.php:416
ref
$object ref
Definition: info.php:77
CommonObject
Parent class of all other business classes (invoices, contracts, proposals, orders,...
Definition: commonobject.class.php:44
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5661
PaymentVarious\info
info($id)
Information on record.
Definition: paymentvarious.class.php:727
PaymentVarious\update
update($user=null, $notrigger=0)
Update database.
Definition: paymentvarious.class.php:198
PaymentVarious
Class to manage various payments.
Definition: paymentvarious.class.php:32
PaymentVarious\fetch
fetch($id, $user=null)
Load object in memory from database.
Definition: paymentvarious.class.php:268
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:105
User
Class to manage Dolibarr users.
Definition: user.class.php:44
dolGetStatus
dolGetStatus($statusLabel='', $statusLabelShort='', $html='', $statusType='status0', $displayMode=0, $url='', $params=array())
Output the badge of a status.
Definition: functions.lib.php:10338
PaymentVarious\getNomUrl
getNomUrl($withpicto=0, $option='', $save_lastsearch_value=-1, $notooltip=0, $morecss='')
Send name clicable (with possibly the picto)
Definition: paymentvarious.class.php:654
img_object
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
Definition: functions.lib.php:4211
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2845
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
PaymentVarious\initAsSpecimen
initAsSpecimen()
Initialise an instance with random values.
Definition: paymentvarious.class.php:375
CommonObject\call_trigger
call_trigger($triggerName, $user)
Call trigger based on this instance.
Definition: commonobject.class.php:5791
Account
Class to manage bank accounts.
Definition: account.class.php:38
PaymentVarious\LibStatut
LibStatut($status, $mode=0)
Renvoi le libelle d'un statut donne.
Definition: paymentvarious.class.php:624