Esempio n. 1
0
 public function deleteAction()
 {
     $this->_helper->viewRenderer->setNoRender();
     $this->_helper->getHelper('layout')->disableLayout();
     if ($this->getRequest()->isPost()) {
         $id = $this->_getParam('id', 0);
         $creditnote = new Sales_Model_DbTable_Creditnote();
         $creditnote->deleteCreditnote($id);
         $positions = $this->getPositions($id);
         $positionsDb = new Sales_Model_DbTable_Creditnotepos();
         foreach ($positions as $position) {
             $positionsDb->deletePosition($position->id);
         }
     }
     $this->_flashMessenger->addMessage('MESSAGES_SUCCESFULLY_DELETED');
 }