clean up invoice calculations - exclusive taxes (#3000)

This commit is contained in:
David Bomba 2019-10-17 23:09:39 +11:00 committed by GitHub
parent e2284132ec
commit 03eb26a6db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -256,7 +256,7 @@ class InvoiceItemSum
if($item_tax_rate3_total > 0)
$this->groupTax($this->item->tax_name3, $this->item->tax_rate3, $item_tax_rate3_total);
\Log::error($this->item->tax_name1. " ". $this->item->line_total." ". $this->invoice->discount." ". $this->sub_total. " ".$amount. " ". $item_tax);
//\Log::error($this->item->tax_name1. " ". $this->item->line_total." ". $this->invoice->discount." ". $this->sub_total. " ".$amount. " ". $item_tax);
}
$this->setTotalTaxes($item_tax);

View File

@ -173,6 +173,7 @@ class InvoiceSum
{
//Build invoice values here and return Invoice
$this->setCalculatedAttributes();
$this->invoice->save();
return $this->invoice;
}
@ -233,8 +234,8 @@ class InvoiceSum
public function setTaxMap()
{
// if($this->invoice->is_amount_discount == true)
// $this->invoice_items->calcTaxesWithAmountDiscount();
if($this->invoice->is_amount_discount == true)
$this->invoice_items->calcTaxesWithAmountDiscount();
$this->tax_map = collect();