Fixed Item Kits comment typos and small refactoring (#665)

This commit is contained in:
FrancescoUK
2016-06-19 21:07:10 +01:00
parent 6c6e41495c
commit 6c791afffc
2 changed files with 14 additions and 10 deletions

View File

@@ -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);
}

View File

@@ -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()