@@ -30,30 +30,30 @@ |
||
| 30 | 30 | public function getPages() |
| 31 | 31 | { |
| 32 | 32 | return \DataTables::of($this->page->get()) |
| 33 | - ->addColumn('checkbox', function ($model) { |
|
| 33 | + ->addColumn('checkbox', function($model) { |
|
| 34 | 34 | return "<input type='checkbox' class='page_checkbox' |
| 35 | 35 | value=".$model->id.' name=select[] id=check>'; |
| 36 | 36 | }) |
| 37 | - ->addColumn('name', function ($model) { |
|
| 37 | + ->addColumn('name', function($model) { |
|
| 38 | 38 | return ucfirst($model->name); |
| 39 | 39 | }) |
| 40 | - ->addColumn('url', function ($model) { |
|
| 40 | + ->addColumn('url', function($model) { |
|
| 41 | 41 | return $model->url; |
| 42 | 42 | }) |
| 43 | - ->addColumn('created_at', function ($model) { |
|
| 43 | + ->addColumn('created_at', function($model) { |
|
| 44 | 44 | return $model->created_at; |
| 45 | 45 | }) |
| 46 | 46 | |
| 47 | - ->addColumn('content', function ($model) { |
|
| 47 | + ->addColumn('content', function($model) { |
|
| 48 | 48 | return str_limit($model->content, 10, '...'); |
| 49 | 49 | }) |
| 50 | - ->addColumn('action', function ($model) { |
|
| 50 | + ->addColumn('action', function($model) { |
|
| 51 | 51 | return '<a href='.url('pages/'.$model->id.'/edit') |
| 52 | 52 | ." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' |
| 53 | 53 | style='color:white;'> </i> Edit</a>"; |
| 54 | 54 | }) |
| 55 | 55 | |
| 56 | - ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'content', 'action']) |
|
| 56 | + ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'content', 'action']) |
|
| 57 | 57 | ->make(true); |
| 58 | 58 | // ->searchColumns('name', 'content') |
| 59 | 59 | // ->orderColumns('name') |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | style='color:white;'> </i> Edit</a>"; |
| 71 | 71 | }) |
| 72 | 72 | |
| 73 | - ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'content', 'action']) |
|
| 73 | + ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'content', 'action']) |
|
| 74 | 74 | ->make(true); |
| 75 | 75 | // ->searchColumns('name', 'content') |
| 76 | 76 | // ->orderColumns('name') |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | //servicedesk |
| 352 | 352 | $sevice_desk_products = $product->where('id', '!=', 1) |
| 353 | 353 | ->where('category', '=', 'Servicedesk') |
| 354 | - ->where('hidden', '=', '0') |
|
| 354 | + ->where('hidden', '=', '0') |
|
| 355 | 355 | ->orderBy('created_at', 'asc') |
| 356 | 356 | ->get() |
| 357 | 357 | ->toArray(); |
@@ -271,7 +271,7 @@ |
||
| 271 | 271 | return redirect()->back()->with('fails', 'Can not delete'); |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | - return redirect()->back()->with('success', "Invoice $invoice->number has been Deleted Successfully"); |
|
| 274 | + return redirect()->back()->with('success', "invoice $invoice->number has been Deleted Successfully"); |
|
| 275 | 275 | } catch (\Exception $e) { |
| 276 | 276 | Bugsnag::notifyException($e); |
| 277 | 277 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | '<td style="border-bottom: 1px solid#ccc; color: #333; |
| 187 | 187 | font-family: Arial,sans-serif; font-size: 14px; line-height: 20px; |
| 188 | 188 | padding: 15px 8px;" valign="top">'.$this->currency($invoiceid).' ' |
| 189 | - .$item->subtotal.'</td>'. |
|
| 189 | + .$item->subtotal.'</td>'. |
|
| 190 | 190 | '</tr>'; |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | return view('themes.default1.invoice.editPayment', |
| 288 | 288 | compact('amountReceived','clientid', 'client', 'invoices', 'orders', |
| 289 | - 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
|
| 289 | + 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
|
| 290 | 290 | } catch (\Exception $e) { |
| 291 | 291 | Bugsnag::notifyException($e); |
| 292 | 292 | |
@@ -285,7 +285,7 @@ |
||
| 285 | 285 | $orders = $order->where('client', $clientid)->get(); |
| 286 | 286 | |
| 287 | 287 | return view('themes.default1.invoice.editPayment', |
| 288 | - compact('amountReceived','clientid', 'client', 'invoices', 'orders', |
|
| 288 | + compact('amountReceived', 'clientid', 'client', 'invoices', 'orders', |
|
| 289 | 289 | 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
| 290 | 290 | } catch (\Exception $e) { |
| 291 | 291 | Bugsnag::notifyException($e); |
@@ -168,9 +168,9 @@ |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | return \DataTables::of($invoices->get()) |
| 171 | - ->addColumn('number', function ($model) { |
|
| 172 | - return $model->number; |
|
| 173 | - }) |
|
| 171 | + ->addColumn('number', function ($model) { |
|
| 172 | + return $model->number; |
|
| 173 | + }) |
|
| 174 | 174 | ->addColumn('products', function ($model) { |
| 175 | 175 | $invoice = $this->invoice->find($model->id); |
| 176 | 176 | $products = $invoice->invoiceItem()->pluck('product_name')->toArray(); |
@@ -182,27 +182,27 @@ |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | return \DataTables::of($invoices->get()) |
| 185 | - ->addColumn('number', function ($model) { |
|
| 185 | + ->addColumn('number', function($model) { |
|
| 186 | 186 | return $model->number; |
| 187 | 187 | }) |
| 188 | - ->addColumn('products', function ($model) { |
|
| 188 | + ->addColumn('products', function($model) { |
|
| 189 | 189 | $invoice = $this->invoice->find($model->id); |
| 190 | 190 | $products = $invoice->invoiceItem()->pluck('product_name')->toArray(); |
| 191 | 191 | |
| 192 | 192 | return ucfirst(implode(',', $products)); |
| 193 | 193 | }) |
| 194 | - ->addColumn('date', function ($model) { |
|
| 194 | + ->addColumn('date', function($model) { |
|
| 195 | 195 | $date = date_create($model->created_at); |
| 196 | 196 | |
| 197 | 197 | return date_format($date, 'M j, Y, g:i a'); |
| 198 | 198 | }) |
| 199 | - ->addColumn('total', function ($model) { |
|
| 199 | + ->addColumn('total', function($model) { |
|
| 200 | 200 | return $model->grand_total; |
| 201 | 201 | }) |
| 202 | - ->addColumn('status', function ($model) { |
|
| 202 | + ->addColumn('status', function($model) { |
|
| 203 | 203 | return ucfirst($model->status); |
| 204 | 204 | }) |
| 205 | - ->addColumn('action', function ($model) { |
|
| 205 | + ->addColumn('action', function($model) { |
|
| 206 | 206 | if (\Auth::user()->role == 'admin') { |
| 207 | 207 | $url = '/invoices/show?invoiceid='.$model->id; |
| 208 | 208 | } else { |
@@ -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)); |
@@ -169,11 +169,13 @@ |
||
| 169 | 169 | |
| 170 | 170 | //if product has expiry date ie sunscriptioon is generated |
| 171 | 171 | if ($endDate) { |
| 172 | - if ($getDownloadCondition == 1) {//Perpetual download till expiry selected |
|
| 172 | + if ($getDownloadCondition == 1) { |
|
| 173 | +//Perpetual download till expiry selected |
|
| 173 | 174 | $getDownload = $this->whenDownloadTillExpiry($endDate, $productid, $versions, $clientid, $invoiceid); |
| 174 | 175 | |
| 175 | 176 | return $getDownload; |
| 176 | - } elseif ($getDownloadCondition == 0) {//When download retires after subscription |
|
| 177 | + } elseif ($getDownloadCondition == 0) { |
|
| 178 | +//When download retires after subscription |
|
| 177 | 179 | |
| 178 | 180 | $getDownload = $this->whenDownloadExpiresAfterExpiry($countExpiry, $countVersions, $endDate, $productid, $versions, $clientid, $invoiceid); |
| 179 | 181 | |
@@ -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 | |
@@ -56,21 +56,21 @@ |
||
| 56 | 56 | $allCategories = $this->productCategory->select('id', 'category_name')->get(); |
| 57 | 57 | |
| 58 | 58 | return \DataTables::of($allCategories) |
| 59 | - ->addColumn('checkbox', function ($model) { |
|
| 60 | - return "<input type='checkbox' class='category_checkbox' |
|
| 59 | + ->addColumn('checkbox', function ($model) { |
|
| 60 | + return "<input type='checkbox' class='category_checkbox' |
|
| 61 | 61 | value=".$model->id.' name=select[] id=check>'; |
| 62 | - }) |
|
| 63 | - ->addColumn('category_name', function ($model) { |
|
| 64 | - return ucfirst($model->category_name); |
|
| 65 | - }) |
|
| 66 | - ->addColumn('action', function ($model) { |
|
| 67 | - return "<p><button data-toggle='modal' |
|
| 62 | + }) |
|
| 63 | + ->addColumn('category_name', function ($model) { |
|
| 64 | + return ucfirst($model->category_name); |
|
| 65 | + }) |
|
| 66 | + ->addColumn('action', function ($model) { |
|
| 67 | + return "<p><button data-toggle='modal' |
|
| 68 | 68 | data-id=".$model->id." data-name= '$model->category_name' |
| 69 | 69 | class='btn btn-sm btn-primary btn-xs editCat'><i class='fa fa-edit' |
| 70 | 70 | style='color:white;'> </i> Edit</button> </p>"; |
| 71 | - }) |
|
| 72 | - ->rawColumns(['checkbox', 'category_name', 'action']) |
|
| 73 | - ->make(true); |
|
| 71 | + }) |
|
| 72 | + ->rawColumns(['checkbox', 'category_name', 'action']) |
|
| 73 | + ->make(true); |
|
| 74 | 74 | } catch (\Exception $ex) { |
| 75 | 75 | return redirect()->back()->with('fails', $ex->getMessage()); |
| 76 | 76 | } |
@@ -56,14 +56,14 @@ |
||
| 56 | 56 | $allCategories = $this->productCategory->select('id', 'category_name')->get(); |
| 57 | 57 | |
| 58 | 58 | return \DataTables::of($allCategories) |
| 59 | - ->addColumn('checkbox', function ($model) { |
|
| 59 | + ->addColumn('checkbox', function($model) { |
|
| 60 | 60 | return "<input type='checkbox' class='category_checkbox' |
| 61 | 61 | value=".$model->id.' name=select[] id=check>'; |
| 62 | 62 | }) |
| 63 | - ->addColumn('category_name', function ($model) { |
|
| 63 | + ->addColumn('category_name', function($model) { |
|
| 64 | 64 | return ucfirst($model->category_name); |
| 65 | 65 | }) |
| 66 | - ->addColumn('action', function ($model) { |
|
| 66 | + ->addColumn('action', function($model) { |
|
| 67 | 67 | return "<p><button data-toggle='modal' |
| 68 | 68 | data-id=".$model->id." data-name= '$model->category_name' |
| 69 | 69 | class='btn btn-sm btn-primary btn-xs editCat'><i class='fa fa-edit' |
@@ -34,21 +34,21 @@ |
||
| 34 | 34 | $allTypes = $this->productType->select('id', 'name')->get(); |
| 35 | 35 | |
| 36 | 36 | return \DataTables::of($allTypes) |
| 37 | - ->addColumn('checkbox', function ($model) { |
|
| 38 | - return "<input type='checkbox' class='type_checkbox' |
|
| 37 | + ->addColumn('checkbox', function ($model) { |
|
| 38 | + return "<input type='checkbox' class='type_checkbox' |
|
| 39 | 39 | value=".$model->id.' name=select[] id=check>'; |
| 40 | - }) |
|
| 41 | - ->addColumn('type_name', function ($model) { |
|
| 42 | - return ucfirst($model->name); |
|
| 43 | - }) |
|
| 44 | - ->addColumn('action', function ($model) { |
|
| 45 | - return "<p><button data-toggle='modal' |
|
| 40 | + }) |
|
| 41 | + ->addColumn('type_name', function ($model) { |
|
| 42 | + return ucfirst($model->name); |
|
| 43 | + }) |
|
| 44 | + ->addColumn('action', function ($model) { |
|
| 45 | + return "<p><button data-toggle='modal' |
|
| 46 | 46 | data-id=".$model->id." data-name= '$model->name' |
| 47 | 47 | class='btn btn-sm btn-primary btn-xs editType'><i class='fa fa-edit' |
| 48 | 48 | style='color:white;'> </i> Edit</button> </p>"; |
| 49 | - }) |
|
| 50 | - ->rawColumns(['checkbox', 'type_name', 'action']) |
|
| 51 | - ->make(true); |
|
| 49 | + }) |
|
| 50 | + ->rawColumns(['checkbox', 'type_name', 'action']) |
|
| 51 | + ->make(true); |
|
| 52 | 52 | } catch (\Exception $ex) { |
| 53 | 53 | Bugsnag::notifyException($ex); |
| 54 | 54 | |
@@ -34,14 +34,14 @@ |
||
| 34 | 34 | $allTypes = $this->productType->select('id', 'name')->get(); |
| 35 | 35 | |
| 36 | 36 | return \DataTables::of($allTypes) |
| 37 | - ->addColumn('checkbox', function ($model) { |
|
| 37 | + ->addColumn('checkbox', function($model) { |
|
| 38 | 38 | return "<input type='checkbox' class='type_checkbox' |
| 39 | 39 | value=".$model->id.' name=select[] id=check>'; |
| 40 | 40 | }) |
| 41 | - ->addColumn('type_name', function ($model) { |
|
| 41 | + ->addColumn('type_name', function($model) { |
|
| 42 | 42 | return ucfirst($model->name); |
| 43 | 43 | }) |
| 44 | - ->addColumn('action', function ($model) { |
|
| 44 | + ->addColumn('action', function($model) { |
|
| 45 | 45 | return "<p><button data-toggle='modal' |
| 46 | 46 | data-id=".$model->id." data-name= '$model->name' |
| 47 | 47 | class='btn btn-sm btn-primary btn-xs editType'><i class='fa fa-edit' |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | { |
| 9 | 9 | protected $table = 'payments'; |
| 10 | 10 | protected $fillable = ['parent_id', 'invoice_id', 'amount', |
| 11 | - 'payment_method', 'user_id', 'payment_status', 'created_at', 'amt_to_credit', ]; |
|
| 11 | + 'payment_method', 'user_id', 'payment_status', 'created_at', 'amt_to_credit', ]; |
|
| 12 | 12 | |
| 13 | 13 | public function invoice() |
| 14 | 14 | { |
@@ -36,9 +36,9 @@ |
||
| 36 | 36 | value=".$model->id.' name=select[] id=check>'; |
| 37 | 37 | }) |
| 38 | 38 | |
| 39 | - ->addColumn('name', function ($model) { |
|
| 40 | - return $model->name; |
|
| 41 | - }) |
|
| 39 | + ->addColumn('name', function ($model) { |
|
| 40 | + return $model->name; |
|
| 41 | + }) |
|
| 42 | 42 | |
| 43 | 43 | ->addColumn('action', function ($model) { |
| 44 | 44 | return '<a href='.url('chat/'.$model->id.'/edit'). |
@@ -32,21 +32,21 @@ |
||
| 32 | 32 | { |
| 33 | 33 | try { |
| 34 | 34 | return \DataTables::of($this->script->get()) |
| 35 | - ->addColumn('checkbox', function ($model) { |
|
| 35 | + ->addColumn('checkbox', function($model) { |
|
| 36 | 36 | return "<input type='checkbox' class='chat_checkbox' |
| 37 | 37 | value=".$model->id.' name=select[] id=check>'; |
| 38 | 38 | }) |
| 39 | 39 | |
| 40 | - ->addColumn('name', function ($model) { |
|
| 40 | + ->addColumn('name', function($model) { |
|
| 41 | 41 | return $model->name; |
| 42 | 42 | }) |
| 43 | 43 | |
| 44 | - ->addColumn('action', function ($model) { |
|
| 44 | + ->addColumn('action', function($model) { |
|
| 45 | 45 | return '<a href='.url('chat/'.$model->id.'/edit'). |
| 46 | 46 | " class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' |
| 47 | 47 | style='color:white;'> </i> Edit</a>"; |
| 48 | 48 | }) |
| 49 | - ->rawColumns(['checkbox', 'name', 'action']) |
|
| 49 | + ->rawColumns(['checkbox', 'name', 'action']) |
|
| 50 | 50 | ->make(true); |
| 51 | 51 | } catch (\Exception $ex) { |
| 52 | 52 | return redirect()->back()->with('fails', $ex->getMessage()); |
@@ -133,7 +133,8 @@ discard block |
||
| 133 | 133 | { |
| 134 | 134 | try { |
| 135 | 135 | foreach ($invoiceChecked as $key => $value) { |
| 136 | - if ($key != 0) {//If Payment is linked to Invoice |
|
| 136 | + if ($key != 0) { |
|
| 137 | +//If Payment is linked to Invoice |
|
| 137 | 138 | $invoice = Invoice::find($value); |
| 138 | 139 | $invoice_status = 'pending'; |
| 139 | 140 | $payment = Payment::where('invoice_id', $value)->create([ |
@@ -157,7 +158,8 @@ discard block |
||
| 157 | 158 | $invoice->status = $invoice_status; |
| 158 | 159 | $invoice->save(); |
| 159 | 160 | } |
| 160 | - } elseif (count($invoiceChecked) == 1 || $amtToCredit > 0) {//If Payment is not linked to any invoice and is to be credited to User Accunt |
|
| 161 | + } elseif (count($invoiceChecked) == 1 || $amtToCredit > 0) { |
|
| 162 | +//If Payment is not linked to any invoice and is to be credited to User Accunt |
|
| 161 | 163 | $payment = Payment::create([ |
| 162 | 164 | 'invoice_id' => $value, |
| 163 | 165 | 'user_id' => $clientid, |
@@ -224,7 +226,8 @@ discard block |
||
| 224 | 226 | try { |
| 225 | 227 | $sum = 0; |
| 226 | 228 | foreach ($invoiceChecked as $key => $value) { |
| 227 | - if ($key != 0) {//If Payment is linked to Invoice |
|
| 229 | + if ($key != 0) { |
|
| 230 | +//If Payment is linked to Invoice |
|
| 228 | 231 | $invoice = Invoice::find($value); |
| 229 | 232 | Payment::where('user_id', $clientid)->where('invoice_id', 0)->update(['amt_to_credit'=>$amtToCredit]); |
| 230 | 233 | $invoice_status = 'pending'; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $orders = $order->where('client', $clientid)->get(); |
| 38 | 38 | |
| 39 | 39 | return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices', 'orders', |
| 40 | - 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
|
| 40 | + 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
|
| 41 | 41 | } catch (Exception $ex) { |
| 42 | 42 | return redirect()->back()->with('fails', $ex->getMessage()); |
| 43 | 43 | } |
@@ -46,9 +46,9 @@ discard block |
||
| 46 | 46 | public function postNewPayment($clientid, Request $request) |
| 47 | 47 | { |
| 48 | 48 | $this->validate($request, [ |
| 49 | - 'payment_date' => 'required', |
|
| 50 | - 'payment_method'=> 'required', |
|
| 51 | - 'amount' => 'required', |
|
| 49 | + 'payment_date' => 'required', |
|
| 50 | + 'payment_method'=> 'required', |
|
| 51 | + 'amount' => 'required', |
|
| 52 | 52 | ]); |
| 53 | 53 | |
| 54 | 54 | try { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $amtToCredit = $request->amtToCredit; |
| 114 | 114 | $payment_status = 'success'; |
| 115 | 115 | $payment = $this->multiplePayment($clientid,$invoiceChecked, $payment_method, |
| 116 | - $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
|
| 116 | + $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
|
| 117 | 117 | $response = ['type' => 'success', 'message' => 'Payment Updated Successfully']; |
| 118 | 118 | |
| 119 | 119 | return response()->json($response); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | public function multiplePayment($clientid,$invoiceChecked, $payment_method, |
| 133 | - $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
|
| 133 | + $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
|
| 134 | 134 | { |
| 135 | 135 | try { |
| 136 | 136 | foreach ($invoiceChecked as $key => $value) { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $amtToCredit = $request->amtToCredit; |
| 206 | 206 | $payment_status = 'success'; |
| 207 | 207 | $payment = $this->updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method, |
| 208 | - $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
|
| 208 | + $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
|
| 209 | 209 | $response = ['type' => 'success', 'message' => 'Payment Updated Successfully']; |
| 210 | 210 | |
| 211 | 211 | return response()->json($response); |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | public function updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method, |
| 222 | - $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
|
| 222 | + $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
|
| 223 | 223 | { |
| 224 | 224 | try { |
| 225 | 225 | $sum = 0; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $symbol = Currency::where('code', $currency)->pluck('symbol')->first(); |
| 37 | 37 | $orders = $order->where('client', $clientid)->get(); |
| 38 | 38 | |
| 39 | - return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices', 'orders', |
|
| 39 | + return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices', 'orders', |
|
| 40 | 40 | 'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol')); |
| 41 | 41 | } catch (Exception $ex) { |
| 42 | 42 | return redirect()->back()->with('fails', $ex->getMessage()); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $invoicAmount = $request->invoiceAmount; |
| 113 | 113 | $amtToCredit = $request->amtToCredit; |
| 114 | 114 | $payment_status = 'success'; |
| 115 | - $payment = $this->multiplePayment($clientid,$invoiceChecked, $payment_method, |
|
| 115 | + $payment = $this->multiplePayment($clientid, $invoiceChecked, $payment_method, |
|
| 116 | 116 | $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
| 117 | 117 | $response = ['type' => 'success', 'message' => 'Payment Updated Successfully']; |
| 118 | 118 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - public function multiplePayment($clientid,$invoiceChecked, $payment_method, |
|
| 132 | + public function multiplePayment($clientid, $invoiceChecked, $payment_method, |
|
| 133 | 133 | $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
| 134 | 134 | { |
| 135 | 135 | try { |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $invoicAmount = $request->invoiceAmount; |
| 205 | 205 | $amtToCredit = $request->amtToCredit; |
| 206 | 206 | $payment_status = 'success'; |
| 207 | - $payment = $this->updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method, |
|
| 207 | + $payment = $this->updatePaymentByInvoice($clientid, $invoiceChecked, $payment_method, |
|
| 208 | 208 | $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status); |
| 209 | 209 | $response = ['type' => 'success', 'message' => 'Payment Updated Successfully']; |
| 210 | 210 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | - public function updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method, |
|
| 221 | + public function updatePaymentByInvoice($clientid, $invoiceChecked, $payment_method, |
|
| 222 | 222 | $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status) |
| 223 | 223 | { |
| 224 | 224 | try { |