- display_error( _("The quantity entered must be numeric."));
- return false;
- }
-
- if ($_POST['quantity'] <= 0)
- {
- display_error( _("The quantity entered must be a positive number greater than zero."));
+ display_error( _("The quantity entered is invalid or less than zero."));
- $_POST['Costs'] = 0;
- if (!is_numeric($_POST['Costs']))
- {
- display_error( _("The cost entered must be numeric."));
- return false;
- }
-
- if ($_POST['Costs'] < 0)
+ $_POST['Costs'] = price_format(0);
+ if (!check_num('Costs', 0))
$qoh = get_qoh_on_date($bom_item["component"], $bom_item["loc_code"], $_POST['date_']);
if (-$quantity + $qoh < 0)
$qoh = get_qoh_on_date($bom_item["component"], $bom_item["loc_code"], $_POST['date_']);
if (-$quantity + $qoh < 0)
{
// if unassembling, check item to unassemble
$qoh = get_qoh_on_date($_POST['stock_id'], $_POST['StockLocation'], $_POST['date_']);
{
// if unassembling, check item to unassemble
$qoh = get_qoh_on_date($_POST['stock_id'], $_POST['StockLocation'], $_POST['date_']);
- $id = add_work_order($_POST['wo_ref'], $_POST['StockLocation'], $_POST['quantity'],
+ $id = add_work_order($_POST['wo_ref'], $_POST['StockLocation'], input_num('quantity'),
$_POST['stock_id'], $_POST['type'], $_POST['date_'],
$_POST['stock_id'], $_POST['type'], $_POST['date_'],
- update_work_order($selected_id, $_POST['StockLocation'], $_POST['quantity'],
+ update_work_order($selected_id, $_POST['StockLocation'], input_num('quantity'),
$_POST['stock_id'], $_POST['date_'], $_POST['RequDate'], $_POST['memo_']);
meta_forward($_SERVER['PHP_SELF'], "UpdatedID=$selected_id");
$_POST['stock_id'], $_POST['date_'], $_POST['RequDate'], $_POST['memo_']);
meta_forward($_SERVER['PHP_SELF'], "UpdatedID=$selected_id");
$_POST['StockLocation'] = $myrow["loc_code"];
$_POST['released'] = $myrow["released"];
$_POST['closed'] = $myrow["closed"];
$_POST['StockLocation'] = $myrow["loc_code"];
$_POST['released'] = $myrow["released"];
$_POST['closed'] = $myrow["closed"];
$_POST['released_date'] = sql2date($myrow["released_date"]);
$_POST['memo_'] = "";
$_POST['units_issued'] = $myrow["units_issued"];
$_POST['released_date'] = sql2date($myrow["released_date"]);
$_POST['memo_'] = "";
$_POST['units_issued'] = $myrow["units_issued"];
date_row(_("Date") . ":", 'date_');
date_row(_("Date Required By") . ":", 'RequDate', null, sys_prefs::default_wo_required_by());
}
else
{
date_row(_("Date") . ":", 'date_');
date_row(_("Date Required By") . ":", 'RequDate', null, sys_prefs::default_wo_required_by());
}
else
{
date_row(_("Date") . ":", 'date_');
hidden('RequDate', '');
if (!isset($_POST['Costs']))
date_row(_("Date") . ":", 'date_');
hidden('RequDate', '');
if (!isset($_POST['Costs']))