dolibarr  16.0.5
paymentsalary.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2011-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
3  * Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
4  * Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.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 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 <https://www.gnu.org/licenses/>.
18  */
19 
26 // Put here all includes required by your class file
27 require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
28 require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
29 
30 
35 {
39  public $element = 'payment_salary';
40 
44  public $table_element = 'payment_salary';
45 
49  public $picto = 'payment';
50 
54  public $fk_salary;
55 
56  public $datec = '';
57  public $tms = '';
58  public $datep = '';
59 
64  public $total;
65 
66  public $amount; // Total amount of payment
67  public $amounts = array(); // Array of amounts
68 
72  public $fk_typepayment;
73 
78  public $num_paiement;
79 
83  public $num_payment;
84 
88  public $fk_bank;
89 
93  public $fk_user_author;
94 
98  public $fk_user_modif;
99 
103  public $fields = array(
104  'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
105  );
106 
112  public function __construct($db)
113  {
114  $this->db = $db;
115  }
116 
125  public function create($user, $closepaidcontrib = 0)
126  {
127  global $conf, $langs;
128 
129  $error = 0;
130 
131  $now = dol_now();
132 
133  dol_syslog(get_class($this)."::create", LOG_DEBUG);
134 
135  // Validate parametres
136  if (!$this->datepaye) {
137  $this->error = 'ErrorBadValueForParameterCreatePaymentSalary';
138  return -1;
139  }
140 
141  // Clean parameters
142  if (isset($this->fk_salary)) $this->fk_salary = (int) $this->fk_salary;
143  if (isset($this->amount)) $this->amount = trim($this->amount);
144  if (isset($this->fk_typepayment)) $this->fk_typepayment = (int) $this->fk_typepayment;
145  if (isset($this->num_paiement)) $this->num_paiement = trim($this->num_paiement); // deprecated
146  if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment);
147  if (isset($this->note)) $this->note = trim($this->note);
148  if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank;
149  if (isset($this->fk_user_author)) $this->fk_user_author = (int) $this->fk_user_author;
150  if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif;
151 
152  $totalamount = 0;
153  foreach ($this->amounts as $key => $value) { // How payment is dispatch
154  $newvalue = price2num($value, 'MT');
155  $this->amounts[$key] = $newvalue;
156  $totalamount += $newvalue;
157  }
158  $totalamount = price2num($totalamount);
159 
160  // Check parameters
161  if ($totalamount == 0) return -1; // On accepte les montants negatifs pour les rejets de prelevement mais pas null
162 
163 
164  $this->db->begin();
165 
166  if ($totalamount != 0) {
167  $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_salary (entity, fk_salary, datec, datep, amount,";
168  $sql .= " fk_typepayment, num_payment, note, fk_user_author, fk_bank)";
169  $sql .= " VALUES (".((int) $conf->entity).", ".((int) $this->chid).", '".$this->db->idate($now)."',";
170  $sql .= " '".$this->db->idate($this->datepaye)."',";
171  $sql .= " ".price2num($totalamount).",";
172  $sql .= " ".((int) $this->paiementtype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".((int) $user->id).",";
173  $sql .= " 0)";
174 
175  $resql = $this->db->query($sql);
176  if ($resql) {
177  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_salary");
178 
179  // Insere tableau des montants / factures
180  foreach ($this->amounts as $key => $amount) {
181  $contribid = $key;
182  if (is_numeric($amount) && $amount <> 0) {
183  $amount = price2num($amount);
184 
185  // If we want to closed payed invoices
186  if ($closepaidcontrib) {
187  $contrib = new Salary($this->db);
188  $contrib->fetch($contribid);
189  $paiement = $contrib->getSommePaiement();
190  //$creditnotes=$contrib->getSumCreditNotesUsed();
191  $creditnotes = 0;
192  //$deposits=$contrib->getSumDepositsUsed();
193  $deposits = 0;
194  $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
195  $remaintopay = price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT');
196  if ($remaintopay == 0) {
197  $result = $contrib->set_paid($user);
198  } else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing.");
199  }
200  }
201  }
202  } else {
203  $error++;
204  }
205  }
206 
207  $result = $this->call_trigger('PAYMENTSALARY_CREATE', $user);
208  if ($result < 0) $error++;
209 
210  if ($totalamount != 0 && !$error) {
211  $this->amount = $totalamount;
212  $this->total = $totalamount; // deprecated
213  $this->db->commit();
214  return $this->id;
215  } else {
216  $this->error = $this->db->error();
217  $this->db->rollback();
218  return -1;
219  }
220  }
221 
228  public function fetch($id)
229  {
230  global $langs;
231  $sql = "SELECT";
232  $sql .= " t.rowid,";
233  $sql .= " t.fk_salary,";
234  $sql .= " t.datec,";
235  $sql .= " t.tms,";
236  $sql .= " t.datep,";
237  $sql .= " t.amount,";
238  $sql .= " t.fk_typepayment,";
239  $sql .= " t.num_payment as num_payment,";
240  $sql .= " t.note,";
241  $sql .= " t.fk_bank,";
242  $sql .= " t.fk_user_author,";
243  $sql .= " t.fk_user_modif,";
244  $sql .= " pt.code as type_code, pt.libelle as type_label,";
245  $sql .= ' b.fk_account';
246  $sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as t LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id";
247  $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid';
248  $sql .= " WHERE t.rowid = ".((int) $id);
249  // TODO link on entity of tax;
250 
251  dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
252  $resql = $this->db->query($sql);
253  if ($resql) {
254  if ($this->db->num_rows($resql)) {
255  $obj = $this->db->fetch_object($resql);
256 
257  $this->id = $obj->rowid;
258  $this->ref = $obj->rowid;
259 
260  $this->fk_salary = $obj->fk_salary;
261  $this->datec = $this->db->jdate($obj->datec);
262  $this->tms = $this->db->jdate($obj->tms);
263  $this->datep = $this->db->jdate($obj->datep);
264  $this->amount = $obj->amount;
265  $this->fk_typepayment = $obj->fk_typepayment;
266  $this->num_paiement = $obj->num_payment;
267  $this->num_payment = $obj->num_payment;
268  $this->note = $obj->note;
269  $this->fk_bank = $obj->fk_bank;
270  $this->fk_user_author = $obj->fk_user_author;
271  $this->fk_user_modif = $obj->fk_user_modif;
272 
273  $this->type_code = $obj->type_code;
274  $this->type_label = $obj->type_label;
275 
276  $this->bank_account = $obj->fk_account;
277  $this->bank_line = $obj->fk_bank;
278  }
279  $this->db->free($resql);
280 
281  return 1;
282  } else {
283  $this->error = "Error ".$this->db->lasterror();
284  return -1;
285  }
286  }
287 
288 
296  public function update($user = null, $notrigger = 0)
297  {
298  global $conf, $langs;
299  $error = 0;
300 
301  // Clean parameters
302 
303  if (isset($this->fk_salary)) $this->fk_salary = (int) $this->fk_salary;
304  if (isset($this->amount)) $this->amount = trim($this->amount);
305  if (isset($this->fk_typepayment)) $this->fk_typepayment = (int) $this->fk_typepayment;
306  if (isset($this->num_paiement)) $this->num_paiement = trim($this->num_paiement); // deprecated
307  if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment);
308  if (isset($this->note)) $this->note = trim($this->note);
309  if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank;
310  if (isset($this->fk_user_author)) $this->fk_user_author = (int) $this->fk_user_author;
311  if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif;
312 
313  // Check parameters
314  // Put here code to add control on parameters values
315 
316  // Update request
317  $sql = "UPDATE ".MAIN_DB_PREFIX."payment_salary SET";
318  $sql .= " fk_salary=".(isset($this->fk_salary) ? $this->fk_salary : "null").",";
319  $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
320  $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
321  $sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
322  $sql .= " amount=".(isset($this->amount) ? $this->amount : "null").",";
323  $sql .= " fk_typepayment=".(isset($this->fk_typepayment) ? $this->fk_typepayment : "null").",";
324  $sql .= " num_payment=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").",";
325  $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").",";
326  $sql .= " fk_bank=".(isset($this->fk_bank) ? $this->fk_bank : "null").",";
327  $sql .= " fk_user_author=".(isset($this->fk_user_author) ? $this->fk_user_author : "null").",";
328  $sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? $this->fk_user_modif : "null")."";
329  $sql .= " WHERE rowid=".((int) $this->id);
330 
331  $this->db->begin();
332 
333  dol_syslog(get_class($this)."::update", LOG_DEBUG);
334  $resql = $this->db->query($sql);
335  if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
336 
337  // Commit or rollback
338  if ($error) {
339  foreach ($this->errors as $errmsg) {
340  dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
341  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
342  }
343  $this->db->rollback();
344  return -1 * $error;
345  } else {
346  $this->db->commit();
347  return 1;
348  }
349  }
350 
351 
359  public function delete($user, $notrigger = 0)
360  {
361  global $conf, $langs;
362  $error = 0;
363 
364  dol_syslog(get_class($this)."::delete");
365 
366  $this->db->begin();
367 
368  if ($this->bank_line > 0) {
369  $accline = new AccountLine($this->db);
370  $accline->fetch($this->bank_line);
371  $result = $accline->delete();
372  if ($result < 0) {
373  $this->errors[] = $accline->error;
374  $error++;
375  }
376  }
377 
378  if (!$error) {
379  $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_salary";
380  $sql .= " WHERE rowid=".((int) $this->id);
381 
382  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
383  $resql = $this->db->query($sql);
384  if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
385  }
386 
387  // Commit or rollback
388  if ($error) {
389  foreach ($this->errors as $errmsg) {
390  dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
391  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
392  }
393  $this->db->rollback();
394  return -1 * $error;
395  } else {
396  $this->db->commit();
397  return 1;
398  }
399  }
400 
401 
402 
410  public function createFromClone(User $user, $fromid)
411  {
412  $error = 0;
413 
414  $object = new PaymentSalary($this->db);
415 
416  $this->db->begin();
417 
418  // Load source object
419  $object->fetch($fromid);
420  $object->id = 0;
421  $object->statut = 0;
422 
423  // Clear fields
424  // ...
425 
426  // Create clone
427  $object->context['createfromclone'] = 'createfromclone';
428  $result = $object->create($user);
429 
430  // Other options
431  if ($result < 0) {
432  $this->error = $object->error;
433  $error++;
434  }
435 
436  unset($object->context['createfromclone']);
437 
438  // End
439  if (!$error) {
440  $this->db->commit();
441  return $object->id;
442  } else {
443  $this->db->rollback();
444  return -1;
445  }
446  }
447 
448 
456  public function initAsSpecimen()
457  {
458  $this->id = 0;
459 
460  $this->fk_salary = '';
461  $this->datec = '';
462  $this->tms = '';
463  $this->datep = '';
464  $this->amount = '';
465  $this->fk_typepayment = '';
466  $this->num_payment = '';
467  $this->note_private = '';
468  $this->note_public = '';
469  $this->fk_bank = '';
470  $this->fk_user_author = '';
471  $this->fk_user_modif = '';
472  }
473 
474 
487  public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
488  {
489  global $conf, $langs;
490 
491  // Clean data
492  $this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement);
493 
494  $error = 0;
495 
496  if (isModEnabled('banque')) {
497  include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
498 
499  $acc = new Account($this->db);
500  $acc->fetch($accountid);
501 
502  $total = $this->amount;
503 
504  // Insert payment into llx_bank
505  $bank_line_id = $acc->addline(
506  $this->datepaye,
507  $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example")
508  $label,
509  -$total,
510  $this->num_payment,
511  '',
512  $user,
513  $emetteur_nom,
514  $emetteur_banque,
515  '',
516  $this->datev
517  );
518 
519  // Update fk_bank into llx_paiement_salary.
520  // so we know the payment that was used to generated the bank entry.
521  if ($bank_line_id > 0) {
522  $result = $this->update_fk_bank($bank_line_id);
523  if ($result <= 0) {
524  $error++;
525  dol_print_error($this->db);
526  }
527 
528  // Add link 'payment_salary' in bank_url between payment and bank transaction
529  $url = '';
530  if ($mode == 'payment_salary') {
531  $url = DOL_URL_ROOT.'/salaries/payment_salary/card.php?id=';
532  }
533 
534  if ($url) {
535  $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
536  if ($result <= 0) {
537  $error++;
538  dol_print_error($this->db);
539  }
540  }
541 
542  // Add link 'user' in bank_url between user and bank transaction
543  foreach ($this->amounts as $key => $value) {
544  if (!$error) {
545  if ($mode == 'payment_salary') {
546  $salary = new Salary($this->db);
547  $salary->fetch($key);
548  $salary->fetch_user($salary->fk_user);
549 
550  $fuser = $salary->user;
551 
552  if ($fuser->id > 0) {
553  $result = $acc->add_url_line(
554  $bank_line_id,
555  $fuser->id,
556  DOL_URL_ROOT.'/user/card.php?id=',
557  $fuser->getFullName($langs),
558  'user'
559  );
560  }
561  if ($result <= 0) {
562  $this->error = $this->db->lasterror();
563  dol_syslog(get_class($this) . '::addPaymentToBank ' . $this->error);
564  $error++;
565  }
566  }
567  }
568  }
569  } else {
570  $this->error = $acc->error;
571  $error++;
572  }
573  }
574 
575  if (!$error) {
576  return 1;
577  } else {
578  return -1;
579  }
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_salary SET fk_bank = ".((int) $id_bank)." WHERE rowid = ".((int) $this->id);
594 
595  dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
596  $result = $this->db->query($sql);
597  if ($result) {
598  return 1;
599  } else {
600  $this->error = $this->db->error();
601  return 0;
602  }
603  }
604 
605 
612  public function getLibStatut($mode = 0)
613  {
614  return $this->LibStatut($this->statut, $mode);
615  }
616 
617  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
625  public function LibStatut($status, $mode = 0)
626  {
627  // phpcs:enable
628  global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
629 
630  $langs->load('compta');
631  /*if ($mode == 0)
632  {
633  if ($status == 0) return $langs->trans('ToValidate');
634  if ($status == 1) return $langs->trans('Validated');
635  }
636  if ($mode == 1)
637  {
638  if ($status == 0) return $langs->trans('ToValidate');
639  if ($status == 1) return $langs->trans('Validated');
640  }
641  if ($mode == 2)
642  {
643  if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
644  if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
645  }
646  if ($mode == 3)
647  {
648  if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1');
649  if ($status == 1) return img_picto($langs->trans('Validated'),'statut4');
650  }
651  if ($mode == 4)
652  {
653  if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
654  if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
655  }
656  if ($mode == 5)
657  {
658  if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
659  if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
660  }
661  if ($mode == 6)
662  {
663  if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
664  if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
665  }*/
666  return '';
667  }
668 
676  public function getNomUrl($withpicto = 0, $maxlen = 0)
677  {
678  global $langs;
679 
680  $result = '';
681 
682  if (empty($this->ref)) $this->ref = $this->lib;
683 
684  $label = img_picto('', $this->picto).' <u>'.$langs->trans("SalaryPayment").'</u>';
685  $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
686  if (!empty($this->label)) {
687  $labeltoshow = $this->label;
688  $reg = array();
689  if (preg_match('/^\((.*)\)$/i', $this->label, $reg)) {
690  // Label generique car entre parentheses. On l'affiche en le traduisant
691  if ($reg[1] == 'paiement') $reg[1] = 'Payment';
692  $labeltoshow = $langs->trans($reg[1]);
693  }
694  $label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
695  }
696  if ($this->datep) {
697  $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'day');
698  }
699 
700  if (!empty($this->id)) {
701  $link = '<a href="'.DOL_URL_ROOT.'/salaries/payment_salary/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
702  $linkend = '</a>';
703 
704  if ($withpicto) $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
705  if ($withpicto && $withpicto != 2) $result .= ' ';
706  if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
707  }
708 
709  return $result;
710  }
711 }
PaymentSalary\addPaymentToBank
addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
Add record into bank for payment with links between this bank record and invoices of payment.
Definition: paymentsalary.class.php:487
db
$conf db
API class for accounts.
Definition: inc.php:41
PaymentSalary\getLibStatut
getLibStatut($mode=0)
Retourne le libelle du statut d'une facture (brouillon, validee, abandonnee, payee)
Definition: paymentsalary.class.php:612
dol_escape_htmltag
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
Definition: functions.lib.php:1468
dol_trunc
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
Definition: functions.lib.php:3805
PaymentSalary
Class to manage payments of salaries.
Definition: paymentsalary.class.php:34
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
PaymentSalary\__construct
__construct($db)
Constructor.
Definition: paymentsalary.class.php:112
ref
$object ref
Definition: info.php:77
CommonObject
Parent class of all other business classes (invoices, contracts, proposals, orders,...
Definition: commonobject.class.php:44
PaymentSalary\createFromClone
createFromClone(User $user, $fromid)
Load an object from its id and create a new one in database.
Definition: paymentsalary.class.php:410
PaymentSalary\create
create($user, $closepaidcontrib=0)
Create payment of salary into database.
Definition: paymentsalary.class.php:125
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5661
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2514
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
PaymentSalary\$total
$total
Definition: paymentsalary.class.php:64
PaymentSalary\LibStatut
LibStatut($status, $mode=0)
Renvoi le libelle d'un statut donne.
Definition: paymentsalary.class.php:625
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
PaymentSalary\update_fk_bank
update_fk_bank($id_bank)
Mise a jour du lien entre le paiement de salaire et la ligne dans llx_bank generee.
Definition: paymentsalary.class.php:590
PaymentSalary\fetch
fetch($id)
Load object in memory from database.
Definition: paymentsalary.class.php:228
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:105
User
Class to manage Dolibarr users.
Definition: user.class.php:44
PaymentSalary\initAsSpecimen
initAsSpecimen()
Initialise an instance with random values.
Definition: paymentsalary.class.php:456
AccountLine
Class to manage bank transaction lines.
Definition: account.class.php:1779
PaymentSalary\update
update($user=null, $notrigger=0)
Update database.
Definition: paymentsalary.class.php:296
Salary
Class to manage salary payments.
Definition: salary.class.php:33
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
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
PaymentSalary\getNomUrl
getNomUrl($withpicto=0, $maxlen=0)
Return clicable name (with picto eventually)
Definition: paymentsalary.class.php:676