Openbravo Issue Tracking System - Localization Pack: Spain
View Issue Details
0047736Localization Pack: SpainSIIpublic2021-09-22 15:242021-12-13 14:33
ucarrion 
psanjuan 
normalmajorhave not tried
closedno change required 
5
 
 
0047736: The SII requires to send the customer data including the region of the address when it should not
The SII requires to send the customer data including the region of the address when it should not.

You create in POS a simplified invoice with anonymous customer or an informed customer which has NO region in the address.
When you send the simplified invoice to SII, it fails obliging to the region, when it should not
-Login an spanish POS terminal
-Select a customer whose address is not informing the 'Region' field
-Add a product
-Pay and complete the transaction
-Go to backoffice
-Send the invoice just generated to SII
-Check that the SII process fails due to the region null value
This new feature needs to be implemented only for sales invoices of type "Factura Simplificada" = Clave Tipo Factura, issued from Web POS.

In the 'SII sending' process in the backoffice, check the customer's region, if it is empty, send the organization region instead. See image RegionOfTheStoreForSIISending (Organization window, tab "Information", "Location/Address" selector, Region" field).

Besides that, SII module needs also to implement a new check in the tab "Information" named "SII Location", so end-user can select one in case there are more than one locations for an Organization.

SII process will stop and give a warning to the user in those cases where:
* BP does not have a region
* Organization has more than one region, and none of them is set as SII Location

Warning message will "No region is found either for the customer or the organization. Please configure it either in the Business Partner window or in the Organization window, Information tab."


Another option would be to take the Region from the Anonymous BP configured for the Organization, but once more this BP could have more than one location/address and therfore Region.



There is no way to implement above proposed solutions in a generic way. We can not be 100% sure that the region taken either from the Organization/Store or from the anonymous customer configured for the store, is the correct one.

Our SII API requires a Region that needs to be provided in any case.


NOR
related to design defect 0048238 new psanjuan SII performance review 
related to feature request 0048237 new psanjuan SII needs to manage the fact that a customer might not have "Region" information 
xls DR_v1.1.xls (156,160) 2021-09-23 10:27
https://issues.openbravo.com/file_download.php?file_id=16218&type=bug
png ConsultaSII-FS.png (193,595) 2021-09-23 10:28
https://issues.openbravo.com/file_download.php?file_id=16219&type=bug
png

xml SPRI1000123_Envio1635863354334_FacturaSimplificada.xml (1,607) 2021-11-02 15:31
https://issues.openbravo.com/file_download.php?file_id=16320&type=bug
xml SPRI1000124_Envio1635863466492_FacturaCompleta.xml (1,714) 2021-11-02 15:31
https://issues.openbravo.com/file_download.php?file_id=16321&type=bug
png image.png (95,467) 2021-11-15 15:46
https://issues.openbravo.com/file_download.php?file_id=16346&type=bug
png

jpg RegionOfTheStoreForSIISending.JPG (123,574) 2021-11-25 12:21
https://issues.openbravo.com/file_download.php?file_id=16399&type=bug
jpg
Issue History
2021-09-22 15:24ucarrionNew Issue
2021-09-22 15:24ucarrionAssigned To => Jorge Bravo
2021-09-22 15:25ucarrionIssue Monitored: rafaroda
2021-09-22 15:25ucarrionIssue Monitored: avicente
2021-09-22 15:25ucarrionIssue Monitored: psanjuan
2021-09-22 15:26ucarrionTag Attached: NOR
2021-09-23 10:25psanjuanProposed Solution updated
2021-09-23 10:26psanjuanProposed Solution updated
2021-09-23 10:27psanjuanFile Added: DR_v1.1.xls
2021-09-23 10:28psanjuanFile Added: ConsultaSII-FS.png
2021-09-23 10:46Jorge BravoAssigned ToJorge Bravo => juabaez
2021-11-02 15:31psanjuanFile Added: SPRI1000123_Envio1635863354334_FacturaSimplificada.xml
2021-11-02 15:31psanjuanFile Added: SPRI1000124_Envio1635863466492_FacturaCompleta.xml
2021-11-15 15:46psanjuanFile Added: image.png
2021-11-15 15:46psanjuanProposed Solution updated
2021-11-19 09:39psanjuanNote Added: 0133211
2021-11-19 09:40psanjuanNote Edited: 0133211bug_revision_view_page.php?bugnote_id=0133211#r23342
2021-11-19 09:41Jorge BravoAssigned Tojuabaez => psanjuan
2021-11-19 09:41psanjuanStatusnew => closed
2021-11-19 09:41psanjuanResolutionopen => no change required
2021-11-25 12:18avicenteStatusclosed => new
2021-11-25 12:18avicenteResolutionno change required => open
2021-11-25 12:18avicenteProposed Solution updated
2021-11-25 12:20avicenteProposed Solution updated
2021-11-25 12:21avicenteFile Added: RegionOfTheStoreForSIISending.JPG
2021-11-25 12:21avicenteProposed Solution updated
2021-11-25 12:32psanjuanProposed Solution updated
2021-11-25 12:33psanjuanProposed Solution updated
2021-11-25 12:35psanjuanProposed Solution updated
2021-12-07 13:40psanjuanNote Added: 0133514
2021-12-07 13:45psanjuanProposed Solution updated
2021-12-07 13:50psanjuanProposed Solution updated
2021-12-10 13:03psanjuanProposed Solution updated
2021-12-10 14:13psanjuanNote Added: 0133612
2021-12-10 14:21psanjuanNote Edited: 0133612bug_revision_view_page.php?bugnote_id=0133612#r23389
2021-12-10 14:22psanjuanStatusnew => closed
2021-12-10 14:22psanjuanResolutionopen => no change required
2021-12-13 14:32rafarodaRelationship addedrelated to 0048237
2021-12-13 14:33rafarodaRelationship addedrelated to 0048238

Notes
(0133211)
psanjuan   
2021-11-19 09:39   
(edited on: 2021-11-19 09:40)
This issue needs to be rejected because SII does correct validations in regards to "Region" data, regardless this data (Region) does not need to be informed in SII. See below:

La validación se realiza previo al envío:
/* Check if an invoice can be sent to SII.
// Check Spanish region code from partner address
SIIUtils.invoicePreviousValidations(AEATSIIConfig, Invoice, String)
donde efectivamente, genera error si el país es "España" y la región de la dirección del tercero asociada a la factura está vacía:
image.png


Luego se utiliza esta región para comprobar si una "Factura (Proveedor)" de compra de importación es una factura con IVA diferido:
/* Checks if an import purchase invoice is deferred VAT invoice
SIIUtils.isDeferredVATInvoice(Invoice)
Donde, si el país es España, y el código de la región es "35" (Las Palmas) o "38" (Santa Cruz de Tenerife) o "51" (Ceuta) o "52" (Melilla), entonces devuelve Verdadero.

En "Factura (Cliente)" también se revisa la región:
SIISOAPUtils.createFacturaExpedida(SOAPElement, Invoice)
// Venta Canarias, Ceuta y Melilla
Si la Región es "35" (Las Palmas) o "38" (Santa Cruz de Tenerife) o "51" (Ceuta) o "52" (Melilla), entonces agrega "DesgloseFactura", sino, sigue consultando otros datos (ya no la Región), para volver a decidir si agregar "DesgloseFactura" o "DesgloseTipoOperación", chequeando varias otras condiciones en varias otras bifurcaciones.

(0133514)
psanjuan   
2021-12-07 13:40   
Issue re-opened as we need to provide a solution for those cases where BP do not have an address, in particular a region. See proposed solution.
(0133612)
psanjuan   
2021-12-10 14:13   
(edited on: 2021-12-10 14:21)
Solution proposed have been double check and as those can not be generic enough we reject this issue.

Answer to project team:

We need to ask you to somehow send "Region" information to the back office by taking it from the Location of the Anonymous customer assigned to the Store or even from the Location of the Store, which in theory should be the same one.

We can not modify SII to do that, as that can not be defined in a way we can be 100% sure the region is the correct one and we are not breaking anything.

So our proposition is that you at project level fix that, by getting the Region from the Store Anonymous customer location/address, therefore that info is included at the time of issuing the simplified invoice, which later on will be sent to SII.