Skip to content

Commit 85fd4f8

Browse files
[FIX] l10n_es_aeat_mod390: Zero out casilla 662 when last period is a refund
When the last 303 period is a refund (result types D, V or X), the taxpayer is reclaiming the full accumulated VAT balance for the year. Therefore, field [662] (compensation pending for future years) must be set to 0, as there is nothing left to carry forward.
1 parent 4472e36 commit 85fd4f8

3 files changed

Lines changed: 30 additions & 14 deletions

File tree

l10n_es_aeat_mod390/README.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
.. image:: https://odoo-community.org/readme-banner-image
2+
:target: https://odoo-community.org/get-involved?utm_source=readme
3+
:alt: Odoo Community Association
4+
15
===============
26
AEAT modelo 390
37
===============
@@ -13,7 +17,7 @@ AEAT modelo 390
1317
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1418
:target: https://odoo-community.org/page/development-status
1519
:alt: Beta
16-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20+
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
1721
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1822
:alt: License: AGPL-3
1923
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github

l10n_es_aeat_mod390/models/mod390.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,12 @@ def _calculate_casilla_662(self, reports_303):
774774
period.
775775
- Compensation previous year is the box 78 of the first period of the year.
776776
"""
777+
last_period = reports_303.filtered(lambda r: r.period_type in {"4T", "12"})
778+
if last_period and last_period[0].result_type in {"D", "V", "X"}:
779+
# Al solicitar la devolución en el último periodo, el saldo acumulado se
780+
# recibe de vuelta, por lo que no queda nada pendiente de compensar para
781+
# años siguientes (casilla 662 = 0).
782+
return 0.0
777783
# Cuotas aplicadas este año
778784
applied_this_year = sum(
779785
reports_303.filtered_domain(
@@ -852,7 +858,7 @@ def calculate(self):
852858
casilla_97 = abs(report_303_last_period.resultado_liquidacion)
853859
elif report_303_last_period[0].result_type in {"D", "V", "X"}:
854860
# Si salió a devolver, casilla 98 = casilla 71 del último periodo
855-
# del año si fue a devolver
861+
# del año si fue a devolver.
856862
casilla_98 = abs(report_303_last_period.resultado_liquidacion)
857863
mod390.update(
858864
{

l10n_es_aeat_mod390/static/description/index.html

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>AEAT modelo 390</title>
6+
<title>README.rst</title>
77
<style type="text/css">
88

99
/*
@@ -360,16 +360,21 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document" id="aeat-modelo-390">
364-
<h1 class="title">AEAT modelo 390</h1>
363+
<div class="document">
365364

365+
366+
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367+
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368+
</a>
369+
<div class="section" id="aeat-modelo-390">
370+
<h1>AEAT modelo 390</h1>
366371
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367372
!! This file is generated by oca-gen-addon-readme !!
368373
!! changes will be overwritten. !!
369374
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370375
!! source digest: sha256:a50659a990ce5bcab73139fd11dd0592c53d4fa0a1ce853bfd3ea0f37af71df6
371376
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372-
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-spain/tree/18.0/l10n_es_aeat_mod390"><img alt="OCA/l10n-spain" src="https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-spain-18-0/l10n-spain-18-0-l10n_es_aeat_mod390"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377+
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-spain/tree/19.0/l10n_es_aeat_mod390"><img alt="OCA/l10n-spain" src="https://img.shields.io/badge/github-OCA%2Fl10n--spain-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-spain-19-0/l10n-spain-19-0-l10n_es_aeat_mod390"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-spain&amp;target_branch=19.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373378
<p>Modelo 390 de la AEAT. Declaración-resumen anual del Impuesto sobre el
374379
Valor Añadido.</p>
375380
<p><strong>Table of contents</strong></p>
@@ -388,12 +393,12 @@ <h1 class="title">AEAT modelo 390</h1>
388393
</ul>
389394
</div>
390395
<div class="section" id="installation">
391-
<h1><a class="toc-backref" href="#toc-entry-1">Installation</a></h1>
396+
<h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
392397
<p>Este módulo requiere del módulo <em>account_tax_balance</em> que se encuentra
393398
en <a class="reference external" href="https://github.com/OCA/account-financial-reporting">https://github.com/OCA/account-financial-reporting</a>.</p>
394399
</div>
395400
<div class="section" id="usage">
396-
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
401+
<h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
397402
<p>Para crear un modelo, por ejemplo de un trimestre del año:</p>
398403
<ol class="arabic simple">
399404
<li>Ir a <em>Contabilidad &gt; Declaraciones AEAT &gt; Modelo 390</em>.</li>
@@ -411,7 +416,7 @@ <h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
411416
</ol>
412417
</div>
413418
<div class="section" id="known-issues-roadmap">
414-
<h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
419+
<h2><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h2>
415420
<ul class="simple">
416421
<li>La declaración sólo se puede realizar para personas jurídicas.</li>
417422
<li>No se calculan operaciones intragrupo.</li>
@@ -433,23 +438,23 @@ <h1><a class="toc-backref" href="#toc-entry-3">Known issues / Roadmap</a></h1>
433438
</ul>
434439
</div>
435440
<div class="section" id="bug-tracker">
436-
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
441+
<h2><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h2>
437442
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-spain/issues">GitHub Issues</a>.
438443
In case of trouble, please check there if your issue has already been reported.
439444
If you spotted it first, help us to smash it by providing a detailed and welcomed
440445
<a class="reference external" href="https://github.com/OCA/l10n-spain/issues/new?body=module:%20l10n_es_aeat_mod390%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
441446
<p>Do not contact contributors directly about support or help with technical issues.</p>
442447
</div>
443448
<div class="section" id="credits">
444-
<h1><a class="toc-backref" href="#toc-entry-5">Credits</a></h1>
449+
<h2><a class="toc-backref" href="#toc-entry-5">Credits</a></h2>
445450
<div class="section" id="authors">
446-
<h2><a class="toc-backref" href="#toc-entry-6">Authors</a></h2>
451+
<h3><a class="toc-backref" href="#toc-entry-6">Authors</a></h3>
447452
<ul class="simple">
448453
<li>Tecnativa</li>
449454
</ul>
450455
</div>
451456
<div class="section" id="contributors">
452-
<h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
457+
<h3><a class="toc-backref" href="#toc-entry-7">Contributors</a></h3>
453458
<ul class="simple">
454459
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:<ul>
455460
<li>Pedro M. Baeza &lt;<a class="reference external" href="mailto:pedro.baeza&#64;tecnativa.com">pedro.baeza&#64;tecnativa.com</a>&gt;</li>
@@ -480,7 +485,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
480485
</ul>
481486
</div>
482487
<div class="section" id="maintainers">
483-
<h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
488+
<h3><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h3>
484489
<p>This module is maintained by the OCA.</p>
485490
<a class="reference external image-reference" href="https://odoo-community.org">
486491
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -495,5 +500,6 @@ <h2><a class="toc-backref" href="#toc-entry-8">Maintainers</a></h2>
495500
</div>
496501
</div>
497502
</div>
503+
</div>
498504
</body>
499505
</html>

0 commit comments

Comments
 (0)