Openbravo Issue Tracking System - Openbravo Localizations
View Issue Details
0050642Openbravo LocalizationsLocalization Italypublic2022-10-26 10:152022-10-27 10:58
ucarrion 
jetxarri 
normalmajoralways
closedfixed 
5
 
 
0050642: Incorrect <PrezzoTotale> when a return invoice contains a discount
The total price of a return invoice (see the tag <PrezzoTotale> in the XML) is incorrectly calculated when the transaction contains a discount.

Then, the validator raises an error: "PrezzoTotale non calcolato secondo le specifiche tecniche"

Find two examples attached (IT06026940012_0lfva has discount and IT06026940012_0lfv8 has NO discount).
-Login an italian terminal
-Do a sales invoice including a discount
-Return the previous invoiced sale
-Run the export XML process in the backoffice
-Get the XMLs generated as attachment in the Sales Invoice window
-Repeat the same process by using the same product with no discount now
-Submit both XML files in the https://www.fatturacheck.it/ [^] web validator and check that the first of the files gets the error message while the second one normally is OK
Below the current result:

 <DettaglioLinee>
        <NumeroLinea>1</NumeroLinea>
        <CodiceArticolo>
          <CodiceTipo>EAN</CodiceTipo>
          <CodiceValore>0000003475614</CodiceValore>
        </CodiceArticolo>
        <Descrizione>FAROL ESQ H4 VALEO</Descrizione>
        <Quantita>1.00</Quantita>
        <PrezzoUnitario>44.60</PrezzoUnitario>
        <ScontoMaggiorazione>
          <Tipo>SC</Tipo>
          <Importo>7.00</Importo>
        </ScontoMaggiorazione>
        <PrezzoTotale>51.60</PrezzoTotale>
        <AliquotaIVA>22.00</AliquotaIVA>
        <AltriDatiGestionali>
          <TipoDato>SCONTRINO</TipoDato>
        </AltriDatiGestionali>
      </DettaglioLinee>

Below the expected result:

 <DettaglioLinee>
        <NumeroLinea>1</NumeroLinea>
        <CodiceArticolo>
          <CodiceTipo>EAN</CodiceTipo>
          <CodiceValore>0000003475614</CodiceValore>
        </CodiceArticolo>
        <Descrizione>FAROL ESQ H4 VALEO</Descrizione>
        <Quantita>1.00</Quantita>
        <PrezzoUnitario>51.60</PrezzoUnitario>
        <ScontoMaggiorazione>
          <Tipo>SC</Tipo>
          <Importo>7.00</Importo>
        </ScontoMaggiorazione>
        <PrezzoTotale>51.60</PrezzoTotale>
        <AliquotaIVA>22.00</AliquotaIVA>
        <AltriDatiGestionali>
          <TipoDato>SCONTRINO</TipoDato>
        </AltriDatiGestionali>
      </DettaglioLinee>

The <PrezzoUnitario> must be:
[c_invoice.c_invoiceLine.PriceActual] + [c_invoice.c_invoiceLine.c_InvoiceLine_Offer.Amtoffer]
No tags attached.
related to defect 0051030 closed jetxarri Incorrect <Importo> when more than one unit per line 
xml IT06026940012_0lfva.xml (2,948) 2022-10-26 10:15
https://issues.openbravo.com/file_download.php?file_id=17713&type=bug
xml IT06026940012_0lfv8.xml (2,948) 2022-10-26 10:16
https://issues.openbravo.com/file_download.php?file_id=17714&type=bug
Issue History
2022-10-26 10:15ucarrionNew Issue
2022-10-26 10:15ucarrionAssigned To => psanjuan
2022-10-26 10:15ucarrionFile Added: IT06026940012_0lfva.xml
2022-10-26 10:16ucarrionFile Added: IT06026940012_0lfv8.xml
2022-10-26 15:59ucarrionProposed Solution updated
2022-10-26 16:13psanjuanAssigned Topsanjuan => jetxarri
2022-10-27 07:31hgbotNote Added: 0142630
2022-10-27 10:58hgbotResolutionopen => fixed
2022-10-27 10:58hgbotStatusnew => closed
2022-10-27 10:58hgbotNote Added: 0142635
2022-10-27 10:58hgbotNote Added: 0142636
2022-11-29 12:22ucarrionRelationship addedrelated to 0051030

Notes
(0142630)
hgbot   
2022-10-27 07:31   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.localization.italy.einvoice/-/merge_requests/22 [^]
(0142635)
hgbot   
2022-10-27 10:58   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.localization.italy.einvoice [^]
Changeset: 0e9b7fa2d20cb1b6d09bf953863bfc7ddd74d6ce
Author: Javier <javieretxarri@ekinbe.com>
Date: 27-10-2022 08:58:19
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.localization.italy.einvoice/-/commit/0e9b7fa2d20cb1b6d09bf953863bfc7ddd74d6ce [^]

Fixes ISSUE-50642: Incorrect <PrezzoTotale> when a return invoice contains a discount

---
M src/org/openbravo/localization/italy/einvoice/xmlengine/document/ItalyDettaglioLinee.java
---
(0142636)
hgbot   
2022-10-27 10:58   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.localization.italy.einvoice/-/merge_requests/22 [^]