Openbravo Issue Tracking System - Openbravo Localizations |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0046542 | Openbravo Localizations | Localization Portugal | public | 2021-05-06 10:11 | 2021-10-21 11:40 |
|
Reporter | lmonreal | |
Assigned To | psanjuan | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | | |
Merge Request Status | |
Regression date | |
Regression introduced by commit | |
Regression level | |
Support ticket | |
OBNetwork customer | |
Regression introduced in release | |
|
Summary | 0046542: EWI when the Is Portuguese flag is selcted but there is no SAFT T Configured |
Description | If the cashier of a country that is not Portugal creates a Business Partner and selects by mistake the flag is Portuguese, the sales order associated generates an Error While Importing in back office.
This is happening when Is Portuguese flag is selected and there is no SAFT T.
From WEBPOS this is correct because the flow is not stopped but in back office the behaviour is not correct. No EWIS should be generated
EWI:
org.openbravo.base.exception.OBException: The indicated Tax ID doesn't have a correct Portuguese format.
at com.practicsbs.saftpt.handler.SaftBPartnerFieldsHandler.onUpdate(SaftBPartnerFieldsHandler.java:56)
at jdk.internal.reflect.GeneratedMethodAccessor314.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:85)
at org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:168)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:286)
at javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
at org.jboss.weld.util.Observers.notify(Observers.java:166)
at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:96)
at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor.sendUpdateEvent(PersistenceEventOBInterceptor.java:107)
at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor.onFlushDirty(PersistenceEventOBInterceptor.java:76)
at org.openbravo.client.kernel.event.PersistenceEventOBInterceptor$Proxy$_$$_WeldClientProxy.onFlushDirty(Unknown Source)
at org.openbravo.dal.core.OBInterceptor.onFlushDirty(OBInterceptor.java:194)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.invokeInterceptor(DefaultFlushEntityEventListener.java:355)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.handleInterception(DefaultFlushEntityEventListener.java:332)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.scheduleUpdate(DefaultFlushEntityEventListener.java:283)
at org.hibernate.event.internal.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:154)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:235)
at org.hibernate.event.internal.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:94)
at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:38)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1484)
at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1470)
at org.openbravo.dal.service.OBDal.flush(OBDal.java:265)
at org.openbravo.retail.posterminal.CustomerLoader.saveRecord(CustomerLoader.java:102)
at org.openbravo.mobile.core.process.DataSynchronizationProcess.saveRecord(DataSynchronizationProcess.java:200)
at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:155)
at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:87)
at org.openbravo.mobile.core.process.MobileImportEntryProcessorRunnable.processEntry(MobileImportEntryProcessorRunnable.java:54)
at org.openbravo.service.importprocess.ImportEntryProcessor$ImportEntryProcessRunnable.doRunCycle(ImportEntryProcessor.java:372)
at org.openbravo.service.importprocess.ImportEntryProcessor$ImportEntryProcessRunnable.run(ImportEntryProcessor.java:293)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834) |
Steps To Reproduce | 1. Have a client that does not have SAFT T configured
2. Create a business partner in WEBPOS and add products
3. Complete transaction
4. Check EWI in back office:
org.openbravo.base.exception.OBException: The indicated Tax ID doesn't have a correct Portuguese format.
I think these steps to reproduce must include the fact that IS Portuguese flag is set to Yes. To confirm.
|
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | blocks | defect | 0046014 | | closed | psanjuan | Unexpected 'Is Portuguese' field on the customer creation popup |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2021-05-06 10:11 | lmonreal | New Issue | |
2021-05-06 10:11 | lmonreal | Assigned To | => Retail |
2021-05-06 10:11 | lmonreal | Resolution time | => 1621461600 |
2021-05-06 10:11 | lmonreal | Triggers an Emergency Pack | => No |
2021-05-10 09:37 | psanjuan | Note Added: 0127929 | |
2021-05-10 09:37 | psanjuan | Assigned To | Retail => psanjuan |
2021-05-10 16:42 | psanjuan | Note Added: 0127962 | |
2021-07-02 13:40 | psanjuan | Steps to Reproduce Updated | bug_revision_view_page.php?rev_id=22849#r22849 |
2021-07-02 13:43 | psanjuan | Relationship added | related to 0046014 |
2021-08-23 09:53 | aferraz | Project | Retail Modules => Openbravo Localizations |
2021-08-23 09:53 | aferraz | Category | Web POS => Localization Portugal |
2021-08-24 09:00 | vmromanos | Status | new => scheduled |
2021-09-15 09:43 | psanjuan | Note Added: 0131802 | |
2021-09-15 09:54 | psanjuan | Note Added: 0131803 | |
2021-09-15 10:55 | psanjuan | Note Added: 0131808 | |
2021-09-15 16:32 | hgbot | Note Added: 0131824 | |
2021-09-15 16:34 | hgbot | Note Added: 0131825 | |
2021-09-15 16:39 | hgbot | Note Added: 0131826 | |
2021-09-15 16:41 | hgbot | Note Added: 0131827 | |
2021-09-15 17:35 | hgbot | Note Added: 0131831 | |
2021-09-15 17:50 | hgbot | Note Added: 0131832 | |
2021-09-15 17:55 | hgbot | Note Added: 0131833 | |
2021-09-15 18:11 | hgbot | Note Added: 0131834 | |
2021-09-16 10:22 | aferraz | Note Deleted: 0131824 | |
2021-09-16 10:23 | aferraz | Note Deleted: 0131825 | |
2021-09-16 10:23 | aferraz | Note Deleted: 0131826 | |
2021-09-16 10:23 | aferraz | Note Deleted: 0131827 | |
2021-10-20 17:54 | hgbot | Note Added: 0132497 | |
2021-10-20 17:54 | hgbot | Resolution | open => fixed |
2021-10-20 17:54 | hgbot | Status | scheduled => closed |
2021-10-20 17:54 | hgbot | Note Added: 0132498 | |
2021-10-20 17:55 | hgbot | Note Added: 0132499 | |
2021-10-20 17:55 | hgbot | Note Added: 0132500 | |
2021-10-20 18:47 | hgbot | Note Added: 0132501 | |
2021-10-20 18:47 | hgbot | Note Added: 0132502 | |
2021-10-20 19:00 | aferraz | Relationship replaced | blocks 0046014 |
2021-10-21 10:50 | hgbot | Note Added: 0132521 | |
2021-10-21 10:53 | hgbot | Note Added: 0132522 | |
2021-10-21 10:58 | hgbot | Note Added: 0132525 | |
2021-10-21 11:40 | hgbot | Note Added: 0132527 | |
Notes |
|
|
This issue will be handle with Practics. |
|
|
|
|
|
|
Respuesta de Practics:
Buenas tardes Patricia,
Resume los detalles del Issue indicado para estar situados:
1. Se crea un Tercero en un Terminal NO portugués y por error se marca la casilla "Is Portuguese" en la ficha del Tercero, añadiendo un NIF NO portugués.
2. Se realiza una venta desde el TPV y se le asigna este nuevo Tercero.
3. Cuando la venta llega al BackOffice se queda en EWI debido a que el check indica que el NIF debe ser portugués pero realmente no lo es.
Dicho esto, os confirmo que este funcionamiento es correcto y está hecho así a propósito para controlar la siguiente situación:
Inicialmente, validábamos si el NIF era portugués o no en función de si la Dirección del Tercero tenía como país Portugal, pero más adelante nos dimos cuenta de que podía ser que alguien viviera en Portugal y tuviera un NIF español, o viceversa, que alguien viva actualmente en España pero tenga un NIF de Portugal.
A raíz de esto, creamos el campo "Es portugués" para indicar si el formato del NIF introducido debía ser validado o no según el formato portugués.
¿Qué sentido tiene que en un terminal NO portugués se aplique esta validación? --> Bien, puede darse el caso de que un cliente portugués vaya a comprar una tienda en España y le den de alta en el sistema por primera vez.
Dicha venta no aparecerá en el SAF-T debido a que la Org. del Terminal no es portuguesa, tampoco lo hará el Tercero.
Pasado un tiempo, el mismo cliente va a una Tienda portuguesa y realiza otra compra, en esta ocasión la compra sí que aparecerá en el fichero SAF-T y la información del Tercero también. De forma que si inicialmente el Tercero se creó con un NIF incorrecto, si no se hubiera validado inicialmente, aparecería la información errónea en el fichero.
Es por este motivo que realizamos la validación sin importar el terminal desde el que se emite la venta.
Si os parece correcto, podemos realizar esta validación en el POS tanto si el TPV es portugués como si no lo es, para que en el mismo momento lo puedan solucionar.
Pendientes de vuestra opinión. |
|
|
|
Respuesta Openbravo
Hola Jordi,
Gracias por tu respuesta.
En base a tu explicación, entiendo que la solución a este issue sería que si el tercero NO es Portugues, pero por error se marca la casilla "Is Portuguese", que el sistema avise de que eso no es correcto.
Es decir:
si el tercero que se está creando tiene dirección de España y un NIF no Portugues, no tiene sentido que se pueda marcar la casilla de "Is Portuguese", no? El sistema no debería permitir que se marque por error.
si el tercero que se está creando tiene dirección de PT y NIF de PT, entonces se debería marcar
si el tercero que se está creando tiene dirección de ES y NIF de PT, entonces de debería marcar para que el NIF se pueda validar.
¿Es correcto como lo entiendo?
A todo esto contamos que el entorno de Openbravo, tendrá instalados los módulos del SAFT que son los que incluyen esta funcionalidad, aunque la tienda donde se realicen estas operaciones no sea de PT, por lo que explicas. En el sentido de que ese tercero podría utilizarse después en una tienda de PT donde en esa sí es fundamental que sus datos sean correctos.
¿Qué opinas?
Gracias y saludos,
Patricia. |
|
|
|
Hola Jordi,
Puntualizo.
Proponeis validar en el POS directamente el formato de NIF portugues cuando se marca que el tercero es portugues.
Con la salvedad de que No te dejaría continuar la transacción en el POS hasta que el NIF sea válido (o se desmarque la casilla de "Es Portugues", si es que se ha seleccionado por error).
De esa forma el NIF siempre llegaría bien al BO.
Entendemos que esa validación la haceis ya en el POS cuando el terminal es portugues, correcto?
Vuestra propuesta es hacer esa validación siempre, independientemente del país del TPV.
¿es correcto?
Gracias,
Patricia. |
|
|
(0131831)
|
hgbot
|
2021-09-15 17:35
|
|
|
|
(0131832)
|
hgbot
|
2021-09-15 17:50
|
|
|
|
(0131833)
|
hgbot
|
2021-09-15 17:55
|
|
|
|
(0131834)
|
hgbot
|
2021-09-15 18:11
|
|
|
|
(0132497)
|
hgbot
|
2021-10-20 17:54
|
|
|
|
(0132498)
|
hgbot
|
2021-10-20 17:54
|
|
Directly closing issue as related merge request is already approved.
Repository: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail [^]
Changeset: 189943f48239a3c44b33da137e22ec86b9088f34
Author: Jordi Casals <jordi.casals@practicsbs.com>
Date: 2021-10-20T15:53:47+00:00
URL: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/commit/189943f48239a3c44b33da137e22ec86b9088f34 [^]
Fixes ISSUE-46542: validate PT NIF in all the Terminals.
When creating/editing a customer from Web POS:
Show Is Portuguese flag if organization has "Portuguese Configuration" flag or "Show Is Portuguese customer check in WEBPOS" preference enabled.
If selected country is Portugal and Is Portuguese flag is not selected, show a popup to double check if the customer has a Portuguese Tax ID and enable or disable the flag automatically.
---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_REF_LIST.xml
M web/com.practicsbs.saftpt.retail/js/components/bp-addproperties.js
M web/com.practicsbs.saftpt.retail/js/hooks/beforecustomersave.js
M web/com.practicsbs.saftpt.retail/js/hooks/loadterminal.js
---
|
|
|
(0132499)
|
hgbot
|
2021-10-20 17:55
|
|
|
|
(0132500)
|
hgbot
|
2021-10-20 17:55
|
|
Directly closing issue as related merge request is already approved.
Repository: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail [^]
Changeset: 29b944352038ff2ec745863b5d485a4fd7dfccdf
Author: Jordi Casals <jordi.casals@practicsbs.com>
Date: 2021-10-20T15:55:51+00:00
URL: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/commit/29b944352038ff2ec745863b5d485a4fd7dfccdf [^]
Fixes ISSUE-46542: validate PT NIF in all the Terminals.
When creating/editing a customer from Web POS:
Show Is Portuguese flag if organization has "Portuguese Configuration" flag or "Show Is Portuguese customer check in WEBPOS" preference enabled.
If selected country is Portugal and Is Portuguese flag is not selected, show a popup to double check if the customer has a Portuguese Tax ID and enable or disable the flag automatically.
Backport for 20Q3.
---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_REF_LIST.xml
M web/com.practicsbs.saftpt.retail/js/components/bp-addproperties.js
M web/com.practicsbs.saftpt.retail/js/hooks/beforecustomersave.js
M web/com.practicsbs.saftpt.retail/js/hooks/loadterminal.js
---
|
|
|
(0132501)
|
hgbot
|
2021-10-20 18:47
|
|
|
|
(0132502)
|
hgbot
|
2021-10-20 18:47
|
|
Directly closing issue as related merge request is already approved.
Repository: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail [^]
Changeset: d2097fd464bb2c90a5e591a86e13b1573b6d7718
Author: Jordi Casals <jordi.casals@practicsbs.com>
Date: 2021-10-20T16:47:18+00:00
URL: https://gitlab.com/openbravo/product/pmods/com.practicsbs.saftpt.retail/-/commit/d2097fd464bb2c90a5e591a86e13b1573b6d7718 [^]
Fixes ISSUE-46542: validate PT NIF in all the Terminals.
When creating/editing a customer from Web POS:
Show Is Portuguese flag if organization has "Portuguese Configuration" flag or "Show Is Portuguese customer check in WEBPOS" preference enabled.
If selected country is Portugal and Is Portuguese flag is not selected, show a popup to double check if the customer has a Portuguese Tax ID and enable or disable the flag automatically.
Backport for 19Q3.
---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_REF_LIST.xml
M web/com.practicsbs.saftpt.retail/js/components/bp-addproperties.js
M web/com.practicsbs.saftpt.retail/js/hooks/beforecustomersave.js
M web/com.practicsbs.saftpt.retail/js/hooks/loadterminal.js
---
|
|
|
(0132521)
|
hgbot
|
2021-10-21 10:50
|
|
|
|
(0132522)
|
hgbot
|
2021-10-21 10:53
|
|
|
|
(0132525)
|
hgbot
|
2021-10-21 10:58
|
|
|
|
(0132527)
|
hgbot
|
2021-10-21 11:40
|
|
|