public function init()
 {
     $identity = new App_Auth();
     $stock_master = new Model_StockMaster();
     $wh_id = $identity->getWarehouseId();
     $result1 = $stock_master->getUnpickedIssueNo($wh_id);
     $this->_list["stock_master_id"][''] = "Select Issue No";
     if ($result1 != false) {
         foreach ($result1 as $row) {
             // $this->_list["make"][$wh['pkId']] = $wh['ccmMakeName'];
             $this->_list["stock_master_id"][$row['stc_master_pkid']] = $row['transaction_number'];
         }
     }
     foreach ($this->_fields as $col => $name) {
         switch ($col) {
             case "stock_master_id":
                 $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => true, "filters" => array("StringTrim", "StripTags"), "validators" => array()));
                 $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
                 break;
             default:
                 break;
         }
         if (in_array($col, array_keys($this->_list))) {
             $this->addElement("select", $col, array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option"))))));
             $this->getElement($col)->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
         if (in_array("stock_master_id", array_keys($this->_list))) {
             $this->addElement("select", "stock_master_id", array("attribs" => array("class" => "form-control"), "filters" => array("StringTrim", "StripTags"), "allowEmpty" => true, "required" => false, "registerInArrayValidator" => false, "multiOptions" => $this->_list["stock_master_id"], "validators" => array(array("validator" => "Float", "breakChainOnFailure" => false, "options" => array("messages" => array("notFloat" => $name . " must be a valid option"))))));
             $this->getElement("stock_master_id")->removeDecorator("Label")->removeDecorator("HtmlTag");
         }
     }
 }
 public function fillBatchCombo($item_id)
 {
     $auth = new App_Auth();
     $wh_id = $auth->getWarehouseId();
     $em = Zend_Registry::get("doctrine");
     //$items = $em->getRepository("StockBatch")->findBy(array("itemPackSize" => $item_id, "status" => "Running", "warehouse" => $wh_id));
     $str_sql = $this->_em->createQueryBuilder()->select("sbw.pkId,sb.number")->from('StockBatchWarehouses', 'sbw')->join('sbw.stockBatch', 'sb')->join('sb.packInfo', 'pi')->join('pi.stakeholderItemPackSize', 'sip')->where("sip.itemPackSize = '" . $item_id . "' ")->andWhere("sbw.warehouse = '{$wh_id}' ")->andWhere("sbw.status = 'Running' ");
     $items = $str_sql->getQuery()->getResult();
     $list_item[''] = "Select";
     foreach ($items as $item) {
         $list_item[$item['pkId']] = $item['number'];
     }
     $this->getElement('number')->setMultiOptions($list_item);
 }
 public function fillBatchCombo($item_id)
 {
     $auth = new App_Auth();
     $wh_id = $auth->getWarehouseId();
     $em = Zend_Registry::get("doctrine");
     $items = $em->getRepository("StockBatch")->findBy(array("itemPackSize" => $item_id, "status" => "Running", "warehouse" => $wh_id));
     $list_item[''] = "Select";
     foreach ($items as $item) {
         $list_item[$item->getPkId()] = $item->getNumber();
     }
     $this->getElement('number')->setMultiOptions($list_item);
 }