Openbravo Issue Tracking System - Retail Modules
View Issue Details
0041901Retail ModulesWeb POSpublic2019-09-30 12:142019-10-18 13:13
aaroncalero 
rqueralta 
highmajoralways
closedfixed 
5
 
RR20Q1 
marvintm
No
0041901: Services Query is not removing duplicated services in remote mode
When services related to a product are shown in webpos, services that are already added to the ticket are removed from the search list.
When using the 'Enable Remote for Product' preference, if there are two services related to the same product, and services for the same product are shown, the removal of duplicates is not working and all services are shown on the Search tab.
Log in backend, go to the Preference window and configure the preference 'Enable Remote for Product' with value 'Y'.
Log in WebPOS
Create a new layaway
Search and add the product GPS Mini
The Mandatory services will be shown.
Add two of the services (i.e. Warranty (deferrable) and Warranty (not deferrable))
Click on Continue.
Click on the Show Related Services button of the GPS Mini.

Verify that all services are shown again, even if two of them are already added to the ticket.

If this happens in a Cancel and Replace or in an Order created from a Quotation, it is possible to add the same services again, and the relationship is duplicated in the line. When a ticket with duplicated relations is synchronized, an Error While Importing POS data is generated, with an error containing something like:

Caused by: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "c_ordlinservrel_unique"
  Detail: Key (c_orderline_id, c_orderline_related_id)=(98F335761254D06A16E7775158B27884, 86018679E82FB06ABC1921AF6DAAD375) already exists.
In the ServicesHQLCriteria.java class, part of the hql filter is a filter to exclude products already added to the ticket ("and product.id not in ('$5')")
This filter is sent from webpos as an array of IDs of the services already added. When there is more than one service, the filter is built wrong, and all services in the array are concatenated in a single comma-separated id instead of being a list of ids.
The issue is probably in the HQLCriteria inner class in SimpleQueryBuilder.java, in the replaceParams method.
No tags attached.
Issue History
2019-09-30 12:14aaroncaleroNew Issue
2019-09-30 12:14aaroncaleroAssigned To => Retail
2019-09-30 12:14aaroncaleroResolution time => 1571004000
2019-09-30 12:14aaroncaleroTriggers an Emergency Pack => No
2019-09-30 12:19aaroncaleroSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=19412#r19412
2019-09-30 12:27aaroncaleroProposed Solution updated
2019-10-07 04:56rqueraltaAssigned ToRetail => rqueralta
2019-10-07 04:57rqueraltaStatusnew => scheduled
2019-10-10 15:14hgbotCheckin
2019-10-10 15:14hgbotNote Added: 0115003
2019-10-10 15:15hgbotStatusscheduled => resolved
2019-10-10 15:15hgbotResolutionopen => fixed
2019-10-10 15:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/961195450fef3743e3c891a002a32222815121d6 [^]
2019-10-18 13:13marvintmReview Assigned To => marvintm
2019-10-18 13:13marvintmStatusresolved => closed
2019-10-18 13:13marvintmFixed in Version => RR20Q1

Notes
(0115003)
hgbot   
2019-10-10 15:14   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 961195450fef3743e3c891a002a32222815121d6
Author: Rafael Queralta <rafaelcuba81 <at> gmail.com>
Date: Wed Oct 09 10:04:22 2019 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/961195450fef3743e3c891a002a32222815121d6 [^]

Fixed issue 41901: Services Query is not removing duplicated services in remote
mode

- Removed join function to pass to the java class a right array object

---
M web/org.openbravo.retail.posterminal/js/components/servicesfilter.js
---