public function ajaxGetPreMonthReceiveAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(TRUE); $params = $this->_request->getParams(); $obj_item = new Model_ItemPackSizes(); $items = $obj_item->getAllItems(); $wh_data = new Model_HfDataMaster(); $wh_data->form_values = array('reporting_start_date' => $params['year'] . "-" . $params['month'] . "-01", 'warehouse_id' => $params['wh_id']); $data_rs = $wh_data->isReportExists(); $result = array(); if (!$data_rs) { foreach ($items as $item) { $ips = $this->_em->getRepository("ItemPackSizes")->find($item['pkId']); $str_sql = "SELECT REPgetTransWHData(4,'" . $params['month'] . "','" . $params['year'] . "','" . $item['pkId'] . "','" . $params['wh_id'] . "') from DUAL"; echo $str_sql; exit; $row = $this->_em->getConnection()->executeQuery($str_sql); $rs = $row->fetch(); $result[$item['pkId']] = $rs[0] == NULL ? 0 : $rs[0] * $ips->getNumberOfDoses(); } } echo json_encode($result); }