dolibarr 25.0.0-alpha
paymentexpensereport.class.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
3 * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
4 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
5 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
27require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
28require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
29
30
35{
39 public $element = 'payment_expensereport';
40
44 public $table_element = 'payment_expensereport';
45
49 public $picto = 'payment';
50
54 public $rowid;
55
59 public $fk_expensereport;
60
64 public $datec = '';
65
69 public $datep = '';
73 public $amount; // Total amount of payment
77 public $amounts = array(); // Array of amounts
78
82 public $fk_typepayment;
83
88 public $num_payment;
89
93 public $fk_bank;
94
98 public $fk_user_creat;
99
103 public $fk_user_modif;
104
108 public $type_code;
109
113 public $type_label;
114
118 public $bank_account;
119
123 public $bank_line;
124
128 public $label;
129
130
136 public function __construct($db)
137 {
138 $this->db = $db;
139 }
140
148 public function create($user)
149 {
150 $error = 0;
151
152 $now = dol_now();
153 // Validate parameters
154 if (!$this->datep) {
155 $this->error = 'ErrorBadValueForParameterCreatePaymentExpenseReport';
156 return -1;
157 }
158
159 // Clean parameters
160 if (isset($this->fk_expensereport)) {
161 $this->fk_expensereport = (int) $this->fk_expensereport;
162 }
163 if (isset($this->amount)) {
164 $this->amount = (float) $this->amount;
165 }
166 if (isset($this->fk_typepayment)) {
167 $this->fk_typepayment = (int) $this->fk_typepayment;
168 }
169 if (isset($this->num_payment)) {
170 $this->num_payment = trim($this->num_payment);
171 }
172 if (isset($this->note)) {
173 $this->note = trim($this->note);
174 }
175 if (isset($this->note_public)) {
176 $this->note_public = trim($this->note_public);
177 }
178 if (isset($this->note_private)) {
179 $this->note_private = trim($this->note_private);
180 }
181 if (isset($this->fk_bank)) {
182 $this->fk_bank = ((int) $this->fk_bank);
183 }
184 if (isset($this->fk_user_creat)) {
185 $this->fk_user_creat = ((int) $this->fk_user_creat);
186 }
187 if (isset($this->fk_user_modif)) {
188 $this->fk_user_modif = ((int) $this->fk_user_modif);
189 }
190
191 $totalamount = 0;
192 foreach ($this->amounts as $key => $value) { // How payment is dispatch
193 $newvalue = (float) price2num($value, 'MT');
194 $this->amounts[$key] = $newvalue;
195 $totalamount += $newvalue;
196 }
197 // $totalamount = (float) price2num($totalamount);
198
199 // Check parameters
200 if ($totalamount == 0) {
201 return -1; // On accepte les montants negatifs pour les rejets de prelevement mais pas null
202 }
203
204
205 $this->db->begin();
206
207 if ($totalamount != 0) {
208 $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_expensereport (fk_expensereport, datec, datep, amount,";
209 $sql .= " fk_typepayment, num_payment, note, fk_user_creat, fk_bank)";
210 $sql .= " VALUES (".((int) $this->fk_expensereport).", '".$this->db->idate($now)."',";
211 $sql .= " '".$this->db->idate($this->datep)."',";
212 $sql .= " ".price2num($totalamount).",";
213 $sql .= " ".((int) $this->fk_typepayment).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".((int) $user->id).",";
214 $sql .= " 0)"; // fk_bank is ID of transaction into ll_bank
215
216 dol_syslog(get_class($this)."::create", LOG_DEBUG);
217 $resql = $this->db->query($sql);
218 if ($resql) {
219 $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_expensereport");
220 } else {
221 $error++;
222 }
223 }
224
225 if ($totalamount != 0 && !$error) {
226 $this->amount = $totalamount;
227 $this->db->commit();
228 return $this->id;
229 } else {
230 $this->error = $this->db->error();
231 $this->db->rollback();
232 return -1;
233 }
234 }
235
242 public function fetch($id)
243 {
244 $sql = "SELECT";
245 $sql .= " t.rowid,";
246 $sql .= " t.fk_expensereport,";
247 $sql .= " t.datec,";
248 $sql .= " t.tms,";
249 $sql .= " t.datep,";
250 $sql .= " t.amount,";
251 $sql .= " t.fk_typepayment,";
252 $sql .= " t.num_payment,";
253 $sql .= " t.note as note_public,";
254 $sql .= " t.fk_bank,";
255 $sql .= " t.fk_user_creat,";
256 $sql .= " t.fk_user_modif,";
257 $sql .= " pt.code as type_code, pt.libelle as type_label,";
258 $sql .= ' b.fk_account';
259 $sql .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as t";
260 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id";
261 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid';
262 $sql .= " WHERE t.rowid = ".((int) $id);
263
264 dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
265 $resql = $this->db->query($sql);
266 if ($resql) {
267 if ($this->db->num_rows($resql)) {
268 $obj = $this->db->fetch_object($resql);
269
270 $this->id = $obj->rowid;
271 $this->ref = $obj->rowid;
272
273 $this->fk_expensereport = $obj->fk_expensereport;
274 $this->datec = $this->db->jdate($obj->datec);
275 $this->tms = $this->db->jdate($obj->tms);
276 $this->datep = $this->db->jdate($obj->datep);
277 $this->amount = $obj->amount;
278 $this->fk_typepayment = $obj->fk_typepayment;
279 $this->num_payment = $obj->num_payment;
280 $this->note_public = $obj->note_public;
281 $this->fk_bank = $obj->fk_bank;
282 $this->fk_user_creat = $obj->fk_user_creat;
283 $this->fk_user_modif = $obj->fk_user_modif;
284
285 $this->type_code = $obj->type_code;
286 $this->type_label = $obj->type_label;
287
288 $this->bank_account = $obj->fk_account;
289 $this->bank_line = $obj->fk_bank;
290 }
291 $this->db->free($resql);
292
293 return 1;
294 } else {
295 $this->error = "Error ".$this->db->lasterror();
296 return -1;
297 }
298 }
299
300 // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter
308 public function update($user = null, $notrigger = 0)
309 {
310 // phpcs:enable
311 $error = 0;
312
313 // Clean parameters
314
315 if (isset($this->fk_expensereport)) {
316 $this->fk_expensereport = (int) $this->fk_expensereport;
317 }
318 if (isset($this->amount)) {
319 $this->amount = (float) $this->amount;
320 }
321 if (isset($this->fk_typepayment)) {
322 $this->fk_typepayment = (int) $this->fk_typepayment;
323 }
324 if (isset($this->num_payment)) {
325 $this->num_payment = trim($this->num_payment);
326 }
327 if (isset($this->note)) {
328 $this->note = trim($this->note);
329 }
330 if (isset($this->fk_bank)) {
331 $this->fk_bank = (int) $this->fk_bank;
332 }
333 if (isset($this->fk_user_creat)) {
334 $this->fk_user_creat = (int) $this->fk_user_creat;
335 }
336 if (isset($this->fk_user_modif)) {
337 $this->fk_user_modif = (int) $this->fk_user_modif;
338 }
339
340 // Update request
341 $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET";
342 $sql .= " fk_expensereport=".(isset($this->fk_expensereport) ? ((int) $this->fk_expensereport) : "null").",";
343 $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
344 $sql .= " tms=".(dol_strlen((string) $this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
345 $sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
346 $sql .= " amount=".(isset($this->amount) ? ((float) $this->amount) : "null").",";
347 $sql .= " fk_typepayment=".(isset($this->fk_typepayment) ? ((int) $this->fk_typepayment) : "null").",";
348 $sql .= " num_payment=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").",";
349 $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").",";
350 $sql .= " fk_bank=".(isset($this->fk_bank) ? ((int) $this->fk_bank) : "null").",";
351 $sql .= " fk_user_creat=".(isset($this->fk_user_creat) ? ((int) $this->fk_user_creat) : "null").",";
352 $sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? ((int) $this->fk_user_modif) : "null");
353 $sql .= " WHERE rowid=".((int) $this->id);
354
355 $this->db->begin();
356
357 dol_syslog(get_class($this)."::update", LOG_DEBUG);
358 $resql = $this->db->query($sql);
359 if (!$resql) {
360 $error++;
361 $this->errors[] = "Error ".$this->db->lasterror();
362 }
363
364 // Commit or rollback
365 if ($error) {
366 foreach ($this->errors as $errmsg) {
367 dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
368 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
369 }
370 $this->db->rollback();
371 return -1 * $error;
372 } else {
373 $this->db->commit();
374 return 1;
375 }
376 }
377
378 // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter
386 public function delete($user, $notrigger = 0)
387 {
388 // phpcs:enable
389 $error = 0;
390
391 $this->db->begin();
392
393 if ($this->bank_line > 0) {
394 $accline = new AccountLine($this->db);
395 $result = $accline->fetch($this->bank_line);
396 if ($result > 0) {
397 $result = $accline->delete($user);
398 if ($result < 0) {
399 $this->errors[] = $accline->error;
400 $error++;
401 }
402 }
403 }
404
405 if (!$error) {
406 $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url";
407 $sql .= " WHERE type='payment_expensereport' AND url_id=".((int) $this->id);
408
409 dol_syslog(get_class($this)."::delete", LOG_DEBUG);
410 $resql = $this->db->query($sql);
411 if (!$resql) {
412 $error++;
413 $this->errors[] = "Error ".$this->db->lasterror();
414 }
415 }
416
417 if (!$error) {
418 $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_expensereport";
419 $sql .= " WHERE rowid=".((int) $this->id);
420
421 dol_syslog(get_class($this)."::delete", LOG_DEBUG);
422 $resql = $this->db->query($sql);
423 if (!$resql) {
424 $error++;
425 $this->errors[] = "Error ".$this->db->lasterror();
426 }
427 }
428
429 // Commit or rollback
430 if ($error) {
431 foreach ($this->errors as $errmsg) {
432 dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
433 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
434 }
435 $this->db->rollback();
436 return -1 * $error;
437 } else {
438 $this->db->commit();
439 return 1;
440 }
441 }
442
443
444
452 public function createFromClone(User $user, $fromid)
453 {
454 $error = 0;
455
456 $object = new PaymentExpenseReport($this->db);
457
458 $this->db->begin();
459
460 // Load source object
461 $object->fetch($fromid);
462 $object->id = 0;
463 $object->statut = 0;
464
465 // Clear fields
466 // ...
467
468 // Create clone
469 $object->context['createfromclone'] = 'createfromclone';
470 $result = $object->create($user);
471
472 // Other options
473 if ($result < 0) {
474 $this->error = $object->error;
475 $error++;
476 }
477
478 unset($object->context['createfromclone']);
479
480 // End
481 if (!$error) {
482 $this->db->commit();
483 return $object->id;
484 } else {
485 $this->db->rollback();
486 return -1;
487 }
488 }
489
490
497 public function getLibStatut($mode = 0)
498 {
499 return '';
500 }
501
502 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
510 public function LibStatut($status, $mode = 0)
511 {
512 // phpcs:enable
513 //global $langs;
514
515 return '';
516 }
517
518
526 public function initAsSpecimen()
527 {
528 $this->id = 0;
529
530 $this->fk_expensereport = 0;
531 $this->datec = dol_now();
532 $this->tms = dol_now();
533 $this->datep = dol_now();
534 $this->amount = 100;
535 $this->fk_typepayment = 0;
536 $this->num_payment = '123456';
537 $this->note_public = 'Public note';
538 $this->note_private = 'Private note';
539 $this->fk_bank = 0;
540 $this->fk_user_creat = 0;
541 $this->fk_user_modif = 0;
542
543 return 1;
544 }
545
546
559 public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
560 {
561 global $langs;
562
563 $error = 0;
564
565 if (isModEnabled("bank")) {
566 include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
567
568 $acc = new Account($this->db);
569 $acc->fetch($accountid);
570
571 //Fix me field
572 $total = $this->amount;
573 $amount = 0;
574
575 if ($mode == 'payment_expensereport') {
576 $amount = $total;
577 }
578
579 // Insert payment into llx_bank
580 $bank_line_id = $acc->addline(
581 $this->datep,
582 (string) $this->fk_typepayment, // Payment mode id or code ("CHQ or VIR for example")
583 $label,
584 -$amount,
585 $this->num_payment,
586 0,
587 $user,
588 $emetteur_nom,
589 $emetteur_banque
590 );
591
592 // Update fk_bank in llx_paiement.
593 // So we will know the payment that has generated the bank transaction
594 if ($bank_line_id > 0) {
595 $result = $this->update_fk_bank($bank_line_id);
596 if ($result <= 0) {
597 $error++;
598 dol_print_error($this->db);
599 }
600
601 // Add link 'payment', 'payment_supplier', 'payment_expensereport' in bank_url between payment and bank transaction
602 $url = '';
603 if ($mode == 'payment_expensereport') {
604 $url = DOL_URL_ROOT.'/expensereport/payment/card.php?rowid=';
605 }
606 if ($url) {
607 $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
608 if ($result <= 0) {
609 $error++;
610 dol_print_error($this->db);
611 }
612 }
613
614 // Add link 'user' in bank_url between user and bank transaction
615 if (!$error) {
616 foreach ($this->amounts as $key => $value) { // We should have always same user but we loop in case of.
617 if ($mode == 'payment_expensereport') {
618 $fuser = new User($this->db);
619 $fuser->fetch($key);
620
621 $result = $acc->add_url_line(
622 $bank_line_id,
623 $fuser->id,
624 DOL_URL_ROOT.'/user/card.php?id=',
625 $fuser->getFullName($langs),
626 'user'
627 );
628 if ($result <= 0) {
629 $this->error = $this->db->lasterror();
630 dol_syslog(get_class($this).'::addPaymentToBank '.$this->error);
631 $error++;
632 }
633 }
634 }
635 }
636 } else {
637 $this->error = $acc->error;
638 $this->errors = $acc->errors;
639 $error++;
640 }
641 }
642
643 if (!$error) {
644 return 1;
645 } else {
646 return -1;
647 }
648 }
649
650
651 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
658 public function update_fk_bank($id_bank)
659 {
660 // phpcs:enable
661 $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET fk_bank = ".((int) $id_bank)." WHERE rowid = ".((int) $this->id);
662
663 dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
664 $result = $this->db->query($sql);
665 if ($result) {
666 return 1;
667 } else {
668 $this->error = $this->db->error();
669 return 0;
670 }
671 }
672
680 public function getNomUrl($withpicto = 0, $maxlen = 0)
681 {
682 global $langs, $hookmanager;
683
684 $result = '';
685
686 if (empty($this->ref)) {
687 $this->ref = $this->label;
688 }
689 $label = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Payment").'</u>';
690 if (isset($this->status)) {
691 $label .= ' '.$this->getLibStatut(5);
692 }
693 if (!empty($this->ref)) {
694 $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
695 }
696 if (!empty($this->datep)) {
697 $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'dayhour');
698 }
699
700 if (!empty($this->id)) {
701 $link = '<a href="'.DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
702 $linkend = '</a>';
703
704 if ($withpicto) {
705 $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
706 }
707 if ($withpicto && $withpicto != 2) {
708 $result .= ' ';
709 }
710 if ($withpicto != 2) {
711 $result .= $link.($maxlen ? dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
712 }
713 }
714 global $action;
715 $hookmanager->initHooks(array($this->element . 'dao'));
716 $parameters = array('id' => $this->id, 'getnomurl' => &$result);
717 $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
718 if ($reshook > 0) {
719 $result = $hookmanager->resPrint;
720 } else {
721 $result .= $hookmanager->resPrint;
722 }
723 return $result;
724 }
725
732 public function info($id)
733 {
734 $sql = 'SELECT e.rowid, e.datec, e.fk_user_creat, e.fk_user_modif, e.tms';
735 $sql .= ' FROM '.MAIN_DB_PREFIX.'payment_expensereport as e';
736 $sql .= ' WHERE e.rowid = '.((int) $id);
737
738 dol_syslog(get_class($this).'::info', LOG_DEBUG);
739 $result = $this->db->query($sql);
740
741 if ($result) {
742 if ($this->db->num_rows($result)) {
743 $obj = $this->db->fetch_object($result);
744
745 $this->id = $obj->rowid;
746
747 $this->user_creation_id = $obj->fk_user_creat;
748 $this->user_modification_id = $obj->fk_user_modif;
749 $this->date_creation = $this->db->jdate($obj->datec);
750 $this->date_modification = $this->db->jdate($obj->tms);
751 }
752 $this->db->free($result);
753 } else {
754 dol_print_error($this->db);
755 }
756 }
757
765 public function getKanbanView($option = '', $arraydata = null)
766 {
767 global $langs;
768
769 $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
770
771 $return = '<div class="box-flex-item box-flex-grow-zero">';
772 $return .= '<div class="info-box info-box-sm">';
773 $return .= '<span class="info-box-icon bg-infobox-action">';
774 $return .= img_picto('', $this->picto);
775 $return .= '</span>';
776 $return .= '<div class="info-box-content">';
777 $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>';
778 if ($selected >= 0) {
779 $return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
780 }
781 if (property_exists($this, 'datep')) {
782 $return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->datep), 'dayhour').'</span>';
783 }
784 if (property_exists($this, 'fk_typepayment')) {
785 $return .= '<br><span class="opacitymedium">'.$langs->trans("Type").'</span> : <span class="info-box-label">'.$this->fk_typepayment.'</span>';
786 }
787 if (property_exists($this, 'fk_bank') && !is_null($this->fk_bank)) {
788 $return .= '<br><span class="opacitymedium">'.$langs->trans("BankAccount").'</span> : <span class="info-box-label">'.$this->fk_bank.'</span>';
789 }
790 if (property_exists($this, 'amount')) {
791 $return .= '<br><span class="opacitymedium">'.$langs->trans("Amount").'</span> : <span class="info-box-label amount">'.price($this->amount).'</span>';
792 }
793 if (method_exists($this, 'getLibStatut')) {
794 $return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
795 }
796 $return .= '</div>';
797 $return .= '</div>';
798 $return .= '</div>';
799 return $return;
800 }
801}
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
$object ref
Definition info.php:90
Class to manage bank accounts.
Class to manage bank transaction lines.
Class to manage payments of expense report.
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.
fetch($id)
Load object in memory from database.
create($user)
Create payment of expense report into database.
info($id)
Tab information on object.
getLibStatut($mode=0)
Return the label of the status.
initAsSpecimen()
Initialise an instance with random values.
getKanbanView($option='', $arraydata=null)
Return clickable link of object (with eventually picto)
getNomUrl($withpicto=0, $maxlen=0)
Return clickable name (with picto eventually)
LibStatut($status, $mode=0)
Return the label of a given status.
createFromClone(User $user, $fromid)
Load an object from its id and create a new one in database.
update($user=null, $notrigger=0)
Update database.
update_fk_bank($id_bank)
Update link between the expense report payment and the generated line in llx_bank.
Class to manage Dolibarr users.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
Definition index.php:169
dol_now($mode='gmt')
Return date for now.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
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.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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...
Definition html.lib.php:172
print $langs trans('Date')." left Ref Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right Paid right PaymentTypeShortLIQ right SELECT p pos_change as p datep as p p num_paiement as f pf amount as amount
Definition receipt.php:489