X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=inventory%2Fmanage%2Fsales_kits.php;h=6040fcd81295a642353fbd0c9f8acad23faf2134;hb=2e181b13aa722a43e78b897404912d6b13a0a937;hp=245656ce938f61400d2d8e7cff37e96c76b19c4f;hpb=3a5c989060c96623b8f621ba89f8eb4405fb1588;p=fa-stable.git diff --git a/inventory/manage/sales_kits.php b/inventory/manage/sales_kits.php index 245656ce..6040fcd8 100644 --- a/inventory/manage/sales_kits.php +++ b/inventory/manage/sales_kits.php @@ -1,5 +1,14 @@ . +***********************************************************************/ $page_security = 11; $path_to_root="../.."; include_once($path_to_root . "/includes/session.inc"); @@ -46,7 +55,7 @@ div_start('bom'); $myrow["units"] == '' ? 0 : get_qty_dec($myrow["comp_name"])); label_cell($myrow["units"] == '' ? _('kit') : $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 @@ -143,7 +152,10 @@ if ($Mode == 'Delete') // $other_kits = get_where_used($_POST['item_code']); $num_kits = db_num_rows($other_kits); - if ($num_kits) { + + $kit = get_item_kit($_POST['item_code']); + if ((db_num_rows($kit) == 1) && $num_kits) { + $msg = _("This item cannot be deleted because it is the last item in the kit used by following kits") .':
'; @@ -229,7 +241,8 @@ if (get_post('item_code') == '') { $Ajax->activate('quantity'); $Ajax->activate('category'); } - qty_row(_("Quantity:"), 'quantity', null, '', $units, $dec); + + qty_row(_("Quantity:"), 'quantity', number_format2(1, $dec), '', $units, $dec); end_table(1); submit_add_or_update_center($selected_id == -1, '', true);