Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036622
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Web POSmajoralways2017-08-08 07:222017-10-11 13:22
ReporterguillermogilView Statuspublic 
Assigned Toranjith_qualiantech_com 
PriorityurgentResolutionfixedFixed in VersionRR17Q4
StatusclosedFix in branchFixed in SCM revision57d9b039b059
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036622: Add a not needed payment can generate wrong data

DescriptionIf you add a not needed payment (e.g.- add a payment when the total has been paid) if that payment is check as cash it can generate wrong data due to cash change.
It should not be possible to allow that.
Steps To Reproduce- 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
- Pay totally with card
- Add 5€ as cash

Look the backend, you will see that total payment is wrong,
Proposed SolutionIt should have 2 different solutions:
- It should not be possible to add a payment (first lines of addPayment function) if amount is positive (to grant change) and pending is <= 0
- There should be an additionnal check to ensure that if something has happend with the payments, to not allow it (e.g.- Add a product that cost 10, pay it, then on the same ticket return a product that cost 20) Those cases are not taken into account properly

Update: another case should also be taken into account: if a payment was added to a positive receipt, and then the receipt total changes to a negative amount (because negative lines are added, or a positive line is changed into a negative line), then the payment should also be considered invalid, and the user should also not be able to complete the ticket.
TagsNo tags attached.
Attached Filespatch file icon issue 36622 17Q2 source posterminal 8064.patch [^] (10,907 bytes) 2017-10-11 13:22 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0037264 closedranjith_qualiantech_com Returning change in a payment method with payment data generates a wrong payment plan 
causes defect 0037224 closedranjith_qualiantech_com It is not possible to finish a refund with multiple means of payment 
causes defect 0037809 closedranjith_qualiantech_com [RR18q1] "Unneeded Payments" Error message is not taking conversion rate into account 

-  Notes
(0098610)
hgbot (developer)
2017-08-23 12:29

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 6252cd13b09ae8f893c339503045e88debdea0a5
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Aug 23 15:58:31 2017 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/6252cd13b09ae8f893c339503045e88debdea0a5 [^]

Related to issue 36622 : Additional Payment should not be allowed if exact amount is paid

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0098611)
hgbot (developer)
2017-08-23 12:29

Repository: tools/automation/pi-mobile
Changeset: 521702944e3290b2a46edffcfa37d03dec865e24
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Aug 23 15:59:00 2017 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/521702944e3290b2a46edffcfa37d03dec865e24 [^]

Verifies issue 36622 : Added automated test 'I36622_VerifyReceiptExactPayment'

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/reversepayments/ReversePaymentTests.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/system/I32826_VerifyOverpaymentByCashCardII.java
A src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I36622_VerifyReceiptExactPayment.java
---
(0098741)
hgbot (developer)
2017-08-31 08:17

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 2254e99d8586af60e5de058547a90637a4381cec
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Wed Aug 30 14:27:36 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2254e99d8586af60e5de058547a90637a4381cec [^]

Fixed issue 36622: Add a not needed payment can generate wrong data

An additional check has been added when done button is clicked.

The check has been also added to multiorders addPayment function.

For reverse payment, it has been added to set in client side the
attribute is ReversePayment for those payment lines loaded from the
backend.

---
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/payment.js
---
(0098757)
hgbot (developer)
2017-08-31 14:26

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: e8a58b4ee7c80e45e5f532b8fca4632fd7283dca
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Thu Aug 31 14:25:44 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/e8a58b4ee7c80e45e5f532b8fca4632fd7283dca [^]

Related to issue 36622: Add a not needed payment can generate wrong data

Backed out changeset 2254e99d8586

---
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/payment.js
---
(0098758)
jorge-garcia (reporter)
2017-08-31 14:26

The last change breaks the cancel and replace functionality
(0098818)
marvintm (manager)
2017-09-04 17:19

Update: another case should also be taken into account: if a payment was added to a positive receipt, and then the receipt total changes to a negative amount (because negative lines are added, or a positive line is changed into a negative line), then the payment should also be considered invalid, and the user should also not be able to complete the ticket.
(0098876)
hgbot (developer)
2017-09-07 07:37

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 45d7ea5660a207217a0530424598adc422edd4cd
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Sep 06 17:56:48 2017 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/45d7ea5660a207217a0530424598adc422edd4cd [^]

Related to issue 36622: Add a not needed payment can generate wrong data

An additional check has been added when done button is clicked.

The check has been also added to multiorders addPayment function.

For reverse payment, it has been added to set in client side the
attribute is ReversePayment for those payment lines loaded from the
backend.

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/payment.js
---
(0098879)
hgbot (developer)
2017-09-07 08:07

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 540d54be7475372ed50da85190839550b80180e4
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Sep 07 11:37:18 2017 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/540d54be7475372ed50da85190839550b80180e4 [^]

Related to issue 36622: Add a not needed payment can generate wrong data

Backed out changeset: 45d7ea5660a2

Tests failed in try

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/payment.js
---
(0098920)
hgbot (developer)
2017-09-08 15:22

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 57d9b039b05973d2c55d261800073125f05f35d6
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri Sep 08 18:51:41 2017 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/57d9b039b05973d2c55d261800073125f05f35d6 [^]

Fixed issue 36622: Add a not needed payment can generate wrong data

An additional check has been added when done button is clicked.

The check has been also added to multiorders addPayment function.

For reverse payment, it has been added to set in client side the
attribute is ReversePayment for those payment lines loaded from the
backend.

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/pointofsale/view/payment.js
---
(0098921)
hgbot (developer)
2017-09-08 15:22

Repository: tools/automation/pi-mobile
Changeset: b207e1da409b029f6e3f2fd4e69a5d5864e24a6a
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Fri Sep 08 18:51:05 2017 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/b207e1da409b029f6e3f2fd4e69a5d5864e24a6a [^]

Verifies issue 36622 : Modified automated test 'CancelAndRplcPartiallyReduced'

Modified automated test 'I36622_VerifyReceiptExactPayment'

---
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/cancelandreplace/CancelAndRplcPartiallyReduced.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/cancelandreplace/I35279_CancelAndRplcLayawayII.java
M src-test/org/openbravo/test/mobile/retail/pack/selenium/tests/receipts/I36622_VerifyReceiptExactPayment.java
---

- Issue History
Date Modified Username Field Change
2017-08-08 07:22 guillermogil New Issue
2017-08-08 07:22 guillermogil Assigned To => Retail
2017-08-08 07:22 guillermogil Resolution time => 1503957600
2017-08-08 07:22 guillermogil Triggers an Emergency Pack => No
2017-08-10 13:12 ranjith_qualiantech_com Assigned To Retail => ranjith_qualiantech_com
2017-08-10 13:12 ranjith_qualiantech_com Status new => scheduled
2017-08-23 12:29 hgbot Checkin
2017-08-23 12:29 hgbot Note Added: 0098610
2017-08-23 12:29 hgbot Checkin
2017-08-23 12:29 hgbot Note Added: 0098611
2017-08-30 14:33 jorge-garcia Assigned To ranjith_qualiantech_com => jorge-garcia
2017-08-31 08:17 hgbot Checkin
2017-08-31 08:17 hgbot Note Added: 0098741
2017-08-31 08:17 hgbot Status scheduled => resolved
2017-08-31 08:17 hgbot Resolution open => fixed
2017-08-31 08:17 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2254e99d8586af60e5de058547a90637a4381cec [^]
2017-08-31 14:26 hgbot Checkin
2017-08-31 14:26 hgbot Note Added: 0098757
2017-08-31 14:26 jorge-garcia Note Added: 0098758
2017-08-31 14:26 jorge-garcia Status resolved => new
2017-08-31 14:26 jorge-garcia Resolution fixed => open
2017-09-04 17:19 marvintm Note Added: 0098818
2017-09-04 17:19 marvintm Proposed Solution updated
2017-09-07 07:37 hgbot Checkin
2017-09-07 07:37 hgbot Note Added: 0098876
2017-09-07 08:07 hgbot Checkin
2017-09-07 08:07 hgbot Note Added: 0098879
2017-09-08 15:22 hgbot Checkin
2017-09-08 15:22 hgbot Note Added: 0098920
2017-09-08 15:22 hgbot Status new => resolved
2017-09-08 15:22 hgbot Resolution open => fixed
2017-09-08 15:22 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/2254e99d8586af60e5de058547a90637a4381cec [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/57d9b039b05973d2c55d261800073125f05f35d6 [^]
2017-09-08 15:22 hgbot Checkin
2017-09-08 15:22 hgbot Note Added: 0098921
2017-09-11 09:36 jorge-garcia Assigned To jorge-garcia => ranjith_qualiantech_com
2017-09-11 11:32 marvintm Review Assigned To => marvintm
2017-09-11 11:32 marvintm Status resolved => closed
2017-09-11 11:32 marvintm Fixed in Version => RR17Q4
2017-10-11 13:22 ranjith_qualiantech_com File Added: issue 36622 17Q2 source posterminal 8064.patch
2017-11-06 07:47 guillermogil Relationship added causes 0037224
2017-11-08 15:28 aaroncalero Relationship added related to 0037264
2018-02-05 09:02 ranjith_qualiantech_com Relationship added causes 0037809


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker