diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index f486c0bc3..2095faa58 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -958,6 +958,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_quote_number($this->CI->Sale->get_quote_number($sale_id)); + $this->set_work_order_number($this->CI->Sale->get_work_order_number($sale_id)); $this->set_sale_type($this->CI->Sale->get_sale_type($sale_id)); $this->set_comment($this->CI->Sale->get_comment($sale_id)); $this->set_dinner_table($this->CI->Sale->get_dinner_table($sale_id)); diff --git a/application/models/Sale.php b/application/models/Sale.php index a420f10ab..a79de6c4d 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -1310,6 +1310,26 @@ class Sale extends CI_Model } } + /** + * Gets the work order number for the selected sale + */ + public function get_work_order_number($sale_id) + { + $this->db->from('sales'); + $this->db->where('sale_id', $sale_id); + + $row = $this->db->get()->row(); + + if($row != NULL) + { + return $row->work_order_number; + } + else + { + return NULL; + } + } + /** * Gets the quote_number for the selected sale */