dolibarr  13.0.2
paymentsocialcontribution.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
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 require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
26 require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
27 
28 
33 {
37  public $element = 'paiementcharge';
38 
42  public $table_element = 'paiementcharge';
43 
47  public $picto = 'payment';
48 
52  public $fk_charge;
53 
54  public $datec = '';
55  public $tms = '';
56  public $datep = '';
57 
62  public $total;
63 
64  public $amount; // Total amount of payment
65  public $amounts = array(); // Array of amounts
66 
70  public $fk_typepaiement;
71 
76  public $num_paiement;
77 
81  public $num_payment;
82 
86  public $fk_bank;
87 
91  public $fk_user_creat;
92 
96  public $fk_user_modif;
97 
103  public function __construct($db)
104  {
105  $this->db = $db;
106  }
107 
116  public function create($user, $closepaidcontrib = 0)
117  {
118  global $conf, $langs;
119 
120  $error = 0;
121 
122  $now = dol_now();
123 
124  dol_syslog(get_class($this)."::create", LOG_DEBUG);
125 
126  // Validate parametres
127  if (!$this->datepaye)
128  {
129  $this->error = 'ErrorBadValueForParameterCreatePaymentSocialContrib';
130  return -1;
131  }
132 
133  // Clean parameters
134  if (isset($this->fk_charge)) $this->fk_charge = (int) $this->fk_charge;
135  if (isset($this->amount)) $this->amount = trim($this->amount);
136  if (isset($this->fk_typepaiement)) $this->fk_typepaiement = (int) $this->fk_typepaiement;
137  if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment);
138  if (isset($this->note_private)) $this->note_private = trim($this->note_private);
139  if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank;
140  if (isset($this->fk_user_creat)) $this->fk_user_creat = (int) $this->fk_user_creat;
141  if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif;
142 
143  $totalamount = 0;
144  foreach ($this->amounts as $key => $value) // How payment is dispatch
145  {
146  $newvalue = price2num($value, 'MT');
147  $this->amounts[$key] = $newvalue;
148  $totalamount += $newvalue;
149  }
150  $totalamount = price2num($totalamount);
151 
152  // Check parameters
153  if ($totalamount == 0) return -1; // On accepte les montants negatifs pour les rejets de prelevement mais pas null
154 
155 
156  $this->db->begin();
157 
158  if ($totalamount != 0)
159  {
160  $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiementcharge (fk_charge, datec, datep, amount,";
161  $sql .= " fk_typepaiement, num_paiement, note, fk_user_creat, fk_bank)";
162  $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',";
163  $sql .= " '".$this->db->idate($this->datepaye)."',";
164  $sql .= " ".$totalamount.",";
165  $sql .= " ".$this->paiementtype.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.",";
166  $sql .= " 0)";
167 
168  $resql = $this->db->query($sql);
169  if ($resql)
170  {
171  $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."paiementcharge");
172 
173  // Insere tableau des montants / factures
174  foreach ($this->amounts as $key => $amount)
175  {
176  $contribid = $key;
177  if (is_numeric($amount) && $amount <> 0)
178  {
179  $amount = price2num($amount);
180 
181  // If we want to closed paid invoices
182  if ($closepaidcontrib)
183  {
184  $contrib = new ChargeSociales($this->db);
185  $contrib->fetch($contribid);
186  $paiement = $contrib->getSommePaiement();
187  //$creditnotes=$contrib->getSumCreditNotesUsed();
188  $creditnotes = 0;
189  //$deposits=$contrib->getSumDepositsUsed();
190  $deposits = 0;
191  $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
192  $remaintopay = price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT');
193  if ($remaintopay == 0)
194  {
195  $result = $contrib->set_paid($user);
196  } else dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing.");
197  }
198  }
199  }
200  } else {
201  $error++;
202  }
203  }
204 
205  $result = $this->call_trigger('PAYMENTSOCIALCONTRIBUTION_CREATE', $user);
206  if ($result < 0) $error++;
207 
208  if ($totalamount != 0 && !$error)
209  {
210  $this->amount = $totalamount;
211  $this->total = $totalamount; // deprecated
212  $this->db->commit();
213  return $this->id;
214  } else {
215  $this->error = $this->db->error();
216  $this->db->rollback();
217  return -1;
218  }
219  }
220 
227  public function fetch($id)
228  {
229  global $langs;
230  $sql = "SELECT";
231  $sql .= " t.rowid,";
232  $sql .= " t.fk_charge,";
233  $sql .= " t.datec,";
234  $sql .= " t.tms,";
235  $sql .= " t.datep,";
236  $sql .= " t.amount,";
237  $sql .= " t.fk_typepaiement,";
238  $sql .= " t.num_paiement as num_payment,";
239  $sql .= " t.note,";
240  $sql .= " t.fk_bank,";
241  $sql .= " t.fk_user_creat,";
242  $sql .= " t.fk_user_modif,";
243  $sql .= " pt.code as type_code, pt.libelle as type_label,";
244  $sql .= ' b.fk_account';
245  $sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as t LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepaiement = pt.id";
246  $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid';
247  $sql .= " WHERE t.rowid = ".$id;
248  // TODO link on entity of tax;
249 
250  dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
251  $resql = $this->db->query($sql);
252  if ($resql)
253  {
254  if ($this->db->num_rows($resql))
255  {
256  $obj = $this->db->fetch_object($resql);
257 
258  $this->id = $obj->rowid;
259  $this->ref = $obj->rowid;
260 
261  $this->fk_charge = $obj->fk_charge;
262  $this->datec = $this->db->jdate($obj->datec);
263  $this->tms = $this->db->jdate($obj->tms);
264  $this->datep = $this->db->jdate($obj->datep);
265  $this->amount = $obj->amount;
266  $this->fk_typepaiement = $obj->fk_typepaiement;
267  $this->num_payment = $obj->num_payment;
268  $this->note_private = $obj->note;
269  $this->fk_bank = $obj->fk_bank;
270  $this->fk_user_creat = $obj->fk_user_creat;
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_charge)) $this->fk_charge = (int) $this->fk_charge;
304  if (isset($this->amount)) $this->amount = trim($this->amount);
305  if (isset($this->fk_typepaiement)) $this->fk_typepaiement = (int) $this->fk_typepaiement;
306  if (isset($this->num_payment)) $this->num_payment = trim($this->num_payment);
307  if (isset($this->note_private)) $this->note_private = trim($this->note_private);
308  if (isset($this->fk_bank)) $this->fk_bank = (int) $this->fk_bank;
309  if (isset($this->fk_user_creat)) $this->fk_user_creat = (int) $this->fk_user_creat;
310  if (isset($this->fk_user_modif)) $this->fk_user_modif = (int) $this->fk_user_modif;
311 
312 
313 
314  // Check parameters
315  // Put here code to add control on parameters values
316 
317  // Update request
318  $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET";
319 
320  $sql .= " fk_charge=".(isset($this->fk_charge) ? $this->fk_charge : "null").",";
321  $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
322  $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
323  $sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
324  $sql .= " amount=".(isset($this->amount) ? $this->amount : "null").",";
325  $sql .= " fk_typepaiement=".(isset($this->fk_typepaiement) ? $this->fk_typepaiement : "null").",";
326  $sql .= " num_paiement=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").",";
327  $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").",";
328  $sql .= " fk_bank=".(isset($this->fk_bank) ? $this->fk_bank : "null").",";
329  $sql .= " fk_user_creat=".(isset($this->fk_user_creat) ? $this->fk_user_creat : "null").",";
330  $sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? $this->fk_user_modif : "null")."";
331 
332 
333  $sql .= " WHERE rowid=".$this->id;
334 
335  $this->db->begin();
336 
337  dol_syslog(get_class($this)."::update", LOG_DEBUG);
338  $resql = $this->db->query($sql);
339  if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
340 
341  // Commit or rollback
342  if ($error)
343  {
344  foreach ($this->errors as $errmsg)
345  {
346  dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
347  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
348  }
349  $this->db->rollback();
350  return -1 * $error;
351  } else {
352  $this->db->commit();
353  return 1;
354  }
355  }
356 
357 
365  public function delete($user, $notrigger = 0)
366  {
367  global $conf, $langs;
368  $error = 0;
369 
370  dol_syslog(get_class($this)."::delete");
371 
372  $this->db->begin();
373 
374  if ($this->bank_line > 0)
375  {
376  $accline = new AccountLine($this->db);
377  $accline->fetch($this->bank_line);
378  $result = $accline->delete();
379  if ($result < 0) {
380  $this->errors[] = $accline->error;
381  $error++;
382  }
383  }
384 
385  if (!$error)
386  {
387  $sql = "DELETE FROM ".MAIN_DB_PREFIX."paiementcharge";
388  $sql .= " WHERE rowid=".$this->id;
389 
390  dol_syslog(get_class($this)."::delete", LOG_DEBUG);
391  $resql = $this->db->query($sql);
392  if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
393  }
394 
395  // Commit or rollback
396  if ($error)
397  {
398  foreach ($this->errors as $errmsg)
399  {
400  dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
401  $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
402  }
403  $this->db->rollback();
404  return -1 * $error;
405  } else {
406  $this->db->commit();
407  return 1;
408  }
409  }
410 
411 
412 
420  public function createFromClone(User $user, $fromid)
421  {
422  $error = 0;
423 
424  $object = new PaymentSocialContribution($this->db);
425 
426  $this->db->begin();
427 
428  // Load source object
429  $object->fetch($fromid);
430  $object->id = 0;
431  $object->statut = 0;
432 
433  // Clear fields
434  // ...
435 
436  // Create clone
437  $object->context['createfromclone'] = 'createfromclone';
438  $result = $object->create($user);
439 
440  // Other options
441  if ($result < 0)
442  {
443  $this->error = $object->error;
444  $error++;
445  }
446 
447  unset($object->context['createfromclone']);
448 
449  // End
450  if (!$error)
451  {
452  $this->db->commit();
453  return $object->id;
454  } else {
455  $this->db->rollback();
456  return -1;
457  }
458  }
459 
460 
468  public function initAsSpecimen()
469  {
470  $this->id = 0;
471 
472  $this->fk_charge = '';
473  $this->datec = '';
474  $this->tms = '';
475  $this->datep = '';
476  $this->amount = '';
477  $this->fk_typepaiement = '';
478  $this->num_payment = '';
479  $this->note_private = '';
480  $this->note_public = '';
481  $this->fk_bank = '';
482  $this->fk_user_creat = '';
483  $this->fk_user_modif = '';
484  }
485 
486 
499  public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
500  {
501  global $conf;
502 
503  // Clean data
504  $this->num_payment = trim($this->num_payment);
505 
506  $error = 0;
507 
508  if (!empty($conf->banque->enabled))
509  {
510  include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
511 
512  $acc = new Account($this->db);
513  $acc->fetch($accountid);
514 
516  if ($mode == 'payment_sc') $total = -$total;
517 
518  // Insert payment into llx_bank
519  $bank_line_id = $acc->addline(
520  $this->datepaye,
521  $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example")
522  $label,
523  $total,
524  $this->num_payment,
525  '',
526  $user,
527  $emetteur_nom,
528  $emetteur_banque
529  );
530 
531  // Mise a jour fk_bank dans llx_paiement.
532  // On connait ainsi le paiement qui a genere l'ecriture bancaire
533  if ($bank_line_id > 0)
534  {
535  $result = $this->update_fk_bank($bank_line_id);
536  if ($result <= 0)
537  {
538  $error++;
539  dol_print_error($this->db);
540  }
541 
542  // Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction
543  $url = '';
544  if ($mode == 'payment_sc') $url = DOL_URL_ROOT.'/compta/payment_sc/card.php?id=';
545  if ($url)
546  {
547  $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
548  if ($result <= 0)
549  {
550  $error++;
551  dol_print_error($this->db);
552  }
553  }
554 
555  // Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
556  $linkaddedforthirdparty = array();
557  foreach ($this->amounts as $key => $value)
558  {
559  if ($mode == 'payment_sc')
560  {
561  $socialcontrib = new ChargeSociales($this->db);
562  $socialcontrib->fetch($key);
563  $result = $acc->add_url_line($bank_line_id, $socialcontrib->id, DOL_URL_ROOT.'/compta/charges.php?id=', $socialcontrib->type_label.(($socialcontrib->lib && $socialcontrib->lib != $socialcontrib->type_label) ? ' ('.$socialcontrib->lib.')' : ''), 'sc');
564  if ($result <= 0) dol_print_error($this->db);
565  }
566  }
567  } else {
568  $this->error = $acc->error;
569  $error++;
570  }
571  }
572 
573  if (!$error)
574  {
575  return 1;
576  } else {
577  return -1;
578  }
579  }
580 
581 
582  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
589  public function update_fk_bank($id_bank)
590  {
591  // phpcs:enable
592  $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".$id_bank." WHERE rowid = ".$this->id;
593 
594  dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
595  $result = $this->db->query($sql);
596  if ($result)
597  {
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("SocialContributionPayment").'</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  {
691  // Label generique car entre parentheses. On l'affiche en le traduisant
692  if ($reg[1] == 'paiement') $reg[1] = 'Payment';
693  $labeltoshow = $langs->trans($reg[1]);
694  }
695  $label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
696  }
697  if ($this->datep) $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'day');
698 
699  if (!empty($this->id)) {
700  $link = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
701  $linkend = '</a>';
702 
703  if ($withpicto) $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
704  if ($withpicto && $withpicto != 2) $result .= ' ';
705  if ($withpicto != 2) $result .= $link.($maxlen ?dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
706  }
707 
708  return $result;
709  }
710 
711 
717  public function getVentilExportCompta()
718  {
719  $alreadydispatched = 0;
720 
721  $type = 'bank';
722 
723  $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 = ".$this->bank_line;
724  $resql = $this->db->query($sql);
725  if ($resql)
726  {
727  $obj = $this->db->fetch_object($resql);
728  if ($obj)
729  {
730  $alreadydispatched = $obj->nb;
731  }
732  } else {
733  $this->error = $this->db->lasterror();
734  return -1;
735  }
736 
737  if ($alreadydispatched)
738  {
739  return 1;
740  }
741  return 0;
742  }
743 }
getLibStatut($mode=0)
Retourne le libelle du statut d&#39;une facture (brouillon, validee, abandonnee, payee) ...
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
fetch($id)
Load object in memory from database.
dol_now($mode= 'auto')
Return date for now.
createFromClone(User $user, $fromid)
Load an object from its id and create a new one in database.
Class to manage Dolibarr users.
Definition: user.class.php:44
Class to manage payments of social contributions.
Class to manage bank transaction lines.
$conf db
API class for accounts.
Definition: inc.php:54
Class to manage bank accounts.
update($user=null, $notrigger=0)
Update database.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is &#39;...
initAsSpecimen()
Initialise an instance with random values.
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.
getNomUrl($withpicto=0, $maxlen=0)
Return clicable name (with picto eventually)
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
call_trigger($triggerName, $user)
Call trigger based on this instance.
update_fk_bank($id_bank)
Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee.
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...
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...
dol_trunc($string, $size=40, $trunc= 'right', $stringencoding= 'UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding &#39;...&#39; if string larger than length.
LibStatut($status, $mode=0)
Renvoi le libelle d&#39;un statut donne.
Classe permettant la gestion des paiements des charges La tva collectee n&#39;est calculee que sur les fa...
getVentilExportCompta()
Return if object was dispatched into bookkeeping.
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, $closepaidcontrib=0)
Create payment of social contribution into database.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...