Fixed warnings related to empty item/customer/supplier selector in search modes.
[fa-stable.git] / inventory / manage / item_codes.php
index 0742780aaa272753e7d2cbfa7e017e2a6b3e7b2f..1881258c22593c9cc1c66a47c9bef3530946ca45 100644 (file)
@@ -113,11 +113,15 @@ echo "<hr></center>";
 
 set_global_stock_item($_POST['stock_id']);
 
+$units = $dec = '';
 $result = get_item_code_dflts($_POST['stock_id']);
-$dec = $result['decimals'];
-$units = $result['units'];
-$dflt_desc = $result['description'];
-$dflt_cat = $result['category_id'];
+if ($result) {
+       $dec = $result['decimals'];
+       $units = $result['units'];
+       $dflt_desc = $result['description'];
+       $dflt_cat = $result['category_id'];
+}
+
 
 $result = get_all_item_codes($_POST['stock_id']);
 div_start('code_table');