public function stockAvailabilityReportAction()
 {
     $this->_helper->layout->setLayout('reports');
     $q_str_pro = '';
     $q_str_prov = '';
     $sel_prov = '';
     $warehouses_data = new Model_WarehousesData();
     $item_pack_sizes = new Model_ItemPackSizes();
     $locations = new Model_Locations();
     $stakeholders = new Model_Stakeholders();
     $request_data = Zend_Controller_Front::getInstance()->getRequest()->getParams();
     $item = $item_pack_sizes->productsReport();
     $this->view->item_id = $item;
     $this->view->report_id = 'SNASUMSTOCKLOC';
     $this->view->report_title = 'Stock Availability Report';
     $this->view->parameters = 'TS01P01I';
     $this->view->cwh_name = '';
     $this->view->num_item2 = '';
     $this->view->total = 0;
     $this->view->cwhtotal = 0;
     $this->view->ppiutotal = 0;
     $this->view->disttotal = 0;
     $this->view->old1 = '';
     $this->view->actionpage = 'stock-availability-report';
     // $this->view->month_sel = $this->_request->month_sel;
     // $this->view->year_sel = $this->_request->year_sel;
     $this->view->sel_item = $this->_request->prod_sel;
     $this->view->sel_stk = $this->_request->stk_id;
     $this->view->prov_sel = $this->_request->prov_sel;
     $lct = $locations->devisionalReport();
     $this->view->location = $lct;
     $warehouses_data->temp = $request_data;
     $rs_items = $warehouses_data->generateStockAvailabilityReport();
     $this->view->rs_items = $rs_items;
     if (!empty($this->_request->year_sel) && !empty($this->_request->month_sel)) {
         $this->view->year_sel = $year = $this->_request->year_sel;
         $this->view->month_sel = $month = $this->_request->month_sel;
     } else {
         $year = date("Y");
         //            if (date('d') > 10) {
         //                $month = date("m", strtotime("-1"));
         //            } else {
         $month = date("m", strtotime("-2 month"));
         //            }
         $this->view->year_sel = $year;
         $this->view->month_sel = $month;
     }
     if (!empty($this->_request->prod_sel)) {
         $item_pack_sizes->form_values['pk_id'] = $this->_request->prod_sel;
         $this->view->product_name = $item_pack_sizes->getProductName();
     }
     if ($this->_request->prov_sel == 'all') {
         $this->view->location_name = "All";
     } else {
         if ($this->_request->prov_sel == '') {
             $this->view->location_name = "Punjab";
         } else {
             $locations->form_values['pk_id'] = $this->_request->prov_sel;
             $this->view->location_name = $locations->getLocationName();
         }
     }
     if ($this->_request->stk_id == 'all' || $this->_request->stk_id == "") {
         $this->view->stakeholder_name = "All";
     } elseif (!empty($this->_request->stk_id)) {
         $stakeholders->form_values['pk_id'] = $this->_request->stk_id;
         $this->view->stakeholder_name = $stakeholders->getStakeholderName();
     }
 }