add_gl_trans_std_cost(ST_JOURNAL, $journal_id, $date, $db_acc,
$dim1, $dim2, $wo_cost_types[$cost_type], $amount);
- $wip = get_company_pref('wip_act');
+ $wo = get_work_order($wo_id);
+ $wip = $wo['assembly_account'];
if ($db_acc != $wip)
{
if (!is_service($bom_item["mb_flag"]))
$ivaccount = $bom_item["inventory_account"];
else
- $ivaccount = $bom_item["assembly_account"];
+ $ivaccount = $bom_item["cogs_account"];
$memo = $date_.": ".$bom_item["units_req"] ." * ".$bom_item["description"];
$memo, -$bom_item["ComponentCost"] * $bom_item["units_req"] * $quantity);
}
- add_gl_trans_std_cost(ST_MANURECEIVE, $rcv_no, $date_, get_company_pref('wip_act'),
+ $wo = get_work_order($woid);
+ add_gl_trans_std_cost(ST_MANURECEIVE, $rcv_no, $date_, $wo['assembly_account'],
0, 0, $memo, -$total_cost);
}