add conctract flag canceled2

This commit is contained in:
2016-04-21 21:08:33 +02:00
parent b886e1cc74
commit 6a5cf48217
5 changed files with 38 additions and 14 deletions

View File

@@ -199,8 +199,15 @@ class ContractController extends Controller {
/**
* EGY RÉSZLET KIFIZETÉSE
*/
public function actionCancel($id) {
public function actionCancel($id,$flag) {
$contract = $this->findModel ( $id );
if ( $flag != Contract::$FLAG_CANCELED && $flag != Contract::$FLAG_CANCELED_2){
\Yii::error("A felmondási státusz nem található! ($flag)");
throw new NotFoundHttpException("Az oldal nem található!");
}
$customer = $contract->customer;
$card = $customer->card;
@@ -209,7 +216,7 @@ class ContractController extends Controller {
$transaction = $connection->beginTransaction ();
try {
$contract->flag = Contract::$FLAG_CANCELED;
$contract->flag = $flag;
$contract->save ();
$requests = $contract->requests;
$buntetes = 0;