示例#1
0
 protected function basicFields($search)
 {
     // Search by Source
     $search->addSearchField('source', 'source', 'select', '', 'basic');
     $pp = new PeriodicPayment();
     $options = array('' => 'All');
     $sources = $pp->getEnumOptions('source');
     $options += $sources;
     $search->setOptions('source', $options);
     // Search by Frequency
     $search->addSearchField('frequency', 'frequency', 'select', '', 'basic');
     $options = array('' => 'All');
     $frequencies = $pp->getEnumOptions('frequency');
     $options += $frequencies;
     $search->setOptions('frequency', $options);
     // Search by Bank Account
     $search->addSearchField('cb_account_id', 'Bank Account', 'select', 0, 'advanced');
     $cb = new CBAccount();
     $cbs = $cb->getAll();
     $options = array('0' => 'All');
     $options += $cbs;
     $search->setOptions('cb_account_id', $options);
     // Search by Status
     $search->addSearchField('status', 'status', 'select', '', 'advanced');
     $options = array('' => 'All');
     $statuses = $pp->getEnumOptions('status');
     $options += $statuses;
     $search->setOptions('status', $options);
     // Search by Source
     $search->addSearchField('company_id', 'company', 'select', 0, 'advanced');
     $company = new Company();
     $options = array('0' => 'All');
     $companies = $company->getAll();
     $options += $companies;
     $search->setOptions('company_id', $options);
     // Search by Next Due Date
     $search->addSearchField('next_due_date', 'Due Between', 'between', '', 'advanced');
 }
示例#2
0
 public function getCurrencyId($_id = '')
 {
     // Used by Ajax to return Currency after selecting the Bank Account
     if (isset($this->_data['ajax'])) {
         if (!empty($this->_data['id'])) {
             $_id = $this->_data['id'];
         }
     }
     $account = new CBAccount();
     $account->load($_id);
     $currency = '';
     if ($account) {
         $currency = $account->currency_id;
     }
     if (isset($this->_data['ajax'])) {
         $this->view->set('value', $currency);
         $this->setTemplateName('text_inner');
     } else {
         return $currency;
     }
 }
示例#3
0
 private function cashbook_payment($current_type = __FUNCTION__)
 {
     $customer = $this->_uses[$this->modeltype];
     $customer_list = $this->getCustomerList();
     if (isset($this->_data['slmaster_id'])) {
         $customer_id = $this->_data['slmaster_id'];
     } else {
         $customer_id = key($customer_list);
     }
     $customer->load($customer_id);
     if (!$customer->isLoaded()) {
         $flash = Flash::Instance();
         $flash->addError('Error loading Customer details');
         sendBack();
     }
     $this->_data['currency_id'] = $customer->currency_id;
     $this->view->set('master_value', $customer_id);
     $this->view->set('company_id', $customer->company_id);
     $this->view->set('people', $this->getPeople($customer->company_id));
     $this->view->set('currency', $customer->currency);
     $this->view->set('payment_type', $customer->payment_type_id);
     if (is_null($customer->cb_account_id)) {
         $cbaccount = CBAccount::getPrimaryAccount();
         $customer->cb_account_id = $cbaccount->{$cbaccount->idField};
     }
     $this->view->set('bank_account', $customer->cb_account_id);
     $this->view->set('bank_accounts', $this->getbankAccounts($customer->id));
     $this->view->set('rate', $this->getAccountRate($customer->id, $customer->cb_account_id));
     $this->view->set('companies', $customer_list);
     $this->sidebar($current_type);
     $this->_templateName = $this->getTemplateName('enter_payment');
 }