! -> 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
}
// 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);
}
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++;
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']);
$_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);
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);
$existing_comments = "";
+$dec = 0;
if (isset($selected_id))
{
$myrow = get_work_order($selected_id);
{
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());
}
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);
$_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();
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();
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();
// 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));
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;
$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,
}
- 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');