From af26ac96e98d7ec6791676fb2bd6860a6332fcd9 Mon Sep 17 00:00:00 2001 From: Gursheen Anand Date: Fri, 29 Mar 2024 17:22:48 +0530 Subject: [PATCH] fix: do not add actual expense twice for validating budget --- erpnext/accounts/doctype/budget/budget.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/doctype/budget/budget.py b/erpnext/accounts/doctype/budget/budget.py index b585f409e14..07e8d853da4 100644 --- a/erpnext/accounts/doctype/budget/budget.py +++ b/erpnext/accounts/doctype/budget/budget.py @@ -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