public function placementStockAction() { $this->_helper->layout->disableLayout(); $this->_helper->viewRenderer->setNoRender(TRUE); $placement = new Placements(); $form = new Form_StockPlacement(); $form->addHidden(); if ($this->_request->isPost()) { if ($form->isValid($this->_request->getPost())) { $id = $form->id->getValue(); $stock_id = $this->_em->find('StockDetail', $id); $placement->setStockDetail($stock_id); $placement->setStockBatch($form->batch_id->getValue()); $placement->setQuantity($stock_id); $placement->setStockDetail($stock_id); $this->_em->persist($placement); $this->_em->flush(); $this->_redirect("/stock/receive-search"); } $this->view->form = $form; } $this->_redirect("/stock/stock-bin-placement"); }
public function ajaxStockBinPlacementAction() { $this->_helper->layout->setLayout('ajax'); $id = $this->_request->getParam('id', ''); $stock_batch = new Model_StockBatch(); $form = new Form_StockPlacement(); $form->addHidden(); $stock_batch->form_values['stock_detail'] = $id; $data = $stock_batch->getStockBatchAndDetailById(); $this->view->data = $data; $data['placed_quantity'] = 0; $this->view->data['placed_quantity'] = $data['placed_quantity']; $this->view->data['remaining_quantity'] = $data['quantity'] - $data['placed_quantity']; $this->view->form = $form; }