Openbravo Issue Tracking System - Retail Modules
View Issue Details
0052664Retail ModulesWeb POSpublic2023-06-05 12:352023-06-14 13:06
ngarcia 
ranjith_qualiantech_com 
urgentmajoralways
closedfixed 
5
 
RR23Q3 
No
0052664: Cash Up in Errors While Importing POS Data cannot be saved again if the amount counted is higher than the amount to keep
Cash Up in Errors While Importing POS Data cannot be saved again if the amount counted is higher than the amount to keep.

The problem seems to be in the associateTransactions of CashCloseProcessor class
Used 23Q2 as I was not able to log in in newest versions:
https://livebuilds.openbravo.com/context/pos2_mp_23Q2 [^]

In the backoffice:

In Open/Close Period, select current period (jun-23) and Close period

In the POS:
https://livebuilds.openbravo.com/context/pos2_mp_23Q2/web/org.openbravo.retail.posterminal/?terminal=VBS-1 [^]

Add a product and pay it with Cash
Do a cash up:
Count more cash than the expected one (higher than 200)
Select 200 as the amount to keep

In the backoffice:
Check the order is stuck in Errors While Importing POS Data with the following error:
The Period does not exist or it is not opened

Check the cash up is stuck with the following error
There are errors related to non-created customers, orders, or cash management movements pending to be processed. Process them before processing the cash ups

Check you are logged in with * Organization

In Open/Close Period, select current period (jun-23) and Open period

In Errors While Importing POS Data, Save Again the order
Try to Save Again the cash-up and check the following error is shown:

org.openbravo.base.exception.OBException: Couldn't enable triggers:
    at org.openbravo.dal.core.TriggerHandler.enable(TriggerHandler.java:98)
    at org.openbravo.retail.posterminal.ProcessCashClose.doReconciliationAndInvoices(ProcessCashClose.java:507)
    at org.openbravo.retail.posterminal.ProcessCashClose.saveRecord(ProcessCashClose.java:189)
    ...
Caused by: javax.persistence.OptimisticLockException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update FIN_Finacc_Transaction set AD_Client_ID=?, AD_Org_ID=?, Created=?, Createdby=?, Updated=?, Updatedby=?, Isactive=?, C_Currency_ID=?, Fin_Financial_Account_ID=?, Line=?, Fin_Payment_ID=?, DateAcct=?, C_Glitem_ID=?, Status=?, Paymentamt=?, Depositamt=?, Processed=?, Processing=?, Posted=?, C_Project_ID=?, C_Campaign_ID=?, C_Activity_ID=?, User1_ID=?, User2_ID=?, Trxtype=?, Statementdate=?, Description=?, FIN_Reconciliation_ID=?, CreatedByAlgorithm=?, Foreign_Currency_ID=?, Foreign_Convert_Rate=?, Foreign_Amount=?, C_Bpartner_ID=?, M_Product_ID=?, C_Salesregion_ID=?, C_Costcenter_ID=?, EM_Aprm_Processed=?, EM_Obpos_App_Cashup_ID=?, EM_Aprm_Finacc_Trans_Origin=? where Fin_Finacc_Transaction_ID=?
...
Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1; statement executed: update FIN_Finacc_Transaction set AD_Client_ID=?, AD_Org_ID=?, Created=?, Createdby=?, Updated=?, Updatedby=?, Isactive=?, C_Currency_ID=?, Fin_Financial_Account_ID=?, Line=?, Fin_Payment_ID=?, DateAcct=?, C_Glitem_ID=?, Status=?, Paymentamt=?, Depositamt=?, Processed=?, Processing=?, Posted=?, C_Project_ID=?, C_Campaign_ID=?, C_Activity_ID=?, User1_ID=?, User2_ID=?, Trxtype=?, Statementdate=?, Description=?, FIN_Reconciliation_ID=?, CreatedByAlgorithm=?, Foreign_Currency_ID=?, Foreign_Convert_Rate=?, Foreign_Amount=?, C_Bpartner_ID=?, M_Product_ID=?, C_Salesregion_ID=?, C_Costcenter_ID=?, EM_Aprm_Processed=?, EM_Obpos_App_Cashup_ID=?, EM_Aprm_Finacc_Trans_Origin=? where Fin_Finacc_Transaction_ID=?
...

Change the login organization to the touchpoint's organization and check the Cashup can be saved again properly
No tags attached.
causes defect 0053493 closed ranjith_qualiantech_com Cash up is not stuck in Errors While Importing POS Data but it is not set as isprocessedbo if it has an existing reconciliation 
Issue History
2023-06-05 12:35ngarciaNew Issue
2023-06-05 12:35ngarciaAssigned To => Retail
2023-06-05 12:35ngarciaTriggers an Emergency Pack => No
2023-06-13 14:47ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2023-06-14 07:26hgbotNote Added: 0151129
2023-06-14 13:06hgbotNote Added: 0151149
2023-06-14 13:06hgbotResolutionopen => fixed
2023-06-14 13:06hgbotStatusnew => closed
2023-06-14 13:06hgbotFixed in Version => RR23Q3
2023-06-14 13:06hgbotNote Added: 0151150
2023-09-25 12:15ranjith_qualiantech_comRelationship addedcauses 0053493

Notes
(0151129)
hgbot   
2023-06-14 07:26   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1243 [^]
(0151149)
hgbot   
2023-06-14 13:06   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/1243 [^]
(0151150)
hgbot   
2023-06-14 13:06   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: faabbb8d7b63d358a3f032d02bbcee51471532a3
Author: Ranjith S R <ranjith@qualiantech.com>
Date: 14-06-2023 10:49:31
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/faabbb8d7b63d358a3f032d02bbcee51471532a3 [^]

Fixed ISSUE-52664: Organization property should be added when creating cashup

---
M src/org/openbravo/retail/posterminal/ProcessCashClose.java
M web/org.openbravo.retail.posterminal/app/model/business-object/cashup/actions/CompleteCashupAndCreateNew.js
M web/org.openbravo.retail.posterminal/js/closecash/model/cashup/cashup-model.js
---