mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:54:41 -04:00
Include line item discounts in tax reports
This commit is contained in:
parent
eaf7e22060
commit
8f3952a938
@ -78,6 +78,15 @@ class InvoiceItem extends EntityModel
|
|||||||
public function amount()
|
public function amount()
|
||||||
{
|
{
|
||||||
$amount = $this->cost * $this->qty;
|
$amount = $this->cost * $this->qty;
|
||||||
|
|
||||||
|
if ($this->discount != 0) {
|
||||||
|
if ($this->invoice->is_amount_discount) {
|
||||||
|
$amount -= $this->discount;
|
||||||
|
} else {
|
||||||
|
$amount -= $amount * $this->discount / 100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$preTaxAmount = $amount;
|
$preTaxAmount = $amount;
|
||||||
|
|
||||||
if ($this->tax_rate1) {
|
if ($this->tax_rate1) {
|
||||||
|
@ -374,7 +374,9 @@ class BasePaymentDriver
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$items[] = $item;
|
$items[] = $item;
|
||||||
$total += $invoiceItem->cost * $invoiceItem->qty;
|
|
||||||
|
$invoiceItem->setRelation('invoice', $invoice);
|
||||||
|
$total += $invoiceItem->amount();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($total != $invoice->getRequestedAmount()) {
|
if ($total != $invoice->getRequestedAmount()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user