1. create multiple costing elements (averate PO, standard)
2. create material transactions,
3. system generates generate cost details from wrong - last m_costhistory record instead use proper costing element equal to m_costdetail.c_accountingschema_id
in our case we await system save to costdetail average po instead standard cost.
patch attached.