<?php
-
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
$page_security = 9;
$path_to_root="../..";
include_once($path_to_root . "/includes/session.inc");
qty_cell($myrow["quantity"], false, get_qty_dec($myrow["component"]));
label_cell($myrow["units"]);
edit_button_cell("Edit".$myrow['id'], _("Edit"));
- edit_button_cell("Delete".$myrow['id'], _("Delete"));
+ delete_button_cell("Delete".$myrow['id'], _("Delete"));
end_row();
} //END WHILE LIST LOOP
if ($Mode == 'Delete')
{
- $sql = "DELETE FROM ".TB_PREF."bom WHERE id='" . $selected_component. "'";
+ $sql = "DELETE FROM ".TB_PREF."bom WHERE id='" . $selected_id. "'";
db_query($sql,"Could not delete this bom components");
display_notification(_("The component item has been deleted from this bom"));
if ($Mode == 'RESET')
{
- $selected_component = -1;
+ $selected_id = -1;
unset($_POST['quantity']);
}
//--------------------------------------------------------------------------------------------------
-start_form(false, true);
+start_form();
echo "<center>" . _("Select a manufacturable item:") . " ";
stock_bom_items_list('stock_id', null, false, true);
{ //Parent Item selected so display bom or edit component
$selected_parent = $_POST['stock_id'];
if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
- on_submit($selected_parent, $selected_component);
+ on_submit($selected_parent, $selected_id);
//--------------------------------------------------------------------------------------
start_form();
display_bom_items($selected_parent);
-//end_form();
//--------------------------------------------------------------------------------------
echo '<br>';
-// start_form(false, true);
start_table($table_style2);
- if ($selected_component != -1)
+ if ($selected_id != -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'
+ WHERE id='$selected_id'
AND ".TB_PREF."stock_master.stock_id=".TB_PREF."bom.component";
$result = db_query($sql, "could not get bom");
$_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"]);
+ }
+ hidden('selected_id', $selected_id);
}
else
{
qty_row(_("Quantity:"), 'quantity', null, null, null, $dec);
end_table(1);
- submit_add_or_update_center($selected_component == -1, '', true);
+ submit_add_or_update_center($selected_id == -1, '', 'both');
end_form();
}
// ----------------------------------------------------------------------------------