Any idea, do i need new table or change the code in ui_lists.in
$sql = "SELECT i.item_code, i.description, c.description, count(*)>1 as kit,
i.inactive, if(count(*)>1, '0', s.editable) as editable
FROM
".TB_PREF."stock_master s,
".TB_PREF."item_codes i
LEFT JOIN
".TB_PREF."stock_category c
ON i.category_id=c.category_id
WHERE i.stock_id=s.stock_id";
if ($type == 'local') { // exclude foreign codes
$sql .= " AND !i.is_foreign";
} elseif ($type == 'kits') { // sales kits
$sql .= " AND !i.is_foreign AND i.item_code!=i.stock_id";
}
$sql .= " AND !i.inactive AND !s.inactive AND !s.no_sale";
$sql .= " GROUP BY i.item_code";
to
$sql = "SELECT i.item_code, s.description, c.description, count(*)>1 as kit,
i.inactive, if(count(*)>1, '0', s.editable) as editable
FROM
".TB_PREF."stock_master s,
".TB_PREF."item_codes i
LEFT JOIN
".TB_PREF."stock_category c
ON i.category_id=c.category_id
WHERE i.stock_id=s.stock_id";
if ($type == 'local') { // exclude foreign codes
$sql .= " AND !i.is_foreign";
} elseif ($type == 'kits') { // sales kits
$sql .= " AND !i.is_foreign AND i.item_code!=i.stock_id";
}
$sql .= " AND !i.inactive AND !s.inactive AND !s.no_sale";
$sql .= " GROUP BY i.stock_id";