Openbravo Issue Tracking System - Retail Modules
View Issue Details
0044904Retail ModulesWeb POSpublic2020-08-27 07:422020-09-22 17:31
marvintm 
prakashmurugesan88 
normalmajoralways
closedfixed 
5
 
RR20Q4 
No
0044904: Cancel Order/Layaway is currently not available in the Retail API
Currently, using the ExternalOrderLoader endpoint, it is possible to do all major Order flows like order creation, layaway creation, addition of payments, or cancel and replace. However, the simple Cancel flow is not available.

The reason is that the Cancel Order/Layaway flow in the WebPOS currently uses a different class in the backend: CancelLayawayLoader.java. Therefore, as ExternalOrderLoader is in a different class hierarchy, the functionality there is not available.
Just try to use ExternalOrderLoader and realise that it is not possible to specify to cancel an order.
There are two main changes that need to be done:
- First is to integrate the logic currently in CancelLayawayLoader into the main OrderLoader class. It should be done in such a way that it is properly integrated, with the common parts (like the call to UpdateCashup.getAndUpdateCashUp to update the cashup data, or the call to handlePayments) being preserved like they are in the OrderLoader, and the specific code in CancelLayaway moved to its own place in OrderLoader.

Special attention should be put when refactoring this to ensure that the same parts that are currently being executed with either triggers enabled or disabled, are executed in the same way after the refactor.

Once this part is done, it will be possible to cancel orders using ExternalOrderLoader.

- Second part then consists on doing the necessary changes in the WebPOS to call OrderLoader also in the Cancel Layaway/Order flows. Once this is done, we will be free to remove the CancelLayawayLoader.java and CancelLayawayImportEntryProcessor.java classes, as we will no longer need them, and import entries of type "Order" will be generated from the WebPOS.
No tags attached.
related to defect 0049912 closed ranjith_qualiantech_com The Layaway is not deliverable even if a payment was done through the API 
patch I44904_20Q3.patch (11,301) 2020-09-07 14:22
https://issues.openbravo.com/file_download.php?file_id=14944&type=bug
Issue History
2020-08-27 07:42marvintmNew Issue
2020-08-27 07:42marvintmAssigned To => Retail
2020-08-27 07:42marvintmTriggers an Emergency Pack => No
2020-08-27 07:43marvintmProposed Solution updated
2020-09-02 16:03prakashmurugesan88Assigned ToRetail => prakashmurugesan88
2020-09-07 05:22prakashmurugesan88Statusnew => scheduled
2020-09-07 14:22prakashmurugesan88File Added: I44904_20Q3.patch
2020-09-11 05:40hgbotNote Added: 0122934
2020-09-14 07:40hgbotNote Added: 0122988
2020-09-14 07:40hgbotResolutionopen => fixed
2020-09-14 07:40hgbotStatusscheduled => closed
2020-09-14 07:40hgbotFixed in Version => RR20Q4
2020-09-14 07:40hgbotNote Added: 0122989
2020-09-14 07:40hgbotNote Added: 0122990
2020-09-22 17:31hgbotNote Added: 0123295
2020-09-22 17:31hgbotNote Added: 0123296
2022-08-05 11:56ranjith_qualiantech_comRelationship addedrelated to 0049912

Notes
(0122934)
hgbot   
2020-09-11 05:40   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/93 [^]
(0122988)
hgbot   
2020-09-14 07:40   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 292cf9b4f5360b699a4fb9985bf5b470ffda4b73
Author: Prakash M <prakash@qualiantech.com>
Date: 2020-09-14T10:48:11+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/292cf9b4f5360b699a4fb9985bf5b470ffda4b73 [^]

Related to BUG-44904 : In ExternalOrderLoader cancel flow is not available
* This is because CancelLayawayLoader is implemented separately
* Fixed by moving cancel flow from CancelLayawayLoader to OrderLoader

---
M src/org/openbravo/retail/posterminal/OrderLoader.java
---
(0122989)
hgbot   
2020-09-14 07:40   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 6fa15e2dc394800b9df55dbbbefc1e5d08231107
Author: Prakash M <prakash@qualiantech.com>
Date: 2020-09-14T10:48:11+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/6fa15e2dc394800b9df55dbbbefc1e5d08231107 [^]

Fixed BUG-44904 : In ExternalOrderLoader cancel flow is not available
* This is because CancelLayawayLoader is implemented separately
* Fixed by moving cancel flow from CancelLayawayLoader to OrderLoader
* CancelLaywayLoader now calls super(OrderLoader) to perform the operation

---
M src/org/openbravo/retail/posterminal/CancelLayawayLoader.java
---
(0122990)
hgbot   
2020-09-14 07:40   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/merge_requests/93 [^]
(0123295)
hgbot   
2020-09-22 17:31   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: 50b82e6574d81d5ccd9673a41a856a81f846eef8
Author: Prakash M <prakash@qualiantech.com>
Date: 2020-09-22T19:32:26+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/50b82e6574d81d5ccd9673a41a856a81f846eef8 [^]

Related to BUG-44904: Handled cancel layaway in external order loader

---
M src/org/openbravo/retail/posterminal/ExternalOrderLoader.java
---
(0123296)
hgbot   
2020-09-22 17:31   
Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal [^]
Changeset: a788cbce5935c73918354b777b9d29ee46ab467f
Author: Prakash M <prakash@qualiantech.com>
Date: 2020-09-22T20:35:30+05:30
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.posterminal/-/commit/a788cbce5935c73918354b777b9d29ee46ab467f [^]

Related to BUG-44904: Fixes try failure in RetailOrderLoaderTest-testPromotionOrder

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