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-2026 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
149 public function create($user, $notrigger = 0)
150 {
151 $error = 0;
152
153 $now = dol_now();
154 // Validate parameters
155 if (!$this->datep) {
156 $this->error = 'ErrorBadValueForParameterCreatePaymentExpenseReport';
157 return -1;
158 }
159
160 // Clean parameters
161 if (isset($this->fk_expensereport)) {
162 $this->fk_expensereport = (int) $this->fk_expensereport;
163 }
164 if (isset($this->amount)) {
165 $this->amount = (float) $this->amount;
166 }
167 if (isset($this->fk_typepayment)) {
168 $this->fk_typepayment = (int) $this->fk_typepayment;
169 }
170 if (isset($this->num_payment)) {
171 $this->num_payment = trim($this->num_payment);
172 }
173 if (isset($this->note)) {
174 $this->note = trim($this->note);
175 }
176 if (isset($this->note_public)) {
177 $this->note_public = trim($this->note_public);
178 }
179 if (isset($this->note_private)) {
180 $this->note_private = trim($this->note_private);
181 }
182 if (isset($this->fk_bank)) {
183 $this->fk_bank = ((int) $this->fk_bank);
184 }
185 if (isset($this->fk_user_creat)) {
186 $this->fk_user_creat = ((int) $this->fk_user_creat);
187 }
188 if (isset($this->fk_user_modif)) {
189 $this->fk_user_modif = ((int) $this->fk_user_modif);
190 }
191
192 $totalamount = 0;
193 foreach ($this->amounts as $key => $value) { // How payment is dispatch
194 $newvalue = (float) price2num($value, 'MT');
195 $this->amounts[$key] = $newvalue;
196 $totalamount += $newvalue;
197 }
198 // $totalamount = (float) price2num($totalamount);
199
200 // Check parameters
201 if ($totalamount == 0) {
202 return -1; // On accepte les montants negatifs pour les rejets de prelevement mais pas null
203 }
204
205
206 $this->db->begin();
207
208 if ($totalamount != 0) {
209 $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_expensereport (fk_expensereport, datec, datep, amount,";
210 $sql .= " fk_typepayment, num_payment, note, fk_user_creat, fk_bank)";
211 $sql .= " VALUES (".((int) $this->fk_expensereport).", '".$this->db->idate($now)."',";
212 $sql .= " '".$this->db->idate($this->datep)."',";
213 $sql .= " ".price2num($totalamount).",";
214 $sql .= " ".((int) $this->fk_typepayment).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".((int) $user->id).",";
215 $sql .= " 0)"; // fk_bank is ID of transaction into ll_bank
216
217 dol_syslog(get_class($this)."::create", LOG_DEBUG);
218 $resql = $this->db->query($sql);
219 if ($resql) {
220 $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_expensereport");
221 } else {
222 $error++;
223 }
224 }
225
226 if ($totalamount != 0 && !$error && !$notrigger) {
227 // Call trigger
228 $result = $this->call_trigger('PAYMENTEXPENSEREPORT_CREATE', $user);
229 if ($result < 0) {
230 $error++;
231 }
232 // End call triggers
233 }
234
235 if ($totalamount != 0 && !$error) {
236 $this->amount = $totalamount;
237 $this->db->commit();
238 return $this->id;
239 } else {
240 $this->error = $this->db->error();
241 $this->db->rollback();
242 return -1;
243 }
244 }
245
252 public function fetch($id)
253 {
254 $sql = "SELECT";
255 $sql .= " t.rowid,";
256 $sql .= " t.fk_expensereport,";
257 $sql .= " t.datec,";
258 $sql .= " t.tms,";
259 $sql .= " t.datep,";
260 $sql .= " t.amount,";
261 $sql .= " t.fk_typepayment,";
262 $sql .= " t.num_payment,";
263 $sql .= " t.note as note_public,";
264 $sql .= " t.fk_bank,";
265 $sql .= " t.fk_user_creat,";
266 $sql .= " t.fk_user_modif,";
267 $sql .= " pt.code as type_code, pt.libelle as type_label,";
268 $sql .= ' b.fk_account';
269 $sql .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as t";
270 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepayment = pt.id";
271 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid';
272 $sql .= " WHERE t.rowid = ".((int) $id);
273
274 dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
275 $resql = $this->db->query($sql);
276 if ($resql) {
277 if ($this->db->num_rows($resql)) {
278 $obj = $this->db->fetch_object($resql);
279
280 $this->id = $obj->rowid;
281 $this->ref = $obj->rowid;
282
283 $this->fk_expensereport = $obj->fk_expensereport;
284 $this->datec = $this->db->jdate($obj->datec);
285 $this->tms = $this->db->jdate($obj->tms);
286 $this->datep = $this->db->jdate($obj->datep);
287 $this->amount = $obj->amount;
288 $this->fk_typepayment = $obj->fk_typepayment;
289 $this->num_payment = $obj->num_payment;
290 $this->note_public = $obj->note_public;
291 $this->fk_bank = $obj->fk_bank;
292 $this->fk_user_creat = $obj->fk_user_creat;
293 $this->fk_user_modif = $obj->fk_user_modif;
294
295 $this->type_code = $obj->type_code;
296 $this->type_label = $obj->type_label;
297
298 $this->bank_account = $obj->fk_account;
299 $this->bank_line = $obj->fk_bank;
300 }
301 $this->db->free($resql);
302
303 return 1;
304 } else {
305 $this->error = "Error ".$this->db->lasterror();
306 return -1;
307 }
308 }
309
310 // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter
318 public function update($user = null, $notrigger = 0)
319 {
320 // phpcs:enable
321 $error = 0;
322
323 // Clean parameters
324
325 if (isset($this->fk_expensereport)) {
326 $this->fk_expensereport = (int) $this->fk_expensereport;
327 }
328 if (isset($this->amount)) {
329 $this->amount = (float) $this->amount;
330 }
331 if (isset($this->fk_typepayment)) {
332 $this->fk_typepayment = (int) $this->fk_typepayment;
333 }
334 if (isset($this->num_payment)) {
335 $this->num_payment = trim($this->num_payment);
336 }
337 if (isset($this->note)) {
338 $this->note = trim($this->note);
339 }
340 if (isset($this->fk_bank)) {
341 $this->fk_bank = (int) $this->fk_bank;
342 }
343 if (isset($this->fk_user_creat)) {
344 $this->fk_user_creat = (int) $this->fk_user_creat;
345 }
346 if (isset($this->fk_user_modif)) {
347 $this->fk_user_modif = (int) $this->fk_user_modif;
348 }
349
350 // Update request
351 $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET";
352 $sql .= " fk_expensereport=".(isset($this->fk_expensereport) ? ((int) $this->fk_expensereport) : "null").",";
353 $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
354 $sql .= " tms=".(dol_strlen((string) $this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
355 $sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
356 $sql .= " amount=".(isset($this->amount) ? ((float) $this->amount) : "null").",";
357 $sql .= " fk_typepayment=".(isset($this->fk_typepayment) ? ((int) $this->fk_typepayment) : "null").",";
358 $sql .= " num_payment=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").",";
359 $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").",";
360 $sql .= " fk_bank=".(isset($this->fk_bank) ? ((int) $this->fk_bank) : "null").",";
361 $sql .= " fk_user_creat=".(isset($this->fk_user_creat) ? ((int) $this->fk_user_creat) : "null").",";
362 $sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? ((int) $this->fk_user_modif) : "null");
363 $sql .= " WHERE rowid=".((int) $this->id);
364
365 $this->db->begin();
366
367 dol_syslog(get_class($this)."::update", LOG_DEBUG);
368 $resql = $this->db->query($sql);
369 if (!$resql) {
370 $error++;
371 $this->errors[] = "Error ".$this->db->lasterror();
372 }
373
374 if (!$error && $user && !$notrigger) {
375 // Call trigger
376 $result = $this->call_trigger('PAYMENTEXPENSEREPORT_MODIFY', $user);
377 if ($result < 0) {
378 $error++;
379 }
380 // End call triggers
381 }
382
383 // Commit or rollback
384 if ($error) {
385 foreach ($this->errors as $errmsg) {
386 dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
387 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
388 }
389 $this->db->rollback();
390 return -1 * $error;
391 } else {
392 $this->db->commit();
393 return 1;
394 }
395 }
396
397 // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter
405 public function delete($user, $notrigger = 0)
406 {
407 // phpcs:enable
408 $error = 0;
409
410 $this->db->begin();
411
412 if ($this->bank_line > 0) {
413 $accline = new AccountLine($this->db);
414 $result = $accline->fetch($this->bank_line);
415 if ($result > 0) {
416 $result = $accline->delete($user);
417 if ($result < 0) {
418 $this->errors[] = $accline->error;
419 $error++;
420 }
421 }
422 }
423
424 if (!$error) {
425 $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_url";
426 $sql .= " WHERE type='payment_expensereport' AND url_id=".((int) $this->id);
427
428 dol_syslog(get_class($this)."::delete", LOG_DEBUG);
429 $resql = $this->db->query($sql);
430 if (!$resql) {
431 $error++;
432 $this->errors[] = "Error ".$this->db->lasterror();
433 }
434 }
435
436 if (!$error) {
437 $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_expensereport";
438 $sql .= " WHERE rowid=".((int) $this->id);
439
440 dol_syslog(get_class($this)."::delete", LOG_DEBUG);
441 $resql = $this->db->query($sql);
442 if (!$resql) {
443 $error++;
444 $this->errors[] = "Error ".$this->db->lasterror();
445 }
446 }
447
448 if (!$error && !$notrigger) {
449 // Call trigger
450 $result = $this->call_trigger('PAYMENTEXPENSEREPORT_DELETE', $user);
451 if ($result < 0) {
452 $error++;
453 }
454 // End call triggers
455 }
456
457 // Commit or rollback
458 if ($error) {
459 foreach ($this->errors as $errmsg) {
460 dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
461 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
462 }
463 $this->db->rollback();
464 return -1 * $error;
465 } else {
466 $this->db->commit();
467 return 1;
468 }
469 }
470
471
472
480 public function createFromClone(User $user, $fromid)
481 {
482 $error = 0;
483
484 $object = new PaymentExpenseReport($this->db);
485
486 $this->db->begin();
487
488 // Load source object
489 $object->fetch($fromid);
490 $object->id = 0;
491 $object->statut = 0;
492
493 // Clear fields
494 // ...
495
496 // Create clone
497 $object->context['createfromclone'] = 'createfromclone';
498 $result = $object->create($user);
499
500 // Other options
501 if ($result < 0) {
502 $this->error = $object->error;
503 $error++;
504 }
505
506 unset($object->context['createfromclone']);
507
508 // End
509 if (!$error) {
510 $this->db->commit();
511 return $object->id;
512 } else {
513 $this->db->rollback();
514 return -1;
515 }
516 }
517
518
525 public function getLibStatut($mode = 0)
526 {
527 return '';
528 }
529
530 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
538 public function LibStatut($status, $mode = 0)
539 {
540 // phpcs:enable
541 //global $langs;
542
543 return '';
544 }
545
546
554 public function initAsSpecimen()
555 {
556 $this->id = 0;
557
558 $this->fk_expensereport = 0;
559 $this->datec = dol_now();
560 $this->tms = dol_now();
561 $this->datep = dol_now();
562 $this->amount = 100;
563 $this->fk_typepayment = 0;
564 $this->num_payment = '123456';
565 $this->note_public = 'Public note';
566 $this->note_private = 'Private note';
567 $this->fk_bank = 0;
568 $this->fk_user_creat = 0;
569 $this->fk_user_modif = 0;
570
571 return 1;
572 }
573
574
587 public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
588 {
589 global $langs;
590
591 $error = 0;
592
593 if (isModEnabled("bank")) {
594 include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
595
596 $acc = new Account($this->db);
597 $acc->fetch($accountid);
598
599 //Fix me field
600 $total = $this->amount;
601 $amount = 0;
602
603 if ($mode == 'payment_expensereport') {
604 $amount = $total;
605 }
606
607 // Insert payment into llx_bank
608 $bank_line_id = $acc->addline(
609 $this->datep,
610 (string) $this->fk_typepayment, // Payment mode id or code ("CHQ or VIR for example")
611 $label,
612 -$amount,
613 $this->num_payment,
614 0,
615 $user,
616 $emetteur_nom,
617 $emetteur_banque
618 );
619
620 // Update fk_bank in llx_paiement.
621 // So we will know the payment that has generated the bank transaction
622 if ($bank_line_id > 0) {
623 $result = $this->update_fk_bank($bank_line_id);
624 if ($result <= 0) {
625 $error++;
626 dol_print_error($this->db);
627 }
628
629 // Add link 'payment', 'payment_supplier', 'payment_expensereport' in bank_url between payment and bank transaction
630 $url = '';
631 if ($mode == 'payment_expensereport') {
632 $url = DOL_URL_ROOT.'/expensereport/payment/card.php?rowid=';
633 }
634 if ($url) {
635 $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
636 if ($result <= 0) {
637 $error++;
638 dol_print_error($this->db);
639 }
640 }
641
642 // Add link 'user' in bank_url between user and bank transaction
643 if (!$error) {
644 foreach ($this->amounts as $key => $value) { // We should have always same user but we loop in case of.
645 if ($mode == 'payment_expensereport') {
646 $fuser = new User($this->db);
647 $fuser->fetch($key);
648
649 $result = $acc->add_url_line(
650 $bank_line_id,
651 $fuser->id,
652 DOL_URL_ROOT.'/user/card.php?id=',
653 $fuser->getFullName($langs),
654 'user'
655 );
656 if ($result <= 0) {
657 $this->error = $this->db->lasterror();
658 dol_syslog(get_class($this).'::addPaymentToBank '.$this->error);
659 $error++;
660 }
661 }
662 }
663 }
664 } else {
665 $this->error = $acc->error;
666 $this->errors = $acc->errors;
667 $error++;
668 }
669 }
670
671 if (!$error) {
672 return 1;
673 } else {
674 return -1;
675 }
676 }
677
678
679 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
686 public function update_fk_bank($id_bank)
687 {
688 // phpcs:enable
689 $sql = "UPDATE ".MAIN_DB_PREFIX."payment_expensereport SET fk_bank = ".((int) $id_bank)." WHERE rowid = ".((int) $this->id);
690
691 dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
692 $result = $this->db->query($sql);
693 if ($result) {
694 return 1;
695 } else {
696 $this->error = $this->db->error();
697 return 0;
698 }
699 }
700
708 public function getNomUrl($withpicto = 0, $maxlen = 0)
709 {
710 global $langs, $hookmanager;
711
712 $result = '';
713
714 if (empty($this->ref)) {
715 $this->ref = $this->label;
716 }
717 $label = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Payment").'</u>';
718 if (isset($this->status)) {
719 $label .= ' '.$this->getLibStatut(5);
720 }
721 if (!empty($this->ref)) {
722 $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
723 }
724 if (!empty($this->datep)) {
725 $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'dayhour');
726 }
727
728 if (!empty($this->id)) {
729 $link = '<a href="'.DOL_URL_ROOT.'/expensereport/payment/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
730 $linkend = '</a>';
731
732 if ($withpicto) {
733 $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
734 }
735 if ($withpicto && $withpicto != 2) {
736 $result .= ' ';
737 }
738 if ($withpicto != 2) {
739 $result .= $link.($maxlen ? dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
740 }
741 }
742 global $action;
743 $hookmanager->initHooks(array($this->element . 'dao'));
744 $parameters = array('id' => $this->id, 'getnomurl' => &$result);
745 $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
746 if ($reshook > 0) {
747 $result = $hookmanager->resPrint;
748 } else {
749 $result .= $hookmanager->resPrint;
750 }
751 return $result;
752 }
753
760 public function info($id)
761 {
762 $sql = 'SELECT e.rowid, e.datec, e.fk_user_creat, e.fk_user_modif, e.tms';
763 $sql .= ' FROM '.MAIN_DB_PREFIX.'payment_expensereport as e';
764 $sql .= ' WHERE e.rowid = '.((int) $id);
765
766 dol_syslog(get_class($this).'::info', LOG_DEBUG);
767 $result = $this->db->query($sql);
768
769 if ($result) {
770 if ($this->db->num_rows($result)) {
771 $obj = $this->db->fetch_object($result);
772
773 $this->id = $obj->rowid;
774
775 $this->user_creation_id = $obj->fk_user_creat;
776 $this->user_modification_id = $obj->fk_user_modif;
777 $this->date_creation = $this->db->jdate($obj->datec);
778 $this->date_modification = $this->db->jdate($obj->tms);
779 }
780 $this->db->free($result);
781 } else {
782 dol_print_error($this->db);
783 }
784 }
785
793 public function getKanbanView($option = '', $arraydata = null)
794 {
795 global $langs;
796
797 $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
798
799 $return = '<div class="box-flex-item box-flex-grow-zero">';
800 $return .= '<div class="info-box info-box-sm">';
801 $return .= '<span class="info-box-icon bg-infobox-action">';
802 $return .= img_picto('', $this->picto);
803 $return .= '</span>';
804 $return .= '<div class="info-box-content">';
805 $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).'</span>';
806 if ($selected >= 0) {
807 $return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
808 }
809 if (property_exists($this, 'datep')) {
810 $return .= '<br><span class="opacitymedium">'.$langs->trans("Date").'</span> : <span class="info-box-label">'.dol_print_date($this->db->jdate($this->datep), 'dayhour').'</span>';
811 }
812 if (property_exists($this, 'fk_typepayment')) {
813 $return .= '<br><span class="opacitymedium">'.$langs->trans("Type").'</span> : <span class="info-box-label">'.$this->fk_typepayment.'</span>';
814 }
815 if (property_exists($this, 'fk_bank') && !is_null($this->fk_bank)) {
816 $return .= '<br><span class="opacitymedium">'.$langs->trans("BankAccount").'</span> : <span class="info-box-label">'.$this->fk_bank.'</span>';
817 }
818 if (property_exists($this, 'amount')) {
819 $return .= '<br><span class="opacitymedium">'.$langs->trans("Amount").'</span> : <span class="info-box-label amount">'.price($this->amount).'</span>';
820 }
821 if (method_exists($this, 'getLibStatut')) {
822 $return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
823 }
824 $return .= '</div>';
825 $return .= '</div>';
826 $return .= '</div>';
827 return $return;
828 }
829}
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.
create($user, $notrigger=0)
Create payment of expense report into database.
fetch($id)
Load object in memory from 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.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Definition html.lib.php:181
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:494