Beispiel #1
0
 private function default_fields($search_data)
 {
     $slcustomer = new SLCustomer();
     // Name
     $this->addSearchField('name', 'name_contains', 'contains');
     // Search by Active/Inactive Status
     $this->addSearchField('date_inactive', 'Show Customers', 'null', 'null', 'advanced');
     $options = array('' => 'All', 'not null' => 'Inactive', 'null' => 'Active');
     $this->setOptions('date_inactive', $options);
     // Currency
     $this->addSearchField('currency_id', 'currency', 'select', '', 'advanced');
     $currency = new Currency();
     $currency_list = $currency->getAll();
     $options = array('' => 'All');
     $options += $currency_list;
     $this->SetOptions('currency_id', $options);
     // Remittance
     $this->addSearchField('statement', 'statement', 'select', '', 'advanced');
     $options = array('' => 'All', 'TRUE' => 'Yes', 'FALSE' => 'No');
     $this->setOptions('statement', $options);
     // Invoice Method
     $this->addSearchField('invoice_method', 'invoice_method', 'select', '', 'advanced');
     $options = array_merge(array('' => 'All'), $slcustomer->getEnumOptions('invoice_method'));
     $this->setOptions('invoice_method', $options);
     // Payment Type
     $this->addSearchField('payment_type_id', 'payment_type', 'select', '', 'advanced');
     $payment_type = new PaymentType();
     $options = array('' => 'All');
     $options += $payment_type->getAll();
     $this->setOptions('payment_type_id', $options);
     // Payment Terms
     $this->addSearchField('payment_term_id', 'payment_term', 'select', '', 'advanced');
     $payment_term = new PaymentTerm();
     $options = array('' => 'All');
     $options = $payment_term->getAll();
     asort($options);
     $options = array('' => 'All') + $options;
     $this->setOptions('payment_term_id', $options);
     // SL Anaylsis
     $this->addSearchField('sl_analysis_id', 'sl_analysis', 'select', '', 'advanced');
     $sl_analysis = new SLAnalysis();
     $options = array('' => 'All');
     $options += $sl_analysis->getAll();
     $this->setOptions('sl_analysis_id', $options);
     // Account Status
     $this->addSearchField('account_status', 'account_status', 'select', '', 'advanced');
     $options = array_merge(array('' => 'All'), $slcustomer->getEnumOptions('account_status'));
     $this->setOptions('account_status', $options);
 }