Use end_date to compute AEAT 303 amount_to_compensate

issue9732
review314511003
This commit is contained in:
Sergi Almacellas Abellana committed 2020-10-19 11:52:40 +02:00
1 parent 8421c643c7
commit 6ae2d2d244
1 file changed
+1 -5
+1 -5
View File
@@ -288,13 +288,9 @@ class AEAT303(AEATReport):
amount_to_compensate = Decimal(0)
fiscalyear = periods[0].fiscalyear
start_periods = Period.search([
('fiscalyear', '=', fiscalyear.id),
('end_date', '<=', start_date),
])
with transaction.set_context({
'fiscalyear': fiscalyear.id,
'periods': [p.id for p in start_periods],
'to_date': end_date,
}):
for account in Account.search([
('company', '=', fiscalyear.company.id),