Openbravo Issue Tracking System - Retail Modules
View Issue Details
0045525Retail ModulesWeb POSpublic2020-11-27 13:422020-12-15 08:17
nicola_uva 
rqueralta 
normalminoralways
closedfixed 
5
pi 
piRR21Q1 
pi
No
0045525: [SafeBox - Cashup] During processing the cashup an error happen on ProcessCashClose
During the execution of ProcessCashClose.java a hibernate error happen. Below the piece of code failing

    if (jsonCashup.has("currentSafeBox")) {
        String safeBoxSK = jsonCashup.getString("currentSafeBox");
        OBCriteria<OBPOSSafeBox> safeBoxCriteria = OBDal.getInstance()
            .createCriteria(OBPOSSafeBox.class);
        safeBoxCriteria.add(Restrictions.eq(OBPOSSafeBox.PROPERTY_SEARCHKEY, safeBoxSK));

        safeBox = (OBPOSSafeBox) safeBoxCriteria.uniqueResult();
      }
Create a safebox with search key = 1 for organization A with cash payment method
Create a safebox with search key = 1 for organization B with cash payment method
Connect to POS on organization A
Link the safebox 1 and do a ticket in cash
Remove the safebox from the menu and process

The cashup go in error while importing POS data with the following error:
org.hibernate.NonUniqueResultException: query did not return a unique result: 2
Put the unicity on (Organization, searchkey) level
We also need to ensure that safe boxes are created at store level, otherwise more than one safe box may be visible if we only do the constraint change
No tags attached.
caused by defect 0045157 closed jorge-garcia [SafeBox] Same search key can't be used on different Organization 
txt errorlog.txt (1,674) 2020-11-27 13:42
https://issues.openbravo.com/file_download.php?file_id=15134&type=bug
Issue History
2020-11-27 13:42nicola_uvaNew Issue
2020-11-27 13:42nicola_uvaAssigned To => Retail
2020-11-27 13:42nicola_uvaFile Added: errorlog.txt
2020-11-27 13:42nicola_uvaResolution time => 1606863600
2020-11-27 13:42nicola_uvaTriggers an Emergency Pack => No
2020-11-27 13:54javietxeIssue Monitored: javietxe
2020-11-27 13:55javietxeResolution time1606863600 => 1608246000
2020-11-27 13:56javietxeRegression introduced in release => pi
2020-11-27 13:57javietxeRelationship addedcaused by 0045157
2020-12-09 17:02rqueraltaAssigned ToRetail => rqueralta
2020-12-14 20:59hgbotNote Added: 0124812
2020-12-15 08:17hgbotResolutionopen => fixed
2020-12-15 08:17hgbotStatusnew => closed
2020-12-15 08:17hgbotFixed in Version => RR21Q1
2020-12-15 08:17hgbotNote Added: 0124818
2020-12-15 08:17hgbotNote Added: 0124819

Notes
(0124812)
hgbot   
2020-12-14 20:59   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/211 [^]
(0124818)
hgbot   
2020-12-15 08:17   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 1a790b02ddf6c29d1ed7d6638f4b7b54969bf9b7
Author: Rafael Queralta <rafaelcuba81@gmail.com>
Date: 2020-12-15T07:17:12+00:00
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/1a790b02ddf6c29d1ed7d6638f4b7b54969bf9b7 [^]

Fixed BUG-45525: Added filter by organization to retrieve an unique safe box

---
M src/org/openbravo/retail/posterminal/ProcessCashClose.java
---
(0124819)
hgbot   
2020-12-15 08:17   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/211 [^]