dolibarr 20.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 * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
5 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
6 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
28require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
29require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
30
31
36{
40 public $element = 'paiementcharge';
41
45 public $table_element = 'paiementcharge';
46
50 public $picto = 'payment';
51
55 public $label;
56
60 public $fk_charge;
61
62 public $datec = '';
63 public $datep = '';
64
68 public $type_code;
69
73 public $type_label;
74
78 public $bank_account;
79
83 public $bank_line;
84
90 public $total;
91
95 public $amount; // Total amount of payment
99 public $amounts = array(); // Array of amounts
100
104 public $fk_typepaiement;
105
111 public $num_paiement;
112
117 public $num_payment;
118
122 public $fk_bank;
123
127 public $fk_user_creat;
128
132 public $fk_user_modif;
133
137 public $chid;
138
142 public $datepaye;
143
147 public $paiementtype;
148
149
155 public function __construct(DoliDB $db)
156 {
157 $this->db = $db;
158 }
159
168 public function create($user, $closepaidcontrib = 0)
169 {
170 global $conf, $langs;
171
172 $error = 0;
173
174 $now = dol_now();
175
176 dol_syslog(get_class($this)."::create", LOG_DEBUG);
177
178 // Validate parameters
179 if (!$this->datepaye) {
180 $this->error = 'ErrorBadValueForParameterCreatePaymentSocialContrib';
181 return -1;
182 }
183
184 // Clean parameters
185 if (isset($this->fk_charge)) {
186 $this->fk_charge = (int) $this->fk_charge;
187 }
188 if (isset($this->amount)) {
189 $this->amount = (float) $this->amount;
190 }
191 if (isset($this->fk_typepaiement)) {
192 $this->fk_typepaiement = (int) $this->fk_typepaiement;
193 }
194 if (isset($this->num_payment)) {
195 $this->num_payment = trim($this->num_payment);
196 }
197 if (isset($this->note_private)) {
198 $this->note_private = trim($this->note_private);
199 }
200 if (isset($this->fk_bank)) {
201 $this->fk_bank = (int) $this->fk_bank;
202 }
203 if (isset($this->fk_user_creat)) {
204 $this->fk_user_creat = (int) $this->fk_user_creat;
205 }
206 if (isset($this->fk_user_modif)) {
207 $this->fk_user_modif = (int) $this->fk_user_modif;
208 }
209
210 $totalamount = 0;
211 foreach ($this->amounts as $key => $value) { // How payment is dispatch
212 $newvalue = (float) price2num($value, 'MT');
213 $this->amounts[$key] = $newvalue;
214 $totalamount += $newvalue;
215 }
216 $totalamount = (float) price2num($totalamount);
217
218 // Check parameters
219 if ($totalamount == 0) {
220 return -1; // On accepte les montants negatifs pour les rejets de prelevement mais pas null
221 }
222
223
224 $this->db->begin();
225
226 if ($totalamount != 0) {
227 $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiementcharge (fk_charge, datec, datep, amount,";
228 $sql .= " fk_typepaiement, num_paiement, note, fk_user_creat, fk_bank)";
229 $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',";
230 $sql .= " '".$this->db->idate($this->datepaye)."',";
231 $sql .= " ".((float) $totalamount).",";
232 $sql .= " ".((int) $this->paiementtype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.",";
233 $sql .= " 0)";
234
235 $resql = $this->db->query($sql);
236 if ($resql) {
237 $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."paiementcharge");
238
239 // Insere tableau des montants / factures
240 foreach ($this->amounts as $key => $amount) {
241 $contribid = $key;
242 if (is_numeric($amount) && $amount != 0) {
243 $amount = (float) price2num($amount);
244
245 // If we want to closed paid invoices
246 if ($closepaidcontrib) {
247 $contrib = new ChargeSociales($this->db);
248 $contrib->fetch($contribid);
249 $paiement = $contrib->getSommePaiement();
250 //$creditnotes=$contrib->getSumCreditNotesUsed();
251 $creditnotes = 0;
252 //$deposits=$contrib->getSumDepositsUsed();
253 $deposits = 0;
254 $alreadypayed = (float) price2num($paiement + $creditnotes + $deposits, 'MT');
255 $remaintopay = (float) price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT');
256 if ($remaintopay == 0) {
257 $result = $contrib->setPaid($user);
258 } else {
259 dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing.");
260 }
261 }
262 }
263 }
264 } else {
265 $error++;
266 }
267 }
268
269 $result = $this->call_trigger('PAYMENTSOCIALCONTRIBUTION_CREATE', $user);
270 if ($result < 0) {
271 $error++;
272 }
273
274 if ($totalamount != 0 && !$error) {
275 $this->amount = $totalamount;
276 $this->total = $totalamount; // deprecated
277 $this->db->commit();
278 return $this->id;
279 } else {
280 $this->error = $this->db->error();
281 $this->db->rollback();
282 return -1;
283 }
284 }
285
292 public function fetch($id)
293 {
294 global $langs;
295 $sql = "SELECT";
296 $sql .= " t.rowid,";
297 $sql .= " t.fk_charge,";
298 $sql .= " t.datec,";
299 $sql .= " t.tms,";
300 $sql .= " t.datep,";
301 $sql .= " t.amount,";
302 $sql .= " t.fk_typepaiement,";
303 $sql .= " t.num_paiement as num_payment,";
304 $sql .= " t.note,";
305 $sql .= " t.fk_bank,";
306 $sql .= " t.fk_user_creat,";
307 $sql .= " t.fk_user_modif,";
308 $sql .= " pt.code as type_code, pt.libelle as type_label,";
309 $sql .= ' b.fk_account';
310 $sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as t LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepaiement = pt.id";
311 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid';
312 $sql .= " WHERE t.rowid = ".((int) $id);
313 // TODO link on entity of tax;
314
315 dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
316 $resql = $this->db->query($sql);
317 if ($resql) {
318 if ($this->db->num_rows($resql)) {
319 $obj = $this->db->fetch_object($resql);
320
321 $this->id = $obj->rowid;
322 $this->ref = $obj->rowid;
323
324 $this->fk_charge = $obj->fk_charge;
325 $this->datec = $this->db->jdate($obj->datec);
326 $this->tms = $this->db->jdate($obj->tms);
327 $this->datep = $this->db->jdate($obj->datep);
328 $this->amount = $obj->amount;
329 $this->total = $obj->amount;
330 $this->fk_typepaiement = $obj->fk_typepaiement;
331 $this->num_payment = $obj->num_payment;
332 $this->num_paiement = $obj->num_payment;
333 $this->note_private = $obj->note;
334 $this->fk_bank = $obj->fk_bank;
335 $this->fk_user_creat = $obj->fk_user_creat;
336 $this->fk_user_modif = $obj->fk_user_modif;
337
338 $this->type_code = $obj->type_code;
339 $this->type_label = $obj->type_label;
340
341 $this->bank_account = $obj->fk_account;
342 $this->bank_line = $obj->fk_bank;
343 }
344 $this->db->free($resql);
345
346 return 1;
347 } else {
348 $this->error = "Error ".$this->db->lasterror();
349 return -1;
350 }
351 }
352
353
361 public function update($user = null, $notrigger = 0)
362 {
363 global $conf, $langs;
364 $error = 0;
365
366 // Clean parameters
367
368 if (isset($this->fk_charge)) {
369 $this->fk_charge = (int) $this->fk_charge;
370 }
371 if (isset($this->amount)) {
372 $this->amount = (float) $this->amount;
373 }
374 if (isset($this->fk_typepaiement)) {
375 $this->fk_typepaiement = (int) $this->fk_typepaiement;
376 }
377 if (isset($this->num_payment)) {
378 $this->num_payment = trim($this->num_payment);
379 }
380 if (isset($this->note_private)) {
381 $this->note_private = trim($this->note_private);
382 }
383 if (isset($this->fk_bank)) {
384 $this->fk_bank = (int) $this->fk_bank;
385 }
386 if (isset($this->fk_user_creat)) {
387 $this->fk_user_creat = (int) $this->fk_user_creat;
388 }
389 if (isset($this->fk_user_modif)) {
390 $this->fk_user_modif = (int) $this->fk_user_modif;
391 }
392
393
394
395 // Check parameters
396 // Put here code to add control on parameters values
397
398 // Update request
399 $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET";
400 $sql .= " fk_charge=".(isset($this->fk_charge) ? ((int) $this->fk_charge) : "null").",";
401 $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
402 $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
403 $sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
404 $sql .= " amount=".(isset($this->amount) ? price2num($this->amount) : "null").",";
405 $sql .= " fk_typepaiement=".(isset($this->fk_typepaiement) ? ((int) $this->fk_typepaiement) : "null").",";
406 $sql .= " num_paiement=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").",";
407 $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").",";
408 $sql .= " fk_bank=".(isset($this->fk_bank) ? ((int) $this->fk_bank) : "null").",";
409 $sql .= " fk_user_creat=".(isset($this->fk_user_creat) ? ((int) $this->fk_user_creat) : "null").",";
410 $sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? ((int) $this->fk_user_modif) : "null");
411 $sql .= " WHERE rowid=".((int) $this->id);
412
413 $this->db->begin();
414
415 dol_syslog(get_class($this)."::update", LOG_DEBUG);
416 $resql = $this->db->query($sql);
417 if (!$resql) {
418 $error++;
419 $this->errors[] = "Error ".$this->db->lasterror();
420 }
421
422 // Commit or rollback
423 if ($error) {
424 foreach ($this->errors as $errmsg) {
425 dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
426 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
427 }
428 $this->db->rollback();
429 return -1 * $error;
430 } else {
431 $this->db->commit();
432 return 1;
433 }
434 }
435
436
444 public function delete($user, $notrigger = 0)
445 {
446 $error = 0;
447
448 dol_syslog(get_class($this)."::delete");
449
450 $this->db->begin();
451
452 if ($this->bank_line > 0) {
453 $accline = new AccountLine($this->db);
454 $accline->fetch($this->bank_line);
455 $result = $accline->delete($user);
456 if ($result < 0) {
457 $this->errors[] = $accline->error;
458 $error++;
459 }
460 }
461
462 if (!$error) {
463 $sql = "DELETE FROM ".MAIN_DB_PREFIX."paiementcharge";
464 $sql .= " WHERE rowid=".((int) $this->id);
465
466 dol_syslog(get_class($this)."::delete", LOG_DEBUG);
467 $resql = $this->db->query($sql);
468 if (!$resql) {
469 $error++;
470 $this->errors[] = "Error ".$this->db->lasterror();
471 }
472 }
473
474 // Commit or rollback
475 if ($error) {
476 foreach ($this->errors as $errmsg) {
477 dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
478 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
479 }
480 $this->db->rollback();
481 return -1 * $error;
482 } else {
483 $this->db->commit();
484 return 1;
485 }
486 }
487
488
489
497 public function createFromClone(User $user, $fromid)
498 {
499 $error = 0;
500
501 $object = new PaymentSocialContribution($this->db);
502
503 $this->db->begin();
504
505 // Load source object
506 $object->fetch($fromid);
507 $object->id = 0;
508 $object->statut = 0;
509
510 // Clear fields
511 // ...
512
513 // Create clone
514 $object->context['createfromclone'] = 'createfromclone';
515 $result = $object->create($user);
516
517 // Other options
518 if ($result < 0) {
519 $this->error = $object->error;
520 $error++;
521 }
522
523 unset($object->context['createfromclone']);
524
525 // End
526 if (!$error) {
527 $this->db->commit();
528 return $object->id;
529 } else {
530 $this->db->rollback();
531 return -1;
532 }
533 }
534
535
543 public function initAsSpecimen()
544 {
545 $this->id = 0;
546 $this->fk_charge = 0;
547 $this->datec = dol_now();
548 $this->tms = dol_now();
549 $this->datep = dol_now();
550 $this->amount = 100;
551 $this->fk_typepaiement = 0;
552 $this->num_payment = 'ABC123';
553 $this->note_private = '';
554 $this->note_public = '';
555 $this->fk_bank = 0;
556 $this->fk_user_creat = 0;
557 $this->fk_user_modif = 0;
558
559 return 1;
560 }
561
562
575 public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
576 {
577 global $conf, $langs;
578
579 // Clean data
580 $this->num_payment = trim($this->num_payment);
581
582 $error = 0;
583
584 if (isModEnabled("bank")) {
585 include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
586
587 $acc = new Account($this->db);
588 $acc->fetch($accountid);
589
590 $total = $this->amount;
591 if ($mode == 'payment_sc') {
592 $total = -$total;
593 }
594
595 // Insert payment into llx_bank
596 $bank_line_id = $acc->addline(
597 $this->datepaye,
598 $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example")
599 $label,
600 $total,
601 $this->num_payment,
602 '',
603 $user,
604 $emetteur_nom,
605 $emetteur_banque
606 );
607
608 // Mise a jour fk_bank dans llx_paiement.
609 // On connait ainsi le paiement qui a genere l'ecriture bancaire
610 if ($bank_line_id > 0) {
611 $result = $this->update_fk_bank($bank_line_id);
612 if ($result <= 0) {
613 $error++;
614 dol_print_error($this->db);
615 }
616
617 // Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction
618 $url = '';
619 if ($mode == 'payment_sc') {
620 $url = DOL_URL_ROOT.'/compta/payment_sc/card.php?id=';
621 }
622 if ($url) {
623 $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
624 if ($result <= 0) {
625 $error++;
626 dol_print_error($this->db);
627 }
628 }
629
630 // Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
631 $linkaddedforthirdparty = array();
632 foreach ($this->amounts as $key => $value) {
633 if ($mode == 'payment_sc') {
634 $socialcontrib = new ChargeSociales($this->db);
635 $socialcontrib->fetch($key);
636 $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');
637 if ($result <= 0) {
638 dol_print_error($this->db);
639 }
640
641 if ($socialcontrib->fk_user) {
642 $fuser = new User($this->db);
643 $fuser->fetch($socialcontrib->fk_user);
644
645 // Add link 'user' in bank_url between operation and bank transaction
646 $result = $acc->add_url_line(
647 $bank_line_id,
648 $socialcontrib->fk_user,
649 DOL_URL_ROOT.'/user/card.php?id=',
650 $fuser->getFullName($langs),
651 'user'
652 );
653
654 if ($result <= 0) {
655 $this->error = $acc->error;
656 $error++;
657 }
658 }
659 }
660 }
661 } else {
662 $this->error = $acc->error;
663 $error++;
664 }
665 }
666
667 if (!$error) {
668 return 1;
669 } else {
670 return -1;
671 }
672 }
673
674
675 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
682 public function update_fk_bank($id_bank)
683 {
684 // phpcs:enable
685 $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".((int) $id_bank)." WHERE rowid = ".((int) $this->id);
686
687 dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
688 $result = $this->db->query($sql);
689 if ($result) {
690 return 1;
691 } else {
692 $this->error = $this->db->error();
693 return 0;
694 }
695 }
696
697
704 public function getLibStatut($mode = 0)
705 {
706 return $this->LibStatut($this->statut, $mode);
707 }
708
709 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
717 public function LibStatut($status, $mode = 0)
718 {
719 // phpcs:enable
720 global $langs; // TODO Renvoyer le libelle anglais et faire traduction a affichage
721
722 $langs->load('compta');
723 /*if ($mode == 0)
724 {
725 if ($status == 0) return $langs->trans('ToValidate');
726 if ($status == 1) return $langs->trans('Validated');
727 }
728 if ($mode == 1)
729 {
730 if ($status == 0) return $langs->trans('ToValidate');
731 if ($status == 1) return $langs->trans('Validated');
732 }
733 if ($mode == 2)
734 {
735 if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
736 if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
737 }
738 if ($mode == 3)
739 {
740 if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1');
741 if ($status == 1) return img_picto($langs->trans('Validated'),'statut4');
742 }
743 if ($mode == 4)
744 {
745 if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
746 if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
747 }
748 if ($mode == 5)
749 {
750 if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
751 if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
752 }
753 if ($mode == 6)
754 {
755 if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
756 if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
757 }*/
758 return '';
759 }
760
768 public function getNomUrl($withpicto = 0, $maxlen = 0)
769 {
770 global $langs;
771
772 $result = '';
773
774 if (empty($this->ref)) {
775 $this->ref = $this->label;
776 }
777
778 $label = img_picto('', $this->picto).' <u>'.$langs->trans("SocialContributionPayment").'</u>';
779 $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
780 if (!empty($this->label)) {
781 $labeltoshow = $this->label;
782 $reg = array();
783 if (preg_match('/^\‍((.*)\‍)$/i', $this->label, $reg)) {
784 // Label generique car entre parentheses. On l'affiche en le traduisant
785 if ($reg[1] == 'paiement') {
786 $reg[1] = 'Payment';
787 }
788 $labeltoshow = $langs->trans($reg[1]);
789 }
790 $label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
791 }
792 if ($this->datep) {
793 $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'day');
794 }
795
796 if (!empty($this->id)) {
797 $link = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
798 $linkend = '</a>';
799
800 if ($withpicto) {
801 $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
802 }
803 if ($withpicto && $withpicto != 2) {
804 $result .= ' ';
805 }
806 if ($withpicto != 2) {
807 $result .= $link.($maxlen ? dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
808 }
809 }
810
811 return $result;
812 }
813
814
820 public function getVentilExportCompta()
821 {
822 $alreadydispatched = 0;
823
824 $type = 'bank';
825
826 $sql = " SELECT COUNT(ab.rowid) as nb FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='".$this->db->escape($type)."' AND ab.fk_doc = ".((int) $this->bank_line);
827 $resql = $this->db->query($sql);
828 if ($resql) {
829 $obj = $this->db->fetch_object($resql);
830 if ($obj) {
831 $alreadydispatched = $obj->nb;
832 }
833 } else {
834 $this->error = $this->db->lasterror();
835 return -1;
836 }
837
838 if ($alreadydispatched) {
839 return 1;
840 }
841 return 0;
842 }
843}
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
$object ref
Definition info.php:79
Class to manage bank accounts.
Class to manage bank transaction lines.
Class for managing the social charges.
Parent class of all other business classes (invoices, contracts, proposals, orders,...
call_trigger($triggerName, $user)
Call trigger based on this instance.
Class to manage Dolibarr database access.
Class to manage payments of social contributions.
getLibStatut($mode=0)
Return the label of the status.
fetch($id)
Load object in memory from database.
getNomUrl($withpicto=0, $maxlen=0)
Return clicable name (with picto eventually)
getVentilExportCompta()
Return if object was dispatched into bookkeeping.
create($user, $closepaidcontrib=0)
Create payment of social contribution into database.
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.
LibStatut($status, $mode=0)
Return the label of a given status.
update($user=null, $notrigger=0)
Update database.
createFromClone(User $user, $fromid)
Load an object from its id and create a new one in database.
update_fk_bank($id_bank)
Mise a jour du lien entre le paiement de charge et la ligne dans llx_bank generee.
initAsSpecimen()
Initialise an instance with random values.
Class to manage Dolibarr users.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_now($mode='auto')
Return date for now.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
publicphonebutton2 phonegreen basiclayout basiclayout TotalHT VATCode TotalVAT TotalLT1 TotalLT2 TotalTTC TotalHT clearboth nowraponall TAKEPOS_SHOW_SUBPRICE right right right takeposterminal SELECT e e e e e statut
Definition invoice.php:2010