Difference between revisions of "Costing Recalculation Project"
m (added ref to costing category) Tag: visualeditor |
(adding more details about how we deal with costing problems) Tag: visualeditor |
||
| Line 29: | Line 29: | ||
| | | | ||
|Norbert Bede | |Norbert Bede | ||
| + | muriloht | ||
|- | |- | ||
|no cost issue | |no cost issue | ||
| Line 54: | Line 55: | ||
!Xref | !Xref | ||
|- | |- | ||
| − | | | + | |BrERP |
| − | |a process that recalculates cost amounts and marks documents for reposting and records a history table of adjustments made for reference purposes. | + | |We actually have 2 solutions that we use in different situations. |
| − | | | + | |
| − | | | + | |
| − | | | + | 1 - The first one, for less complex situations is a process that can be executed from menu. It recalculates cost amounts (based on in out) and storage qtys, and marks documents for reposting and records a history table of adjustments made for reference purposes. Mainly used when quantities end up being incorrect due to operational problems or even adjustments made to products not respecting the temporal order. |
| + | |||
| + | |||
| + | 2 - The second, and more complex and less used, we currently do a manual process and only use it when we have a set of errors (incorrect tax settings, ledger accounts, incorrect entries, etc.) that led to a completely incorrect result in accounting and/or costs. | ||
| + | |||
| + | After mapping the entire scenario, with the system under maintenance: | ||
| + | |||
| + | |||
| + | A - Stop the accounting processor | ||
| + | |||
| + | B - Reset the accounting | ||
| + | |||
| + | C - Delete the Cost* records | ||
| + | delete from m_costhistory where ad_client_id=5000008; | ||
| + | delete from m_costdetail where ad_client_id=5000008; | ||
| + | update m_cost set futurecostprice = 0, currentqty =0 , cumulatedqty =0, currentcostprice =0, cumulatedamt = 0 where ad_client_id=5000008; | ||
| + | D - Start the accounting processor and wait (or force) the next run | ||
| + | |||
| + | E - Check for possible errors and proceed with adjustments if necessary | ||
| + | |||
| + | F - Restore the dates of the the newly created entries of cost* tables to respect the date of the documents (this is a need that may not be common, but for us in some tax obligations it is important) | ||
| + | update m_costdetail cd1 set created = ( | ||
| + | select | ||
| + | coalesce(co.created, mi.created, ci.created, ml.created, mi2.created, cp.created, mp.created, mc.created) | ||
| + | from | ||
| + | m_costdetail mc | ||
| + | left join c_orderline co on co.c_orderline_id = mc.c_orderline_id | ||
| + | left join m_inoutline mi on mi.m_inoutline_id = mc.m_inoutline_id | ||
| + | left join c_invoiceline ci on ci.c_invoiceline_id = mc.c_invoiceline_id | ||
| + | left join m_movementline ml on ml.m_movementline_id = mc.m_movementline_id | ||
| + | left join m_inventoryline mi2 on mi2.m_inventoryline_id = mc.m_inventoryline_id | ||
| + | left join cp_projectissue cp on cp.c_projectissue_id = mc.c_projectissue_id | ||
| + | left join m_productionline mp on mp.m_productionline_id = mc.m_productionline_id | ||
| + | left join m_product p on p.m_product_id = mc.m_product_id | ||
| + | where cd1.m_costdetail_id = mc.m_costdetail_id ) | ||
| + | where ad_client_id=5000008 ; | ||
| + | -- update cost history | ||
| + | update m_costhistory ch set created = (select created from m_costdetail cd where cd.m_costdetail_id = ch.m_costdetail_id) where ad_client_id = 5000008; | ||
| + | update m_costdetail set updated = created where ad_client_id=5000008 ; | ||
| + | update m_costhistory set updated = created where ad_client_id=5000008 ; | ||
| + | |production | ||
| + | |muriloht | ||
| + | |BrERP | ||
|- | |- | ||
|Cloudempiere | |Cloudempiere | ||
Revision as of 15:15, 28 March 2023
Thread: https://groups.google.com/g/idempiere/c/ghFgs44mPb8/m/WPJ7BzvYEwAJ
What is costing: Costing Costing Main page: Category:Cost accounting
Project: Costing Recalculation Process Implementation
Project Leader: Norbert Bede
Imact: Critical
Project Scope: collect all known issues and experiences with costing, existing contributors solutions, including design and pro/contra perspectives.
Goal: make final design, approval, coding process handle the best of costing recalculation process.
Costing Issues
| issue | description | workaround | ideal behaviour | priority | source |
|---|---|---|---|---|---|
| backdated documents | the user enter backdated document | Norbert Bede
muriloht | |||
| no cost issue | Norbert Bede | ||||
Contributor solutions
| contributor | short overview | status | Contact | Xref |
|---|---|---|---|---|
| BrERP | We actually have 2 solutions that we use in different situations.
After mapping the entire scenario, with the system under maintenance:
B - Reset the accounting C - Delete the Cost* records delete from m_costhistory where ad_client_id=5000008; delete from m_costdetail where ad_client_id=5000008; update m_cost set futurecostprice = 0, currentqty =0 , cumulatedqty =0, currentcostprice =0, cumulatedamt = 0 where ad_client_id=5000008; D - Start the accounting processor and wait (or force) the next run E - Check for possible errors and proceed with adjustments if necessary F - Restore the dates of the the newly created entries of cost* tables to respect the date of the documents (this is a need that may not be common, but for us in some tax obligations it is important) update m_costdetail cd1 set created = ( select coalesce(co.created, mi.created, ci.created, ml.created, mi2.created, cp.created, mp.created, mc.created) from m_costdetail mc left join c_orderline co on co.c_orderline_id = mc.c_orderline_id left join m_inoutline mi on mi.m_inoutline_id = mc.m_inoutline_id left join c_invoiceline ci on ci.c_invoiceline_id = mc.c_invoiceline_id left join m_movementline ml on ml.m_movementline_id = mc.m_movementline_id left join m_inventoryline mi2 on mi2.m_inventoryline_id = mc.m_inventoryline_id left join cp_projectissue cp on cp.c_projectissue_id = mc.c_projectissue_id left join m_productionline mp on mp.m_productionline_id = mc.m_productionline_id left join m_product p on p.m_product_id = mc.m_product_id where cd1.m_costdetail_id = mc.m_costdetail_id ) where ad_client_id=5000008 ; -- update cost history update m_costhistory ch set created = (select created from m_costdetail cd where cd.m_costdetail_id = ch.m_costdetail_id) where ad_client_id = 5000008; update m_costdetail set updated = created where ad_client_id=5000008 ; update m_costhistory set updated = created where ad_client_id=5000008 ; |
production | muriloht | BrERP |
| Cloudempiere | our solution when start delete all accounting data, costing detail, collect data by populating product cost queue table, which is processed by process continuously. | production | Norbert Bede | clde-project |
| INGEINT | we created a process for the re-costing, we should have a meeting to review said processes and see how we unify this in a single plugin taking the best practices, ours does not touch any kind of the core. | Orlando Curilies | inteint-project | |
| Andres Lopez | Great idea, I've the same issue and we have a recalculate process to do that, let´s have a meeting! | Andres Lopez | andreas-project |
