From 4ebd1ff8a2c5fe1452e42866cff9b6d5d65cdd34 Mon Sep 17 00:00:00 2001 From: Benlo Date: Wed, 12 Oct 2016 12:30:22 +0200 Subject: [PATCH 1/2] Permit to print Total TTC price in objectline --- htdocs/core/class/commonobject.class.php | 4 +++- htdocs/core/tpl/objectline_view.tpl.php | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) mode change 100644 => 100755 htdocs/core/tpl/objectline_view.tpl.php diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a82a4c9e537..a09253e02ea 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3277,7 +3277,7 @@ abstract class CommonObject { global $conf, $hookmanager, $langs, $user; // TODO We should not use global var for this ! - global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove; + global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $inputalsopricetotalwithtax; // Define usemargins $usemargins=0; @@ -3340,6 +3340,8 @@ abstract class CommonObject // Multicurrency if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('TotalHTShortCurrency').''; + if ($inputalsopricetotalwithtax) print ''.$langs->trans('TotalTTCShort').''; + print ''; // No width to allow autodim print ''; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php old mode 100644 new mode 100755 index 559cae91464..acdc33db3f1 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -36,7 +36,7 @@ * $type, $text, $description, $line */ -global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins; +global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins, $inputalsopricetotalwithtax; $usemargins=0; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; @@ -45,6 +45,7 @@ if (empty($dateSelector)) $dateSelector=0; if (empty($forceall)) $forceall=0; if (empty($senderissupplier)) $senderissupplier=0; if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; +if (empty($inputalsopricetotalwithtax)) $inputalsopricetotalwithtax=0; if (empty($usemargins)) $usemargins=0; ?> @@ -201,6 +202,10 @@ if (empty($usemargins)) $usemargins=0; multicurrency_total_ht); ?> + + total_ttc); ?> + + statut == 0 && ($object_rights->creer)) { ?> From a46e7d8e1abc9cbdb753d2b45081b2a45945c572 Mon Sep 17 00:00:00 2001 From: Benoit Date: Mon, 24 Oct 2016 10:18:24 +0200 Subject: [PATCH 2/2] Change inputalsopricetotalwithtax to outputalsopricetotalwithtax --- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/tpl/objectline_view.tpl.php | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index a09253e02ea..824c9b032ad 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3277,7 +3277,7 @@ abstract class CommonObject { global $conf, $hookmanager, $langs, $user; // TODO We should not use global var for this ! - global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $inputalsopricetotalwithtax; + global $inputalsopricewithtax, $usemargins, $disableedit, $disablemove, $disableremove, $outputalsopricetotalwithtax; // Define usemargins $usemargins=0; @@ -3340,7 +3340,7 @@ abstract class CommonObject // Multicurrency if (!empty($conf->multicurrency->enabled)) print ''.$langs->trans('TotalHTShortCurrency').''; - if ($inputalsopricetotalwithtax) print ''.$langs->trans('TotalTTCShort').''; + if ($outputalsopricetotalwithtax) print ''.$langs->trans('TotalTTCShort').''; print ''; // No width to allow autodim diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index acdc33db3f1..4df9eb517b1 100755 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -36,7 +36,7 @@ * $type, $text, $description, $line */ -global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins, $inputalsopricetotalwithtax; +global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins, $outputalsopricetotalwithtax; $usemargins=0; if (! empty($conf->margin->enabled) && ! empty($object->element) && in_array($object->element,array('facture','propal','commande'))) $usemargins=1; @@ -45,7 +45,7 @@ if (empty($dateSelector)) $dateSelector=0; if (empty($forceall)) $forceall=0; if (empty($senderissupplier)) $senderissupplier=0; if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0; -if (empty($inputalsopricetotalwithtax)) $inputalsopricetotalwithtax=0; +if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0; if (empty($usemargins)) $usemargins=0; ?> @@ -202,7 +202,7 @@ if (empty($usemargins)) $usemargins=0; multicurrency_total_ht); ?> - + total_ttc); ?>