mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-01-29 19:51:05 -05:00
Merge pull request #1335 from Frontuari/master
Fixed Dinner Tables feature
This commit is contained in:
@@ -866,6 +866,7 @@ class Sale_lib
|
||||
|
||||
$this->set_customer($this->CI->Sale->get_customer($sale_id)->person_id);
|
||||
$this->set_employee($this->CI->Sale->get_employee($sale_id)->person_id);
|
||||
$this->set_dinner_table($this->CI->Sale->get_dinner_table($sale_id));
|
||||
}
|
||||
|
||||
public function get_cart_reordered($sale_id)
|
||||
|
||||
@@ -511,6 +511,18 @@ class Sale extends CI_Model
|
||||
return -1;
|
||||
}
|
||||
|
||||
if($sale_status == '1') //suspend sales
|
||||
{
|
||||
if($dinner_table > 2) //not delivery or take away
|
||||
{
|
||||
$table_status = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$table_status = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$sales_data = array(
|
||||
'sale_time' => date('Y-m-d H:i:s'),
|
||||
'customer_id' => $this->Customer->exists($customer_id) ? $customer_id : null,
|
||||
@@ -702,6 +714,13 @@ class Sale extends CI_Model
|
||||
$this->save_sales_tax($sales_taxes);
|
||||
}
|
||||
|
||||
$dinner_table_data = array(
|
||||
'status' => $table_status
|
||||
);
|
||||
|
||||
$this->db->where('dinner_table_id',$dinner_table);
|
||||
$this->db->update('dinner_tables', $dinner_table_data);
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
if($this->db->trans_status() === FALSE)
|
||||
|
||||
Reference in New Issue
Block a user