Add ticket suggestions for #40

This commit is contained in:
jekkos-t520
2015-03-07 22:41:03 +01:00
parent 6faaec53d6
commit b29cb85b9b
3 changed files with 6 additions and 4 deletions

View File

@@ -65,8 +65,10 @@ class Sales extends Secure_area
function item_search()
{
if ($this->sale_lib->get_mode() == 'return') {
$suggestions = $this->Sale->get_search_suggestions($this->input->post('q'), $this->input->post('limit'));
$suggestions = array();
if ($this->sale_lib->get_mode() == 'return')
{
$this->sale_lib->is_valid_receipt($this->input->post('q')) && $suggestions[] = $this->input->post('q');
} else {
$suggestions = $this->Item->get_item_search_suggestions($this->input->post('q'),$this->input->post('limit'));
$suggestions = array_merge($suggestions, $this->Item_kit->get_item_kit_search_suggestions($this->input->post('q'),$this->input->post('limit')));

View File

@@ -397,7 +397,7 @@ class Sale_lib
//POS #
$pieces = explode(' ',$receipt_sale_id);
if(count($pieces)==2)
if(count($pieces)==2 && strtolower($pieces[0]) == 'pos')
{
return $this->CI->Sale->exists($pieces[1]);
}

View File

@@ -432,7 +432,7 @@ $(document).ready(function()
selectFirst: false,
delay:10,
formatItem: function(row) {
return row[1];
return (row.length > 1 && row[1]) || row[0];
}
});