示例#1
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');
 }