Merge pull request #1335 from Frontuari/master

Fixed Dinner Tables feature
This commit is contained in:
FrancescoUK
2017-06-07 19:44:18 +01:00
committed by GitHub
2 changed files with 20 additions and 0 deletions

View File

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

View File

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