Openbravo Issue Tracking System - Retail Modules
View Issue Details
0041426Retail ModulesWeb POSpublic2019-07-22 22:292019-08-16 07:32
asiermartirena 
asiermartirena 
urgentmajoralways
closedfixed 
5
 
RR19Q4 
marvintm
No
0041426: Payments are not correctly divided during the 'Pay Open Tickets' flow
There are some cases in the 'Pay Open Tickets' flow in which the payments are not correctly divided between the different orders.

This flow iterates the payments and the orders in order to set payments to orders until the orders are fully paid or the payments are fully consumed. Normally, a payment is set totally and is not managed again.

But there are some flows that makes this flow more complex. Those flows are 'Prepayments' and 'Delivery Modes'. Due to these flows, it is possible to have the situation in which the orders and payments iteration is not only done once for each order/payment.

In these different cases it is not taken into account if a payment have been totally divided between different orders, and it is divided even the remaining amount is zero. This generated a situation in which a payment of zero is added to a receipt. This is not correct.
Configure the delivery modes use them in Web POS.
Create a ticket with a line of amount 20 and with the delivery mode 'Pickup in Store'.
Create a second ticket with a line of amount 30 and a delivery mode of 'Pick and Carry'.
Load both orders in the 'Pay Open Tickets' flow.
Add a payment of type card of 10.
Pay the rest using cash.
Synchronize the receipts.
Having a break point in the OrderLoader.java class, check that the order with delivery mode 'Pickup in Store' has a payment of type card with amount zero. This is not correct, the payment shouldn't exist.

In addition, if the payment of zero is a 'Digital Coupon' payment, there would be a null pointer exception in an OrderLoaderHook which would generate an order in error status (in errors while importing).
No tags attached.
Issue History
2019-07-22 22:29asiermartirenaNew Issue
2019-07-22 22:29asiermartirenaAssigned To => asiermartirena
2019-07-22 22:29asiermartirenaTriggers an Emergency Pack => No
2019-07-23 12:51hgbotCheckin
2019-07-23 12:51hgbotNote Added: 0113591
2019-07-23 12:51hgbotStatusnew => resolved
2019-07-23 12:51hgbotResolutionopen => fixed
2019-07-23 12:51hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/443b7e4901a2f408d140e7320a82a64a6af52a13 [^]
2019-08-16 07:32marvintmReview Assigned To => marvintm
2019-08-16 07:32marvintmStatusresolved => closed
2019-08-16 07:32marvintmFixed in Version => RR19Q4

Notes
(0113591)
hgbot   
2019-07-23 12:51   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 443b7e4901a2f408d140e7320a82a64a6af52a13
Author: Asier Martirena <asier.martirena <at> openbravo.com>
Date: Mon Jul 22 22:32:11 2019 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/443b7e4901a2f408d140e7320a82a64a6af52a13 [^]

Fixed issue 41426: Payments are not correctly divided during the 'Pay Open Tickets' flow

During the 'Pay Open Tickets' flow, when trying to divide a payment that has been fully consumed, instead of creating a payment with the remaining amount (zero), it is iterated to the next payment.

---
M web/org.openbravo.retail.posterminal/js/hookPreSetPaymentsToReceipt.js
M web/org.openbravo.retail.posterminal/js/pointofsale/model/pointofsale-model.js
---