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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0032589
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] Gift cards and gift vouchersmajoralways2016-04-05 00:082016-05-09 11:12
ReporterrbianchiniView Statuspublic 
Assigned Tomario_castello 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisionb8f0453a2bef
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionRR16Q1SCM revision 
Review Assigned Tomarvintm
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0032589: [MultiPriceList] Gift card with multi price list fails in some cases

DescriptionIf you have the multi price list enabled in a store, and the business partner has a different price list than the store, when you add a gift card, the ammount is added to the ticket instead of substracted

Tested in 16Q1 and 15Q4.5
Steps To Reproduce1 - Install gift cards / vouchers module
2 - Goto Preferences window
3 - Set property's value "Web POS Enable Multi Price List" to 'Y'
4 - Configure a gift card as a product.
5 - Add it in the store's assortment and price list
6 - Go to business partner window and select Arturo Montoro
7 - Move to Tab Client and select the price list "Sale Price List Customer VIP"
8 - Add the gift card product created in step 4 to the price list "Sale Price List Customer VIP"
9 - Log in to web pos (in the store with the milti price list enabled in step 3)
10 - Sell a gift card with the default business partner
11 - Select the business Partner "Arturo Montoro"
12 - Add some product to the ticket
13 - Select the menu entry Gift cards/vouchers
14 - Select the gift card sold in step 10 and apply it
15 - Realize that the gift card is added instead of substracted
Proposed SolutionIn the backbone model "Order" the line:
if (OB.MobileApp.model.hasPermission('EnableMultiPriceList', true) && this.get('priceList') !== OB.MobileApp.model.get('terminal').priceList)

Should take into account if the product is a gift card, add negative price
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0085579)
hgbot (developer)
2016-04-12 17:44

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 9629da6656d1e1e629fa285a364679535669a6bd
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Mon Apr 11 14:48:43 2016 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9629da6656d1e1e629fa285a364679535669a6bd [^]

Fixed issue 32589: Added a validation to identify whether the product is a gift card. If the product is a gift card then not change the product price.

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---
(0085754)
hgbot (developer)
2016-04-19 17:33

Repository: tools/automation/pi-mobile
Changeset: 7833223116177f78e7aa19fcbfaee25f8bc1cf53
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Tue Apr 19 09:33:02 2016 -0600
URL: http://code.openbravo.com/tools/automation/pi-mobile/rev/7833223116177f78e7aa19fcbfaee25f8bc1cf53 [^]

Related to issue 32589: Added automated test

---
A src-test/org/openbravo/test/mobile/quarantine/pack/MCA/multipricelists/I32589_MPLEnablePreferenceCreateReceipt.java
---
(0085969)
marvintm (manager)
2016-04-25 19:31

There shouldn't be a reference from Core modules to attributes added by external modules. This is at least bad styling, and in some cases can even lead to compilation or runtime errors.

Instead of explicitly using a flag set up by the Gift Cards module, a new generic flag at the product level should be defined in Core, and this flag should be read instead in the Core method. The gift card module should set this flag so that then in Core the price is not changed in the case of multipricelist.
(0086002)
marvintm (manager)
2016-04-26 17:43

A bit more information:

A new flag with name "doNotUpdatePriceFromPricelist" should be created in Core. This flag should be checked in the place the current "giftCardTransaction" is checked, and if it's true then the prices should not be updated.

The gift cards module should set this flag in the product which is then used to create a new line, when a gift card is used to pay.
(0086222)
hgbot (developer)
2016-05-05 18:25

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 5aa95adab94df267e84346ce3a0628de4b31615c
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Fri Apr 29 10:20:45 2016 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5aa95adab94df267e84346ce3a0628de4b31615c [^]

Related to issue 32589: Added new property updatePriceFromPricelist to product model

---
M src/org/openbravo/retail/posterminal/master/ProductProperties.java
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/model/product.js
---
(0086224)
hgbot (developer)
2016-05-05 19:38
edited on: 2016-05-05 23:53

Repository: erp/pmods/org.openbravo.retail.giftcards
Changeset: 2785fcf83f67c7d0883619e7f44d85df93b38c4d
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Thu May 05 11:37:39 2016 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/rev/2785fcf83f67c7d0883619e7f44d85df93b38c4d [^]

Fixed issue 32589: Added validation to giftCardTransaction to prevent price changes.
Set the updatePriceFromPricelist property in false to prevent prices changes for gift card transaction line.

---
M web/org.openbravo.retail.giftcards/js/components/lineproperties.js
---

(0086249)
marvintm (manager)
2016-05-06 10:45

Now the fix is much better. However, there is some part of the code which is not really need, and should be removed. Specifically, the changes in ProductProperties.java and product.js are not needed. The product object is a dynamic object and new properties can be added on the fly without any issue, so it's not necessary to explicitly declare every single property always.

The updatePriceFromPricelist is a property which in most cases will not be used at all, so I would prefer not to declare it anywhere, and only explicitly set it when it's needed. So the remaining changes which need to be done are:
- Remove the changes in ProductProperties.java. It's not necessary to declare the property.
- Remove the changes in product.js. It's also not necessary to declare the property here either.
- Change the expression in order.js to check if the property is true, instead of checking that it's false, as the property will be undefined (so false in practice) in most cases.
(0086287)
hgbot (developer)
2016-05-07 18:19

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: b8f0453a2befcf3631d4be642c3616882f8ed2cd
Author: Mario Castello <mario.castello <at> peoplewalking.com>
Date: Sat May 07 10:18:04 2016 -0600
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b8f0453a2befcf3631d4be642c3616882f8ed2cd [^]

Fixed issue 32589: Delete declaration of the property updatePriceFromPricelist in product model.

---
M src/org/openbravo/retail/posterminal/master/ProductProperties.java
M web/org.openbravo.retail.posterminal/js/model/order.js
M web/org.openbravo.retail.posterminal/js/model/product.js
---
(0086302)
hgbot (developer)
2016-05-09 11:11

Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 5c14a08c7388035e1a0e31cc4d9b6bb9a8d32c86
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon May 09 11:09:35 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/5c14a08c7388035e1a0e31cc4d9b6bb9a8d32c86 [^]

Related to issue 32589. Also update prices in case the property is true

---
M web/org.openbravo.retail.posterminal/js/model/order.js
---

- Issue History
Date Modified Username Field Change
2016-04-05 00:08 rbianchini New Issue
2016-04-05 00:08 rbianchini Assigned To => Retail
2016-04-05 00:08 rbianchini Resolution time => 1460343600
2016-04-05 00:08 rbianchini Triggers an Emergency Pack => No
2016-04-06 18:34 Orekaria Resolution time 1460343600 => 1460325600
2016-04-06 18:34 Orekaria Summary Gift card with multi price list fails in some cases => [MultiPriceList] Gift card with multi price list fails in some cases
2016-04-06 18:34 Orekaria Status new => acknowledged
2016-04-11 16:11 mario_castello Assigned To Retail => mario_castello
2016-04-11 16:11 mario_castello Status acknowledged => scheduled
2016-04-12 17:44 hgbot Checkin
2016-04-12 17:44 hgbot Note Added: 0085579
2016-04-12 17:44 hgbot Status scheduled => resolved
2016-04-12 17:44 hgbot Resolution open => fixed
2016-04-12 17:44 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9629da6656d1e1e629fa285a364679535669a6bd [^]
2016-04-19 17:33 hgbot Checkin
2016-04-19 17:33 hgbot Note Added: 0085754
2016-04-25 19:31 marvintm Note Added: 0085969
2016-04-25 19:31 marvintm Status resolved => new
2016-04-25 19:31 marvintm Resolution fixed => open
2016-04-26 16:29 mario_castello Status new => scheduled
2016-04-26 17:43 marvintm Note Added: 0086002
2016-05-05 18:25 hgbot Checkin
2016-05-05 18:25 hgbot Note Added: 0086222
2016-05-05 19:38 hgbot Checkin
2016-05-05 19:38 hgbot Note Added: 0086224
2016-05-05 19:38 hgbot Status scheduled => resolved
2016-05-05 19:38 hgbot Resolution open => fixed
2016-05-05 19:38 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/9629da6656d1e1e629fa285a364679535669a6bd [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/rev/2785fcf83f67c7d0883619e7f44d85df93b38c4d [^]
2016-05-05 23:53 mario_castello Note Edited: 0086224 View Revisions
2016-05-06 10:45 marvintm Note Added: 0086249
2016-05-06 10:45 marvintm Status resolved => new
2016-05-06 10:45 marvintm Resolution fixed => open
2016-05-06 10:46 marvintm Status new => scheduled
2016-05-07 18:19 hgbot Checkin
2016-05-07 18:19 hgbot Note Added: 0086287
2016-05-07 18:19 hgbot Status scheduled => resolved
2016-05-07 18:19 hgbot Resolution open => fixed
2016-05-07 18:19 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/rev/2785fcf83f67c7d0883619e7f44d85df93b38c4d [^] => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/b8f0453a2befcf3631d4be642c3616882f8ed2cd [^]
2016-05-09 11:11 hgbot Checkin
2016-05-09 11:11 hgbot Note Added: 0086302
2016-05-09 11:12 marvintm Review Assigned To => marvintm
2016-05-09 11:12 marvintm Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker