diff --git a/application/controllers/config.php b/application/controllers/config.php index d70bafde3..be3b8775d 100644 --- a/application/controllers/config.php +++ b/application/controllers/config.php @@ -39,9 +39,7 @@ class Config extends Secure_area 'timezone'=>$this->input->post('timezone'), 'print_after_sale'=>$this->input->post('print_after_sale'), 'tax_included'=>$this->input->post('tax_included'), - 'recv_invoice_enable'=>$this->input->post('recv_invoice_enable'), 'recv_invoice_format'=>$this->input->post('recv_invoice_format'), - 'sales_invoice_enable'=>$this->input->post('sales_invoice_enable'), 'sales_invoice_format'=>$this->input->post('sales_invoice_format'), 'custom1_name'=>$this->input->post('custom1_name'),/**GARRISON ADDED 4/20/2013**/ 'custom2_name'=>$this->input->post('custom2_name'),/**GARRISON ADDED 4/20/2013**/ diff --git a/application/controllers/giftcards.php b/application/controllers/giftcards.php index e386b08fb..3b052bddd 100644 --- a/application/controllers/giftcards.php +++ b/application/controllers/giftcards.php @@ -41,9 +41,9 @@ class Giftcards extends Secure_area implements iData_controller /* Gives search suggestions for person_id based on what is being searched for */ - function suggest_person() + function person_search() { - $suggestions = $this->Giftcard->get_person_search_suggestions($this->input->post('q'),$this->input->post('limit')); + $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('q'),$this->input->post('limit')); echo implode("\n",$suggestions); } /** END GARRISON ADDED **/ @@ -56,8 +56,10 @@ class Giftcards extends Secure_area implements iData_controller function view($giftcard_id=-1) { - $data['giftcard_info']=$this->Giftcard->get_info($giftcard_id); - + $giftcard_info=$this->Giftcard->get_info($giftcard_id); + $person_name=$giftcard_info->first_name . ' ' . $giftcard_info->last_name; + $data['selected_person'] = $giftcard_id > 0 ? $giftcard_info->person_id . "|" . $person_name : ""; + $data['giftcard_info']=$giftcard_info; $this->load->view("giftcards/form",$data); } diff --git a/application/libraries/Receiving_lib.php b/application/libraries/Receiving_lib.php index 6fe939728..737cc4241 100644 --- a/application/libraries/Receiving_lib.php +++ b/application/libraries/Receiving_lib.php @@ -101,8 +101,7 @@ class Receiving_lib function clear_invoice_number_enabled() { - $enable = $this->CI->config->config['recv_invoice_enable']; - $this->set_invoice_number_enabled($enable); + $this->set_invoice_number_enabled(FALSE); } function set_stock_source($stock_source) diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index cd9fa7e6e..ed3775fcb 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -80,8 +80,7 @@ class Sale_lib function clear_invoice_number_enabled() { - $enable = $this->CI->config->config['sales_invoice_enable']; - $this->set_invoice_number_enabled($enable); + $this->set_invoice_number_enabled(FALSE); } function get_email_receipt() @@ -537,15 +536,15 @@ class Sale_lib return to_currency_no_money($subtotal); } - function get_item_total_tax_exclusive($quantity, $price, $discount_percentage) + function get_item_total_tax_exclusive($item_id, $quantity, $price, $discount_percentage) { - $tax_info = $this->CI->Item_taxes->get_info($item['item_id']); + $tax_info = $this->CI->Item_taxes->get_info($item_id); $item_price = $this->get_item_total($quantity, $price, $discount_percentage); // only additive tax here foreach($tax_info as $tax) { $tax_percentage = $tax_info[0]['percent']; - $item_price =- $this->get_item_tax($quantity, $price, $discount_percentage, $tax_percentage); + $item_price -= $this->get_item_tax($quantity, $price, $discount_percentage, $tax_percentage); } return $item_price; @@ -585,13 +584,13 @@ class Sale_lib } else { - if ($CI->config->config['tax_included']) + if ($this->CI->config->config['tax_included']) { $subtotal += $this->get_item_total($item['quantity'], $item['price'], $item['discount']); } else { - $subtotal += $this->get_item_total_tax_exclusive($item['quantity'], $item['price'], $item['discount']); + $subtotal += $this->get_item_total_tax_exclusive($item['item_id'], $item['quantity'], $item['price'], $item['discount']); } } } diff --git a/application/models/giftcard.php b/application/models/giftcard.php index 10e894b65..3cd1520ca 100644 --- a/application/models/giftcard.php +++ b/application/models/giftcard.php @@ -41,6 +41,7 @@ class Giftcard extends CI_Model function get_info($giftcard_id) { $this->db->from('giftcards'); + $this->db->join('people', 'people.person_id = giftcards.person_id', 'LEFT'); $this->db->where('giftcard_id',$giftcard_id); $this->db->where('deleted',0); diff --git a/application/views/config.php b/application/views/config.php index ee1b7db58..c0a0f6ba4 100644 --- a/application/views/config.php +++ b/application/views/config.php @@ -268,17 +268,6 @@ echo form_open('config/save/',array('id'=>'config_form')); -