コード例 #1
0
 public function stockIssueAction()
 {
     $form = new Form_StockIssueDispatch();
     $stock_master = new Model_StockMaster();
     $stakeholder_item_pack_sizes = new Model_StakeholderItemPackSizes();
     $this->view->form = $form;
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getPost())) {
             //    App_Controller_Functions::pr($form->getValues());
             $data = $form->getValues();
             $stock_master->form_values = $data;
             $form->month->setValue($data['month']);
             $form->year->setValue($data['year']);
             $form->activity_id->setValue($data['activity_id']);
             $stakeholder_item_pack_sizes->form_values['stakeholder_id'] = $data['activity_id'];
             $this->view->activity_id = $data['activity_id'];
             $this->view->month = $data['month'];
             $this->view->year = $data['year'];
         }
     } else {
         if ($this->_request->month) {
             $form->month->setValue($this->_request->month);
             $form->year->setValue($this->_request->year);
             $stock_master->form_values['month'] = $this->_request->month;
             $stock_master->form_values['year'] = $this->_request->year;
             $stakeholder_item_pack_sizes->form_values['stakeholder_id'] = '1';
             $this->view->activity_id = 1;
             $this->view->month = $this->_request->month;
             $this->view->year = $this->_request->year;
         } else {
             $form->month->setValue(date('m'));
             $form->year->setValue(date('Y'));
             $stock_master->form_values['month'] = date('m');
             $stock_master->form_values['year'] = date('Y');
             $stakeholder_item_pack_sizes->form_values['stakeholder_id'] = '1';
             $this->view->activity_id = 1;
             $this->view->month = date('m');
             $this->view->year = date('Y');
         }
     }
     $items = $stakeholder_item_pack_sizes->getAllProductsByStakeholderTypeVaccines();
     $dataset_search = $stock_master->getStockIssueVoucherList();
     $this->view->result = $dataset_search;
     $this->view->wh_id = $this->_identity->getWarehouseId();
     $this->view->items = $items;
     $auth = App_Auth::getInstance();
     $this->view->role_id = $auth->getRoleId();
 }