Пример #1
0
 public function __construct($data = NULL)
 {
     parent::__construct($data);
     $this->_id = isset($data->id) ? (int) $data->id : 0;
     $this->_data = $data;
     $this->_sale = $this->_load_customer_sale($this->_id);
 }
Пример #2
0
 /**
  * Create a new customer sale.
  * @param stdClass $data Object to create new sale.
  */
 public function __construct($data = NULL)
 {
     parent::__construct($data);
     $this->_data = $data;
     $this->_sale = $this->_default_customer_sale();
     $this->_sale_lines = array();
     $this->_sale_taxes = array();
     $this->_date_billed = isset($this->_data->date_billed) ? $this->_data->date_billed : FALSE;
     $this->_date_due = isset($this->_data->date_due) ? $this->_data->date_due : FALSE;
 }
Пример #3
0
 public function __construct($data = NULL)
 {
     parent::__construct($data);
     $this->_validate_only = (isset($data->validate_only) and $data->validate_only) ? TRUE : FALSE;
     $this->_id = isset($data->id) ? (int) $data->id : 0;
     $this->_sale = $this->_load_customer_sale($this->_id);
     // Date Billed defaults to today, or the SO date if it is in the future.
     $this->_date_billed = isset($data->date_billed) ? $data->date_billed : (strtotime(date("Y-m-d")) < strtotime($this->_sale->date_created) ? $this->_sale->date_created : date("Y-m-d"));
     $this->_date_due = isset($data->date_due) ? $data->date_due : FALSE;
 }
Пример #4
0
 public function __construct($data = NULL)
 {
     parent::__construct($data);
     $this->_data = $data;
     $this->_transaction_sale_account_id = $this->_beans_setting_get('sale_default_account_id');
     $this->_transaction_sale_line_account_id = $this->_beans_setting_get('sale_default_line_account_id');
     $this->_transaction_sale_tax_account_id = $this->_beans_setting_get('sale_default_tax_account_id');
     $this->_transaction_sale_deferred_income_account_id = $this->_beans_setting_get('sale_deferred_income_account_id');
     $this->_transaction_sale_deferred_liability_account_id = $this->_beans_setting_get('sale_deferred_liability_account_id');
 }
Пример #5
0
 public function __construct($data = NULL)
 {
     parent::__construct($data);
     $this->_data = $data;
     $this->_id = isset($data->id) ? (int) $data->id : 0;
     $this->_sale = $this->_load_customer_sale($this->_id);
     $this->_sale_lines = array();
     $this->_sale_taxes = array();
     $this->_date_billed = isset($this->_data->date_billed) ? $this->_data->date_billed : FALSE;
 }
Пример #6
0
 public function __construct($data = NULL)
 {
     parent::__construct($data);
     $this->_page = (isset($data->page) and (int) $data->page >= 0) ? (int) $data->page : 0;
     $this->_page_size = (isset($data->page_size) and (int) $data->page_size > 0) ? (int) $data->page_size : 50;
     $this->_sort_by = isset($data->sort_by) ? strtolower($data->sort_by) : "newest";
     $this->_search_customer_id = isset($data->search_customer_id) ? $data->search_customer_id : FALSE;
     $this->_search_keywords = isset($data->keywords) ? $data->keywords : FALSE;
     $this->_search_flag_invoiced = isset($data->invoiced) ? $data->invoiced ? TRUE : FALSE : NULL;
     $this->_search_flag_cancelled = isset($data->cancelled) ? $data->cancelled ? TRUE : FALSE : NULL;
     $this->_search_flag_sent = isset($data->sent) ? $data->sent ? TRUE : FALSE : NULL;
     $this->_search_flag_past_due = isset($data->past_due) ? $data->past_due ? TRUE : FALSE : NULL;
     $this->_search_flag_has_balance = isset($data->has_balance) ? $data->has_balance ? TRUE : FALSE : NULL;
     $this->_search_date_created_before = isset($data->date_created_before) ? $data->date_created_before : NULL;
     $this->_search_date_created_after = isset($data->date_created_after) ? $data->date_created_after : NULL;
     $this->_search_date_billed_before = isset($data->date_billed_before) ? $data->date_billed_before : NULL;
     $this->_search_date_billed_after = isset($data->date_billed_after) ? $data->date_billed_after : NULL;
 }
Пример #7
0
 public function __construct($data = NULL)
 {
     parent::__construct($data);
     $this->_data = $data;
 }
Пример #8
0
 public function __construct($data = NULL)
 {
     parent::__construct($data);
 }