Skip to content

Commit

Permalink
Merge pull request #8354 from tuxgasy/5.0_multicurrency_objectline_print
Browse files Browse the repository at this point in the history
No display object line curreny if not necessary
  • Loading branch information
eldy committed May 1, 2018
2 parents e181905 + 34145ed commit b1f1ddc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -3370,7 +3370,7 @@ function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0
print '<td class="linecoluht" align="right" width="80">'.$langs->trans('PriceUHT').'</td>';

// Multicurrency
if (!empty($conf->multicurrency->enabled)) print '<td class="linecoluht_currency" align="right" width="80">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</td>';
if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print '<td class="linecoluht_currency" align="right" width="80">'.$langs->trans('PriceUHTCurrency', $this->multicurrency_code).'</td>';

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

Expand Down Expand Up @@ -3409,7 +3409,7 @@ function printObjectLines($action, $seller, $buyer, $selected=0, $dateSelector=0
print '<td class="linecolht" align="right">'.$langs->trans('TotalHTShort').'</td>';

// Multicurrency
if (!empty($conf->multicurrency->enabled)) print '<td class="linecoltotalht_currency" align="right">'.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'</td>';
if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) print '<td class="linecoltotalht_currency" align="right">'.$langs->trans('TotalHTShortCurrency', $this->multicurrency_code).'</td>';

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

Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/tpl/objectline_create.tpl.php
Expand Up @@ -65,7 +65,7 @@
<?php } ?>
<td class="linecolvat" align="right"><span id="title_vat"><?php echo $langs->trans('VAT'); ?></span></td>
<td class="linecoluht" align="right"><span id="title_up_ht"><?php echo $langs->trans('PriceUHT'); ?></span></td>
<?php if (!empty($conf->multicurrency->enabled)) { $colspan++;?>
<?php if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { $colspan++;?>
<td class="linecoluht_currency" align="right"><span id="title_up_ht_currency"><?php echo $langs->trans('PriceUHTCurrency'); ?></span></td>
<?php } ?>
<?php if (! empty($inputalsopricewithtax)) { ?>
Expand Down Expand Up @@ -266,7 +266,7 @@
<input type="text" size="5" name="price_ht" id="price_ht" class="flat" value="<?php echo (isset($_POST["price_ht"])?GETPOST("price_ht",'alpha',2):''); ?>">
</td>

<?php if (!empty($conf->multicurrency->enabled)) { $colspan++;?>
<?php if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { $colspan++;?>
<td class="nobottom linecoluht_currency" align="right">
<input type="text" size="5" name="multicurrency_price_ht" id="multicurrency_price_ht" class="flat" value="<?php echo (isset($_POST["multicurrency_price_ht"])?GETPOST("multicurrency_price_ht",'alpha',2):''); ?>">
</td>
Expand Down Expand Up @@ -402,7 +402,7 @@
}
}

if (!empty($conf->multicurrency->enabled)) $colspan+=2;
if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) $colspan+=2;

if (! empty($usemargins))
{
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/tpl/objectline_edit.tpl.php
Expand Up @@ -122,7 +122,7 @@
if ($this->situation_counter > 1) print ' readonly';
print '></td>';

if (!empty($conf->multicurrency->enabled)) {
if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) {
$colspan++;
print '<td align="right"><input rel="'.$object->multicurrency_tx.'" type="text" class="flat" size="5" id="multicurrency_subprice" name="multicurrency_subprice" value="'.price($line->multicurrency_subprice).'" /></td>';
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/tpl/objectline_view.tpl.php
Expand Up @@ -138,7 +138,7 @@

<td align="right" class="linecoluht nowrap"><?php $coldisplay++; ?><?php echo price($line->subprice); ?></td>

<?php if (!empty($conf->multicurrency->enabled)) { ?>
<?php if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { ?>
<td align="right" class="linecoluht_currency nowrap"><?php $coldisplay++; ?><?php echo price($line->multicurrency_subprice); ?></td>
<?php } ?>

Expand Down Expand Up @@ -204,7 +204,7 @@
<td align="right" class="linecoloption nowrap"><?php $coldisplay++; ?><?php echo $langs->trans('Option'); ?></td>
<?php } else { ?>
<td align="right" class="liencolht nowrap"><?php $coldisplay++; ?><?php echo price($line->total_ht); ?></td>
<?php if (!empty($conf->multicurrency->enabled)) { ?>
<?php if (!empty($conf->multicurrency->enabled) && $object->multicurrency_code != $conf->currency) { ?>
<td align="right" class="linecolutotalht_currency nowrap"><?php $coldisplay++; ?><?php echo price($line->multicurrency_total_ht); ?></td>
<?php } ?>
<?php } ?>
Expand Down

0 comments on commit b1f1ddc

Please sign in to comment.