$costs = $qty * $costs;
if ($qoh>0)
$overhead_cost = ($qoh * $overhead_cost + $costs) / $qoh;
- else // Journal Entry if QOH is 0/negative \r
+ else // Journal Entry if QOH is 0/negative
{
global $Refs;
$costs = $qty * $costs;
if ($qoh>0)
$labour_cost = ($qoh * $labour_cost + $costs) / $qoh;
- else // Journal Entry if QOH is 0/negative \r
+ else // Journal Entry if QOH is 0/negative
{
global $Refs;
{
if ($qoh + $qty != 0)
$labour_cost = ($qoh * $labour_cost + $qty * $costs) / ($qoh + $qty);
- } \r
+ }
$sql = "UPDATE ".TB_PREF."stock_master SET labour_cost=".db_escape($labour_cost)."
WHERE stock_id=".db_escape($stock_id);
db_query($sql,"The cost details for the inventory item could not be updated");
$costs = $qty * $costs;
if ($qoh>0)
$material_cost = $costs / $qoh;
- else // Journal Entry if QOH is 0/negative\r
+ else // Journal Entry if QOH is 0/negative
{
global $Refs;
{
if ($qoh + $qty != 0)
$material_cost = ($qty * $costs) / ($qoh + $qty);
- } \r
+ }
$sql = "UPDATE ".TB_PREF."stock_master SET material_cost=material_cost+"
.db_escape($material_cost)
." WHERE stock_id=".db_escape($stock_id);
continue;
$memo_ = _("Voiding Work Order Trans # ").$woid;
add_audit_trail(ST_MANURECEIVE, $row['id'], today(), _("Voided.")."\n".$memo_);
- add_voided_entry(ST_MANURECEIVE, $row['id'], today(), $memo_);\r
+ add_voided_entry(ST_MANURECEIVE, $row['id'], today(), $memo_);
}
-\r
+
$result = get_work_order_issues($woid);
$cost = 0;
$issue_no = 0;
add_voided_entry(ST_MANUISSUE, $row['issue_no'], today(), $memo_);
}
- //Adust avg labour cost\r
- $cost = get_gl_wo_cost($woid, WO_LABOUR); \r
+ //Adust avg labour cost
+ $cost = get_gl_wo_cost($woid, WO_LABOUR);
if ($cost != 0)
add_labour_cost($work_order['stock_id'], 1, $date, -$cost, true);
- \r
- //Adust avg overhead cost\r
- $cost = get_gl_wo_cost($woid, WO_OVERHEAD); \r
+
+ //Adust avg overhead cost
+ $cost = get_gl_wo_cost($woid, WO_OVERHEAD);
if ($cost != 0)
add_overhead_cost($work_order['stock_id'], 1, $date, -$cost, true);
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 */
function edit_link($row)
{
- if (@$_GET['popup'])\r
- return '';\r
+ if (@$_GET['popup'])
+ return '';
global $trans_type;
$modify = ($trans_type == ST_SALESORDER ? "ModifyOrderNumber" : "ModifyQuotationNumber");
return pager_link( _("Edit"),
$Ajax->activate('orders_tbl');
}
-if (!@$_GET['popup'])\r
+if (!@$_GET['popup'])
start_form();
start_table(TABLESTYLE_NOBORDER);
start_row();
}
stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true);
-if (!@$_GET['popup'])\r
- customer_list_cells(_("Select a customer: "), 'customer_id', null, true);\r
+if (!@$_GET['popup'])
+ customer_list_cells(_("Select a customer: "), 'customer_id', null, true);
if ($trans_type == ST_SALESQUOTE)
check_cells(_("Show All:"), 'show_all');
// Orders inquiry table
//
$sql = get_sql_for_sales_orders_view($selected_customer, $trans_type, $_POST['OrderNumber'], $_POST['order_view_mode'],
- @$selected_stock_item, @$_POST['OrdersAfterDate'], @$_POST['OrdersToDate'], @$_POST['OrderReference'], $_POST['StockLocation'], $_POST['customer_id']);\r
+ @$selected_stock_item, @$_POST['OrdersAfterDate'], @$_POST['OrdersToDate'], @$_POST['OrderReference'], $_POST['StockLocation'], $_POST['customer_id']);
if ($trans_type == ST_SALESORDER)
$cols = array(
'Type' => 'skip',
_("Currency") => array('align'=>'center')
);
-if ($_POST['order_view_mode'] == 'OutstandingOnly') {\r
- //array_substitute($cols, 4, 1, _("Cust Order Ref"));\r
- array_append($cols, array(\r
- array('insert'=>true, 'fun'=>'dispatch_link'),\r
- array('insert'=>true, 'fun'=>'edit_link')));\r
+if ($_POST['order_view_mode'] == 'OutstandingOnly') {
+ //array_substitute($cols, 4, 1, _("Cust Order Ref"));
+ array_append($cols, array(
+ array('insert'=>true, 'fun'=>'dispatch_link'),
+ array('insert'=>true, 'fun'=>'edit_link')));
} elseif ($_POST['order_view_mode'] == 'InvoiceTemplates') {
array_substitute($cols, 4, 1, _("Description"));
display_db_pager($table);
submit_center('Update', _("Update"), true, '', null);
-if (!@$_GET['popup'])\r
+if (!@$_GET['popup'])
{
end_form();
end_page();
-}\r
+}
?>
\ No newline at end of file