Openbravo Issue Tracking System - POS2
View Issue Details
0055331POS2POSpublic2024-04-26 08:082024-06-19 13:04
marvintm 
Rajesh_18 
normalmajorhave not tried
closedfixed 
5
 
24Q3 
approved
marvintm
Gold
96264
No
0055331: Error while importing generated when doing the cashup, if the connection is lost at a certain point in the process
It is possible for an Error While importing to happen in certain conditions when doing the cashup, if the connection is lost in some specific moment in time.

When this happens, the terminal will go offline, and once it is online again, the user can trigger the cashup completion again, causing an EWI due to a wrong cashup that is containing the same ids that the previously completed cashup also had.
- Login in the POS and do some sales.
- Go to the Cashup window, and count the payment methods (leaving no difference).
- When you reach the last step, add a breakpoint in this function, inside the FinishCashup.js file, in dev tools:
function addCashupId(payload) {
  return { ...payload, cashupId: OB.App.State.getState().Cashup.id };
}
- Then execute the cashup. The process will stop in the breakpoint you just added
- Go to dev tools/Network panel, and set the connectivity to "Without connection"
- Continue the process. The user action will fail as there is some post hook that requires connection
- Enable connectivity again.
- In the POS, change the terminal to online (it will work now because you just enabled connectivity).
- Now, realize you can complete the cashup again. Click on the "Finish" button again.
- Go to the back office. Verify that you now have an Error While Importing with the following message:

org.openbravo.base.exception.OBException: Cashup cannot be processed since error occurred in CashClose: A different object with the same identifier value was already associated with the session : [FIN_Reconciliation#590A06CCA2E08FD9EE354472E0ED81F1]
    at org.openbravo.retail.posterminal.ProcessCashClose.doReconciliationAndInvoices(ProcessCashClose.java:525)
    at org.openbravo.retail.posterminal.ProcessCashClose.saveRecord(ProcessCashClose.java:222)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.saveRecord(DataSynchronizationProcess.java:214)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:165)
    at org.openbravo.mobile.core.process.DataSynchronizationProcess.exec(DataSynchronizationProcess.java:97)
    at org.openbravo.mobile.core.process.MobileImportEntryProcessorRunnable.processEntry(MobileImportEntryProcessorRunnable.java:55)
    at
Most probably the easiest solution is to review all postHooks of the action, and make sure we have proper fallbacks for all the cases where a remote request is triggered, so that the user action itself cannot fail if connection is lost at that moment.
No tags attached.
depends on backport 005564624Q2 closed Rajesh_18 Error while importing generated when doing the cashup, if the connection is lost at a certain point in the process 
depends on backport 005579323Q4.3 closed Rajesh_18 Error while importing generated when doing the cashup, if the connection is lost at a certain point in the process 
depends on backport 005579424Q1.3 closed Rajesh_18 Error while importing generated when doing the cashup, if the connection is lost at a certain point in the process 
Issue History
2024-04-26 08:08marvintmNew Issue
2024-04-26 08:08marvintmAssigned To => Retail
2024-04-26 08:08marvintmOBNetwork customer => No
2024-04-26 08:08marvintmTriggers an Emergency Pack => No
2024-04-26 08:09marvintmOBNetwork customerNo => Gold
2024-04-26 09:05ngarciaIssue Monitored: ngarcia
2024-04-26 09:11ngarciaSupport ticket => 96264
2024-05-06 09:24guilleaerStatusnew => acknowledged
2024-05-06 13:01Rajesh_18Assigned ToRetail => Rajesh_18
2024-05-06 13:02Rajesh_18Statusacknowledged => scheduled
2024-05-07 16:19lorenzofidalgoTarget Version => 24Q2
2024-05-08 06:33hgbotMerge Request Status => open
2024-05-08 06:33hgbotNote Added: 0164302
2024-05-24 14:08migueldejuanaTarget Version24Q2 =>
2024-06-03 08:27hgbotMerge Request Statusopen => approved
2024-06-03 08:27hgbotNote Added: 0165438
2024-06-03 08:27hgbotResolutionopen => fixed
2024-06-03 08:27hgbotStatusscheduled => closed
2024-06-03 08:27hgbotNote Added: 0165439
2024-06-03 08:28marvintmStatusclosed => new
2024-06-03 08:28marvintmResolutionfixed => open
2024-06-03 08:28marvintmStatusnew => scheduled
2024-06-03 08:28marvintmStatusscheduled => resolved
2024-06-03 08:28marvintmFixed in Version => 24Q3
2024-06-03 08:28marvintmResolutionopen => fixed
2024-06-03 08:28marvintmReview Assigned To => marvintm
2024-06-03 08:28marvintmStatusresolved => closed
2024-06-19 13:03marvintmStatusclosed => new
2024-06-19 13:03marvintmResolutionfixed => open
2024-06-19 13:03marvintmFixed in Version24Q3 =>
2024-06-19 13:03marvintmStatusnew => scheduled
2024-06-19 13:04marvintmStatusscheduled => acknowledged
2024-06-19 13:04marvintmStatusacknowledged => scheduled
2024-06-19 13:04marvintmStatusscheduled => resolved
2024-06-19 13:04marvintmFixed in Version => 24Q3
2024-06-19 13:04marvintmResolutionopen => fixed
2024-06-19 13:04marvintmStatusresolved => closed

Notes
(0164302)
hgbot   
2024-05-08 06:33   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/120 [^]
(0165438)
hgbot   
2024-06-03 08:27   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/merge_requests/120 [^]
(0165439)
hgbot   
2024-06-03 08:27   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions [^]
Changeset: 5fd718a6243ceae930ff2f3fce1f9e40d3463fda
Author: Rajesh Senthilkumar <rajesh@qualiantech.com>
Date: 03-06-2024 06:27:44
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.sessions/-/commit/5fd718a6243ceae930ff2f3fce1f9e40d3463fda [^]

Fixed ISSUE-55331: Added try-catch for mobile service request

---
M web-jspack/org.openbravo.retail.sessions/src/model/till/actions/CloseTillInServer.js
---