Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032934Openbravo ERP04. Warehouse managementpublic2016-05-11 17:312018-01-26 10:51
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
 
aferraz
Core
No
0032934: Wrong definition of convertUOM function in RestoreStockValue_data.xsql
Wrong definition of convertUOM function in RestoreStockValue_data.xsql. It should be changed from callableStatement to preparedStatement
As system admin role:
   Set as Displayed the fields related with second UOM feature in Windows Tab and Fields window, for Purchaser Order window, Lines Tab:
      Order UOM
      Order Quantity
   Set as Active the tabs used in that feature:
      Product window - UOM tab
      Unit Of Measure window - Conversion tab

   Install the org.openbravo.module.fixstock module (it is not available in the module management window, it is on https://code.openbravo.com/erp/pmods [^] repository)
As group admin role:
   Create a product
   Add a new unit in the UOM tab
   Configure the conversion between both of them
   Add a purchase price to it
   Create a purchase order and add the previously created order
   You should fill the Order Quantity and Order UOM fields
   Book it
   Create a partial goods receipt from it
   Check there is an entry in the m_storage_pending for that product
   Go to Process Request window and launch the Fix Stock process
   Check the following error message is shown in the log

867946fe 12275108 [DefaultQuartzScheduler_Worker-7] ERROR org.openbravo.module.fixstock.RestoreStockValue -
java.lang.NullPointerException
    at java.math.BigDecimal.<init>(BigDecimal.java:739)
    at org.openbravo.module.fixstock.RestoreStockValue.addSalesOrderEntries(RestoreStockValue.java:590)
    at org.openbravo.module.fixstock.RestoreStockValue.doExecute(RestoreStockValue.java:70)
    at org.openbravo.service.db.DalBaseProcess.execute(DalBaseProcess.java:82)
    at org.openbravo.scheduling.DefaultJob.execute(DefaultJob.java:62)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)

Check there is no entry in the m_storage_pending for that product
It is also reproducible in sales flow
Change the following code

<SqlMethod name="convertUOM" type="callableStatement" connection="true" return="string">

with

<SqlMethod name="convertUOM" type="preparedStatement" connection="true" return="string">

in RestoreStockValue_data.xsql
Fix Stock
related to defect 0032943 closed markmm82 'Fix Stock QuantityOrder Process' should round the Order quantity of the opening physical inventory to the std precision 
related to defect 0032951 closed alostale Fix Stock process rounds the quantities to 6 decimals and it should not 
depends on defect 0028459 closed eduardo_Argal It is necessary a modulescript to solve stock inconsistencies 
blocks defect 0032935 closed markmm82 Data is pending to be created in M_STORAGE_PENDING by the Fix Stock process 
Issue History
2016-05-11 17:31ngarciaNew Issue
2016-05-11 17:31ngarciaAssigned To => Triage Finance
2016-05-11 17:31ngarciaModules => Core
2016-05-11 17:31ngarciaResolution time => 1466200800
2016-05-11 17:31ngarciaTriggers an Emergency Pack => No
2016-05-11 17:32ngarciaRelationship addeddepends on 0028459
2016-05-11 17:32ngarciaIssue Monitored: networkb
2016-05-11 17:35ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12058#r12058
2016-05-11 17:39ngarciaRelationship addedblocks 0032935
2016-05-11 17:53aferrazAssigned ToTriage Finance => markmm82
2016-05-12 17:02markmm82Statusnew => scheduled
2016-05-13 22:18markmm82Note Added: 0086447
2016-05-16 17:38aferrazRelationship addedrelated to 0032943
2016-05-16 17:39aferrazRelationship addedrelated to 0032951
2016-05-17 11:51psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12129#r12129
2016-05-20 15:13hgbotCheckin
2016-05-20 15:13hgbotNote Added: 0086624
2016-05-20 15:13hgbotStatusscheduled => resolved
2016-05-20 15:13hgbotResolutionopen => fixed
2016-05-20 15:13hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.module.fixstock/rev/408ed751de816784e82cff02effc965d64cbdc99 [^]
2016-05-20 15:13hgbotCheckin
2016-05-20 15:13hgbotNote Added: 0086627
2016-05-20 15:14aferrazReview Assigned To => aferraz
2016-05-20 15:14aferrazNote Added: 0086629
2016-05-20 15:14aferrazStatusresolved => closed
2018-01-26 10:51ngarciaTag Attached: Fix Stock

Notes
(0086447)
markmm82   
2016-05-13 22:18   
Test plan:
As system admin role:
   Set as Displayed the fields related with second UOM feature:
      Order UOM
      Order Quantity
   Set as Active the tabs used in that feature:
      Product - UOM
      Unit Of Measure - Conversion
   Install the org.openbravo.module.fixstock module
   Go to Unit of Measure window, select "Unit" and go to conversion tab
      Configure the conversion between both of them (Unit -> Liter)

As group admin role:
   Create a product
    Name: P01,
    UOM: Unit,
    Purchase: true
   Add a new unit in the UOM tab
    UOM: Liter
   Go to Price tab
    Add a purchase price to it, for instance "Tarifa La Fruta es la Vida"
   Go to Purchase order window and add the previously created product P01
       You should fill the Order Quantity and Order UOM fields
    Book it
   Create a partial goods receipt from it
    Complete it
   Check there is an entry in the m_storage_pending for that product
   Go to Process Request window
    Create a new process
        Process: Fix Stock
        Timing: Run immediately
    Schedule the Fix Stock process
   After run the process you will find as result in the process monitor:
    Status: Success
    Process log:
        2016-05-13 14:26:30.011 - Entries deleted: 192
        2016-05-13 14:26:30.038 - Number of draft shipment/receipt entries: 0
        2016-05-13 14:26:30.051 - Number of not processed internal consumption entries: 0
        2016-05-13 14:26:30.06 - Number of not processed inventory count entries: 0
        2016-05-13 14:26:30.081 - Number of not processed internal movement entries: 0
        2016-05-13 14:26:30.092 - Number of not processed production entries: 0
        2016-05-13 14:26:35.356 - Number of transaction entries: 496
        2016-05-13 14:26:35.37 - Entries deleted: 8
        2016-05-13 14:26:36.063 - Number of sales order lines: 50
        2016-05-13 14:26:36.633 - Number of purchase order lines: 1
        2016-05-13 14:26:36.64 - Number of reservation entries: 0
        2016-05-13 14:26:36.647 - Process completed successfully
(0086624)
hgbot   
2016-05-20 15:13   
Repository: erp/pmods/org.openbravo.module.fixstock
Changeset: 408ed751de816784e82cff02effc965d64cbdc99
Author: Mark <markmm82 <at> gmail.com>
Date: Sun May 15 19:15:17 2016 -0400
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.fixstock/rev/408ed751de816784e82cff02effc965d64cbdc99 [^]

Fixes issue 32934 & Fixes issue 32935: Error in Fix Stock process

Data is created in M_STORAGE_PENDING by the Fix Stock process.
The c_uom_id is passed to the convertUOM function instead of the m_product_uom_id.
Correct definition of convertUOM function in RestoreStockValue_data.xsql.

---
M src/org/openbravo/module/fixstock/RestoreStockValue.java
M src/org/openbravo/module/fixstock/RestoreStockValue_data.xsql
---
(0086627)
hgbot   
2016-05-20 15:13   
Repository: erp/pmods/org.openbravo.module.fixstock
Changeset: d3c9a8b3561c70b89f6de33faf318dc04c6165e3
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri May 20 15:12:58 2016 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.module.fixstock/rev/d3c9a8b3561c70b89f6de33faf318dc04c6165e3 [^]

Related to issue 32934 & Related to issue 32935: Update module version

---
M src-db/database/sourcedata/AD_MODULE.xml
---
(0086629)
aferraz   
2016-05-20 15:14   
Code review + Testing OK