Openbravo Issue Tracking System - Retail Modules
View Issue Details
0036481Retail ModulesWeb POSpublic2017-07-12 18:512017-07-27 10:21
kchoperena 
mtaal 
urgentmajoralways
closedfixed 
5
 
 
migueldejuana
No
0036481: [STORE SERVER 3094]: A fully paid layaway has isLayaway = N
When we create an order using ExternalOrderLoader, if the layaway is fully paid it is never detected.

If we pay fully when the execution achieve the orderLoader, the fullypaidLayaway variable is always false because never satisfy the next condition:

fullypaidLayaway = (jsonorder.getBoolean("isLayaway") || jsonorder.optLong("orderType") == 2)
        && Math.abs(jsonorder.getDouble("payment")) >= Math.abs(jsonorder.getDouble("gross"));


This happens because ExternalOrderLoader is setting property payment to value -1
1.- Create a layaway using EcommerceCreateOrderWS
2.- Create a payment using EcommerceCreatePaymentWS

EXPECTED RESULTS:

The flag isLayaway will be N, because payment is not detected.
It is needed to set the payment property from the received JSON.

Order Loader should be able to avoid update delivered quantity when not generated shipment.

It is needed that the ExternalOrderLoader class, add the previous paid quantity (should get it from DB) in order to detect that the layaway has been completely paid.

Attached patch with suggested solution.

No tags attached.
related to feature request 0036548 closed asiermartirena In OrderLoader the delivery logic has been moved to the shipments logic 
diff patchPosTerminal.diff (3,258) 2017-07-14 12:08
https://issues.openbravo.com/file_download.php?file_id=10915&type=bug
Issue History
2017-07-12 18:51kchoperenaNew Issue
2017-07-12 18:51kchoperenaAssigned To => mtaal
2017-07-12 18:51kchoperenaResolution time => 1499983200
2017-07-12 18:51kchoperenaTriggers an Emergency Pack => No
2017-07-14 11:20jonibcAssigned Tomtaal =>
2017-07-14 11:20jonibcCategoryStoreServer => Web POS
2017-07-14 11:20jonibcDescription Updatedbug_revision_view_page.php?rev_id=15513#r15513
2017-07-14 11:20jonibcSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15515#r15515
2017-07-14 11:20jonibcProposed Solution updated
2017-07-14 11:28jonibcProposed Solution updated
2017-07-14 12:08jonibcFile Added: patchPosTerminal.diff
2017-07-17 09:37jonibcIssue Monitored: jonibc
2017-07-19 18:24mtaalAssigned To => mtaal
2017-07-20 09:41hgbotCheckin
2017-07-20 09:41hgbotNote Added: 0098141
2017-07-20 09:41hgbotStatusnew => resolved
2017-07-20 09:41hgbotResolutionopen => fixed
2017-07-20 09:41hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2cd793c0149767c5dc67d24741bc8fc2f10782f1 [^]
2017-07-20 09:42mtaalReview Assigned To => migueldejuana
2017-07-20 14:59hgbotCheckin
2017-07-20 14:59hgbotNote Added: 0098153
2017-07-20 15:00migueldejuanaNote Added: 0098154
2017-07-20 15:00migueldejuanaStatusresolved => new
2017-07-20 15:00migueldejuanaResolutionfixed => open
2017-07-22 22:10hgbotCheckin
2017-07-22 22:10hgbotNote Added: 0098185
2017-07-22 22:10hgbotStatusnew => resolved
2017-07-22 22:10hgbotResolutionopen => fixed
2017-07-22 22:10hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2cd793c0149767c5dc67d24741bc8fc2f10782f1 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5d2c77ae365cec69ffdf39f657d0ccae2bb011ab [^]
2017-07-22 22:12hgbotCheckin
2017-07-22 22:12hgbotNote Added: 0098186
2017-07-27 10:21migueldejuanaNote Added: 0098241
2017-07-27 10:21migueldejuanaStatusresolved => closed
2017-07-31 11:58asiermartirenaRelationship addedrelated to 0036548

Notes
(0098141)
hgbot   
2017-07-20 09:41   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 2cd793c0149767c5dc67d24741bc8fc2f10782f1
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Jul 20 09:41:27 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2cd793c0149767c5dc67d24741bc8fc2f10782f1 [^]

Fixes issue 36481: [STORE SERVER 3094]: A fully paid layaway has isLayaway = N
Compute the value of the payments property in the ExternalOrderLoader
OrderLoader: set delivered and deliveredquantity in the createshipment logic

---
M src/org/openbravo/retail/posterminal/ExternalOrderLoader.java
M src/org/openbravo/retail/posterminal/OrderLoader.java
---
(0098153)
hgbot   
2017-07-20 14:59   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 4a38031eaf8572a56b41642df630681c4702c1b0
Author: Miguel de Juana <miguel.dejuana <at> openbravo.com>
Date: Thu Jul 20 14:59:13 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/4a38031eaf8572a56b41642df630681c4702c1b0 [^]

Related to issue 0036481: [STORE SERVER 3094]: A fully paid layaway has isLayaway = N

Backed out changeset 2cd793c01497

It is breaking: CancelAndRplcAmountIncreased, CancelAndRplcOfCancelAndRplc, I35955_CancelAndRplcFromCredit, CancelAndRplcOfCancelAndRplc, I35955_CancelAndRplcFromCredit

---
M src/org/openbravo/retail/posterminal/ExternalOrderLoader.java
M src/org/openbravo/retail/posterminal/OrderLoader.java
---
(0098154)
migueldejuana   
2017-07-20 15:00   
It is breaking: CancelAndRplcAmountIncreased, CancelAndRplcOfCancelAndRplc, I35955_CancelAndRplcFromCredit, CancelAndRplcOfCancelAndRplc, I35955_CancelAndRplcFromCredit
(0098185)
hgbot   
2017-07-22 22:10   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 5d2c77ae365cec69ffdf39f657d0ccae2bb011ab
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sat Jul 22 22:10:30 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5d2c77ae365cec69ffdf39f657d0ccae2bb011ab [^]

Fixes issue 36481: [STORE SERVER 3094]: A fully paid layaway has isLayaway = N

Compute the value of the payments property in the ExternalOrderLoader
OrderLoader: set delivered and deliveredquantity in the createshipment logic

---
M src/org/openbravo/retail/posterminal/ExternalOrderLoader.java
M src/org/openbravo/retail/posterminal/OrderLoader.java
---
(0098186)
hgbot   
2017-07-22 22:12   
Repository: tools/automation/pi-mobile
Changeset: 05fce0fb56a709b716c4cc143bc2459ea928fcf0
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sat Jul 22 22:12:13 2017 +0200
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/05fce0fb56a709b716c4cc143bc2459ea928fcf0 [^]

Related to issue 36481: [STORE SERVER 3094]: A fully paid layaway has isLayaway = N
Adapted testcase so that it has multiple lines, check delivered status

---
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/RetailOrderLoaderTest.java
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/message-order-create-1.json
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/message-order-paypartial1-1.json
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/message-order-paypartial2-1.json
M src-test/org/openbravo/test/mobile/retail/pack/webservice/tests/orderloader/message-order-ship-1.json
---
(0098241)
migueldejuana   
2017-07-27 10:21   
Reviewed