diff --git a/erpnext/patches/v15_0/recalculate_amount_difference_field.py b/erpnext/patches/v15_0/recalculate_amount_difference_field.py index 7d3d957fe62..e4e1add6949 100644 --- a/erpnext/patches/v15_0/recalculate_amount_difference_field.py +++ b/erpnext/patches/v15_0/recalculate_amount_difference_field.py @@ -62,6 +62,7 @@ def execute(): ): posting_date = period_closing_voucher[0].period_end_date +<<<<<<< HEAD try: fiscal_year = get_fiscal_year(frappe.utils.datetime.date.today()) except Exception: @@ -69,6 +70,15 @@ def execute(): else: if fiscal_year and getdate(fiscal_year[1]) > getdate(posting_date): posting_date = fiscal_year[1] +======= + acc_frozen_upto = frappe.db.get_single_value("Accounts Settings", "acc_frozen_upto") + if acc_frozen_upto and getdate(acc_frozen_upto) > getdate(posting_date): + posting_date = acc_frozen_upto + + fiscal_year = get_fiscal_year(frappe.utils.datetime.date.today(), raise_on_missing=False) + if fiscal_year and getdate(fiscal_year[1]) > getdate(posting_date): + posting_date = fiscal_year[1] +>>>>>>> 696f931678 (fix: consider account freeze date in recalculate_amount_difference_field patch) query = query.where(parent.posting_date > posting_date) if result := query.run(as_dict=True):