Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037264Retail ModulesWeb POSpublic2017-11-08 15:282019-04-11 13:12
aaroncalero 
ranjith_qualiantech_com 
highmajoralways
closedfixed 
5
 
 
marvintm
No
0037264: Returning change in a payment method with payment data generates a wrong payment plan
If you generate change in a ticket and the cash payment method is not grouped (because it is created with payment data), when the ticket is finally synchronized the payment plan is wrongly generated.
- Add this hook to your code:
OB.UTIL.HookManager.registerHook('OBPOS_preAddPayment', function (args, callbacks) {
  if (args.paymentToAdd.get('amount') < 0) {
    args.paymentToAdd.set('paid', args.paymentToAdd.get('amount'));
    args.paymentToAdd.set('origAmount', args.paymentToAdd.get('amount'))
    args.paymentToAdd.set('paymentData', {
      change: 'change payment'
    });
  }
  OB.UTIL.HookManager.callbackExecutor(args, callbacks);
});

- Load WebPOS
- Add an Avalanche transceiver
- Add 5€ as cash
- Pay 150.5€ with card

Go to the Sales Order window in backend and verify that the Payment Plan is wrong,
No tags attached.
related to defect 0036622 closed ranjith_qualiantech_com Add a not needed payment can generate wrong data 
related to defect 0038038 closed ranjith_qualiantech_com Wrong payment documents registered in backoffice when giving change in another currency from WebPOS 
Issue History
2017-11-08 15:28aaroncaleroNew Issue
2017-11-08 15:28aaroncaleroAssigned To => Retail
2017-11-08 15:28aaroncaleroTriggers an Emergency Pack => No
2017-11-08 15:28aaroncaleroRelationship addedrelated to 0036622
2018-03-22 08:15ranjith_qualiantech_comRelationship addedrelated to 0038048
2018-03-22 08:24ranjith_qualiantech_comRelationship addedrelated to 0038038
2018-03-22 08:24ranjith_qualiantech_comRelationship deletedrelated to 0038048
2018-03-22 14:01ranjith_qualiantech_comAssigned ToRetail => ranjith_qualiantech_com
2018-03-26 07:55ranjith_qualiantech_comStatusnew => scheduled
2019-04-11 13:12marvintmReview Assigned To => marvintm
2019-04-11 13:12marvintmNote Added: 0111081
2019-04-11 13:12marvintmStatusscheduled => closed
2019-04-11 13:12marvintmResolutionopen => fixed

Notes
(0111081)
marvintm   
2019-04-11 13:12   
This issue has been fixed as part of the multichange project