fix: do not add actual expense twice for validating budget

(cherry picked from commit af26ac96e9)
This commit is contained in:
Gursheen Anand
2024-03-29 17:22:48 +05:30
committed by Mergify
parent e8accd0256
commit ec4f07fd60

View File

@@ -273,12 +273,10 @@ def get_amount(args, budget):
amount = 0
if args.get("doctype") == "Material Request" and budget.for_material_request:
amount = (
get_requested_amount(args, budget) + get_ordered_amount(args, budget) + get_actual_expense(args)
)
amount = get_requested_amount(args, budget) + get_ordered_amount(args, budget)
elif args.get("doctype") == "Purchase Order" and budget.for_purchase_order:
amount = get_ordered_amount(args, budget) + get_actual_expense(args)
amount = get_ordered_amount(args, budget)
return amount