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

@@ -11,6 +11,9 @@ use common\models\Account;
use common\models\User;
use backend\models\TransferSummarySearch;
use backend\models\TransferListSearch;
use backend\models\TransferSaleSearch;
use common\models\ProductCategory;
use common\models\Product;
/**
* TransferController implements the CRUD actions for Transfer model.
@@ -25,7 +28,7 @@ class TransferController extends \backend\controllers\BackendController
'rules' => [
// allow authenticated users
[
'actions' => [ 'index','view','summary','list' ],
'actions' => [ 'index','view','summary','list',"sale","sale-pdf" ],
'allow' => true,
'roles' => ['admin','employee','reception'],
],
@@ -78,6 +81,46 @@ class TransferController extends \backend\controllers\BackendController
}
/**
* Lists all Transfer models.
* @return mixed
*/
public function actionSale()
{
$searchModel = new TransferSaleSearch();
$searchModel->accounts = Account::read();
$searchModel->users = User::read();
$searchModel->productCategories = ProductCategory::read();
$searchModel->productOptions = Product::read();
$searchModel->search(Yii::$app->request->queryParams);
return $this->render('sale', [
'searchModel' => $searchModel,
]);
}
public function actionSalePdf(){
$searchModel = new TransferSaleSearch();
$searchModel->accounts = Account::read();
$searchModel->users = User::read();
$searchModel->productCategories = ProductCategory::read();
$searchModel->productOptions = Product::read();
$searchModel->search(Yii::$app->request->queryParams);
$mpdf=new \mPDF('utf-8', 'A4-L');
$mpdf->WriteHTML($this->renderPartial('_result_sale', [
'searchModel' => $searchModel,
]));
$mpdf->Output('MyPDF.pdf', 'D');
exit;
}
/**
* Lists all Transfer models.
* @return mixed