News:

Looking for documentation? Take a look on our wiki

Main Menu

Missing code for coupon in invoice_items.php

Started by kratzi, October 15, 2016, 13:44:49 PM

Previous topic - Next topic

kratzi

Hi,

when a customer orders with coupon the VAT of the coupon is missing on the invoice. The amount for VAT is subtracted correctly torward the total amount however the VAT value of the coupon is missing on the invoice.

The reason is most likely missing code in invoice_items.php



<?php

if(
$discountsBill){
foreach($discountsBill as $rule){ ?>

<tr >
<td colspan="6" align="right" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
<?php if ( VmConfig::get('show_tax')) { ?>
<td align="right">

#####CODE MISSING HERE TO SHOW VAT OF DISCOUNT COUPON ON INVOICE######

</td>
<?php ?>
<td align="right"><?php echo $this->currency->priceDisplay($rule->calc_amount$this->user_currency_id); ?></td>
<td align="right"><?php echo $this->currency->priceDisplay($rule->calc_amount$this->user_currency_id); ?></td>
</tr>
<?php
}
}



?>




Could you plese assist what the correct code would be. Thank you.

Vm. 3.0.18

kratzi

Hi,

for anyone intersted in a solution.

Replace:

<tr>
<td align="right" class="pricePad" colspan="3"><?php echo vmText::_('COM_VIRTUEMART_COUPON_DISCOUNT').$coupon_code ?></td>
<?php if ( VmConfig::get('show_tax')) { ?>
<td align="right"> </td>
<?php ?>

<td align="right"><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->coupon_discount$this->currency); ?></td>
</tr>


with

<tr>
<td align="right" class="pricePad" colspan="3"><?php echo vmText::_('COM_VIRTUEMART_COUPON_DISCOUNT').$coupon_code ?></td>
<?php if ( VmConfig::get('show_tax')) { ?>


<td align="right"><span class='priceColor2'><?php 
$couponvat
= ($this->orderDetails['details']['BT']->order_billTaxAmount) - ($this->orderDetails['details']['BT']->order_tax);
echo(
$this->currency->priceDisplay($couponvat$this->currency));
?>
</span></td>

<?php ?>

<td align="right"><?php echo $this->currency->priceDisplay($this->orderDetails['details']['BT']->coupon_discount$this->currency); ?></td>
</tr>