From: Joe Hunt Date: Mon, 16 Jun 2008 23:07:17 +0000 (+0000) Subject: More files with Quantity routines needed fix due to php4 related issue. X-Git-Tag: v2.4.2~19^2~2009 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=6e349a924dd02e35d94555807d34b25e4427ab6e;p=fa-stable.git More files with Quantity routines needed fix due to php4 related issue. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6dbbad15..ea6154de 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,18 @@ Legend: ! -> Note $ -> Affected files +17-Jun-2008 Joe Hunt +! More files with Quantity routines needed fix due to php4 related issue. +$ /includes/current_user.inc + /manufacturing/work_order_entry.php + /manufacturing/inquiry/where_used_inquiry.php + /manufacturing/manage/bom_edit.php + /purchasing/po_receive_items.php + /purchasing/supplier_credit_grns.php + /purchasing/supplier_invoice_grns.php + /sales/customer_credit_invoice.php + /sales/includes/ui/sales_order_ui.inc + 16-Jun-2008 Joe Hunt ! Changed so Customer's Reference is printed on all sales documents (you can f.i. enter PO number here). $ /reporting/includes/header2.inc diff --git a/includes/current_user.inc b/includes/current_user.inc index 3aa6a3f9..14faa349 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -120,7 +120,7 @@ function price_format($number) { } // 2008-06-15. Added extra parameter $stock_id and reference for $dec //-------------------------------------------------------------------- -function qty_format($number, $stock_id=null, &$dec=0) { +function qty_format($number, $stock_id=null, &$dec) { $dec = get_qty_dec($stock_id); return number_format2($number, $dec); } diff --git a/manufacturing/inquiry/where_used_inquiry.php b/manufacturing/inquiry/where_used_inquiry.php index c848a1da..e7958dca 100644 --- a/manufacturing/inquiry/where_used_inquiry.php +++ b/manufacturing/inquiry/where_used_inquiry.php @@ -59,7 +59,7 @@ if (isset($_POST['stock_id'])) label_cell("" . $myrow["parent"]. " - " . $myrow["description"]. ""); label_cell($myrow["WorkCentreName"]); label_cell($myrow["location_name"]); - label_cell(qty_format($myrow["quantity"], $_POST['stock_id'])); + qty_cell($myrow["quantity"], false, get_qty_dec($_POST['stock_id'])); end_row(); $j++; diff --git a/manufacturing/manage/bom_edit.php b/manufacturing/manage/bom_edit.php index 2469afad..d06b84d3 100644 --- a/manufacturing/manage/bom_edit.php +++ b/manufacturing/manage/bom_edit.php @@ -102,7 +102,7 @@ div_start('bom'); label_cell($myrow["description"]); label_cell($myrow["location_name"]); label_cell($myrow["WorkCentreDescription"]); - label_cell(qty_format($myrow["quantity"], $myrow["component"])); + qty_cell($myrow["quantity"], false, get_qty_dec($myrow["component"])); label_cell($myrow["units"]); edit_link_cell(SID . "NewItem=$selected_parent&selected_component=" . $myrow["id"]); delete_link_cell(SID . "delete=" . $myrow["id"]. "&stock_id=" . $_POST['stock_id']); @@ -245,7 +245,7 @@ if (isset($_POST['stock_id'])) $_POST['loc_code'] = $myrow["loc_code"]; $_POST['workcentre_added'] = $myrow["workcentre_added"]; - $_POST['quantity'] = qty_format($myrow["quantity"], $myrow["component"], $dec); + $_POST['quantity'] = number_format2($myrow["quantity"], get_qty_dec($myrow["component"])); hidden('selected_parent', $selected_parent); hidden('selected_component', $selected_component); @@ -268,10 +268,10 @@ if (isset($_POST['stock_id'])) locations_list_row(_("Location to Draw From:"), 'loc_code', null); workcenter_list_row(_("Work Centre Added:"), 'workcentre_added', null); - + $dec = get_qty_dec($_POST['component']); if (!isset($_POST['quantity'])) { - $_POST['quantity'] = qty_format(1, $_POST['stock_id'], $dec); + $_POST['quantity'] = number_format2(1, $dec); } qty_row(_("Quantity:"), 'quantity', $_POST['quantity'], null, null, $dec); diff --git a/manufacturing/work_order_entry.php b/manufacturing/work_order_entry.php index 28d00f29..40484ea3 100644 --- a/manufacturing/work_order_entry.php +++ b/manufacturing/work_order_entry.php @@ -289,6 +289,7 @@ start_table($table_style2); $existing_comments = ""; +$dec = 0; if (isset($selected_id)) { $myrow = get_work_order($selected_id); @@ -365,7 +366,7 @@ if (get_post('type') == wo_types::advanced()) { qty_row(_("Quantity Required:"), 'quantity', null, null, null, $dec); if ($_POST['released']) - label_row(_("Quantity Manufactured:"), qty_format($_POST['units_issued'], $_POST['stock_id'])); + label_row(_("Quantity Manufactured:"), number_format($_POST['units_issued'], get_qty_dec($_POST['stock_id']))); date_row(_("Date") . ":", 'date_'); date_row(_("Date Required By") . ":", 'RequDate', '', null, sys_prefs::default_wo_required_by()); } diff --git a/purchasing/po_receive_items.php b/purchasing/po_receive_items.php index f8aa583f..039355e4 100644 --- a/purchasing/po_receive_items.php +++ b/purchasing/po_receive_items.php @@ -86,9 +86,9 @@ function display_po_receive_items() qty_cell($qty_outstanding, false, $dec); if ($qty_outstanding > 0) - qty_cells(null, $ln_itm->line_no, qty_format($ln_itm->receive_qty, $ln_itm->stock_id, $dec), "align=right", null, $dec); + qty_cells(null, $ln_itm->line_no, number_format2($ln_itm->receive_qty, $dec), "align=right", null, $dec); else - qty_cells(null, $ln_itm->line_no, qty_format($ln_itm->receive_qty, $ln_itm->stock_id, $dec), "align=right", + qty_cells(null, $ln_itm->line_no, number_format2($ln_itm->receive_qty, $dec), "align=right", "disabled", $dec); amount_cell($ln_itm->price); @@ -264,7 +264,7 @@ if (isset($_POST['Update']) || isset($_POST['ProcessGoodsReceived'])) $_POST[$line->line_no] = max($_POST[$line->line_no], 0); if (!check_num($line->line_no)) - $_POST[$line->line_no] = qty_format(0, $line->stock_id); + $_POST[$line->line_no] = number_format2(0, get_qty_dec($line->stock_id)); if (!isset($_POST['DefaultReceivedDate']) || $_POST['DefaultReceivedDate'] == "") $_POST['DefaultReceivedDate'] = Today(); diff --git a/purchasing/supplier_credit_grns.php b/purchasing/supplier_credit_grns.php index 49b07b49..cb50c66f 100644 --- a/purchasing/supplier_credit_grns.php +++ b/purchasing/supplier_credit_grns.php @@ -170,7 +170,7 @@ if (isset($_POST['grn_item_id']) && $_POST['grn_item_id'] != "") label_cell($myrow['item_code'] . " " . $myrow['description']); $dec = get_qty_dec($myrow['item_code']); qty_cell($myrow["quantity_inv"], false, $dec); - qty_cells(null, 'This_QuantityCredited', qty_format(max($myrow['quantity_inv'],0),$myrow['item_code'], $dec), null, null, $dec); + qty_cells(null, 'This_QuantityCredited', number_format2(max($myrow['quantity_inv'],0), $dec), null, null, $dec); amount_cell($myrow['unit_price']); amount_cells(null, 'ChgPrice', price_format($myrow['unit_price'])); end_row(); diff --git a/purchasing/supplier_invoice_grns.php b/purchasing/supplier_invoice_grns.php index 3c444880..0adbe8e9 100644 --- a/purchasing/supplier_invoice_grns.php +++ b/purchasing/supplier_invoice_grns.php @@ -212,7 +212,7 @@ if (isset($_POST['grn_item_id']) && $_POST['grn_item_id'] != "") label_cell($myrow['description']); $dec = get_qty_dec($myrow['item_code']); qty_cell($myrow['QtyOstdg'], false, $dec); - qty_cells(null, 'this_quantity_inv', qty_format($myrow['QtyOstdg'], $myrow['item_code'], $dec), null, null, $dec); + qty_cells(null, 'this_quantity_inv', number_format2($myrow['QtyOstdg'], $dec), null, null, $dec); amount_cell($myrow['unit_price']); small_amount_cells(null, 'ChgPrice', price_format($myrow['unit_price'])); end_row(); diff --git a/sales/customer_credit_invoice.php b/sales/customer_credit_invoice.php index 3c0f9fa4..9b8c0d86 100644 --- a/sales/customer_credit_invoice.php +++ b/sales/customer_credit_invoice.php @@ -279,12 +279,12 @@ function display_credit_items() // view_stock_status_cell($ln_itm->stock_id); alternative view label_cell($ln_itm->stock_id); - text_cells(null, 'Line'.$line_no.'Desc', $ln_itm->item_description, 30, 50); - - qty_cell($ln_itm->quantity, false, get_qty_dec($ln_itm->stock_id)); + text_cells(null, 'Line'.$line_no.'Desc', $ln_itm->item_description, 30, 50); + $dec = get_qty_dec($ln_itm->stock_id); + qty_cell($ln_itm->quantity, false, $dec); label_cell($ln_itm->units); - amount_cells(null, 'Line'.$line_no, qty_format($ln_itm->qty_dispatched, $ln_itm->stock_id)); + amount_cells(null, 'Line'.$line_no, number_format2($ln_itm->qty_dispatched, $dec)); $line_total =($ln_itm->qty_dispatched * $ln_itm->price * (1 - $ln_itm->discount_percent)); diff --git a/sales/includes/ui/sales_order_ui.inc b/sales/includes/ui/sales_order_ui.inc index b9f5e12e..fa628d91 100644 --- a/sales/includes/ui/sales_order_ui.inc +++ b/sales/includes/ui/sales_order_ui.inc @@ -315,7 +315,8 @@ function sales_order_item_controls(&$order, &$rowcounter, $line_no=-1) if ($line_no!=-1 && $line_no == $id) { $_POST['stock_id'] = $order->line_items[$id]->stock_id; - $_POST['qty'] = qty_format($order->line_items[$id]->qty_dispatched, $_POST['stock_id']); + $dec = get_qty_dec($_POST['stock_id']); + $_POST['qty'] = number_format2($order->line_items[$id]->qty_dispatched, $dec); $_POST['price'] = price_format($order->line_items[$id]->price); $_POST['Disc'] = percent_format($order->line_items[$id]->discount_percent*100); $units = $order->line_items[$id]->units; @@ -335,8 +336,8 @@ function sales_order_item_controls(&$order, &$rowcounter, $line_no=-1) $item_info = get_item_edit_info($_POST['stock_id']); $units = $item_info["units"]; - - $_POST['qty'] = qty_format(1, $_POST['stock_id']); + $dec = get_qty_dec($_POST['stock_id']); + $_POST['qty'] = number_format2(1, $dec); $_POST['price'] = price_format(get_price ($_POST['stock_id'], $order->customer_currency, $order->sales_type, @@ -346,10 +347,10 @@ function sales_order_item_controls(&$order, &$rowcounter, $line_no=-1) } - qty_cells(null, 'qty', qty_format($_POST['qty'], $_POST['stock_id'], $dec), null, null, $dec); + qty_cells(null, 'qty', $_POST['qty'], null, null, $dec); if ($order->trans_no!=0) { - amount_cell($line_no==-1 ? 0 :$order->line_items[$line_no]->qty_done); + qty_cell($line_no==-1 ? 0 :$order->line_items[$line_no]->qty_done, false, $dec); } label_cell($units, '', 'units');