Skip to content
Closed
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
14 changes: 6 additions & 8 deletions l10n_it_edi_rf11/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,9 @@ Usage
XML the agency becomes the *CedentePrestatore* and the company the
*CessionarioCommittente*, with ``RegimeFiscale`` RF11,
``TipoDocumento`` TD01, ``SoggettoEmittente`` CC, the *Terzo
Intermediario o Soggetto Emittente* block filled with the company,
``CodiceDestinatario`` = the agency's code, and the total
(``ImportoTotaleDocumento``) omitted. For intra-EU lines the 22% VAT
is stripped and reported as Natura N6.9.
Intermediario o Soggetto Emittente* block filled with the company and
``CodiceDestinatario`` = the agency's code. For intra-EU lines the
22% VAT is stripped and reported as Natura N6.9.
3. Use the **Send to Tax Agency** button on the bill to send the XML to
the SdI. A courtesy copy can then be forwarded to the agency.

Expand All @@ -316,10 +315,9 @@ Usage
FatturaPA l'agenzia diventa il *CedentePrestatore* e l'azienda il
*CessionarioCommittente*, con ``RegimeFiscale`` RF11,
``TipoDocumento`` TD01, ``SoggettoEmittente`` CC, il blocco *Terzo
Intermediario o Soggetto Emittente* valorizzato con l'azienda,
``CodiceDestinatario`` = codice dell'agenzia e l'importo totale
(``ImportoTotaleDocumento``) omesso. Per le righe intra-UE l'IVA al
22% viene azzerata e riportata come Natura N6.9.
Intermediario o Soggetto Emittente* valorizzato con l'azienda e
``CodiceDestinatario`` = codice dell'agenzia. Per le righe intra-UE
l'IVA al 22% viene azzerata e riportata come Natura N6.9.
3. Usare il pulsante **Invia all'Agenzia delle Entrate** sulla fattura
per inviare l'XML allo SdI. Una copia di cortesia può poi essere
inviata all'agenzia.
Expand Down
8 changes: 0 additions & 8 deletions l10n_it_edi_rf11/data/invoice_it_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,5 @@
t-if="soggetto_emittente != 'CC' and company.l10n_edi_it_sender_partner"
>TZ</SoggettoEmittente>
</xpath>

<!-- Omit ImportoTotaleDocumento for the 74-ter autofattura -->
<xpath expr="//DatiGeneraliDocumento/ImportoTotaleDocumento" position="replace">
<ImportoTotaleDocumento
t-if="importo_totale_documento is not None"
t-out="format_monetary(importo_totale_documento, currency)"
/>
</xpath>
</template>
</odoo>
7 changes: 4 additions & 3 deletions l10n_it_edi_rf11/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ def _l10n_it_edi_get_values(self, pdf_values=None):
values["document_type"] = "TD01"
# Emitted by the Cessionario/Committente (the tour operator).
values["soggetto_emittente"] = "CC"
# ImportoTotaleDocumento must be omitted for this case
# (the QWeb override drops the element when this is None).
values["importo_totale_documento"] = None
# No VAT is exported for this case (see the intra-EU stripping
# below), so the total must equal the untaxed amount: core would
# otherwise add the 22% booked for the VAT registers.
values["importo_totale_documento"] = self.amount_untaxed
# CodiceDestinatario is the agency's SdI code (as in the v16
# module), not the company's own. <CodiceDestinatario> is rendered
# from buyer_info['pa_index'], which for a self-invoice is the
Expand Down
10 changes: 4 additions & 6 deletions l10n_it_edi_rf11/readme/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
agency becomes the *CedentePrestatore* and the company the
*CessionarioCommittente*, with `RegimeFiscale` RF11, `TipoDocumento` TD01,
`SoggettoEmittente` CC, the *Terzo Intermediario o Soggetto Emittente* block
filled with the company, `CodiceDestinatario` = the agency's code, and the
total (`ImportoTotaleDocumento`) omitted. For intra-EU lines the 22% VAT is
stripped and reported as Natura N6.9.
filled with the company and `CodiceDestinatario` = the agency's code. For
intra-EU lines the 22% VAT is stripped and reported as Natura N6.9.
3. Use the **Send to Tax Agency** button on the bill to send the XML to the SdI.
A courtesy copy can then be forwarded to the agency.

Expand All @@ -32,9 +31,8 @@
FatturaPA l'agenzia diventa il *CedentePrestatore* e l'azienda il
*CessionarioCommittente*, con `RegimeFiscale` RF11, `TipoDocumento` TD01,
`SoggettoEmittente` CC, il blocco *Terzo Intermediario o Soggetto Emittente*
valorizzato con l'azienda, `CodiceDestinatario` = codice dell'agenzia e
l'importo totale (`ImportoTotaleDocumento`) omesso. Per le righe intra-UE
l'IVA al 22% viene azzerata e riportata come Natura N6.9.
valorizzato con l'azienda e `CodiceDestinatario` = codice dell'agenzia. Per
le righe intra-UE l'IVA al 22% viene azzerata e riportata come Natura N6.9.
3. Usare il pulsante **Invia all'Agenzia delle Entrate** sulla fattura per
inviare l'XML allo SdI. Una copia di cortesia può poi essere inviata
all'agenzia.
Expand Down
14 changes: 6 additions & 8 deletions l10n_it_edi_rf11/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,9 @@ <h1><a class="toc-backref" href="#toc-entry-7">Usage</a></h1>
XML the agency becomes the <em>CedentePrestatore</em> and the company the
<em>CessionarioCommittente</em>, with <tt class="docutils literal">RegimeFiscale</tt> RF11,
<tt class="docutils literal">TipoDocumento</tt> TD01, <tt class="docutils literal">SoggettoEmittente</tt> CC, the <em>Terzo
Intermediario o Soggetto Emittente</em> block filled with the company,
<tt class="docutils literal">CodiceDestinatario</tt> = the agency’s code, and the total
(<tt class="docutils literal">ImportoTotaleDocumento</tt>) omitted. For intra-EU lines the 22% VAT
is stripped and reported as Natura N6.9.</li>
Intermediario o Soggetto Emittente</em> block filled with the company and
<tt class="docutils literal">CodiceDestinatario</tt> = the agency’s code. For intra-EU lines the
22% VAT is stripped and reported as Natura N6.9.</li>
<li>Use the <strong>Send to Tax Agency</strong> button on the bill to send the XML to
the SdI. A courtesy copy can then be forwarded to the agency.</li>
</ol>
Expand All @@ -653,10 +652,9 @@ <h1><a class="toc-backref" href="#toc-entry-7">Usage</a></h1>
FatturaPA l’agenzia diventa il <em>CedentePrestatore</em> e l’azienda il
<em>CessionarioCommittente</em>, con <tt class="docutils literal">RegimeFiscale</tt> RF11,
<tt class="docutils literal">TipoDocumento</tt> TD01, <tt class="docutils literal">SoggettoEmittente</tt> CC, il blocco <em>Terzo
Intermediario o Soggetto Emittente</em> valorizzato con l’azienda,
<tt class="docutils literal">CodiceDestinatario</tt> = codice dell’agenzia e l’importo totale
(<tt class="docutils literal">ImportoTotaleDocumento</tt>) omesso. Per le righe intra-UE l’IVA al
22% viene azzerata e riportata come Natura N6.9.</li>
Intermediario o Soggetto Emittente</em> valorizzato con l’azienda e
<tt class="docutils literal">CodiceDestinatario</tt> = codice dell’agenzia. Per le righe intra-UE
l’IVA al 22% viene azzerata e riportata come Natura N6.9.</li>
<li>Usare il pulsante <strong>Invia all’Agenzia delle Entrate</strong> sulla fattura
per inviare l’XML allo SdI. Una copia di cortesia può poi essere
inviata all’agenzia.</li>
Expand Down
15 changes: 11 additions & 4 deletions l10n_it_edi_rf11/tests/test_edi_rf11_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,12 @@ def test_74ter_bill_xml(self):
# Extra-EU / non-taxable: Natura N3.6 from the tax config, tax 0
self.assertEqual(tree.findtext(".//DatiRiepilogo/Natura"), "N3.6")
self.assertEqual(tree.findtext(".//DatiRiepilogo/Imposta"), "0.00")
# ImportoTotaleDocumento omitted
self.assertIsNone(tree.find(".//ImportoTotaleDocumento"))
# ImportoTotaleDocumento is kept: no VAT is charged, so the total is
# the untaxed amount
self.assertEqual(
tree.findtext(".//DatiGeneraliDocumento/ImportoTotaleDocumento"),
f"{bill.amount_untaxed:.2f}",
)

def test_74ter_bill_intra_eu_n69(self):
"""Intra-EU: an explicit 22% reverse-charge tax carrying N6.9 is kept in
Expand All @@ -174,8 +178,11 @@ def test_74ter_bill_intra_eu_n69(self):
# DettaglioLinee: aliquota 0 and nature N6.9
self.assertEqual(tree.findtext(".//DettaglioLinee/AliquotaIVA"), "0.00")
self.assertEqual(tree.findtext(".//DettaglioLinee/Natura"), "N6.9")
# No total, as for the extra-EU case
self.assertIsNone(tree.find(".//ImportoTotaleDocumento"))
# Total kept and equal to the untaxed amount (the 22% is not exported)
self.assertEqual(
tree.findtext(".//DatiGeneraliDocumento/ImportoTotaleDocumento"),
f"{bill.amount_untaxed:.2f}",
)

def test_74ter_bill_intra_eu_natura_fallback(self):
"""A 22% line whose tax carries no nature falls back to N6.9."""
Expand Down
Loading