add hidden account, cart insert/delete

add hidden account support
add delete/payout buttons to carts
add backend product sales with pdf export
add frontend product sales with pdf export
add frontend ticket sales with pdf export
This commit is contained in:
2016-01-03 18:29:39 +01:00
parent 62bcb7ff27
commit 595f663820
43 changed files with 2154 additions and 24 deletions

View File

@@ -187,18 +187,27 @@ class ProductSaleForm extends Model
protected function saveTransfer(){
$customer = null;
$paid_at;
$status = Transfer::STATUS_PAID;
if ( $this->isAppendToUserCart() ){
$status = Transfer::STATUS_NOT_PAID;
}else if ( $this->isAppendToCustomerCart() ){
$status = Transfer::STATUS_NOT_PAID;
$customer = $this->customer;
}else{
$paid_at = date('Y-m-d H:i:s' ) ;
}
$this->transfer = Transfer::createProductTransfer($this->sale,$this->account, $this->discount, $this->currency, $this->count, $this->product,$status,$customer);
if ( isset($this->comment)){
$this->transfer->comment = $this->comment;
}
if ( isset($paid_at)){
$this->transfer->paid_at = $paid_at;
}
$this->transfer->id_user = Yii::$app->user->id;
$this->transfer->save();
}