add contract controller(s) changes
This commit is contained in:
parent
dd0d6c50c9
commit
792d0caab5
@ -60,11 +60,13 @@ class ContractController extends Controller {
|
|||||||
'dataProvider' => $dataProvider
|
'dataProvider' => $dataProvider
|
||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Lists all Contract models.
|
/**
|
||||||
*
|
* Lists all Contract models.
|
||||||
* @return mixed
|
*
|
||||||
*/
|
* @return mixed
|
||||||
|
* @throws NotFoundHttpException
|
||||||
|
*/
|
||||||
public function actionIndexCustomer($id) {
|
public function actionIndexCustomer($id) {
|
||||||
$model = Customer::findOne ( $id );
|
$model = Customer::findOne ( $id );
|
||||||
|
|
||||||
@ -82,13 +84,14 @@ class ContractController extends Controller {
|
|||||||
'dataProvider' => $dataProvider
|
'dataProvider' => $dataProvider
|
||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a single Contract model.
|
* Displays a single Contract model.
|
||||||
*
|
*
|
||||||
* @param integer $id
|
* @param integer $id
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
* @throws NotFoundHttpException
|
||||||
|
*/
|
||||||
public function actionView($id) {
|
public function actionView($id) {
|
||||||
return $this->render ( 'view', [
|
return $this->render ( 'view', [
|
||||||
'model' => $this->findModel ( $id )
|
'model' => $this->findModel ( $id )
|
||||||
@ -115,14 +118,15 @@ class ContractController extends Controller {
|
|||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates an existing Contract model.
|
* Updates an existing Contract model.
|
||||||
* If update is successful, the browser will be redirected to the 'view' page.
|
* If update is successful, the browser will be redirected to the 'view' page.
|
||||||
*
|
*
|
||||||
* @param integer $id
|
* @param integer $id
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
* @throws NotFoundHttpException
|
||||||
|
*/
|
||||||
public function actionUpdate($id) {
|
public function actionUpdate($id) {
|
||||||
$model = $this->findModel ( $id );
|
$model = $this->findModel ( $id );
|
||||||
|
|
||||||
@ -217,7 +221,13 @@ class ContractController extends Controller {
|
|||||||
'index'
|
'index'
|
||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
public function actionDetails($id) {
|
|
||||||
|
/**
|
||||||
|
* @param $id
|
||||||
|
* @return string
|
||||||
|
* @throws NotFoundHttpException
|
||||||
|
*/
|
||||||
|
public function actionDetails($id) {
|
||||||
$contract = Contract::findOne ( $id );
|
$contract = Contract::findOne ( $id );
|
||||||
// ticket_installment_request
|
// ticket_installment_request
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace backend\models;
|
namespace backend\models;
|
||||||
|
|
||||||
|
use common\components\Helper;
|
||||||
use Yii;
|
use Yii;
|
||||||
use yii\base\Model;
|
use yii\base\Model;
|
||||||
use yii\data\ActiveDataProvider;
|
use yii\data\ActiveDataProvider;
|
||||||
@ -15,6 +16,7 @@ class ContractSearch extends Contract
|
|||||||
{
|
{
|
||||||
|
|
||||||
public $customer_name;
|
public $customer_name;
|
||||||
|
public $card_number;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
@ -23,7 +25,7 @@ class ContractSearch extends Contract
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[['id_contract', 'id_customer', 'status', 'flag', 'part_paid', 'part_count', 'part_required', 'id_ticket_type'], 'integer'],
|
[['id_contract', 'id_customer', 'status', 'flag', 'part_paid', 'part_count', 'part_required', 'id_ticket_type'], 'integer'],
|
||||||
[['customer_name' ], 'safe'],
|
[['customer_name' ,'card_number'], 'safe'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,7 +67,8 @@ class ContractSearch extends Contract
|
|||||||
$query->from('contract');
|
$query->from('contract');
|
||||||
$query->innerJoin('user' ,'user.id = contract.id_user');
|
$query->innerJoin('user' ,'user.id = contract.id_user');
|
||||||
$query->innerJoin('customer' ,'customer.id_customer = contract.id_customer');
|
$query->innerJoin('customer' ,'customer.id_customer = contract.id_customer');
|
||||||
|
$query->leftJoin('card as card' ,'card.id_card = customer.id_customer_card');
|
||||||
|
|
||||||
|
|
||||||
$dataProvider = new ActiveDataProvider([
|
$dataProvider = new ActiveDataProvider([
|
||||||
'query' => $query,
|
'query' => $query,
|
||||||
@ -133,6 +136,9 @@ class ContractSearch extends Contract
|
|||||||
// $query->where('0=1');
|
// $query->where('0=1');
|
||||||
return $dataProvider;
|
return $dataProvider;
|
||||||
}
|
}
|
||||||
|
if ( isset($this->card_number)){
|
||||||
|
$this->card_number = Helper::fixAsciiChars($this->card_number);
|
||||||
|
}
|
||||||
|
|
||||||
$query->andFilterWhere([
|
$query->andFilterWhere([
|
||||||
'contract.id_contract' => $this->id_contract,
|
'contract.id_contract' => $this->id_contract,
|
||||||
@ -147,6 +153,7 @@ class ContractSearch extends Contract
|
|||||||
'contract.created_at' => $this->created_at,
|
'contract.created_at' => $this->created_at,
|
||||||
'contract.updated_at' => $this->updated_at,
|
'contract.updated_at' => $this->updated_at,
|
||||||
'contract.id_ticket_type' => $this->id_ticket_type,
|
'contract.id_ticket_type' => $this->id_ticket_type,
|
||||||
|
'card.number' => $this->card_number,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$query->andFilterWhere(['like', 'customer.name', $this->customer_name]);
|
$query->andFilterWhere(['like', 'customer.name', $this->customer_name]);
|
||||||
|
|||||||
@ -26,6 +26,7 @@ use yii\widgets\ActiveForm;
|
|||||||
<?= $form->field($model, 'customer_name')->label('Vendég neve') ?>
|
<?= $form->field($model, 'customer_name')->label('Vendég neve') ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
|
<?= $form->field($model, 'card_number')->label('Kártyaszám') ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,7 @@ use common\components\Helper;
|
|||||||
* @property string $original_end;
|
* @property string $original_end;
|
||||||
*
|
*
|
||||||
* @property \common\models\Card card
|
* @property \common\models\Card card
|
||||||
|
* @property \common\models\Ticket transfer
|
||||||
*/
|
*/
|
||||||
class Ticket extends \common\models\BaseFitnessActiveRecord
|
class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||||
{
|
{
|
||||||
|
|||||||
@ -135,14 +135,6 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
|||||||
$started_at = $contract->started_at;
|
$started_at = $contract->started_at;
|
||||||
$date = \DateTime::createFromFormat("Y-m-d H:i:s", $started_at, new \DateTimeZone( 'UTC'));
|
$date = \DateTime::createFromFormat("Y-m-d H:i:s", $started_at, new \DateTimeZone( 'UTC'));
|
||||||
$date = DateUtil::addMonth( $date,$this->priority + 1 );
|
$date = DateUtil::addMonth( $date,$this->priority + 1 );
|
||||||
// $date = \DateTime::createFromFormat("Y-m-d H:i:s", $this->request_target_time_at, new \DateTimeZone( 'UTC'));
|
|
||||||
// $date = DateUtil::addMonth( $date, 1 );
|
|
||||||
// $date->modify("+1 month");
|
|
||||||
// $date->modify("-1 day");
|
|
||||||
|
|
||||||
// $date = \DateTime::createFromFormat("Y-m-d H:i:s", $this->request_target_time_at, new \DateTimeZone( 'UTC'));
|
|
||||||
// $date->modify("+1 month");
|
|
||||||
// $date->modify("-1 day");
|
|
||||||
|
|
||||||
$date->setTime(0, 0, 0);
|
$date->setTime(0, 0, 0);
|
||||||
|
|
||||||
@ -201,7 +193,6 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
|||||||
if ( $status == static::$STATUS_ACCEPTED || $status == static::$STATUS_ACCEPTED_MANUAL){
|
if ( $status == static::$STATUS_ACCEPTED || $status == static::$STATUS_ACCEPTED_MANUAL){
|
||||||
if ( !$this->isStatusAccepted() ){
|
if ( !$this->isStatusAccepted() ){
|
||||||
$contract->part_paid = $contract->part_paid +1;
|
$contract->part_paid = $contract->part_paid +1;
|
||||||
// $tranfer = $this->addTransfer();
|
|
||||||
$result = Transfer::sellContractTicket($contract, $this, Account::findOne(1), Transfer::STATUS_PAID, Transfer::PAYMENT_METHOD_TRANSFER);
|
$result = Transfer::sellContractTicket($contract, $this, Account::findOne(1), Transfer::STATUS_PAID, Transfer::PAYMENT_METHOD_TRANSFER);
|
||||||
$transfer = $result[0];
|
$transfer = $result[0];
|
||||||
$ticket = $result[1];
|
$ticket = $result[1];
|
||||||
@ -236,15 +227,6 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// protected function applyNewTicketState($partRequired = false){
|
|
||||||
// if ( $partRequired ){
|
|
||||||
// $this->ticket->setPartRequired($this);
|
|
||||||
// }
|
|
||||||
// $this->ticket->applyTicketInstallmentRequest($this);
|
|
||||||
// $this->ticket->save(false);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Transfer
|
* @return Transfer
|
||||||
*/
|
*/
|
||||||
@ -340,7 +322,11 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
|||||||
TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL=> 'Személyesen fizetve',
|
TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL=> 'Személyesen fizetve',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $id_status
|
||||||
|
* @return mixed|string
|
||||||
|
*/
|
||||||
public static function toStatusName($id_status){
|
public static function toStatusName($id_status){
|
||||||
$result = "Ismeretlen";
|
$result = "Ismeretlen";
|
||||||
$statuses = TicketInstallmentRequest::statuses();
|
$statuses = TicketInstallmentRequest::statuses();
|
||||||
@ -349,7 +335,10 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
|||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed|string
|
||||||
|
*/
|
||||||
public function getStatusName(){
|
public function getStatusName(){
|
||||||
return static::toStatusName($this->status);
|
return static::toStatusName($this->status);
|
||||||
}
|
}
|
||||||
|
|||||||
164
console/controllers/ContractController.php
Normal file
164
console/controllers/ContractController.php
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace console\controllers;
|
||||||
|
|
||||||
|
use common\models\Card;
|
||||||
|
use common\models\Contract;
|
||||||
|
use common\models\Customer;
|
||||||
|
use common\models\ShoppingCart;
|
||||||
|
use common\models\Ticket;
|
||||||
|
use common\models\TicketInstallmentRequest;
|
||||||
|
use common\models\Transfer;
|
||||||
|
use yii\console\Controller;
|
||||||
|
use yii\console\Exception;
|
||||||
|
|
||||||
|
class ContractController extends Controller
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $cardNumber
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \yii\db\Exception
|
||||||
|
*/
|
||||||
|
public function actionRestoreCanceled($cardNumber)
|
||||||
|
{
|
||||||
|
|
||||||
|
$card = Card::findOne(['number' => $cardNumber]);
|
||||||
|
if (!isset($card)) {
|
||||||
|
throw new Exception("Card not found: " . $cardNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info("Card loaded");
|
||||||
|
$this->info($card->id_card);
|
||||||
|
$this->info($card->number);
|
||||||
|
|
||||||
|
$customer = Customer::findOne(['id_customer_card' => $card->id_card]);
|
||||||
|
if (!isset($customer)) {
|
||||||
|
throw new Exception("Customer not found for card: " . $cardNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info("Customer loaded");
|
||||||
|
$this->info($customer->id_customer);
|
||||||
|
$this->info($customer->name);
|
||||||
|
|
||||||
|
|
||||||
|
// find latest contract for customer
|
||||||
|
/** @var \common\models\Contract $contract */
|
||||||
|
$contract = Contract::find()
|
||||||
|
->andWhere(['id_customer' => $customer->id_customer])
|
||||||
|
->orderBy(['created_at' => SORT_DESC])
|
||||||
|
->limit(1)
|
||||||
|
->one();
|
||||||
|
|
||||||
|
if (!isset($contract)) {
|
||||||
|
throw new Exception("Contract not found for customer: " . $customer->id_customer);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info("Contract loaded");
|
||||||
|
$this->info($contract->id_contract);
|
||||||
|
$this->info(Contract::toFlangName($contract->flag));
|
||||||
|
|
||||||
|
$parts = TicketInstallmentRequest::findAll(['id_contract' => $contract->id_contract]);
|
||||||
|
$this->info("Parts loaded");
|
||||||
|
|
||||||
|
$tx = \Yii::$app->db->beginTransaction();
|
||||||
|
try {
|
||||||
|
if (!$contract->isFlagActive()) {
|
||||||
|
$contract->flag = Contract::$FLAG_ACTIVE;
|
||||||
|
$I_CONTRACT = "Contract - change flag " . Contract::toStatusName($contract->flag) . "=>" .
|
||||||
|
Contract::toStatusName(Contract::$FLAG_ACTIVE);
|
||||||
|
$contract->save(false);
|
||||||
|
$this->info($I_CONTRACT);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($parts as $part) {
|
||||||
|
$this->info("Part #" . $part->priority);
|
||||||
|
if ($part->status == TicketInstallmentRequest::$STATUS_CANCELED) {
|
||||||
|
$part->status = TicketInstallmentRequest::$STATUS_PENDING;
|
||||||
|
$part->request_processed_at = null;
|
||||||
|
$part->save(false);
|
||||||
|
$this->info( "Change status: "
|
||||||
|
. TicketInstallmentRequest::toStatusName(TicketInstallmentRequest::$STATUS_CANCELED)
|
||||||
|
. "->"
|
||||||
|
. TicketInstallmentRequest::toStatusName(TicketInstallmentRequest::$STATUS_PENDING)
|
||||||
|
);
|
||||||
|
} else if ($part->isStatusAccepted()) {
|
||||||
|
/** @var \common\models\Ticket $ticket */
|
||||||
|
$ticket = $part->ticket;
|
||||||
|
if ($ticket->status == Ticket::STATUS_DELETED) {
|
||||||
|
$ticket->status = Ticket::STATUS_ACTIVE;
|
||||||
|
$ticket->save(false);
|
||||||
|
$this->info( "Ticket restored: ");
|
||||||
|
$this->info( $ticket->id_ticket );
|
||||||
|
$this->info( Ticket::toStatusName(Ticket::STATUS_DELETED)
|
||||||
|
. "->"
|
||||||
|
. Ticket::toStatusName(Ticket::STATUS_ACTIVE)
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
/** @var \common\models\Transfer $transfer */
|
||||||
|
$transfer = $ticket->transfer;
|
||||||
|
if ($transfer->status == Transfer::STATUS_STORNO) {
|
||||||
|
$transfer->status = Transfer::STATUS_PAID;
|
||||||
|
$transfer->save(false);
|
||||||
|
|
||||||
|
$this->info( "Restore transfer: ");
|
||||||
|
$this->info( $transfer->id_transfer);
|
||||||
|
$this->info( Transfer::toStatusName(Transfer::STATUS_STORNO)
|
||||||
|
. "->"
|
||||||
|
. Ticket::toStatusName(Transfer::STATUS_PAID)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!isset($transfer->paid_at)) {
|
||||||
|
$cart = new ShoppingCart();
|
||||||
|
$cart->id_customer = $contract->customer->id_customer;
|
||||||
|
$cart->id_transfer = $transfer->id_transfer;
|
||||||
|
if (!$cart->save(false)) {
|
||||||
|
/** @noinspection SpellCheckingInspection */
|
||||||
|
$E_FAILED_TO_SAVE = "Vendég kosár hozzárendelés sikertelen!";
|
||||||
|
\Yii::error($E_FAILED_TO_SAVE);
|
||||||
|
throw new \Exception($E_FAILED_TO_SAVE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$tx->commit();
|
||||||
|
$this->info("Ready");
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
$tx->rollBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function info($msg)
|
||||||
|
{
|
||||||
|
echo $msg . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \common\models\Contract $contract
|
||||||
|
* @param \common\models\TicketInstallmentRequest[] $parts
|
||||||
|
*/
|
||||||
|
private function log($contract, $parts)
|
||||||
|
{
|
||||||
|
|
||||||
|
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
|
||||||
|
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
|
||||||
|
|
||||||
|
foreach ($contract->getAttributes() as $key => $value) {
|
||||||
|
echo $key . "=" . $value . ";";
|
||||||
|
}
|
||||||
|
echo "\n";
|
||||||
|
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n";
|
||||||
|
foreach ($parts as $part) {
|
||||||
|
echo "----------------------------------------------------------------------\n";
|
||||||
|
foreach ($part->getAttributes() as $key => $value) {
|
||||||
|
echo $key . "=" . $value . ";";
|
||||||
|
}
|
||||||
|
echo "\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -65,13 +65,14 @@ class ContractController extends Controller {
|
|||||||
'dataProvider' => $dataProvider
|
'dataProvider' => $dataProvider
|
||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a single Contract model.
|
* Displays a single Contract model.
|
||||||
*
|
*
|
||||||
* @param integer $id
|
* @param integer $id
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
* @throws NotFoundHttpException
|
||||||
|
*/
|
||||||
public function actionView($id) {
|
public function actionView($id) {
|
||||||
$model = $this->findModel ( $id );
|
$model = $this->findModel ( $id );
|
||||||
$customer = $model->customer;
|
$customer = $model->customer;
|
||||||
@ -110,14 +111,15 @@ class ContractController extends Controller {
|
|||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates an existing Contract model.
|
* Updates an existing Contract model.
|
||||||
* If update is successful, the browser will be redirected to the 'view' page.
|
* If update is successful, the browser will be redirected to the 'view' page.
|
||||||
*
|
*
|
||||||
* @param integer $id
|
* @param integer $id
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
* @throws NotFoundHttpException
|
||||||
|
*/
|
||||||
public function actionUpdate($id) {
|
public function actionUpdate($id) {
|
||||||
$model = $this->findModel ( $id );
|
$model = $this->findModel ( $id );
|
||||||
|
|
||||||
@ -132,14 +134,16 @@ class ContractController extends Controller {
|
|||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes an existing Contract model.
|
* Deletes an existing Contract model.
|
||||||
* If deletion is successful, the browser will be redirected to the 'index' page.
|
* If deletion is successful, the browser will be redirected to the 'index' page.
|
||||||
*
|
*
|
||||||
* @param integer $id
|
* @param integer $id
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
* @throws NotFoundHttpException
|
||||||
|
* @throws \yii\db\StaleObjectException
|
||||||
|
*/
|
||||||
public function actionDelete($id) {
|
public function actionDelete($id) {
|
||||||
$this->findModel ( $id )->delete ();
|
$this->findModel ( $id )->delete ();
|
||||||
|
|
||||||
@ -196,10 +200,15 @@ class ContractController extends Controller {
|
|||||||
'id' => $contract->id_contract
|
'id' => $contract->id_contract
|
||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* EGY RÉSZLET KIFIZETÉSE
|
* Cancel contract.
|
||||||
*/
|
* @param $id
|
||||||
|
* @param $flag
|
||||||
|
* @return \yii\web\Response
|
||||||
|
* @throws NotFoundHttpException
|
||||||
|
* @throws \yii\db\Exception
|
||||||
|
*/
|
||||||
public function actionCancel($id,$flag) {
|
public function actionCancel($id,$flag) {
|
||||||
$contract = $this->findModel ( $id );
|
$contract = $this->findModel ( $id );
|
||||||
|
|
||||||
@ -235,7 +244,8 @@ class ContractController extends Controller {
|
|||||||
$productBuntetes = Product::find ()->andWhere ( [
|
$productBuntetes = Product::find ()->andWhere ( [
|
||||||
'product_number' => Product::$BUNTETES
|
'product_number' => Product::$BUNTETES
|
||||||
] )->one ();
|
] )->one ();
|
||||||
|
|
||||||
|
// if there is a fee , generate fee and put it to the shopping cart
|
||||||
if (isset ( $productBuntetes )) {
|
if (isset ( $productBuntetes )) {
|
||||||
if ($buntetes > 0) {
|
if ($buntetes > 0) {
|
||||||
|
|
||||||
@ -286,7 +296,12 @@ class ContractController extends Controller {
|
|||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionMake($id) {
|
/**
|
||||||
|
* @param $id
|
||||||
|
* @return string|\yii\web\Response
|
||||||
|
* @throws \yii\db\Exception
|
||||||
|
*/
|
||||||
|
public function actionMake($id) {
|
||||||
$customer = Customer::findOne ( $id );
|
$customer = Customer::findOne ( $id );
|
||||||
|
|
||||||
if (! isset ( $customer )) {
|
if (! isset ( $customer )) {
|
||||||
@ -326,8 +341,13 @@ class ContractController extends Controller {
|
|||||||
'model' => $model
|
'model' => $model
|
||||||
] );
|
] );
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionContract($id){
|
/**
|
||||||
|
* @param $id
|
||||||
|
* @throws NotFoundHttpException
|
||||||
|
* @throws \yii\base\InvalidConfigException
|
||||||
|
*/
|
||||||
|
public function actionContract($id){
|
||||||
$model = $this->findModel($id);
|
$model = $this->findModel($id);
|
||||||
|
|
||||||
//$mpdf=new \mPDF('utf-8', 'A4');
|
//$mpdf=new \mPDF('utf-8', 'A4');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user