Completed
Branch feature-dynamic-fields (9e5831)
by Ashutosh
13:15
created
app/Traits/TaxCalculation.php 1 patch
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,24 +8,28 @@  discard block
 block discarded – undo
8 8
 {
9 9
     public function getDetailsWhenUserStateIsIndian($user_state, $origin_state, $productid, $geoip_state, $geoip_country, $status = 1)
10 10
     {
11
-        if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user,if user from INdia
11
+        if ($user_state != '') {
12
+//Get the CGST,SGST,IGST,STATE_CODE of the user,if user from INdia
12 13
             $c_gst = $user_state->c_gst;
13 14
             $s_gst = $user_state->s_gst;
14 15
             $i_gst = $user_state->i_gst;
15 16
             $ut_gst = $user_state->ut_gst;
16 17
             $state_code = $user_state->state_code;
17 18
 
18
-            if ($state_code == $origin_state) {//If user and origin state are same
19
+            if ($state_code == $origin_state) {
20
+//If user and origin state are same
19 21
                 $rateForSameState = $this->getTaxWhenIndianSameState($user_state, $origin_state, $productid, $c_gst, $s_gst, $state_code, $status);
20 22
                 $taxes = $rateForSameState['taxes'];
21 23
                 $status = $rateForSameState['status'];
22 24
                 $value = $rateForSameState['value'];
23
-            } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
25
+            } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {
26
+//If user is from other state
24 27
                 $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state, $origin_state, $productid, $i_gst, $state_code, $status);
25 28
                 $taxes = $rateForOtherState['taxes'];
26 29
                 $status = $rateForOtherState['status'];
27 30
                 $value = $rateForOtherState['value'];
28
-            } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
31
+            } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {
32
+//if user from Union Territory
29 33
                 $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state, $origin_state, $productid, $c_gst, $ut_gst, $state_code, $status);
30 34
                 $taxes = $rateForUnionTerritory['taxes'];
31 35
                 $status = $rateForUnionTerritory['status'];
@@ -46,13 +50,15 @@  discard block
 block discarded – undo
46 50
         $taxClassId = Tax::where('state', $geoip_state)
47 51
                 ->orWhere('country', $geoip_country)
48 52
                 ->pluck('tax_classes_id')->first();
49
-        if ($taxClassId) { //if state equals the user State or country equals user country
53
+        if ($taxClassId) {
54
+//if state equals the user State or country equals user country
50 55
             $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId, $productid, $status);
51 56
             $taxes = $taxForSpecificCountry['taxes'];
52 57
             $status = $taxForSpecificCountry['status'];
53 58
             $value = $taxForSpecificCountry['value'];
54 59
             $rate = $taxForSpecificCountry['value'];
55
-        } else {//if Tax is selected for Any Country Any State
60
+        } else {
61
+//if Tax is selected for Any Country Any State
56 62
             $taxClassId = Tax::where('country', '')
57 63
                     ->where('state', 'Any State')
58 64
                     ->pluck('tax_classes_id')->first();
@@ -86,13 +92,15 @@  discard block
 block discarded – undo
86 92
                 $status = 0;
87 93
             }
88 94
             $rate = $value;
89
-        } else {//In case of other country
95
+        } else {
96
+//In case of other country
90 97
             //when tax is available and tax is not enabled
91 98
             //(Applicable when Global Tax class for any country and state is not there)
92 99
             $taxClassId = Tax::where('state', $geoip_state)
93 100
             ->orWhere('country', $geoip_country)
94 101
             ->pluck('tax_classes_id')->first();
95
-            if ($taxClassId) { //if state equals the user State
102
+            if ($taxClassId) {
103
+//if state equals the user State
96 104
                 $taxes = $this->getTaxByPriority($taxClassId);
97 105
                 $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
98 106
                 if ($value == '') {
Please login to merge, or discard this patch.
app/Http/Controllers/Common/BaseTemplateController.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@
 block discarded – undo
25 25
             $currencyAndSymbol = $cart_controller->currency();
26 26
             $currency = $currencyAndSymbol['currency'];
27 27
             $symbol = $currencyAndSymbol['symbol'];
28
-            if ($symbol == '') {  //If user has no currency symbol(In case of old customers)
28
+            if ($symbol == '') {
29
+//If user has no currency symbol(In case of old customers)
29 30
                 $symbol = Currency::where('code', $currency)->pluck('symbol')->first();
30 31
                 $symbol = \Auth::user()->update(['currency_symbol'=> $symbol]);
31 32
             }
Please login to merge, or discard this patch.
app/Http/Controllers/Common/BaseSettingsController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -435,7 +435,7 @@
 block discarded – undo
435 435
 
436 436
         StatusSetting::where('id', 1)->update(['recaptcha_status'=>$status]);
437 437
         ApiKey::where('id', 1)->update(['nocaptcha_sitekey'=> $nocaptcha_sitekey,
438
-         'captcha_secretCheck'                             => $captcha_secretCheck, ]);
438
+            'captcha_secretCheck'                             => $captcha_secretCheck, ]);
439 439
 
440 440
         return ['message' => 'success', 'update'=>'Recaptcha Settings Updated'];
441 441
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -296,7 +296,7 @@
 block discarded – undo
296 296
 
297 297
         // validate detected / default PHP CLI
298 298
         // Because array_filter() preserves keys, you should consider the resulting array to be an associative array even if the original array had integer keys for there may be holes in your sequence of keys. This means that, for example, json_encode() will convert your result array into an object instead of an array. Call array_values() on the result array to guarantee json_encode() gives you an array.
299
-        $paths = array_values(array_filter($paths, function ($path) {
299
+        $paths = array_values(array_filter($paths, function($path) {
300 300
             return is_executable($path) && preg_match("/php[0-9\.a-z]{0,3}$/i", $path);
301 301
         }));
302 302
 
Please login to merge, or discard this patch.
app/Http/Controllers/Common/PaymentSettingsController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
                         ->addColumn('version', function ($model) {
88 88
                             return $model['version'];
89 89
                         })
90
-                      ->rawColumns(['name', 'description', 'author', 'website', 'version'])
90
+                        ->rawColumns(['name', 'description', 'author', 'website', 'version'])
91 91
                             ->make(true);
92 92
     }
93 93
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
         return \DataTables::of(new Collection($plugins))
17 17
                         // ->searchColumns('name')
18
-                        ->addColumn('name', function ($model) {
18
+                        ->addColumn('name', function($model) {
19 19
                             if (array_has($model, 'path')) {
20 20
                                 if ($model['status'] == 0) {
21 21
                                     $activate = '<a href='.url('plugin/status/'.$model['path']).'>Activate</a>';
@@ -51,16 +51,16 @@  discard block
 block discarded – undo
51 51
 
52 52
                             return ucfirst($model['name']).$action;
53 53
                         })
54
-                        ->addColumn('description', function ($model) {
54
+                        ->addColumn('description', function($model) {
55 55
                             return $model['description'];
56 56
                         })
57
-                        ->addColumn('author', function ($model) {
57
+                        ->addColumn('author', function($model) {
58 58
                             return ucfirst($model['author']);
59 59
                         })
60
-                        ->addColumn('website', function ($model) {
60
+                        ->addColumn('website', function($model) {
61 61
                             return '<a href='.$model['website'].' target=_blank>'.$model['website'].'</a>';
62 62
                         })
63
-                        ->addColumn('version', function ($model) {
63
+                        ->addColumn('version', function($model) {
64 64
                             return $model['version'];
65 65
                         })
66 66
                       ->rawColumns(['name', 'description', 'author', 'website', 'version'])
Please login to merge, or discard this patch.
app/Http/Controllers/Product/PlanController.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -87,22 +87,22 @@  discard block
 block discarded – undo
87 87
 
88 88
                             return ucfirst($response);
89 89
                         })
90
-                         ->addColumn('price', function ($model) use ($defaultCurrency) {
91
-                             $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency)
90
+                            ->addColumn('price', function ($model) use ($defaultCurrency) {
91
+                                $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency)
92 92
                             ->pluck('add_price')->first();
93
-                             if ($price != null) {
94
-                                 return $price;
95
-                             } else {
96
-                                 return 'Not Available';
97
-                             }
98
-                         })
99
-                         ->addColumn('currency', function ($model) use ($defaultCurrency) {
100
-                             if ($defaultCurrency && $defaultCurrency != null) {
101
-                                 return $defaultCurrency;
102
-                             } else {
103
-                                 return 'Not Available';
104
-                             }
105
-                         })
93
+                                if ($price != null) {
94
+                                    return $price;
95
+                                } else {
96
+                                    return 'Not Available';
97
+                                }
98
+                            })
99
+                            ->addColumn('currency', function ($model) use ($defaultCurrency) {
100
+                                if ($defaultCurrency && $defaultCurrency != null) {
101
+                                    return $defaultCurrency;
102
+                                } else {
103
+                                    return 'Not Available';
104
+                                }
105
+                            })
106 106
                         ->addColumn('action', function ($model) {
107 107
                             return '<a href='.url('plans/'.$model->id.'/edit')." 
108 108
                             class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' 
@@ -206,10 +206,10 @@  discard block
 block discarded – undo
206 206
         $agentQuantity = $plan->planPrice->first()->no_of_agents;
207 207
         foreach ($products as $key => $product) {
208 208
             $selectedProduct = $this->product->where('id', $plan->product)
209
-          ->pluck('name', 'id', 'subscription')->toArray();
209
+            ->pluck('name', 'id', 'subscription')->toArray();
210 210
         }
211 211
         $selectedPeriods = $this->period->where('days', $plan->days)
212
-       ->pluck('name', 'days')->toArray();
212
+        ->pluck('name', 'days')->toArray();
213 213
 
214 214
         return view(
215 215
             'themes.default1.product.plan.edit',
@@ -247,8 +247,8 @@  discard block
 block discarded – undo
247 247
             'name'                => 'required',
248 248
             'add_price.*'         => 'required',
249 249
             'product'             => 'required',
250
-              'days'              => $days_rule.'numeric',
251
-               'product_quantity' => 'required_without:no_of_agents|integer|min:0',
250
+                'days'              => $days_rule.'numeric',
251
+                'product_quantity' => 'required_without:no_of_agents|integer|min:0',
252 252
             'no_of_agents'        => 'required_without:product_quantity|integer|min:0',
253 253
         ]);
254 254
         $product_quantity = $request->input('product_quantity');
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
         $defaultCurrency = Setting::where('id', 1)->value('default_currency');
62 62
 
63 63
         return\ DataTables::of($new_plan)
64
-                        ->addColumn('checkbox', function ($model) {
64
+                        ->addColumn('checkbox', function($model) {
65 65
                             return "<input type='checkbox' class='plan_checkbox' 
66 66
                             value=".$model->id.' name=select[] id=check>';
67 67
                         })
68
-                        ->addColumn('name', function ($model) {
68
+                        ->addColumn('name', function($model) {
69 69
                             return ucfirst($model->name);
70 70
                         })
71
-                        ->addColumn('days', function ($model) {
71
+                        ->addColumn('days', function($model) {
72 72
                             if ($model->days != '') {
73 73
                                 $months = $model->days / 30;
74 74
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
                             return 'Not Available';
79 79
                         })
80
-                        ->addColumn('product', function ($model) {
80
+                        ->addColumn('product', function($model) {
81 81
                             $productid = $model->product;
82 82
                             $product = $this->product->where('id', $productid)->first();
83 83
                             $response = '';
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
                             return ucfirst($response);
89 89
                         })
90
-                         ->addColumn('price', function ($model) use ($defaultCurrency) {
90
+                         ->addColumn('price', function($model) use ($defaultCurrency) {
91 91
                              $price = PlanPrice::where('plan_id', $model->id)->where('currency', $defaultCurrency)
92 92
                             ->pluck('add_price')->first();
93 93
                              if ($price != null) {
@@ -96,14 +96,14 @@  discard block
 block discarded – undo
96 96
                                  return 'Not Available';
97 97
                              }
98 98
                          })
99
-                         ->addColumn('currency', function ($model) use ($defaultCurrency) {
99
+                         ->addColumn('currency', function($model) use ($defaultCurrency) {
100 100
                              if ($defaultCurrency && $defaultCurrency != null) {
101 101
                                  return $defaultCurrency;
102 102
                              } else {
103 103
                                  return 'Not Available';
104 104
                              }
105 105
                          })
106
-                        ->addColumn('action', function ($model) {
106
+                        ->addColumn('action', function($model) {
107 107
                             return '<a href='.url('plans/'.$model->id.'/edit')." 
108 108
                             class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit' 
109 109
                             style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ExtendedBaseProductController.php 3 patches
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);
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                 if ($product->require_domain == 1) {
98 98
                     $field .= "<div class='col-md-4 form-group'>
99 99
                         <label class='required'>"./* @scrutinizer ignore-type */
100
-                         \Lang::get('message.domain')."</label>
100
+                            \Lang::get('message.domain')."</label>
101 101
                         <input type='text' name='domain' class='form-control' 
102 102
                         id='domain' placeholder='http://example.com'>
103 103
                 </div>";
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,28 +19,28 @@
 block discarded – undo
19 19
         ->get();
20 20
 
21 21
         return \DataTables::of($new_upload)
22
-        ->addColumn('checkbox', function ($model) {
22
+        ->addColumn('checkbox', function($model) {
23 23
             return "<input type='checkbox' class='upload_checkbox' value=".$model->id.' name=select[] id=checks>';
24 24
         })
25 25
 
26
-        ->addColumn('product_id', function ($model) {
26
+        ->addColumn('product_id', function($model) {
27 27
             return ucfirst($this->product->where('id', $model->product_id)->first()->name);
28 28
         })
29 29
 
30
-        ->addColumn('title', function ($model) {
30
+        ->addColumn('title', function($model) {
31 31
             return ucfirst($model->title);
32 32
         })
33
-        ->addColumn('description', function ($model) {
33
+        ->addColumn('description', function($model) {
34 34
             return ucfirst($model->description);
35 35
         })
36
-        ->addColumn('version', function ($model) {
36
+        ->addColumn('version', function($model) {
37 37
             return $model->version;
38 38
         })
39 39
 
40
-        ->addColumn('file', function ($model) {
40
+        ->addColumn('file', function($model) {
41 41
             return $model->file;
42 42
         })
43
-        ->addColumn('action', function ($model) {
43
+        ->addColumn('action', function($model) {
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="'
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,8 @@
 block discarded – undo
58 58
         $file_upload->description = $request->input('description');
59 59
         $file_upload->version = $request->input('version');
60 60
         $autoUpdateStatus = StatusSetting::pluck('update_settings')->first();
61
-        if ($autoUpdateStatus == 1) { //If License Setting Status is on,Add Product to the License Manager
61
+        if ($autoUpdateStatus == 1) {
62
+//If License Setting Status is on,Add Product to the License Manager
62 63
             $productSku = $file_upload->product->product_sku;
63 64
             $updateClassObj = new \App\Http\Controllers\AutoUpdate\AutoUpdateController();
64 65
             $addProductToAutoUpdate = $updateClassObj->editVersion($request->input('version'), $productSku);
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ProductController.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -120,10 +120,10 @@
 block discarded – undo
120 120
                             ->addColumn('name', function ($model) {
121 121
                                 return ucfirst($model->name);
122 122
                             })
123
-                              ->addColumn('image', function ($model) {
124
-                                  // return $model->image;
125
-                                  return "<img src= '$model->image' + height=\"80\"/>";
126
-                              })
123
+                                ->addColumn('image', function ($model) {
124
+                                    // return $model->image;
125
+                                    return "<img src= '$model->image' + height=\"80\"/>";
126
+                                })
127 127
                             ->addColumn('type', function ($model) {
128 128
                                 if ($this->type->where('id', $model->type)->first()) {
129 129
                                     return $this->type->where('id', $model->type)->first()->name;
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -113,18 +113,18 @@  discard block
 block discarded – undo
113 113
 
114 114
             return\ DataTables::of($new_product)
115 115
 
116
-                            ->addColumn('checkbox', function ($model) {
116
+                            ->addColumn('checkbox', function($model) {
117 117
                                 return "<input type='checkbox' class='product_checkbox' 
118 118
                                 value=".$model->id.' name=select[] id=check>';
119 119
                             })
120
-                            ->addColumn('name', function ($model) {
120
+                            ->addColumn('name', function($model) {
121 121
                                 return ucfirst($model->name);
122 122
                             })
123
-                              ->addColumn('image', function ($model) {
123
+                              ->addColumn('image', function($model) {
124 124
                                   // return $model->image;
125 125
                                   return "<img src= '$model->image' + height=\"80\"/>";
126 126
                               })
127
-                            ->addColumn('type', function ($model) {
127
+                            ->addColumn('type', function($model) {
128 128
                                 if ($this->type->where('id', $model->type)->first()) {
129 129
                                     return $this->type->where('id', $model->type)->first()->name;
130 130
                                 } else {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                                 }
133 133
                             })
134 134
 
135
-                            ->addColumn('group', function ($model) {
135
+                            ->addColumn('group', function($model) {
136 136
                                 if ($this->group->where('id', $model->group)->first()) {
137 137
                                     return $this->group->where('id', $model->group)->first()->name;
138 138
                                 } else {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                                 }
141 141
                             })
142 142
 
143
-                            ->addColumn('Action', function ($model) {
143
+                            ->addColumn('Action', function($model) {
144 144
                                 $url = '';
145 145
                                 if ($model->type == 2) {
146 146
                                     $url = '<a href='.url('product/download/'.$model->id).
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -183,7 +183,8 @@  discard block
 block discarded – undo
183 183
             $this->product_upload->save();
184 184
             $this->product->where('id', $product_id->id)->update(['version'=>$request->input('version')]);
185 185
             $autoUpdateStatus = StatusSetting::pluck('update_settings')->first();
186
-            if ($autoUpdateStatus == 1) { //If License Setting Status is on,Add Product to the License Manager
186
+            if ($autoUpdateStatus == 1) {
187
+//If License Setting Status is on,Add Product to the License Manager
187 188
                 $updateClassObj = new \App\Http\Controllers\AutoUpdate\AutoUpdateController();
188 189
                 $addProductToAutoUpdate = $updateClassObj->addNewVersion($product_id->id, $request->input('version'), '1');
189 190
             }
@@ -270,7 +271,8 @@  discard block
 block discarded – undo
270 271
 
271 272
         try {
272 273
             $licenseStatus = StatusSetting::pluck('license_status')->first();
273
-            if ($licenseStatus == 1) { //If License Setting Status is on,Add Product to the License Manager
274
+            if ($licenseStatus == 1) {
275
+//If License Setting Status is on,Add Product to the License Manager
274 276
                 $addProductToLicensing = $this->licensing->addNewProduct($input['name'], $input['product_sku']);
275 277
             }
276 278
             $licenseCont = new \App\Http\Controllers\AutoUpdate\AutoUpdateController();
Please login to merge, or discard this patch.
app/Http/Controllers/Order/BaseOrderController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@
 block discarded – undo
271 271
         $data = $template->data;
272 272
         $replace = [
273 273
             'name'         => $user->first_name.' '.$user->last_name,
274
-             'serialkeyurl'=> $myaccounturl,
274
+                'serialkeyurl'=> $myaccounturl,
275 275
             'downloadurl'  => $downloadurl,
276 276
             'invoiceurl'   => $invoiceurl,
277 277
             'product'      => $product,
Please login to merge, or discard this patch.
app/Http/Controllers/Order/ExtendedOrderController.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -137,15 +137,15 @@
 block discarded – undo
137 137
                 case '1':
138 138
                    $lastFour = '000'.$noOfAgents;
139 139
                     break;
140
-                   case '2':
140
+                    case '2':
141 141
                     $lastFour = '00'.$noOfAgents;
142
-                     break;
143
-                      case '3':
142
+                        break;
143
+                        case '3':
144 144
                     $lastFour = '0'.$noOfAgents;
145
-                     break;
146
-                      case '4':
145
+                        break;
146
+                        case '4':
147 147
                     $lastFour = $noOfAgents;
148
-                     break;
148
+                        break;
149 149
                 default:
150 150
                     $lastFour = '0000';
151 151
                     break;
Please login to merge, or discard this patch.