Discounts should be removed from invoice totals not added
This commit is contained in:
parent
260bd96c74
commit
30fb36ff8b
@ -258,8 +258,8 @@ class Account extends Model implements IDs
|
|||||||
DB::raw('SUM(discount) AS _discount'),
|
DB::raw('SUM(discount) AS _discount'),
|
||||||
DB::raw('SUM(item_total) AS _item_total'),
|
DB::raw('SUM(item_total) AS _item_total'),
|
||||||
DB::raw('SUM(payment_fees) AS _payment_fee'),
|
DB::raw('SUM(payment_fees) AS _payment_fee'),
|
||||||
DB::raw('ROUND(CAST(SUM(item_total)-SUM(COALESCE(discount,0))+COALESCE(invoices.discount_amt,0) AS NUMERIC),2) AS _total'),
|
DB::raw('ROUND(CAST(SUM(item_total)-SUM(COALESCE(discount,0))-COALESCE(invoices.discount_amt,0) AS NUMERIC),2) AS _total'),
|
||||||
DB::raw('ROUND(CAST(SUM(item_total)-SUM(COALESCE(discount,0))+COALESCE(invoices.discount_amt,0)-SUM(payments) AS NUMERIC),2) AS _balance'),
|
DB::raw('ROUND(CAST(SUM(item_total)-SUM(COALESCE(discount,0))-COALESCE(invoices.discount_amt,0)-SUM(payments) AS NUMERIC),2) AS _balance'),
|
||||||
'invoices.due_at',
|
'invoices.due_at',
|
||||||
'invoices.created_at',
|
'invoices.created_at',
|
||||||
])
|
])
|
||||||
|
Loading…
Reference in New Issue
Block a user