Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0040863Openbravo ERP04. Warehouse managementpublic2019-05-13 14:172019-07-05 11:38
gorkaion 
nonofrancisco 
highmajoralways
closedfixed 
5
 
3.0PR19Q3 
Sandrahuguet
Core
No
0040863: When cost of a void receipt is calculated only unit cost amount should be considered.
When a receipt has a cost adjustment. For example a negative stock correction. If this receipt is voided the cost of the negative receipt created to void it is calculated considering all the adjustment amount.

This generates a balance in the "Non-Invoiced Receipts" account when posting the receipts.
Create a Goods Receipt and process it.
- BPartner: Bebidas Alegres
- Product: Agua Sin Gas
- Quantity: 100
Ensure that its cost is calculated.
On the Transactions Tab of the Agua sin Gas product. Search the transaction of the created Goods Receipt and add a manual adjustment:
- Amount: 20
- Incremental: True
- Unit Cost: false
Check that the total cost of the transaction is 20EUR higher than the unit cost.
Go back to the Goods Receipt and void it.
Execute the cost calculation background.
Go back to the Transaction tab of the product and refresh it.
Note that the cost of the receipt is the total cost of the original transaction instead of the unit cost.
When calculating the cost of the void receipt it should only take the original cost of the receipt.

If the original receipt has any adjustment that it is Unit Cost then a new Cost Adjustment should be automatically generated when the cost of the void receipt is calculated to include those. To ensure that the inventory valuation after the void is the same.

For example:

Goods receipt original cost: 100USD
Price difference correction: 10USD unit cost true.
Manual correction 15USD unit cost true.
Negative Stock Correction: -20USD unit cost false.

When it is voided the cost of the receipt should be 100USD.
Then a cost adjustment needs to be created with 2 lines:
- Price difference correction 10USD.
- Manual correctoin 15USD.

So the inventory valuation balance is: -20USD from the negative stock correction.
No tags attached.
related to defect 0041295 closed collazoandy4 When a void receipt is a backdated transaction and the original receipt has adjustments the background process fails. 
Issue History
2019-05-13 14:17gorkaionNew Issue
2019-05-13 14:17gorkaionAssigned To => Triage Finance
2019-05-13 14:17gorkaionModules => Core
2019-05-13 14:17gorkaionResolution time => 1559512800
2019-05-13 14:17gorkaionTriggers an Emergency Pack => No
2019-05-13 14:47gorkaionStatusnew => feedback
2019-05-13 15:01gorkaionStatusfeedback => new
2019-05-13 15:01gorkaionDescription Updatedbug_revision_view_page.php?rev_id=18758#r18758
2019-05-13 15:01gorkaionProposed Solution updated
2019-05-13 15:32SandrahuguetAssigned ToTriage Finance => nonofrancisco
2019-05-14 20:23nonofranciscoStatusnew => scheduled
2019-05-27 21:35nonofranciscoNote Added: 0112187
2019-05-30 09:02hgbotCheckin
2019-05-30 09:02hgbotNote Added: 0112256
2019-05-30 09:02hgbotStatusscheduled => resolved
2019-05-30 09:02hgbotResolutionopen => fixed
2019-05-30 09:02hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/05d253f229e406a616de41fa8cba87c95062fb84 [^]
2019-05-30 10:10SandrahuguetReview Assigned To => Sandrahuguet
2019-05-30 10:10SandrahuguetNote Added: 0112258
2019-05-30 10:10SandrahuguetStatusresolved => closed
2019-05-30 10:10SandrahuguetFixed in Version => 3.0PR19Q3
2019-05-30 18:24hudsonbotCheckin
2019-05-30 18:24hudsonbotNote Added: 0112284
2019-07-05 11:38gorkaionIssue cloned0041295
2019-07-05 11:38gorkaionRelationship addedrelated to 0041295

Notes
(0112187)
nonofrancisco   
2019-05-27 21:35   
Test Plan

As Openbravo/F&B international Group Admin
Unschedule Costing Background process

Create a Goods Receipt and process it.
- BPartner: Bebidas Alegres
- Product: Agua Sin Gas
- Quantity: 100

Run costing Backgrround process

On the Transactions Tab of the Agua sin Gas product. Search the transaction of the created Goods Receipt and add a manual adjustment:
- Amount: 20
- Incremental: True
- Unit Cost: false
Check that the total cost of the transaction is 20EUR higher than the unit cost.

Go back to the Goods Receipt and void it.

Run costing Backgrround process

Go back to the Transaction tab of the product and refresh it.

Verify in the new transaction created:
  Movement quantity = -100
  Transaction original cost is the same as in the original transaction
  There are two cost adjustments with same values as in the original transaction
(0112256)
hgbot   
2019-05-30 09:02   
Repository: erp/devel/pi
Changeset: 05d253f229e406a616de41fa8cba87c95062fb84
Author: Nono Carballo <nonofce <at> gmail.com>
Date: Thu May 23 14:30:35 2019 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/05d253f229e406a616de41fa8cba87c95062fb84 [^]

Fixes issue 40863: Fixes cost calculation for voided receipt transaction

When registering a transaction for a voided Goods Receipt or Shipment, the
transaction cost is set to the original transaction cost. Also costs adjustments
are created based on cost adjustment lines from original transaction.

---
M src-test/src/org/openbravo/test/costing/TestCostingNoSourceAdjustments.java
M src/org/openbravo/costing/CostingAlgorithm.java
M src/org/openbravo/costing/CostingServer.java
---
(0112258)
Sandrahuguet   
2019-05-30 10:10   
code review + testing ok
(0112284)
hudsonbot   
2019-05-30 18:24   
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/b12569076050 [^]
Maturity status: Test