Adjustments for inclusive taxes

This commit is contained in:
David Bomba 2024-07-05 14:15:42 +10:00
parent f3dc80ae09
commit 26bb71f067

View File

@ -125,6 +125,7 @@ class InvoiceSumInclusive
private function calculateInvoiceTaxes() private function calculateInvoiceTaxes()
{ {
$amount = $this->total; $amount = $this->total;
nlog("taxing this amount {$amount}");
if ($this->invoice->discount > 0 && $this->invoice->is_amount_discount) { if ($this->invoice->discount > 0 && $this->invoice->is_amount_discount) {
$amount = $this->formatValue(($this->sub_total - $this->invoice->discount), 2); $amount = $this->formatValue(($this->sub_total - $this->invoice->discount), 2);
@ -134,6 +135,8 @@ class InvoiceSumInclusive
$amount = $this->formatValue(($this->sub_total - ($this->sub_total * ($this->invoice->discount / 100))), 2); $amount = $this->formatValue(($this->sub_total - ($this->sub_total * ($this->invoice->discount / 100))), 2);
} }
$amount += $this->total_custom_values;
//Handles cases where the surcharge is not taxed //Handles cases where the surcharge is not taxed
// if(is_numeric($this->invoice->custom_surcharge1) && $this->invoice->custom_surcharge1 > 0 && !$this->invoice->custom_surcharge_tax1) { // if(is_numeric($this->invoice->custom_surcharge1) && $this->invoice->custom_surcharge1 > 0 && !$this->invoice->custom_surcharge_tax1) {
// $amount += $this->invoice->custom_surcharge1; // $amount += $this->invoice->custom_surcharge1;