$_POST['date_'] = Today();
if (!is_date_in_fiscalyear($_POST['date_']))
$_POST['date_'] = end_fiscalyear();
$_POST['date_'] = Today();
if (!is_date_in_fiscalyear($_POST['date_']))
$_POST['date_'] = end_fiscalyear();
- if (!is_numeric($_POST['quantity']))
- {
- display_error( _("The quantity entered must be numeric."));
- return false;
- }
-
- if ($_POST['quantity'] <= 0)
+ if (!check_num('quantity', 0))
{
display_error(_("The entered date is not in fiscal year."));
return false;
}
// only check bom and quantites if quick assembly
{
display_error(_("The entered date is not in fiscal year."));
return false;
}
// only check bom and quantites if quick assembly
- if (!is_numeric($_POST['Costs']))
- {
- display_error( _("The cost entered must be numeric."));
- return false;
- }
-
- if ($_POST['Costs'] < 0)
+ if ($_POST['Costs'] == "")
+ $_POST['Costs'] = price_format(0);
+ if (!check_num('Costs', 0))
{
display_error(_("The work order cannot be processed because there is an insufficient quantity for component:") .
" " . $bom_item["component"] . " - " . $bom_item["description"] . ". " . _("Location:") . " " . $bom_item["location_name"]);
{
display_error(_("The work order cannot be processed because there is an insufficient quantity for component:") .
" " . $bom_item["component"] . " - " . $bom_item["description"] . ". " . _("Location:") . " " . $bom_item["location_name"]);
{
// 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_'],
meta_forward($_SERVER['PHP_SELF'], "AddedID=$id");
}
//-------------------------------------------------------------------------------------
meta_forward($_SERVER['PHP_SELF'], "AddedID=$id");
}
//-------------------------------------------------------------------------------------
- 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");
{
//the link to delete a selected record was clicked instead of the submit button
$cancel_delete = false;
// can't delete it there are productions or issues
{
//the link to delete a selected record was clicked instead of the submit button
$cancel_delete = false;
// can't delete it there are productions or issues
work_order_has_payments($selected_id))
{
display_error(_("This work order cannot be deleted because it has already been processed."));
$cancel_delete = true;
}
work_order_has_payments($selected_id))
{
display_error(_("This work order cannot be deleted because it has already been processed."));
$cancel_delete = true;
}
$_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"];
hidden('released', $_POST['released']);
hidden('released_date', $_POST['released_date']);
hidden('selected_id', $selected_id);
hidden('released', $_POST['released']);
hidden('released_date', $_POST['released_date']);
hidden('selected_id', $selected_id);
label_row(_("Reference:"), $_POST['wo_ref']);
label_row(_("Type:"), wo_types::name($_POST['type']));
label_row(_("Reference:"), $_POST['wo_ref']);
label_row(_("Type:"), wo_types::name($_POST['type']));
{
$_POST['units_issued'] = $_POST['released'] = 0;
ref_row(_("Reference:"), 'wo_ref', references::get_next(systypes::work_order()));
{
$_POST['units_issued'] = $_POST['released'] = 0;
ref_row(_("Reference:"), 'wo_ref', references::get_next(systypes::work_order()));
{
hidden('stock_id', $_POST['stock_id']);
hidden('StockLocation', $_POST['StockLocation']);
{
hidden('stock_id', $_POST['stock_id']);
hidden('StockLocation', $_POST['StockLocation']);
label_row(_("Item:"), $myrow["StockItemName"]);
label_row(_("Destination Location:"), $myrow["location_name"]);
label_row(_("Item:"), $myrow["StockItemName"]);
label_row(_("Destination Location:"), $myrow["location_name"]);
date_row(_("Date") . ":", 'date_');
date_row(_("Date Required By") . ":", 'RequDate', null, sys_prefs::default_wo_required_by());
}
date_row(_("Date") . ":", 'date_');
date_row(_("Date Required By") . ":", 'RequDate', null, sys_prefs::default_wo_required_by());
}
date_row(_("Date") . ":", 'date_');
hidden('RequDate', '');
if (!isset($_POST['Costs']))
date_row(_("Date") . ":", 'date_');
hidden('RequDate', '');
if (!isset($_POST['Costs']))
{
submit_cells('close', _("Close This Work Order"));
}
submit_cells('delete', _("Delete This Work Order"));
{
submit_cells('close', _("Close This Work Order"));
}
submit_cells('delete', _("Delete This Work Order"));