From 61d5e8967712a7bb395584e5e6fc94ce99045c63 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Thu, 9 Jun 2022 04:01:02 +0200 Subject: [PATCH 1/2] Look & Feel - Align amount to right on card --- htdocs/compta/facture/card.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 0fefbbab118..985a10c392e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4711,36 +4711,36 @@ if ($action == 'create') { if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''; - print ''.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount VAT print ''.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''; - print ''.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount TTC print ''.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''; - print ''.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; } // Amount print ''.$langs->trans('AmountHT').''; - print ''.price($sign * $object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.price($sign * $object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).''; // Vat - print ''.$langs->trans('AmountVAT').''.price($sign * $object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.$langs->trans('AmountVAT').''.price($sign * $object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).''; print ''; // Amount Local Taxes if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { // Localtax1 print ''.$langs->transcountry("AmountLT1", $mysoc->country_code).''; - print ''.price($sign * $object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.price($sign * $object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).''; } if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { // Localtax2 print ''.$langs->transcountry("AmountLT2", $mysoc->country_code).''; - print ''.price($sign * $object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.price($sign * $object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).''; } // Revenue stamp @@ -4796,7 +4796,7 @@ if ($action == 'create') { } // Total with tax - print ''.$langs->trans('AmountTTC').''.price($sign * $object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).''; + print ''.$langs->trans('AmountTTC').''.price($sign * $object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).''; print ''; From a8e4aec5c238f0a9fa38ce12f4a3cfb9497742b2 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Wed, 15 Jun 2022 04:46:58 +0200 Subject: [PATCH 2/2] Same modification on supplier invoice --- htdocs/fourn/facture/card.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index a7d03c901c9..c2fc4e8511a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -8,10 +8,10 @@ * Copyright (C) 2013-2015 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2016 Marcos García - * Copyright (C) 2016-2021 Alexandre Spangaro + * Copyright (C) 2016-2022 Alexandre Spangaro * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2019 Ferran Marcet - * Copyright (C) 2022 Gauthier VERDOL + * Copyright (C) 2022 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 @@ -3169,23 +3169,28 @@ if ($action == 'create') { if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''; - print ''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount VAT print ''.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''; - print ''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; // Multicurrency Amount TTC print ''.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''; - print ''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; + print ''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''; print ''; } // Amount - print ''.$langs->trans('AmountHT').''.price($object->total_ht, 1, $langs, 0, -1, -1, $conf->currency).''; - print ''.$langs->trans('AmountVAT').''.price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency); + print ''.$langs->trans('AmountHT').''; + print ''.price($object->total_ht, 1, $langs, 0, -1, -1, $conf->currency).''; + print ''; + + // VAT + print ''.$langs->trans('AmountVAT').''; + print ''; if (GETPOST('calculationrule')) { $calculationrule = GETPOST('calculationrule', 'alpha'); } else { @@ -3203,25 +3208,28 @@ if ($action == 'create') { $s .= ' / '; $s .= ''.$langs->trans("Mode2").''; print '
'; - print '         '; print $form->textwithtooltip($s, $langs->trans("CalculationRuleDesc", $calculationrulenum).'
'.$langs->trans("CalculationRuleDescSupplier"), 2, 1, img_picto('', 'help'), '', 3, '', 0, 'recalculate'); + print '       '; print '
'; } + print price($object->total_tva, 1, $langs, 0, -1, -1, $conf->currency); print ''; // Amount Local Taxes //TODO: Place into a function to control showing by country or study better option if ($societe->localtax1_assuj == "1") { //Localtax1 print ''.$langs->transcountry("AmountLT1", $societe->country_code).''; - print ''.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).''; + print ''.price($object->total_localtax1, 1, $langs, 0, -1, -1, $conf->currency).''; print ''; } if ($societe->localtax2_assuj == "1") { //Localtax2 print ''.$langs->transcountry("AmountLT2", $societe->country_code).''; - print ''.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).''; + print ''.price($object->total_localtax2, 1, $langs, 0, -1, -1, $conf->currency).''; print ''; } - print ''.$langs->trans('AmountTTC').''.price($object->total_ttc, 1, $langs, 0, -1, -1, $conf->currency).''; + print ''.$langs->trans('AmountTTC').''; + print ''.price($object->total_ttc, 1, $langs, 0, -1, -1, $conf->currency).''; + print ''; print '';