From fcf7391e1937fe9f4eeb5924143054fa4d50a012 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sun, 24 Mar 2013 11:10:38 +0100 Subject: [PATCH] Line end cleanups. --- manufacturing/includes/db/work_orders_db.inc | 24 +++++++++--------- purchasing/includes/db/grn_db.inc | 14 +++++------ sales/inquiry/sales_orders_view.php | 26 ++++++++++---------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/manufacturing/includes/db/work_orders_db.inc b/manufacturing/includes/db/work_orders_db.inc index 2aed7c1..a79c257 100644 --- a/manufacturing/includes/db/work_orders_db.inc +++ b/manufacturing/includes/db/work_orders_db.inc @@ -71,7 +71,7 @@ function add_overhead_cost($stock_id, $qty, $date_, $costs, $adj_only=false) $costs = $qty * $costs; if ($qoh>0) $overhead_cost = ($qoh * $overhead_cost + $costs) / $qoh; - else // Journal Entry if QOH is 0/negative + else // Journal Entry if QOH is 0/negative { global $Refs; @@ -124,7 +124,7 @@ function add_labour_cost($stock_id, $qty, $date_, $costs, $adj_only=false) $costs = $qty * $costs; if ($qoh>0) $labour_cost = ($qoh * $labour_cost + $costs) / $qoh; - else // Journal Entry if QOH is 0/negative + else // Journal Entry if QOH is 0/negative { global $Refs; @@ -153,7 +153,7 @@ function add_labour_cost($stock_id, $qty, $date_, $costs, $adj_only=false) { if ($qoh + $qty != 0) $labour_cost = ($qoh * $labour_cost + $qty * $costs) / ($qoh + $qty); - } + } $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"); @@ -177,7 +177,7 @@ function add_issue_cost($stock_id, $qty, $date_, $costs, $adj_only=false) $costs = $qty * $costs; if ($qoh>0) $material_cost = $costs / $qoh; - else // Journal Entry if QOH is 0/negative + else // Journal Entry if QOH is 0/negative { global $Refs; @@ -206,7 +206,7 @@ function add_issue_cost($stock_id, $qty, $date_, $costs, $adj_only=false) { if ($qoh + $qty != 0) $material_cost = ($qty * $costs) / ($qoh + $qty); - } + } $sql = "UPDATE ".TB_PREF."stock_master SET material_cost=material_cost+" .db_escape($material_cost) ." WHERE stock_id=".db_escape($stock_id); @@ -444,9 +444,9 @@ function void_work_order($woid) 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_); + add_voided_entry(ST_MANURECEIVE, $row['id'], today(), $memo_); } - + $result = get_work_order_issues($woid); $cost = 0; $issue_no = 0; @@ -463,13 +463,13 @@ function void_work_order($woid) add_voided_entry(ST_MANUISSUE, $row['issue_no'], today(), $memo_); } - //Adust avg labour cost - $cost = get_gl_wo_cost($woid, WO_LABOUR); + //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); - - //Adust avg overhead cost - $cost = get_gl_wo_cost($woid, WO_OVERHEAD); + + //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); diff --git a/purchasing/includes/db/grn_db.inc b/purchasing/includes/db/grn_db.inc index 24e421a..2bfa00d 100644 --- a/purchasing/includes/db/grn_db.inc +++ b/purchasing/includes/db/grn_db.inc @@ -13,8 +13,8 @@ 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 - if (is_inventory_item($stock_id) && !$adj_only) + //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 @@ -46,8 +46,8 @@ function update_average_material_cost($supplier, $stock_id, $price, $qty, $date, $myrow = db_fetch($result); $material_cost = $myrow['material_cost']; - //Price adjustment for manufactured item - if (!$adj_only && $myrow['mb_flag'] == 'M') + //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 @@ -117,8 +117,8 @@ function add_grn(&$po) 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); - update_average_material_cost($po->supplier_id, $order_line->stock_id, $order_line->price, + $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_); } //---------------------------------------------------------------------------------------------------------------- @@ -143,7 +143,7 @@ function add_grn(&$po) /* 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)); + $po->supplier_id, 1, $order_line->taxfree_charge_price($po)); } /*quantity received is != 0 */ } /*end of order_line loop */ diff --git a/sales/inquiry/sales_orders_view.php b/sales/inquiry/sales_orders_view.php index 2d76536..4ac964a 100644 --- a/sales/inquiry/sales_orders_view.php +++ b/sales/inquiry/sales_orders_view.php @@ -121,8 +121,8 @@ function prt_link($row) function edit_link($row) { - if (@$_GET['popup']) - return ''; + if (@$_GET['popup']) + return ''; global $trans_type; $modify = ($trans_type == ST_SALESORDER ? "ModifyOrderNumber" : "ModifyQuotationNumber"); return pager_link( _("Edit"), @@ -217,7 +217,7 @@ if (get_post('_OrderNumber_changed') || get_post('_OrderReference_changed')) // $Ajax->activate('orders_tbl'); } -if (!@$_GET['popup']) +if (!@$_GET['popup']) start_form(); start_table(TABLESTYLE_NOBORDER); @@ -239,8 +239,8 @@ if($show_dates) { start_row(); } stock_items_list_cells(_("Item:"), 'SelectStockFromList', null, true); -if (!@$_GET['popup']) - customer_list_cells(_("Select a customer: "), 'customer_id', null, true); +if (!@$_GET['popup']) + customer_list_cells(_("Select a customer: "), 'customer_id', null, true); if ($trans_type == ST_SALESQUOTE) check_cells(_("Show All:"), 'show_all'); @@ -255,7 +255,7 @@ end_table(1); // 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']); + @$selected_stock_item, @$_POST['OrdersAfterDate'], @$_POST['OrdersToDate'], @$_POST['OrderReference'], $_POST['StockLocation'], $_POST['customer_id']); if ($trans_type == ST_SALESORDER) $cols = array( @@ -285,11 +285,11 @@ else 'Type' => 'skip', _("Currency") => array('align'=>'center') ); -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'))); +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")); @@ -322,9 +322,9 @@ $table->width = "80%"; display_db_pager($table); submit_center('Update', _("Update"), true, '', null); -if (!@$_GET['popup']) +if (!@$_GET['popup']) { end_form(); end_page(); -} +} ?> \ No newline at end of file -- 2.30.2