Cost details inherit amt/qty from wrong history cost element

Description

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.

Environment

None

Status

Assignee

Norbert Bede

Reporter

Norbert Bede

Labels

Tested By

Norbert Bede

Fix versions

Priority

Critical
Configure