dolibarr  13.0.2
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 
154  // BEGIN MODULEBUILDER PROPERTIES
158  public $fields = array(
159  // TODO: fill this array
160  );
161  // END MODULEBUILDER PROPERTIES
162 
168  public function __construct($db)
169  {
170  $this->db = $db;
171  $this->element = 'payment_various';
172  $this->table_element = 'payment_various';
173  }
174 
182  public function update($user = null, $notrigger = 0)
183  {
184  global $conf, $langs;
185 
186  $error = 0;
187 
188  // Clean parameters
189  $this->amount = trim($this->amount);
190  $this->label = trim($this->label);
191  $this->note = trim($this->note);
192  $this->fk_bank = (int) $this->fk_bank;
193  $this->fk_user_author = (int) $this->fk_user_author;
194  $this->fk_user_modif = (int) $this->fk_user_modif;
195 
196  $this->db->begin();
197 
198  // Update request
199  $sql = "UPDATE ".MAIN_DB_PREFIX."payment_various SET";
200  if ($this->tms) $sql .= " tms='".$this->db->idate($this->tms)."',";
201  $sql .= " datep='".$this->db->idate($this->datep)."',";
202  $sql .= " datev='".$this->db->idate($this->datev)."',";
203  $sql .= " sens=".(int) $this->sens.",";
204  $sql .= " amount=".price2num($this->amount).",";
205  $sql .= " fk_typepayment=".(int) $this->type_payment.",";
206  $sql .= " num_payment='".$this->db->escape($this->num_payment)."',";
207  $sql .= " label='".$this->db->escape($this->label)."',";
208  $sql .= " note='".$this->db->escape($this->note)."',";
209  $sql .= " accountancy_code='".$this->db->escape($this->accountancy_code)."',";
210  $sql .= " subledger_account='".$this->db->escape($this->subledger_account)."',";
211  $sql .= " fk_projet='".$this->db->escape($this->fk_project)."',";
212  $sql .= " fk_bank=".($this->fk_bank > 0 ? $this->fk_bank : "null").",";
213  $sql .= " fk_user_author=".(int) $this->fk_user_author.",";
214  $sql .= " fk_user_modif=".(int) $this->fk_user_modif;
215  $sql .= " WHERE rowid=".$this->id;
216 
217  dol_syslog(get_class($this)."::update", LOG_DEBUG);
218  $resql = $this->db->query($sql);
219  if (!$resql) {
220  $this->error = "Error ".$this->db->lasterror();
221  return -1;
222  }
223 
224  if (!$notrigger) {
225  // Call trigger
226  $result = $this->call_trigger('PAYMENT_VARIOUS_MODIFY', $user);
227  if ($result < 0) $error++;
228  // End call triggers
229  }
230 
231  if (!$error) {
232  $this->db->commit();
233  return 1;
234  } else {
235  $this->db->rollback();
236  return -1;
237  }
238  }
239 
240 
248  public function fetch($id, $user = null)
249  {
250  global $langs;
251  $sql = "SELECT";
252  $sql .= " v.rowid,";
253  $sql .= " v.tms,";
254  $sql .= " v.datep,";
255  $sql .= " v.datev,";
256  $sql .= " v.sens,";
257  $sql .= " v.amount,";
258  $sql .= " v.fk_typepayment,";
259  $sql .= " v.num_payment,";
260  $sql .= " v.label,";
261  $sql .= " v.note,";
262  $sql .= " v.accountancy_code,";
263  $sql .= " v.subledger_account,";
264  $sql .= " v.fk_projet as fk_project,";
265  $sql .= " v.fk_bank,";
266  $sql .= " v.fk_user_author,";
267  $sql .= " v.fk_user_modif,";
268  $sql .= " b.fk_account,";
269  $sql .= " b.fk_type,";
270  $sql .= " b.rappro";
271  $sql .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
272  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON v.fk_bank = b.rowid";
273  $sql .= " WHERE v.rowid = ".$id;
274 
275  dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
276  $resql = $this->db->query($sql);
277  if ($resql)
278  {
279  if ($this->db->num_rows($resql))
280  {
281  $obj = $this->db->fetch_object($resql);
282 
283  $this->id = $obj->rowid;
284  $this->ref = $obj->rowid;
285  $this->tms = $this->db->jdate($obj->tms);
286  $this->datep = $this->db->jdate($obj->datep);
287  $this->datev = $this->db->jdate($obj->datev);
288  $this->sens = $obj->sens;
289  $this->amount = $obj->amount;
290  $this->type_payment = $obj->fk_typepayment;
291  $this->num_payment = $obj->num_payment;
292  $this->label = $obj->label;
293  $this->note = $obj->note;
294  $this->subledger_account = $obj->subledger_account;
295  $this->accountancy_code = $obj->accountancy_code;
296  $this->fk_project = $obj->fk_project;
297  $this->fk_bank = $obj->fk_bank;
298  $this->fk_user_author = $obj->fk_user_author;
299  $this->fk_user_modif = $obj->fk_user_modif;
300  $this->fk_account = $obj->fk_account;
301  $this->fk_type = $obj->fk_type;
302  $this->rappro = $obj->rappro;
303  }
304  $this->db->free($resql);
305 
306  return 1;
307  } else {
308  $this->error = "Error ".$this->db->lasterror();
309  return -1;
310  }
311  }
312 
313 
320  public function delete($user)
321  {
322  global $conf, $langs;
323 
324  $error = 0;
325 
326  // Call trigger
327  $result = $this->call_trigger('PAYMENT_VARIOUS_DELETE', $user);
328  if ($result < 0) return -1;
329  // End call triggers
330 
331 
332  $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_various";
333  $sql .= " WHERE rowid=".$this->id;
334 
335  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
336  $resql = $this->db->query($sql);
337  if (!$resql) {
338  $this->error = "Error ".$this->db->lasterror();
339  return -1;
340  }
341 
342  return 1;
343  }
344 
345 
353  public function initAsSpecimen()
354  {
355  $this->id = 0;
356 
357  $this->tms = '';
358  $this->datep = '';
359  $this->datev = '';
360  $this->sens = '';
361  $this->amount = '';
362  $this->label = '';
363  $this->accountancy_code = '';
364  $this->subledger_account = '';
365  $this->note = '';
366  $this->fk_bank = '';
367  $this->fk_user_author = '';
368  $this->fk_user_modif = '';
369  }
370 
376  public function check()
377  {
378  $newamount = price2num($this->amount, 'MT');
379 
380  // Validation of parameters
381  if (!($newamount) > 0 || empty($this->datep)) {
382  return false;
383  }
384 
385  return true;
386  }
387 
394  public function create($user)
395  {
396  global $conf, $langs;
397 
398  $error = 0;
399  $now = dol_now();
400 
401  // Clean parameters
402  $this->amount = price2num(trim($this->amount));
403  $this->label = trim($this->label);
404  $this->note = trim($this->note);
405  $this->fk_bank = (int) $this->fk_bank;
406  $this->fk_user_author = (int) $this->fk_user_author;
407  $this->fk_user_modif = (int) $this->fk_user_modif;
408  $this->fk_account = (int) $this->fk_account;
409  if (empty($this->fk_account) && isset($this->accountid)) { // For compatibility
410  $this->fk_account = $this->accountid;
411  }
412 
413  // Check parameters
414  if (!$this->label)
415  {
416  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
417  return -3;
418  }
419  if ($this->amount < 0 || $this->amount == '')
420  {
421  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
422  return -5;
423  }
424  if (!empty($conf->banque->enabled) && (empty($this->fk_account) || $this->fk_account <= 0))
425  {
426  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount"));
427  return -6;
428  }
429  if (!empty($conf->banque->enabled) && (empty($this->type_payment)))
430  {
431  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
432  return -7;
433  }
434 
435  $this->db->begin();
436 
437  // Insert into llx_payment_various
438  $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_various (";
439  $sql .= " datep";
440  $sql .= ", datev";
441  $sql .= ", sens";
442  $sql .= ", amount";
443  $sql .= ", fk_typepayment";
444  $sql .= ", num_payment";
445  if ($this->note) $sql .= ", note";
446  $sql .= ", label";
447  $sql .= ", accountancy_code";
448  $sql .= ", subledger_account";
449  $sql .= ", fk_projet";
450  $sql .= ", fk_user_author";
451  $sql .= ", datec";
452  $sql .= ", fk_bank";
453  $sql .= ", entity";
454  $sql .= ")";
455  $sql .= " VALUES (";
456  $sql .= "'".$this->db->idate($this->datep)."'";
457  $sql .= ", '".$this->db->idate($this->datev)."'";
458  $sql .= ", '".$this->db->escape($this->sens)."'";
459  $sql .= ", ".price2num($this->amount);
460  $sql .= ", '".$this->db->escape($this->type_payment)."'";
461  $sql .= ", '".$this->db->escape($this->num_payment)."'";
462  if ($this->note) $sql .= ", '".$this->db->escape($this->note)."'";
463  $sql .= ", '".$this->db->escape($this->label)."'";
464  $sql .= ", '".$this->db->escape($this->accountancy_code)."'";
465  $sql .= ", '".$this->db->escape($this->subledger_account)."'";
466  $sql .= ", ".($this->fk_project > 0 ? $this->fk_project : 0);
467  $sql .= ", ".$user->id;
468  $sql .= ", '".$this->db->idate($now)."'";
469  $sql .= ", NULL"; // Filled later
470  $sql .= ", ".$conf->entity;
471  $sql .= ")";
472 
473  dol_syslog(get_class($this)."::create", LOG_DEBUG);
474  $result = $this->db->query($sql);
475  if ($result)
476  {
477  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_various");
478  $this->ref = $this->id;
479 
480  if ($this->id > 0)
481  {
482  if (!empty($conf->banque->enabled) && !empty($this->amount))
483  {
484  // Insert into llx_bank
485  require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
486 
487  $acc = new Account($this->db);
488  $result = $acc->fetch($this->fk_account);
489  if ($result <= 0) dol_print_error($this->db);
490 
491  // Insert payment into llx_bank
492  // Add link 'payment_various' in bank_url between payment and bank transaction
493  $sign = 1;
494  if ($this->sens == '0') $sign = -1;
495 
496  $bank_line_id = $acc->addline(
497  $this->datep,
498  $this->type_payment,
499  $this->label,
500  $sign * abs($this->amount),
501  $this->num_payment,
502  ($this->category_transaction > 0 ? $this->category_transaction : 0),
503  $user,
504  $this->chqemetteur,
505  $this->chqbank,
506  '',
507  $this->datev
508  );
509 
510  // Update fk_bank into llx_payment_various
511  // So we know the payment which has generate the banking ecriture
512  if ($bank_line_id > 0) {
513  $this->update_fk_bank($bank_line_id);
514  } else {
515  $this->error = $acc->error;
516  $error++;
517  }
518 
519  if (!$error)
520  {
521  // Add link 'payment_various' in bank_url between payment and bank transaction
522  $url = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id=';
523 
524  $result = $acc->add_url_line($bank_line_id, $this->id, $url, "(VariousPayment)", "payment_various");
525  if ($result <= 0)
526  {
527  $this->error = $acc->error;
528  $error++;
529  }
530  }
531 
532  if ($result <= 0)
533  {
534  $this->error = $acc->error;
535  $error++;
536  }
537  }
538 
539  // Call trigger
540  $result = $this->call_trigger('PAYMENT_VARIOUS_CREATE', $user);
541  if ($result < 0) $error++;
542  // End call triggers
543  } else $error++;
544 
545  if (!$error)
546  {
547  $this->db->commit();
548  return $this->id;
549  } else {
550  $this->db->rollback();
551  return -2;
552  }
553  } else {
554  $this->error = $this->db->error();
555  $this->db->rollback();
556  return -1;
557  }
558  }
559 
560  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
567  public function update_fk_bank($id_bank)
568  {
569  // phpcs:enable
570  $sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_various SET fk_bank = '.$id_bank;
571  $sql .= ' WHERE rowid = '.$this->id;
572  $result = $this->db->query($sql);
573  if ($result)
574  {
575  return 1;
576  } else {
577  dol_print_error($this->db);
578  return -1;
579  }
580  }
581 
582 
589  public function getLibStatut($mode = 0)
590  {
591  return $this->LibStatut($this->statut, $mode);
592  }
593 
594  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
602  public function LibStatut($status, $mode = 0)
603  {
604  // phpcs:enable
605  global $langs;
606 
607  if ($mode == 0) {
608  return $langs->trans($this->statuts[$status]);
609  } elseif ($mode == 1) {
610  return $langs->trans($this->statuts_short[$status]);
611  } elseif ($mode == 2) {
612  if ($status == 0) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts_short[$status]);
613  elseif ($status == 1) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts_short[$status]);
614  elseif ($status == 2) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts_short[$status]);
615  } elseif ($mode == 3) {
616  if ($status == 0 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
617  elseif ($status == 1 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
618  elseif ($status == 2 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
619  } elseif ($mode == 4) {
620  if ($status == 0 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut0').' '.$langs->trans($this->statuts[$status]);
621  elseif ($status == 1 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut4').' '.$langs->trans($this->statuts[$status]);
622  elseif ($status == 2 && !empty($this->statuts_short[$status])) return img_picto($langs->trans($this->statuts_short[$status]), 'statut6').' '.$langs->trans($this->statuts[$status]);
623  } elseif ($mode == 5) {
624  if ($status == 0 && !empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut0');
625  elseif ($status == 1 && !empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut4');
626  elseif ($status == 2 && !empty($this->statuts_short[$status])) return $langs->trans($this->statuts_short[$status]).' '.img_picto($langs->trans($this->statuts_short[$status]), 'statut6');
627  }
628  }
629 
630 
641  public function getNomUrl($withpicto = 0, $option = '', $save_lastsearch_value = -1, $notooltip = 0, $morecss = '')
642  {
643  global $db, $conf, $langs, $hookmanager;
644  global $langs;
645 
646  if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
647 
648  $result = '';
649 
650  $label = '<u>'.$langs->trans("ShowVariousPayment").'</u>';
651  $label .= '<br>';
652  $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
653 
654  $url = DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$this->id;
655 
656  if ($option != 'nolink')
657  {
658  // Add param to save lastsearch_values or not
659  $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
660  if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
661  if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
662  }
663 
664  $linkclose = '';
665  if (empty($notooltip))
666  {
667  if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
668  {
669  $label = $langs->trans("ShowMyObject");
670  $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
671  }
672  $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
673  $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
674 
675  /*
676  $hookmanager->initHooks(array('myobjectdao'));
677  $parameters=array('id'=>$this->id);
678  $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
679  if ($reshook > 0) $linkclose = $hookmanager->resPrint;
680  */
681  } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
682 
683  $linkstart = '<a href="'.$url.'"';
684  $linkstart .= $linkclose.'>';
685  $linkend = '</a>';
686 
687  $result .= $linkstart;
688  if ($withpicto) $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);
689  if ($withpicto != 2) $result .= $this->ref;
690  $result .= $linkend;
691  //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
692 
693  global $action;
694  $hookmanager->initHooks(array('variouspayment'));
695  $parameters = array('id'=>$this->id, 'getnomurl'=>$result);
696  $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
697  if ($reshook > 0) $result = $hookmanager->resPrint;
698  else $result .= $hookmanager->resPrint;
699 
700  return $result;
701  }
702 
709  public function info($id)
710  {
711  $sql = 'SELECT v.rowid, v.datec, v.fk_user_author';
712  $sql .= ' FROM '.MAIN_DB_PREFIX.'payment_various as v';
713  $sql .= ' WHERE v.rowid = '.$id;
714 
715  dol_syslog(get_class($this).'::info', LOG_DEBUG);
716  $result = $this->db->query($sql);
717 
718  if ($result)
719  {
720  if ($this->db->num_rows($result))
721  {
722  $obj = $this->db->fetch_object($result);
723  $this->id = $obj->rowid;
724  if ($obj->fk_user_author)
725  {
726  $cuser = new User($this->db);
727  $cuser->fetch($obj->fk_user_author);
728  $this->user_creation = $cuser;
729  }
730  $this->date_creation = $this->db->jdate($obj->datec);
731  if ($obj->fk_user_modif)
732  {
733  $muser = new User($this->db);
734  $muser->fetch($obj->fk_user_modif);
735  $this->user_modif = $muser;
736  }
737  $this->date_modif = $this->db->jdate($obj->tms);
738  }
739  $this->db->free($result);
740  } else {
741  dol_print_error($this->db);
742  }
743  }
744 
750  public function getVentilExportCompta()
751  {
752  $banklineid = $this->fk_bank;
753 
754  $alreadydispatched = 0;
755 
756  $type = 'bank';
757 
758  $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 = ".$banklineid;
759  $resql = $this->db->query($sql);
760  if ($resql)
761  {
762  $obj = $this->db->fetch_object($resql);
763  if ($obj)
764  {
765  $alreadydispatched = $obj->nb;
766  }
767  } else {
768  $this->error = $this->db->lasterror();
769  return -1;
770  }
771 
772  if ($alreadydispatched)
773  {
774  return 1;
775  }
776  return 0;
777  }
778 }
__construct($db)
Constructor.
Class to manage various payments.
if(!empty($arrayfields['u.datec']['checked'])) print_liste_field_titre("DateCreationShort"u if(!empty($arrayfields['u.tms']['checked'])) print_liste_field_titre("DateModificationShort"u if(!empty($arrayfields['u.statut']['checked'])) print_liste_field_titre("Status"u statut
Definition: list.php:632
dol_now($mode= 'auto')
Return date for now.
fetch($id, $user=null)
Load object in memory from database.
Class to manage Dolibarr users.
Definition: user.class.php:44
update_fk_bank($id_bank)
Update link between payment various and line generate into llx_bank.
$conf db
API class for accounts.
Definition: inc.php:54
Class to manage bank accounts.
getVentilExportCompta()
Return if a various payment linked to a bank line id was dispatched into bookkeeping.
check()
Check if a miscellaneous payment can be created into database.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is &#39;...
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it&#39;s its name (generic function)
initAsSpecimen()
Initialise an instance with random values.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
print $_SERVER["PHP_SELF"]
Edit parameters.
info($id)
Information on record.
LibStatut($status, $mode=0)
Renvoi le libelle d&#39;un statut donne.
call_trigger($triggerName, $user)
Call trigger based on this instance.
getNomUrl($withpicto=0, $option= '', $save_lastsearch_value=-1, $notooltip=0, $morecss= '')
Send name clicable (with possibly the picto)
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getLibStatut($mode=0)
Retourne le libelle du statut.
Parent class of all other business classes (invoices, contracts, proposals, orders, ...)
if(!empty($search_group)) natural_search(array("g.nom"g note
Definition: list.php:122
create($user)
Create in database.
update($user=null, $notrigger=0)
Update database.