From bee39e88d630e6e8404f9645ee3009f1687fc226 Mon Sep 17 00:00:00 2001 From: sergiocorato Date: Tue, 17 Sep 2024 14:56:00 +0200 Subject: [PATCH 1/2] [IMP] add field previous_year_credit to set VP9 account_vat_period_end_statement --- account_vat_period_end_statement/models/account.py | 1 + .../views/account_view.xml | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) 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 @@ + - +
- - - + + + + + + From 777aca5b425f2ba4ae6fe1b5cae25f0ca34d9c79 Mon Sep 17 00:00:00 2001 From: sergiocorato Date: Tue, 17 Sep 2024 14:57:27 +0200 Subject: [PATCH 2/2] [IMP] l10n_it_vat_statement_communication set VP9 value --- .../models/comunicazione_liquidazione.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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