Openbravo Issue Tracking System - Retail Modules
View Issue Details
0033176Retail ModulesWeb POSpublic2016-06-07 18:072018-03-19 09:27
shuehner 
Sandrahuguet 
normalminorhave not tried
closedfixed 
5
 
RR18Q2 
marvintm
No
0033176: OrderLoader countPayments functions is called to often (once per payment)
The countPayments functions which counts all payment related to the order being processed is called in a loop per payment present in the Order.

That seems to not be required as the code can easily know how many payments it created (via the loop) so should only need to query some initial payment-count once before the loop (to find any possible payments created before this orderloader invocation). Then it could use this startcount + simple add a counter to get unique DocumentNo.
Configure POS to use useOrderDocumentNoForRelatedDocs preference to use that code-path.

Add item to webpos cart.
Use 2 different payments methods to pay this ticket
i.e. 5€ cash + rest 'credit'.

Performance
related to defect 0033123 closed shuehner OrderLoader countPayments function uses very complex and potentially very slow query for simple check 
Issue History
2016-06-07 18:07shuehnerNew Issue
2016-06-07 18:07shuehnerAssigned To => Retail
2016-06-07 18:07shuehnerTriggers an Emergency Pack => No
2016-06-07 18:07shuehnerRelationship addedrelated to 0033123
2016-06-07 18:07shuehnerTag Attached: Performance
2018-03-14 13:14SandrahuguetAssigned ToRetail => Sandrahuguet
2018-03-14 15:19SandrahuguetReview Assigned To => marvintm
2018-03-15 08:23hgbotCheckin
2018-03-15 08:23hgbotNote Added: 0103263
2018-03-15 08:23hgbotStatusnew => resolved
2018-03-15 08:23hgbotResolutionopen => fixed
2018-03-15 08:23hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/0050c49b4a1f375b764ecfb881d2120606e9a8e6 [^]
2018-03-19 09:27marvintmStatusresolved => closed
2018-03-19 09:27marvintmFixed in Version => RR18Q2

Notes
(0103263)
hgbot   
2018-03-15 08:23   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 0050c49b4a1f375b764ecfb881d2120606e9a8e6
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Wed Mar 14 09:07:31 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/0050c49b4a1f375b764ecfb881d2120606e9a8e6 [^]

fixed issue 33176 call to countPayments only once time during orderloader

---
M src/org/openbravo/retail/posterminal/OrderLoader.java
---