dolibarr 23.0.3
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 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)."', ".$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 $accline->fetch($this->bank_line);
462 $result = $accline->delete($user);
463 if ($result < 0) {
464 $this->errors[] = $accline->error;
465 $error++;
466 }
467 }
468
469 if (!$error) {
470 $sql = "DELETE FROM ".MAIN_DB_PREFIX."payment_vat";
471 $sql .= " WHERE rowid=".((int) $this->id);
472
473 dol_syslog(get_class($this)."::delete", LOG_DEBUG);
474 $resql = $this->db->query($sql);
475 if (!$resql) {
476 $error++;
477 $this->errors[] = "Error ".$this->db->lasterror();
478 }
479 }
480
481 // Commit or rollback
482 if ($error) {
483 foreach ($this->errors as $errmsg) {
484 dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
485 $this->error .= ($this->error ? ', '.$errmsg : $errmsg);
486 }
487 $this->db->rollback();
488 return -1 * $error;
489 } else {
490 $this->db->commit();
491 return 1;
492 }
493 }
494
495
496
504 public function createFromClone(User $user, $fromid)
505 {
506 $error = 0;
507
508 $object = new PaymentVAT($this->db);
509
510 $this->db->begin();
511
512 // Load source object
513 $object->fetch($fromid);
514 $object->id = 0;
515 $object->status = 0;
516 $object->statut = 0;
517
518 // Clear fields
519
520 // Create clone
521 $object->context['createfromclone'] = 'createfromclone';
522 $result = $object->create($user);
523
524 // Other options
525 if ($result < 0) {
526 $this->error = $object->error;
527 $error++;
528 }
529
530 unset($object->context['createfromclone']);
531
532 // End
533 if (!$error) {
534 $this->db->commit();
535 return $object->id;
536 } else {
537 $this->db->rollback();
538 return -1;
539 }
540 }
541
542
550 public function initAsSpecimen()
551 {
552 $this->id = 0;
553 $this->fk_tva = 0;
554 $this->datec = dol_now();
555 $this->tms = dol_now();
556 $this->datep = dol_now();
557 $this->amount = 100;
558 $this->fk_typepaiement = 0;
559 $this->num_payment = '123456';
560 $this->note_private = 'Private note';
561 $this->note_public = 'Public note';
562 $this->fk_bank = 0;
563 $this->fk_user_creat = 0;
564 $this->fk_user_modif = 0;
565
566 return 1;
567 }
568
569
582 public function addPaymentToBank($user, $mode, $label, $accountid, $emetteur_nom, $emetteur_banque)
583 {
584 // Clean data
585 $this->num_payment = trim($this->num_payment ? $this->num_payment : $this->num_paiement);
586
587 $error = 0;
588
589 if (isModEnabled("bank")) {
590 include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
591
592 $acc = new Account($this->db);
593 $acc->fetch($accountid);
594
595 $total = $this->amount;
596 if ($mode == 'payment_vat') {
597 $total = -$total;
598 }
599
600 // Insert payment into llx_bank
601 $bank_line_id = $acc->addline(
602 $this->datepaye,
603 $this->paiementtype, // Payment mode id or code ("CHQ or VIR for example")
604 $label,
605 $total,
606 $this->num_payment,
607 0,
608 $user,
609 $emetteur_nom,
610 $emetteur_banque
611 );
612
613 // Update fk_bank in llx_paiement.
614 // We thus know the payment that generated the bank entry
615 if ($bank_line_id > 0) {
616 $result = $this->update_fk_bank($bank_line_id);
617 if ($result <= 0) {
618 $error++;
619 dol_print_error($this->db);
620 }
621
622 // Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction
623 $url = '';
624 if ($mode == 'payment_vat') {
625 $url = DOL_URL_ROOT.'/compta/payment_vat/card.php?id=';
626 }
627 if ($url) {
628 $result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
629 if ($result <= 0) {
630 $error++;
631 dol_print_error($this->db);
632 }
633 }
634
635 // Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
636 $linkaddedforthirdparty = array();
637 foreach ($this->amounts as $key => $value) {
638 if ($mode == 'payment_vat') {
639 $tva = new Tva($this->db);
640 $tva->fetch($key);
641 $result = $acc->add_url_line($bank_line_id, $tva->id, DOL_URL_ROOT.'/compta/tva/card.php?id=', '('.$tva->label.')', 'vat');
642 if ($result <= 0) {
643 dol_print_error($this->db);
644 }
645 }
646 }
647 } else {
648 $this->error = $acc->error;
649 $error++;
650 }
651 }
652
653 if (!$error) {
654 return 1;
655 } else {
656 return -1;
657 }
658 }
659
660
661 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
668 public function update_fk_bank($id_bank)
669 {
670 // phpcs:enable
671 $sql = "UPDATE ".MAIN_DB_PREFIX."payment_vat SET fk_bank = ".((int) $id_bank)." WHERE rowid = ".((int) $this->id);
672
673 dol_syslog(get_class($this)."::update_fk_bank", LOG_DEBUG);
674 $result = $this->db->query($sql);
675 if ($result) {
676 return 1;
677 } else {
678 $this->error = $this->db->error();
679 return 0;
680 }
681 }
682
683
690 public function getLibStatut($mode = 0)
691 {
692 return $this->LibStatut($this->statut, $mode);
693 }
694
695 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
703 public function LibStatut($status, $mode = 0)
704 {
705 // phpcs:enable
706 global $langs;
707
708 $langs->load('compta');
709 /*if ($mode == 0)
710 {
711 if ($status == 0) return $langs->trans('ToValidate');
712 if ($status == 1) return $langs->trans('Validated');
713 }
714 if ($mode == 1)
715 {
716 if ($status == 0) return $langs->trans('ToValidate');
717 if ($status == 1) return $langs->trans('Validated');
718 }
719 if ($mode == 2)
720 {
721 if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
722 if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
723 }
724 if ($mode == 3)
725 {
726 if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1');
727 if ($status == 1) return img_picto($langs->trans('Validated'),'statut4');
728 }
729 if ($mode == 4)
730 {
731 if ($status == 0) return img_picto($langs->trans('ToValidate'),'statut1').' '.$langs->trans('ToValidate');
732 if ($status == 1) return img_picto($langs->trans('Validated'),'statut4').' '.$langs->trans('Validated');
733 }
734 if ($mode == 5)
735 {
736 if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
737 if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
738 }
739 if ($mode == 6)
740 {
741 if ($status == 0) return $langs->trans('ToValidate').' '.img_picto($langs->trans('ToValidate'),'statut1');
742 if ($status == 1) return $langs->trans('Validated').' '.img_picto($langs->trans('Validated'),'statut4');
743 }*/
744 return '';
745 }
746
754 public function getNomUrl($withpicto = 0, $maxlen = 0)
755 {
756 global $langs;
757
758 $result = '';
759
760 if (empty($this->ref)) {
761 $this->ref = $this->lib;
762 }
763
764 $label = img_picto('', $this->picto).' <u>'.$langs->trans("VATPayment").'</u>';
765 $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
766 if (!empty($this->label)) {
767 $labeltoshow = $this->label;
768 $reg = array();
769 if (preg_match('/^\‍((.*)\‍)$/i', $this->label, $reg)) {
770 // Label generique car entre parentheses. On l'affiche en le traduisant
771 if ($reg[1] == 'paiement') {
772 $reg[1] = 'Payment';
773 }
774 $labeltoshow = $langs->trans($reg[1]);
775 }
776 $label .= '<br><b>'.$langs->trans('Label').':</b> '.$labeltoshow;
777 }
778 if ($this->datep) {
779 $label .= '<br><b>'.$langs->trans('Date').':</b> '.dol_print_date($this->datep, 'day');
780 }
781
782 if (!empty($this->id)) {
783 $link = '<a href="'.DOL_URL_ROOT.'/compta/payment_vat/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
784 $linkend = '</a>';
785
786 if ($withpicto) {
787 $result .= ($link.img_object($label, 'payment', 'class="classfortooltip"').$linkend.' ');
788 }
789 if ($withpicto && $withpicto != 2) {
790 $result .= ' ';
791 }
792 if ($withpicto != 2) {
793 $result .= $link.($maxlen ? dol_trunc($this->ref, $maxlen) : $this->ref).$linkend;
794 }
795 }
796
797 return $result;
798 }
799}
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 - Taxe sur la valeur ajoutée)
Definition tva.class.php:39
Class to manage Dolibarr users.
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...
if(getDolGlobalString( 'TAKEPOS_SHOW_CUSTOMER')) print $langs trans('Date')." left 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 PaymentTypeShortLIQ right SELECT p pos_change as p datep as p p num_paiement as f pf amount as amount
Definition receipt.php:466