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 bb5096075f
commit c72478c74d

View File

@@ -298,12 +298,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