Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] l10n_it_vat_statement_communication VP9 ability #4377

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions account_vat_period_end_statement/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
12 changes: 8 additions & 4 deletions account_vat_period_end_statement/views/account_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,16 @@
<tree editable="bottom">
<field name="account_id" />
<field name="name" />
<field name="previous_year_credit" />
<field name="amount" />
</tree>
</tree>
<form>
<field name="account_id" />
<field name="name" />
<field name="amount" />
<group>
<field name="account_id" />
<field name="name" />
<field name="previous_year_credit" />
<field name="amount" />
</group>
</form>
</field>
</group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,12 @@
# 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

Check warning on line 691 in l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py#L691

Added line #L691 was not covered by tests
else:
quadro.iva_esigibile -= line.amount

Check warning on line 693 in l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py#L693

Added line #L693 was not covered by tests
else:
quadro.iva_detratta += line.amount
if line.previous_year_credit:
quadro.credito_anno_precedente += line.amount

Check warning on line 696 in l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py#L696

Added line #L696 was not covered by tests
else:
quadro.iva_detratta += line.amount

Check warning on line 698 in l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py

View check run for this annotation

Codecov / codecov/patch

l10n_it_vat_statement_communication/models/comunicazione_liquidazione.py#L698

Added line #L698 was not covered by tests
Loading