More files with Quantity routines needed fix due to php4 related issue.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 16 Jun 2008 23:07:17 +0000 (23:07 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 16 Jun 2008 23:07:17 +0000 (23:07 +0000)
CHANGELOG.txt
includes/current_user.inc
manufacturing/inquiry/where_used_inquiry.php
manufacturing/manage/bom_edit.php
manufacturing/work_order_entry.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

index 6dbbad1528a3f0e453dd8713791460ad946e8863..ea6154de02e993dc74844741f83fc7c72a53c31c 100644 (file)
@@ -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
index 3aa6a3f91aaf6ca72a3c0e06b6d5cfeb3623fbc0..14faa3498b4aaf2ad854cdce9efdfa1bb029d47a 100644 (file)
@@ -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);
 }
index c848a1dac99b9c6d65d9b5dc313945caffe81020..e7958dca6ec1bb2ce0e889d355fb3f01a7ec8e20 100644 (file)
@@ -59,7 +59,7 @@ if (isset($_POST['stock_id']))
                label_cell("<a href='$select_item'>" . $myrow["parent"]. " - " . $myrow["description"]. "</a>");
                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++;
index 2469afad8af4b0ed6bee52784b0003c27e14214e..d06b84d321a6f525bfb6e6d1c0ed5f4355ec1c66 100644 (file)
@@ -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);
 
index 28d00f2935a3786cf0f84a02efb6a9096641f04b..40484ea3e65e075d0542de20e155baaa4adf2572 100644 (file)
@@ -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());
 }
index f8aa583fa6b0c8a7d90473f99ffd3dec41401e05..039355e4beab455676dbd7cfcc13d1670486f701 100644 (file)
@@ -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();
index 49b07b49ce9f70e46ed59730c98e976d3f404d84..cb50c66f530acf47a44b4a55a36ea4988a53ba26 100644 (file)
@@ -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();
index 3c444880ae94c86639f941bfd479b9fc59ca2aed..0adbe8e996ec5403c4aee4881b7298afbbdbc4fe 100644 (file)
@@ -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();
index 3c0f9fa43ce76e8593f62cb2790cf78a3172f27e..9b8c0d86000a80efe85afb8966a92a058d0d3d2f 100644 (file)
@@ -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));
 
index b9f5e12e205ded2f1317ec3577420ceeab0c2c92..fa628d91331ce7ce3d26c85379fbeb14f40fc6a5 100644 (file)
@@ -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');