From 1d063608a06512e13895bc52f49adfdb7e6321b5 Mon Sep 17 00:00:00 2001 From: franknstayn Date: Sat, 31 Oct 2020 21:32:01 +0800 Subject: [PATCH] added qr on reports --- .../Controllers/admin/AdminController.php | 1 - app/Models/admin/AdminModel.php | 2 +- .../views/admin_pages/print_order.blade.php | 23 ++++++++++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/admin/AdminController.php b/app/Http/Controllers/admin/AdminController.php index a37cc8c..e8910bb 100644 --- a/app/Http/Controllers/admin/AdminController.php +++ b/app/Http/Controllers/admin/AdminController.php @@ -68,7 +68,6 @@ class AdminController extends Controller $item_thumbs = $AdminModel->selectDisplayItemThumb(); $array_payment_details = $AdminModel->selectPaymentDetails('CartKey', $ck); $array_shipping_add = $AdminModel->selectShippingAddress('PaymentDetail_Id', $array_payment_details[0]->Id); - return view('admin_pages.print_order') ->with('array_payment_details', $array_payment_details) ->with('img_thumb', $item_thumbs) diff --git a/app/Models/admin/AdminModel.php b/app/Models/admin/AdminModel.php index 67d2b0b..1e781c1 100644 --- a/app/Models/admin/AdminModel.php +++ b/app/Models/admin/AdminModel.php @@ -38,7 +38,7 @@ class AdminModel extends Model function itemGroup($cartKey){ $pdo = DB::connection()->getPdo(); - $query = $pdo->prepare("SELECT *, COUNT(Id) AS qty, Price * SUM(Quantity) AS total_price FROM orders WHERE CartKey = :ck GROUP BY ProductId"); + $query = $pdo->prepare("SELECT orders.*, COUNT(orders.Id) AS qty, orders.Price * SUM(orders.Quantity) AS total_price, teamstores.StoreName FROM orders LEFT JOIN teamstores on teamstores.Id = orders.StoreId WHERE CartKey = :ck GROUP BY ProductId"); $query->execute([':ck'=>$cartKey]); $row = $query->fetchAll(\PDO::FETCH_OBJ); return $row; diff --git a/resources/views/admin_pages/print_order.blade.php b/resources/views/admin_pages/print_order.blade.php index d4d358f..3072a9b 100644 --- a/resources/views/admin_pages/print_order.blade.php +++ b/resources/views/admin_pages/print_order.blade.php @@ -353,8 +353,9 @@ /* this affects the margin in the printer settings */ /* top - right - bottom - left */ - margin: 10mm 5mm 1mm 5mm; + margin: 10mm 5mm 1mm 5mm; } + @@ -374,6 +375,17 @@

Order Details

+ + + + + +
+ QRCode + + QRCode +
+
@@ -437,7 +449,11 @@ @endforeach
Payer Information - +

Store: {{ $item->StoreName }}

+
+ Total Price: ${{ $item->total_price }} • Row(s): {{ $item->qty }} @if($item->FormUsed=="jersey-and-shorts-form") @@ -524,6 +540,7 @@ @if($item->FormUsed=="jersey-and-shorts-form") + @@ -631,7 +648,7 @@
@if($sub_item->Name != '') {{ $sub_item->Name }} @else -- @endif {{ $sub_item->Number }} {{ $sub_item->JerseySize }}
- Copyright © 2019 crewsportswear.com. All rights reserved. + Copyright © {{ date('Y') }} crewsportswear.com. All rights reserved.