diff --git a/account_vat_period_end_statement/models/account.py b/account_vat_period_end_statement/models/account.py index 9119093f0e1c..6974282a0eef 100644 --- a/account_vat_period_end_statement/models/account.py +++ b/account_vat_period_end_statement/models/account.py @@ -821,6 +821,7 @@ class StatementGenericAccountLine(models.Model): statement_id = fields.Many2one("account.vat.period.end.statement", "VAT statement") amount = fields.Float("Amount", required=True, digits="Account") name = fields.Char("Description") + previous_year_credit = fields.Boolean("Previous year credits") class AccountTax(models.Model): diff --git a/account_vat_period_end_statement/views/account_view.xml b/account_vat_period_end_statement/views/account_view.xml index 75659e405307..6bf2eba34845 100644 --- a/account_vat_period_end_statement/views/account_view.xml +++ b/account_vat_period_end_statement/views/account_view.xml @@ -181,12 +181,16 @@ + - +
- - - + + + + + + diff --git a/l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py b/l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py index 427c7ae36216..6919c1d28d45 100644 --- a/l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py +++ b/l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py @@ -687,6 +687,12 @@ def compute_from_liquidazioni(self): # 2 - Decremento iva detratta con righe negative for line in liq.generic_vat_account_line_ids: if line.amount > 0: - quadro.iva_esigibile -= line.amount + if line.previous_year_credit: + quadro.credito_anno_precedente -= line.amount + else: + quadro.iva_esigibile -= line.amount else: - quadro.iva_detratta += line.amount + if line.previous_year_credit: + quadro.credito_anno_precedente += line.amount + else: + quadro.iva_detratta += line.amount