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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034103
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 02. Master data managementmajoralways2016-09-27 17:302016-09-29 00:02
Reportermarkmm82View Statuspublic 
Assigned Tomarkmm82 
PriorityurgentResolutionfixedFixed in Version3.0PR16Q4
StatusclosedFix in branchFixed in SCM revisionc679132719ab
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toaferraz
Web browser
ModulesCore
Regression levelProduction - QA Approved
Regression date2016-04-15
Regression introduced in release3.0PR16Q3
Regression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/168db990cb85 [^]
Triggers an Emergency PackNo
Summary

0034103: Incorrect prices are calculated in Purchase Orders/Invoices when exists discounts or promotions related to products.

DescriptionWhen a Promotion or Discount is created for an specific product, and it is added to a purchase order/invoice prices for the product should not be recalculated as discounts and promotions not applies to Purchases, it applies only for the Sales flows. At moment of product selection, discounts are applied and when the purchase order/invoice is processed it is ignored. As it will be not applied, should be avoided recalculation of prices at product selection time.
Steps To ReproduceAs group admin role:
   1. Set the Price Precision of the Currency EUR to 2 if necessary
   2. Create a new product
      Search key/ Name: Test
   3. Add two prices of 34.27 to it. For instance for Tarifa Bebidas Alegres and Tarifa de Ventas price lists versions.
   4. Create a Price Adjustment for that product. Go to Discount and Promotions and add a new record:
      Discount %: 64.3
      Discount Amount: 0.00
      Included Products: Only those defined
   5. Add the new product in tab Products
   6. Create a Purchase Order header for Bebidas Alegres, S.L bp.
   7. Create a line to the purchase order:
     Add the previously created product (Test) and check the Net Unit Price is updated to 12.34. IT IS NOT CORRECT
   8. Set tax to Compras exentas, to not apply taxes.
   9. Remove discounts from Basic Discounts if exists.
   10. Book the order and check the following information is updated in header and line:
     Purchase Order Line:
        Net Unit Price is updated to 34.28
        Line Net Amount is updated to 34.28
     Purchase Order Header:
    Total Gross Amount: 34.28
    Total Net Amount: 34.28
     
     IT IS NOT CORRECT because Discounts and Promotions only work for Sales flow and can not be applied.
     In step 7, the price should not be updated because discounts are not applicable to purchases.
     So, when the order is processed the correct values should be:
     Purchase Order Line:
        Net Unit Price is updated to 34.27
        Line Net Amount is updated to 34.27
     Purchase Order Header:
    Total Gross Amount: 34.27
    Total Net Amount: 34.27

Verify, this issue is also reproducible to Purchases Invoices.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0033975 closedmarkmm82 Openbravo ERP Wrong Net Unit Price and pricestd in order and invoice lines when applying a discount of a percentage with decimals 
depends on backport 00341043.0PR16Q3.2 closedmarkmm82 Openbravo ERP Incorrect prices are calculated in Purchase Orders/Invoices when exists discounts or promotions related to products. 
caused by defect 0032544 closedshivum039 Retail Modules automatic discounts are applied in backoffice purchase flow 

-  Notes
(0090308)
markmm82 (developer)
2016-09-27 17:37

Test Plan 1:
As group admin role:
   Set the Price Precision of the Currency EUR to 2 if necessary
   Create a new product
      Search key/ Name: Test-I
   Add two prices of 34.27 to it. For instance for Tarifa Bebidas Alegres and Tarifa de Ventas price lists versions.
   Create a Price Adjustment for that product. Go to Discount and Promotions and add a new record:
      Discount %: 64.3
      Discount Amount: 0.00
      Included Products: Only those defined
   Add the new product in tab Products
   Create a Purchase Order header for Bebidas Alegres, S.L bp.
   Create a line to the purchase order:
     Add the previously created product (Test-I) and check the Net Unit Price is updated to 34.27.
   Set tax to Compras exentas, to not apply taxes.
   Remove discounts from Basic Discounts if exists.
   Book the order and check the following information is updated in header and line:
     Purchase Order Line:
        Net Unit Price is updated to 34.27
     Purchase Order Header:
    Total Gross Amount: 34.27
    Total Net Amount: 34.27
     It is correct because Discounts and Promotions only work for Sales flow and can not be applied.


Test Plan 2:
As group admin role:
   Set the Price Precision of the Currency EUR to 2 if necessary
   Create a new product
      Search key/ Name: Test-II
   Add two prices of 34.27 to it. For instance for Tarifa Bebidas Alegres and Tarifa de Ventas price lists versions.
   Create a Price Adjustment for that product. Go to Discount and Promotions and add a new record:
      Discount %: 64.3
      Discount Amount: 0.00
      Included Products: Only those defined
   Add the new product in tab Products
   Create a Purchase Invoice header for Bebidas Alegres, S.L bp.
   Create a line to the invoice:
     Add the previously created product (Test-II) and check the Net Unit Price is updated to 34.27.
   Set tax to Compras exentas, to not apply taxes.
   Remove discounts from Basic Discounts if exists.
   Complete the invoice and check the following information is updated in header and line:
     Purchase Invoice Line:
        Net Unit Price is updated to 34.27
     Purchase Invoice Header:
    Total Gross Amount: 34.27
    Total Net Amount: 34.27
     It is correct because Discounts and Promotions only work for Sales flow and can not be applied.

Test Plan 3 (related issue 33975):
As group admin role:
   Set the Price Precision of the Currency EUR to 2 if necessary
   Create a new product
      Search key/ Name: Test-III
   Add two prices of 34.27 to it. For instance for Tarifa Bebidas Alegres and Tarifa de Ventas price lists versions.
   Create a Price Adjustment for that product. Go to Discount and Promotions and add a new record:
      Discount %: 64.3
      Discount Amount: 0.00
      Included Products: Only those defined
   Add the new product in tab Products
   Create a Sales Order header for Alimentos y Supermercados, S.A bp.
   Create a line to the sales order:
     Add the previously created product (Test-III) and check the Net Unit Price is updated to 12.23.
   Set tax to Ventas exentas, to not apply taxes.
   Remove discounts from Basic Discounts if exists.
   Book it and check the following information is updated in Sales order header and line:
     Sales Order Line:
        Net Unit Price is updated to 12.23
     Sales Order Header:
    Total Gross Amount: 12.23
    Total Net Amount: 12.23
     It is correct, there are not taxes or discounts except applied to the price with the Price adjustment previously created to the product.

Test Plan 4 (related issue 33975):
As group admin role:
   Set the Price Precision of the Currency EUR to 2 if necessary
   Create a new product
      Search key/ Name: Test-IV
   Add two prices of 34.27 to it. For instance for Tarifa Bebidas Alegres and Tarifa de Ventas price lists versions.
   Create a Price Adjustment for that product. Go to Discount and Promotions and add a new record:
      Discount %: 64.3
      Discount Amount: 0.00
      Included Products: Only those defined
   Add the new product in tab Products
   Create a Sales Invoice header for Alimentos y Supermercados, S.A bp.
   Create a line to the invoice:
     Add the previously created product (Test-IV) and check the Net Unit Price is updated to 12.23.
   Set tax to Ventas exentas, to not apply taxes.
   Remove discounts from Basic Discounts if exists.
   Complete it and check the following information is updated in header and line:
     Sales Invoice Line:
        Net Unit Price is updated to 12.23
     Sales Invoice Header:
    Total Gross Amount: 12.23
    Total Net Amount: 12.23
     It is correct, there are not taxes or discounts except applied to the price with the Price adjustment previously created for the product.
(0090329)
hgbot (developer)
2016-09-28 09:53

Repository: erp/devel/pi
Changeset: c679132719ab56e00c5702079c419922b51d9e0d
Author: Mark <markmm82 <at> gmail.com>
Date: Tue Sep 27 11:06:10 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/c679132719ab56e00c5702079c419922b51d9e0d [^]

Fixes issue 34103: No discounts are applied to product prices in Purchase flows

Price adjustments are not executed if is processing a Purchase Order/Invoice using a product with a promotion or discount, because this functionality should be only available for Sales flows.

---
M src-db/database/model/functions/M_PROMOTION_ADJUSTMENT.xml
M src/org/openbravo/erpCommon/businessUtility/PriceAdjustment.java
---
(0090332)
aferraz (developer)
2016-09-28 09:58

Code review + Testing OK
(0090360)
hudsonbot (developer)
2016-09-29 00:02

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/2cd54ee6264a [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2016-09-27 17:30 markmm82 New Issue
2016-09-27 17:30 markmm82 Assigned To => markmm82
2016-09-27 17:30 markmm82 Modules => Core
2016-09-27 17:30 markmm82 Regression level => Production - Confirmed Stable
2016-09-27 17:30 markmm82 Regression date => 2016-06-17
2016-09-27 17:30 markmm82 Regression introduced in release => 3.0PR16Q3
2016-09-27 17:30 markmm82 Regression introduced by commit => https://code.openbravo.com/erp/devel/main/rev/0dc7be081b1c [^]
2016-09-27 17:30 markmm82 Triggers an Emergency Pack => No
2016-09-27 17:31 markmm82 Status new => scheduled
2016-09-27 17:37 markmm82 Relationship added related to 0033975
2016-09-27 17:37 markmm82 Note Added: 0090308
2016-09-27 17:49 aferraz Relationship added caused by 0032544
2016-09-27 17:50 aferraz Regression level Production - Confirmed Stable => Production - QA Approved
2016-09-27 17:50 aferraz Regression date 2016-06-17 => 2016-04-15
2016-09-27 17:50 aferraz Regression introduced by commit https://code.openbravo.com/erp/devel/main/rev/0dc7be081b1c [^] => https://code.openbravo.com/erp/devel/pi/rev/168db990cb85 [^]
2016-09-28 09:34 aferraz Steps to Reproduce Updated View Revisions
2016-09-28 09:53 hgbot Checkin
2016-09-28 09:53 hgbot Note Added: 0090329
2016-09-28 09:53 hgbot Status scheduled => resolved
2016-09-28 09:53 hgbot Resolution open => fixed
2016-09-28 09:53 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c679132719ab56e00c5702079c419922b51d9e0d [^]
2016-09-28 09:58 aferraz Review Assigned To => aferraz
2016-09-28 09:58 aferraz Note Added: 0090332
2016-09-28 09:58 aferraz Status resolved => closed
2016-09-28 09:58 aferraz Fixed in Version => 3.0PR16Q4
2016-09-29 00:02 hudsonbot Checkin
2016-09-29 00:02 hudsonbot Note Added: 0090360


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker