Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037033Openbravo ERP04. Warehouse managementpublic2017-10-09 13:232018-01-08 18:19
maite 
nonofrancisco 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q1 
dmiguelez
Core
No
0037033: "Price Difference Correction" adjustment calculated when it should not
Although no differences between order's price and invoice's price have been registered, process creates "Price Difference Correction" adjustment (because user could invoice same order twice)
1. Register Purchase Order for "F&B España - Región Norte" and business partner "Bebidas Alegres, S.L."
2. Add line for "Cerveza Ale 0,5L" and qty=2. Process Order
3. Register Goods Receipt using "Create lines from" and selecting previous order line. Process receipt
4. Register Purchase Invoice using "Create lines from" and selecting previous order line. Leave it in Draft status
5. Register Purchase Invoice using "Create lines from" and selecting previous order line. Process invoice
6. Process invoice created in step 4)
7. Create new Preference "Enable automatic Price Difference Corrections" with value Y
8. Verify that next execution of "Costing Background process" finishes successfully
9. Access "Cerveza Ale 0,5L" product and realize that "Price Difference Correction" adjustment has been calculated when no difference between order's price and invoice's price has been registered
No tags attached.
Issue History
2017-10-09 13:23maiteNew Issue
2017-10-09 13:23maiteAssigned To => Triage Finance
2017-10-09 13:23maiteModules => Core
2017-10-09 13:23maiteResolution time => 1509318000
2017-10-09 13:23maiteTriggers an Emergency Pack => No
2017-10-09 13:24maiteIssue Monitored: networkb
2017-10-09 13:57PracticsIssue Monitored: Practics
2017-10-09 19:51nonofranciscoAssigned ToTriage Finance => nonofrancisco
2017-10-09 19:56nonofranciscoStatusnew => scheduled
2017-10-10 19:41nonofranciscoNote Added: 0099858
2017-10-10 19:41nonofranciscoNote Edited: 0099858bug_revision_view_page.php?bugnote_id=0099858#r16049
2017-10-11 15:11nonofranciscoNote Edited: 0099858bug_revision_view_page.php?bugnote_id=0099858#r16062
2017-10-23 18:29dmiguelezNote Added: 0100006
2017-10-23 18:38dmiguelezNote Edited: 0100006bug_revision_view_page.php?bugnote_id=0100006#r16167
2017-10-24 09:27dmiguelezNote Edited: 0100006bug_revision_view_page.php?bugnote_id=0100006#r16170
2017-10-24 09:29hgbotCheckin
2017-10-24 09:29hgbotNote Added: 0100011
2017-10-24 09:29hgbotStatusscheduled => resolved
2017-10-24 09:29hgbotResolutionopen => fixed
2017-10-24 09:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a5064f422fe0001ff4f12b5e7c054a2965a0667e [^]
2017-10-24 09:29hgbotCheckin
2017-10-24 09:29hgbotNote Added: 0100012
2017-10-24 09:29dmiguelezReview Assigned To => dmiguelez
2017-10-24 09:29dmiguelezNote Added: 0100013
2017-10-24 09:29dmiguelezStatusresolved => closed
2017-11-09 11:11hgbotCheckin
2017-11-09 11:11hgbotNote Added: 0100376
2018-01-03 12:38hudsonbotCheckin
2018-01-03 12:38hudsonbotNote Added: 0101341
2018-01-03 12:38hudsonbotCheckin
2018-01-03 12:38hudsonbotNote Added: 0101342
2018-01-03 12:38hudsonbotCheckin
2018-01-03 12:38hudsonbotNote Added: 0101390
2018-01-08 18:19dmiguelezFixed in Version => 3.0PR18Q1

Notes
(0099858)
nonofrancisco   
2017-10-10 19:41   
(edited on: 2017-10-11 15:11)
Test Plan

1. Register Purchase Order for "F&B España - Región Norte" and business partner "Bebidas Alegres, S.L."
2. Add line for "Cerveza Ale 0,5L" and qty=2. Process Order
3. Register Goods Receipt using "Create lines from" and selecting previous order line. Process receipt
4. Register Purchase Invoice using "Create lines from" and selecting previous order line. Leave it in Draft status
5. Register Purchase Invoice using "Create lines from" and selecting previous order line. Process invoice
6. Process invoice created in step 4)
7. Create new Preference "Enable automatic Price Difference Corrections" with value Y
8. Verify that next execution of "Costing Background process" finishes successfully
9. Access "Cerveza Ale 0,5L" product and verify no cost adjustment has been calculated for the transaction

(0100006)
dmiguelez   
2017-10-23 18:29   
(edited on: 2017-10-24 09:27)
Test Plan

Go to Product Window and create a new Product
  - Organization: *
  - Search Key: TestCost
  - Name: TestCost
  - Other parameters with default values
Move to Price Tab and create a new record
  - Price List Version: Be Soft Drinker Price List
  - Unit Price: 10.00
  - List Price: 10.00
Create another record in the same Tab
  - Price List Version: General Sales
  - Unit Price: 10.00
  - List Price: 10.00

Go to Preference Window and create a new record:
  - Organization: *
  - Property: Enable automatic Price Difference Corrections
  - Vavlue: Y
  - Visibility fields: All empty

Test 1 (No Cost Adjustment):

1. Go to Purchase Order Window and create a new Purchase Order
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Move to Lines Tab and create a new record
  - Product: TestCost
  - Ordered Quantity: 1
  - Other parameters with default values
Click on Book button to complete the Purchase Order

2. Go to Goods Receipt Window and create a new Goods Receipt
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created (select also any Bin available)
Click on Complete button to complete the Goods Receipt

3. Go to Purchase Invoice Window and create a new Purchase Invoice
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created
Do not complte the Invoice yet

Create another Purchase Invoice
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created

Complete the two Invoices previously created

4. Execute the Costing Background Process (from Process Request Window)

5. Move to Product Window || Transactions Tab
Check that the last transaction created has:
  - Trx Original Cost: 10.00
  - Total Cost: 10.00
  - Unit Cost: 10.00


Test 2 (Cost adjustment to increase cost):

1. Go to Purchase Order Window and create a new Purchase Order
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Move to Lines Tab and create a new record
  - Product: TestCost
  - Ordered Quantity: 1
  - Other parameters with default values
Click on Book button to complete the Purchase Order

2. Go to Goods Receipt Window and create a new Goods Receipt
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created (select also any Bin available)
Click on Complete button to complete the Goods Receipt

3. Go to Purchase Invoice Window and create a new Purchase Invoice
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created
Do not complte the Invoice yet

Create another Purchase Invoice
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created
Select the line created and change the Net Unit Price to 20

Complete the two Invoices previously created

4. Execute the Costing Background Process (from Process Request Window)

5. Move to Product Window || Transactions Tab
Check that the last transaction created has:
  - Trx Original Cost: 10.00
  - Total Cost: 15.00
  - Unit Cost: 15.00

Test 3 (Cost adjustment to decrease cost):

1. Go to Purchase Order Window and create a new Purchase Order
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Move to Lines Tab and create a new record
  - Product: TestCost
  - Ordered Quantity: 1
  - Other parameters with default values
Click on Book button to complete the Purchase Order

2. Go to Goods Receipt Window and create a new Goods Receipt
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created (select also any Bin available)
Click on Complete button to complete the Goods Receipt

3. Go to Purchase Invoice Window and create a new Purchase Invoice
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created
Do not complte the Invoice yet

Create another Purchase Invoice
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created
Select the line created and change the Net Unit Price to 5

Complete the two Invoices previously created

4. Execute the Costing Background Process (from Process Request Window)

5. Move to Product Window || Transactions Tab
Check that the last transaction created has:
  - Trx Original Cost: 10.00
  - Total Cost: 7.50
  - Unit Cost: 7.50

Test 4 (Cost adjustment to increase cost with receipt partially invoiced):

1. Go to Purchase Order Window and create a new Purchase Order
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Move to Lines Tab and create a new record
  - Product: TestCost
  - Ordered Quantity: 2
  - Other parameters with default values
Click on Book button to complete the Purchase Order

2. Go to Goods Receipt Window and create a new Goods Receipt
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created (select also any Bin available)
Click on Complete button to complete the Goods Receipt

3. Go to Purchase Invoice Window and create a new Purchase Invoice
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created
Select the created line and change:
  - Invoiced Quantity: 1
  - Net Unit Price: 11
Complete the Purchase Invoice

4. Execute the Costing Background Process (from Process Request Window)

5. Move to Product Window || Transactions Tab
Check that the last transaction created has:
  - Trx Original Cost: 20.00
  - Total Cost: 21.00
  - Unit Cost: 21.00

Test 5 (Cost adjustment to decrease cost with receipt partially invoiced):

1. Go to Purchase Order Window and create a new Purchase Order
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Move to Lines Tab and create a new record
  - Product: TestCost
  - Ordered Quantity: 2
  - Other parameters with default values
Click on Book button to complete the Purchase Order

2. Go to Goods Receipt Window and create a new Goods Receipt
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created (select also any Bin available)
Click on Complete button to complete the Goods Receipt

3. Go to Purchase Invoice Window and create a new Purchase Invoice
  - Organization: F&B US
  - Business Partner: Be Soft Drinker
  - Other parameters with default values
Click on Create Lines From button and select the Order previously created
Select the created line and change:
  - Invoiced Quantity: 1
  - Net Unit Price: 9
Complete the Purchase Invoice

4. Execute the Costing Background Process (from Process Request Window)

5. Move to Product Window || Transactions Tab
Check that the last transaction created has:
  - Trx Original Cost: 20.00
  - Total Cost: 19.00
  - Unit Cost: 19.00

(0100011)
hgbot   
2017-10-24 09:29   
Repository: erp/devel/pi
Changeset: a5064f422fe0001ff4f12b5e7c054a2965a0667e
Author: Nono Carballo <nonofce <at> gmail.com>
Date: Mon Oct 23 17:40:09 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a5064f422fe0001ff4f12b5e7c054a2965a0667e [^]

Fixes issue 37033: "Price Difference Correction" adjustment calculated when it
should not

Cost adjustment is created just if expected unitary cost excedes transaction
unitary cost.

---
M src/org/openbravo/costing/PriceDifferenceProcess.java
---
(0100012)
hgbot   
2017-10-24 09:29   
Repository: erp/devel/pi
Changeset: 68b79a76a32d36bc1743cb8d8773b69be1c0aa8a
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Tue Oct 24 09:12:56 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/68b79a76a32d36bc1743cb8d8773b69be1c0aa8a [^]

Related to Issue 37033. Code Review changes

* Take into account correct quantity when calculating the expected unit cost
* Use correct quantity to calculate Transaction Cost Difference

---
M src/org/openbravo/costing/PriceDifferenceProcess.java
---
(0100013)
dmiguelez   
2017-10-24 09:29   
Code Review + Testing Ok
(0100376)
hgbot   
2017-11-09 11:11   
Repository: erp/devel/pi
Changeset: f4ae897ed38c53ca6a8b4c3707fce8489fa43408
Author: Nono Carballo <nonofce <at> gmail.com>
Date: Wed Nov 08 11:51:54 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/f4ae897ed38c53ca6a8b4c3707fce8489fa43408 [^]

Related to Issue 37033. Added automated test cases

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
A src-test/src/org/openbravo/test/costing/TestCostingUtils.java
---
(0101341)
hudsonbot   
2018-01-03 12:38   
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/c81e0d3cbab5 [^]
Maturity status: Test
(0101342)
hudsonbot   
2018-01-03 12:38   
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/c81e0d3cbab5 [^]
Maturity status: Test
(0101390)
hudsonbot   
2018-01-03 12:38   
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/c81e0d3cbab5 [^]
Maturity status: Test