From 23468929dfee10ceb6394ef58cb56fe92ae9a74f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 May 2022 09:13:37 +0200 Subject: [PATCH] Clean code --- htdocs/compta/tva/payments.php | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index 5b104955716..0279acdeaa4 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -5,7 +5,7 @@ * Copyright (C) 2011-2016 Alexandre Spangaro * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2021 Gauthier VERDOL + * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -180,6 +180,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); + $tva->id = $obj->rowid; + $tva->ref = $obj->rowid; + $tva->label = $obj->label; + $payment_vat_static->id = $obj->pid; $payment_vat_static->ref = $obj->pid; @@ -190,31 +194,32 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { // VAT print ''; - $tva->id = $obj->rowid; - $tva->ref = $obj->rowid; - $tva->label = $obj->label; print $tva->getNomUrl(1, '20'); print ''; // Label - print ''.$obj->label.''; + print ''.dol_escape_htmltag($obj->label).''; // Date - $date = $obj->datev; - print ''.dol_print_date($date, 'day').''; + $date = $db->jdate($obj->datev); + print ''.dol_print_date($date, 'day').''; // Date payment - print ''.dol_print_date($db->jdate($obj->datep), 'day').''; + $datep = $db->jdate($obj->datep); + print ''.dol_print_date($datep, 'day').''; // Type payment - print ''; + $labelpaymenttype = ''; if ($obj->payment_code) { - print $langs->trans("PaymentTypeShort".$obj->payment_code).' '; + $labelpaymenttype = $langs->trans("PaymentTypeShort".$obj->payment_code).' '; } + + print ''; + print dol_escape_htmltag($labelpaymenttype); print ''; // Chq number - print ''.$obj->num_payment.''; + print ''.dol_escape_htmltag($obj->num_payment).''; if (!empty($conf->banque->enabled)) { // Bank transaction @@ -231,10 +236,9 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { print ''; } - // Type - //print ''.$obj->type_label.''; // Expected to pay print ''.price($obj->total).''; + // Paid print ''; if ($obj->totalpaid) {