Completed
Push — development ( 877883...280d38 )
by Ashutosh
10:04
created
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/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/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.
app/Traits/PaymentsAndInvoices.php 2 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,10 +90,12 @@  discard block
 block discarded – undo
90 90
 
91 91
         public function getAgents($agents, $productid, $plan)
92 92
         {
93
-            if (!$agents) {//If agents is not received in the request in the case when
93
+            if (!$agents) {
94
+//If agents is not received in the request in the case when
94 95
                 // 'modify agent' is not allowed for the Product,get the no of Agents from the Plan Table.
95 96
                 $planForAgent = Product::find($productid)->planRelation->find($plan);
96
-                if ($planForAgent) {//If Plan Exists For the Product ie not a Product without Plan
97
+                if ($planForAgent) {
98
+//If Plan Exists For the Product ie not a Product without Plan
97 99
                     $noOfAgents = $planForAgent->planPrice->first()->no_of_agents;
98 100
                     $agents = $noOfAgents ? $noOfAgents : 0; //If no. of Agents is specified then that,else 0(Unlimited Agents)
99 101
                 } else {
@@ -106,7 +108,8 @@  discard block
 block discarded – undo
106 108
 
107 109
         public function getQuantity($qty, $productid, $plan)
108 110
         {
109
-            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.
111
+            if (!$qty) {
112
+//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.
110 113
                 $planForQty = Product::find($productid)->planRelation->find($plan);
111 114
                 if ($planForQty) {
112 115
                     $quantity = Product::find($productid)->planRelation->find($plan)->planPrice->first()->product_quantity;
Please login to merge, or discard this patch.
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
                 $paymentid = $request->input('id');
29 29
                 $creditAmtUserId = $this->payment->where('id', $paymentid)->value('user_id');
30 30
                 $creditAmt = $this->payment->where('user_id', $creditAmtUserId)
31
-                  ->where('invoice_id', '=', 0)->value('amt_to_credit');
31
+                    ->where('invoice_id', '=', 0)->value('amt_to_credit');
32 32
                 $invoices = $invoice->where('user_id', $creditAmtUserId)->orderBy('created_at', 'desc')->get();
33 33
                 $cltCont = new \App\Http\Controllers\User\ClientController();
34 34
                 $invoiceSum = $cltCont->getTotalInvoice($invoices);
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         $payment_method,
62 62
         $invoiceid,
63 63
         $amount,
64
-       $parent_id = '',
64
+        $parent_id = '',
65 65
         $userid = '',
66 66
         $payment_status = 'pending'
67 67
     ) {
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                 $paymentRenewal = $this->updateInvoicePayment(
160 160
                 $invoiceid,
161 161
                 $payment_method,
162
-             $payment_status,
162
+                $payment_status,
163 163
                 $payment_date,
164 164
                 $amount
165 165
             );
@@ -217,15 +217,15 @@  discard block
 block discarded – undo
217 217
 
218 218
                     return view(
219 219
                     'themes.default1.invoice.payment',
220
-                 compact(
221
-                     'invoice_status',
222
-                     'payment_status',
223
-                  'payment_method',
224
-                     'invoice_id',
225
-                     'domain',
226
-                     'invoice',
227
-                     'userid'
228
-                 )
220
+                    compact(
221
+                        'invoice_status',
222
+                        'payment_status',
223
+                    'payment_method',
224
+                        'invoice_id',
225
+                        'domain',
226
+                        'invoice',
227
+                        'userid'
228
+                    )
229 229
                 );
230 230
                 }
231 231
 
Please login to merge, or discard this patch.
app/Traits/Order/UpdateDates.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     public function editUpdateExpiry(Request $request)
23 23
     {
24 24
         $this->validate($request, [
25
-         'date' => 'required',
25
+            'date' => 'required',
26 26
         ]);
27 27
 
28 28
         try {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     public function editLicenseExpiry(Request $request)
68 68
     {
69 69
         $this->validate($request, [
70
-         'date' => 'required',
70
+            'date' => 'required',
71 71
         ]);
72 72
 
73 73
         try {
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     public function editSupportExpiry(Request $request)
113 113
     {
114 114
         $this->validate($request, [
115
-         'date' => 'required',
115
+            'date' => 'required',
116 116
         ]);
117 117
 
118 118
         try {
Please login to merge, or discard this patch.
app/Http/Controllers/DashboardController.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $status = $request->input('status');
61 61
 
62 62
         return view('themes.default1.common.dashboard', compact('allowedCurrencies1','allowedCurrencies2','currency1Symbol','currency2Symbol','totalSalesCurrency2', 'totalSalesCurrency1', 'yearlySalesCurrency2', 'yearlySalesCurrency1', 'monthlySalesCurrency2', 'monthlySalesCurrency1', 'users','count_users', 'arraylists', 'productSoldlists','orders','subscriptions','invoices', 'products', 'arrayCountList', 'pendingPaymentCurrency2', 'pendingPaymentCurrency1', 'status','startSubscriptionDate',
63
-                 'endSubscriptionDate'));
63
+                    'endSubscriptionDate'));
64 64
     }
65 65
 
66 66
     /**
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         // dd($currentYear,$currentMonth );
158 158
         $total = Invoice::whereYear('created_at', '=', $currentYear)->whereMonth('created_at', '=', $currentMonth)
159 159
                 ->where('currency', $allowedCurrencies1)
160
-                 ->where('status', '=', 'success')
160
+                    ->where('status', '=', 'success')
161 161
                 ->pluck('grand_total')->all();
162 162
         $grandTotal = array_sum($total);
163 163
 
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
     public function getAllUsers()
205 205
     {
206 206
         $allUsers = User::orderBy('created_at', 'desc')->where('active', 1)->where('mobile_verified', 1)
207
-              ->take(20)
208
-              ->get()
209
-              ->toArray();
207
+                ->take(20)
208
+                ->get()
209
+                ->toArray();
210 210
 
211 211
         return $allUsers;
212 212
     }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         $dayUtc = new Carbon('-30 days');
242 242
         $minus30Day = $dayUtc->toDateTimeString();
243 243
         $recentOrders = Order::where('created_at', '>', $minus30Day)->orderBy('created_at', 'desc')
244
-                 ->where('price_override', '>', 0)->get();
244
+                    ->where('price_override', '>', 0)->get();
245 245
 
246 246
         return $recentOrders;
247 247
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         $endSubscriptionDate = date('Y-m-d', strtotime('+3 months'));
60 60
         $status = $request->input('status');
61 61
 
62
-        return view('themes.default1.common.dashboard', compact('allowedCurrencies1','allowedCurrencies2','currency1Symbol','currency2Symbol','totalSalesCurrency2', 'totalSalesCurrency1', 'yearlySalesCurrency2', 'yearlySalesCurrency1', 'monthlySalesCurrency2', 'monthlySalesCurrency1', 'users','count_users', 'arraylists', 'productSoldlists','orders','subscriptions','invoices', 'products', 'arrayCountList', 'pendingPaymentCurrency2', 'pendingPaymentCurrency1', 'status','startSubscriptionDate',
62
+        return view('themes.default1.common.dashboard', compact('allowedCurrencies1', 'allowedCurrencies2', 'currency1Symbol', 'currency2Symbol', 'totalSalesCurrency2', 'totalSalesCurrency1', 'yearlySalesCurrency2', 'yearlySalesCurrency1', 'monthlySalesCurrency2', 'monthlySalesCurrency1', 'users', 'count_users', 'arraylists', 'productSoldlists', 'orders', 'subscriptions', 'invoices', 'products', 'arrayCountList', 'pendingPaymentCurrency2', 'pendingPaymentCurrency1', 'status', 'startSubscriptionDate',
63 63
                  'endSubscriptionDate'));
64 64
     }
65 65
 
Please login to merge, or discard this patch.
app/Http/Controllers/Common/TemplateController.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
                             value=".$model->id.' name=select[] id=check>';
123 123
                         })
124 124
 
125
-                         ->addColumn('name', function ($model) {
126
-                             return $model->name;
127
-                         })
125
+                            ->addColumn('name', function ($model) {
126
+                                return $model->name;
127
+                            })
128 128
                         ->addColumn('type', function ($model) {
129 129
                             return $this->type->where('id', $model->type)->first()->name;
130 130
                         })
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     }
269 269
 
270 270
     public function mailing($from, $to, $data, $subject, $replace = [],
271
-     $type = '', $fromname = '', $toname = '', $cc = [], $attach = [])
271
+        $type = '', $fromname = '', $toname = '', $cc = [], $attach = [])
272 272
     {
273 273
         try {
274 274
             $transform = [];
@@ -301,10 +301,10 @@  discard block
 block discarded – undo
301 301
             'date'     => date('Y-m-d H:i:s'),
302 302
             'from'     => $from,
303 303
             'to'       => $to,
304
-             'subject' => $subject,
304
+                'subject' => $subject,
305 305
             'body'     => $data,
306
-          'status'     => 'success',
307
-          ]);
306
+            'status'     => 'success',
307
+            ]);
308 308
 
309 309
             return 'success';
310 310
         } catch (\Exception $ex) {
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
             'date'     => date('Y-m-d H:i:s'),
313 313
             'from'     => $from,
314 314
             'to'       => $to,
315
-             'subject' => $subject,
315
+                'subject' => $subject,
316 316
             'body'     => $data,
317 317
             'status'   => 'failed',
318 318
         ]);
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -117,18 +117,18 @@  discard block
 block discarded – undo
117 117
     public function getTemplates()
118 118
     {
119 119
         return \DataTables::of($this->template->select('id', 'name', 'type')->get())
120
-                        ->addColumn('checkbox', function ($model) {
120
+                        ->addColumn('checkbox', function($model) {
121 121
                             return "<input type='checkbox' class='template_checkbox' 
122 122
                             value=".$model->id.' name=select[] id=check>';
123 123
                         })
124 124
 
125
-                         ->addColumn('name', function ($model) {
125
+                         ->addColumn('name', function($model) {
126 126
                              return $model->name;
127 127
                          })
128
-                        ->addColumn('type', function ($model) {
128
+                        ->addColumn('type', function($model) {
129 129
                             return $this->type->where('id', $model->type)->first()->name;
130 130
                         })
131
-                        ->addColumn('action', function ($model) {
131
+                        ->addColumn('action', function($model) {
132 132
                             return '<a href='.url('templates/'.$model->id.'/edit').
133 133
                             " class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit'
134 134
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
             $settings = \App\Model\Common\Setting::find(1);
280 280
             $fromname = $settings->company;
281
-            \Mail::send('emails.mail', ['data' => $data], function ($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) {
281
+            \Mail::send('emails.mail', ['data' => $data], function($m) use ($from, $to, $subject, $fromname, $toname, $cc, $attach) {
282 282
                 $m->from($from, $fromname);
283 283
 
284 284
                 $m->to($to, $toname)->subject($subject);
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
                     $prices[] = $value->planPrice()->where('currency', $currencyAndSymbol['currency'])->min('add_price');
379 379
                 }
380 380
                 $price = min($prices);
381
-                $format = currency_format($price,$code=$currencyAndSymbol['currency']);
381
+                $format = currency_format($price, $code = $currencyAndSymbol['currency']);
382 382
                 $finalPrice = str_replace($currencyAndSymbol['symbol'], '', $format);
383 383
                 $cost = '<span class="price-unit">'.$currencyAndSymbol['symbol'].'</span>'.$finalPrice;
384 384
             }
Please login to merge, or discard this patch.
app/Http/Controllers/Front/CartController.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -178,13 +178,13 @@  discard block
 block discarded – undo
178 178
                 if (count($tax_class_id) > 0) {//If the product is allowed for tax (Check in tax_product relation table)
179 179
                     if ($tax_enable == 1) {//If GST is Enabled
180 180
 
181
-                         $details = $this->getDetailsWhenUserStateIsIndian(
182
-                             $user_state,
183
-                             $origin_state,
184
-                             $productid,
185
-                             $geoip_state,
186
-                             $geoip_country
187
-                         );
181
+                            $details = $this->getDetailsWhenUserStateIsIndian(
182
+                                $user_state,
183
+                                $origin_state,
184
+                                $productid,
185
+                                $geoip_state,
186
+                                $geoip_country
187
+                            );
188 188
                         $c_gst = $details['cgst'];
189 189
                         $s_gst = $details['sgst'];
190 190
                         $i_gst = $details['igst'];
@@ -202,21 +202,21 @@  discard block
 block discarded – undo
202 202
                             if ($taxes[0]) {
203 203
                                 $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst,
204 204
 
205
-                               's_gst'         => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst,
205
+                                's_gst'         => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst,
206 206
                                 'state'        => $state_code, 'origin_state'=>$origin_state,
207
-                                 'tax_enable'  => $tax_enable, 'rate'=>$value, 'status'=>$status, ];
207
+                                    'tax_enable'  => $tax_enable, 'rate'=>$value, 'status'=>$status, ];
208 208
 
209 209
                                 $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
210 210
                                             'name'   => 'no compound', 'type'   => 'tax',
211 211
                                             'target' => 'item', 'value'  => $value,
212
-                                          ]);
212
+                                            ]);
213 213
                             } else {
214 214
                                 $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
215 215
                                 $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
216
-                                           'name'   => 'null', 'type'   => 'tax',
217
-                                           'target' => 'item', 'value'  => '0%',
218
-                                           'rate'   => 0, 'tax_enable' =>0,
219
-                                         ]);
216
+                                            'name'   => 'null', 'type'   => 'tax',
217
+                                            'target' => 'item', 'value'  => '0%',
218
+                                            'rate'   => 0, 'tax_enable' =>0,
219
+                                            ]);
220 220
                             }
221 221
                         }
222 222
                     } elseif ($tax_enable == 0) {//If Tax enable is 0 and other tax is available
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
             $subregion = \App\Model\Common\State::where('state_subdivision_code', $code)->first();
353 353
             if ($subregion) {
354 354
                 $result = ['id' => $subregion->state_subdivision_code,
355
-                 'name'         => $subregion->state_subdivision_name, ];
355
+                    'name'         => $subregion->state_subdivision_name, ];
356 356
             }
357 357
 
358 358
             return $result;
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -96,7 +96,8 @@  discard block
 block discarded – undo
96 96
     {
97 97
         try {
98 98
             $plan = '';
99
-            if ($request->has('subscription')) {//put he Plan id sent into session variable
99
+            if ($request->has('subscription')) {
100
+//put he Plan id sent into session variable
100 101
                 $plan = $request->get('subscription');
101 102
                 Session::put('plan', $plan);
102 103
             }
@@ -127,7 +128,8 @@  discard block
 block discarded – undo
127 128
             foreach ($cartCollection as $item) {
128 129
                 $attributes[] = $item->attributes;
129 130
                 $cart_currency = $attributes[0]['currency']['currency'];
130
-                if (\Auth::user()) {//If User is Loggen in and his currency changes after logginng in then remove his previous order from cart
131
+                if (\Auth::user()) {
132
+//If User is Loggen in and his currency changes after logginng in then remove his previous order from cart
131 133
                     $currency = \Auth::user()->currency;
132 134
                     if ($cart_currency != $currency) {
133 135
                         $id = $item->id;
@@ -174,8 +176,10 @@  discard block
 block discarded – undo
174 176
                 $user_state = TaxByState::where('state_code', $geoip_state)->first();
175 177
                 $origin_state = $this->setting->first()->state; //Get the State of origin
176 178
                 $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray();
177
-                if (count($tax_class_id) > 0) {//If the product is allowed for tax (Check in tax_product relation table)
178
-                    if ($tax_enable == 1) {//If GST is Enabled
179
+                if (count($tax_class_id) > 0) {
180
+//If the product is allowed for tax (Check in tax_product relation table)
181
+                    if ($tax_enable == 1) {
182
+//If GST is Enabled
179 183
 
180 184
                          $details = $this->getDetailsWhenUserStateIsIndian(
181 185
                              $user_state,
@@ -218,7 +222,8 @@  discard block
 block discarded – undo
218 222
                                          ]);
219 223
                             }
220 224
                         }
221
-                    } elseif ($tax_enable == 0) {//If Tax enable is 0 and other tax is available
225
+                    } elseif ($tax_enable == 0) {
226
+//If Tax enable is 0 and other tax is available
222 227
 
223 228
                         $details = $this->whenOtherTaxAvailableAndTaxNotEnable($tax_class_id, $productid, $geoip_state, $geoip_country);
224 229
 
@@ -394,7 +399,8 @@  discard block
 block discarded – undo
394 399
         try {
395 400
             $currency = Setting::find(1)->default_currency;
396 401
             $currency_symbol = Setting::find(1)->default_symbol;
397
-            if (!\Auth::user()) {//When user is not logged in
402
+            if (!\Auth::user()) {
403
+//When user is not logged in
398 404
                 $cont = new \App\Http\Controllers\Front\PageController();
399 405
                 $location = $cont->getLocation();
400 406
                 $country = self::findCountryByGeoip($location['iso_code']);
@@ -409,7 +415,8 @@  discard block
 block discarded – undo
409 415
                 $currency = \Auth::user()->currency;
410 416
                 $currency_symbol = \Auth::user()->currency_symbol;
411 417
             }
412
-            if ($userid != '') {//For Admin Panel Clients
418
+            if ($userid != '') {
419
+//For Admin Panel Clients
413 420
                 $currencyAndSymbol = self::getCurrency($userid);
414 421
                 $currency = $currencyAndSymbol['currency'];
415 422
                 $currency_symbol = $currencyAndSymbol['symbol'];
Please login to merge, or discard this patch.
app/Http/Controllers/Payment/CurrencyController.php 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
                             return $model->name;
46 46
                         })
47 47
 
48
-                          ->addColumn('code', function ($model) {
49
-                              return $model->code;
50
-                          })
48
+                            ->addColumn('code', function ($model) {
49
+                                return $model->code;
50
+                            })
51 51
 
52
-                          ->addColumn('symbol', function ($model) {
53
-                              return $model->symbol;
54
-                          })
52
+                            ->addColumn('symbol', function ($model) {
53
+                                return $model->symbol;
54
+                            })
55 55
 
56
-                          ->addColumn('dashboard', function ($model) {
57
-                              if ($model->status == 1) {
58
-                                  $showButton = $this->getButtonColor($model->id);
56
+                            ->addColumn('dashboard', function ($model) {
57
+                                if ($model->status == 1) {
58
+                                    $showButton = $this->getButtonColor($model->id);
59 59
 
60
-                                  return $showButton;
61
-                              } else {
62
-                                  return  '<a class="btn btn-sm btn-primary btn-xs disabled"><i class="fa fa-eye"
60
+                                    return $showButton;
61
+                                } else {
62
+                                    return  '<a class="btn btn-sm btn-primary btn-xs disabled"><i class="fa fa-eye"
63 63
                                 style="color:white;"> </i>&nbsp;&nbsp;Show on Dashboard</a>';
64
-                              }
65
-                          })
64
+                                }
65
+                            })
66 66
 
67 67
                         ->addColumn('status', function ($model) {
68 68
                             if ($model->status == 1) {
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     {
288 288
         $countryDetails = Country::where('country_id', $request->id)->select('currency_code', 'currency_symbol', 'currency_name')->first();
289 289
         $data = (['code'=> $countryDetails->currency_code,
290
-          'symbol'      => $countryDetails->currency_symbol, 'currency'=>$countryDetails->currency_name, ]);
290
+            'symbol'      => $countryDetails->currency_symbol, 'currency'=>$countryDetails->currency_name, ]);
291 291
 
292 292
         return $data;
293 293
     }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,19 +41,19 @@  discard block
 block discarded – undo
41 41
 
42 42
         return \DataTables::of($model)
43 43
 
44
-                        ->addColumn('name', function ($model) {
44
+                        ->addColumn('name', function($model) {
45 45
                             return $model->name;
46 46
                         })
47 47
 
48
-                          ->addColumn('code', function ($model) {
48
+                          ->addColumn('code', function($model) {
49 49
                               return $model->code;
50 50
                           })
51 51
 
52
-                          ->addColumn('symbol', function ($model) {
52
+                          ->addColumn('symbol', function($model) {
53 53
                               return $model->symbol;
54 54
                           })
55 55
 
56
-                          ->addColumn('dashboard', function ($model) {
56
+                          ->addColumn('dashboard', function($model) {
57 57
                               if ($model->status == 1) {
58 58
                                   $showButton = $this->getButtonColor($model->id);
59 59
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
                               }
65 65
                           })
66 66
 
67
-                        ->addColumn('status', function ($model) {
67
+                        ->addColumn('status', function($model) {
68 68
                             if ($model->status == 1) {
69 69
                                 return'<label class="switch toggle_event_editing">
70 70
                             <input type="hidden" name="module_id" class="module_id" value="'.$model->id.'" >
Please login to merge, or discard this patch.