public function init() { $non_ccm_loc = new Model_NonCcmLocations(); $result3 = $non_ccm_loc->getLocationsName(); $this->_list["non_ccm_location_id"][''] = "Select Location"; if ($result3) { foreach ($result3 as $row3) { $this->_list["non_ccm_location_id"][$row3['pkId']] = $row3['locationName']; } } foreach ($this->_fields as $col => $name) { switch ($col) { case "item_pack_size_id": case "stock_batch_id": case "totqty": case "quantity": $this->addElement("text", $col, array("attribs" => array("class" => "form-control"), "allowEmpty" => false, "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, "multiOptions" => $this->_list[$col], "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"); } } }
public function init() { //Generate Item Combo $item_pack_size = new Model_ItemPackSizes(); $result = $item_pack_size->getItemsByCategory(); $this->_list["item_pack_size_id"][''] = "Select Product"; if ($result) { foreach ($result as $row) { $this->_list["item_pack_size_id"][$row->getPkId()] = $row->getItemName(); } } //Generate Batch Number Combo $stock_batch = new Model_StockBatch(); $result = $stock_batch->getBatches(); $this->_list["stock_batch_id"][''] = "Select Stock Batch"; if ($result) { foreach ($result as $row) { $this->_list["stock_batch_id"][$row['pkId']] = $row['number']; } } //Generate Location Combo $non_ccm_loc = new Model_NonCcmLocations(); $result = $non_ccm_loc->getLocationsName(); // print_r($result);exit; $this->_list["location"][''] = "Select Location"; if ($result) { foreach ($result as $row) { $this->_list["location"][$row['pkId']] = $row['locationName']; } } foreach ($this->_fields as $col => $name) { switch ($col) { case "item_pack_size_id": case "stock_batch_id": case "number": case "unallocated_quantity": case "total_quantity": case "quantity": case "estimated_pallet_filled": $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; case "location": case "quantity1": $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; } foreach ($this->_hidden as $col => $name) { switch ($col) { case "placement_location_id": case "itemId": case "batchId": $this->addElement("hidden", $col); $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, "multiOptions" => $this->_list[$col], "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"); } } }
function transferStockAction() { $this->_helper->layout->setLayout("ajax"); $form = new Form_TransferStock(); $form->addHidden(); $form->readFields(); $placement = new Model_Placements(); $non_ccm_loc = new Model_NonCcmLocations(); $placement_id = $this->_request->getParam('placement_id'); $bin_id = $this->_request->getParam('bin_id'); $quantity_per_pack = $this->_request->getParam('quantity_per_pack'); $totqty = $this->_request->getParam('totqty'); $area = $this->_request->getParam('area'); $level = $this->_request->getParam('level'); $placement = $this->_em->find("PlacementSummary", $placement_id); $batch_numer = $placement->getStockBatch()->getNumber(); $item_name = $placement->getStockBatch()->getStakeholderItemPackSize()->getItemPackSize()->getItemName(); $non_ccm_id = $non_ccm_loc->getNonCcmLocationId($bin_id); $form->item_pack_size_id->setValue($item_name); $form->stock_batch_id->setValue($batch_numer); $form->id->setValue($placement_id); $form->totqty->setValue($totqty); $this->view->form = $form; $this->view->bin_id = $bin_id; $this->view->non_ccm_id = $non_ccm_id; $this->view->quantity_per_pack = $quantity_per_pack; $this->view->totqty = $totqty; $this->view->area = $area; $this->view->level = $level; }
public function ajaxGetPlacementLocationsAction() { $this->_helper->layout->disableLayout(); $detail_id = $this->_request->id; $p = $this->_request->p; $stock_master = new Model_StockMaster(); $stock_master->form_values['$detail_id'] = $detail_id; $result = $stock_master->getIssueDetail(); $item_category_id = $result['item_category_id']; if ($item_category_id == 1) { $cold_chain_loc = new Model_ColdChain(); $ccm_locations = $cold_chain_loc->getLocationsName(); $this->view->locations = $ccm_locations; } else { $non_ccm_loc = new Model_NonCcmLocations(); $non_ccm_locations = $non_ccm_loc->getLocationsName(); $this->view->locations = $non_ccm_locations; } $this->view->item_cat_id = $item_category_id; $this->view->result = $result; $this->view->p = $p; $this->view->detail_id = $detail_id; }