Completed
Branch feature-dynamic-fields (3b03cc)
by Ashutosh
09:05
created
app/Traits/CoupCodeAndInvoiceSearch.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@
 block discarded – undo
232 232
             $payment_date = \Carbon\Carbon::now()->toDateTimeString();
233 233
             $amount = $grand_total;
234 234
             $paymentRenewal = $this->updateInvoicePayment($invoiceid, $payment_method,
235
-             $payment_status, $payment_date, $amount);
235
+                $payment_status, $payment_date, $amount);
236 236
 
237 237
             return redirect()->back()->with('success', 'Payment Accepted Successfully');
238 238
         } catch (\Exception $ex) {
Please login to merge, or discard this patch.
app/Traits/TaxCalculation.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         $value = '';
171 171
         $value = $taxes->toArray()[0]['active'] ?
172 172
              (TaxProductRelation::where('product_id', $productid)
173
-              ->where('tax_class_id', $taxClassId)->count() ? $ut_gst + $c_gst.'%' : 0) : 0;
173
+                ->where('tax_class_id', $taxClassId)->count() ? $ut_gst + $c_gst.'%' : 0) : 0;
174 174
 
175 175
         return $value;
176 176
     }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         $otherRate = 0;
188 188
         $status = $taxes->toArray()[0]['active'];
189 189
         if ($status && (TaxProductRelation::where('product_id', $productid)
190
-          ->where('tax_class_id', $taxClassId)->count() > 0)) {
190
+            ->where('tax_class_id', $taxClassId)->count() > 0)) {
191 191
             $otherRate = Tax::where('tax_classes_id', $taxClassId)->first()->rate;
192 192
         }
193 193
         $value = $otherRate.'%';
Please login to merge, or discard this patch.
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,24 +18,28 @@  discard block
 block discarded – undo
18 18
 
19 19
     public function getDetailsWhenUserStateIsIndian($user_state, $origin_state, $productid, $geoip_state, $geoip_country, $status = 1)
20 20
     {
21
-        if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user,if user from INdia
21
+        if ($user_state != '') {
22
+//Get the CGST,SGST,IGST,STATE_CODE of the user,if user from INdia
22 23
             $c_gst = $user_state->c_gst;
23 24
             $s_gst = $user_state->s_gst;
24 25
             $i_gst = $user_state->i_gst;
25 26
             $ut_gst = $user_state->ut_gst;
26 27
             $state_code = $user_state->state_code;
27 28
 
28
-            if ($state_code == $origin_state) {//If user and origin state are same
29
+            if ($state_code == $origin_state) {
30
+//If user and origin state are same
29 31
                 $rateForSameState = $this->getTaxWhenIndianSameState($user_state, $origin_state, $productid, $c_gst, $s_gst, $state_code, $status);
30 32
                 $taxes = $rateForSameState['taxes'];
31 33
                 $status = $rateForSameState['status'];
32 34
                 $value = $rateForSameState['value'];
33
-            } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
35
+            } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {
36
+//If user is from other state
34 37
                 $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state, $origin_state, $productid, $i_gst, $state_code, $status);
35 38
                 $taxes = $rateForOtherState['taxes'];
36 39
                 $status = $rateForOtherState['status'];
37 40
                 $value = $rateForOtherState['value'];
38
-            } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
41
+            } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {
42
+//if user from Union Territory
39 43
                 $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state, $origin_state, $productid, $c_gst, $ut_gst, $state_code, $status);
40 44
                 $taxes = $rateForUnionTerritory['taxes'];
41 45
                 $status = $rateForUnionTerritory['status'];
@@ -56,13 +60,15 @@  discard block
 block discarded – undo
56 60
         $taxClassId = Tax::where('state', $geoip_state)
57 61
                 ->orWhere('country', $geoip_country)
58 62
                 ->pluck('tax_classes_id')->first();
59
-        if ($taxClassId) { //if state equals the user State or country equals user country
63
+        if ($taxClassId) {
64
+//if state equals the user State or country equals user country
60 65
             $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId, $productid, $status);
61 66
             $taxes = $taxForSpecificCountry['taxes'];
62 67
             $status = $taxForSpecificCountry['status'];
63 68
             $value = $taxForSpecificCountry['value'];
64 69
             $rate = $taxForSpecificCountry['value'];
65
-        } else {//if Tax is selected for Any Country Any State
70
+        } else {
71
+//if Tax is selected for Any Country Any State
66 72
             $taxClassId = Tax::where('country', '')
67 73
                     ->where('state', 'Any State')
68 74
                     ->pluck('tax_classes_id')->first();
@@ -96,13 +102,15 @@  discard block
 block discarded – undo
96 102
                 $status = 0;
97 103
             }
98 104
             $rate = $value;
99
-        } else {//In case of other country
105
+        } else {
106
+//In case of other country
100 107
             //when tax is available and tax is not enabled
101 108
             //(Applicable when Global Tax class for any country and state is not there)
102 109
             $taxClassId = Tax::where('state', $geoip_state)
103 110
             ->orWhere('country', $geoip_country)
104 111
             ->pluck('tax_classes_id')->first();
105
-            if ($taxClassId) { //if state equals the user State
112
+            if ($taxClassId) {
113
+//if state equals the user State
106 114
                 $taxes = $this->getTaxByPriority($taxClassId);
107 115
                 $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
108 116
                 if ($value == '') {
Please login to merge, or discard this patch.
app/Http/Controllers/Common/SettingsController.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             $mobileauthkey = $apikeys->pluck('msg91_auth_key')->first();
68 68
             $updateUrl = $apikeys->pluck('update_api_url')->first();
69 69
             $emailStatus = StatusSetting::pluck('emailverification_status')->first();
70
-            $twitterKeys = $apikeys->select('twitter_consumer_key','twitter_consumer_secret',
70
+            $twitterKeys = $apikeys->select('twitter_consumer_key', 'twitter_consumer_secret',
71 71
                 'twitter_access_token', 'access_tooken_secret')->first();
72 72
             $twitterStatus = $this->statusSetting->pluck('twitter_status')->first();
73 73
             $zohoStatus = $this->statusSetting->pluck('zoho_status')->first();
@@ -299,16 +299,16 @@  discard block
 block discarded – undo
299 299
 
300 300
             return \DataTables::of($query->take(50))
301 301
              ->setTotalRecords($query->count())
302
-             ->addColumn('checkbox', function ($model) {
302
+             ->addColumn('checkbox', function($model) {
303 303
                  return "<input type='checkbox' class='activity' value=".$model->id.' name=select[] id=check>';
304 304
              })
305
-                           ->addColumn('name', function ($model) {
305
+                           ->addColumn('name', function($model) {
306 306
                                return ucfirst($model->log_name);
307 307
                            })
308
-                             ->addColumn('description', function ($model) {
308
+                             ->addColumn('description', function($model) {
309 309
                                  return ucfirst($model->description);
310 310
                              })
311
-                          ->addColumn('username', function ($model) {
311
+                          ->addColumn('username', function($model) {
312 312
                               $causer_id = $model->causer_id;
313 313
                               $names = User::where('id', $causer_id)->pluck('last_name', 'first_name');
314 314
                               foreach ($names as $key => $value) {
@@ -317,41 +317,41 @@  discard block
 block discarded – undo
317 317
                                   return $fullName;
318 318
                               }
319 319
                           })
320
-                              ->addColumn('role', function ($model) {
320
+                              ->addColumn('role', function($model) {
321 321
                                   $causer_id = $model->causer_id;
322 322
                                   $role = User::where('id', $causer_id)->pluck('role');
323 323
 
324 324
                                   return json_decode($role);
325 325
                               })
326
-                               ->addColumn('new', function ($model) {
326
+                               ->addColumn('new', function($model) {
327 327
                                    $properties = ($model->properties);
328 328
                                    $newEntry = $this->getNewEntry($properties, $model);
329 329
 
330 330
                                    return $newEntry;
331 331
                                })
332
-                                ->addColumn('old', function ($model) {
332
+                                ->addColumn('old', function($model) {
333 333
                                     $data = ($model->properties);
334 334
                                     $oldEntry = $this->getOldEntry($data, $model);
335 335
 
336 336
                                     return $oldEntry;
337 337
                                 })
338
-                                ->addColumn('created_at', function ($model) {
338
+                                ->addColumn('created_at', function($model) {
339 339
                                     $newDate = $this->getDate($model->created_at);
340 340
 
341 341
                                     return $newDate;
342 342
                                 })
343 343
 
344
-                                    ->filterColumn('log_name', function ($query, $keyword) {
344
+                                    ->filterColumn('log_name', function($query, $keyword) {
345 345
                                         $sql = 'log_name like ?';
346 346
                                         $query->whereRaw($sql, ["%{$keyword}%"]);
347 347
                                     })
348 348
 
349
-                                ->filterColumn('description', function ($query, $keyword) {
349
+                                ->filterColumn('description', function($query, $keyword) {
350 350
                                     $sql = 'description like ?';
351 351
                                     $query->whereRaw($sql, ["%{$keyword}%"]);
352 352
                                 })
353 353
 
354
-                            ->filterColumn('causer_id', function ($query, $keyword) {
354
+                            ->filterColumn('causer_id', function($query, $keyword) {
355 355
                                 $sql = 'first_name like ?';
356 356
                                 $query->whereRaw($sql, ["%{$keyword}%"]);
357 357
                             })
@@ -373,37 +373,37 @@  discard block
 block discarded – undo
373 373
             $email_log = \DB::table('email_log')->get();
374 374
 
375 375
             return\ DataTables::of($email_log)
376
-             ->addColumn('checkbox', function ($model) {
376
+             ->addColumn('checkbox', function($model) {
377 377
                  return "<input type='checkbox' class='email' value=".$model->id.' name=select[] id=check>';
378 378
              })
379
-                           ->addColumn('date', function ($model) {
379
+                           ->addColumn('date', function($model) {
380 380
                                return ucfirst($model->date);
381 381
                            })
382
-                             ->addColumn('from', function ($model) {
382
+                             ->addColumn('from', function($model) {
383 383
                                  $from = Markdown::convertToHtml(ucfirst($model->from));
384 384
 
385 385
                                  return $from;
386 386
                              })
387
-                              ->addColumn('to', function ($model) {
387
+                              ->addColumn('to', function($model) {
388 388
                                   $to = Markdown::convertToHtml(ucfirst($model->to));
389 389
 
390 390
                                   return $to;
391 391
                               })
392
-                             ->addColumn('cc', function ($model) {
392
+                             ->addColumn('cc', function($model) {
393 393
                                  $cc = '--';
394 394
 
395 395
                                  return $cc;
396 396
                              })
397 397
 
398
-                               ->addColumn('subject', function ($model) {
398
+                               ->addColumn('subject', function($model) {
399 399
                                    return ucfirst($model->subject);
400 400
                                })
401
-                                ->addColumn('headers', function ($model) {
401
+                                ->addColumn('headers', function($model) {
402 402
                                     $headers = Markdown::convertToHtml(ucfirst($model->headers));
403 403
 
404 404
                                     return $headers;
405 405
                                 })
406
-                              ->addColumn('status', function ($model) {
406
+                              ->addColumn('status', function($model) {
407 407
                                   return ucfirst($model->status);
408 408
                               })
409 409
 
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ExtendedBaseProductController.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             return '<a href='.('#edit-upload-option/'.$model->id).' 
45 45
          class=" btn btn-sm btn-primary " data-title="'.$model->title.'"
46 46
           data-description="'.$model->description.'" data-version="'
47
-              .$model->version.'" data-id="'.$model->id.'" onclick="openEditPopup(this)" >Edit</a>';
47
+                .$model->version.'" data-id="'.$model->id.'" onclick="openEditPopup(this)" >Edit</a>';
48 48
         })
49 49
         ->rawcolumns(['checkbox', 'product_id', 'title', 'description', 'version', 'file', 'action'])
50 50
         ->make(true);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             if ($product->require_domain == 1) {
102 102
                 $field .= "<div class='col-md-4 form-group'>
103 103
                         <label class='required'>"./* @scrutinizer ignore-type */
104
-                         \Lang::get('message.domain')."</label>
104
+                            \Lang::get('message.domain')."</label>
105 105
                         <input type='text' name='domain' class='form-control' 
106 106
                         id='domain' placeholder='http://example.com'>
107 107
                 </div>";
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
@@ -169,7 +169,8 @@  discard block
 block discarded – undo
169 169
 
170 170
             $plan = new Plan();
171 171
             $plans = $plan->where('product', $productid)->pluck('name', 'id')->toArray();
172
-            if (count($plans) > 0) {//If Plan Exist For A product, Display Dropdown for Plans
172
+            if (count($plans) > 0) {
173
+//If Plan Exist For A product, Display Dropdown for Plans
173 174
                 $field = "<div class='col-md-4 form-group'>
174 175
                         <label class='required'>"./* @scrutinizer ignore-type */
175 176
                         \Lang::get('message.subscription').'</label>
@@ -180,7 +181,8 @@  discard block
 block discarded – undo
180 181
                             ['class' => 'form-control', 'id' => 'plan', 'onchange' => 'getPrice(this.value)']
181 182
                         ).'
182 183
                 </div>';
183
-            } else {//If No Plan Exist For A Product
184
+            } else {
185
+//If No Plan Exist For A Product
184 186
                 $userid = $request->input('user');
185 187
                 $price = $controller->cost($productid, $userid);
186 188
             }
@@ -243,7 +245,8 @@  discard block
 block discarded – undo
243 245
 
244 246
     public function getRelease($owner, $repository, $order_id, $file)
245 247
     {
246
-        if ($owner && $repository) {//If the Product is downloaded from Github
248
+        if ($owner && $repository) {
249
+//If the Product is downloaded from Github
247 250
             $github_controller = new \App\Http\Controllers\Github\GithubController();
248 251
             $relese = $github_controller->listRepositories($owner, $repository, $order_id);
249 252
 
Please login to merge, or discard this patch.
app/Http/Controllers/Order/BaseOrderController.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -117,12 +117,12 @@  discard block
 block discarded – undo
117 117
         //     $r = $mailchimp->updateSubscriberForFreeProduct($email, $product);
118 118
         // }
119 119
 
120
-     } catch (\Exception $ex) {
120
+        } catch (\Exception $ex) {
121 121
         dd($ex);
122
-       Bugsnag::notifyException($ex);
123
-       app('log')->error($ex->getMessage());
124
-         throw new \Exception('Can not Generate Order');
125
-     }
122
+        Bugsnag::notifyException($ex);
123
+        app('log')->error($ex->getMessage());
124
+            throw new \Exception('Can not Generate Order');
125
+        }
126 126
 
127 127
 
128 128
             throw new \Exception('Can not Generate Order');
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
         $data = $template->data;
280 280
         $replace = [
281 281
             'name'         => $user->first_name.' '.$user->last_name,
282
-             'serialkeyurl'=> $myaccounturl,
282
+                'serialkeyurl'=> $myaccounturl,
283 283
             'downloadurl'  => $downloadurl,
284 284
             'invoiceurl'   => $invoiceurl,
285 285
             'product'      => $product,
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     public function getIfItemPresent($item, $invoiceid, $user_id, $order_status)
82 82
     {
83 83
 
84
-        try{
84
+        try {
85 85
 
86 86
         $product = $this->product->where('name', $item->product_name)->first()->id;
87 87
         $version = $this->product->where('name', $item->product_name)->first()->version;
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             //Get Version from Product Upload Table
90 90
             $version = $this->product_upload->where('product_id', $product)->pluck('version')->first();
91 91
         }
92
-        $serial_key = $this->generateSerialKey($product,$item->agents);//Send Product Id and Agents to generate Serial Key
92
+        $serial_key = $this->generateSerialKey($product, $item->agents); //Send Product Id and Agents to generate Serial Key
93 93
         $domain = $item->domain;
94 94
         $plan_id = $this->plan($item->id);
95 95
         $order = $this->order->create([
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
     public function getIfItemPresent($item, $invoiceid, $user_id, $order_status)
82 82
     {
83 83
 
84
-        try{
84
+        try {
85 85
 
86 86
         $product = $this->product->where('name', $item->product_name)->first()->id;
87 87
         $version = $this->product->where('name', $item->product_name)->first()->version;
Please login to merge, or discard this patch.
app/Http/Controllers/Order/ExtendedOrderController.php 1 patch
Indentation   +15 added lines, -15 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',
52
+            ->select(
53
+                'orders.id',
54
+                'orders.created_at',
55
+                'client',
56 56
             'price_override',
57
-               'order_status',
58
-               'product',
59
-               'number',
60
-               'serial_key'
61
-           );
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
Indentation   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -127,12 +127,12 @@  discard block
 block discarded – undo
127 127
         $query = $this->advanceSearch($name, $invoice_no, $currency, $status, $from, $till);
128 128
 
129 129
         return \DataTables::of($query->take(100))
130
-         ->setTotalRecords($query->count())
130
+            ->setTotalRecords($query->count())
131 131
 
132
-         ->addColumn('checkbox', function ($model) {
133
-             return "<input type='checkbox' class='invoice_checkbox' 
132
+            ->addColumn('checkbox', function ($model) {
133
+                return "<input type='checkbox' class='invoice_checkbox' 
134 134
                             value=".$model->id.' name=select[] id=check>';
135
-         })
135
+            })
136 136
                         ->addColumn('user_id', function ($model) {
137 137
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
138 138
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 
141 141
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
142 142
                         })
143
-                         ->addColumn('number', function ($model) {
144
-                             return ucfirst($model->number);
145
-                         })
143
+                            ->addColumn('number', function ($model) {
144
+                                return ucfirst($model->number);
145
+                            })
146 146
 
147 147
                         ->addColumn('date', function ($model) {
148 148
                             $date = ($model->created_at);
@@ -150,12 +150,12 @@  discard block
 block discarded – undo
150 150
                             return $date;
151 151
                             // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
152 152
                         })
153
-                         ->addColumn('grand_total', function ($model) {
154
-                             return ucfirst($model->number);
155
-                         })
156
-                          ->addColumn('status', function ($model) {
157
-                              return ucfirst($model->status);
158
-                          })
153
+                            ->addColumn('grand_total', function ($model) {
154
+                                return ucfirst($model->number);
155
+                            })
156
+                            ->addColumn('status', function ($model) {
157
+                                return ucfirst($model->status);
158
+                            })
159 159
 
160 160
                         ->addColumn('action', function ($model) {
161 161
                             $action = '';
@@ -173,30 +173,30 @@  discard block
 block discarded – undo
173 173
                             style='color:white;'> </i>&nbsp;&nbsp;View</a>"
174 174
                                     ."   $action";
175 175
                         })
176
-                         ->filterColumn('user_id', function ($query, $keyword) {
177
-                             $sql = 'first_name like ?';
178
-                             $query->whereRaw($sql, ["%{$keyword}%"]);
179
-                         })
176
+                            ->filterColumn('user_id', function ($query, $keyword) {
177
+                                $sql = 'first_name like ?';
178
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
179
+                            })
180 180
 
181
-                          ->filterColumn('status', function ($query, $keyword) {
182
-                              $sql = 'status like ?';
183
-                              $query->whereRaw($sql, ["%{$keyword}%"]);
184
-                          })
181
+                            ->filterColumn('status', function ($query, $keyword) {
182
+                                $sql = 'status like ?';
183
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
184
+                            })
185 185
 
186 186
                         ->filterColumn('number', function ($query, $keyword) {
187 187
                             $sql = 'number like ?';
188 188
                             $query->whereRaw($sql, ["%{$keyword}%"]);
189 189
                         })
190
-                         ->filterColumn('grand_total', function ($query, $keyword) {
191
-                             $sql = 'grand_total like ?';
192
-                             $query->whereRaw($sql, ["%{$keyword}%"]);
193
-                         })
194
-                          ->filterColumn('date', function ($query, $keyword) {
195
-                              $sql = 'date like ?';
196
-                              $query->whereRaw($sql, ["%{$keyword}%"]);
197
-                          })
198
-
199
-                         ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
190
+                            ->filterColumn('grand_total', function ($query, $keyword) {
191
+                                $sql = 'grand_total like ?';
192
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
193
+                            })
194
+                            ->filterColumn('date', function ($query, $keyword) {
195
+                                $sql = 'date like ?';
196
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
197
+                            })
198
+
199
+                            ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
200 200
                         ->make(true);
201 201
     }
202 202
 
@@ -308,8 +308,8 @@  discard block
 block discarded – undo
308 308
             }
309 309
             $symbol = $attributes[0]['currency']['symbol'];
310 310
             $invoice = $this->invoice->create(['user_id' => $user_id, 'number' => $number,
311
-             'date'                                      => $date, 'grand_total' => $grand_total, 'status' => 'pending',
312
-             'currency'                                  => $symbol, ]);
311
+                'date'                                      => $date, 'grand_total' => $grand_total, 'status' => 'pending',
312
+                'currency'                                  => $symbol, ]);
313 313
             foreach (\Cart::getContent() as $cart) {
314 314
                 $this->createInvoiceItems($invoice->id, $cart);
315 315
             }
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
                 'currency'                        => $currency, 'status' => 'pending', 'description' => $description, ]);
437 437
 
438 438
             $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid,
439
-             $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate);
439
+                $code, $total, $currency, $qty, $agents, $plan, $user_id, $tax_name, $tax_rate);
440 440
             $result = $this->getMessage($items, $user_id);
441 441
         } catch (\Exception $ex) {
442 442
             app('log')->info($ex->getMessage());
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
                 } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
542 542
 
543 543
                     $taxClassId = Tax::where('country', '')->where('state', 'Any State')
544
-                     ->pluck('tax_classes_id')->first(); //In case of India when
544
+                        ->pluck('tax_classes_id')->first(); //In case of India when
545 545
                     //other tax is available and tax is not enabled
546 546
                     if ($taxClassId) {
547 547
                         $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
@@ -609,10 +609,10 @@  discard block
 block discarded – undo
609 609
         foreach ($taxes as $key => $tax) {
610 610
             if ($taxes[0]) {
611 611
                 $tax_attribute[$key] = ['name' => $tax->name, 'name1' => $name1,
612
-                 'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
613
-                 'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
614
-                 'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
615
-                  'origin_state'               => $origin_state, ];
612
+                    'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
613
+                    'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
614
+                    'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
615
+                    'origin_state'               => $origin_state, ];
616 616
 
617 617
                 $rate = $tax->rate;
618 618
 
@@ -684,8 +684,8 @@  discard block
 block discarded – undo
684 684
                 }
685 685
 
686 686
                 return view('themes.default1.invoice.payment',
687
-                 compact('invoice_status', 'payment_status',
688
-                  'payment_method', 'invoice_id', 'domain', 'invoice', 'userid'));
687
+                    compact('invoice_status', 'payment_status',
688
+                    'payment_method', 'invoice_id', 'domain', 'invoice', 'userid'));
689 689
             }
690 690
 
691 691
             return redirect()->back();
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             $from = $request->input('from');
107 107
             $till = $request->input('till');
108 108
 
109
-            return view('themes.default1.invoice.index', compact('name','invoice_no','status','currencies','currency_id','from',
109
+            return view('themes.default1.invoice.index', compact('name', 'invoice_no', 'status', 'currencies', 'currency_id', 'from',
110 110
 
111 111
                 'till'));
112 112
         } catch (\Exception $ex) {
@@ -129,35 +129,35 @@  discard block
 block discarded – undo
129 129
         return \DataTables::of($query->take(100))
130 130
          ->setTotalRecords($query->count())
131 131
 
132
-         ->addColumn('checkbox', function ($model) {
132
+         ->addColumn('checkbox', function($model) {
133 133
              return "<input type='checkbox' class='invoice_checkbox' 
134 134
                             value=".$model->id.' name=select[] id=check>';
135 135
          })
136
-                        ->addColumn('user_id', function ($model) {
136
+                        ->addColumn('user_id', function($model) {
137 137
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
138 138
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
139 139
                             $id = $this->user->where('id', $model->user_id)->first()->id;
140 140
 
141 141
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
142 142
                         })
143
-                         ->addColumn('number', function ($model) {
143
+                         ->addColumn('number', function($model) {
144 144
                              return ucfirst($model->number);
145 145
                          })
146 146
 
147
-                        ->addColumn('date', function ($model) {
147
+                        ->addColumn('date', function($model) {
148 148
                             $date = ($model->created_at);
149 149
 
150 150
                             return $date;
151 151
                             // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
152 152
                         })
153
-                         ->addColumn('grand_total', function ($model) {
153
+                         ->addColumn('grand_total', function($model) {
154 154
                              return ucfirst($model->number);
155 155
                          })
156
-                          ->addColumn('status', function ($model) {
156
+                          ->addColumn('status', function($model) {
157 157
                               return ucfirst($model->status);
158 158
                           })
159 159
 
160
-                        ->addColumn('action', function ($model) {
160
+                        ->addColumn('action', function($model) {
161 161
                             $action = '';
162 162
 
163 163
                             $check = $this->checkExecution($model->id);
@@ -173,25 +173,25 @@  discard block
 block discarded – undo
173 173
                             style='color:white;'> </i>&nbsp;&nbsp;View</a>"
174 174
                                     ."   $action";
175 175
                         })
176
-                         ->filterColumn('user_id', function ($query, $keyword) {
176
+                         ->filterColumn('user_id', function($query, $keyword) {
177 177
                              $sql = 'first_name like ?';
178 178
                              $query->whereRaw($sql, ["%{$keyword}%"]);
179 179
                          })
180 180
 
181
-                          ->filterColumn('status', function ($query, $keyword) {
181
+                          ->filterColumn('status', function($query, $keyword) {
182 182
                               $sql = 'status like ?';
183 183
                               $query->whereRaw($sql, ["%{$keyword}%"]);
184 184
                           })
185 185
 
186
-                        ->filterColumn('number', function ($query, $keyword) {
186
+                        ->filterColumn('number', function($query, $keyword) {
187 187
                             $sql = 'number like ?';
188 188
                             $query->whereRaw($sql, ["%{$keyword}%"]);
189 189
                         })
190
-                         ->filterColumn('grand_total', function ($query, $keyword) {
190
+                         ->filterColumn('grand_total', function($query, $keyword) {
191 191
                              $sql = 'grand_total like ?';
192 192
                              $query->whereRaw($sql, ["%{$keyword}%"]);
193 193
                          })
194
-                          ->filterColumn('date', function ($query, $keyword) {
194
+                          ->filterColumn('date', function($query, $keyword) {
195 195
                               $sql = 'date like ?';
196 196
                               $query->whereRaw($sql, ["%{$keyword}%"]);
197 197
                           })
Please login to merge, or discard this patch.
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -382,16 +382,19 @@  discard block
 block discarded – undo
382 382
             }
383 383
             $productid = $request->input('product');
384 384
             $plan = $request->input('plan');
385
-            if (!$agents) {//If agents is not received in the request in the case when 'modify agent' is not allowed for the Product,get the no of Agents from the Plan Table.
385
+            if (!$agents) {
386
+//If agents is not received in the request in the case when 'modify agent' is not allowed for the Product,get the no of Agents from the Plan Table.
386 387
                 $planForAgent = Product::find($productid)->planRelation->find($plan);
387
-                if ($planForAgent) {//If Plan Exists For the Product ie not a Product without Plan
388
+                if ($planForAgent) {
389
+//If Plan Exists For the Product ie not a Product without Plan
388 390
                     $noOfAgents = $planForAgent->planPrice->first()->no_of_agents;
389 391
                     $agents = $noOfAgents ? $noOfAgents : 0; //If no. of Agents is specified then that,else 0(Unlimited Agents)
390 392
                 } else {
391 393
                     $agents = 0;
392 394
                 }
393 395
             }
394
-            if (!$qty) {//If quantity is not received in the request in the case when 'modify quantity' is not allowed for the Product,get the Product qUANTITY from the Plan Table.
396
+            if (!$qty) {
397
+//If quantity is not received in the request in the case when 'modify quantity' is not allowed for the Product,get the Product qUANTITY from the Plan Table.
395 398
                 $planForQty = Product::find($productid)->planRelation->find($plan);
396 399
                 if ($planForQty) {
397 400
                     $quantity = Product::find($productid)->planRelation->find($plan)->planPrice->first()->product_quantity;
@@ -538,7 +541,8 @@  discard block
 block discarded – undo
538 541
             if ($this->tax_option->findOrFail(1)->inclusive == 0) {
539 542
                 if ($this->tax_option->findOrFail(1)->tax_enable == 1) {
540 543
                     $taxs = $this->getTaxWhenEnable($productid, $taxs[0], $userid);
541
-                } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
544
+                } elseif ($this->tax_option->tax_enable == 0) {
545
+//if tax_enable is 0
542 546
 
543 547
                     $taxClassId = Tax::where('country', '')->where('state', 'Any State')
544 548
                      ->pluck('tax_classes_id')->first(); //In case of India when
@@ -547,13 +551,15 @@  discard block
 block discarded – undo
547 551
                         $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
548 552
                         $taxs = $rate['taxes'];
549 553
                         $rate = $rate['rate'];
550
-                    } elseif ($geoip_country != 'IN') {//In case of other country
554
+                    } elseif ($geoip_country != 'IN') {
555
+//In case of other country
551 556
                         // when tax is available and tax is not enabled(Applicable
552 557
                         //when Global Tax class for any country and state is not there)
553 558
 
554 559
                         $taxClassId = Tax::where('state', $geoip_state)
555 560
                         ->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first();
556
-                        if ($taxClassId) { //if state equals the user State
561
+                        if ($taxClassId) {
562
+//if state equals the user State
557 563
                             $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
558 564
                             $taxs = $rate['taxes'];
559 565
                             $rate = $rate['rate'];
@@ -595,11 +601,13 @@  discard block
 block discarded – undo
595 601
         $i_gst = 0;
596 602
         $ut_gst = 0;
597 603
         $state_code = '';
598
-        if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
604
+        if ($user_state != '') {
605
+//Get the CGST,SGST,IGST,STATE_CODE of the user
599 606
             $tax = $this->getTaxWhenState($user_state, $productid, $origin_state);
600 607
             $taxes = $tax['taxes'];
601 608
             $value = $tax['value'];
602
-        } else {//If user from other Country
609
+        } else {
610
+//If user from other Country
603 611
             $tax = $this->getTaxWhenOtherCountry($geoip_state, $geoip_country, $productid);
604 612
             $taxes = $tax['taxes'];
605 613
             $value = $tax['value'];
Please login to merge, or discard this patch.
app/Http/Controllers/Order/BaseRenewController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
             ]);
126 126
             $this->createOrderInvoiceRelation($orderid, $invoice->id);
127 127
             $items = $controller->createInvoiceItemsByAdmin($invoice->id, $product->id,
128
-             $code, $cost, $currency, $qty = 1, $agents);
128
+                $code, $cost, $currency, $qty = 1, $agents);
129 129
 
130 130
             return $items;
131 131
         } catch (Exception $ex) {
Please login to merge, or discard this patch.