Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] 04. Warehouse managementcriticalalways2021-02-02 10:402021-02-08 12:56
ReportergorkaionView Statuspublic 
Assigned Tomarkmm82 
PriorityimmediateResolutionfixedFixed in VersionPR21Q1
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget VersionPR21Q1.1
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
Regression levelProduction - Confirmed Stable
Regression date2019-09-09
Regression introduced in release3.0PR19Q4
Regression introduced by commit [^]
Triggers an Emergency PackNo

0045843: Error on Fix Backadated Transaction process. A trx is wrongly considered as backdated

DescriptionThe fix backdated transaction is not checking the transaction dates by product. This can lead to false positives and adjusting transactions that are not backdated.

Having the following transactions processed in the given order:
Product A mvt date 01-01-2021
Product A mvt date 10-01-2021
Product A mvt date 01-02-2021
Product B mvt date 20-01-2021

The fix backdated transaction process tries to adjust as backdated transaction the last trasnaction from product B because the previous transaction from Product A has a newer movement date. This is wrong, the transaction from Product B has to be compared with other transactions of the same product.

If the fix backdated transactions are already enabled in the costing rule that transaction won't be automatically adjusted as backdated.

If the false positive is the 1st transaction of the product the process fails with an error:
2021-02-02 08:57:02,284 [http-6] ERROR org.openbravo.costing.FixBackdatedTransactionsProcess - null
java.lang.NullPointerException: null
    at org.openbravo.costing.AverageCostAdjustment.extendPreviousCosting( ~[classes/:?]
    at org.openbravo.costing.AverageCostAdjustment.calculateBackdatedTrxAdjustment( ~[classes/:?]
    at org.openbravo.costing.CostingAlgorithmAdjustmentImp.searchRelatedTransactionCosts( ~[classes/:?]
    at org.openbravo.costing.CostAdjustmentProcess.calculateAdjustmentAmount( ~[classes/:?]
    at org.openbravo.costing.CostAdjustmentProcess.processCostAdjustment( ~[classes/:?]
    at org.openbravo.costing.CostAdjustmentProcess.doProcessCostAdjustment( ~[classes/:?]
    at org.openbravo.costing.FixBackdatedTransactionsProcess.doExecute( [classes/:?]
    at org.openbravo.client.application.process.BaseProcessActionHandler.execute( [classes/:?]
    at org.openbravo.client.kernel.BaseActionHandler.execute( [classes/:?]
    at org.openbravo.client.kernel.KernelServlet.processActionRequest( [classes/:?]
    at org.openbravo.client.kernel.KernelServlet.doGet( [classes/:?]
    at org.openbravo.client.kernel.KernelServlet.doPost( [classes/:?]
    at javax.servlet.http.HttpServlet.service( [tomcat8-servlet-api.jar:?]
    at org.openbravo.base.HttpBaseServlet.serviceInitialized( [openbravo-core.jar:?]
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service( [classes/:?]
    at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper( [classes/:?]
    at org.openbravo.client.kernel.BaseKernelServlet.service( [classes/:?]
    at org.openbravo.client.kernel.KernelServlet.service( [classes/:?]
    at javax.servlet.http.HttpServlet.service( [tomcat8-servlet-api.jar:?]
Steps To ReproduceOn F&B EspaƱa.
Check that Costing Rule does not have the fix backdated transactions enabled.
Check the newest transaction movement date on some products.
Create a new product and set a purchase price.
Create a receipt for the new product with a movement date in the past. Ensure that it is a date older than the checked for other products.
Ensure that the cost of the receipt is calculated.
Go to Costing Rule and execute the Fix Backdated transactions process. Set a starting date before the date used in the receipt.
Proposed SolutionThe transaction movement dates shall be compared on same product transactions. Change the getTransactions method to sort the transactions also by product and modify the transaction loop to manage when the product changes.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0045830 closedmarkmm82 Error on Fix Backadated Transaction process. A trx is wrongly considered as backdated 

-  Notes
hgbot (developer)
2021-02-04 18:41

Merge Request created: [^]
hgbot (developer)
2021-02-08 12:54

Merge request merged: [^]
hgbot (developer)
2021-02-08 12:56

Directly closing issue as related merge request is already approved.

Repository: [^]
Changeset: c34f94f1414a256b65a82613d83ea6ec107f021a
Author: Mark <>
Date: 2021-02-04T14:39:30-03:00
URL: [^]

Fixes ISSUE-45843: Fixed error on Fix Backadated Transaction process.

In some cases was possible that transaction ordering without having into account ordering by product, caused that transactions be wrongly considered as backdated.

To fix this issue the transaction movement dates is compared on same product transactions. The getTransactions method was changed to sort the transactions also by product and always reset the comparison date of the last transaction for the product when the product changes on the loop.

M src/org/openbravo/costing/
hgbot (developer)
2021-02-08 12:56

Repository: [^]
Changeset: 1318ab966e185c0e14a87aa125f88edc6d7641bc
Author: Mark <>
Date: 2021-02-05T13:58:43-03:00
URL: [^]

Related to ISSUE-45843: Improve the ordering by explicitly do by product id column

M src/org/openbravo/costing/

- Issue History
Date Modified Username Field Change
2021-02-03 23:27 markmm82 Type defect => backport
2021-02-03 23:27 markmm82 Target Version => PR21Q1.1
2021-02-04 18:41 hgbot Note Added: 0125991
2021-02-08 12:54 hgbot Note Added: 0126027
2021-02-08 12:56 hgbot Resolution open => fixed
2021-02-08 12:56 hgbot Status scheduled => closed
2021-02-08 12:56 hgbot Fixed in Version => PR21Q1
2021-02-08 12:56 hgbot Note Added: 0126032
2021-02-08 12:56 hgbot Note Added: 0126033

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker