mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 03:01:22 +00:00
Merge pull request #31016 from HarryPaulo/fix-average-discount-auth
fix: correction of the calculation to the average value when there is…
This commit is contained in:
@@ -135,8 +135,8 @@ class AuthorizationControl(TransactionBase):
|
|||||||
price_list_rate, base_rate = 0, 0
|
price_list_rate, base_rate = 0, 0
|
||||||
for d in doc_obj.get("items"):
|
for d in doc_obj.get("items"):
|
||||||
if d.base_rate:
|
if d.base_rate:
|
||||||
price_list_rate += flt(d.base_price_list_rate) or flt(d.base_rate)
|
price_list_rate += (flt(d.base_price_list_rate) or flt(d.base_rate)) * flt(d.qty)
|
||||||
base_rate += flt(d.base_rate)
|
base_rate += flt(d.base_rate) * flt(d.qty)
|
||||||
if doc_obj.get("discount_amount"):
|
if doc_obj.get("discount_amount"):
|
||||||
base_rate -= flt(doc_obj.discount_amount)
|
base_rate -= flt(doc_obj.discount_amount)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user