Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029723Openbravo ERP04. Warehouse managementpublic2015-04-28 17:422015-08-20 23:16
VictorVillar 
aferraz 
urgentmajoralways
closedfixed 
5
pi 
 
dmiguelez
Core
No
0029723: Landed Cost differences must not trigger a cost adjustment and need to be post to a "LCV" for products valued at Standard Cost.
Landed Cost differences must not create a cost adjustment and besides that must be post to a "LCV" account (Landed Cost Variance) account instead of an "Asset" (Product Asset) account for products valued at Standard Cost.
You should work with a Standard Cost Algorithm

As group Admin role,
  Go to Product window:
    create a new one
    Name: test
  Add a purchase Price list: Tarifa bebidas
  unit/list price: 5
Add a Cost register:
  Start date: 01/01/2012
  Ending date: 31/12/9999
  Cost: 5
  Warehouse: blank
  manual: Y
  permanent: Y

Go to Purchase Order:
   Create a new one for this product: qty: 1
Complete it.
Go to Goods receipt window,
  Create the lines from the Purchase Order created before.
  Storage Bin: RN- 2-0-0
Complete it.

Go to Goods Shipment window,
  Create a new one selecting the product: Test
  qty:1
Process it.

Go to Product window:
  create a new one
  Type: service
  name: transport
 Accounting tab:
Asset Account : 62400 Transportes
Product Expense : 62400 Transportes


Go to Landed Cost Type document:
 select the Distribution by Amount algorithm
 select the product: Transport

Create a landed cost document --> Cost 20 assigned to the Goods Receipt created before. Process it and post it.

Landed Cost posting looks like:

20.00 € (Product Asset) - DEBIT
20.00 € (Transport Expense) - CREDIT

Launch the Costing Background process and realise that the transactions have been calculated.

Realise that there is only one adjustment for Goods Receipt document (not for the Goods shipment), therefore the "Total Cost" and "Unit Cost" of that transaction has changed.

This is not correct as landed cost booking should not change the cost of a transaction valued at "Standard" cost, and it should not trigger the creation of a cost adjustment.

Realize also that there is no recalculation of the Cost. This is correct.

As a summary:

The stock of this item is 0 units but the posting valuation is 20 as you can see in the journal entry of the Landed Cost. this is not correct:

35000 Productos terminados A Debit 20.00
62400 Transportes Credit 20.00

Above means that this adjustment for a product under Standard cost calculation implies a value in the Product Asset account that is not true.

Above posting should be something like:

XXXXX Product Price Differences Debit 20.00
62400 Transportes Credit 20.00

Moreover, if you introduce now a new goods receipt (qty: 1 => transaction cost 5) and you launch the valued stock report, you will see qty:1 and valuation 25 => 'Average Cost': 25 which is not correct, correct cost is 5 (it is not 20+5)

If the users does not navigate to the Costing tab of this product they will not realise that there is a difference between the cost shown in this report and the actual cost of the product.
(1) Landed cost processing must not trigger a cost adjustment for products valued at "Standard Cost".

(2) landed cost posting must use an "Invoice Price Variance" account instead of a "Product Asset" account for products valued at "Standard Cost".

Correct posting should be:

XXXXX Invoice Price Variance Debit 20.00
62400 Transportes Credit 20.00

Same would apply to differences between "Estimated" Landed Cost and "Actual" Landed Cost.

Those differences are post now as "Product Asset" if marked as "Is Cost Adjusted" = Yes.

Same way those differences must be posted as "Invoice Price Variance".

(3) Review "valued stock report". It is necessary to change the name of the column "Average Cost" by "Cost". Once all of this is fixed, the "Cost" shown for this kind of "products" will be the "Standard" cost. See issue related 29731
No tags attached.
related to defect 0029728 closed aferraz Purchase price differences need to be post to a PPV account for products valued at "Standard" cost 
related to defect 0029731 closed AtulOpenbravo "Value Stock Report" needs to be enhanced. 
related to defect 0029729 closed aferraz Differences between actual cost and standard cost (variances) should not trigger Cost Adjustments. 
png issue_29723.png (81,040) 2015-06-30 14:05
https://issues.openbravo.com/file_download.php?file_id=8250&type=bug
png

png issue_29723_2.png (107,348) 2015-06-30 14:19
https://issues.openbravo.com/file_download.php?file_id=8251&type=bug
png
Issue History
2015-04-28 17:42VictorVillarNew Issue
2015-04-28 17:42VictorVillarAssigned To => Triage Finance
2015-04-28 17:42VictorVillarModules => Core
2015-04-28 17:42VictorVillarResolution time => 1433541600
2015-04-28 17:42VictorVillarTriggers an Emergency Pack => No
2015-04-28 17:50VictorVillarSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8365#r8365
2015-04-28 18:02VictorVillarIssue Monitored: networkb
2015-04-29 09:31VictorVillarAssigned ToTriage Finance => psanjuan
2015-04-29 09:38psanjuanProposed Solution updated
2015-04-29 09:39psanjuanAssigned Topsanjuan => Triage Finance
2015-04-29 11:44psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8370#r8370
2015-04-29 11:45psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8371#r8371
2015-04-29 11:50psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8372#r8372
2015-04-29 11:50psanjuanProposed Solution updated
2015-04-29 11:51psanjuanRelationship addedrelated to 0029728
2015-04-29 11:53psanjuanSummaryWrong accounting/situation using Standard Algorithm and Landed Cost (Cost Adjustment) => Landed Cost differences must be post to a "PPV" account instead of an "Asset" account for Standard Cost.
2015-04-29 11:53psanjuanDescription Updatedbug_revision_view_page.php?rev_id=8374#r8374
2015-04-29 12:01psanjuanRelationship addedcaused by 0029729
2015-04-29 12:20psanjuanRelationship addedrelated to 0029731
2015-04-29 12:24psanjuanProposed Solution updated
2015-04-29 13:47psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8386#r8386
2015-04-29 14:19aferrazAssigned ToTriage Finance => aferraz
2015-04-30 13:51psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8404#r8404
2015-04-30 14:08psanjuanDescription Updatedbug_revision_view_page.php?rev_id=8409#r8409
2015-04-30 14:08psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8410#r8410
2015-04-30 14:08psanjuanProposed Solution updated
2015-04-30 14:11psanjuanProposed Solution updated
2015-04-30 14:32psanjuanSummaryLanded Cost differences must be post to a "PPV" account instead of an "Asset" account for Standard Cost. => Landed Cost differences must not trigger a cost adjustment and need to be post to a "PPV" for products valued at Standard Cost.
2015-04-30 14:32psanjuanDescription Updatedbug_revision_view_page.php?rev_id=8417#r8417
2015-05-04 12:30dmitry_mezentsevRelationship replacedblocks 0029729
2015-05-05 10:09psanjuanSummaryLanded Cost differences must not trigger a cost adjustment and need to be post to a "PPV" for products valued at Standard Cost. => Landed Cost differences must not trigger a cost adjustment and need to be post to a "LCV" for products valued at Standard Cost.
2015-05-05 10:09psanjuanDescription Updatedbug_revision_view_page.php?rev_id=8429#r8429
2015-05-05 10:09psanjuanProposed Solution updated
2015-05-29 14:38psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8712#r8712
2015-05-29 14:38psanjuanProposed Solution updated
2015-06-15 12:17aferrazStatusnew => scheduled
2015-06-15 12:31aferrazNote Added: 0078293
2015-06-29 12:44vmromanosTarget Version3.0PR15Q3 =>
2015-06-30 13:53psanjuanNote Added: 0078592
2015-06-30 14:04psanjuanNote Edited: 0078592bug_revision_view_page.php?bugnote_id=0078592#r8945
2015-06-30 14:05psanjuanNote Edited: 0078592bug_revision_view_page.php?bugnote_id=0078592#r8946
2015-06-30 14:05psanjuanFile Added: issue_29723.png
2015-06-30 14:06psanjuanNote Edited: 0078592bug_revision_view_page.php?bugnote_id=0078592#r8947
2015-06-30 14:07psanjuanNote Edited: 0078592bug_revision_view_page.php?bugnote_id=0078592#r8948
2015-06-30 14:19psanjuanNote Edited: 0078592bug_revision_view_page.php?bugnote_id=0078592#r8951
2015-06-30 14:19psanjuanFile Added: issue_29723_2.png
2015-06-30 14:20psanjuanNote Edited: 0078592bug_revision_view_page.php?bugnote_id=0078592#r8952
2015-06-30 14:21psanjuanNote Edited: 0078592bug_revision_view_page.php?bugnote_id=0078592#r8953
2015-07-07 11:32vmromanosRelationship deletedblocks 0029729
2015-07-07 11:32vmromanosRelationship addedrelated to 0029729
2015-07-17 15:07psanjuanNote Added: 0078942
2015-08-13 12:03hgbotCheckin
2015-08-13 12:03hgbotNote Added: 0079338
2015-08-13 12:03hgbotStatusscheduled => resolved
2015-08-13 12:03hgbotResolutionopen => fixed
2015-08-13 12:03hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/70f14eb6163a85d50431a467739956b435debcea [^]
2015-08-13 12:04hgbotCheckin
2015-08-13 12:04hgbotNote Added: 0079339
2015-08-13 12:04hgbotCheckin
2015-08-13 12:04hgbotNote Added: 0079340
2015-08-13 12:04dmiguelezReview Assigned To => dmiguelez
2015-08-13 12:04dmiguelezNote Added: 0079341
2015-08-13 12:04dmiguelezStatusresolved => closed
2015-08-14 13:15hgbotCheckin
2015-08-14 13:15hgbotNote Added: 0079355
2015-08-14 13:23dmiguelezNote Added: 0079356
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079543
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079544
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079545
2015-08-20 23:16hudsonbotCheckin
2015-08-20 23:16hudsonbotNote Added: 0079552
2016-01-28 10:41psanjuanNote Edited: 0078293bug_revision_view_page.php?bugnote_id=0078293#r10791

Notes
(0078293)
aferraz   
2015-06-15 12:31   
(edited on: 2016-01-28 10:41)
Test Plan:

As QA Admin:

- Create and validate a new Costing Rule with Standard Algorithm

- Create a Landed Cost. Move to Receipt tab and realize no documents are shown in Goods Receipt selector.

- Create a new Product.
  Add a Purchase price list in Price tab.
  Add a Standard cost in Costing tab.

- Create a Purchase Order and add a line with this product. Book it.

- Create a Goods Receipt from the order.

- Go to created Landed Cost. Realize created receipt is now available in Goods Receipt selector. Select it.
  Add a Landed Cost Cost and process the landed cost. Realize no cost adjustment is created.
  Post it. Realize difference line is posted to a IPV account.
  Unpost it deleting lines.
  Reactivate landed cost.

- Create a Purchase Invoice.
  Add a line with Financial Invoice Line = Y and Fees account.
  Process it.
  Click on Match LC Costs and match the invoice with the landed cost cost of created landed cost with Is Matching adjusted = Y and Process Matching = Y

- Go to Landed Cost.
  Realize Landed Cost Cost is now Matched = Y but no cost adjustment has been created.
  Post Landed Cost Cost. Realize difference line is posted to a IPV account.
  Unpost it deleting lines.
  Cancel Landed Cost Matching. Realize no cost adjustment is voided.

- Repeat the same flow creating Landed Cost Cost from Goods Receipt.

- Repeat the same flow with a Costing Rule with Average Algorithm and realize Landed Cost and Landed Cost Cost create cost adjustments and differences are posted to an Asset account.

(0078592)
psanjuan   
2015-06-30 13:53   
(edited on: 2015-06-30 14:21)
Test Plan above verified for three scenarios below:
Actual LC = Estimated LC
Actual LC > Estimated LC
Actual LC < Estimated LC

No cost adjustment is created and correct ledger account (IPV) is used in all three cases.

Landed cost feature is working for products valued at "Average" cost. Landed cost are posted to a product asset account, actual vs estimated landed cost differences are also posted to product asset account and the corresponding cost adjustment are created as well. Average cost of the product is adjusted properly.


However:

(1) In regards to "Creating Landed cost from the Goods Receipt" feature:

Landed cost document is not created after completing a Goods Receipt that includes a product valued at Standard Cost and landed cost information in the landed cost tab.
Above scenario works in case of a Goods Receipt including a product valued at Average Cost. A landed cost document is created.
Please double check.

(2) Below scenario is not properly working:
Create a product valued at standard cost
Create a Goods receipt for that product. Complete and Post the receipt
Go to Landed cost window and enter a landed cost amount for that goods receipt
Process and Post.
Go to purchase invoice window and enter an actual landed cost which do not match the one entered in the landed cost document.
Match actual landed cost, select the checks "Is Matching Adjusted" and "Process Matching".
Go to landed cost window and post landed cost cost.

After than unpost landed cost cost, press cancel matching. Refresh.
Realize that it is not possible to process the matching once again from the landed cost cost tab. It is only possible to match from the corresponding purchase invoice. See image attached Issue_29723_1

Above scenario is working for an Average product. It is possible to process the matching once again from landed cost cost. See image Issue 29723_2
Please double check.

(0078942)
psanjuan   
2015-07-17 15:07   
Verified.

Also verified two scenarios described in the note above. Now both are working ok.
(0079338)
hgbot   
2015-08-13 12:03   
Repository: erp/devel/pi
Changeset: 70f14eb6163a85d50431a467739956b435debcea
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Jul 17 15:02:18 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/70f14eb6163a85d50431a467739956b435debcea [^]

Fixes issue 29723: Avoid cost adjustmens in Landed Cost + Standard Algorithm

Cost Adjustments will not be created in landed cost created with Standard Algorithm.
Goods Receipt selector in Landed Cost window - Receipt tab, will only show receipts processed with current costing rule.
Landed Cost and Landed Cost Cost documents will create cost adjustment only if active costing rule does not use Standard Algorithm.
Landed Cost and Landed Cost Cost differences will be posted to a IPV account (instead of an Asset account) if used costing rule does not use Standard Algorithm.

---
M src-db/database/sourcedata/AD_AUXILIARINPUT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/OBUISEL_SELECTOR.xml
M src/org/openbravo/costing/LCMatchingCancelHandler.java
M src/org/openbravo/costing/LCMatchingProcess.java
M src/org/openbravo/costing/LandedCostProcess.java
M src/org/openbravo/costing/ReactivateLandedCost.java
M src/org/openbravo/erpCommon/ad_forms/DocLCCost.java
M src/org/openbravo/erpCommon/ad_forms/DocLandedCost.java
---
(0079339)
hgbot   
2015-08-13 12:04   
Repository: erp/devel/pi
Changeset: f9fc3ff9fad2259e9da1a220059e8066948b6feb
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Jul 16 11:31:58 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f9fc3ff9fad2259e9da1a220059e8066948b6feb [^]

Related to issue 29723: Modify an assert in TestCosting

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
---
(0079340)
hgbot   
2015-08-13 12:04   
Repository: erp/devel/pi
Changeset: 092bf17c3613fc752dfcdd2e87bdefbd6dbee957
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Aug 13 12:03:24 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/092bf17c3613fc752dfcdd2e87bdefbd6dbee957 [^]

Related to Issue 29723. Code Review changes.
Modifies Query to improve performance.

---
M src-db/database/sourcedata/OBUISEL_SELECTOR.xml
---
(0079341)
dmiguelez   
2015-08-13 12:04   
Code Review + Testing Ok
(0079355)
hgbot   
2015-08-14 13:15   
Repository: erp/devel/pi
Changeset: dcbd22cb016988e457eb4b470e2748a123a1810e
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Aug 14 12:40:35 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/dcbd22cb016988e457eb4b470e2748a123a1810e [^]

Related to issue 29723: LC5552 & LC5554 tests fail in TestCosting

Remove an unneeded save to avoid Hibernate error. Save will be done in the next flush().

---
M src/org/openbravo/costing/LandedCostProcess.java
---
(0079356)
dmiguelez   
2015-08-14 13:23   
Latest commit to fix problems with integration is Code Reviewed and Tested.
(0079543)
hudsonbot   
2015-08-20 23:16   
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/8c91718397a5 [^]
Maturity status: Test
(0079544)
hudsonbot   
2015-08-20 23:16   
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/8c91718397a5 [^]
Maturity status: Test
(0079545)
hudsonbot   
2015-08-20 23:16   
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/8c91718397a5 [^]
Maturity status: Test
(0079552)
hudsonbot   
2015-08-20 23:16   
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/8c91718397a5 [^]
Maturity status: Test