Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0045830
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementcriticalalways2021-02-02 10:402021-02-11 10:56
ReportergorkaionView Statuspublic 
Assigned Tomarkmm82 
PriorityimmediateResolutionfixedFixed in VersionPR21Q2
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression levelProduction - Confirmed Stable
Regression date2019-09-09
Regression introduced in release3.0PR19Q4
Regression introduced by commithttps://gitlab.com/openbravo/product/openbravo/-/commit/a0cdfc9f6f68a6235ce22d00b0f53d94504a05d6 [^]
Triggers an Emergency PackNo
Summary

0045830: 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(AverageCostAdjustment.java:1022) ~[classes/:?]
    at org.openbravo.costing.AverageCostAdjustment.calculateBackdatedTrxAdjustment(AverageCostAdjustment.java:593) ~[classes/:?]
    at org.openbravo.costing.CostingAlgorithmAdjustmentImp.searchRelatedTransactionCosts(CostingAlgorithmAdjustmentImp.java:145) ~[classes/:?]
    at org.openbravo.costing.CostAdjustmentProcess.calculateAdjustmentAmount(CostAdjustmentProcess.java:238) ~[classes/:?]
    at org.openbravo.costing.CostAdjustmentProcess.processCostAdjustment(CostAdjustmentProcess.java:82) ~[classes/:?]
    at org.openbravo.costing.CostAdjustmentProcess.doProcessCostAdjustment(CostAdjustmentProcess.java:342) ~[classes/:?]
    at org.openbravo.costing.FixBackdatedTransactionsProcess.doExecute(FixBackdatedTransactionsProcess.java:143) [classes/:?]
    at org.openbravo.client.application.process.BaseProcessActionHandler.execute(BaseProcessActionHandler.java:153) [classes/:?]
    at org.openbravo.client.kernel.BaseActionHandler.execute(BaseActionHandler.java:74) [classes/:?]
    at org.openbravo.client.kernel.KernelServlet.processActionRequest(KernelServlet.java:319) [classes/:?]
    at org.openbravo.client.kernel.KernelServlet.doGet(KernelServlet.java:208) [classes/:?]
    at org.openbravo.client.kernel.KernelServlet.doPost(KernelServlet.java:291) [classes/:?]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) [tomcat8-servlet-api.jar:?]
    at org.openbravo.base.HttpBaseServlet.serviceInitialized(HttpBaseServlet.java:200) [openbravo-core.jar:?]
    at org.openbravo.base.secureApp.HttpSecureAppServlet.service(HttpSecureAppServlet.java:459) [classes/:?]
    at org.openbravo.client.kernel.BaseKernelServlet.callServiceInSuper(BaseKernelServlet.java:89) [classes/:?]
    at org.openbravo.client.kernel.BaseKernelServlet.service(BaseKernelServlet.java:60) [classes/:?]
    at org.openbravo.client.kernel.KernelServlet.service(KernelServlet.java:170) [classes/:?]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [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 Filesdiff file icon issue45830.diff [^] (1,532 bytes) 2021-02-02 11:01 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
depends on backport 0045843PR21Q1.1 closedmarkmm82 Error on Fix Backadated Transaction process. A trx is wrongly considered as backdated 
depends on backport 0045844PR20Q4.2 closedmarkmm82 Error on Fix Backadated Transaction process. A trx is wrongly considered as backdated 
depends on backport 0045845PR20Q3.4 closedmarkmm82 Error on Fix Backadated Transaction process. A trx is wrongly considered as backdated 
caused by defect 0041749 closedcollazoandy4 Fix backdated transaction is not fixing all backdated transactions 

-  Notes
(0125964)
markmm82 (developer)
2021-02-04 01:08

Test Plan:
Using F&B International Group Admin - F&B International Group
  Go to Costing Rules windows and select 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, for instance 01/03/2020.
  Ensure that the cost of the receipt is calculated. You can do it by running the Costing Background process if you want to do immediately.
  Go to Costing Rule and execute the Fix Backdated transactions process. Set a starting date before the date used in the receipt for instance 01/01/2020.
  Notice the process end successfully, and there are no exceptions in logs.
  Go to the created product and notice the costing was rightly calculated and related to the receipt.
(0125990)
hgbot (developer)
2021-02-04 18:34

Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/306 [^]
(0126034)
hgbot (developer)
2021-02-08 12:59

Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 83a811681e535a821b9fd08448d92bb6bae268f6
Author: Mark <markmm82@gmail.com>
Date: 2021-02-08T11:53:54+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/83a811681e535a821b9fd08448d92bb6bae268f6 [^]

Fixes ISSUE-45830: 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/FixBackdatedTransactionsProcess.java
---
(0126035)
hgbot (developer)
2021-02-08 12:59

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: d134050899e31d8b5935dd725b77c6babeecc338
Author: Mark <markmm82@gmail.com>
Date: 2021-02-08T11:53:54+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/d134050899e31d8b5935dd725b77c6babeecc338 [^]

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

---
M src/org/openbravo/costing/FixBackdatedTransactionsProcess.java
---
(0126036)
hgbot (developer)
2021-02-08 12:59

Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/306 [^]

- Issue History
Date Modified Username Field Change
2021-02-02 10:40 gorkaion New Issue
2021-02-02 10:40 gorkaion Assigned To => Triage Finance
2021-02-02 10:40 gorkaion Modules => Core
2021-02-02 10:40 gorkaion Resolution time => 1614034800
2021-02-02 10:40 gorkaion Triggers an Emergency Pack => No
2021-02-02 11:00 gorkaion File Added: issue45830.diff
2021-02-02 11:00 gorkaion File Deleted: issue45830.diff
2021-02-02 11:01 gorkaion File Added: issue45830.diff
2021-02-02 11:26 gorkaion Regression level => Production - Confirmed Stable
2021-02-02 11:26 gorkaion Regression date => 2019-09-09
2021-02-02 11:26 gorkaion Regression introduced in release => 3.0PR19Q4
2021-02-02 11:26 gorkaion Regression introduced by commit => https://gitlab.com/openbravo/product/openbravo/-/commit/a0cdfc9f6f68a6235ce22d00b0f53d94504a05d6 [^]
2021-02-02 11:26 gorkaion Priority high => immediate
2021-02-02 11:26 gorkaion Severity major => critical
2021-02-03 23:26 markmm82 Assigned To Triage Finance => markmm82
2021-02-03 23:27 markmm82 Status new => scheduled
2021-02-04 01:08 markmm82 Note Added: 0125964
2021-02-04 18:34 hgbot Note Added: 0125990
2021-02-08 12:59 hgbot Resolution open => fixed
2021-02-08 12:59 hgbot Status scheduled => closed
2021-02-08 12:59 hgbot Fixed in Version => PR21Q2
2021-02-08 12:59 hgbot Note Added: 0126034
2021-02-08 12:59 hgbot Note Added: 0126035
2021-02-08 12:59 hgbot Note Added: 0126036
2021-02-11 10:56 dmitry_mezentsev Relationship added caused by 0041749


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker