@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | use Hideyo\Ecommerce\Framework\Services\Order\OrderFacade as OrderService; |
15 | 15 | use Hideyo\Ecommerce\Framework\Services\Order\OrderStatusFacade as OrderStatusService; |
16 | 16 | use Hideyo\Ecommerce\Framework\Services\PaymentMethod\PaymentMethodFacade as PaymentMethodService; |
17 | -use Hideyo\Ecommerce\Framework\Services\SendingMethod\SendingMethodFacade as SendingMethodService;use Hideyo\Ecommerce\Framework\Services\Product\ProductFacade as ProductService; |
|
17 | +use Hideyo\Ecommerce\Framework\Services\SendingMethod\SendingMethodFacade as SendingMethodService; use Hideyo\Ecommerce\Framework\Services\Product\ProductFacade as ProductService; |
|
18 | 18 | |
19 | 19 | use Carbon\Carbon; |
20 | 20 | use Request; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | public function index() |
30 | 30 | { |
31 | - $shop = auth('hideyobackend')->user()->shop; |
|
31 | + $shop = auth('hideyobackend')->user()->shop; |
|
32 | 32 | $now = Carbon::now(); |
33 | 33 | |
34 | 34 | $revenueThisMonth = null; |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | |
59 | 59 | $datatables = \Datatables::of($order) |
60 | 60 | |
61 | - ->addColumn('generated_custom_order_id', function ($order) { |
|
61 | + ->addColumn('generated_custom_order_id', function($order) { |
|
62 | 62 | return $order->generated_custom_order_id; |
63 | 63 | }) |
64 | 64 | |
65 | - ->addColumn('created_at', function ($order) { |
|
65 | + ->addColumn('created_at', function($order) { |
|
66 | 66 | return date('d F H:i', strtotime($order->created_at)); |
67 | 67 | }) |
68 | 68 | |
69 | - ->addColumn('status', function ($order) { |
|
69 | + ->addColumn('status', function($order) { |
|
70 | 70 | if ($order->orderStatus) { |
71 | 71 | if ($order->orderStatus->color) { |
72 | 72 | return '<a href="/admin/order/'.$order->id.'" style="text-decoration:none;"><span style="background-color:'.$order->orderStatus->color.'; padding: 10px; line-height:30px; text-align:center; color:white;">'.$order->orderStatus->title.'</span></a>'; |
@@ -75,46 +75,46 @@ discard block |
||
75 | 75 | } |
76 | 76 | }) |
77 | 77 | |
78 | - ->filterColumn('client', function ($query, $keyword) { |
|
78 | + ->filterColumn('client', function($query, $keyword) { |
|
79 | 79 | |
80 | 80 | $query->where( |
81 | - function ($query) use ($keyword) { |
|
81 | + function($query) use ($keyword) { |
|
82 | 82 | $query->whereRaw("order_address.firstname like ?", ["%{$keyword}%"]); |
83 | 83 | $query->orWhereRaw("order_address.lastname like ?", ["%{$keyword}%"]); |
84 | 84 | ; |
85 | 85 | } |
86 | 86 | ); |
87 | 87 | }) |
88 | - ->addColumn('client', function ($order) { |
|
88 | + ->addColumn('client', function($order) { |
|
89 | 89 | if ($order->client) { |
90 | 90 | if ($order->orderBillAddress) { |
91 | - return '<a href="/admin/client/'.$order->client_id.'/order">'.$order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname.' ('.$order->client->orders->count() .')</a>'; |
|
91 | + return '<a href="/admin/client/'.$order->client_id.'/order">'.$order->orderBillAddress->firstname.' '.$order->orderBillAddress->lastname.' ('.$order->client->orders->count().')</a>'; |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | }) |
95 | - ->addColumn('products', function ($order) { |
|
95 | + ->addColumn('products', function($order) { |
|
96 | 96 | if ($order->products) { |
97 | 97 | return $order->products->count(); |
98 | 98 | } |
99 | 99 | }) |
100 | - ->addColumn('price_with_tax', function ($order) { |
|
100 | + ->addColumn('price_with_tax', function($order) { |
|
101 | 101 | $money = '€ '.$order->getPriceWithTaxNumberFormat(); |
102 | 102 | return $money; |
103 | 103 | }) |
104 | 104 | |
105 | 105 | |
106 | - ->addColumn('paymentMethod', function ($order) { |
|
106 | + ->addColumn('paymentMethod', function($order) { |
|
107 | 107 | if ($order->orderPaymentMethod) { |
108 | 108 | return $order->orderPaymentMethod->title; |
109 | 109 | } |
110 | 110 | }) |
111 | - ->addColumn('sendingMethod', function ($order) { |
|
111 | + ->addColumn('sendingMethod', function($order) { |
|
112 | 112 | if ($order->orderSendingMethod) { |
113 | 113 | return $order->orderSendingMethod->title; |
114 | 114 | } |
115 | 115 | }) |
116 | - ->addColumn('action', function ($order) { |
|
117 | - $deleteLink = \Form::deleteajax('/admin/order/'. $order->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
116 | + ->addColumn('action', function($order) { |
|
117 | + $deleteLink = \Form::deleteajax('/admin/order/'.$order->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
118 | 118 | $download = '<a href="/admin/order/'.$order->id.'/download" class="btn btn-default btn-sm btn-info"><i class="entypo-pencil"></i>Download</a> '; |
119 | 119 | |
120 | 120 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | |
148 | 148 | if ($data and $data['order']) { |
149 | 149 | |
150 | - if($data['type'] == 'one-pdf') { |
|
150 | + if ($data['type'] == 'one-pdf') { |
|
151 | 151 | $pdfHtml = ""; |
152 | 152 | $countOrders = count($data['order']); |
153 | 153 | $i = 0; |
@@ -173,15 +173,15 @@ discard block |
||
173 | 173 | $pdf = PDF::loadHTML($pdfHtmlBody); |
174 | 174 | |
175 | 175 | return $pdf->download('order-'.$order->generated_custom_order_id.'.pdf'); |
176 | - } elseif($data['type'] == 'product-list') { |
|
176 | + } elseif ($data['type'] == 'product-list') { |
|
177 | 177 | $products = OrderService::productsByOrderIds($data['order']); |
178 | 178 | |
179 | - if($products) { |
|
179 | + if ($products) { |
|
180 | 180 | |
181 | 181 | |
182 | - Excel::create('products', function ($excel) use ($products) { |
|
182 | + Excel::create('products', function($excel) use ($products) { |
|
183 | 183 | |
184 | - $excel->sheet('Products', function ($sheet) use ($products) { |
|
184 | + $excel->sheet('Products', function($sheet) use ($products) { |
|
185 | 185 | $newArray = array(); |
186 | 186 | foreach ($products as $key => $row) { |
187 | 187 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | if ($orders) { |
214 | 214 | Request::session()->put('print_orders', $orders->toArray()); |
215 | - return response()->json(array('orders' => $orders->toArray() )); |
|
215 | + return response()->json(array('orders' => $orders->toArray())); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | Request::session()->destroy('print_orders'); |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | public function downloadLabel($orderId) |
256 | 256 | { |
257 | 257 | $order = OrderService::find($orderId); |
258 | - if($order->orderLabel()->count()) { |
|
258 | + if ($order->orderLabel()->count()) { |
|
259 | 259 | header("Content-type: application/octet-stream"); |
260 | 260 | header("Content-disposition: attachment;filename=label.pdf"); |
261 | 261 | echo $order->orderLabel->data; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | |
288 | 288 | ); |
289 | 289 | foreach ($replace as $key => $val) { |
290 | - $content = str_replace("[" . $key . "]", $val, $content); |
|
290 | + $content = str_replace("[".$key."]", $val, $content); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | return $content; |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | |
301 | 301 | public function update($orderId) |
302 | 302 | { |
303 | - $result = OrderService::updateById(Request::all(), $orderId); |
|
303 | + $result = OrderService::updateById(Request::all(), $orderId); |
|
304 | 304 | |
305 | 305 | if ($result->errors()->all()) { |
306 | 306 | return redirect()->back()->withInput()->withErrors($result->errors()->all()); |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | if ($request->wantsJson()) { |
23 | 23 | |
24 | 24 | $query = OrderStatusService::getModel()->select( |
25 | - ['id', 'color','title'] |
|
25 | + ['id', 'color', 'title'] |
|
26 | 26 | )->where('shop_id', '=', auth('hideyobackend')->user()->selected_shop_id); |
27 | 27 | |
28 | 28 | $datatables = \Datatables::of($query) |
29 | 29 | |
30 | - ->addColumn('title', function ($query) { |
|
30 | + ->addColumn('title', function($query) { |
|
31 | 31 | |
32 | 32 | if ($query->color) { |
33 | 33 | return '<span style="background-color:'.$query->color.'; padding: 10px; line-height:30px; text-align:center; color:white;">'.$query->title.'</span>'; |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | }) |
37 | 37 | |
38 | 38 | |
39 | - ->addColumn('action', function ($query) { |
|
40 | - $deleteLink = Form::deleteajax('/admin/order-status/'. $query->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
39 | + ->addColumn('action', function($query) { |
|
40 | + $deleteLink = Form::deleteajax('/admin/order-status/'.$query->id, 'Delete', '', array('class'=>'btn btn-default btn-sm btn-danger')); |
|
41 | 41 | $links = '<a href="/admin/order-status/'.$query->id.'/edit" class="btn btn-default btn-sm btn-success"><i class="entypo-pencil"></i>Edit</a> '.$deleteLink; |
42 | 42 | |
43 | 43 | return $links; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | public function store(Request $request) |
60 | 60 | { |
61 | - $result = OrderStatusService::create($request->all()); |
|
61 | + $result = OrderStatusService::create($request->all()); |
|
62 | 62 | return OrderStatusService::notificationRedirect('order-status.index', $result, 'The order status was inserted.'); |
63 | 63 | } |
64 | 64 | |
@@ -79,13 +79,13 @@ discard block |
||
79 | 79 | |
80 | 80 | public function update(Request $request, $orderStatusId) |
81 | 81 | { |
82 | - $result = OrderStatusService::updateById($request->all(), $orderStatusId); |
|
82 | + $result = OrderStatusService::updateById($request->all(), $orderStatusId); |
|
83 | 83 | return OrderStatusService::notificationRedirect('order-status.index', $result, 'The order status was updated.'); |
84 | 84 | } |
85 | 85 | |
86 | 86 | public function destroy($orderStatusId) |
87 | 87 | { |
88 | - $result = OrderStatusService::destroy($orderStatusId); |
|
88 | + $result = OrderStatusService::destroy($orderStatusId); |
|
89 | 89 | |
90 | 90 | if ($result) { |
91 | 91 | Notification::success('The order status was deleted.'); |