dolibarr  13.0.2
paymentsalary.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2011-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
3  * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
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 = 'payment_salary';
38 
42  public $table_element = 'payment_salary';
43 
47  public $picto = 'payment';
48 
49  public $tms;
50 
54  public $fk_user;
55 
56  public $datep;
57  public $datev;
58  public $amount;
59 
63  public $fk_project;
64 
65  public $type_payment;
66  public $num_payment;
67 
71  public $label;
72 
73  public $datesp;
74  public $dateep;
75 
79  public $fk_bank;
80 
84  public $fk_user_author;
85 
89  public $fk_user_modif;
90 
94  public $fields = array();
95 
96 
102  public function __construct($db)
103  {
104  $this->db = $db;
105  $this->element = 'payment_salary';
106  $this->table_element = 'payment_salary';
107  }
108 
116  public function update($user = null, $notrigger = 0)
117  {
118  global $conf, $langs;
119 
120  $error = 0;
121 
122  // Clean parameters
123  $this->amount = trim($this->amount);
124  $this->label = trim($this->label);
125  $this->note = trim($this->note);
126 
127  // Check parameters
128  if (empty($this->fk_user) || $this->fk_user < 0)
129  {
130  $this->error = 'ErrorBadParameter';
131  return -1;
132  }
133 
134  $this->db->begin();
135 
136  // Update request
137  $sql = "UPDATE ".MAIN_DB_PREFIX."payment_salary SET";
138 
139  $sql .= " tms='".$this->db->idate($this->tms)."',";
140  $sql .= " fk_user=".$this->fk_user.",";
141  $sql .= " datep='".$this->db->idate($this->datep)."',";
142  $sql .= " datev='".$this->db->idate($this->datev)."',";
143  $sql .= " amount=".price2num($this->amount).",";
144  $sql .= " fk_projet=".((int) $this->fk_project).",";
145  $sql .= " fk_typepayment=".$this->fk_typepayment."',";
146  $sql .= " num_payment='".$this->db->escape($this->num_payment)."',";
147  $sql .= " label='".$this->db->escape($this->label)."',";
148  $sql .= " datesp='".$this->db->idate($this->datesp)."',";
149  $sql .= " dateep='".$this->db->idate($this->dateep)."',";
150  $sql .= " note='".$this->db->escape($this->note)."',";
151  $sql .= " fk_bank=".($this->fk_bank > 0 ? (int) $this->fk_bank : "null").",";
152  $sql .= " fk_user_author=".((int) $this->fk_user_author).",";
153  $sql .= " fk_user_modif=".($this->fk_user_modif > 0 ? (int) $this->fk_user_modif : 'null');
154 
155  $sql .= " WHERE rowid=".$this->id;
156 
157  dol_syslog(get_class($this)."::update", LOG_DEBUG);
158  $resql = $this->db->query($sql);
159  if (!$resql)
160  {
161  $this->error = "Error ".$this->db->lasterror();
162  return -1;
163  }
164 
165  // Update extrafield
166  if (!$error)
167  {
168  if (!$error)
169  {
170  $result = $this->insertExtraFields();
171  if ($result < 0)
172  {
173  $error++;
174  }
175  }
176  }
177 
178  if (!$notrigger)
179  {
180  // Call trigger
181  $result = $this->call_trigger('PAYMENT_SALARY_MODIFY', $user);
182  if ($result < 0) $error++;
183  // End call triggers
184  }
185 
186  if (!$error)
187  {
188  $this->db->commit();
189  return 1;
190  } else {
191  $this->db->rollback();
192  return -1;
193  }
194  }
195 
196 
204  public function fetch($id, $user = null)
205  {
206  global $langs;
207  $sql = "SELECT";
208  $sql .= " s.rowid,";
209 
210  $sql .= " s.tms,";
211  $sql .= " s.fk_user,";
212  $sql .= " s.datep,";
213  $sql .= " s.datev,";
214  $sql .= " s.amount,";
215  $sql .= " s.fk_projet as fk_project,";
216  $sql .= " s.fk_typepayment,";
217  $sql .= " s.num_payment,";
218  $sql .= " s.label,";
219  $sql .= " s.datesp,";
220  $sql .= " s.dateep,";
221  $sql .= " s.note,";
222  $sql .= " s.fk_bank,";
223  $sql .= " s.fk_user_author,";
224  $sql .= " s.fk_user_modif,";
225  $sql .= " b.fk_account,";
226  $sql .= " b.fk_type,";
227  $sql .= " b.rappro";
228 
229  $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
230  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON s.fk_bank = b.rowid";
231  $sql .= " WHERE s.rowid = ".$id;
232 
233  dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
234  $resql = $this->db->query($sql);
235  if ($resql)
236  {
237  if ($this->db->num_rows($resql))
238  {
239  $obj = $this->db->fetch_object($resql);
240 
241  $this->id = $obj->rowid;
242  $this->ref = $obj->rowid;
243  $this->tms = $this->db->jdate($obj->tms);
244  $this->fk_user = $obj->fk_user;
245  $this->datep = $this->db->jdate($obj->datep);
246  $this->datev = $this->db->jdate($obj->datev);
247  $this->amount = $obj->amount;
248  $this->fk_project = $obj->fk_project;
249  $this->type_payement = $obj->fk_typepayment;
250  $this->num_payment = $obj->num_payment;
251  $this->label = $obj->label;
252  $this->datesp = $this->db->jdate($obj->datesp);
253  $this->dateep = $this->db->jdate($obj->dateep);
254  $this->note = $obj->note;
255  $this->fk_bank = $obj->fk_bank;
256  $this->fk_user_author = $obj->fk_user_author;
257  $this->fk_user_modif = $obj->fk_user_modif;
258  $this->fk_account = $obj->fk_account;
259  $this->fk_type = $obj->fk_type;
260  $this->rappro = $obj->rappro;
261 
262  // Retrieve all extrafield
263  // fetch optionals attributes and labels
264  $this->fetch_optionals();
265  }
266  $this->db->free($resql);
267 
268  return 1;
269  } else {
270  $this->error = "Error ".$this->db->lasterror();
271  return -1;
272  }
273  }
274 
275 
282  public function delete($user)
283  {
284  global $conf, $langs;
285 
286  $error = 0;
287 
288  // Call trigger
289  $result = $this->call_trigger('PAYMENT_SALARY_DELETE', $user);
290  if ($result < 0) return -1;
291  // End call triggers
292 
293  // Delete donation
294  if (!$error)
295  {
296  $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary_extrafields";
297  $sql .= " WHERE fk_object=".$this->id;
298 
299  $resql = $this->db->query($sql);
300  if (!$resql)
301  {
302  $this->errors[] = $this->db->lasterror();
303  $error++;
304  }
305  }
306 
307  $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary";
308  $sql .= " WHERE rowid=".$this->id;
309 
310  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
311  $resql = $this->db->query($sql);
312  if (!$resql)
313  {
314  $this->error = "Error ".$this->db->lasterror();
315  return -1;
316  }
317 
318  return 1;
319  }
320 
321 
329  public function initAsSpecimen()
330  {
331  $this->id = 0;
332 
333  $this->tms = '';
334  $this->fk_user = '';
335  $this->datep = '';
336  $this->datev = '';
337  $this->amount = '';
338  $this->label = '';
339  $this->datesp = '';
340  $this->dateep = '';
341  $this->note = '';
342  $this->fk_bank = '';
343  $this->fk_user_author = '';
344  $this->fk_user_modif = '';
345  }
346 
353  public function create($user)
354  {
355  global $conf, $langs;
356 
357  $error = 0;
358  $now = dol_now();
359 
360  // Clean parameters
361  $this->amount = price2num(trim($this->amount));
362  $this->label = trim($this->label);
363  $this->note = trim($this->note);
364  $this->fk_bank = trim($this->fk_bank);
365  $this->fk_user_author = trim($this->fk_user_author);
366  $this->fk_user_modif = trim($this->fk_user_modif);
367 
368  // Check parameters
369  if (!$this->label)
370  {
371  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label"));
372  return -3;
373  }
374  if ($this->fk_user < 0 || $this->fk_user == '')
375  {
376  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Employee"));
377  return -4;
378  }
379  if ($this->amount < 0 || $this->amount == '')
380  {
381  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount"));
382  return -5;
383  }
384  if (!empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0))
385  {
386  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Account"));
387  return -6;
388  }
389  if (!empty($conf->banque->enabled) && (empty($this->type_payment) || $this->type_payment <= 0))
390  {
391  $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode"));
392  return -7;
393  }
394 
395  $this->db->begin();
396 
397  // Insert into llx_payment_salary
398  $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_salary (fk_user";
399  $sql .= ", datep";
400  $sql .= ", datev";
401  $sql .= ", amount";
402  $sql .= ", fk_projet";
403  $sql .= ", salary";
404  $sql .= ", fk_typepayment";
405  $sql .= ", num_payment";
406  if ($this->note) $sql .= ", note";
407  $sql .= ", label";
408  $sql .= ", datesp";
409  $sql .= ", dateep";
410  $sql .= ", fk_user_author";
411  $sql .= ", datec";
412  $sql .= ", fk_bank";
413  $sql .= ", entity";
414  $sql .= ") ";
415  $sql .= " VALUES (";
416  $sql .= "'".$this->db->escape($this->fk_user)."'";
417  $sql .= ", '".$this->db->idate($this->datep)."'";
418  $sql .= ", '".$this->db->idate($this->datev)."'";
419  $sql .= ", ".$this->amount;
420  $sql .= ", ".($this->fk_project > 0 ? $this->fk_project : 0);
421  $sql .= ", ".($this->salary > 0 ? $this->salary : "null");
422  $sql .= ", ".$this->db->escape($this->type_payment);
423  $sql .= ", '".$this->db->escape($this->num_payment)."'";
424  if ($this->note) $sql .= ", '".$this->db->escape($this->note)."'";
425  $sql .= ", '".$this->db->escape($this->label)."'";
426  $sql .= ", '".$this->db->idate($this->datesp)."'";
427  $sql .= ", '".$this->db->idate($this->dateep)."'";
428  $sql .= ", '".$this->db->escape($user->id)."'";
429  $sql .= ", '".$this->db->idate($now)."'";
430  $sql .= ", NULL";
431  $sql .= ", ".$conf->entity;
432  $sql .= ")";
433 
434  dol_syslog(get_class($this)."::create", LOG_DEBUG);
435  $result = $this->db->query($sql);
436  if ($result)
437  {
438  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_salary");
439 
440  if ($this->id > 0)
441  {
442  if (!empty($conf->banque->enabled) && !empty($this->amount))
443  {
444  // Insert into llx_bank
445  require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
446 
447  $acc = new Account($this->db);
448  $result = $acc->fetch($this->accountid);
449  if ($result <= 0) dol_print_error($this->db);
450 
451  // Update extrafield
452  if (!$error) {
453  if (!$error)
454  {
455  $result = $this->insertExtraFields();
456  if ($result < 0)
457  {
458  $error++;
459  }
460  }
461  }
462 
463  // Insert payment into llx_bank
464  // Add link 'payment_salary' in bank_url between payment and bank transaction
465  $bank_line_id = $acc->addline(
466  $this->datep,
467  $this->type_payment,
468  $this->label,
469  -abs($this->amount),
470  $this->num_payment,
471  '',
472  $user,
473  '',
474  '',
475  '',
476  $this->datev
477  );
478 
479  // Update fk_bank into llx_paiement.
480  // So we know the payment which has generate the banking ecriture
481  if ($bank_line_id > 0)
482  {
483  $this->update_fk_bank($bank_line_id);
484  } else {
485  $this->error = $acc->error;
486  $error++;
487  }
488 
489  if (!$error)
490  {
491  // Add link 'payment_salary' in bank_url between payment and bank transaction
492  $url = DOL_URL_ROOT.'/salaries/card.php?id=';
493 
494  $result = $acc->add_url_line($bank_line_id, $this->id, $url, "(SalaryPayment)", "payment_salary");
495  if ($result <= 0)
496  {
497  $this->error = $acc->error;
498  $error++;
499  }
500  }
501 
502  $fuser = new User($this->db);
503  $fuser->fetch($this->fk_user);
504 
505  // Add link 'user' in bank_url between operation and bank transaction
506  $result = $acc->add_url_line(
507  $bank_line_id,
508  $this->fk_user,
509  DOL_URL_ROOT.'/user/card.php?id=',
510  $fuser->getFullName($langs),
511  // $langs->trans("SalaryPayment").' '.$fuser->getFullName($langs).' '.dol_print_date($this->datesp,'dayrfc').' '.dol_print_date($this->dateep,'dayrfc'),
512  'user'
513  );
514 
515  if ($result <= 0)
516  {
517  $this->error = $acc->error;
518  $error++;
519  }
520  }
521 
522  // Call trigger
523  $result = $this->call_trigger('PAYMENT_SALARY_CREATE', $user);
524  if ($result < 0) $error++;
525  // End call triggers
526  } else $error++;
527 
528  if (!$error)
529  {
530  $this->db->commit();
531  return $this->id;
532  } else {
533  $this->db->rollback();
534  return -2;
535  }
536  } else {
537  $this->error = $this->db->error();
538  $this->db->rollback();
539  return -1;
540  }
541  }
542 
543  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
550  public function update_fk_bank($id_bank)
551  {
552  // phpcs:enable
553  $sql = 'UPDATE '.MAIN_DB_PREFIX.'payment_salary SET fk_bank = '.$id_bank;
554  $sql .= ' WHERE rowid = '.$this->id;
555  $result = $this->db->query($sql);
556  if ($result)
557  {
558  return 1;
559  } else {
560  dol_print_error($this->db);
561  return -1;
562  }
563  }
564 
565 
576  public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
577  {
578  global $db, $conf, $langs, $hookmanager;
579  global $dolibarr_main_authentication, $dolibarr_main_demo;
580  global $menumanager;
581 
582  if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips
583 
584  $result = '';
585 
586  $label = img_picto('', $this->picto).' <u>'.$langs->trans("SalaryPayment").'</u>';
587  $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
588  if (!empty($this->label)) {
589  $labeltoshow = $this->label;
590  $reg = array();
591  if (preg_match('/^\((.*)\)$/i', $this->label, $reg))
592  {
593  // Label generique car entre parentheses. On l'affiche en le traduisant
594  if ($reg[1] == 'paiement') $reg[1] = 'Payment';
595  $labeltoshow = $langs->trans($reg[1]);
596  }
597  $label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
598  }
599 
600  $url = DOL_URL_ROOT.'/salaries/card.php?id='.$this->id;
601 
602  if ($option != 'nolink')
603  {
604  // Add param to save lastsearch_values or not
605  $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
606  if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) $add_save_lastsearch_values = 1;
607  if ($add_save_lastsearch_values) $url .= '&save_lastsearch_values=1';
608  }
609 
610  $linkclose = '';
611  if (empty($notooltip))
612  {
613  if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
614  {
615  $label = $langs->trans("ShowMyObject");
616  $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
617  }
618  $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
619  $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
620 
621  /*
622  $hookmanager->initHooks(array('myobjectdao'));
623  $parameters=array('id'=>$this->id);
624  $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
625  if ($reshook > 0) $linkclose = $hookmanager->resPrint;
626  */
627  } else $linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
628 
629  $linkstart = '<a href="'.$url.'"';
630  $linkstart .= $linkclose.'>';
631  $linkend = '</a>';
632 
633  $result .= $linkstart;
634  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);
635  if ($withpicto != 2) $result .= $this->ref;
636  $result .= $linkend;
637  //if ($withpicto != 2) $result.=(($addlabel && $this->label) ? $sep . dol_trunc($this->label, ($addlabel > 1 ? $addlabel : 0)) : '');
638 
639  global $action, $hookmanager;
640  $hookmanager->initHooks(array('salarypayment'));
641  $parameters = array('id'=>$this->id, 'getnomurl'=>$result);
642  $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
643  if ($reshook > 0) $result = $hookmanager->resPrint;
644  else $result .= $hookmanager->resPrint;
645 
646  return $result;
647  }
648 
655  public function info($id)
656  {
657  $sql = 'SELECT ps.rowid, ps.datec, ps.fk_user_author';
658  $sql .= ' FROM '.MAIN_DB_PREFIX.'payment_salary as ps';
659  $sql .= ' WHERE ps.rowid = '.$id;
660 
661  dol_syslog(get_class($this).'::info', LOG_DEBUG);
662  $result = $this->db->query($sql);
663 
664  if ($result)
665  {
666  if ($this->db->num_rows($result))
667  {
668  $obj = $this->db->fetch_object($result);
669  $this->id = $obj->rowid;
670  if ($obj->fk_user_author)
671  {
672  $cuser = new User($this->db);
673  $cuser->fetch($obj->fk_user_author);
674  $this->user_creation = $cuser;
675  }
676  $this->date_creation = $this->db->jdate($obj->datec);
677  }
678  $this->db->free($result);
679  } else {
680  dol_print_error($this->db);
681  }
682  }
683 
684 
691  public function getLibStatut($mode = 0)
692  {
693  return $this->LibStatut($this->statut, $mode);
694  }
695 
696  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
704  public function LibStatut($status, $mode = 0)
705  {
706  // phpcs:enable
707  global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
708 
709  $langs->load('compta');
710  /*if ($mode == 0)
711  {
712  if ($status == 0) return $langs->trans('ToValidate');
713  if ($status == 1) return $langs->trans('Validated');
714  }
715  if ($mode == 1)
716  {
717  if ($status == 0) return $langs->trans('ToValidate');
718  if ($status == 1) return $langs->trans('Validated');
719  }
720  if ($mode == 2)
721  {
722  if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
723  if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
724  }
725  if ($mode == 3)
726  {
727  if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1');
728  if ($status == 1) return img_picto($langs->trans('Validated'),'statut4');
729  }
730  if ($mode == 4)
731  {
732  if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
733  if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
734  }
735  if ($mode == 5)
736  {
737  if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
738  if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
739  }
740  if ($mode == 6)
741  {
742  if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
743  if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
744  }*/
745  return '';
746  }
747 }
create($user)
Create in database.
fetch($id, $user=null)
Load object in memory from database.
getLibStatut($mode=0)
Retourne le libelle du statut d&#39;une facture (brouillon, validee, abandonnee, payee) ...
Class to manage salary 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.
Class to manage Dolibarr users.
Definition: user.class.php:44
getNomUrl($withpicto=0, $option= '', $notooltip=0, $morecss= '', $save_lastsearch_value=-1)
Send name clicable (with possibly the picto)
update_fk_bank($id_bank)
Update link between payment salary and line generate into llx_bank.
$conf db
API class for accounts.
Definition: inc.php:54
Class to manage bank accounts.
insertExtraFields($trigger= '', $userused=null)
Add/Update all extra fields values for the current object.
__construct($db)
Constructor.
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)
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)
fetch_optionals($rowid=null, $optionsArray=null)
Function to get extra fields of an object into $this-&gt;array_options This method is in most cases call...
print $_SERVER["PHP_SELF"]
Edit parameters.
call_trigger($triggerName, $user)
Call trigger based on this instance.
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...
LibStatut($status, $mode=0)
Renvoi le libelle d&#39;un statut donne.
info($id)
Information on record.
initAsSpecimen()
Initialise an instance with random values.
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
update($user=null, $notrigger=0)
Update database.