News:

Looking for documentation? Take a look on our wiki

Main Menu

Can't remove invoice tax detail lines

Started by austega, May 14, 2015, 04:03:34 AM

Previous topic - Next topic

austega

We are testing an upgrade from VM2.0.20b to VM3.0.9 on Joomla 2.5.28. Test site is http://j3.sag.org.au

The invoice generated for the same order shows additional tax detail lines in VM3.0.9 that we would like to remove. See attached before and after images with the extra lines highlighted.

I have tried to comment out lines 142-159 in invoice_items.php as suggested in http://forum.virtuemart.net/index.php?topic=127935.msg439095#msg439095 - image of my edited code attached.

I may be stuffing up the location of the template override, but I have tried placing the edited file in each of
/templates/rt_afterburner/html/com_virtuemart/views/invoice/tmpl
/templates/rt_afterburner/html/com_virtuemart/invoice/tmpl  and
/templates/rt_afterburner/html/com_virtuemart/invoice

without seeing any impact on an invoice generated from the site's VM | Orders list. The invoice is a generated pdf that is downloaded - could this override code need to be located elsewhere? What else am I missing? And which of the above three locations is the right one?


jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

austega

#3
Thanks for the pointer, JenkinHill. I had searched but did not find.  :-\

Yes changing our sole tax rule configuration to Tax per Product worked for us.

David

AH

You could try looking in this file and changin your tax settings back

components/com_virtuemart/views/invoice/tmpl/invoice_items.php


<?php
$sumRules = array();
foreach($this->orderDetails['calc_rules'] as $rule){
$quantity 1;
//Todo bad construction, storing must be enhanced
if($rule->virtuemart_order_item_id){
foreach($this->orderDetails['items'] as $it){
if($it->virtuemart_order_item_id == $rule->virtuemart_order_item_id){
$quantity $it->product_quantity;
break;
}
}
}
if(!isset($sumRules[$rule->virtuemart_calc_id])){
$sumRules[$rule->virtuemart_calc_id] = new stdClass();
$sumRules[$rule->virtuemart_calc_id]->calc_amount $rule->calc_amount;
$sumRules[$rule->virtuemart_calc_id]->calc_rule_name $rule->calc_rule_name $quantity;
$sumRules[$rule->virtuemart_calc_id]->calc_kind $rule->calc_kind;
} else {
$sumRules[$rule->virtuemart_calc_id]->calc_amount += $rule->calc_amount $quantity;
}
}
//vmdebug('hmm',$this->orderDetails);
foreach($sumRules as $rule){

if ($rule->calc_kind == 'DBTaxRulesBill' or $rule->calc_kind == 'DATaxRulesBill') { ?>

<tr >
<td colspan="6" align="right" class="pricePad"><?php echo $rule->calc_rule_name ?> </td>
<?php if ( VmConfig::get('show_tax')) { ?>
<td align="right"> </td>
<?php ?>
<td align="right"><?php echo $this->currency->priceDisplay($rule->calc_amount$this->currency); ?></td>
<td align="right"><?php echo $this->currency->priceDisplay($rule->calc_amount$this->currency); ?></td>
</tr>
<?php
} elseif ($rule->calc_kind == 'taxRulesBill' or $rule->calc_kind == 'VatTax' ) { ?>

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




You could comment out this section in an override and see what it gives you  ;)
Regards
A

Joomla 4.4.5
php 8.1