global $table_style;
$result = get_bom($selected_parent);
-
+div_start('bom');
start_table("$table_style width=60%");
$th = array(_("Code"), _("Description"), _("Location"),
_("Work Centre"), _("Quantity"), _("Units"),'','');
} //END WHILE LIST LOOP
end_table();
+div_end();
}
//--------------------------------------------------------------------------------------------------
if (!check_num('quantity', 0))
{
display_error(_("The quantity entered must be numeric and greater than zero."));
+ set_focus('quantity');
return;
}
elseif (!isset($selected_component) && isset($selected_parent))
{
- /*Selected component is null cos no item selected on first time round
- so must be adding a record must be Submitting new entries in the new
+ /*Selected component is null cos no item selected on first time round
+ so must be adding a record must be Submitting new entries in the new
component form */
//need to check not recursive bom component of itself!
if (db_num_rows($result) == 0)
{
$sql = "INSERT INTO ".TB_PREF."bom (parent, component, workcentre_added, loc_code, quantity)
- VALUES ('$selected_parent', '" . $_POST['component'] . "', '"
- . $_POST['workcentre_added'] . "', '" . $_POST['loc_code'] . "', "
+ VALUES ('$selected_parent', '" . $_POST['component'] . "', '"
+ . $_POST['workcentre_added'] . "', '" . $_POST['loc_code'] . "', "
. input_num('quantity') . ")";
db_query($sql,"check failed");
echo "<center>" . _("Select a manufacturable item:") . " ";
stock_bom_items_list('stock_id', null, false, true);
+echo "</center>";
end_form();
+if (isset($_POST['_stock_id_update']))
+ $Ajax->activate('bom');
//--------------------------------------------------------------------------------------------------
if (isset($_POST['stock_id']))
label_cell(_("Component:"));
echo "<td>";
- stock_component_items_list('component', $selected_parent, $_POST['component'], false, true);
+ stock_component_items_list('component', $selected_parent, null, false, true);
echo "</td>";
end_row();
}
{
$_POST['quantity'] = qty_format(1);
}
- amount_row(_("Quantity:"), 'quantity', $_POST['quantity']);
+ qty_row(_("Quantity:"), 'quantity', $_POST['quantity']);
end_table(1);
submit_center('Submit', _("Add/Update"));