Skip to content

Commit cdfc8ff

Browse files
committed
Merge PR #4675 into 18.0
Signed-off-by eLBati
2 parents cf9ab3d + 995ce8f commit cdfc8ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+57869
-75
lines changed

l10n_it_account/README.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,23 @@ Authors
7373
Contributors
7474
------------
7575

76-
- Davide Corio
77-
- Lorenzo Battistini <lorenzo.battistini@agilebg.com>
78-
- Alex Comba <alex.comba@agilebg.com>
79-
- Sergio Zanchetta <https://github.com/primes2h>
80-
- Gianmarco Conte - Dinamiche Aziendali Sr
81-
<gconte@dinamicheaziendali.it>
82-
- Marco Colombo - Phi S.r.l. <marco.colombo@phi.technology>
83-
- `TAKOBI <https://takobi.online>`__:
76+
- Davide Corio
77+
- Lorenzo Battistini
78+
- Alex Comba <alex.comba@agilebg.com>
79+
- Sergio Zanchetta <https://github.com/primes2h>
80+
- Gianmarco Conte - Dinamiche Aziendali Sr
81+
<gconte@dinamicheaziendali.it>
82+
- Marco Colombo - Phi S.r.l. <marco.colombo@phi.technology>
83+
- `TAKOBI <https://takobi.online>`__:
8484

85-
- Simone Rubino <sir@takobi.online>
85+
- Simone Rubino <sir@takobi.online>
8686

8787
Other credits
8888
-------------
8989

9090
The development of this module has been financially supported by:
9191

92-
- Odoo Italia Network
92+
- Odoo Italia Network
9393

9494
Maintainers
9595
-----------

l10n_it_account/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"account_tax_balance",
2222
"date_range",
2323
"web",
24+
"l10n_it", # for _l10n_it_is_split_payment
2425
],
2526
"data": [
2627
"views/account_menuitem.xml",

l10n_it_account/models/account_tax.py

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
class AccountTax(models.Model):
2323
_inherit = "account.tax"
2424

25-
# TODO remove?
2625
parent_tax_ids = fields.Many2many(
2726
"account.tax",
2827
"account_tax_filiation_rel",
@@ -44,7 +43,11 @@ class AccountTax(models.Model):
4443
)
4544
def _compute_deductible_balance(self):
4645
for tax in self:
47-
tax.deductible_balance = tax.credit_balance
46+
tax.deductible_balance = (
47+
tax.credit_balance
48+
if tax.type_tax_use == "purchase"
49+
else tax.debit_balance
50+
)
4851

4952
@api.depends_context(
5053
"from_date",
@@ -67,8 +70,7 @@ def _compute_undeductible_balance(self):
6770
)
6871
def _compute_debit_balance(self):
6972
for tax in self:
70-
accounts = tax._get_accounts_tax()
71-
accounts = accounts.filtered(lambda a: a.account_type in LIABILITY_TYPES)
73+
accounts = tax._get_debit_accounts()
7274
account_ids = accounts.ids
7375
tax.debit_balance = tax._compute_tax_balance_by_accounts(
7476
account_ids=account_ids
@@ -82,17 +84,28 @@ def _compute_debit_balance(self):
8284
)
8385
def _compute_credit_balance(self):
8486
for tax in self:
85-
accounts = tax._get_accounts_tax()
86-
accounts = accounts.filtered(lambda a: a.account_type in ASSET_TYPES)
87+
accounts = tax._get_credit_accounts()
8788
account_ids = accounts.ids
8889
tax.credit_balance = tax._compute_tax_balance_by_accounts(
8990
account_ids=account_ids
9091
)
9192

93+
def _get_debit_accounts(self):
94+
accounts = self._get_accounts_tax()
95+
return accounts.filtered(lambda a: a.account_type in LIABILITY_TYPES)
96+
97+
def _get_credit_accounts(self):
98+
accounts = self._get_accounts_tax()
99+
return accounts.filtered(lambda a: a.account_type in ASSET_TYPES)
100+
92101
def _get_accounts_tax(self):
93-
return self.mapped("invoice_repartition_line_ids.account_id") | self.mapped(
102+
accounts = self.mapped("invoice_repartition_line_ids.account_id") | self.mapped(
94103
"refund_repartition_line_ids.account_id"
95104
)
105+
for child in self.children_tax_ids:
106+
# split payment case
107+
accounts |= child._get_accounts_tax()
108+
return accounts
96109

97110
def _compute_tax_balance_by_accounts(
98111
self, account_ids=None, exclude_account_ids=None
@@ -195,8 +208,10 @@ def _compute_totals_tax(self, data):
195208
Args:
196209
data: date range, journals and registry_type
197210
Returns:
198-
A tuple: (tax_name, base, tax, deductible, undeductible)
199-
211+
A tuple:
212+
(tax_name, base, tax, deductible, undeductible,
213+
debit_balance, credit_balance, customer_balance,
214+
supplier_balance)
200215
"""
201216
self.ensure_one()
202217
context = {
@@ -217,17 +232,30 @@ def _compute_totals_tax(self, data):
217232
deductible_balance = tax.deductible_balance
218233
undeductible_balance = tax.undeductible_balance
219234
debit_balance = tax.debit_balance
235+
customer_balance = debit_balance
220236
credit_balance = tax.credit_balance
237+
supplier_balance = credit_balance + undeductible_balance
238+
if tax.amount_type == "group":
239+
for child_tax in tax.children_tax_ids:
240+
if child_tax._l10n_it_is_split_payment():
241+
# split payment case: tax and debit amount is from child,
242+
# but deductible is not
243+
balance = child_tax.balance
244+
customer_balance = child_tax.debit_balance
221245
if registry_type == "supplier":
222246
base_balance = -base_balance
223247
balance = -balance
224248
deductible_balance = -deductible_balance
225249
undeductible_balance = -undeductible_balance
226250
debit_balance = -debit_balance
227251
credit_balance = -credit_balance
252+
customer_balance = -customer_balance
253+
supplier_balance = -supplier_balance
228254
if registry_type == "customer" and tax.type_tax_use == "purchase":
229255
# case of reverse charge in sales VAT registry
230256
base_balance = -base_balance
257+
deductible_balance = -deductible_balance - undeductible_balance
258+
undeductible_balance = 0
231259
return (
232260
tax_name,
233261
base_balance,
@@ -236,4 +264,6 @@ def _compute_totals_tax(self, data):
236264
undeductible_balance,
237265
debit_balance,
238266
credit_balance,
267+
customer_balance,
268+
supplier_balance,
239269
)

l10n_it_account/readme/CONTRIBUTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- Davide Corio
2-
- Lorenzo Battistini \<<lorenzo.battistini@agilebg.com>\>
2+
- Lorenzo Battistini
33
- Alex Comba \<<alex.comba@agilebg.com>\>
44
- Sergio Zanchetta \<<https://github.com/primes2h>\>
55
- Gianmarco Conte - Dinamiche Aziendali Sr

l10n_it_account/static/description/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
414414
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
415415
<ul class="simple">
416416
<li>Davide Corio</li>
417-
<li>Lorenzo Battistini &lt;<a class="reference external" href="mailto:lorenzo.battistini&#64;agilebg.com">lorenzo.battistini&#64;agilebg.com</a>&gt;</li>
417+
<li>Lorenzo Battistini</li>
418418
<li>Alex Comba &lt;<a class="reference external" href="mailto:alex.comba&#64;agilebg.com">alex.comba&#64;agilebg.com</a>&gt;</li>
419419
<li>Sergio Zanchetta &lt;<a class="reference external" href="https://github.com/primes2h">https://github.com/primes2h</a>&gt;</li>
420420
<li>Gianmarco Conte - Dinamiche Aziendali Sr
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
======================
2+
ITA - Liquidazione IVA
3+
======================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:2bf28f1ec0b8e0fdfe89ae111fd5fc5f0af4a38ff656acad3dd95cb8159e5c61
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
20+
:target: https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_account_vat_period_end_settlement
21+
:alt: OCA/l10n-italy
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_account_vat_period_end_settlement
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
**Italiano**
32+
33+
Per fare la liquidazione IVA, aprire Fatturazione > Contabilità >
34+
Liquidazioni IVA, il menù è visibile solo quando è abilitato il
35+
gruppo 'Mostrare funzionalità contabili complete'. Selezionare un
36+
registro che conterrà le registrazioni contabili della liquidazione.
37+
Il campo 'Conto IVA erario' contiene il conto dove verrà effettuata
38+
la registrazione della liquidazione IVA.
39+
40+
L'oggetto 'Liquidazione IVA' permette di specificare ogni importo e
41+
il conto utilizzato dalla liquidazione. Di norma, gli importi di
42+
debito e credito delle imposte vengono caricati automaticamente dai
43+
periodi selezionati (vedere Configurazione per generare correttamente
44+
i periodi). I debiti e crediti precedenti vengono caricati dalle
45+
liquidazioni IVA precedenti, in base allo stato del loro pagamento.
46+
47+
Per creare la registrazione contabile, fare clic sul pulsante 'Crea
48+
movimento', dentro la scheda 'Conti'. Se i termini di pagamento sono
49+
impostati viene scritta anche la scadenza (o le scadenze).
50+
51+
La scheda 'Erario' contiene informazioni sui pagamenti, qui si
52+
possono visualizzare i risultati della liquidazione ('Importo IVA
53+
erario') e l'importo residuo da pagare ('Importo a saldo'). La
54+
liquidazione può essere pagata come qualunque altro debito, con la
55+
riconciliazione delle registrazioni contabili.
56+
57+
È inoltre possibile stampare la liquidazione IVA facendo clic su
58+
Stampa > Stampa liquidazione IVA.
59+
60+
**English**
61+
62+
In order to create a 'VAT Settlement', open Accounting > Adviser >
63+
VAT Settlements, this menu is only visible when the group 'Show Full
64+
Accounting Features' is enabled. Select a Journal that will contain
65+
the journal entries of the settlement. The field 'Tax authority VAT'
66+
account contains the account where the settlement balance will be
67+
registered.
68+
69+
The 'VAT Settlement' object allows to specify every amount and
70+
relative account used by the settlement. By default, amounts of debit
71+
and credit taxes are automatically loaded from taxes of the selected
72+
periods (see Configuration to correctly generate the periods).
73+
Previous debit or credit is loaded from previous VAT settlement,
74+
according to its payments status.
75+
76+
In order to generate the journal entry, click on 'Create move'
77+
button, inside the 'Accounts' tab. If you select a payment term, the
78+
due date(s) will be set.
79+
80+
The 'tax authority' tab contains information about payment(s), here
81+
you can see settlement's result ('authority VAT amount') and residual
82+
amount to pay ('Balance'). The settlement can be paid like every
83+
other debit, by journal item reconciliation.
84+
85+
It is also possible to print the 'VAT Settlement' clicking on print >
86+
Print VAT period end settlement.
87+
88+
**Table of contents**
89+
90+
.. contents::
91+
:local:
92+
93+
Configuration
94+
=============
95+
96+
**Italiano**
97+
98+
Per generare i periodi della dichiarazione IVA, aprire Fatturazione >
99+
Configurazione > Contabilità > Intervalli date > Generazione
100+
intervalli data (visibile solo in modalità debug):
101+
102+
- prefisso nome intervallo: prefisso identificativo per i periodi da
103+
generare (tipicamente l'anno)
104+
- durata: 1 mese
105+
- numero di intervalli da generare: 12
106+
- tipo: creare un tipo o utilizzarne uno esistente, non è richiesta
107+
una configurazione particolare
108+
- data iniziale: primo giorno del primo periodo che sarà generato
109+
(tipicamente il primo giorno dell'anno i.e. 01/01/2018)
110+
111+
Per escludere un'imposta dalla liquidazione IVA:
112+
113+
1. aprire l'imposta da Fatturazione > Configurazione > Contabilità >
114+
Imposte,
115+
2. nella scheda 'Opzioni avanzate' impostare 'Escludere da
116+
liquidazioni IVA'.
117+
118+
Per calcolare gli interessi, è possibile aggiungere le informazioni
119+
da utilizzare (conto e percentuale) nei dati aziendali, nella scheda
120+
'Liquidazione IVA'.
121+
122+
**English**
123+
124+
In order to generate VAT Settlement's periods, open Accounting >
125+
Configuration > Accounting > Date ranges > Generate Date Ranges
126+
(visible only in debug mode):
127+
128+
- range name prefix: prefix identifying the periods to be generated
129+
(usually the year)
130+
- duration: 1 month
131+
- number of ranges to generate: 12
132+
- type: create a type or use an existing one, no specific
133+
configuration is required
134+
- date start: first day of the first period to be generated (usually
135+
the first day of the year e.g. 01/01/2018)
136+
137+
In order to exclude a tax from VAT settlement:
138+
139+
1. open a tax in Accounting > Configuration > Accounting > Taxes,
140+
2. in the tab 'Advanced Options' set 'Exclude from VAT settlements'.
141+
142+
If you need to calculate interest, you can add default information in
143+
your company data (percentage and account), in the 'VAT Settlement'
144+
tab.
145+
146+
Bug Tracker
147+
===========
148+
149+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_.
150+
In case of trouble, please check there if your issue has already been reported.
151+
If you spotted it first, help us to smash it by providing a detailed and welcomed
152+
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_account_vat_period_end_settlement%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
153+
154+
Do not contact contributors directly about support or help with technical issues.
155+
156+
Credits
157+
=======
158+
159+
Authors
160+
-------
161+
162+
* Agile Business Group
163+
* LinkIt Spa
164+
165+
Contributors
166+
------------
167+
168+
- Lorenzo Battistini <https://github.com/eLBati>
169+
- Elena Carlesso
170+
- Marco Marchiori <marcomarkiori@gmail.com>
171+
- Sergio Corato <sergiocorato@gmail.com>
172+
- Andrea Gallina <a.gallina@apuliasoftware.it>
173+
- Alex Comba <alex.comba@agilebg.com>
174+
- Alessandro Camilli <camillialex@gmail.com>
175+
- Simone Rubino <simone.rubino@agilebg.com>
176+
- Giacomo Grasso <giacomo.grasso.82@gmail.com>
177+
- Lara Baggio <http://linkgroup.it/>
178+
- Gianmarco Conte <gconte@dinamicheaziendali.it>
179+
- Michele Rusticucci <michele.rusticucci@agilebg.com>
180+
- Salvo Rapisarda <sdrapisarda@gmail.com>
181+
- `TAKOBI <https://takobi.online>`__:
182+
183+
- Simone Rubino <sir@takobi.online>
184+
185+
- `Aion Tech <https://aiontech.company/>`__:
186+
187+
- Simone Rubino <simone.rubino@aion-tech.it>
188+
189+
- `Nextev Srl <https://nextev.it/>`__:
190+
191+
- <odoo@nextev.it>
192+
193+
Maintainers
194+
-----------
195+
196+
This module is maintained by the OCA.
197+
198+
.. image:: https://odoo-community.org/logo.png
199+
:alt: Odoo Community Association
200+
:target: https://odoo-community.org
201+
202+
OCA, or the Odoo Community Association, is a nonprofit organization whose
203+
mission is to support the collaborative development of Odoo features and
204+
promote its widespread use.
205+
206+
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_account_vat_period_end_settlement>`_ project on GitHub.
207+
208+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
2+
3+
from . import report
4+
from . import wizard
5+
from . import models
6+
from .hooks import pre_absorb_old_module

0 commit comments

Comments
 (0)