add payment method
This commit is contained in:
@@ -78,14 +78,16 @@ class ProductSaleForm extends Model
|
||||
|
||||
public $products;
|
||||
|
||||
public $payment_method;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_product','count','id_account'], 'required'],
|
||||
[['id_product','id_currency','id_account', 'id_discount','count'], 'integer'],
|
||||
[['id_product','count','id_account','payment_method'], 'required'],
|
||||
[['id_product','id_currency','id_account', 'id_discount','count','payment_method'], 'integer'],
|
||||
[['comment'], 'string' ,'max' => 255],
|
||||
[['cart'], 'string' ,'max' => 20],
|
||||
[['id_product' ], 'validateProduct'],
|
||||
@@ -108,6 +110,7 @@ class ProductSaleForm extends Model
|
||||
'id_account' => Yii::t("frontend/product", "Account"),
|
||||
'id_discount' => Yii::t("frontend/product", "Discount"),
|
||||
'comment' => Yii::t("frontend/product", "Comment"),
|
||||
'payment_method' => Yii::t('common/transfer', 'Fizetési mód'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -199,6 +202,7 @@ class ProductSaleForm extends Model
|
||||
}
|
||||
|
||||
$this->transfer = Transfer::createProductTransfer($this->sale,$this->account, $this->discount, $this->currency, $this->count, $this->product,$status,$customer);
|
||||
$this->transfer->payment_method = $this->payment_method;
|
||||
if ( isset($this->comment)){
|
||||
$this->transfer->comment = $this->comment;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ class TicketCreate extends Ticket{
|
||||
|
||||
public $cart;
|
||||
|
||||
public $payment_method;
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
@@ -48,6 +50,11 @@ class TicketCreate extends Ticket{
|
||||
[[ 'id_account'], 'integer'],
|
||||
[[ 'id_account'], 'validateAccount'],
|
||||
/////////////////////
|
||||
//payment_method
|
||||
/////////////////////
|
||||
[[ 'payment_method'], 'required'],
|
||||
[[ 'payment_method'], 'integer'],
|
||||
/////////////////////
|
||||
//id_discount
|
||||
/////////////////////
|
||||
[[ 'id_discount'], 'integer'],
|
||||
@@ -123,7 +130,7 @@ class TicketCreate extends Ticket{
|
||||
$transfer->paid_by = \Yii::$app->user->id;
|
||||
}
|
||||
$transfer->status = $status;
|
||||
|
||||
$transfer->payment_method = $this->payment_method;
|
||||
|
||||
if ( isset($this->comment)){
|
||||
$transfer->comment = $this->comment;
|
||||
|
||||
Reference in New Issue
Block a user