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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0039780
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Gift cards and gift vouchersmajoralways2018-12-11 15:462019-01-04 00:16
ReporteraaroncaleroView Statuspublic 
Assigned Toranjith_qualiantech_com 
PriorityurgentResolutionfixedFixed in VersionRR19Q2
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toguilleaer
Regression levelCoding ( Testing )
Regression date2018-10-16
Regression introduced in releasepi
Regression introduced by commithttps://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/rev/7e8784db93445ce848d86fa2766e0f6922664476 [^]
Triggers an Emergency PackNo
Summary

0039780: Giftcards are not consumed in a reimburse until the related cash management is finally processed in the server

DescriptionWhenever a giftcard is used from WebPOS (a payment is added, or the giftcard is returned), a giftcard transaction is created in the backend database to prevent using the giftcard more times than it is intended.

When a giftcard is reimbursed, however, this is no longer the case, and the giftcard is not closed until the reimburse cash management is finally processed by the server. If, by any reason, the cash management is not immediately processed, it would be possible to consume the giftcard or do another reimburse.
Steps To Reproduce1. Login in webpos in an instance with giftcards installed (i.e. livebuilds modules environment)
2. Create a gift certificate:
*Menu > Create Gift Certificate
*Select 'Refund the Difference' as Category.
*Fill rest of fields as required
*Click on Apply
3. Click on Menu > Cash Management
4. Click on Reimburse
5. Select the created Gift Certificate and click on Apply
6. Add an amount to reimburse
7. Select the payment method to reimburse
8. In the server code, set a breakpoint in the ProcessCashMgmt class, inside the saveRecord method.
8. Finally click on Done
Verify that the giftcard will remain open/not consumed until the breakpoint is removed.
Proposed SolutionIn the commit which introduced the issue [1] the payment list is iterated (OB.MobileApp.model.get('payments')) and each element's id is compared with an id from the cash management model. The problem is that the elements inside OB.MobileApp.model.get('payments') don't have an id, it is needed to go into the payment inside the element to get the correct id. Basically:
Change from:
 return payment.id === dropsdeps.at(index).get('paymentMethodId')
To
 return payment.payment.id === dropsdeps.at(index).get('paymentMethodId')

[1] https://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/rev/7e8784db93445ce848d86fa2766e0f6922664476 [^]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0039684 closedranjith_qualiantech_com check Gift Card Instance || Gift Card Transaction || Cancelled must be Yes for partial reimbursement 
related to defect 0039704 closedranjith_qualiantech_com Modify the payment description for a gift card reimbursement 
related to defect 0038771 closedranjith_qualiantech_com Test ReimburseCard is failing, not clear if failure of the test or failure in the pos 

-  Notes
(0108399)
aaroncalero (manager)
2018-12-11 16:02
edited on: 2018-12-12 13:31

There is another consequence of this issue.
When the partial reimburse/reimburse in different payment methods was implemented, it was done assuming the code was working correctly, and it was implemented assuming that the ProcessCashMgmtHookGiftCard[1] class didn't receive a transactionId (which is generated when the giftcard is consumed preemtively). When this issue is fixed, it will be required to check that the partial reimburse continues working correctly.

Moreover, at least two issues were fixed for the reimburse, 0039684 and 0039704, so it will be required to check that they continue working after fixing this issue.

[1] https://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/file/tip/src/org/openbravo/retail/giftcards/hooks/ProcessCashMgmtHookGiftCard.java#l120 [^]

(0108545)
hgbot (developer)
2018-12-12 11:13

Repository: erp/pmods/org.openbravo.retail.giftcards
Changeset: 59511e2e5d450a53dbc5942830b36189d7454a07
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Wed Dec 12 15:43:34 2018 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/rev/59511e2e5d450a53dbc5942830b36189d7454a07 [^]

Related to issue 39780 : Gift Card transaction must be Cancelled while reimbursing it in Cash managament

* Gift Car must be consumed/closed before CashMgmt Process.
  In CashMgmt Process, it will update payment transaction with gift card transaction

---
M src/org/openbravo/retail/giftcards/GiftCardModel.java
M src/org/openbravo/retail/giftcards/hooks/ProcessCashMgmtHookGiftCard.java
M src/org/openbravo/retail/giftcards/process/GiftCardGLItemUtils.java
M web/org.openbravo.retail.giftcards/js/hooks/preSaveCashManagementsHook.js
---
(0108799)
ranjith_qualiantech_com (developer)
2019-01-03 07:56

Changes in GiftCardModel.java should be reverted
https://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/rev/59511e2e5d450a53dbc5942830b36189d7454a07#l1.2 [^]

While completing the receipt using Gift Certificate (Refund the difference), then transaction should not be in cancelled status
While reimburse the Gift Certificate (Refund the difference) partially or fully through cash management, then transaction should be in cancelled status

Currently, transaction is updated as cancelled for receipt payments
(0108808)
hgbot (developer)
2019-01-03 09:55

Repository: erp/pmods/org.openbravo.retail.giftcards
Changeset: 9b080894ba2e18a7edfd33aaaab5650430eba8b9
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Jan 03 14:24:55 2019 +0530
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/rev/9b080894ba2e18a7edfd33aaaab5650430eba8b9 [^]

Related to issue 39780 : Gift Card transaction should not be Cancelled when it is paid for receipt

* For Reimbursed Gift certificate, transaction status should be false when Gift certificate is paid for receipt
* While completing the receipt using Gift Certificate (Refund the difference), then transaction should not be in cancelled status
  While reimburse the Gift Certificate (Refund the difference) partially or fully through cash management, then transaction should be in cancelled status

---
M src/org/openbravo/retail/giftcards/ConsumeGiftCardAmount.java
M src/org/openbravo/retail/giftcards/GiftCardModel.java
M web/org.openbravo.retail.giftcards/js/hooks/preSaveCashManagementsHook.js
---
(0108812)
hgbot (developer)
2019-01-03 12:20

Repository: tools/automation/pi-mobile
Changeset: fe2a28963ef0ea352e4d9e36f2aa44ee526c66e5
Author: Ranjith S R <ranjith <at> qualiantech.com>
Date: Thu Jan 03 16:50:33 2019 +0530
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/fe2a28963ef0ea352e4d9e36f2aa44ee526c66e5 [^]

Verifies issue 39780 : Added Automated Test 'I39780_VerifyReimurseGiftTransaction'

---
A src-test/org/openbravo/test/mobile/retail/extmodules/selenium/tests/giftcards/I39780_VerifyReimurseGiftTransaction.java
---

- Issue History
Date Modified Username Field Change
2018-12-11 15:46 aaroncalero New Issue
2018-12-11 15:46 aaroncalero Assigned To => Retail
2018-12-11 15:46 aaroncalero Resolution time => 1545692400
2018-12-11 15:46 aaroncalero Regression level => Coding ( Testing )
2018-12-11 15:46 aaroncalero Regression date => 2018-10-16
2018-12-11 15:46 aaroncalero Regression introduced in release => pi
2018-12-11 15:46 aaroncalero Regression introduced by commit => https://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/rev/7e8784db93445ce848d86fa2766e0f6922664476 [^]
2018-12-11 15:46 aaroncalero Triggers an Emergency Pack => No
2018-12-11 16:02 aaroncalero Note Added: 0108399
2018-12-11 17:31 ranjith_qualiantech_com Assigned To Retail => ranjith_qualiantech_com
2018-12-11 17:31 ranjith_qualiantech_com Status new => scheduled
2018-12-12 11:13 hgbot Checkin
2018-12-12 11:13 hgbot Note Added: 0108545
2018-12-12 13:27 ranjith_qualiantech_com Status scheduled => resolved
2018-12-12 13:27 ranjith_qualiantech_com Resolution open => fixed
2018-12-12 13:31 aaroncalero Note Edited: 0108399 View Revisions
2018-12-12 13:35 ranjith_qualiantech_com Relationship added related to 0039684
2018-12-12 13:35 ranjith_qualiantech_com Relationship added related to 0039704
2018-12-24 13:05 marvintm Review Assigned To => marvintm
2018-12-24 13:05 marvintm Status resolved => closed
2018-12-24 13:05 marvintm Fixed in Version => RR19Q1
2019-01-03 07:56 ranjith_qualiantech_com Note Added: 0108799
2019-01-03 07:56 ranjith_qualiantech_com Status closed => new
2019-01-03 07:56 ranjith_qualiantech_com Resolution fixed => open
2019-01-03 07:56 ranjith_qualiantech_com Fixed in Version RR19Q1 =>
2019-01-03 07:56 ranjith_qualiantech_com Status new => scheduled
2019-01-03 09:55 hgbot Checkin
2019-01-03 09:55 hgbot Note Added: 0108808
2019-01-03 12:20 hgbot Checkin
2019-01-03 12:20 hgbot Note Added: 0108812
2019-01-03 14:49 ranjith_qualiantech_com Status scheduled => resolved
2019-01-03 14:49 ranjith_qualiantech_com Resolution open => fixed
2019-01-04 00:16 guilleaer Review Assigned To marvintm => guilleaer
2019-01-04 00:16 guilleaer Status resolved => closed
2019-01-04 00:16 guilleaer Fixed in Version => RR19Q2
2019-01-04 07:52 ranjith_qualiantech_com Relationship added related to 0038771


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker