From 1ea251d813126f5a0b9edb28e824758f2ce7a035 Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 4 Apr 2023 16:10:02 +0200 Subject: [PATCH 1/5] new attributes on propal card --- htdocs/comm/propal/card.php | 73 ++++++++++++++++++------------------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index abf68f1d30e..d7b51735243 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2753,53 +2753,50 @@ if ($action == 'create') { print ''; + print ''; + print ''; + print ''; - print ''; - print ''; - - // Multicurrency Amount VAT - print ''; - print ''; - print ''; - - // Multicurrency Amount TTC - print ''; - print ''; - print ''; + print ' - ' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code); } + print ''; + print ''; - // Amount HT - print ''; - print ''; + print ''; + print ''; + print ''; print ''; - // Amount VAT - print ''; - print ''; - print ''; - - // Amount Local Taxes - if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { // Localtax1 - print ''; - print ''; - print ''; - } - if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { // Localtax2 - print ''; - print ''; - print ''; + if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { + print ''; + print ''; + print ''; + print ''; + if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { + print ''; + print ''; + print ''; + print ''; + } } - // Amount TTC - print ''; - print ''; + print ''; + print ''; + print ''; print ''; - // Statut - //print ''; - print '
' . $langs->trans('AmountHT') . '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency); if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - // Multicurrency Amount HT - print '
'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
'.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).''.price($object->multicurrency_total_tva, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
'.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).''.price($object->multicurrency_total_ttc, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'
'.$langs->trans('AmountHT').''.price($object->total_ht, '', $langs, 0, - 1, - 1, $conf->currency).'' . $langs->trans('AmountVAT') . '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency); + if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { + print ' - ' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code); + } + print '
'.$langs->trans('AmountVAT').''.price($object->total_tva, '', $langs, 0, - 1, - 1, $conf->currency).'
'.$langs->transcountry("AmountLT1", $mysoc->country_code).''.price($object->total_localtax1, '', $langs, 0, - 1, - 1, $conf->currency).'
'.$langs->transcountry("AmountLT2", $mysoc->country_code).''.price($object->total_localtax2, '', $langs, 0, - 1, - 1, $conf->currency).'
' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency); + if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { + print ' - ' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code); + } + print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency); + if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { + print ' - ' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code); + } + print '
'.$langs->trans('AmountTTC').''.price($object->total_ttc, '', $langs, 0, - 1, - 1, $conf->currency).'
' . $langs->trans('AmountTTC') . '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . '
' . $langs->trans('Status') . '' . $object->getLibStatut(4) . '
'; // Margin Infos From c7657ed3fd9431b4df1f3f6433ffbeff1f859a7b Mon Sep 17 00:00:00 2001 From: FLIO Date: Wed, 5 Apr 2023 02:40:39 +0200 Subject: [PATCH 2/5] fix the missing condition and missing price total_ttc --- htdocs/comm/propal/card.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index d7b51735243..fb2ec070b3c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2757,16 +2757,15 @@ if ($action == 'create') { print '' . $langs->trans('AmountHT') . ''; print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency); if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ' - ' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code); + print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; - print ''; - print ''; + print '' . $langs->trans('AmountVAT') . ''; print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency); if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ' - ' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code); + print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; @@ -2776,16 +2775,15 @@ if ($action == 'create') { print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency); if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ' - ' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code); + print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; - print ''; + if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { - print ''; print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency); if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { - print ' - ' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code); + print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; print ''; @@ -2795,6 +2793,9 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountTTC') . ''; print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $conf->currency) . ''; + if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { + print '' . price($object->total_ttc, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; + } print ''; print ''; From 8463bce9f5c45176a06625ea970f3e8ef3e6c9b9 Mon Sep 17 00:00:00 2001 From: FLIO Date: Wed, 5 Apr 2023 16:02:50 +0200 Subject: [PATCH 3/5] fix. the were 3 lines down after the additional amount --- htdocs/comm/propal/card.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index fb2ec070b3c..5496f02173f 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2755,37 +2755,32 @@ if ($action == 'create') { print ''; print '' . $langs->trans('AmountHT') . ''; - print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency); + print '' . price($object->total_ht, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } - print ''; - print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency); + print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } - print ''; print ''; if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency); + print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } - print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency); + print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } - print ''; print ''; } } From 5e3409936379ceb22aceff06214244dfe57a309b Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 11 Apr 2023 12:48:44 +0200 Subject: [PATCH 4/5] Fix to correspond to the requested table --- htdocs/comm/propal/card.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 5496f02173f..501fb6ab51c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2759,9 +2759,11 @@ if ($action == 'create') { if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->multicurrency_total_ht, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } + print ''; + print ''; print '' . $langs->trans('AmountVAT') . ''; - print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_tva, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->multicurrency_total_tva, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } @@ -2770,14 +2772,16 @@ if ($action == 'create') { if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) { print ''; print '' . $langs->transcountry("AmountLT1", $mysoc->country_code) . ''; - print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } - + print ''; + + print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . ''; - print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; + print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $conf->currency) . ''; if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) { print '' . price($object->total_localtax2, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } From 74c1bcf4e8b0dffd8087aedbd2902da009bcb067 Mon Sep 17 00:00:00 2001 From: FLIO Date: Tue, 11 Apr 2023 12:58:00 +0200 Subject: [PATCH 5/5] Fix to correspond to the requested table --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 501fb6ab51c..d8f4889bbaa 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2777,7 +2777,7 @@ if ($action == 'create') { print '' . price($object->total_localtax1, '', $langs, 0, -1, -1, $object->multicurrency_code) . ''; } print ''; - + print ''; if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) { print '' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '';