" . _("Select a manufacturable item:") . " "; stock_bom_items_list('selected_parent', null, false, true); echo "
"; end_form(); if (isset($_POST['_selected_parent_update'])) $Ajax->activate('_page_body'); //-------------------------------------------------------------------------------------------------- if (get_post('selected_parent') != '') { //Parent Item selected so display bom or edit component $selected_parent = $_POST['selected_parent']; if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') on_submit($selected_parent, $selected_component); //-------------------------------------------------------------------------------------- start_form(); display_bom_items($selected_parent); //end_form(); //-------------------------------------------------------------------------------------- echo '
'; // start_form(false, true); start_table($table_style2); if ($selected_component != -1) { if ($Mode == 'Edit') { //editing a selected component from the link to the line item $sql = "SELECT ".TB_PREF."bom.*,".TB_PREF."stock_master.description FROM ".TB_PREF."bom,".TB_PREF."stock_master WHERE id='$selected_component' AND ".TB_PREF."stock_master.stock_id=".TB_PREF."bom.component"; $result = db_query($sql, "could not get bom"); $myrow = db_fetch($result); $_POST['loc_code'] = $myrow["loc_code"]; $_POST['workcentre_added'] = $myrow["workcentre_added"]; $_POST['quantity'] = number_format2($myrow["quantity"], get_qty_dec($myrow["component"])); } hidden('component', $selected_component); label_row(_("Component:"), $myrow["component"] . " - " . $myrow["description"]); } else { start_row(); label_cell(_("Component:")); echo ""; stock_component_items_list('component', $selected_parent, null, false, true); if (get_post('_component_update')) { $Ajax->activate('quantity'); } echo ""; end_row(); } hidden('selected_parent', $selected_parent); locations_list_row(_("Location to Draw From:"), 'loc_code', null); workcenter_list_row(_("Work Centre Added:"), 'workcentre_added', null); $dec = get_qty_dec(get_post('component')); $_POST['quantity'] = number_format2(input_num('quantity',1), $dec); qty_row(_("Quantity:"), 'quantity', null, null, null, $dec); end_table(1); submit_add_or_update_center($selected_component == -1, '', true); end_form(); } // ---------------------------------------------------------------------------------- end_page(); ?>