@@ -77,20 +77,20 @@ discard block |
||
| 77 | 77 | ->select('number', 'created_at', 'grand_total', 'id', 'status'); |
| 78 | 78 | |
| 79 | 79 | return \DataTables::of($invoices->get()) |
| 80 | - ->addColumn('number', function ($model) { |
|
| 80 | + ->addColumn('number', function($model) { |
|
| 81 | 81 | return $model->number; |
| 82 | 82 | }) |
| 83 | - ->addColumn('date', function ($model) { |
|
| 83 | + ->addColumn('date', function($model) { |
|
| 84 | 84 | $date = $model->created_at; |
| 85 | 85 | |
| 86 | 86 | return $date; |
| 87 | 87 | // $myobject->created_at->timezone($this->auth->user()->timezone); |
| 88 | 88 | }) |
| 89 | 89 | // ->showColumns('created_at') |
| 90 | - ->addColumn('total', function ($model) { |
|
| 90 | + ->addColumn('total', function($model) { |
|
| 91 | 91 | return $model->grand_total; |
| 92 | 92 | }) |
| 93 | - ->addColumn('Action', function ($model) { |
|
| 93 | + ->addColumn('Action', function($model) { |
|
| 94 | 94 | $status = $model->status; |
| 95 | 95 | $payment = ''; |
| 96 | 96 | if ($status == 'Pending' && $model->grand_total > 0) { |
@@ -147,19 +147,19 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | return \DataTables::of($versions) |
| 150 | - ->addColumn('id', function ($versions) { |
|
| 150 | + ->addColumn('id', function($versions) { |
|
| 151 | 151 | return ucfirst($versions->id); |
| 152 | 152 | }) |
| 153 | - ->addColumn('version', function ($versions) { |
|
| 153 | + ->addColumn('version', function($versions) { |
|
| 154 | 154 | return ucfirst($versions->version); |
| 155 | 155 | }) |
| 156 | - ->addColumn('title', function ($versions) { |
|
| 156 | + ->addColumn('title', function($versions) { |
|
| 157 | 157 | return ucfirst($versions->title); |
| 158 | 158 | }) |
| 159 | - ->addColumn('description', function ($versions) { |
|
| 159 | + ->addColumn('description', function($versions) { |
|
| 160 | 160 | return ucfirst($versions->description); |
| 161 | 161 | }) |
| 162 | - ->addColumn('file', function ($versions) use ($countExpiry, $countVersions,$clientid, $invoiceid, $productid) { |
|
| 162 | + ->addColumn('file', function($versions) use ($countExpiry, $countVersions, $clientid, $invoiceid, $productid) { |
|
| 163 | 163 | $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first(); |
| 164 | 164 | $order = Order::where('invoice_id', '=', $invoice_id)->first(); |
| 165 | 165 | $order_id = $order->id; |
@@ -258,18 +258,18 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | return \DataTables::of($link) |
| 261 | - ->addColumn('version', function ($link) { |
|
| 261 | + ->addColumn('version', function($link) { |
|
| 262 | 262 | return ucfirst($link['tag_name']); |
| 263 | 263 | }) |
| 264 | - ->addColumn('name', function ($link) { |
|
| 264 | + ->addColumn('name', function($link) { |
|
| 265 | 265 | return ucfirst($link['name']); |
| 266 | 266 | }) |
| 267 | - ->addColumn('description', function ($link) { |
|
| 267 | + ->addColumn('description', function($link) { |
|
| 268 | 268 | $markdown = Markdown::convertToHtml(ucfirst($link['body'])); |
| 269 | 269 | |
| 270 | 270 | return $markdown; |
| 271 | 271 | }) |
| 272 | - ->addColumn('file', function ($link) use ($countExpiry,$countVersions,$invoiceid, $productid) { |
|
| 272 | + ->addColumn('file', function($link) use ($countExpiry, $countVersions, $invoiceid, $productid) { |
|
| 273 | 273 | $order = Order::where('invoice_id', '=', $invoiceid)->first(); |
| 274 | 274 | $order_id = $order->id; |
| 275 | 275 | $orderEndDate = Subscription::select('ends_at') |
@@ -316,20 +316,20 @@ discard block |
||
| 316 | 316 | $orders = Order::where('client', \Auth::user()->id); |
| 317 | 317 | |
| 318 | 318 | return \DataTables::of($orders->get()) |
| 319 | - ->addColumn('id', function ($model) { |
|
| 319 | + ->addColumn('id', function($model) { |
|
| 320 | 320 | return $model->id; |
| 321 | 321 | }) |
| 322 | - ->addColumn('product_name', function ($model) { |
|
| 322 | + ->addColumn('product_name', function($model) { |
|
| 323 | 323 | return $model->product()->first()->name; |
| 324 | 324 | }) |
| 325 | - ->addColumn('expiry', function ($model) { |
|
| 325 | + ->addColumn('expiry', function($model) { |
|
| 326 | 326 | $tz = \Auth::user()->timezone()->first()->name; |
| 327 | 327 | $end = $this->getExpiryDate($model); |
| 328 | 328 | |
| 329 | 329 | return $end; |
| 330 | 330 | }) |
| 331 | 331 | |
| 332 | - ->addColumn('Action', function ($model) { |
|
| 332 | + ->addColumn('Action', function($model) { |
|
| 333 | 333 | $sub = $model->subscription()->first(); |
| 334 | 334 | $order = Order::where('id', $model->id)->select('product')->first(); |
| 335 | 335 | $productid = $order->product; |
@@ -444,17 +444,17 @@ discard block |
||
| 444 | 444 | ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at'); |
| 445 | 445 | |
| 446 | 446 | return \DataTables::of($payments->get()) |
| 447 | - ->addColumn('checkbox', function ($model) { |
|
| 447 | + ->addColumn('checkbox', function($model) { |
|
| 448 | 448 | if (\Input::get('client') != 'true') { |
| 449 | 449 | return "<input type='checkbox' class='payment_checkbox' |
| 450 | 450 | value=".$model->id.' name=select[] id=check>'; |
| 451 | 451 | } |
| 452 | 452 | }) |
| 453 | - ->addColumn('number', function ($model) { |
|
| 453 | + ->addColumn('number', function($model) { |
|
| 454 | 454 | return $model->invoice()->first()->number; |
| 455 | 455 | }) |
| 456 | 456 | ->addColumn('amount', 'payment_method', 'payment_status', 'created_at') |
| 457 | - ->addColumn('total', function ($model) { |
|
| 457 | + ->addColumn('total', function($model) { |
|
| 458 | 458 | return $model->grand_total; |
| 459 | 459 | }) |
| 460 | 460 | ->rawColumns(['checkbox', 'number', 'total', |
@@ -481,13 +481,13 @@ discard block |
||
| 481 | 481 | ->select('id', 'invoice_id', 'user_id', 'payment_method', 'payment_status', 'created_at', 'amount'); |
| 482 | 482 | //dd(\Input::all()); |
| 483 | 483 | return \DataTables::of($payments->get()) |
| 484 | - ->addColumn('number', function ($model) { |
|
| 484 | + ->addColumn('number', function($model) { |
|
| 485 | 485 | return $model->invoice()->first()->number; |
| 486 | 486 | }) |
| 487 | - ->addColumn('total', function ($model) { |
|
| 487 | + ->addColumn('total', function($model) { |
|
| 488 | 488 | return $model->amount; |
| 489 | 489 | }) |
| 490 | - ->addColumn('created_at', function ($model) { |
|
| 490 | + ->addColumn('created_at', function($model) { |
|
| 491 | 491 | $date1 = new DateTime($model->created_at); |
| 492 | 492 | $tz = \Auth::user()->timezone()->first()->name; |
| 493 | 493 | $date1->setTimezone(new DateTimeZone($tz)); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | try { |
| 130 | 130 | $versions = ProductUpload::where('product_id', $productid) |
| 131 | 131 | ->select('id', 'product_id', 'version', |
| 132 | - 'title', 'description', 'file', 'created_at')->get(); |
|
| 132 | + 'title', 'description', 'file', 'created_at')->get(); |
|
| 133 | 133 | $countVersions = count($versions); |
| 134 | 134 | $countExpiry = 0; |
| 135 | 135 | $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first(); |
@@ -137,11 +137,11 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | $order_id = $order->id; |
| 139 | 139 | $endDate = Subscription::select('ends_at') |
| 140 | - ->where('product_id', $productid)->where('order_id', $order_id)->first(); |
|
| 140 | + ->where('product_id', $productid)->where('order_id', $order_id)->first(); |
|
| 141 | 141 | if ($endDate) { |
| 142 | 142 | foreach ($versions as $version) { |
| 143 | 143 | if ($version->created_at->toDateTimeString() |
| 144 | - < $endDate->ends_at->toDateTimeString()) { |
|
| 144 | + < $endDate->ends_at->toDateTimeString()) { |
|
| 145 | 145 | $countExpiry = $countExpiry + 1; |
| 146 | 146 | } |
| 147 | 147 | } |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | $bussinesses = \App\Model\Common\Bussiness::pluck('name', 'short')->toArray(); |
| 394 | 394 | |
| 395 | 395 | return view('themes.default1.front.clients.profile', |
| 396 | - compact('user', 'timezones', 'state', 'states', 'bussinesses')); |
|
| 396 | + compact('user', 'timezones', 'state', 'states', 'bussinesses')); |
|
| 397 | 397 | } catch (Exception $ex) { |
| 398 | 398 | Bugsnag::notifyException($ex); |
| 399 | 399 | |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | return $model->grand_total; |
| 473 | 473 | }) |
| 474 | 474 | ->rawColumns(['checkbox', 'number', 'total', |
| 475 | - 'payment_method', 'payment_status', 'created_at', ]) |
|
| 475 | + 'payment_method', 'payment_status', 'created_at', ]) |
|
| 476 | 476 | ->make(true); |
| 477 | 477 | } catch (Exception $ex) { |
| 478 | 478 | Bugsnag::notifyException($ex); |
@@ -498,17 +498,17 @@ discard block |
||
| 498 | 498 | ->addColumn('number', function ($model) { |
| 499 | 499 | return $model->invoice()->first()->number; |
| 500 | 500 | }) |
| 501 | - ->addColumn('total', function ($model) { |
|
| 502 | - return $model->amount; |
|
| 503 | - }) |
|
| 504 | - ->addColumn('created_at', function ($model) { |
|
| 505 | - $date1 = new DateTime($model->created_at); |
|
| 506 | - $tz = \Auth::user()->timezone()->first()->name; |
|
| 507 | - $date1->setTimezone(new DateTimeZone($tz)); |
|
| 508 | - $date = $date1->format('M j, Y, g:i a'); |
|
| 509 | - |
|
| 510 | - return $date; |
|
| 511 | - }) |
|
| 501 | + ->addColumn('total', function ($model) { |
|
| 502 | + return $model->amount; |
|
| 503 | + }) |
|
| 504 | + ->addColumn('created_at', function ($model) { |
|
| 505 | + $date1 = new DateTime($model->created_at); |
|
| 506 | + $tz = \Auth::user()->timezone()->first()->name; |
|
| 507 | + $date1->setTimezone(new DateTimeZone($tz)); |
|
| 508 | + $date = $date1->format('M j, Y, g:i a'); |
|
| 509 | + |
|
| 510 | + return $date; |
|
| 511 | + }) |
|
| 512 | 512 | |
| 513 | 513 | ->addColumn('payment_method', 'payment_status', 'created_at') |
| 514 | 514 | |