add transaction/summary, fix transaction/index, add reception product typeahead

This commit is contained in:
2015-12-29 22:22:11 +01:00
parent 3b2f19b909
commit 6eb0e69b1b
20 changed files with 535 additions and 8 deletions

View File

@@ -42,7 +42,7 @@ class ProductController extends Controller
],
'access' => [
'class' => \yii\filters\AccessControl::className(),
'only' => [ 'sale','payout-customer-cart','payout-user-cart', 'lookup'],
'only' => [ 'sale','payout-customer-cart','payout-user-cart', 'lookup','find'],
'rules' => [
// allow authenticated users
[
@@ -82,6 +82,11 @@ class ProductController extends Controller
$model->customer = $this->customer;
$model->card = $this->card;
$products = Product::read();
$products = Product::modelToMapIdName($products);
$model->products = $products;
if (Yii::$app->request->isAjax) {
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
@@ -203,6 +208,23 @@ class ProductController extends Controller
return $result;
}
/**
*/
public function actionFind($id=null)
{
$result = [];
$product = Product::findOne($id);
$product = Product::modelToArray($product);
$result['product'] = $product;
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
return $result;
}