dolibarr 25.0.0-alpha
paymentvat.class.php
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) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
5 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
6 * Copyright (C) 2024-2026 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/tva/class/tva.class.php';
30
31
36{
40 public $element = 'payment_vat';
41
45 public $table_element = 'payment_vat';
46
50 public $picto = 'payment';
51
55 public $fk_tva;
56
60 public $datec = '';
61
65 public $datep = '';
66
72 public $total;
73
77 public $amount; // Total amount of payment
78
82 public $amounts = array(); // Array of amounts
83
87 public $fk_typepaiement;
88
94 public $num_paiement;
95
100 public $num_payment;
101
105 public $fk_bank;
106
110 public $fk_user_creat;
111
115 public $fk_user_modif;
116
120 public $chid;
121
127 public $lib;
128
132 public $datepaye;
133
137 public $type_code;
138
142 public $type_label;
143
147 public $bank_account;
148
152 public $bank_line;
153
157 public $paiementtype;
158
164 public function __construct($db)
165 {
166 $this->db = $db;
167 }
168
177 public function create($user, $closepaidvat = 0)
178 {
179 $error = 0;
180
181 $now = dol_now();
182
183 dol_syslog(get_class($this)."::create", LOG_DEBUG);
184
185 // Validate parameters
186 if (!$this->datepaye) {
187 $this->error = 'ErrorBadValueForParameterCreatePaymentVAT';
188 return -1;
189 }
190
191 // Clean parameters
192 if (isset($this->fk_tva)) {
193 $this->fk_tva = (int) $this->fk_tva;
194 }
195 if (isset($this->amount)) {
196 $this->amount = (float) $this->amount;
197 }
198 if (isset($this->fk_typepaiement)) {
199 $this->fk_typepaiement = (int) $this->fk_typepaiement;
200 }
201 if (isset($this->num_paiement)) {
202 $this->num_paiement = trim($this->num_paiement); // deprecated
203 }
204 if (isset($this->num_payment)) {
205 $this->num_payment = trim($this->num_payment);
206 }
207 if (isset($this->note)) {
208 $this->note = trim($this->note);
209 }
210 if (isset($this->fk_bank)) {
211 $this->fk_bank = (int) $this->fk_bank;
212 }
213 if (isset($this->fk_user_creat)) {
214 $this->fk_user_creat = (int) $this->fk_user_creat;
215 }
216 if (isset($this->fk_user_modif)) {
217 $this->fk_user_modif = (int) $this->fk_user_modif;
218 }
219
220 $totalamount = 0;
221 foreach ($this->amounts as $key => $value) { // How payment is dispatch
222 $newvalue = (float) price2num($value, 'MT');
223 $this->amounts[$key] = $newvalue;
224 $totalamount += $newvalue;
225 }
226 // $totalamount = price2num($totalamount);
227
228 // Check parameters
229 if ($totalamount == 0) {
230 return -1; // We accept negative amounts for chargebacks, but not null amounts.
231 }
232
233
234 $this->db->begin();
235
236 if ($totalamount != 0) {
237 $sql = "INSERT INTO ".MAIN_DB_PREFIX."payment_vat (fk_tva, datec, datep, amount,";
238 $sql .= " fk_typepaiement, num_paiement, note, fk_user_creat, fk_bank)";
239 $sql .= " VALUES (".((int) $this->chid).", '".$this->db->idate($now)."',";
240 $sql .= " '".$this->db->idate($this->datepaye)."',";
241 $sql .= " ".((float) $totalamount).",";
242 $sql .= " ".((int) $this->paiementtype).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note)."', ".((int) $user->id).",";
243 $sql .= " 0)";
244
245 $resql = $this->db->query($sql);
246 if ($resql) {
247 $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_vat");
248
249 // Insert table of amounts / invoices
250 foreach ($this->amounts as $key => $amount) {
251 $contribid = $key;
252 if (is_numeric($amount) && $amount != 0) {
253 $amount = (float) price2num($amount);
254
255 // If we want to closed paid invoices
256 if ($closepaidvat) {
257 $contrib = new Tva($this->db);
258 $contrib->fetch($contribid);
259 $paiement = $contrib->getSommePaiement();
260 //$creditnotes=$contrib->getSumCreditNotesUsed();
261 $creditnotes = 0;
262 //$deposits=$contrib->getSumDepositsUsed();
263 $deposits = 0;
264 $alreadypayed = (float) price2num($paiement + $creditnotes + $deposits, 'MT');
265 $remaintopay = (float) price2num($contrib->amount - $paiement - $creditnotes - $deposits, 'MT');
266 if ($remaintopay == 0) {
267 $result = $contrib->setPaid($user);
268 } else {
269 dol_syslog("Remain to pay for conrib ".$contribid." not null. We do nothing.");
270 }
271 }
272 }
273 }
274 } else {
275 $error++;
276 }
277 }
278
279 $result = $this->call_trigger('PAYMENTVAT_CREATE', $user);
280 if ($result < 0) {
281 $error++;
282 }
283
284 if ($totalamount != 0 && !$error) {
285 $this->amount = $totalamount;
286 $this->total = $totalamount; // deprecated
287 $this->db->commit();
288 return $this->id;
289 } else {
290 $this->error = $this->db->error();
291 $this->db->rollback();
292 return -1;
293 }
294 }
295
302 public function fetch($id)
303 {
304 $sql = "SELECT";
305 $sql .= " t.rowid,";
306 $sql .= " t.fk_tva,";
307 $sql .= " t.datec,";
308 $sql .= " t.tms,";
309 $sql .= " t.datep,";
310 $sql .= " t.amount,";
311 $sql .= " t.fk_typepaiement,";
312 $sql .= " t.num_paiement as num_payment,";
313 $sql .= " t.note as note_private,";
314 $sql .= " t.fk_bank,";
315 $sql .= " t.fk_user_creat,";
316 $sql .= " t.fk_user_modif,";
317 $sql .= " pt.code as type_code, pt.libelle as type_label,";
318 $sql .= ' b.fk_account';
319 $sql .= " FROM ".MAIN_DB_PREFIX."payment_vat as t LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pt ON t.fk_typepaiement = pt.id";
320 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON t.fk_bank = b.rowid';
321 $sql .= " WHERE t.rowid = ".((int) $id);
322 // TODO link on entity of tax;
323
324 dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
325 $resql = $this->db->query($sql);
326 if ($resql) {
327 if ($this->db->num_rows($resql)) {
328 $obj = $this->db->fetch_object($resql);
329
330 $this->id = $obj->rowid;
331 $this->ref = $obj->rowid;
332
333 $this->fk_tva = $obj->fk_tva;
334 $this->datec = $this->db->jdate($obj->datec);
335 $this->tms = $this->db->jdate($obj->tms);
336 $this->datep = $this->db->jdate($obj->datep);
337 $this->amount = $obj->amount;
338 $this->fk_typepaiement = $obj->fk_typepaiement;
339 $this->num_paiement = $obj->num_payment;
340 $this->num_payment = $obj->num_payment;
341 $this->note = $obj->note_private;
342 $this->note_private = $obj->note_private;
343 $this->fk_bank = $obj->fk_bank;
344 $this->fk_user_creat = $obj->fk_user_creat;
345 $this->fk_user_modif = $obj->fk_user_modif;
346
347 $this->type_code = $obj->type_code;
348 $this->type_label = $obj->type_label;
349
350 $this->bank_account = $obj->fk_account;
351 $this->bank_line = $obj->fk_bank;
352 }
353 $this->db->free($resql);
354
355 return 1;
356 } else {
357 $this->error = "Error ".$this->db->lasterror();
358 return -1;
359 }
360 }
361
362
370 public function update($user = null, $notrigger = 0)
371 {
372 global $conf, $langs;
373 $error = 0;
374
375 // Clean parameters
376
377 if (isset($this->fk_tva)) {
378 $this->fk_tva = (int) $this->fk_tva;
379 }
380 if (isset($this->amount)) {
381 $this->amount = (float) $this->amount;
382 }
383 if (isset($this->fk_typepaiement)) {
384 $this->fk_typepaiement = (int) $this->fk_typepaiement;
385 }
386 if (isset($this->num_payment)) {
387 $this->num_payment = trim($this->num_payment);
388 }
389 if (isset($this->note)) {
390 $this->note = trim($this->note);
391 }
392 if (isset($this->fk_bank)) {
393 $this->fk_bank = (int) $this->fk_bank;
394 }
395 if (isset($this->fk_user_creat)) {
396 $this->fk_user_creat = (int) $this->fk_user_creat;
397 }
398 if (isset($this->fk_user_modif)) {
399 $this->fk_user_modif = (int) $this->fk_user_modif;
400 }
401
402 // Check parameters
403 // Put here code to add control on parameters values
404
405 // Update request
406 $sql = "UPDATE ".MAIN_DB_PREFIX."payment_vat SET";
407 $sql .= " fk_tva=".(isset($this->fk_tva) ? ((int) $this->fk_tva) : "null").",";
408 $sql .= " datec=".(dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').",";
409 $sql .= " tms=".(dol_strlen((string) $this->tms) != 0 ? "'".$this->db->idate($this->tms)."'" : 'null').",";
410 $sql .= " datep=".(dol_strlen($this->datep) != 0 ? "'".$this->db->idate($this->datep)."'" : 'null').",";
411 $sql .= " amount=".(isset($this->amount) ? (float) price2num($this->amount) : "null").",";
412 $sql .= " fk_typepaiement=".(isset($this->fk_typepaiement) ? ((int) $this->fk_typepaiement) : "null").",";
413 $sql .= " num_paiement=".(isset($this->num_payment) ? "'".$this->db->escape($this->num_payment)."'" : "null").",";
414 $sql .= " note=".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : "null").",";
415 $sql .= " fk_bank=".(isset($this->fk_bank) ? ((int) $this->fk_bank) : "null").",";
416 $sql .= " fk_user_creat=".(isset($this->fk_user_creat) ? ((int) $this->fk_user_creat) : "null").",";
417 $sql .= " fk_user_modif=".(isset($this->fk_user_modif) ? ((int) $this->fk_user_modif) : "null");
418 $sql .= " WHERE rowid=".((int) $this->id);
419
420 $this->db->begin();
421
422 dol_syslog(get_class($this)."::update", LOG_DEBUG);
423 $resql = $this->db->query($sql);
424 if (!$resql) {
425 $error++;
426 $this->errors[] = "Error ".$this->db->lasterror();
427 }
428
429 // Commit or rollback
430 if ($error) {
431 foreach ($this->errors as $errmsg) {
432 dol_syslog(get_class($this)."::update ".$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
451 public function delete($user, $notrigger = 0)
452 {
453 $error = 0;
454
455 dol_syslog(get_class($this)."::delete");
456
457 $this->db->begin();
458
459 if ($this->bank_line > 0) {
460 $accline = new AccountLine($this->db);
461 $result = $accline->fetch($this->bank_line);
462 if ($result > 0) {
463 $result = $accline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
464 if ($result < 0) {
465 $this->errors[] = $accline->error;
466 $error++;
467 }
468 }
469 }
470
471 if (!$error) {
472 $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_vat";
473 $sql .= " WHERE rowid=".((int) $this->id);
474
475 dol_syslog(get_class($this)."::delete", LOG_DEBUG);
476 $resql = $this->db->query($sql);
477 if (!$resql) {
478 $error++;
479 $this->errors[] = "Error ".$this->db->lasterror();
480 }
481 }
482
483 // Commit or rollback
484 if ($error) {
485 foreach ($this->errors as $errmsg) {
486 dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
487 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
488 }
489 $this->db->rollback();
490 return -1 * $error;
491 } else {
492 $this->db->commit();
493 return 1;
494 }
495 }
496
497
498
506 public function createFromClone(User $user, $fromid)
507 {
508 $error = 0;
509
510 $object = new PaymentVAT($this->db);
511
512 $this->db->begin();
513
514 // Load source object
515 $object->fetch($fromid);
516 $object->id = 0;
517 $object->status = 0;
518 $object->statut = 0;
519
520 // Clear fields
521
522 // Create clone
523 $object->context['createfromclone'] = 'createfromclone';
524 $result = $object->create($user);
525
526 // Other options
527 if ($result < 0) {
528 $this->error = $object->error;
529 $error++;
530 }
531
532 unset($object->context['createfromclone']);
533
534 // End
535 if (!$error) {
536 $this->db->commit();
537 return $object->id;
538 } else {
539 $this->db->rollback();
540 return -1;
541 }
542 }
543
544
552 public function initAsSpecimen()
553 {
554 $this->id = 0;
555 $this->fk_tva = 0;
556 $this->datec = dol_now();
557 $this->tms = dol_now();
558 $this->datep = dol_now();
559 $this->amount = 100;
560 $this->fk_typepaiement = 0;
561 $this->num_payment = '123456';
562 $this->note_private = 'Private note';
563 $this->note_public = 'Public note';
564 $this->fk_bank = 0;
565 $this->fk_user_creat = 0;
566 $this->fk_user_modif = 0;
567
568 return 1;
569 }
570
571
584 public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
585 {
586 // Clean data
587 $this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement);
588
589 $error = 0;
590
591 if (isModEnabled("bank")) {
592 include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
593
594 $acc = new Account($this->db);
595 $acc->fetch($accountid);
596
597 $total = $this->amount;
598 if ($mode == 'payment_vat') {
599 $total = -$total;
600 }
601
602 // Insert payment into llx_bank
603 $bank_line_id = $acc->addline(
604 $this->datepaye,
605 $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example")
606 $label,
607 $total,
608 $this->num_payment,
609 0,
610 $user,
611 $emetteur_nom,
612 $emetteur_banque
613 );
614
615 // Update fk_bank in llx_paiement.
616 // We thus know the payment that generated the bank entry
617 if ($bank_line_id > 0) {
618 $result = $this->update_fk_bank($bank_line_id);
619 if ($result <= 0) {
620 $error++;
621 dol_print_error($this->db);
622 }
623
624 // Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction
625 $url = '';
626 if ($mode == 'payment_vat') {
627 $url = DOL_URL_ROOT.'/compta/payment_vat/card.php?id=';
628 }
629 if ($url) {
630 $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
631 if ($result <= 0) {
632 $error++;
633 dol_print_error($this->db);
634 }
635 }
636
637 // Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
638 $linkaddedforthirdparty = array();
639 foreach ($this->amounts as $key => $value) {
640 if ($mode == 'payment_vat') {
641 $tva = new Tva($this->db);
642 $tva->fetch($key);
643 $result = $acc->add_url_line($bank_line_id, $tva->id, DOL_URL_ROOT.'/compta/tva/card.php?id=', '('.$tva->label.')', 'vat');
644 if ($result <= 0) {
645 dol_print_error($this->db);
646 }
647 }
648 }
649 } else {
650 $this->error = $acc->error;
651 $error++;
652 }
653 }
654
655 if (!$error) {
656 return 1;
657 } else {
658 return -1;
659 }
660 }
661
662
663 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
670 public function update_fk_bank($id_bank)
671 {
672 // phpcs:enable
673 $sql = "UPDATE ".MAIN_DB_PREFIX."payment_vat SET fk_bank = ".((int) $id_bank)." WHERE rowid = ".((int) $this->id);
674
675 dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
676 $result = $this->db->query($sql);
677 if ($result) {
678 return 1;
679 } else {
680 $this->error = $this->db->error();
681 return 0;
682 }
683 }
684
685
692 public function getLibStatut($mode = 0)
693 {
694 return $this->LibStatut($this->statut, $mode);
695 }
696
697 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
705 public function LibStatut($status, $mode = 0)
706 {
707 // phpcs:enable
708 global $langs;
709
710 $langs->load('compta');
711 /*if ($mode == 0)
712 {
713 if ($status == 0) return $langs->trans('ToValidate');
714 if ($status == 1) return $langs->trans('Validated');
715 }
716 if ($mode == 1)
717 {
718 if ($status == 0) return $langs->trans('ToValidate');
719 if ($status == 1) return $langs->trans('Validated');
720 }
721 if ($mode == 2)
722 {
723 if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
724 if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
725 }
726 if ($mode == 3)
727 {
728 if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1');
729 if ($status == 1) return img_picto($langs->trans('Validated'),'statut4');
730 }
731 if ($mode == 4)
732 {
733 if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
734 if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
735 }
736 if ($mode == 5)
737 {
738 if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
739 if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
740 }
741 if ($mode == 6)
742 {
743 if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
744 if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
745 }*/
746 return '';
747 }
748
756 public function getNomUrl($withpicto = 0, $maxlen = 0)
757 {
758 global $langs;
759
760 $result = '';
761
762 if (empty($this->ref)) {
763 $this->ref = $this->lib;
764 }
765
766 $label = img_picto('', $this->picto).' <u>'.$langs->trans("VATPayment").'</u>';
767 $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
768 if (!empty($this->label)) {
769 $labeltoshow = $this->label;
770 $reg = array();
771 if (preg_match('/^\‍((.*)\‍)$/i', $this->label, $reg)) {
772 // Label generique car entre parentheses. On l'affiche en le traduisant
773 if ($reg[1] == 'paiement') {
774 $reg[1] = 'Payment';
775 }
776 $labeltoshow = $langs->trans($reg[1]);
777 }
778 $label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
779 }
780 if ($this->datep) {
781 $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'day');
782 }
783
784 if (!empty($this->id)) {
785 $link = '<a href="'.DOL_URL_ROOT.'/compta/payment_vat/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
786 $linkend = '</a>';
787
788 if ($withpicto) {
789 $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
790 }
791 if ($withpicto && $withpicto != 2) {
792 $result .= ' ';
793 }
794 if ($withpicto != 2) {
795 $result .= $link.($maxlen ? dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
796 }
797 }
798
799 return $result;
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.
Parent class of all other business classes (invoices, contracts, proposals, orders,...
Class to manage payments of social contributions.
initAsSpecimen()
Initialise an instance with random values.
LibStatut($status, $mode=0)
Return the label of a given status.
create($user, $closepaidvat=0)
Create payment of vat into database.
__construct($db)
Constructor.
update_fk_bank($id_bank)
Update link between vat payment and line in llx_bank generated.
fetch($id)
Load object in memory from database.
createFromClone(User $user, $fromid)
Load an object from its id and create a new one in database.
getLibStatut($mode=0)
Return the label of the status.
getNomUrl($withpicto=0, $maxlen=0)
Return clickable name (with picto eventually)
update($user=null, $notrigger=0)
Update 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.
Class to manage VAT - Value-added tax (also known in French as TVA)
Definition tva.class.php:39
Class to manage Dolibarr users.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
dol_now($mode='gmt')
Return date for now.
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)
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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_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.
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)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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