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

View Revisions: Issue #43202 Back to Issue ]
Summary 0043202: grossListPrice & priceList properties of order line model (client side) are not behaving as expected according to ERP behavior
Revision 2020-02-19 13:31 by joniturralde93
Steps To Reproduce [scenario 1 -> including taxes]


- Go to web POS (VBS-1) which uses price including taxes)
- Mark the order as layaway
- add Headlamp ultralight (price in the price list = 18.90)
- Manually modify that line price (click price and enter 6)
- In developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
18.9
OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
18.9

Error 1: Since we are working with the price including taxes priceList should be 0 and grossPriceList = 18.90. However, when order is synchronized values are OK in the backend

- layaway the ticket without adding any payment

[ticket saved]

- Open the menu and open recently created receipt using "Open receipt"
- When the ticket is loaded using developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
6
OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
18.9

Error 2: Since we are working with the price including taxes priceList should be 0 and grossPriceList = 18.90. However, when payments are added or layaway is completed values are still correct in the backend

[scenario 2 -> Not including taxes]


- Go to web POS (PS-1) which uses price NOT including taxes)
- Mark the order as layaway
- add Headlamp ultralight (price in the price list = 18.90)
- Manually modify that line price (click price and enter 6)
- In developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
18.9
OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
18.9

Error 3: Since we are working with the price NOT including taxes priceList should be 18.90 and grossPriceList = 0. However, when order is synchronized values are OK in the backend

- layaway the ticket without adding any payment

[ticket saved]

- Open the menu and open recently created receipt using "Open receipt"
- When the ticket is loaded using developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
6
OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
6

Error 4: Since we are working with the price including taxes priceList should be 18.90 and grossPriceList = 0. However, when payments are added or layaway is completed values are still correct in the backend

Error 5: If for any reason someone needs to check the original price list of the product included in the order line when order line was created, there is no way in the front end to do that.



Update:

- Go to web POS (PS-1) which uses price NOT including taxes)
- Mark the order as layaway
- add Headlamp ultralight (price in the price list = 18.90)
- Manually modify that line price (click price and enter 6)
- In developer tools check that
OB.MobileApp.model.receipt.get('lines').at(0).get('discountPercentage') is still not set (it's set when synchronizing the order)
- Layaway the order
- Load it with open receipt option
- In developer tools check that
OB.MobileApp.model.receipt.get('lines').at(0).get('discountPercentage') is 68.25%
- Completely pay the layaway
- If you put a breakpoint in the previous code:
discountPercentage = OB.DEC.toBigDecimal(grossListPrice)
              .subtract(grossUnitPrice)
              .multiply(new BigDecimal('100'))
              .divide(
                OB.DEC.toBigDecimal(grossListPrice),
                2,
                BigDecimal.prototype.ROUND_HALF_UP
              );

- You can check the discountPercentage is calculated based on a previously wrongly calculated grossListPrice. It is always 0.
Revision 2020-02-19 13:31 by joniturralde93
Description In backend
-> Using price including taxes
GrossPriceList field of orderline stores the price of a product in the price list when the order line was created

-> Using price not including taxes
priceList field of orderline stores the price of a product in the price list when the order line was created

The above fields are static and should not change during the different processes.

All the facts explained above are true and correct. However, in the frontend side (client-side) we have properties that suggest the same behavior but they are behaving differently

priceList => seems to match with OB.MobileApp.model.receipt.get('lines').at(0).get('priceList') but the behavior is not the same

GrossPriceList => seems to match with OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice') but the behavior is not the same

Error 1:
names of these properties are confusing

Error 2:
Front end does not offer a model property that represents the same concept stored in GrossPriceList, priceList which is the original price in the price list used when the order was created


Update:

Also the property discountPercentage is wrongly set for a layaway with manually modified price. This property is used for the column "discount" in the DB orderline (it is a percentage)

When a layaway is loaded in order to pay it, if you type:
OB.MobileApp.model.receipt.get('lines').at(0).get('discountPercentage')
The value is right. It's the same than when first synchronized the layaway, but when you completely pay the layaway, this code is executed:
discountPercentage = OB.DEC.toBigDecimal(grossListPrice)
              .subtract(grossUnitPrice)
              .multiply(new BigDecimal('100'))
              .divide(
                OB.DEC.toBigDecimal(grossListPrice),
                2,
                BigDecimal.prototype.ROUND_HALF_UP
              );

Since the property grossListPrice is wrong (based on grossListPrice or priceList depending on including/excluding taxes), the discountPercentage is wrongly calculated and sent.

Since this only happens for completed layaways, the orderloader doesn't put this wrong values in the DB, but they could be used by custom processes.
Revision 2020-02-12 22:12 by joniturralde93
Description In backend
-> Using price including taxes
GrossPriceList field of orderline stores the price of a product in the price list when the order line was created

-> Using price not including taxes
priceList field of orderline stores the price of a product in the price list when the order line was created

The above fields are static and should not change during the different processes.

All the facts explained above are true and correct. However, in the frontend side (client-side) we have properties that suggest the same behavior but they are behaving differently

priceList => seems to match with OB.MobileApp.model.receipt.get('lines').at(0).get('priceList') but the behavior is not the same

GrossPriceList => seems to match with OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice') but the behavior is not the same

Error 1:
names of these properties are confusing

Error 2:
Front end does not offer a model property that represents the same concept stored in GrossPriceList, priceList which is the original price in the price list used when the order was created
Revision 2020-02-12 18:05 by guilleaer
Steps To Reproduce [scenario 1 -> including taxes]


- Go to web POS (VBS-1) which uses price including taxes)
- Mark the order as layaway
- add Headlamp ultralight (price in the price list = 18.90)
- Manually modify that line price (click price and enter 6)
- In developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
18.9
OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
18.9

Error 1: Since we are working with the price including taxes priceList should be 0 and grossPriceList = 18.90. However, when order is synchronized values are OK in the backend

- layaway the ticket without adding any payment

[ticket saved]

- Open the menu and open recently created receipt using "Open receipt"
- When the ticket is loaded using developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
6
OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
18.9

Error 2: Since we are working with the price including taxes priceList should be 0 and grossPriceList = 18.90. However, when payments are added or layaway is completed values are still correct in the backend

[scenario 2 -> Not including taxes]


- Go to web POS (PS-1) which uses price NOT including taxes)
- Mark the order as layaway
- add Headlamp ultralight (price in the price list = 18.90)
- Manually modify that line price (click price and enter 6)
- In developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
18.9
OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
18.9

Error 3: Since we are working with the price NOT including taxes priceList should be 18.90 and grossPriceList = 0. However, when order is synchronized values are OK in the backend

- layaway the ticket without adding any payment

[ticket saved]

- Open the menu and open recently created receipt using "Open receipt"
- When the ticket is loaded using developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
6
OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
6

Error 4: Since we are working with the price including taxes priceList should be 18.90 and grossPriceList = 0. However, when payments are added or layaway is completed values are still correct in the backend

Error 5: If for any reason someone needs to check the original price list of the product included in the order line when order line was created, there is no way in the front end to do that.
Revision 2020-02-12 17:58 by guilleaer
Steps To Reproduce [scenario 1 -> including taxes]


- Go to web POS (VBS-1) which uses price including taxes)
- Mark the order as layaway
- add Headlamp ultralight (price in the price list = 18.90)
- Manually modify that line price (click price and enter 6)
- In developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
18.9
OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
18.9

Error 1: Since we are working with the price including taxes priceList should be 0 and grossPriceList = 18.90. However, when order is synchronized values are OK in the backend

- layaway the ticket without adding any payment

[ticket saved]

- Open the menu and open recently created receipt using "Open receipt"
- When the ticket is loaded using developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
6
OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
18.9

Error 2: Since we are working with the price including taxes priceList should be 0 and grossPriceList = 18.90. However, when payments are added or layaway is completed values are still correct in the backend

[scenario 2 -> Not including taxes]


- Go to web POS (PS-1) which uses price NOT including taxes)
- Mark the order as layaway
- add Headlamp ultralight (price in the price list = 18.90)
- Manually modify that line price (click price and enter 6)
- In developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
18.9
OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
18.9

Error 3: Since we are working with the price NOT including taxes priceList should be 18.90 and grossPriceList = 0. However, when order is synchronized values are OK in the backend

- layaway the ticket without adding any payment

[ticket saved]

- Open the menu and open recently created receipt using "Open receipt"
- When the ticket is loaded using developer tools check that

OB.MobileApp.model.receipt.get('lines').at(0).get('grossListPrice')
6
OB.MobileApp.model.receipt.get('lines').at(0).get('priceList')
6

Error 4: Since we are working with the price including taxes priceList should be 18.90 and grossPriceList = 0. However, when payments are added or layaway is completed values are still correct in the backend

Error 5: If for any reason someone needs to check the original price list of the order, it is not possible to do that.


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker