From faed89b65555757d93ce4728ad08905151c55a36 Mon Sep 17 00:00:00 2001 From: A R R R Associates Date: Thu, 10 Sep 2026 16:49:44 +0530 Subject: [PATCH] Fix sundry creditors opening first FIFO runtime error --- app/modules/accounting/accounting_mirror_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/modules/accounting/accounting_mirror_service.py b/app/modules/accounting/accounting_mirror_service.py index 0e29802..685bbd8 100644 --- a/app/modules/accounting/accounting_mirror_service.py +++ b/app/modules/accounting/accounting_mirror_service.py @@ -596,7 +596,7 @@ def sundry_creditors_aging( # Non-purchase credits remain visibly distinguished in the drill-down; # they are not represented as purchase bills. closing_lots = sorted( - closing_lots + non_purchase_credit_lots, + closing_lots, key=lambda lot: ( _parse_date(lot.get("voucher_date")) or opening_fallback_date, str(lot.get("voucher_number") or ""),