mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Fix for calculating balance with inclusive taxes
This commit is contained in:
parent
528a02db6f
commit
76fb186f02
@ -230,6 +230,7 @@ class InvoiceSumInclusive
|
|||||||
private function setCalculatedAttributes()
|
private function setCalculatedAttributes()
|
||||||
{
|
{
|
||||||
/* If amount != balance then some money has been paid on the invoice, need to subtract this difference from the total to set the new balance */
|
/* If amount != balance then some money has been paid on the invoice, need to subtract this difference from the total to set the new balance */
|
||||||
|
if ($this->invoice->status_id != Invoice::STATUS_DRAFT) {
|
||||||
if ($this->invoice->amount != $this->invoice->balance) {
|
if ($this->invoice->amount != $this->invoice->balance) {
|
||||||
$paid_to_date = $this->invoice->amount - $this->invoice->balance;
|
$paid_to_date = $this->invoice->amount - $this->invoice->balance;
|
||||||
|
|
||||||
@ -237,6 +238,7 @@ class InvoiceSumInclusive
|
|||||||
} else {
|
} else {
|
||||||
$this->invoice->balance = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
|
$this->invoice->balance = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Set new calculated total */
|
/* Set new calculated total */
|
||||||
$this->invoice->amount = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
|
$this->invoice->amount = $this->formatValue($this->getTotal(), $this->invoice->client->currency()->precision);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user