public function editmedicinedataAction()
 {
     $values = $this->_request->getParams();
     $RequestMedicineModel = new RequestmedicineModel();
     $SupplyStockModel = new SupplyStockModel();
     $SupplyModel = new SupplyModel();
     $RequestMedicineModel->getAdapter()->beginTransaction();
     try {
         if ($values['oper'] == 'del') {
             if (isset($values['nrstockdiscount'])) {
                 $cdsupply = $SupplyModel->fetchRow($SupplyModel->getCdSupplyByRequestMedicine($values['id']));
                 $qtquantitySupplyStock = $SupplyStockModel->fetchRow("cdsupply = " . $cdsupply['cdsupply']);
                 $qtquantitySupply = $SupplyModel->fetchRow("cdsupply = " . $cdsupply['cdsupply']);
                 $stockReturn = $values['nrstockdiscount'];
                 if ($stockReturn != null && $stockReturn != '') {
                     $SupplyStockModel->update(array("qtquantity" => $qtquantitySupplyStock['qtquantity'] + $stockReturn, "qtsupplybalance" => $qtquantitySupplyStock['qtsupplybalance'] + $stockReturn), "cdsupply = " . $cdsupply['cdsupply']);
                     $SupplyModel->update(array("qtbalance" => $qtquantitySupply['qtbalance'] + $stockReturn), "cdsupply = " . $cdsupply['cdsupply']);
                 }
             }
             $RequestMedicineModel->delete("cdrequestmedicine = " . $values['id']);
         }
         $RequestMedicineModel->getAdapter()->commit();
     } catch (exception $e) {
         $RequestMedicineModel->getAdapter()->rollback();
     }
 }