Openbravo Issue Tracking System - Retail Modules
View Issue Details
0042208Retail ModulesReturn Receiptpublic2019-11-06 15:002019-11-25 12:19
aaroncalero 
rqueralta 
highmajoralways
closedfixed 
5
 
RR20Q1 
guilleaer
No
0042208: Error while importing generated after reprocessing a verified return under specific circumstances
When a verified return is reprocessed (loaded in webpos and synchronized again, i.e. with a reverse payment), if any of the returned lines was originally delivered in several shipment lines, the processing goes to the Errors While importing POS Data window with the following error:
org.hibernate.NonUniqueResultException: query did not return a unique result: 2
    at org.hibernate.query.internal.AbstractProducedQuery.uniqueElement(AbstractProducedQuery.java:1596)
    at org.hibernate.internal.CriteriaImpl.uniqueResult(CriteriaImpl.java:392)
    at org.openbravo.dal.service.OBCriteria.uniqueResult(OBCriteria.java:172)
    at org.openbravo.retail.returns.ReturnsShipmentOrderLoaderHook.exec(ReturnsShipmentOrderLoaderHook.java:43)
    at org.openbravo.retail.returns.ReturnsShipmentOrderLoaderHook$Proxy$_$$_WeldClientProxy.exec(Unknown Source)
    at org.openbravo.retail.posterminal.OrderLoader.executeHooks(OrderLoader.java:634
a) Configuration
1. Log in Backend, go to the Product window, search for the Avalanche Transceiver and go to the Stock tab. Note the stock for the VBS/001 0-0-0 bin.
2. If there is stock also for the VBS/002 bin skip to step 3. If not, add stock for the Avalanche transceiver in that bin:
2.1. Go to the Physical Inventory window and create a new record.
2.2. Select the Vall Blanca Store organization and then the Vall Blanca Store Warehouse.
2.3. Create a new inventory line and select the Avalanche Transceiver product. Change the bin to VBS/002 and the Quantity count to 1. Save and click on the Process Inventory Count button on the top right.
3. Go to the Preference window and create the preference "Allow to select a warehouse for a specific line order" with value Y

b) Steps
1. Log in Web POS and create a new ticket
2. Add the product Avalanche Transceiver. Click on the line and, on the Edit tab, click on Show More > Check Stock
3. Click on Store Stock, and then select the Vall Blanca Store Warehouse
4. Change the quantity of the line to (qty in VBS/001 0-0-0 + qty in VBS/002). This will create 2 separate shipment lines for the same order line.
5. Pay and complete the ticket
6. Go to the menu > Verified Returns and select the newly created ticket. Select the ticket line and click on Apply
7. Two different lines will be added to the ticket (one for each shipment line)
8. Pay and complete the verified return
9. Load the Verified return again in webpos.
10. Click on the total amount button and finally click on Done.
11. Verify that a new Error While Importing has been generated with the error mentioned in the description.
One possible solution is to make the ReturnsShipmentOrderLoaderHook ignore verified returns that have already been processed.
This can be done by checking the isPaid property in the order json, and ignoring receipts that have the isPaid property set to true (because it means this ticket was loaded in webpos and then reprocessed).
No tags attached.
Issue History
2019-11-06 15:00aaroncaleroNew Issue
2019-11-06 15:00aaroncaleroAssigned To => Retail
2019-11-06 15:00aaroncaleroResolution time => 1574204400
2019-11-06 15:00aaroncaleroTriggers an Emergency Pack => No
2019-11-07 15:23rqueraltaAssigned ToRetail => rqueralta
2019-11-07 15:24rqueraltaStatusnew => scheduled
2019-11-23 14:28hgbotCheckin
2019-11-23 14:28hgbotNote Added: 0115779
2019-11-23 14:28hgbotStatusscheduled => resolved
2019-11-23 14:28hgbotResolutionopen => fixed
2019-11-23 14:28hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.returns/rev/cf0948955b919d9e47c1b0f0922ea40d2ce74bd0 [^]
2019-11-25 12:19guilleaerReview Assigned To => guilleaer
2019-11-25 12:19guilleaerStatusresolved => closed
2019-11-25 12:19guilleaerFixed in Version => RR20Q1

Notes
(0115779)
hgbot   
2019-11-23 14:28   
Repository: erp/pmods/org.openbravo.retail.returns
Changeset: cf0948955b919d9e47c1b0f0922ea40d2ce74bd0
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Thu Nov 21 11:04:48 2019 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.returns/rev/cf0948955b919d9e47c1b0f0922ea40d2ce74bd0 [^]

Fixed issue 42208: Error while importing generated after reprocessing a verified
return under specific circumstances

- Ignoring receipts that have the isPaid property set to true

---
M src/org/openbravo/retail/returns/ReturnsShipmentOrderLoaderHook.java
---