X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fmovement_types.php;h=e7086f947432915989c1a32f1f68631f13750c3a;hb=7908728fad477f68f6f9633d2e79c53956169934;hp=fb866fc2d0c6a308f2d68b8d379244e9299e64f9;hpb=c09be0dad6b05131e240349a375af7a4b7bf3444;p=fa-stable.git diff --git a/inventory/manage/movement_types.php b/inventory/manage/movement_types.php index fb866fc2..e7086f94 100644 --- a/inventory/manage/movement_types.php +++ b/inventory/manage/movement_types.php @@ -1,10 +1,19 @@ . +***********************************************************************/ +$page_security = 'SA_INVENTORYMOVETYPE'; +$path_to_root = "../.."; include($path_to_root . "/includes/session.inc"); -page(_("Inventory Movement Types")); +page(_($help_context = "Inventory Movement Types")); include_once($path_to_root . "/inventory/includes/inventory_db.inc"); @@ -47,11 +56,7 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') function can_delete($selected_id) { - $sql= "SELECT COUNT(*) FROM ".TB_PREF."stock_moves - WHERE type=" . systypes::inventory_adjustment(). " AND person_id=$selected_id"; - $result = db_query($sql, "could not query stock moves"); - $myrow = db_fetch_row($result); - if ($myrow[0] > 0) + if (movement_types_in_stock_moves($selected_id)) { display_error(_("Cannot delete this inventory movement type because item transactions have been created referring to it.")); return false; @@ -76,16 +81,19 @@ if ($Mode == 'Delete') if ($Mode == 'RESET') { $selected_id = -1; + $sav = get_post('show_inactive'); unset($_POST); + $_POST['show_inactive'] = $sav; } //----------------------------------------------------------------------------------- -$result = get_all_movement_type(); +$result = get_all_movement_type(check_value('show_inactive')); start_form(); -start_table("$table_style width=30%"); +start_table(TABLESTYLE, "width=30%"); $th = array(_("Description"), "", ""); +inactive_control_column($th); table_header($th); $k = 0; while ($myrow = db_fetch($result)) @@ -94,20 +102,17 @@ while ($myrow = db_fetch($result)) alt_table_row_color($k); label_cell($myrow["name"]); + inactive_control_cell($myrow["id"], $myrow["inactive"], 'movement_types', 'id'); edit_button_cell("Edit".$myrow['id'], _("Edit")); - edit_button_cell("Delete".$myrow['id'], _("Delete")); + delete_button_cell("Delete".$myrow['id'], _("Delete")); end_row(); } - -end_table(); -end_form(); -echo '
'; +inactive_control_row($th); +end_table(1); //----------------------------------------------------------------------------------- -start_form(); - -start_table(); +start_table(TABLESTYLE2); if ($selected_id != -1) { @@ -125,7 +130,7 @@ text_row(_("Description:"), 'name', null, 50, 50); end_table(1); -submit_add_or_update_center($selected_id == -1, '', true); +submit_add_or_update_center($selected_id == -1, '', 'both'); end_form();