fix: do not add actual expense twice for validating budget

This commit is contained in:
Gursheen Anand
2024-03-29 17:22:48 +05:30
parent 8e522183bc
commit af26ac96e9

View File

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