Beispiel #1
0
 /**
  * Delete sales
  * @param integer|string $id
  * @param MSales $model
  * @throws ServerErrorHttpException
  */
 public function delete($id, $model = null)
 {
     $model = $model ?: $this->findModel($id);
     if ($model->status != MSales::STATUS_DRAFT) {
         throw new ServerErrorHttpException('Document can not be update');
     }
     parent::delete($id, $model);
 }
Beispiel #2
0
 /**
  * 
  * @param type $id
  * @param \biz\core\inventory\models\Transfer $model
  * @throws ServerErrorHttpException
  */
 public function delete($id, $model = null)
 {
     /* @var $model MTransfer */
     $model = $model ?: $this->findModel($id);
     if ($model->status != MTransfer::STATUS_DRAFT) {
         throw new ServerErrorHttpException('Document can not be delete');
     }
     parent::delete($id, $model);
 }