From cd060fc20c3133035be4bd56636fc22b8a80caef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A0=20Tarroja=20Caubet?= Date: Thu, 28 Nov 2024 11:25:55 +0100 Subject: [PATCH] Sort periods in AEAT 303 report Closes #13707 --- modules/account_es/reporting_tax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/account_es/reporting_tax.py b/modules/account_es/reporting_tax.py index 6d711bb6cb..dd266de231 100644 --- a/modules/account_es/reporting_tax.py +++ b/modules/account_es/reporting_tax.py @@ -271,7 +271,7 @@ class AEAT303(AEATReport): context = super().get_context(records, header, data) amounts = context['amounts'] - periods = records + periods = sorted(records, key=attrgetter('start_date')) start_date = periods[0].start_date end_date = periods[-1].end_date