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"),'','');
label_cell($myrow["description"]);
label_cell($myrow["location_name"]);
label_cell($myrow["WorkCentreDescription"]);
- label_cell(qty_format($myrow["quantity"]));
+ 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']);
} //END WHILE LIST LOOP
end_table();
+div_end();
}
//--------------------------------------------------------------------------------------------------
end_form();
+if (isset($_POST['_stock_id_update']))
+ $Ajax->activate('bom');
//--------------------------------------------------------------------------------------------------
if (isset($_POST['stock_id']))
$_POST['loc_code'] = $myrow["loc_code"];
$_POST['workcentre_added'] = $myrow["workcentre_added"];
- $_POST['quantity'] = qty_format($myrow["quantity"]);
+ $_POST['quantity'] = number_format2($myrow["quantity"], get_qty_dec($myrow["component"]));
hidden('selected_parent', $selected_parent);
hidden('selected_component', $selected_component);
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();
}
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['quantity'] = number_format2(1, $dec);
}
- qty_row(_("Quantity:"), 'quantity', $_POST['quantity']);
+ qty_row(_("Quantity:"), 'quantity', $_POST['quantity'], null, null, $dec);
end_table(1);
submit_center('Submit', _("Add/Update"));