Skip to content

Commit

Permalink
Merge pull request #5863 from benlo06/fr_total_tva
Browse files Browse the repository at this point in the history
New: Permit to print TotalTTC price in objectline_view
  • Loading branch information
eldy committed Nov 8, 2016
2 parents bc24516 + a46e7d8 commit a28e2a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion htdocs/core/class/commonobject.class.php
Expand Up @@ -3280,7 +3280,7 @@ function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0
{
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, $outputalsopricetotalwithtax;

// Define usemargins
$usemargins=0;
Expand Down Expand Up @@ -3343,6 +3343,8 @@ function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0
// Multicurrency
if (!empty($conf->multicurrency->enabled)) print '<td class="linecoltotalht_currency" align="right">'.$langs->trans('TotalHTShortCurrency').'</td>';

if ($outputalsopricetotalwithtax) print '<td align="right" width="80">'.$langs->trans('TotalTTCShort').'</td>';

print '<td class="linecoledit"></td>'; // No width to allow autodim

print '<td class="linecoldelete" width="10"></td>';
Expand Down
7 changes: 6 additions & 1 deletion htdocs/core/tpl/objectline_view.tpl.php 100644 → 100755
Expand Up @@ -36,7 +36,7 @@
* $type, $text, $description, $line
*/

global $forceall, $senderissupplier, $inputalsopricewithtax, $usemargins;
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;
Expand All @@ -45,6 +45,7 @@
if (empty($forceall)) $forceall=0;
if (empty($senderissupplier)) $senderissupplier=0;
if (empty($inputalsopricewithtax)) $inputalsopricewithtax=0;
if (empty($outputalsopricetotalwithtax)) $outputalsopricetotalwithtax=0;
if (empty($usemargins)) $usemargins=0;
?>
<?php $coldisplay=0; ?>
Expand Down Expand Up @@ -203,6 +204,10 @@
<td align="right" class="linecolutotalht_currency nowrap"><?php $coldisplay++; ?><?php echo price($line->multicurrency_total_ht); ?></td>
<?php } ?>
<?php } ?>
<?php if ($outputalsopricetotalwithtax) { ?>
<td align="right" class="liencolht nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ttc); ?></td>
<?php } ?>


<?php
if ($this->statut == 0 && ($object_rights->creer)) { ?>
Expand Down

0 comments on commit a28e2a7

Please sign in to comment.