fix tax claculation for trusted store tracking code

This commit is contained in:
Daniel Seifert 2015-07-10 15:08:16 +00:00
bovenliggende b064f8e1a8
commit ce2c2541c6
2 gewijzigde bestanden met toevoegingen van 48 en 1 verwijderingen

Bestand weergeven

@ -50,7 +50,7 @@
<span id="gts-o-total">[{$sTotal|string_format:"%.2f"}]</span>
<span id="gts-o-discounts">-[{$oOrder->getFieldData('oxdiscount')|string_format:"%.2f"}]</span>
<span id="gts-o-shipping-total">[{$oOrder->getFieldData('oxdelcost')|string_format:"%.2f"}]</span>
<span id="gts-o-tax-total">[{math equation="fi + se + th + fo" fi=$oOrder->getFieldData('oxartvatprice1') se=$oOrder->getFieldData('oxartvatprice2') th=$oOrder->getFieldData('oxpayvat') fo=$oOrder->getFieldData('oxdelvat') format="%.2f"}]</span>
<span id="gts-o-tax-total">[{$oOrder->d3GetTaxTotal()}]</span>
<span id="gts-o-est-delivery-date">[{$oView->d3GAgetEstimatedDeliveryDate()|date_format:"%Y-%m-%d"}]</span>
<span id="gts-o-est-ship-date">[{$oView->d3GAgetEstimatedShippingDate()|date_format:"%Y-%m-%d"}]</span>
<span id="gts-o-has-preorder">[{$oView->d3GAhasBackorderPreorder()}]</span>

Bestand weergeven

@ -73,4 +73,51 @@ class d3_oxorder_googleanalytics extends d3_oxorder_googleanalytics_parent
}
}
}
/**
* @return float
*/
public function d3GetOrderPayVat()
{
return $this->getFieldData('oxpaycost') / 100 * $this->getFieldData('oxpayvat');
}
/**
* @return float
*/
public function d3GetOrderDelVat()
{
return $this->getFieldData('oxdelcost') / 100 * $this->getFieldData('oxdelvat');
}
/**
* @return float
*/
public function d3GetOrderWrapVat()
{
return $this->getFieldData('oxwrapcost') / 100 * $this->getFieldData('oxwrapvat');
}
/**
* @return float
*/
public function d3GetOrderCardVat()
{
return $this->getFieldData('oxcardcost') / 100 * $this->getFieldData('oxcardvat');
}
/**
* @return float
*/
public function d3GetTaxTotal()
{
$dVat = $this->getFieldData('oxartvatprice1')
+ $this->getFieldData('oxartvatprice2')
+ $this->d3GetOrderPayVat()
+ $this->d3GetOrderDelVat()
+ $this->d3GetOrderWrapVat()
+ $this->d3GetOrderCardVat();
return sprintf('%.2f', $dVat);
}
}