Completed
Branch development (b1b115)
by Johannes
10:28
created
app/Http/Controllers/Front/ClientController.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -567,17 +567,17 @@
 block discarded – undo
567 567
                             ->addColumn('number', function ($model) {
568 568
                                 return $model->invoice()->first()->number;
569 569
                             })
570
-                              ->addColumn('total', function ($model) {
571
-                                  return $model->amount;
572
-                              })
573
-                               ->addColumn('created_at', function ($model) {
574
-                                   $date1 = new DateTime($model->created_at);
575
-                                   $tz = \Auth::user()->timezone()->first()->name;
576
-                                   $date1->setTimezone(new DateTimeZone($tz));
577
-                                   $date = $date1->format('M j, Y, g:i a');
578
-
579
-                                   return $date;
580
-                               })
570
+                                ->addColumn('total', function ($model) {
571
+                                    return $model->amount;
572
+                                })
573
+                                ->addColumn('created_at', function ($model) {
574
+                                    $date1 = new DateTime($model->created_at);
575
+                                    $tz = \Auth::user()->timezone()->first()->name;
576
+                                    $date1->setTimezone(new DateTimeZone($tz));
577
+                                    $date = $date1->format('M j, Y, g:i a');
578
+
579
+                                    return $date;
580
+                                })
581 581
 
582 582
                             ->addColumn('payment_method', 'payment_status', 'created_at')
583 583
 
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -81,10 +81,10 @@  discard block
 block discarded – undo
81 81
                     ->select('number', 'created_at', 'grand_total', 'id', 'status');
82 82
 
83 83
             return \DataTables::of($invoices->get())
84
-                            ->addColumn('number', function ($model) {
84
+                            ->addColumn('number', function($model) {
85 85
                                 return $model->number;
86 86
                             })
87
-                            ->addColumn('date', function ($model) {
87
+                            ->addColumn('date', function($model) {
88 88
 
89 89
                                 // $timezone = Timezone::where('id',Auth::user()->timezone_id)->pluck('location')->first();
90 90
                                 $date = $model->created_at;
@@ -93,10 +93,10 @@  discard block
 block discarded – undo
93 93
                                 // $myobject->created_at->timezone($this->auth->user()->timezone);
94 94
                             })
95 95
                             // ->showColumns('created_at')
96
-                            ->addColumn('total', function ($model) {
96
+                            ->addColumn('total', function($model) {
97 97
                                 return $model->grand_total;
98 98
                             })
99
-                            ->addColumn('Action', function ($model) {
99
+                            ->addColumn('Action', function($model) {
100 100
                                 $status = $model->status;
101 101
                                 $payment = '';
102 102
                                 if ($status == 'Pending' && $model->grand_total > 0) {
@@ -134,19 +134,19 @@  discard block
 block discarded – undo
134 134
             $versions = ProductUpload::where('product_id', $productid)->select('id', 'product_id', 'version', 'title', 'description', 'file', 'created_at')->get();
135 135
 
136 136
             return \DataTables::of($versions)
137
-                            ->addColumn('id', function ($versions) {
137
+                            ->addColumn('id', function($versions) {
138 138
                                 return ucfirst($versions->id);
139 139
                             })
140
-                            ->addColumn('version', function ($versions) {
140
+                            ->addColumn('version', function($versions) {
141 141
                                 return ucfirst($versions->version);
142 142
                             })
143
-                            ->addColumn('title', function ($versions) {
143
+                            ->addColumn('title', function($versions) {
144 144
                                 return ucfirst($versions->title);
145 145
                             })
146
-                            ->addColumn('description', function ($versions) {
146
+                            ->addColumn('description', function($versions) {
147 147
                                 return ucfirst($versions->description);
148 148
                             })
149
-                            ->addColumn('file', function ($versions) use ($clientid, $invoiceid, $productid) {
149
+                            ->addColumn('file', function($versions) use ($clientid, $invoiceid, $productid) {
150 150
                                 $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
151 151
                                 $order = Order::where('invoice_id', '=', $invoice_id)->first();
152 152
                                 $order_id = $order->id;
@@ -191,19 +191,19 @@  discard block
 block discarded – undo
191 191
             $link = (array_slice($link, 0, 10, true));
192 192
 
193 193
             return \DataTables::of($link)
194
-                            ->addColumn('version', function ($link) {
194
+                            ->addColumn('version', function($link) {
195 195
                                 // dd($link['tag_name']);
196 196
                                 return ucfirst($link['tag_name']);
197 197
                             })
198
-                            ->addColumn('name', function ($link) {
198
+                            ->addColumn('name', function($link) {
199 199
                                 return ucfirst($link['name']);
200 200
                             })
201
-                            ->addColumn('description', function ($link) {
201
+                            ->addColumn('description', function($link) {
202 202
                                 $markdown = Markdown::convertToHtml(ucfirst($link['body']));
203 203
 
204 204
                                 return $markdown;
205 205
                             })
206
-                            ->addColumn('file', function ($link) use ($invoiceid, $productid) {
206
+                            ->addColumn('file', function($link) use ($invoiceid, $productid) {
207 207
                                 $order = Order::where('invoice_id', '=', $invoiceid)->first();
208 208
                                 $order_id = $order->id;
209 209
                                 $orderEndDate = Subscription::select('ends_at')->where('product_id', $productid)->where('order_id', $order_id)->first();
@@ -256,13 +256,13 @@  discard block
 block discarded – undo
256 256
             $orders = Order:: where('client', \Auth::user()->id);
257 257
 
258 258
             return \DataTables::of($orders->get())
259
-                            ->addColumn('id', function ($model) {
259
+                            ->addColumn('id', function($model) {
260 260
                                 return $model->id;
261 261
                             })
262
-                            ->addColumn('product_name', function ($model) {
262
+                            ->addColumn('product_name', function($model) {
263 263
                                 return $model->product()->first()->name;
264 264
                             })
265
-                            ->addColumn('expiry', function ($model) {
265
+                            ->addColumn('expiry', function($model) {
266 266
                                 $tz = \Auth::user()->timezone()->first()->name;
267 267
                                 $end = '--';
268 268
                                 if ($model->subscription()->first()) {
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
                                 return $end;
280 280
                             })
281 281
 
282
-                            ->addColumn('Action', function ($model) {
282
+                            ->addColumn('Action', function($model) {
283 283
                                 $sub = $model->subscription()->first();
284 284
                                 $order = Order::where('id', $model->id)->select('product')->first();
285 285
                                 $productid = $order->product;
@@ -328,11 +328,11 @@  discard block
 block discarded – undo
328 328
             $subscriptions = $this->subscription->where('user_id', \Auth::user()->id)->get();
329 329
 
330 330
             return \Datatable::collection($subscriptions)
331
-                            ->addColumn('id', function ($model) {
331
+                            ->addColumn('id', function($model) {
332 332
                                 return $model->id;
333 333
                             })
334 334
                             ->showColumns('created_at')
335
-                            ->addColumn('ends_at', function ($model) {
335
+                            ->addColumn('ends_at', function($model) {
336 336
                                 return $model->subscription()->first()->ends_at;
337 337
                             })
338 338
                             ->searchColumns('id', 'created_at', 'ends_at')
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
                 $user->profile_pic = $fileName;
376 376
             }
377 377
             $user->fill($request->input())->save();
378
-            $response = ['type' => 'success',  'message' =>'Updated Successfully..'];
378
+            $response = ['type' => 'success', 'message' =>'Updated Successfully..'];
379 379
 
380 380
             return $response;
381 381
             // return redirect()->back()->with('success', \Lang::get('message.updated-successfully'));
@@ -479,27 +479,27 @@  discard block
 block discarded – undo
479 479
             }
480 480
 
481 481
             return \DataTables::of($invoices->get())
482
-                            ->addColumn('number', function ($model) {
482
+                            ->addColumn('number', function($model) {
483 483
                                 return $model->number;
484 484
                             })
485
-                            ->addColumn('products', function ($model) {
485
+                            ->addColumn('products', function($model) {
486 486
                                 $invoice = $this->invoice->find($model->id);
487 487
                                 $products = $invoice->invoiceItem()->pluck('product_name')->toArray();
488 488
 
489 489
                                 return ucfirst(implode(',', $products));
490 490
                             })
491
-                            ->addColumn('date', function ($model) {
491
+                            ->addColumn('date', function($model) {
492 492
                                 $date = date_create($model->created_at);
493 493
 
494 494
                                 return date_format($date, 'M j, Y, g:i a');
495 495
                             })
496
-                            ->addColumn('total', function ($model) {
496
+                            ->addColumn('total', function($model) {
497 497
                                 return $model->grand_total;
498 498
                             })
499
-                            ->addColumn('status', function ($model) {
499
+                            ->addColumn('status', function($model) {
500 500
                                 return ucfirst($model->status);
501 501
                             })
502
-                            ->addColumn('action', function ($model) {
502
+                            ->addColumn('action', function($model) {
503 503
                                 if (\Auth::user()->role == 'admin') {
504 504
                                     $url = '/invoices/show?invoiceid='.$model->id;
505 505
                                 } else {
@@ -533,16 +533,16 @@  discard block
 block discarded – undo
533 533
                     ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at');
534 534
             //dd(\Input::all());
535 535
             return \DataTables::of($payments->get())
536
-                            ->addColumn('checkbox', function ($model) {
536
+                            ->addColumn('checkbox', function($model) {
537 537
                                 if (\Input::get('client') != 'true') {
538 538
                                     return "<input type='checkbox' class='payment_checkbox' value=".$model->id.' name=select[] id=check>';
539 539
                                 }
540 540
                             })
541
-                            ->addColumn('number', function ($model) {
541
+                            ->addColumn('number', function($model) {
542 542
                                 return $model->invoice()->first()->number;
543 543
                             })
544 544
                             ->addColumn('amount', 'payment_method', 'payment_status', 'created_at')
545
-                            ->addColumn('total', function ($model) {
545
+                            ->addColumn('total', function($model) {
546 546
                                 return $model->grand_total;
547 547
                             })
548 548
                             ->rawColumns(['checkbox', 'number', 'total', 'payment_method', 'payment_status', 'created_at'])
@@ -568,13 +568,13 @@  discard block
 block discarded – undo
568 568
                     ->select('id', 'invoice_id', 'user_id', 'payment_method', 'payment_status', 'created_at', 'amount');
569 569
             //dd(\Input::all());
570 570
             return \DataTables::of($payments->get())
571
-                            ->addColumn('number', function ($model) {
571
+                            ->addColumn('number', function($model) {
572 572
                                 return $model->invoice()->first()->number;
573 573
                             })
574
-                              ->addColumn('total', function ($model) {
574
+                              ->addColumn('total', function($model) {
575 575
                                   return $model->amount;
576 576
                               })
577
-                               ->addColumn('created_at', function ($model) {
577
+                               ->addColumn('created_at', function($model) {
578 578
                                    $date1 = new DateTime($model->created_at);
579 579
                                    $tz = \Auth::user()->timezone()->first()->name;
580 580
                                    $date1->setTimezone(new DateTimeZone($tz));
Please login to merge, or discard this patch.
app/Http/Controllers/Order/InvoiceController.php 4 patches
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -120,21 +120,21 @@  discard block
 block discarded – undo
120 120
 
121 121
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
122 122
                         })
123
-                         ->addColumn('number', function ($model) {
124
-                             return ucfirst($model->number);
125
-                         })
123
+                            ->addColumn('number', function ($model) {
124
+                                return ucfirst($model->number);
125
+                            })
126 126
 
127 127
                         ->addColumn('date', function ($model) {
128 128
                             $date = date_create($model->created_at);
129 129
 
130 130
                             return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
131 131
                         })
132
-                         ->addColumn('grand_total', function ($model) {
133
-                             return ucfirst($model->number);
134
-                         })
135
-                          ->addColumn('status', function ($model) {
136
-                              return ucfirst($model->status);
137
-                          })
132
+                            ->addColumn('grand_total', function ($model) {
133
+                                return ucfirst($model->number);
134
+                            })
135
+                            ->addColumn('status', function ($model) {
136
+                                return ucfirst($model->status);
137
+                            })
138 138
 
139 139
                         ->addColumn('action', function ($model) {
140 140
                             $action = '';
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
                                     ."   $action";
149 149
                         })
150 150
 
151
-                         ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
151
+                            ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
152 152
                         ->make(true);
153 153
 
154 154
         // ->searchColumns('date', 'user_id', 'number', 'grand_total', 'status')
@@ -664,36 +664,36 @@  discard block
 block discarded – undo
664 664
                     // dd($rate);
665 665
                     $taxs = ([$rate['taxs']['0']['name'], $rate['taxs']['0']['rate']]);
666 666
                 } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
667
-                     $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first(); //In case of India when other tax is available and tax is not enabled
668
-                           if ($taxClassId) {
669
-                               $taxs = $cartController->getTaxByPriority($taxClassId);
670
-                               $value = $cartController->getValueForOthers($productid, $taxClassId, $taxs);
671
-                               if ($value == 0) {
672
-                                   $status = 0;
673
-                               }
674
-                               $rate = $value;
675
-                           } elseif ($geoip_country != 'IN') {//In case of other country when tax is available and tax is not enabled(Applicable when Global Tax class for any country and state is not there)
676
-
677
-                               $taxClassId = Tax::where('state', $geoip_state)->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first();
678
-
679
-                               // $taxClassId =Tax::where('country','!=','IN')->where(function($q) use($geoip_state,$geoip_country){
680
-                               //  $q->where('state', $geoip_state)->orWhere('country', $geoip_country);
681
-                               // })->pluck('tax_classes_id')->first();
682
-
683
-                               // dd($taxClassId);
684
-                               if ($taxClassId) { //if state equals the user State
685
-                                   $taxes = $cartController->getTaxByPriority($taxClassId);
686
-                                   $value = $cartController->getValueForOthers($productid, $taxClassId, $taxes);
687
-                                   if ($value == '') {
688
-                                       $status = 0;
689
-                                   }
690
-                                   $rate = $value;
691
-                               }
692
-                               $taxs = ([$taxes[0]['name'], $taxes[0]['rate']]);
693
-                               // dd($taxs);
694
-                               //                $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
667
+                        $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first(); //In case of India when other tax is available and tax is not enabled
668
+                            if ($taxClassId) {
669
+                                $taxs = $cartController->getTaxByPriority($taxClassId);
670
+                                $value = $cartController->getValueForOthers($productid, $taxClassId, $taxs);
671
+                                if ($value == 0) {
672
+                                    $status = 0;
673
+                                }
674
+                                $rate = $value;
675
+                            } elseif ($geoip_country != 'IN') {//In case of other country when tax is available and tax is not enabled(Applicable when Global Tax class for any country and state is not there)
676
+
677
+                                $taxClassId = Tax::where('state', $geoip_state)->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first();
678
+
679
+                                // $taxClassId =Tax::where('country','!=','IN')->where(function($q) use($geoip_state,$geoip_country){
680
+                                //  $q->where('state', $geoip_state)->orWhere('country', $geoip_country);
681
+                                // })->pluck('tax_classes_id')->first();
682
+
683
+                                // dd($taxClassId);
684
+                                if ($taxClassId) { //if state equals the user State
685
+                                    $taxes = $cartController->getTaxByPriority($taxClassId);
686
+                                    $value = $cartController->getValueForOthers($productid, $taxClassId, $taxes);
687
+                                    if ($value == '') {
688
+                                        $status = 0;
689
+                                    }
690
+                                    $rate = $value;
691
+                                }
692
+                                $taxs = ([$taxes[0]['name'], $taxes[0]['rate']]);
693
+                                // dd($taxs);
694
+                                //                $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
695 695
                 // $tax_value = '0%';
696
-                           }
696
+                            }
697 697
                     $taxs = ([$taxs[0]['name'], $taxs[0]['rate']]);
698 698
                 } else {
699 699
                     $taxs = ([$taxs[0]['name'], $taxs[0]['rate']]);
@@ -735,13 +735,13 @@  discard block
 block discarded – undo
735 735
             $state_code = $user_state->state_code;
736 736
 
737 737
             if ($state_code == $origin_state) {//If user and origin state are same
738
-             $taxClassId = TaxClass::where('name', 'Intra State GST')->pluck('id')->toArray(); //Get the class Id  of state
739
-               if ($taxClassId) {
740
-                   $taxes = $cartController->getTaxByPriority($taxClassId);
741
-                   $value = $cartController->getValueForSameState($productid, $c_gst, $s_gst, $taxClassId, $taxes);
742
-               } else {
743
-                   $taxes = [0];
744
-               }
738
+                $taxClassId = TaxClass::where('name', 'Intra State GST')->pluck('id')->toArray(); //Get the class Id  of state
739
+                if ($taxClassId) {
740
+                    $taxes = $cartController->getTaxByPriority($taxClassId);
741
+                    $value = $cartController->getValueForSameState($productid, $c_gst, $s_gst, $taxClassId, $taxes);
742
+                } else {
743
+                    $taxes = [0];
744
+                }
745 745
             } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
746 746
 
747 747
                 $taxClassId = TaxClass::where('name', 'Inter State GST')->pluck('id')->toArray(); //Get the class Id  of state
@@ -753,12 +753,12 @@  discard block
 block discarded – undo
753 753
                 }
754 754
             } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
755 755
         $taxClassId = TaxClass::where('name', 'Union Territory GST')->pluck('id')->toArray(); //Get the class Id  of state
756
-         if ($taxClassId) {
757
-             $taxes = $cartController->getTaxByPriority($taxClassId);
758
-             $value = $cartController->getValueForUnionTerritory($productid, $c_gst, $ut_gst, $taxClassId, $taxes);
759
-         } else {
760
-             $taxes = [0];
761
-         }
756
+            if ($taxClassId) {
757
+                $taxes = $cartController->getTaxByPriority($taxClassId);
758
+                $value = $cartController->getValueForUnionTerritory($productid, $c_gst, $ut_gst, $taxClassId, $taxes);
759
+            } else {
760
+                $taxes = [0];
761
+            }
762 762
             }
763 763
         } else {//If user from other Country
764 764
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -110,33 +110,33 @@
 block discarded – undo
110 110
         $new_invoice = Invoice::select('id', 'user_id', 'number', 'date', 'grand_total', 'status', 'created_at')->get();
111 111
 
112 112
         return \DataTables::of($new_invoice)
113
-                        ->addColumn('checkbox', function ($model) {
113
+                        ->addColumn('checkbox', function($model) {
114 114
                             return "<input type='checkbox' class='invoice_checkbox' value=".$model->id.' name=select[] id=check>';
115 115
                         })
116
-                        ->addColumn('user_id', function ($model) {
116
+                        ->addColumn('user_id', function($model) {
117 117
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
118 118
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
119 119
                             $id = $this->user->where('id', $model->user_id)->first()->id;
120 120
 
121 121
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
122 122
                         })
123
-                         ->addColumn('number', function ($model) {
123
+                         ->addColumn('number', function($model) {
124 124
                              return ucfirst($model->number);
125 125
                          })
126 126
 
127
-                        ->addColumn('date', function ($model) {
127
+                        ->addColumn('date', function($model) {
128 128
                             $date = date_create($model->created_at);
129 129
 
130 130
                             return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
131 131
                         })
132
-                         ->addColumn('grand_total', function ($model) {
132
+                         ->addColumn('grand_total', function($model) {
133 133
                              return ucfirst($model->number);
134 134
                          })
135
-                          ->addColumn('status', function ($model) {
135
+                          ->addColumn('status', function($model) {
136 136
                               return ucfirst($model->status);
137 137
                           })
138 138
 
139
-                        ->addColumn('action', function ($model) {
139
+                        ->addColumn('action', function($model) {
140 140
                             $action = '';
141 141
 
142 142
                             $check = $this->checkExecution($model->id);
Please login to merge, or discard this patch.
Braces   +20 added lines, -10 removed lines patch added patch discarded remove patch
@@ -663,7 +663,8 @@  discard block
 block discarded – undo
663 663
                     $rate = $this->getRate($productid, $taxs[0], $userid);
664 664
                     // dd($rate);
665 665
                     $taxs = ([$rate['taxs']['0']['name'], $rate['taxs']['0']['rate']]);
666
-                } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
666
+                } elseif ($this->tax_option->tax_enable == 0) {
667
+//if tax_enable is 0
667 668
                      $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first(); //In case of India when other tax is available and tax is not enabled
668 669
                            if ($taxClassId) {
669 670
                                $taxs = $cartController->getTaxByPriority($taxClassId);
@@ -672,7 +673,8 @@  discard block
 block discarded – undo
672 673
                                    $status = 0;
673 674
                                }
674 675
                                $rate = $value;
675
-                           } elseif ($geoip_country != 'IN') {//In case of other country when tax is available and tax is not enabled(Applicable when Global Tax class for any country and state is not there)
676
+                           } elseif ($geoip_country != 'IN') {
677
+//In case of other country when tax is available and tax is not enabled(Applicable when Global Tax class for any country and state is not there)
676 678
 
677 679
                                $taxClassId = Tax::where('state', $geoip_state)->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first();
678 680
 
@@ -681,7 +683,8 @@  discard block
 block discarded – undo
681 683
                                // })->pluck('tax_classes_id')->first();
682 684
 
683 685
                                // dd($taxClassId);
684
-                               if ($taxClassId) { //if state equals the user State
686
+                               if ($taxClassId) {
687
+//if state equals the user State
685 688
                                    $taxes = $cartController->getTaxByPriority($taxClassId);
686 689
                                    $value = $cartController->getValueForOthers($productid, $taxClassId, $taxes);
687 690
                                    if ($value == '') {
@@ -727,14 +730,16 @@  discard block
 block discarded – undo
727 730
         $i_gst = 0;
728 731
         $ut_gst = 0;
729 732
         $state_code = '';
730
-        if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
733
+        if ($user_state != '') {
734
+//Get the CGST,SGST,IGST,STATE_CODE of the user
731 735
             $c_gst = $user_state->c_gst;
732 736
             $s_gst = $user_state->s_gst;
733 737
             $i_gst = $user_state->i_gst;
734 738
             $ut_gst = $user_state->ut_gst;
735 739
             $state_code = $user_state->state_code;
736 740
 
737
-            if ($state_code == $origin_state) {//If user and origin state are same
741
+            if ($state_code == $origin_state) {
742
+//If user and origin state are same
738 743
              $taxClassId = TaxClass::where('name', 'Intra State GST')->pluck('id')->toArray(); //Get the class Id  of state
739 744
                if ($taxClassId) {
740 745
                    $taxes = $cartController->getTaxByPriority($taxClassId);
@@ -742,7 +747,8 @@  discard block
 block discarded – undo
742 747
                } else {
743 748
                    $taxes = [0];
744 749
                }
745
-            } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
750
+            } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {
751
+//If user is from other state
746 752
 
747 753
                 $taxClassId = TaxClass::where('name', 'Inter State GST')->pluck('id')->toArray(); //Get the class Id  of state
748 754
                 if ($taxClassId) {
@@ -751,7 +757,8 @@  discard block
 block discarded – undo
751 757
                 } else {
752 758
                     $taxes = [0];
753 759
                 }
754
-            } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
760
+            } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {
761
+//if user from Union Territory
755 762
         $taxClassId = TaxClass::where('name', 'Union Territory GST')->pluck('id')->toArray(); //Get the class Id  of state
756 763
          if ($taxClassId) {
757 764
              $taxes = $cartController->getTaxByPriority($taxClassId);
@@ -760,18 +767,21 @@  discard block
 block discarded – undo
760 767
              $taxes = [0];
761 768
          }
762 769
             }
763
-        } else {//If user from other Country
770
+        } else {
771
+//If user from other Country
764 772
 
765 773
             $taxClassId = Tax::where('state', $geoip_state)->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first();
766 774
 
767
-            if ($taxClassId) { //if state equals the user State
775
+            if ($taxClassId) {
776
+//if state equals the user State
768 777
 
769 778
                 $taxes = $cartController->getTaxByPriority($taxClassId);
770 779
 
771 780
                 // $taxes = $this->cartController::getTaxByPriority($taxClassId);
772 781
                 $value = $cartController->getValueForOthers($productid, $taxClassId, $taxes);
773 782
                 $rate = $value;
774
-            } else {//if Tax is selected for Any State Any Country
783
+            } else {
784
+//if Tax is selected for Any State Any Country
775 785
                 $taxClassId = Tax::where('country', '')->where('state', 'Any State')->pluck('tax_classes_id')->first();
776 786
                 if ($taxClassId) {
777 787
                     $taxes = $cartController->getTaxByPriority($taxClassId);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1187,7 +1187,7 @@
 block discarded – undo
1187 1187
                 return redirect()->back()->with('fails', 'Can not delete');
1188 1188
             }
1189 1189
 
1190
-            return redirect()->back()->with('success', "Invoice $invoice->number has Deleted Successfully");
1190
+            return redirect()->back()->with('success', "invoice $invoice->number has Deleted Successfully");
1191 1191
         } catch (\Exception $e) {
1192 1192
             Bugsnag::notifyExeption($e);
1193 1193
 
Please login to merge, or discard this patch.
app/Http/Controllers/Order/OrderController.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@
 block discarded – undo
162 162
                             return '<p><a href='.url('orders/'.$model->id)." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-eye' style='color:white;'> </i>&nbsp;&nbsp;View</a> $url</p>";
163 163
                         })
164 164
 
165
-                         ->rawColumns(['checkbox', 'date', 'client', 'number', 'price_override', 'order_status', 'ends_at', 'action'])
165
+                            ->rawColumns(['checkbox', 'date', 'client', 'number', 'price_override', 'order_status', 'ends_at', 'action'])
166 166
                         ->make(true);
167 167
         // ->searchColumns('order_status', 'number', 'price_override', 'client', 'ends_at')
168 168
                         // ->orderColumns('client', 'date', 'number', 'price_override')
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -110,15 +110,15 @@  discard block
 block discarded – undo
110 110
         //'price_override', 'order_status', 'number', 'serial_key'))
111 111
         return\ DataTables::of($query->get())
112 112
 
113
-                        ->addColumn('checkbox', function ($model) {
113
+                        ->addColumn('checkbox', function($model) {
114 114
                             return "<input type='checkbox' class='order_checkbox' value=".$model->id.' name=select[] id=check>';
115 115
                         })
116
-                        ->addColumn('date', function ($model) {
116
+                        ->addColumn('date', function($model) {
117 117
                             $date = $model->created_at;
118 118
 
119 119
                             return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m A');
120 120
                         })
121
-                        ->addColumn('client', function ($model) {
121
+                        ->addColumn('client', function($model) {
122 122
                             $user = $this->user->where('id', $model->client)->first();
123 123
                             $first = $user->first_name;
124 124
                             $last = $user->last_name;
@@ -126,17 +126,17 @@  discard block
 block discarded – undo
126 126
 
127 127
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'<a>';
128 128
                         })
129
-                        ->addColumn('number', function ($model) {
129
+                        ->addColumn('number', function($model) {
130 130
                             return ucfirst($model->number);
131 131
                         })
132
-                        ->addColumn('price_override', function ($model) {
132
+                        ->addColumn('price_override', function($model) {
133 133
                             return ucfirst($model->price_override);
134 134
                         })
135
-                        ->addColumn('order_status', function ($model) {
135
+                        ->addColumn('order_status', function($model) {
136 136
                             return ucfirst($model->order_status);
137 137
                         })
138 138
                         // ->showColumns('number', 'price_override', 'order_status')
139
-                        ->addColumn('ends_at', function ($model) {
139
+                        ->addColumn('ends_at', function($model) {
140 140
                             $end = '--';
141 141
                             $ends = $model->subscription()->first();
142 142
                             if ($ends) {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
                             return $end;
151 151
                         })
152
-                        ->addColumn('action', function ($model) {
152
+                        ->addColumn('action', function($model) {
153 153
                             $sub = $model->subscription()->first();
154 154
                             $status = $this->checkInvoiceStatusByOrderId($model->id);
155 155
                             $url = '';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -593,7 +593,7 @@
 block discarded – undo
593 593
                 return redirect()->back()->with('fails', 'Can not delete');
594 594
             }
595 595
 
596
-            return redirect()->back()->with('success', "Order $order->number has Deleted Successfully");
596
+            return redirect()->back()->with('success', "order $order->number has Deleted Successfully");
597 597
         } catch (\Exception $e) {
598 598
             Bugsnag::notifyException($e);
599 599
 
Please login to merge, or discard this patch.
app/Http/Controllers/Common/SocialMediaController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,20 +35,20 @@
 block discarded – undo
35 35
             $social = $this->social->get();
36 36
 
37 37
             return \DataTables::of($social)
38
-                            ->addColumn('#', function ($model) {
38
+                            ->addColumn('#', function($model) {
39 39
                                 return "<input type='checkbox' value=".$model->id.' name=select[] id=check>';
40 40
                             })
41
-                            ->addColumn('name', function ($model) {
41
+                            ->addColumn('name', function($model) {
42 42
                                 return $model->name;
43 43
                             })
44
-                            ->addColumn('class', function ($model) {
44
+                            ->addColumn('class', function($model) {
45 45
                                 return $model->class;
46 46
                             })
47
-                            ->addColumn('link', function ($model) {
47
+                            ->addColumn('link', function($model) {
48 48
                                 return $model->link;
49 49
                             })
50 50
                             // ->showColumns('name', 'class', 'link')
51
-                            ->addColumn('action', function ($model) {
51
+                            ->addColumn('action', function($model) {
52 52
                                 return '<a href='.url('social-media/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>";
53 53
                             })
54 54
                             ->rawColumns(['name', 'class', 'link', 'action'])
Please login to merge, or discard this patch.
app/Http/Controllers/Common/TemplateController.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -133,9 +133,9 @@
 block discarded – undo
133 133
                             return "<input type='checkbox' class='template_checkbox' value=".$model->id.' name=select[] id=check>';
134 134
                         })
135 135
 
136
-                         ->addColumn('name', function ($model) {
137
-                             return $model->name;
138
-                         })
136
+                            ->addColumn('name', function ($model) {
137
+                                return $model->name;
138
+                            })
139 139
                         ->addColumn('type', function ($model) {
140 140
                             return $this->type->where('id', $model->type)->first()->name;
141 141
                         })
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -129,17 +129,17 @@  discard block
 block discarded – undo
129 129
     public function getTemplates()
130 130
     {
131 131
         return \DataTables::of($this->template->select('id', 'name', 'type')->get())
132
-                        ->addColumn('checkbox', function ($model) {
132
+                        ->addColumn('checkbox', function($model) {
133 133
                             return "<input type='checkbox' class='template_checkbox' value=".$model->id.' name=select[] id=check>';
134 134
                         })
135 135
 
136
-                         ->addColumn('name', function ($model) {
136
+                         ->addColumn('name', function($model) {
137 137
                              return $model->name;
138 138
                          })
139
-                        ->addColumn('type', function ($model) {
139
+                        ->addColumn('type', function($model) {
140 140
                             return $this->type->where('id', $model->type)->first()->name;
141 141
                         })
142
-                        ->addColumn('action', function ($model) {
142
+                        ->addColumn('action', function($model) {
143 143
                             return '<a href='.url('templates/'.$model->id.'/edit')." class='btn btn-sm btn-primary'>Edit</a>";
144 144
                         })
145 145
                         ->rawColumns(['checkbox', 'name', 'type', 'action'])
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 
328 328
             /*Mail config ends*/
329 329
 
330
-            \Mail::send('emails.mail', ['data' => $data], function ($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) {
330
+            \Mail::send('emails.mail', ['data' => $data], function($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) {
331 331
                 $m->from($from, $fromname);
332 332
 
333 333
                 $m->to($to, $toname)->subject($subject);
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -570,9 +570,11 @@
 block discarded – undo
570 570
 
571 571
             // $location = json_decode(file_get_contents('http://ip-api.com/json/'.$ip), true);
572 572
             // $location = json_decode(file_get_contents('http://ip-api.com/json'), true);
573
-            if (!empty($_SERVER['HTTP_CLIENT_IP'])) {   //check ip from share internet
573
+            if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
574
+//check ip from share internet
574 575
             $ip = $_SERVER['HTTP_CLIENT_IP'];
575
-            } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {   //to check ip is pass from proxy
576
+            } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
577
+//to check ip is pass from proxy
576 578
                 $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
577 579
             } else {
578 580
                 $ip = $_SERVER['REMOTE_ADDR'];
Please login to merge, or discard this patch.
app/Http/Controllers/RazorpayController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,8 @@
 block discarded – undo
55 55
         $api = new Api(config('custom.razor_key'), config('custom.razor_secret'));
56 56
         $payment = $api->payment->fetch($input['razorpay_payment_id']);
57 57
 
58
-        if (count($input) && !empty($input['razorpay_payment_id'])) { //Verify Razorpay Payment Id and Signature
58
+        if (count($input) && !empty($input['razorpay_payment_id'])) {
59
+//Verify Razorpay Payment Id and Signature
59 60
 
60 61
             //Fetch payment information by razorpay_payment_id
61 62
             try {
Please login to merge, or discard this patch.
app/Providers/RouteServiceProvider.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
     protected function mapWebRoutes()
53 53
     {
54 54
         Route::middleware('web')
55
-             ->namespace($this->namespace)
56
-             ->group(base_path('routes/web.php'));
55
+                ->namespace($this->namespace)
56
+                ->group(base_path('routes/web.php'));
57 57
     }
58 58
 
59 59
     /**
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
     protected function mapApiRoutes()
67 67
     {
68 68
         Route::prefix('api')
69
-             ->middleware('api')
70
-             ->namespace($this->namespace)
71
-             ->group(base_path('routes/api.php'));
69
+                ->middleware('api')
70
+                ->namespace($this->namespace)
71
+                ->group(base_path('routes/api.php'));
72 72
     }
73 73
 }
Please login to merge, or discard this patch.
app/Console/Kernel.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      */
15 15
     protected $commands = [
16 16
         //
17
-         'App\Console\Commands\Inspire',
17
+            'App\Console\Commands\Inspire',
18 18
         \App\Console\Commands\Install::class,
19 19
         'App\Console\Commands\ExpiryCron',
20 20
     ];
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     protected function schedule(Schedule $schedule)
30 30
     {
31 31
         $schedule->command('inspire')
32
-                 ->hourly();
32
+                    ->hourly();
33 33
 
34 34
         $schedule->command('expiry')->hourly();
35 35
     }
Please login to merge, or discard this patch.
app/Plugins/Ccavanue/views/settings.blade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
                         <div class="pull-right">
49 49
 
50 50
                             <?php
51
-                            $status=0;
51
+                            $status = 0;
52 52
 
53 53
                             ?>
54 54
                             <div class="btn-group {{$status == '0' ? 'locked_active unlocked_inactive' : 'locked_inactive unlocked_active'}}" id="toggle_event" style="margin-top:-8px">
Please login to merge, or discard this patch.