diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index a83bd283ab13..7629f7d984fd 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -1003,6 +1003,7 @@ class Invoice extends EntityModel implements BalanceAffecting 'tax_name2', 'tax_rate2', 'invoice_item_type_id', + 'discount', ]); } diff --git a/app/Ninja/PaymentDrivers/BasePaymentDriver.php b/app/Ninja/PaymentDrivers/BasePaymentDriver.php index 8e4384bb3e55..40aa7a9993ff 100644 --- a/app/Ninja/PaymentDrivers/BasePaymentDriver.php +++ b/app/Ninja/PaymentDrivers/BasePaymentDriver.php @@ -375,8 +375,7 @@ class BasePaymentDriver $items[] = $item; - $invoiceItem->setRelation('invoice', $invoice); - $total += $invoiceItem->amount(); + $total += $invoiceItem->cost * $invoiceItem->qty; } if ($total != $invoice->getRequestedAmount()) {