Costing Recalculation Project
Project: Costing Recalculation Process Implementation
Project Leader: Norbert Bede
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.
|the user enter backdated document
|no cost issue
|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 ;
|our solution designed allow run on scheduler server, without any touch-intelligent way found when to re-calculate costing records. we have users with habit backdating and re-activating documents, which make quite huge issue with processing order. in worst case, we can run eg 1 month for all material transactions.
READ MORE in clde-project Page
|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.
|Great idea, I've the same issue and we have a recalculate process to do that, let´s have a meeting!
|We have also developed through plugins a process that allows recreating costs based on the result of a database view, which orders the transactions, as they were created in the system, additionally tools support to correct traceable errors. I agree to participate in the meeting and contribute ideas.