diff --git a/application/controllers/Item_kits.php b/application/controllers/Item_kits.php index 909f832f8..07498a20f 100644 --- a/application/controllers/Item_kits.php +++ b/application/controllers/Item_kits.php @@ -9,7 +9,9 @@ class Item_kits extends Secure_Controller parent::__construct('item_kits'); } - // add the total cost and retail price to a passed items kit retriegeneving the data from each singolar item part of the kit + /* + Add the total cost and retail price to a passed items kit retrieving the data from each singular item part of the kit + */ private function _add_totals_to_item_kit($item_kit) { $item_kit->total_cost_price = 0; @@ -172,8 +174,10 @@ class Item_kits extends Secure_Controller { // calculate the total cost and retail price of the Kit so it can be added to the barcode text at the bottom $item_kit = $this->_add_totals_to_item_kit($this->Item_kit->get_info($item_kid_id)); + + $item_kid_id = 'KIT '. urldecode($item_kid_id); - $result[] = array('name' => $item_kit->name, 'item_id' => 'KIT '. urldecode($item_kid_id), 'item_number' => 'KIT '. urldecode($item_kid_id), + $result[] = array('name' => $item_kit->name, 'item_id' => $item_kid_id, 'item_number' => $item_kid_id, 'cost_price' => $item_kit->total_cost_price, 'unit_price' => $item_kit->total_unit_price); } diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index ddf8e8615..134fd2a9c 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -53,7 +53,7 @@ class Sales extends Secure_Controller echo json_encode($data_row); } - + public function search() { $this->Sale->create_sales_items_temp_table(); @@ -67,12 +67,12 @@ class Sales extends Secure_Controller $is_valid_receipt = isset($search) ? $this->sale_lib->is_valid_receipt($search) : FALSE; $filters = array('sale_type' => 'all', - 'location_id' => 'all', - 'start_date' => $this->input->get('start_date'), - 'end_date' => $this->input->get('end_date'), - 'only_cash' => FALSE, - 'only_invoices' => $this->config->item('invoice_enable') && $this->input->get('only_invoices'), - 'is_valid_receipt' => $is_valid_receipt); + 'location_id' => 'all', + 'start_date' => $this->input->get('start_date'), + 'end_date' => $this->input->get('end_date'), + 'only_cash' => FALSE, + 'only_invoices' => $this->config->item('invoice_enable') && $this->input->get('only_invoices'), + 'is_valid_receipt' => $is_valid_receipt); // check if any filter is set in the multiselect dropdown $filledup = array_fill_keys($this->input->get('filters'), TRUE); @@ -94,7 +94,7 @@ class Sales extends Secure_Controller $data_rows[] = $this->xss_clean(get_sale_data_last_row($sales, $this)); } - echo json_encode(array('total' => $total_rows, 'rows' => $data_rows,'payment_summary' => $payment_summary)); + echo json_encode(array('total' => $total_rows, 'rows' => $data_rows, 'payment_summary' => $payment_summary)); } public function item_search()