Merge branch '636-fix-timing-of-vat-computation' of gitlab.com:jankstudio/resq into 632-resq-1-5-changes

This commit is contained in:
Korina Cordero 2021-11-02 04:54:28 +00:00
commit acf5d964cf

View file

@ -363,7 +363,7 @@ class ResqInvoiceGenerator implements InvoiceGeneratorInterface
$this->processBatteries($total, $con_batts, $invoice);
$this->processTradeIns($total, $con_tis, $invoice);
$this->processVAT($total);
// $this->processVAT($total);
}
protected function processBatteries(&$total, $con_batts, Invoice $invoice)
@ -375,13 +375,12 @@ class ResqInvoiceGenerator implements InvoiceGeneratorInterface
$qty = $con_data['qty'];
$sell_price = $batt->getSellingPrice();
// comment out the getting of tax amount
// $vat = $this->getTaxAmount($sell_price);
// $vat_ex_price = $this->getTaxExclusivePrice($sell_price);
$vat = $this->getTaxAmount($sell_price);
$vat_ex_price = $this->getTaxExclusivePrice($sell_price);
$total['sell_price'] += $sell_price * $qty;
// $total['vat'] += $vat * $qty;
// $total['vat_ex_price'] += ($sell_price - $vat) * $qty;
$total['vat'] += $vat * $qty;
$total['vat_ex_price'] += ($sell_price - $vat) * $qty;
$total['total_price'] += $sell_price * $qty;
@ -819,6 +818,8 @@ class ResqInvoiceGenerator implements InvoiceGeneratorInterface
return $cust_tag_info;
}
// commenting this out since not used. Reverting back to the old VAT computation
/*
protected function processVAT(&$total)
{
// total trade in amount to deduct from SRP before we compute VAT
@ -839,5 +840,6 @@ class ResqInvoiceGenerator implements InvoiceGeneratorInterface
$total['vat'] = $total_vat;
$total['vat_ex_price'] = $total_vat_ex_price;
}
}
*/
}