Completed
Push — development ( 00627b...6692d3 )
by Ashutosh
22:08 queued 10:22
created
app/Http/Controllers/BaseHomeController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
     public function checkUpdatesExpiry(Request $request)
147 147
     {
148 148
         $v = \Validator::make($request->all(), [
149
-          'order_number' => 'required',
149
+            'order_number' => 'required',
150 150
         ]);
151 151
         if ($v->fails()) {
152 152
             $error = $v->errors();
Please login to merge, or discard this patch.
app/Http/Controllers/HomeController.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             $serial_key = $this->checkSerialKey($faveo_encrypted_key, $order_number);
96 96
 
97 97
             \Log::emergency(json_encode(['domain' => $request->input('domain'),
98
-             'serial'                             => $serial_key, 'order' => $order_number, ]));
98
+                'serial'                             => $serial_key, 'order' => $order_number, ]));
99 99
             $result = [];
100 100
             if ($request_type == 'install') {
101 101
                 $result = $this->verificationResult($order_number, $serial_key);
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
                     ->value('serial_key');
350 350
 
351 351
             $this_order = $order
352
-                     ->where('number', $faveo_encrypted_order_number)
352
+                        ->where('number', $faveo_encrypted_order_number)
353 353
                     ->first();
354 354
             if ($this_order && $orderSerialKey == $faveo_serial_key) {
355 355
                 $product_id = $this_order->product;
Please login to merge, or discard this patch.
app/Http/Kernel.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
         \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
18 18
         \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
19 19
         // \App\Http\Middleware\TrimStrings::class,
20
-          \Illuminate\Session\Middleware\StartSession::class,
21
-             \Illuminate\View\Middleware\ShareErrorsFromSession::class,
22
-              // \Torann\Currency\Middleware\CurrencyMiddleware::class,
20
+            \Illuminate\Session\Middleware\StartSession::class,
21
+                \Illuminate\View\Middleware\ShareErrorsFromSession::class,
22
+                // \Torann\Currency\Middleware\CurrencyMiddleware::class,
23 23
         // \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
24 24
     ];
25 25
 
@@ -30,21 +30,21 @@  discard block
 block discarded – undo
30 30
      */
31 31
     protected $middlewareGroups = [
32 32
         'web' => [
33
-             \App\Http\Middleware\Install::class,
33
+                \App\Http\Middleware\Install::class,
34 34
             \App\Http\Middleware\EncryptCookies::class,
35 35
             \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
36 36
             // \Illuminate\Session\Middleware\StartSession::class,
37 37
             // \Illuminate\Session\Middleware\AuthenticateSession::class,
38 38
             // \Illuminate\View\Middleware\ShareErrorsFromSession::class,
39
-           // \App\Http\Middleware\VerifyCsrfToken::class,
39
+            // \App\Http\Middleware\VerifyCsrfToken::class,
40 40
             \Illuminate\Routing\Middleware\SubstituteBindings::class,
41 41
             \Barryvdh\Cors\HandleCors::class,
42
-             // \App\Http\Middleware\IsInstalled::class,
42
+                // \App\Http\Middleware\IsInstalled::class,
43 43
 
44 44
         ],
45
-         'admin'        => [\App\Http\Middleware\Admin::class],
46
-          'guest'       => [\App\Http\Middleware\RedirectIfAuthenticated::class],
47
-           'auth'       => [\Illuminate\Auth\Middleware\Authenticate::class],
45
+            'admin'        => [\App\Http\Middleware\Admin::class],
46
+            'guest'       => [\App\Http\Middleware\RedirectIfAuthenticated::class],
47
+            'auth'       => [\Illuminate\Auth\Middleware\Authenticate::class],
48 48
         'auth.basic'    => [\Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class],
49 49
 
50 50
         'api' => [
Please login to merge, or discard this patch.
app/Http/Requests/User/ProfileRequest.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,10 +45,10 @@
 block discarded – undo
45 45
             $userid = \Auth::user()->id;
46 46
 
47 47
             return [
48
-                     'first_name'            => 'required|min:3|max:30',
48
+                        'first_name'            => 'required|min:3|max:30',
49 49
                     'last_name'              => 'required|max:30',
50
-                     'mobile'                => 'required|regex:/[0-9]/|min:5|max:20',
51
-                     'email'                 => 'required',
50
+                        'mobile'                => 'required|regex:/[0-9]/|min:5|max:20',
51
+                        'email'                 => 'required',
52 52
                     'mobile_code'            => 'required|numeric',
53 53
                     'mobile'                 => 'required|numeric',
54 54
                     'zip'                    => 'required|numeric',
Please login to merge, or discard this patch.
app/Http/Controllers/Product/BaseProductController.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -126,7 +126,8 @@  discard block
 block discarded – undo
126 126
 
127 127
             $plan = new Plan();
128 128
             $plans = $plan->where('product', $productid)->pluck('name', 'id')->toArray();
129
-            if (count($plans) > 0) {//If Plan Exist For A product, Display Dropdown for Plans
129
+            if (count($plans) > 0) {
130
+//If Plan Exist For A product, Display Dropdown for Plans
130 131
                 $field = "<div class='col-md-4 form-group'>
131 132
                         <label class='required'>"./* @scrutinizer ignore-type */
132 133
                         \Lang::get('message.subscription').'</label>
@@ -137,7 +138,8 @@  discard block
 block discarded – undo
137 138
                             ['class' => 'form-control required', 'id' => 'plan', 'onchange' => 'getPrice(this.value)']
138 139
                         ).'
139 140
                 </div>';
140
-            } else {//If No Plan Exist For A Product
141
+            } else {
142
+//If No Plan Exist For A Product
141 143
                 $userid = $request->input('user');
142 144
                 $price = $controller->cost($productid, $userid);
143 145
             }
@@ -203,7 +205,8 @@  discard block
 block discarded – undo
203 205
 
204 206
     public function getRelease($owner, $repository, $order_id, $file)
205 207
     {
206
-        if ($owner && $repository) {//If the Product is downloaded from Github
208
+        if ($owner && $repository) {
209
+//If the Product is downloaded from Github
207 210
             $github_controller = new \App\Http\Controllers\Github\GithubController();
208 211
             $relese = $github_controller->listRepositories($owner, $repository, $order_id);
209 212
 
Please login to merge, or discard this patch.
app/Http/Controllers/Front/PageController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
78 78
                         })
79 79
 
80
-                          ->rawColumns(['checkbox', 'name', 'url',  'created_at', 'action'])
80
+                            ->rawColumns(['checkbox', 'name', 'url',  'created_at', 'action'])
81 81
                         ->make(true);
82 82
         // ->searchColumns('name', 'content')
83 83
                         // ->orderColumns('name')
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -49,17 +49,17 @@  discard block
 block discarded – undo
49 49
     public function getPages()
50 50
     {
51 51
         return \DataTables::of($this->page->get())
52
-                        ->addColumn('checkbox', function ($model) {
52
+                        ->addColumn('checkbox', function($model) {
53 53
                             return "<input type='checkbox' class='page_checkbox' 
54 54
                             value=".$model->id.' name=select[] id=check>';
55 55
                         })
56
-                        ->addColumn('name', function ($model) {
56
+                        ->addColumn('name', function($model) {
57 57
                             return ucfirst($model->name);
58 58
                         })
59
-                        ->addColumn('url', function ($model) {
59
+                        ->addColumn('url', function($model) {
60 60
                             return $model->url;
61 61
                         })
62
-                        ->addColumn('created_at', function ($model) {
62
+                        ->addColumn('created_at', function($model) {
63 63
                             $created = $model->created_at;
64 64
                             if ($created) {
65 65
                                 $date1 = new \DateTime($created);
@@ -71,13 +71,13 @@  discard block
 block discarded – undo
71 71
                             return $createdate;
72 72
                         })
73 73
 
74
-                        ->addColumn('action', function ($model) {
74
+                        ->addColumn('action', function($model) {
75 75
                             return '<a href='.url('pages/'.$model->id.'/edit')
76 76
                             ." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit'
77 77
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
78 78
                         })
79 79
 
80
-                          ->rawColumns(['checkbox', 'name', 'url',  'created_at', 'action'])
80
+                          ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'action'])
81 81
                         ->make(true);
82 82
         // ->searchColumns('name', 'content')
83 83
                         // ->orderColumns('name')
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
             $selectedParent = $this->page->where('id', $id)->pluck('parent_page_id')->toArray();
110 110
             $parentName = $this->page->where('id', $selectedParent)->pluck('name', 'id')->toArray();
111 111
 
112
-            return view('themes.default1.front.page.edit', compact('parents', 'page', 'default', 'selectedDefault', 'publishingDate','selectedParent',
112
+            return view('themes.default1.front.page.edit', compact('parents', 'page', 'default', 'selectedDefault', 'publishingDate', 'selectedParent',
113 113
                 'parentName'));
114 114
         } catch (\Exception $ex) {
115 115
             return redirect()->back()->with('fails', $ex->getMessage());
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ProductController.php 3 patches
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -190,7 +190,8 @@  discard block
 block discarded – undo
190 190
             $this->product_upload->save();
191 191
             $this->product->where('id', $product_id->id)->update(['version'=>$request->input('version')]);
192 192
             $autoUpdateStatus = StatusSetting::pluck('update_settings')->first();
193
-            if ($autoUpdateStatus == 1) { //If License Setting Status is on,Add Product to the License Manager
193
+            if ($autoUpdateStatus == 1) {
194
+//If License Setting Status is on,Add Product to the License Manager
194 195
                 $updateClassObj = new \App\Http\Controllers\AutoUpdate\AutoUpdateController();
195 196
                 $addProductToAutoUpdate = $updateClassObj->addNewVersion($product_id->id, $request->input('version'), $request->input('filename'), '1');
196 197
             }
@@ -280,7 +281,8 @@  discard block
 block discarded – undo
280 281
 
281 282
         try {
282 283
             $licenseStatus = StatusSetting::pluck('license_status')->first();
283
-            if ($licenseStatus == 1) { //If License Setting Status is on,Add Product to the License Manager
284
+            if ($licenseStatus == 1) {
285
+//If License Setting Status is on,Add Product to the License Manager
284 286
                 $addProductToLicensing = $this->licensing->addNewProduct($input['name'], $input['product_sku']);
285 287
             }
286 288
             $licenseCont = new \App\Http\Controllers\AutoUpdate\AutoUpdateController();
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
                             ->addColumn('name', function ($model) {
126 126
                                 return ucfirst($model->name);
127 127
                             })
128
-                              ->addColumn('image', function ($model) {
129
-                                  // return $model->image;
130
-                                  return "<img src= '$model->image' + height=\"80\"/>";
131
-                              })
128
+                                ->addColumn('image', function ($model) {
129
+                                    // return $model->image;
130
+                                    return "<img src= '$model->image' + height=\"80\"/>";
131
+                                })
132 132
                             ->addColumn('type', function ($model) {
133 133
                                 if ($this->type->where('id', $model->type)->first()) {
134 134
                                     return $this->type->where('id', $model->type)->first()->name;
@@ -173,11 +173,11 @@  discard block
 block discarded – undo
173 173
         $this->validate(
174 174
             $request,
175 175
             [
176
-       'producttitle'  => 'required',
176
+        'producttitle'  => 'required',
177 177
         'version'      => 'required',
178
-       'filename'      => 'required',
179
-       ],
180
-       ['filename.required' => 'Please Uplaod A file',
178
+        'filename'      => 'required',
179
+        ],
180
+        ['filename.required' => 'Please Uplaod A file',
181 181
         ]
182 182
         );
183 183
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -118,25 +118,25 @@  discard block
 block discarded – undo
118 118
 
119 119
             return\ DataTables::of($new_product)
120 120
 
121
-                            ->addColumn('checkbox', function ($model) {
121
+                            ->addColumn('checkbox', function($model) {
122 122
                                 return "<input type='checkbox' class='product_checkbox' 
123 123
                                 value=".$model->id.' name=select[] id=check>';
124 124
                             })
125
-                            ->addColumn('name', function ($model) {
125
+                            ->addColumn('name', function($model) {
126 126
                                 return ucfirst($model->name);
127 127
                             })
128
-                              ->addColumn('image', function ($model) {
128
+                              ->addColumn('image', function($model) {
129 129
                                   // return $model->image;
130 130
                                   return "<img src= '$model->image' + height=\"80\"/>";
131 131
                               })
132
-                            ->addColumn('type', function ($model) {
132
+                            ->addColumn('type', function($model) {
133 133
                                 if ($this->type->where('id', $model->type)->first()) {
134 134
                                     return $this->type->where('id', $model->type)->first()->name;
135 135
                                 } else {
136 136
                                     return 'Not available';
137 137
                                 }
138 138
                             })
139
-                            ->addColumn('group', function ($model) {
139
+                            ->addColumn('group', function($model) {
140 140
                                 if ($this->group->where('id', $model->group)->first()) {
141 141
                                     return $this->group->where('id', $model->group)->first()->name;
142 142
                                 } else {
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
                                 }
145 145
                             })
146 146
 
147
-                            ->addColumn('Action', function ($model) {
147
+                            ->addColumn('Action', function($model) {
148 148
                                 $permissions = LicensePermissionsController::getPermissionsForProduct($model->id);
149 149
                                 $url = '';
150 150
                                 if ($permissions['downloadPermission'] == 1) {
Please login to merge, or discard this patch.
app/Http/Controllers/Order/ExtendedOrderController.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -49,16 +49,16 @@  discard block
 block discarded – undo
49 49
             $this->domain($domain, $join);
50 50
 
51 51
             $join = $join->orderBy('created_at', 'desc')
52
-           ->select(
53
-               'orders.id',
54
-               'orders.created_at',
55
-               'client',
56
-               'price_override',
57
-               'order_status',
58
-               'product',
59
-               'number',
60
-               'serial_key'
61
-           );
52
+            ->select(
53
+                'orders.id',
54
+                'orders.created_at',
55
+                'client',
56
+                'price_override',
57
+                'order_status',
58
+                'product',
59
+                'number',
60
+                'serial_key'
61
+            );
62 62
 
63 63
             return $join;
64 64
         } catch (\Exception $ex) {
@@ -268,17 +268,17 @@  discard block
 block discarded – undo
268 268
                 case '1':
269 269
                    $lastFour = '000'.$agents;
270 270
                     break;
271
-                   case '2':
271
+                    case '2':
272 272
 
273 273
                     $lastFour = '00'.$agents;
274
-                     break;
275
-                      case '3':
274
+                        break;
275
+                        case '3':
276 276
                     $lastFour = '0'.$agents;
277
-                     break;
278
-                      case '4':
277
+                        break;
278
+                        case '4':
279 279
                     $lastFour = $agents;
280 280
 
281
-                     break;
281
+                        break;
282 282
                 default:
283 283
                     $lastFour = '0000';
284 284
                     break;
Please login to merge, or discard this patch.
app/Http/Controllers/Order/InvoiceController.php 3 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $from = $request->input('from');
109 109
             $till = $request->input('till');
110 110
 
111
-            return view('themes.default1.invoice.index', compact('name','invoice_no','status','currencies','currency_id','from',
111
+            return view('themes.default1.invoice.index', compact('name', 'invoice_no', 'status', 'currencies', 'currency_id', 'from',
112 112
 
113 113
                 'till'));
114 114
         } catch (\Exception $ex) {
@@ -131,35 +131,35 @@  discard block
 block discarded – undo
131 131
         return \DataTables::of($query->take(100))
132 132
          ->setTotalRecords($query->count())
133 133
 
134
-         ->addColumn('checkbox', function ($model) {
134
+         ->addColumn('checkbox', function($model) {
135 135
              return "<input type='checkbox' class='invoice_checkbox' 
136 136
                             value=".$model->id.' name=select[] id=check>';
137 137
          })
138
-                        ->addColumn('user_id', function ($model) {
138
+                        ->addColumn('user_id', function($model) {
139 139
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
140 140
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
141 141
                             $id = $this->user->where('id', $model->user_id)->first()->id;
142 142
 
143 143
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
144 144
                         })
145
-                         ->addColumn('number', function ($model) {
145
+                         ->addColumn('number', function($model) {
146 146
                              return ucfirst($model->number);
147 147
                          })
148 148
 
149
-                        ->addColumn('date', function ($model) {
149
+                        ->addColumn('date', function($model) {
150 150
                             $date = ($model->created_at);
151 151
 
152 152
                             return $date;
153 153
                             // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
154 154
                         })
155
-                         ->addColumn('grand_total', function ($model) {
155
+                         ->addColumn('grand_total', function($model) {
156 156
                              return $model->grand_total;
157 157
                          })
158
-                          ->addColumn('status', function ($model) {
158
+                          ->addColumn('status', function($model) {
159 159
                               return ucfirst($model->status);
160 160
                           })
161 161
 
162
-                        ->addColumn('action', function ($model) {
162
+                        ->addColumn('action', function($model) {
163 163
                             $action = '';
164 164
 
165 165
                             $check = $this->checkExecution($model->id);
@@ -175,25 +175,25 @@  discard block
 block discarded – undo
175 175
                             style='color:white;'> </i>&nbsp;&nbsp;View</a>"
176 176
                                     ."   $action";
177 177
                         })
178
-                         ->filterColumn('user_id', function ($query, $keyword) {
178
+                         ->filterColumn('user_id', function($query, $keyword) {
179 179
                              $sql = 'first_name like ?';
180 180
                              $query->whereRaw($sql, ["%{$keyword}%"]);
181 181
                          })
182 182
 
183
-                          ->filterColumn('status', function ($query, $keyword) {
183
+                          ->filterColumn('status', function($query, $keyword) {
184 184
                               $sql = 'status like ?';
185 185
                               $query->whereRaw($sql, ["%{$keyword}%"]);
186 186
                           })
187 187
 
188
-                        ->filterColumn('number', function ($query, $keyword) {
188
+                        ->filterColumn('number', function($query, $keyword) {
189 189
                             $sql = 'number like ?';
190 190
                             $query->whereRaw($sql, ["%{$keyword}%"]);
191 191
                         })
192
-                         ->filterColumn('grand_total', function ($query, $keyword) {
192
+                         ->filterColumn('grand_total', function($query, $keyword) {
193 193
                              $sql = 'grand_total like ?';
194 194
                              $query->whereRaw($sql, ["%{$keyword}%"]);
195 195
                          })
196
-                          ->filterColumn('date', function ($query, $keyword) {
196
+                          ->filterColumn('date', function($query, $keyword) {
197 197
                               $sql = 'date like ?';
198 198
                               $query->whereRaw($sql, ["%{$keyword}%"]);
199 199
                           })
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
 
422 422
             $invoice = Invoice::create(['user_id' => $user_id, 'number' => $number, 'date' => $date,
423 423
              'coupon_code'                        => $code, 'discount'=>$codeValue,
424
-                'grand_total'                     => $grand_total,  'currency'  => $currency, 'status' => $status, 'description' => $description, ]);
424
+                'grand_total'                     => $grand_total, 'currency'  => $currency, 'status' => $status, 'description' => $description, ]);
425 425
 
426 426
             $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid,
427 427
              $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate);
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -494,7 +494,8 @@  discard block
 block discarded – undo
494 494
                 if (count($tax_class_id) > 0) {
495 495
                     if ($this->tax_option->findOrFail(1)->tax_enable == 1) {
496 496
                         $taxs = $this->getTaxWhenEnable($productid, $taxs[0], $userid);
497
-                    } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
497
+                    } elseif ($this->tax_option->tax_enable == 0) {
498
+//if tax_enable is 0
498 499
 
499 500
                         $taxClassId = Tax::where('country', '')->where('state', 'Any State')
500 501
                      ->pluck('tax_classes_id')->first(); //In case of India when
@@ -503,13 +504,15 @@  discard block
 block discarded – undo
503 504
                             $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
504 505
                             $taxs = $rate['taxes'];
505 506
                             $rate = $rate['rate'];
506
-                        } elseif ($geoip_country != 'IN') {//In case of other country
507
+                        } elseif ($geoip_country != 'IN') {
508
+//In case of other country
507 509
                             // when tax is available and tax is not enabled(Applicable
508 510
                             //when Global Tax class for any country and state is not there)
509 511
 
510 512
                             $taxClassId = Tax::where('state', $geoip_state)
511 513
                         ->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first();
512
-                            if ($taxClassId) { //if state equals the user State
514
+                            if ($taxClassId) {
515
+//if state equals the user State
513 516
                                 $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
514 517
                                 $taxs = $rate['taxes'];
515 518
                                 $rate = $rate['rate'];
@@ -552,11 +555,13 @@  discard block
 block discarded – undo
552 555
         $i_gst = 0;
553 556
         $ut_gst = 0;
554 557
         $state_code = '';
555
-        if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
558
+        if ($user_state != '') {
559
+//Get the CGST,SGST,IGST,STATE_CODE of the user
556 560
             $tax = $this->getTaxWhenState($user_state, $productid, $origin_state);
557 561
             $taxes = $tax['taxes'];
558 562
             $value = $tax['value'];
559
-        } else {//If user from other Country
563
+        } else {
564
+//If user from other Country
560 565
             $tax = $this->getTaxWhenOtherCountry($geoip_state, $geoip_country, $productid);
561 566
             $taxes = $tax['taxes'];
562 567
             $value = $tax['value'];
Please login to merge, or discard this patch.
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
         $query = $this->advanceSearch($name, $invoice_no, $currency, $status, $from, $till);
131 131
 
132 132
         return \DataTables::of($query->take(100))
133
-         ->setTotalRecords($query->count())
133
+            ->setTotalRecords($query->count())
134 134
 
135
-         ->addColumn('checkbox', function ($model) {
136
-             return "<input type='checkbox' class='invoice_checkbox' 
135
+            ->addColumn('checkbox', function ($model) {
136
+                return "<input type='checkbox' class='invoice_checkbox' 
137 137
                             value=".$model->id.' name=select[] id=check>';
138
-         })
138
+            })
139 139
                         ->addColumn('user_id', function ($model) {
140 140
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
141 141
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
 
144 144
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
145 145
                         })
146
-                         ->addColumn('number', function ($model) {
147
-                             return ucfirst($model->number);
148
-                         })
146
+                            ->addColumn('number', function ($model) {
147
+                                return ucfirst($model->number);
148
+                            })
149 149
 
150 150
                         ->addColumn('date', function ($model) {
151 151
                             $date = ($model->created_at);
@@ -153,12 +153,12 @@  discard block
 block discarded – undo
153 153
                             return $date;
154 154
                             // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
155 155
                         })
156
-                         ->addColumn('grand_total', function ($model) {
157
-                             return $model->grand_total;
158
-                         })
159
-                          ->addColumn('status', function ($model) {
160
-                              return ucfirst($model->status);
161
-                          })
156
+                            ->addColumn('grand_total', function ($model) {
157
+                                return $model->grand_total;
158
+                            })
159
+                            ->addColumn('status', function ($model) {
160
+                                return ucfirst($model->status);
161
+                            })
162 162
 
163 163
                         ->addColumn('action', function ($model) {
164 164
                             $action = '';
@@ -176,30 +176,30 @@  discard block
 block discarded – undo
176 176
                             style='color:white;'> </i>&nbsp;&nbsp;View</a>"
177 177
                                     ."   $action";
178 178
                         })
179
-                         ->filterColumn('user_id', function ($query, $keyword) {
180
-                             $sql = 'first_name like ?';
181
-                             $query->whereRaw($sql, ["%{$keyword}%"]);
182
-                         })
179
+                            ->filterColumn('user_id', function ($query, $keyword) {
180
+                                $sql = 'first_name like ?';
181
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
182
+                            })
183 183
 
184
-                          ->filterColumn('status', function ($query, $keyword) {
185
-                              $sql = 'status like ?';
186
-                              $query->whereRaw($sql, ["%{$keyword}%"]);
187
-                          })
184
+                            ->filterColumn('status', function ($query, $keyword) {
185
+                                $sql = 'status like ?';
186
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
187
+                            })
188 188
 
189 189
                         ->filterColumn('number', function ($query, $keyword) {
190 190
                             $sql = 'number like ?';
191 191
                             $query->whereRaw($sql, ["%{$keyword}%"]);
192 192
                         })
193
-                         ->filterColumn('grand_total', function ($query, $keyword) {
194
-                             $sql = 'grand_total like ?';
195
-                             $query->whereRaw($sql, ["%{$keyword}%"]);
196
-                         })
197
-                          ->filterColumn('date', function ($query, $keyword) {
198
-                              $sql = 'date like ?';
199
-                              $query->whereRaw($sql, ["%{$keyword}%"]);
200
-                          })
201
-
202
-                         ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
193
+                            ->filterColumn('grand_total', function ($query, $keyword) {
194
+                                $sql = 'grand_total like ?';
195
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
196
+                            })
197
+                            ->filterColumn('date', function ($query, $keyword) {
198
+                                $sql = 'date like ?';
199
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
200
+                            })
201
+
202
+                            ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
203 203
                         ->make(true);
204 204
     }
205 205
 
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
                 $attributes[] = $item->attributes;
293 293
             }
294 294
             $invoice = $this->invoice->create(['user_id' => $user_id, 'number' => $number,
295
-             'date'                                      => $date, 'discount'=>$codevalue, 'grand_total' => $grand_total, 'coupon_code'=>$code, 'status' => 'pending',
296
-             'currency'                                  => \Auth::user()->currency, ]);
295
+                'date'                                      => $date, 'discount'=>$codevalue, 'grand_total' => $grand_total, 'coupon_code'=>$code, 'status' => 'pending',
296
+                'currency'                                  => \Auth::user()->currency, ]);
297 297
             
298 298
             foreach (\Cart::getContent() as $cart) {
299 299
                 $this->createInvoiceItems($invoice->id, $cart, $codevalue);
@@ -414,11 +414,11 @@  discard block
 block discarded – undo
414 414
             $grand_total = \App\Http\Controllers\Front\CartController::rounding($grand_total);
415 415
 
416 416
             $invoice = Invoice::create(['user_id' => $user_id, 'number' => $number, 'date' => $date,
417
-             'coupon_code'                        => $code, 'discount'=>$codeValue,
417
+                'coupon_code'                        => $code, 'discount'=>$codeValue,
418 418
                 'grand_total'                     => $grand_total,  'currency'  => $currency, 'status' => $status, 'description' => $description, ]);
419 419
 
420 420
             $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid,
421
-             $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate);
421
+                $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate);
422 422
             $result = $this->getMessage($items, $user_id);
423 423
         } catch (\Exception $ex) {
424 424
             app('log')->info($ex->getMessage());
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
                     } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
497 497
 
498 498
                         $taxClassId = Tax::where('country', '')->where('state', 'Any State')
499
-                     ->pluck('tax_classes_id')->first(); //In case of India when
499
+                        ->pluck('tax_classes_id')->first(); //In case of India when
500 500
                         //other tax is available and tax is not enabled
501 501
                         if ($taxClassId) {
502 502
                             $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
@@ -565,10 +565,10 @@  discard block
 block discarded – undo
565 565
         foreach ($taxes as $key => $tax) {
566 566
             if ($taxes[0]) {
567 567
                 $tax_attribute[$key] = ['name' => $tax->name, 'name1' => $name1,
568
-                 'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
569
-                 'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
570
-                 'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
571
-                  'origin_state'               => $origin_state, ];
568
+                    'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
569
+                    'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
570
+                    'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
571
+                    'origin_state'               => $origin_state, ];
572 572
 
573 573
                 $rate = $tax->rate;
574 574
 
Please login to merge, or discard this patch.