コード例 #1
0
ファイル: sodespatchSearch.php プロジェクト: uzerpllp/uzerp
 public static function useDefault($search_data = null, &$errors = array(), $defaults = null)
 {
     $search = new sodespatchSearch($defaults);
     // Search by Customer
     $search->addSearchField('slmaster_id', 'Customer', 'select', 0, 'advanced');
     $customer = new SLCustomer();
     $options = array('0' => 'All');
     $customers = $customer->getAll(null, false, true);
     $options += $customers;
     $search->setOptions('slmaster_id', $options);
     // Search by Stock Item
     $search->addSearchField('stitem_id', 'Stock Item', 'select', 0, 'advanced');
     $stitems = new STItem();
     $options = array('0' => 'All');
     $stitems = $stitems->getAll();
     $options += $stitems;
     $search->setOptions('stitem_id', $options);
     // Search by Despatch Number
     $search->addSearchField('despatch_number', 'despatch_number', 'equal', '', 'advanced');
     // Search by Order Number
     $search->addSearchField('order_number', 'order_number', 'equal', '', 'advanced');
     // Search by Invoice Number
     $search->addSearchField('invoice_number', 'invoice_number', 'equal', '', 'advanced');
     // Search by Despatch Date
     $search->addSearchField('despatch_date', 'despatch_date_between', 'between', '', 'advanced');
     // Search by Status
     $search->addSearchField('status', 'status', 'select', 'N', 'basic');
     $options = array('' => 'All', 'N' => 'New', 'D' => 'Despatched', 'X' => 'Cancelled');
     $search->setOptions('status', $options);
     $search->setSearchData($search_data, $errors);
     return $search;
 }
コード例 #2
0
ファイル: SLDiscountSearch.php プロジェクト: uzerpllp/uzerp
 public static function useDefault($search_data = null, &$errors = array(), $defaults = null)
 {
     $search = new SLDiscountSearch($defaults);
     // Customer
     $search->addSearchField('slmaster_id', 'Customer', 'select', 0, 'advanced');
     $customer = new SLCustomer();
     $options = array('0' => 'All');
     $customers = $customer->getAll(null, false, true);
     $options += $customers;
     $search->setOptions('slmaster_id', $options);
     // Product Group
     $search->addSearchField('prod_group_id', 'Product Group', 'select', '', 'advanced');
     $prodgroup = new STProductgroup();
     $prodgroup_list = $prodgroup->getAll();
     $options = array('' => 'All');
     $options += $prodgroup_list;
     $search->setOptions('prod_group_id', $options);
     // Execute Search
     $search->setSearchData($search_data, $errors);
     return $search;
 }
コード例 #3
0
 public function getAccountList($_item_type = '', $_account = '')
 {
     if (isset($this->_data['ajax'])) {
         if (!empty($this->_data['item_type'])) {
             $_item_type = $this->_data['item_type'];
         }
     }
     switch ($_item_type) {
         case 'PO':
             $account = new PLSupplier();
             break;
         case 'SI':
             $account = new SLCustomer();
             break;
     }
     $accounts = $account->getAll();
     if (isset($this->_data['ajax'])) {
         $output['account'] = array('data' => $accounts, 'is_array' => true);
         $this->view->set('data', $output);
         $this->setTemplateName('ajax_multiple');
     } else {
         return $orders;
     }
 }