Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027932Openbravo ERP09. Financial managementpublic2014-10-21 13:472014-11-03 13:40
plujan 
umartirena 
normalmajorhave not tried
closedno change required 
5
main 
3.0PR14Q4main 
umartirena
Core
Packaging and release
main
No
0027932: [Costing] Costing Background process is assuming a negative shipment as a voided shipment
When creating a negative shipment to calculate the initial cost of a product, the process monitor shows an error that seems to be caused by wrongly assuming the shipment is voiding a positive shipment (that does not actually exist)
1. Login as:
Username: QAAdmin
Password: QAAdmin

2. Modify Document Types
Go to Financial Management || Accounting || Setup || Document Type:
Select the record with Name: "RFC Order"
Set "Organization": *
Select the record with Name: "RFC Receipt"
Set "Organization": *
Select the record with Name: "RTV Order"
Set "Organization": *
Select the record with Name: "RTV Shipment"
Set "Organization": *

3. Schedule the Costing Process
Go to General Setup || Process Scheduling || Process Request:
Click New and select:
"Client": QA Testing
"Organization": *
"Process": Costing Background process
"Timing": Run Immediately
Click on "Schedule Process".
A popup should appear with the message:
"Process completed succesfully"

4. Create the Product
Go to Master Data Management || Product:
Click New and select:
"Organization": USA
"Search Key": CostingProduct
"Name": CostingProduct
"UOM": Unit
"Product Type": Item

5. Create the Price List for Purchase and Sales
Go to Master Data Management || Pricing || Price List:
Click New and select:
"Organization": USA
"Name": Costing Price List
"Currency": USD
Move to Price List Version and create a new row:
"Name": Costing Price List
"Valid from Date": 01-01-2012
Move to Product Price and create a new row:
"Product": CostingProduct
"Net Unit Price": 50.00
"Net List Price": 50.00

Click New and select:
"Organization": USA
"Name": Costing Price List Sales
"Currency": USD
"Sales Price List": Checked
Move to Price List Version and create a new row:
"Name": Costing Price List Sales
"Valid from Date": 01-01-2012
Move to Product Price and create a new row:
"Product": CostingProduct
"Net Unit Price": 50.00
"Net List Price": 50.00

6. Create a Business Partner:
Go to Master Data Management || Business Partner:
Click New and select:
"Organization": *
"Search Key": Costing Business Partner
"Commercial Name": Costing Business Partner
Move to Customer.
"Price List": Costing Price List Sales
"Payment Method": 1 (USA)
"Payment Terms": 90 days
"Financial Account" USD - USA Cashbook
Move to Vendor/Creditor.
"Vendor": Checked
"Purchase Price List": Costing Price List
"PO Payment Method": 1 (USA)
"PO Payment Terms": 90 days
"PO Financial Account" USD - USA Cashbook
Move to Location/Address
"Location / Address":
"1st line": Street
"Postal Code": 0123456
"City": City
"Country": United States
"Region": AK

7. Create a Tax Rate:
Go to Financial Management || Accounting || Setup || Tax Rate:
Click New and select:
"Organization": USA
"Name": Costing Tax Rate
"Valid From Date": 01-01-2012
"Tax Category": Exempt
"Default": Checked

8. Create Negative Goods Shipment.
Go to Sales Management || Transactions || Goods Shipment:
Click New and select:
"Organization": USA
“Business Partner”: Costing Business Partner
Move to Lines. Click new and select:
“Product”: CostingProduct
“Movement Quantity”: -50
"Storage Bin": USA111
Click the “Complete” button. Click OK.

9. Reschedule the Process
Go to General Setup || Process Scheduling || Process Request:
Select the process Costing Background Process.
Click on "Reschedule Process"

Expected result:
A popup should appear with the message:
"Process completed succesfully"

Actual result:
"Index: 0, Size: 0"

Log message
2014-10-21 10:44:53,575 [DefaultQuartzScheduler_Worker-6] ERROR org.openbravo.costing.CostingBackground - Index: 0, Size: 0
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.rangeCheck(ArrayList.java:571)
        at java.util.ArrayList.get(ArrayList.java:349)
        at org.hibernate.collection.PersistentBag.get(PersistentBag.java:446)
        at org.openbravo.costing.CostingAlgorithm.getOriginalInOutLineCost(CostingAlgorithm.java:326)
        at org.openbravo.costing.CostingAlgorithm.getShipmentVoidCost(CostingAlgorithm.java:200)
        at org.openbravo.costing.CostingAlgorithm.getTransactionCost(CostingAlgorithm.java:109)
        at org.openbravo.costing.AverageAlgorithm.getTransactionCost(AverageAlgorithm.java:45)
        at org.openbravo.costing.CostingServer.process(CostingServer.java:104)
        at org.openbravo.costing.CostingBackground.doExecute(CostingBackground.java:106)
        at org.openbravo.service.db.DalBaseProcess.execute(DalBaseProcess.java:80)
        at org.openbravo.scheduling.DefaultJob.execute(DefaultJob.java:58)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
No tags attached.
related to defect 0027934 new Triage Omni OMS [Costing] Message when Costing Background process fails has to be reviewed 
Issue History
2014-10-21 13:47plujanNew Issue
2014-10-21 13:47plujanAssigned To => Sandrahuguet
2014-10-21 13:47plujanModules => Core
2014-10-21 13:47plujanTriggers an Emergency Pack => No
2014-10-21 13:48plujanRegression level => Packaging and release
2014-10-21 13:48plujanRegression introduced in release => main
2014-10-21 13:48plujanversion => main
2014-10-21 13:53plujanIssue cloned0027934
2014-10-21 13:53plujanRelationship addedrelated to 0027934
2014-10-29 09:57umartirenaStatusnew => scheduled
2014-10-29 09:57umartirenaAssigned ToSandrahuguet => umartirena
2014-10-29 09:57umartirenafix_in_branch => pi
2014-10-29 09:57umartirenaReview Assigned To => umartirena
2014-10-29 09:57umartirenaNote Added: 0071239
2014-10-29 09:57umartirenaStatusscheduled => closed
2014-10-29 09:57umartirenaResolutionopen => unable to reproduce
2014-10-29 09:57umartirenaFixed in Version => pi
2014-11-03 13:39umartirenaNote Added: 0071353
2014-11-03 13:39umartirenaStatusclosed => new
2014-11-03 13:39umartirenaResolutionunable to reproduce => open
2014-11-03 13:39umartirenaFixed in Versionpi =>
2014-11-03 13:40umartirenaNote Added: 0071354
2014-11-03 13:40umartirenaStatusnew => closed
2014-11-03 13:40umartirenaResolutionopen => no change required
2014-11-03 13:40umartirenaFixed in Version => main

Notes
(0071239)
umartirena   
2014-10-29 09:57   
Unable to reproduce the issue
(0071353)
umartirena   
2014-11-03 13:39   
Reopened
(0071354)
umartirena   
2014-11-03 13:40   
The issue was happening because there was some bad data (missing m_transaction records), but this has no relation with Costing Engine process.