Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036371Retail ModulesWeb POSpublic2017-06-29 09:092017-09-27 18:52
Sandrahuguet 
gorka_gil 
normalmajorhave not tried
closedfixed 
20Community Appliance
 
RR17Q4 
marvintm
No
0036371: Delete payment schedule details is slow when paying a layaway
When a layaway is paid, payment schedule details are deleted and created again, this process is slow.

LOG: duration: 605.752 ms execute <unnamed>: delete from FIN_Payment_ScheduleDetail where FIN_Payment_Scheduledetail_ID=$1

Log in the WebPOS
Create a layaway
Search the layaway created in previous step and pay it
 
Performance
Issue History
2017-06-29 09:09SandrahuguetNew Issue
2017-06-29 09:09SandrahuguetAssigned To => Retail
2017-06-29 09:09SandrahuguetResolution time => 1501106400
2017-06-29 09:09SandrahuguetTriggers an Emergency Pack => No
2017-06-29 09:09SandrahuguetTag Attached: Performance
2017-06-29 09:10SandrahuguetDescription Updatedbug_revision_view_page.php?rev_id=15442#r15442
2017-06-29 09:31SandrahuguetSummaryDelete payment schedule details are slow when paying a layaway => Delete payment schedule details is slow when paying a layaway
2017-07-31 09:37marvintmResolution time1501106400 => 1502748000
2017-08-21 08:44marvintmResolution time1502748000 => 1503352800
2017-08-25 12:05marvintmResolution time1503352800 => 1504130400
2017-09-01 13:28marvintmResolution time1504130400 => 1505426400
2017-09-12 16:48gorka_gilAssigned ToRetail => gorka_gil
2017-09-12 16:58gorka_gilStatusnew => scheduled
2017-09-18 11:22marvintmResolution time1505426400 => 1506031200
2017-09-26 18:33hgbotCheckin
2017-09-26 18:33hgbotNote Added: 0099607
2017-09-26 18:34hgbotCheckin
2017-09-26 18:34hgbotNote Added: 0099608
2017-09-26 18:34hgbotStatusscheduled => resolved
2017-09-26 18:34hgbotResolutionopen => fixed
2017-09-26 18:34hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/818345823503482414b01975872aa4617839a3dd [^]
2017-09-27 18:52marvintmReview Assigned To => marvintm
2017-09-27 18:52marvintmStatusresolved => closed
2017-09-27 18:52marvintmFixed in Version => RR17Q4

Notes
(0099607)
hgbot   
2017-09-26 18:33   
Repository: tools/automation/pi-mobile
Changeset: 32bbc2c4e1de3f6ff73eaf4bc8960b961dc77177
Author: Gorka Gil <gorka.gil <at> openbravo.com>
Date: Fri Sep 22 14:04:36 2017 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/32bbc2c4e1de3f6ff73eaf4bc8960b961dc77177 [^]

Related to issue 36371: Delete payment schedule details is slow when paying a layaway

test1
- create laway (no payment)
- 2 parcial payment
- final payment
test2
- create layaway (1 payment)
- parcial payment
- final payment
test3
- like test 2, but in the final payment create the invoice

checks for all tests:
- remaining psd id used for new payment (so there is no delete of psd)
- check num psd are the correct one
- check psd amounts are correct
- the psd has related a pd and payment
- if has invoice, check it has a related invoice

---
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/layaway/I36371_NewParcialPaymentDontDeleteAPaymentScheduleDetail.java
---
(0099608)
hgbot   
2017-09-26 18:34   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 818345823503482414b01975872aa4617839a3dd
Author: Gorka Gil <gorka.gil <at> openbravo.com>
Date: Tue Sep 19 10:26:46 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/818345823503482414b01975872aa4617839a3dd [^]

Fixed issue 36371: Delete payment schedule details is slow when paying a layaway

Previously:
  When creating a payment for a layaway, it create a new fin_payment_scheduledatail
for the payment, then delete all the non linked fin_payment_scheduledatail's and then
create a new one for the remaining amount.

After the fix:
  Instead create a new one for the payment search for any non linked, if found reuse it,
and create a new one for the remaining.

Note: the non linked are still deleted before create the one for the ramaining, but
in normal case should not be any to delete. Only will be when creating the order in
the erp and seting many schedule details, webpos always create only one scheudle detail.

Also needed to remove the set of the id when creating the remaining one, since it fails
with the new changes and they are not needed, since the correlation of ids between the client
and the backend is not needed for the case fin_payment_scheduledatail_id.

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