function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, $adj_only=false)
{
//Handle if inventory will become negative
- //8-OCT-2011 : Skip negative inventory adjustment for case of adjust_only\r
- if (is_inventory_item($stock_id) && !$adj_only) \r
+ //8-OCT-2011 : Skip negative inventory adjustment for case of adjust_only
+ if (is_inventory_item($stock_id) && !$adj_only)
handle_negative_inventory($stock_id, $qty, $price, $date);
// probably this function should be optimized
$myrow = db_fetch($result);
$material_cost = $myrow['material_cost'];
- //Price adjustment for manufactured item\r
- if (!$adj_only && $myrow['mb_flag'] == 'M') \r
+ //Price adjustment for manufactured item
+ if (!$adj_only && $myrow['mb_flag'] == 'M')
{
$standard_cost = get_standard_cost($stock_id);
//reduce overhead_cost and labour_cost from price as those will remain as is
if ($clearing_act)
$total += add_gl_trans_supplier(ST_SUPPRECEIVE, $grn, $date_, $stock_gl_code["inventory_account"],
$stock_gl_code['dimension_id'], $stock_gl_code['dimension2_id'],
- $order_line->receive_qty * $order_line->taxfree_charge_price($po), $po->supplier_id, '', 0, $order_line->stock_id);\r
- update_average_material_cost($po->supplier_id, $order_line->stock_id, $order_line->price,\r
+ $order_line->receive_qty * $order_line->taxfree_charge_price($po), $po->supplier_id, '', 0, $order_line->stock_id);
+ update_average_material_cost($po->supplier_id, $order_line->stock_id, $order_line->price,
$order_line->receive_qty, $date_);
}
//----------------------------------------------------------------------------------------------------------------
/* Update location stock records - NB a po cannot be entered for a service/kit parts done automatically */
add_stock_move(ST_SUPPRECEIVE, $order_line->stock_id, $grn, $po->Location, $date_, "",
$order_line->receive_qty, $order_line->standard_cost,
- $po->supplier_id, 1, $order_line->taxfree_charge_price($po));\r
+ $po->supplier_id, 1, $order_line->taxfree_charge_price($po));
} /*quantity received is != 0 */
} /*end of order_line loop */