From 123101542b3f044f280ee88a552960a7546534d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 30 Dec 2020 19:13:20 +0100 Subject: [PATCH] Update paiement.php --- htdocs/fourn/facture/paiement.php | 53 +++++++++++++++++-------------- 1 file changed, 30 insertions(+), 23 deletions(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 8a7e0cc8054..f88e6dfd834 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -9,7 +9,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2017 Alexandre Spangaro - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * * 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 @@ -42,15 +42,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'bills', 'banks', 'compta')); -$action = GETPOST('action', 'alpha'); -$confirm = GETPOST('confirm', 'alpha'); +$action = GETPOST('action', 'alpha'); +$confirm = GETPOST('confirm', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); -$facid = GETPOST('facid', 'int'); -$socid = GETPOST('socid', 'int'); +$facid = GETPOST('facid', 'int'); +$socid = GETPOST('socid', 'int'); $accountid = GETPOST('accountid', 'int'); $day = GETPOST('day', 'int'); -$month = GETPOST('month', 'int'); +$month = GETPOST('month', 'int'); $year = GETPOST('year', 'int'); $search_ref = GETPOST("search_ref", "alpha"); @@ -562,15 +562,19 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''.$langs->trans('RefSupplier').''; print ''.$langs->trans('Date').''; print ''.$langs->trans('DateMaxPayment').''; - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('Currency').''; - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyAmountTTC').''; - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyAlreadyPaid').''; - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyRemainderToPay').''; + if (!empty($conf->multicurrency->enabled)) { + print ''.$langs->trans('Currency').''; + print ''.$langs->trans('MulticurrencyAmountTTC').''; + print ''.$langs->trans('MulticurrencyAlreadyPaid').''; + print ''.$langs->trans('MulticurrencyRemainderToPay').''; + } print ''.$langs->trans('AmountTTC').''; print ''.$langs->trans('AlreadyPaid').''; print ''.$langs->trans('RemainderToPay').''; print ''.$langs->trans('PaymentAmount').''; - if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('MulticurrencyPaymentAmount').''; + if (!empty($conf->multicurrency->enabled)) { + print ''.$langs->trans('MulticurrencyPaymentAmount').''; + } print ''; $total = 0; @@ -596,8 +600,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT'); // Multicurrency Price - if (!empty($conf->multicurrency->enabled)) - { + if (!empty($conf->multicurrency->enabled)) { $multicurrency_payment = $invoice->getSommePaiement(1); $multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1); $multicurrency_deposits = $invoice->getSumDepositsUsed(1); @@ -616,8 +619,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''.$objp->ref_supplier.''; // Date - if ($objp->df > 0) - { + if ($objp->df > 0) { print ''; print dol_print_date($db->jdate($objp->df), 'day').''; } else { @@ -728,15 +730,16 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $totalrecudeposits += $deposits; $i++; } - if ($i > 1) - { + if ($i > 1) { // Print total print ''; print ''.$langs->trans('TotalTTC').':'; - if (!empty($conf->multicurrency->enabled)) print ' '; - if (!empty($conf->multicurrency->enabled)) print ' '; - if (!empty($conf->multicurrency->enabled)) print ' '; - if (!empty($conf->multicurrency->enabled)) print ' '; + if (!empty($conf->multicurrency->enabled)) { + print ' '; + print ' '; + print ' '; + print ' '; + } print ''.price($sign * $total_ttc).''; print ''.price($sign * $totalrecu); if ($totalrecucreditnote) print '+'.price($totalrecucreditnote); @@ -744,7 +747,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''.price($sign * price2num($total_ttc - $totalrecu - $totalrecucreditnote - $totalrecudeposits, 'MT')).''; print ''; // Autofilled - if (!empty($conf->multicurrency->enabled)) print ''; + if (!empty($conf->multicurrency->enabled)) { + print ''; + } print "\n"; } print "\n"; @@ -785,7 +790,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; } - } else dol_print_error($db); + } else { + dol_print_error($db); + } } // End of page