How to display [(Rate)] [SKU code] - [Description] - [(Inventory Quantity)] on the Invoice while selecting the item

  • Last Created On Dec 13, 2023
  • 150
0 0

How to display  [(Rate)] - [Description] - [(Inventory Quantity)] on the Invoice while selecting the item


public function wh_commodity_code_search($q, $type, $can_be = '', $search_all = false)

{


$this->db->select('rate, id, description as name, long_description as subtext, commodity_code, purchase_price, CONCAT(description, " - (", IFNULL(( SELECT sum(inventory_number)  from '.db_prefix().'inventory_manage where '.db_prefix().'items.id = '.db_prefix().'inventory_manage.commodity_id group by commodity_id), 0),")") as description_iv');

$this->db->group_start();

$this->db->like('description', $q);

$this->db->or_like('long_description', $q);

$this->db->or_like('commodity_code', $q);

$this->db->or_like('sku_code', $q);

$this->db->group_end();

if(new_strlen($can_be) > 0){

$this->db->where($can_be, $can_be);

}

$this->db->where('active', 1);

if(!$search_all){

$this->db->where('id not in ( SELECT distinct parent_id from '.db_prefix().'items WHERE parent_id is not null AND parent_id != "0" )');

}

$this->db->order_by('id', 'desc');

$this->db->limit(500);


$items = $this->db->get(db_prefix() . 'items')->result_array();


foreach ($items as $key => $item) {

$items[$key]['subtext'] = strip_tags(mb_substr($item['subtext'], 0, 200)) . '...';

if($type == 'rate'){

$items[$key]['name']    = '(' . app_format_number($item['rate']) . ') -'. $item['description_iv'];

}else{

$items[$key]['name']    = '(' . app_format_number($item['purchase_price']) . ') ' .$item['commodity_code'].'-'. $item['description_iv'];

}


}


return $items;

}

How to display SKU Code on the Invoice while selecting the item


Views: 150

Recent Articles

  • Google Analytics Dashboard
    7
  • Customizing the metric view in Google An...
    7
  • Connect your Google account
    6
  • Workspaces Management
    7
  • Connect your Youtube account and Sync da...
    22

Popular Articles

  • Warehouse
    681
  • Mapping Setup
    542
  • Item Settings
    519
  • General Accounting Settings
    500
  • Inventory Receiving Voucher
    422