dolibarr 19.0.3
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 *
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
26require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
27require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
28
29
34{
38 public $element = 'paiementcharge';
39
43 public $table_element = 'paiementcharge';
44
48 public $picto = 'payment';
49
53 public $label;
54
58 public $fk_charge;
59
60 public $datec = '';
61 public $tms = '';
62 public $datep = '';
63
67 public $type_code;
68
72 public $type_label;
73
77 public $bank_account;
78
82 public $bank_line;
83
88 public $total;
89
90 public $amount; // Total amount of payment
91 public $amounts = array(); // Array of amounts
92
96 public $fk_typepaiement;
97
102 public $num_paiement;
103
107 public $num_payment;
108
112 public $fk_bank;
113
117 public $fk_user_creat;
118
122 public $fk_user_modif;
123
127 public $chid;
128
132 public $datepaye;
133
137 public $paiementtype;
138
139
145 public function __construct(DoliDB $db)
146 {
147 $this->db = $db;
148 }
149
158 public function create($user, $closepaidcontrib = 0)
159 {
160 global $conf, $langs;
161
162 $error = 0;
163
164 $now = dol_now();
165
166 dol_syslog(get_class($this)."::create", LOG_DEBUG);
167
168 // Validate parametres
169 if (!$this->datepaye) {
170 $this->error = 'ErrorBadValueForParameterCreatePaymentSocialContrib';
171 return -1;
172 }
173
174 // Clean parameters
175 if (isset($this->fk_charge)) {
176 $this->fk_charge = (int) $this->fk_charge;
177 }
178 if (isset($this->amount)) {
179 $this->amount = trim($this->amount);
180 }
181 if (isset($this->fk_typepaiement)) {
182 $this->fk_typepaiement = (int) $this->fk_typepaiement;
183 }
184 if (isset($this->num_payment)) {
185 $this->num_payment = trim($this->num_payment);
186 }
187 if (isset($this->note_private)) {
188 $this->note_private = trim($this->note_private);
189 }
190 if (isset($this->fk_bank)) {
191 $this->fk_bank = (int) $this->fk_bank;
192 }
193 if (isset($this->fk_user_creat)) {
194 $this->fk_user_creat = (int) $this->fk_user_creat;
195 }
196 if (isset($this->fk_user_modif)) {
197 $this->fk_user_modif = (int) $this->fk_user_modif;
198 }
199
200 $totalamount = 0;
201 foreach ($this->amounts as $key => $value) { // How payment is dispatch
202 $newvalue = price2num($value, 'MT');
203 $this->amounts[$key] = $newvalue;
204 $totalamount += $newvalue;
205 }
206 $totalamount = price2num($totalamount);
207
208 // Check parameters
209 if ($totalamount == 0) {
210 return -1; // On accepte les montants negatifs pour les rejets de prelevement mais pas null
211 }
212
213
214 $this->db->begin();
215
216 if ($totalamount != 0) {
217 $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiementcharge (fk_charge, datec, datep, amount,";
218 $sql .= " fk_typepaiement, num_paiement, note, fk_user_creat, fk_bank)";
219 $sql .= " VALUES ($this->chid, '".$this->db->idate($now)."',";
220 $sql .= " '".$this->db->idate($this->datepaye)."',";
221 $sql .= " ".((float) $totalamount).",";
222 $sql .= " ".((int) $this->paiementtype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".$user->id.",";
223 $sql .= " 0)";
224
225 $resql = $this->db->query($sql);
226 if ($resql) {
227 $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."paiementcharge");
228
229 // Insere tableau des montants / factures
230 foreach ($this->amounts as $key => $amount) {
231 $contribid = $key;
232 if (is_numeric($amount) && $amount != 0) {
233 $amount = price2num($amount);
234
235 // If we want to closed paid invoices
236 if ($closepaidcontrib) {
237 $contrib = new ChargeSociales($this->db);
238 $contrib->fetch($contribid);
239 $paiement = $contrib->getSommePaiement();
240 //$creditnotes=$contrib->getSumCreditNotesUsed();
241 $creditnotes = 0;
242 //$deposits=$contrib->getSumDepositsUsed();
243 $deposits = 0;
244 $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT');
245 $remaintopay = price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT');
246 if ($remaintopay == 0) {
247 $result = $contrib->setPaid($user);
248 } else {
249 dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing.");
250 }
251 }
252 }
253 }
254 } else {
255 $error++;
256 }
257 }
258
259 $result = $this->call_trigger('PAYMENTSOCIALCONTRIBUTION_CREATE', $user);
260 if ($result < 0) {
261 $error++;
262 }
263
264 if ($totalamount != 0 && !$error) {
265 $this->amount = $totalamount;
266 $this->total = $totalamount; // deprecated
267 $this->db->commit();
268 return $this->id;
269 } else {
270 $this->error = $this->db->error();
271 $this->db->rollback();
272 return -1;
273 }
274 }
275
282 public function fetch($id)
283 {
284 global $langs;
285 $sql = "SELECT";
286 $sql .= " t.rowid,";
287 $sql .= " t.fk_charge,";
288 $sql .= " t.datec,";
289 $sql .= " t.tms,";
290 $sql .= " t.datep,";
291 $sql .= " t.amount,";
292 $sql .= " t.fk_typepaiement,";
293 $sql .= " t.num_paiement as num_payment,";
294 $sql .= " t.note,";
295 $sql .= " t.fk_bank,";
296 $sql .= " t.fk_user_creat,";
297 $sql .= " t.fk_user_modif,";
298 $sql .= " pt.code as type_code, pt.libelle as type_label,";
299 $sql .= ' b.fk_account';
300 $sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as t LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepaiement = pt.id";
301 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid';
302 $sql .= " WHERE t.rowid = ".((int) $id);
303 // TODO link on entity of tax;
304
305 dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
306 $resql = $this->db->query($sql);
307 if ($resql) {
308 if ($this->db->num_rows($resql)) {
309 $obj = $this->db->fetch_object($resql);
310
311 $this->id = $obj->rowid;
312 $this->ref = $obj->rowid;
313
314 $this->fk_charge = $obj->fk_charge;
315 $this->datec = $this->db->jdate($obj->datec);
316 $this->tms = $this->db->jdate($obj->tms);
317 $this->datep = $this->db->jdate($obj->datep);
318 $this->amount = $obj->amount;
319 $this->fk_typepaiement = $obj->fk_typepaiement;
320 $this->num_payment = $obj->num_payment;
321 $this->note_private = $obj->note;
322 $this->fk_bank = $obj->fk_bank;
323 $this->fk_user_creat = $obj->fk_user_creat;
324 $this->fk_user_modif = $obj->fk_user_modif;
325
326 $this->type_code = $obj->type_code;
327 $this->type_label = $obj->type_label;
328
329 $this->bank_account = $obj->fk_account;
330 $this->bank_line = $obj->fk_bank;
331 }
332 $this->db->free($resql);
333
334 return 1;
335 } else {
336 $this->error = "Error ".$this->db->lasterror();
337 return -1;
338 }
339 }
340
341
349 public function update($user = null, $notrigger = 0)
350 {
351 global $conf, $langs;
352 $error = 0;
353
354 // Clean parameters
355
356 if (isset($this->fk_charge)) {
357 $this->fk_charge = (int) $this->fk_charge;
358 }
359 if (isset($this->amount)) {
360 $this->amount = trim($this->amount);
361 }
362 if (isset($this->fk_typepaiement)) {
363 $this->fk_typepaiement = (int) $this->fk_typepaiement;
364 }
365 if (isset($this->num_payment)) {
366 $this->num_payment = trim($this->num_payment);
367 }
368 if (isset($this->note_private)) {
369 $this->note_private = trim($this->note_private);
370 }
371 if (isset($this->fk_bank)) {
372 $this->fk_bank = (int) $this->fk_bank;
373 }
374 if (isset($this->fk_user_creat)) {
375 $this->fk_user_creat = (int) $this->fk_user_creat;
376 }
377 if (isset($this->fk_user_modif)) {
378 $this->fk_user_modif = (int) $this->fk_user_modif;
379 }
380
381
382
383 // Check parameters
384 // Put here code to add control on parameters values
385
386 // Update request
387 $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET";
388 $sql .= " fk_charge=".(isset($this->fk_charge) ? ((int) $this->fk_charge) : "null").",";
389 $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
390 $sql .= " tms=".(dol_strlen($this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
391 $sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
392 $sql .= " amount=".(isset($this->amount) ? price2num($this->amount) : "null").",";
393 $sql .= " fk_typepaiement=".(isset($this->fk_typepaiement) ? ((int) $this->fk_typepaiement) : "null").",";
394 $sql .= " num_paiement=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").",";
395 $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").",";
396 $sql .= " fk_bank=".(isset($this->fk_bank) ? ((int) $this->fk_bank) : "null").",";
397 $sql .= " fk_user_creat=".(isset($this->fk_user_creat) ? ((int) $this->fk_user_creat) : "null").",";
398 $sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? ((int) $this->fk_user_modif) : "null");
399 $sql .= " WHERE rowid=".((int) $this->id);
400
401 $this->db->begin();
402
403 dol_syslog(get_class($this)."::update", LOG_DEBUG);
404 $resql = $this->db->query($sql);
405 if (!$resql) {
406 $error++;
407 $this->errors[] = "Error ".$this->db->lasterror();
408 }
409
410 // Commit or rollback
411 if ($error) {
412 foreach ($this->errors as $errmsg) {
413 dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
414 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
415 }
416 $this->db->rollback();
417 return -1 * $error;
418 } else {
419 $this->db->commit();
420 return 1;
421 }
422 }
423
424
432 public function delete($user, $notrigger = 0)
433 {
434 $error = 0;
435
436 dol_syslog(get_class($this)."::delete");
437
438 $this->db->begin();
439
440 if ($this->bank_line > 0) {
441 $accline = new AccountLine($this->db);
442 $accline->fetch($this->bank_line);
443 $result = $accline->delete($user);
444 if ($result < 0) {
445 $this->errors[] = $accline->error;
446 $error++;
447 }
448 }
449
450 if (!$error) {
451 $sql = "DELETE FROM ".MAIN_DB_PREFIX."paiementcharge";
452 $sql .= " WHERE rowid=".((int) $this->id);
453
454 dol_syslog(get_class($this)."::delete", LOG_DEBUG);
455 $resql = $this->db->query($sql);
456 if (!$resql) {
457 $error++;
458 $this->errors[] = "Error ".$this->db->lasterror();
459 }
460 }
461
462 // Commit or rollback
463 if ($error) {
464 foreach ($this->errors as $errmsg) {
465 dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
466 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
467 }
468 $this->db->rollback();
469 return -1 * $error;
470 } else {
471 $this->db->commit();
472 return 1;
473 }
474 }
475
476
477
485 public function createFromClone(User $user, $fromid)
486 {
487 $error = 0;
488
489 $object = new PaymentSocialContribution($this->db);
490
491 $this->db->begin();
492
493 // Load source object
494 $object->fetch($fromid);
495 $object->id = 0;
496 $object->statut = 0;
497
498 // Clear fields
499 // ...
500
501 // Create clone
502 $object->context['createfromclone'] = 'createfromclone';
503 $result = $object->create($user);
504
505 // Other options
506 if ($result < 0) {
507 $this->error = $object->error;
508 $error++;
509 }
510
511 unset($object->context['createfromclone']);
512
513 // End
514 if (!$error) {
515 $this->db->commit();
516 return $object->id;
517 } else {
518 $this->db->rollback();
519 return -1;
520 }
521 }
522
523
531 public function initAsSpecimen()
532 {
533 $this->id = 0;
534
535 $this->fk_charge = '';
536 $this->datec = '';
537 $this->tms = '';
538 $this->datep = '';
539 $this->amount = '';
540 $this->fk_typepaiement = '';
541 $this->num_payment = '';
542 $this->note_private = '';
543 $this->note_public = '';
544 $this->fk_bank = '';
545 $this->fk_user_creat = '';
546 $this->fk_user_modif = '';
547 }
548
549
562 public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
563 {
564 global $conf, $langs;
565
566 // Clean data
567 $this->num_payment = trim($this->num_payment);
568
569 $error = 0;
570
571 if (isModEnabled("banque")) {
572 include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
573
574 $acc = new Account($this->db);
575 $acc->fetch($accountid);
576
578 if ($mode == 'payment_sc') {
579 $total = -$total;
580 }
581
582 // Insert payment into llx_bank
583 $bank_line_id = $acc->addline(
584 $this->datepaye,
585 $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example")
586 $label,
587 $total,
588 $this->num_payment,
589 '',
590 $user,
591 $emetteur_nom,
592 $emetteur_banque
593 );
594
595 // Mise a jour fk_bank dans llx_paiement.
596 // On connait ainsi le paiement qui a genere l'ecriture bancaire
597 if ($bank_line_id > 0) {
598 $result = $this->update_fk_bank($bank_line_id);
599 if ($result <= 0) {
600 $error++;
601 dol_print_error($this->db);
602 }
603
604 // Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction
605 $url = '';
606 if ($mode == 'payment_sc') {
607 $url = DOL_URL_ROOT.'/compta/payment_sc/card.php?id=';
608 }
609 if ($url) {
610 $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
611 if ($result <= 0) {
612 $error++;
613 dol_print_error($this->db);
614 }
615 }
616
617 // Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
618 $linkaddedforthirdparty = array();
619 foreach ($this->amounts as $key => $value) {
620 if ($mode == 'payment_sc') {
621 $socialcontrib = new ChargeSociales($this->db);
622 $socialcontrib->fetch($key);
623 $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');
624 if ($result <= 0) {
625 dol_print_error($this->db);
626 }
627
628 if ($socialcontrib->fk_user) {
629 $fuser = new User($this->db);
630 $fuser->fetch($socialcontrib->fk_user);
631
632 // Add link 'user' in bank_url between operation and bank transaction
633 $result = $acc->add_url_line(
634 $bank_line_id,
635 $socialcontrib->fk_user,
636 DOL_URL_ROOT.'/user/card.php?id=',
637 $fuser->getFullName($langs),
638 'user'
639 );
640
641 if ($result <= 0) {
642 $this->error = $acc->error;
643 $error++;
644 }
645 }
646 }
647 }
648 } else {
649 $this->error = $acc->error;
650 $error++;
651 }
652 }
653
654 if (!$error) {
655 return 1;
656 } else {
657 return -1;
658 }
659 }
660
661
662 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
669 public function update_fk_bank($id_bank)
670 {
671 // phpcs:enable
672 $sql = "UPDATE ".MAIN_DB_PREFIX."paiementcharge SET fk_bank = ".((int) $id_bank)." WHERE rowid = ".((int) $this->id);
673
674 dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
675 $result = $this->db->query($sql);
676 if ($result) {
677 return 1;
678 } else {
679 $this->error = $this->db->error();
680 return 0;
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
755 public function getNomUrl($withpicto = 0, $maxlen = 0)
756 {
757 global $langs;
758
759 $result = '';
760
761 if (empty($this->ref)) {
762 $this->ref = $this->label;
763 }
764
765 $label = img_picto('', $this->picto).' <u>'.$langs->trans("SocialContributionPayment").'</u>';
766 $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
767 if (!empty($this->label)) {
768 $labeltoshow = $this->label;
769 $reg = array();
770 if (preg_match('/^\‍((.*)\‍)$/i', $this->label, $reg)) {
771 // Label generique car entre parentheses. On l'affiche en le traduisant
772 if ($reg[1] == 'paiement') {
773 $reg[1] = 'Payment';
774 }
775 $labeltoshow = $langs->trans($reg[1]);
776 }
777 $label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
778 }
779 if ($this->datep) {
780 $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'day');
781 }
782
783 if (!empty($this->id)) {
784 $link = '<a href="'.DOL_URL_ROOT.'/compta/payment_sc/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
785 $linkend = '</a>';
786
787 if ($withpicto) {
788 $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
789 }
790 if ($withpicto && $withpicto != 2) {
791 $result .= ' ';
792 }
793 if ($withpicto != 2) {
794 $result .= $link.($maxlen ? dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
795 }
796 }
797
798 return $result;
799 }
800
801
807 public function getVentilExportCompta()
808 {
809 $alreadydispatched = 0;
810
811 $type = 'bank';
812
813 $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);
814 $resql = $this->db->query($sql);
815 if ($resql) {
816 $obj = $this->db->fetch_object($resql);
817 if ($obj) {
818 $alreadydispatched = $obj->nb;
819 }
820 } else {
821 $this->error = $this->db->lasterror();
822 return -1;
823 }
824
825 if ($alreadydispatched) {
826 return 1;
827 }
828 return 0;
829 }
830}
$object ref
Definition info.php:79
Class to manage bank accounts.
Class to manage bank transaction lines.
Classe permettant la gestion des paiements des charges La tva collectee n'est calculee que sur les fa...
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.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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 right right takeposterminal SELECT e e e e e statut
Definition invoice.php:1907