<?php
namespace console\controllers;


use yii\console\Controller;
use frontend\models\ContractForm;
use common\models\TicketType;
use common\models\Customer;
use common\models\Transfer;


class DetstaConsoleController  extends Controller{
	

	public function actionCreateContract(){

		
		$contractForm = new ContractForm(
			[
				'idAccount' => 1,
				'idUser' => 1
			]		
		);
		
		$customer = Customer::findOne(5559);
		$contractForm->customer = $customer;
		$contractForm->payment_method = Transfer::PAYMENT_METHOD_TRANSFER;
		
		
		$contractForm->ticketType = TicketType::find()->andWhere(['status' => TicketType::STATUS_ACTIVE ,'installment_enabled' => '1'])->one();
		
		
		$start = new \DateTime();
		$startString = $start->format("'Y-m-d");
		
		
		$contractForm->make();
		
	}
	
	
	
}