Bug 5687: Unable to dispatch SO for service items with u/m decimal places set as...
[fa-stable.git] / inventory / manage / items.php
index d4904041b2e0c3752f2d5fdf1c1a9e7bc5345ab2..5497838254b515ee22444ab33e8009376406733d 100644 (file)
@@ -56,7 +56,7 @@ function set_edit($stock_id)
        $_POST['del_image'] = 0;
 }
 
-function delete_image($stock_id)
+function del_image($stock_id)
 {
        foreach (array('jpg', 'png', 'gif') as $ext) {
                $filename = company_path().'/images/'.item_img_name($stock_id).".".$ext;
@@ -335,7 +335,7 @@ if (isset($_POST['delete']) && strlen($_POST['delete']) > 1)
 
                $stock_id = $_POST['NewStockID'];
                delete_item($stock_id);
-               delete_image($stock_id);
+               del_image($stock_id);
                display_notification(_("Selected item has been deleted."));
                $_POST['stock_id'] = '';
                clear_data();
@@ -686,7 +686,7 @@ function generateBarcode() {
                $query = "SELECT stock_id FROM ".TB_PREF."stock_master WHERE stock_id='" . $tmpBarcodeID . "'";
                $arr_stock = db_fetch(db_query($query));
   
-               if (  !$arr_stock['stock_id'] ) {
+               if (  !$arr_stock || !$arr_stock['stock_id'] ) {
                        return $tmpBarcodeID;
                }
                $tmpBarcodeID = "";