Completed
Push — development ( 391142...b6c7fb )
by Bhanu
70:59 queued 61:25
created
app/Http/Controllers/HomeController.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             $serial_key = $this->checkSerialKey($faveo_encrypted_key, $order_number);
96 96
 
97 97
             \Log::emergency(json_encode(['domain' => $request->input('domain'),
98
-             'serial'                             => $serial_key, 'order' => $order_number, ]));
98
+                'serial'                             => $serial_key, 'order' => $order_number, ]));
99 99
             $result = [];
100 100
             if ($request_type == 'install') {
101 101
                 $result = $this->verificationResult($order_number, $serial_key, $domain);
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
             // $faveo_encrypted_key = self::decryptByFaveoPrivateKey($request->input('serial_key'));
349 349
             // $faveo_encrypted_domain = self::decryptByFaveoPrivateKey($request->input('domain'));
350 350
             $this_order = $order
351
-                     ->where('number', $faveo_encrypted_order_number)
351
+                        ->where('number', $faveo_encrypted_order_number)
352 352
                     // ->where('number', $request->input('order_number'))
353 353
                     //->where('serial_key', $faveo_encrypted_key)
354 354
                     //->where('domain', $faveo_encrypted_domain)
Please login to merge, or discard this patch.
app/Console/Commands/Install.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
             $dbpassword = $this->ask('Enter your database password (blank if not entered)', false);
49 49
             $port = $this->ask('Enter your sql port (blank if not entered)', false);
50 50
             $array = ['DB_TYPE' => $default, 'DB_HOST' => $host,
51
-             'DB_DATABASE'      => $database, 'DB_USERNAME' => $dbusername, 'DB_PASSWORD' => $dbpassword, ];
51
+                'DB_DATABASE'      => $database, 'DB_USERNAME' => $dbusername, 'DB_PASSWORD' => $dbpassword, ];
52 52
             $this->updateDBEnv($array);
53 53
             $this->call('key:generate');
54 54
             $this->call('migrate');
Please login to merge, or discard this patch.
app/Http/Controllers/Front/CartController.php 2 patches
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -192,149 +192,149 @@  discard block
 block discarded – undo
192 192
                 $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray();
193 193
 
194 194
                 if ($tax_class_id) {//If the product is allowed for tax (Check in tax_product relation table)
195
-                   if ($tax_enable == 1) {//If GST is Enabled
196
-
197
-                       $state_code = '';
198
-                       $c_gst = '';
199
-                       $s_gst = '';
200
-                       $i_gst = '';
201
-                       $ut_gst = '';
202
-                       $value = '';
203
-                       $rate = '';
204
-                       $status = 1;
205
-
206
-                       if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
207
-                           $c_gst = $user_state->c_gst;
208
-                           $s_gst = $user_state->s_gst;
209
-                           $i_gst = $user_state->i_gst;
210
-                           $ut_gst = $user_state->ut_gst;
211
-                           $state_code = $user_state->state_code;
212
-
213
-                           if ($state_code == $origin_state) {//If user and origin state are same
214
-                               $rateForSameState = $this->getTaxWhenIndianSameState($user_state,
195
+                    if ($tax_enable == 1) {//If GST is Enabled
196
+
197
+                        $state_code = '';
198
+                        $c_gst = '';
199
+                        $s_gst = '';
200
+                        $i_gst = '';
201
+                        $ut_gst = '';
202
+                        $value = '';
203
+                        $rate = '';
204
+                        $status = 1;
205
+
206
+                        if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
207
+                            $c_gst = $user_state->c_gst;
208
+                            $s_gst = $user_state->s_gst;
209
+                            $i_gst = $user_state->i_gst;
210
+                            $ut_gst = $user_state->ut_gst;
211
+                            $state_code = $user_state->state_code;
212
+
213
+                            if ($state_code == $origin_state) {//If user and origin state are same
214
+                                $rateForSameState = $this->getTaxWhenIndianSameState($user_state,
215 215
                                 $origin_state, $productid, $c_gst, $s_gst, $state_code, $status);
216 216
 
217
-                               $taxes = $rateForSameState['taxes'];
218
-                               $status = $rateForSameState['status'];
219
-                               $value = $rateForSameState['value'];
220
-                           } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
221
-                               $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state,
217
+                                $taxes = $rateForSameState['taxes'];
218
+                                $status = $rateForSameState['status'];
219
+                                $value = $rateForSameState['value'];
220
+                            } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
221
+                                $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state,
222 222
                                 $origin_state, $productid, $i_gst, $state_code, $status);
223
-                               $taxes = $rateForOtherState['taxes'];
224
-                               $status = $rateForOtherState['status'];
225
-                               $value = $rateForOtherState['value'];
226
-                           } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
227
-                               $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state,
223
+                                $taxes = $rateForOtherState['taxes'];
224
+                                $status = $rateForOtherState['status'];
225
+                                $value = $rateForOtherState['value'];
226
+                            } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
227
+                                $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state,
228 228
                                 $origin_state, $productid, $c_gst, $ut_gst, $state_code, $status);
229
-                               $taxes = $rateForUnionTerritory['taxes'];
230
-                               $status = $rateForUnionTerritory['status'];
231
-                               $value = $rateForUnionTerritory['value'];
232
-                           }
233
-                       } else {//If user from other Country
234
-                           $taxClassId = Tax::where('state', $geoip_state)
235
-                           ->orWhere('country', $geoip_country)
236
-                           ->pluck('tax_classes_id')->first();
237
-                           if ($taxClassId) { //if state equals the user State or country equals user country
238
-                               $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId,
229
+                                $taxes = $rateForUnionTerritory['taxes'];
230
+                                $status = $rateForUnionTerritory['status'];
231
+                                $value = $rateForUnionTerritory['value'];
232
+                            }
233
+                        } else {//If user from other Country
234
+                            $taxClassId = Tax::where('state', $geoip_state)
235
+                            ->orWhere('country', $geoip_country)
236
+                            ->pluck('tax_classes_id')->first();
237
+                            if ($taxClassId) { //if state equals the user State or country equals user country
238
+                                $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId,
239 239
                                 $productid, $status);
240
-                               $taxes = $taxForSpecificCountry['taxes'];
241
-                               $status = $taxForSpecificCountry['status'];
242
-                               $value = $taxForSpecificCountry['value'];
243
-                               $rate = $taxForSpecificCountry['value'];
244
-                           } else {//if Tax is selected for Any Country Any State
245
-                               $taxClassId = Tax::where('country', '')
246
-                               ->where('state', 'Any State')
247
-                               ->pluck('tax_classes_id')->first();
248
-                               if ($taxClassId) {
249
-                                   $taxForAnyCountry = $this->getTaxForAnyCountry($taxClassId, $productid, $status);
250
-                                   $taxes = $taxForAnyCountry['taxes'];
251
-                                   $status = $taxForAnyCountry['status'];
252
-                                   $value = $taxForAnyCountry['value'];
253
-                                   $rate = $taxForAnyCountry['value'];
254
-                               } else {
255
-                                   $taxes = [0];
256
-                               }
257
-                           }
258
-                       }
259
-                       foreach ($taxes as $key => $tax) {
240
+                                $taxes = $taxForSpecificCountry['taxes'];
241
+                                $status = $taxForSpecificCountry['status'];
242
+                                $value = $taxForSpecificCountry['value'];
243
+                                $rate = $taxForSpecificCountry['value'];
244
+                            } else {//if Tax is selected for Any Country Any State
245
+                                $taxClassId = Tax::where('country', '')
246
+                                ->where('state', 'Any State')
247
+                                ->pluck('tax_classes_id')->first();
248
+                                if ($taxClassId) {
249
+                                    $taxForAnyCountry = $this->getTaxForAnyCountry($taxClassId, $productid, $status);
250
+                                    $taxes = $taxForAnyCountry['taxes'];
251
+                                    $status = $taxForAnyCountry['status'];
252
+                                    $value = $taxForAnyCountry['value'];
253
+                                    $rate = $taxForAnyCountry['value'];
254
+                                } else {
255
+                                    $taxes = [0];
256
+                                }
257
+                            }
258
+                        }
259
+                        foreach ($taxes as $key => $tax) {
260 260
 
261 261
                                     //All the da a attribute that is sent to the checkout Page if tax_compound=0
262
-                           if ($taxes[0]) {
263
-                               $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst,
264
-                               's_gst'                        => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst,
262
+                            if ($taxes[0]) {
263
+                                $tax_attribute[$key] = ['name' => $tax->name, 'c_gst'=>$c_gst,
264
+                                's_gst'                        => $s_gst, 'i_gst'=>$i_gst, 'ut_gst'=>$ut_gst,
265 265
                                 'state'                       => $state_code, 'origin_state'=>$origin_state,
266
-                                 'tax_enable'                 => $tax_enable, 'rate'=>$value, 'status'=>$status, ];
266
+                                    'tax_enable'                 => $tax_enable, 'rate'=>$value, 'status'=>$status, ];
267 267
 
268
-                               $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
268
+                                $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
269 269
 
270 270
                                             'name'   => 'no compound',
271 271
                                             'type'   => 'tax',
272 272
                                             'target' => 'item',
273 273
                                             'value'  => $value,
274
-                                          ]);
275
-                           } else {
276
-                               $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
277
-                               $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
278
-                                           'name'   => 'null',
279
-                                           'type'   => 'tax',
280
-                                           'target' => 'item',
281
-                                           'value'  => '0%',
282
-                                         ]);
283
-                           }
284
-                       }
285
-                   } elseif ($tax_enable == 0) {//If Tax enable is 0
286
-                       $status = 1;
287
-                       if ($this->tax_option->findOrFail(1)->tax_enable == 0) {
288
-                           $taxClassId = Tax::where('country', '')
289
-                           ->where('state', 'Any State')
290
-                           ->pluck('tax_classes_id')->first(); //In case of India when
291
-                           // other tax is available and tax is not enabled
292
-                           if ($taxClassId) {
293
-                               $taxes = $this->getTaxByPriority($taxClassId);
294
-                               $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
295
-                               if ($value == 0) {
296
-                                   $status = 0;
297
-                               }
298
-                               $rate = $value;
299
-                               foreach ($taxes as $key => $tax) {
300
-                                   $tax_attribute[$key] = ['name' => $tax->name,
301
-                                   'rate'                         => $value, 'tax_enable'=>0, 'status' => $status, ];
302
-                                   $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([
274
+                                            ]);
275
+                            } else {
276
+                                $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
277
+                                $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
278
+                                            'name'   => 'null',
279
+                                            'type'   => 'tax',
280
+                                            'target' => 'item',
281
+                                            'value'  => '0%',
282
+                                            ]);
283
+                            }
284
+                        }
285
+                    } elseif ($tax_enable == 0) {//If Tax enable is 0
286
+                        $status = 1;
287
+                        if ($this->tax_option->findOrFail(1)->tax_enable == 0) {
288
+                            $taxClassId = Tax::where('country', '')
289
+                            ->where('state', 'Any State')
290
+                            ->pluck('tax_classes_id')->first(); //In case of India when
291
+                            // other tax is available and tax is not enabled
292
+                            if ($taxClassId) {
293
+                                $taxes = $this->getTaxByPriority($taxClassId);
294
+                                $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
295
+                                if ($value == 0) {
296
+                                    $status = 0;
297
+                                }
298
+                                $rate = $value;
299
+                                foreach ($taxes as $key => $tax) {
300
+                                    $tax_attribute[$key] = ['name' => $tax->name,
301
+                                    'rate'                         => $value, 'tax_enable'=>0, 'status' => $status, ];
302
+                                    $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([
303 303
 
304 304
                                             'name'   => $tax->name,
305 305
                                             'type'   => 'tax',
306 306
                                             'target' => 'item',
307 307
                                             'value'  => $value,
308 308
                                         ]);
309
-                               }
310
-                           } else {//In case of other country
311
-                               //when tax is available and tax is not enabled
312
-                               //(Applicable when Global Tax class for any country and state is not there)
313
-                               $taxClassId = Tax::where('state', $geoip_state)
314
-                               ->orWhere('country', $geoip_country)
315
-                               ->pluck('tax_classes_id')->first();
316
-                               if ($taxClassId) { //if state equals the user State
317
-                                   $taxes = $this->getTaxByPriority($taxClassId);
318
-                                   $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
319
-                                   if ($value == '') {
320
-                                       $status = 0;
321
-                                   }
322
-                                   $rate = $value;
323
-                               }
324
-                               foreach ($taxes as $key => $tax) {
325
-                                   $tax_attribute[$key] = ['name' => $tax->name,
326
-                                   'rate'                         => $value, 'tax_enable'=>0, 'status' => $status, ];
327
-                                   $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([
309
+                                }
310
+                            } else {//In case of other country
311
+                                //when tax is available and tax is not enabled
312
+                                //(Applicable when Global Tax class for any country and state is not there)
313
+                                $taxClassId = Tax::where('state', $geoip_state)
314
+                                ->orWhere('country', $geoip_country)
315
+                                ->pluck('tax_classes_id')->first();
316
+                                if ($taxClassId) { //if state equals the user State
317
+                                    $taxes = $this->getTaxByPriority($taxClassId);
318
+                                    $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
319
+                                    if ($value == '') {
320
+                                        $status = 0;
321
+                                    }
322
+                                    $rate = $value;
323
+                                }
324
+                                foreach ($taxes as $key => $tax) {
325
+                                    $tax_attribute[$key] = ['name' => $tax->name,
326
+                                    'rate'                         => $value, 'tax_enable'=>0, 'status' => $status, ];
327
+                                    $taxCondition[$key] = new \Darryldecode\Cart\CartCondition([
328 328
 
329 329
                                             'name'   => $tax->name,
330 330
                                             'type'   => 'tax',
331 331
                                             'target' => 'item',
332 332
                                             'value'  => $value,
333 333
                                         ]);
334
-                               }
335
-                           }
336
-                       }
337
-                   }
334
+                                }
335
+                            }
336
+                        }
337
+                    }
338 338
                 } else {
339 339
                     $tax_attribute[0] = ['name' => 'null', 'rate' => 0, 'tax_enable' =>0];
340 340
                     $taxCondition[0] = new \Darryldecode\Cart\CartCondition([
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         $value = '';
414 414
         $value = $taxes->toArray()[0]['active'] ?
415 415
              (TaxProductRelation::where('product_id', $productid)
416
-              ->where('tax_class_id', $taxClassId)->count() ? $ut_gst + $c_gst.'%' : 0) : 0;
416
+                ->where('tax_class_id', $taxClassId)->count() ? $ut_gst + $c_gst.'%' : 0) : 0;
417 417
 
418 418
         return $value;
419 419
     }
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
         $otherRate = 0;
431 431
         $status = $taxes->toArray()[0]['active'];
432 432
         if ($status && (TaxProductRelation::where('product_id', $productid)
433
-          ->where('tax_class_id', $taxClassId)->count() > 0)) {
433
+            ->where('tax_class_id', $taxClassId)->count() > 0)) {
434 434
             $otherRate = Tax::where('tax_classes_id', $taxClassId)->first()->rate;
435 435
         }
436 436
         $value = $otherRate.'%';
@@ -711,7 +711,7 @@  discard block
 block discarded – undo
711 711
             if ($subregion) {
712 712
                 $result = ['id' => $subregion->state_subdivision_code,
713 713
 
714
-                     'name' => $subregion->state_subdivision_name, ];
714
+                        'name' => $subregion->state_subdivision_name, ];
715 715
             }
716 716
 
717 717
             return $result;
Please login to merge, or discard this patch.
Braces   +28 added lines, -14 removed lines patch added patch discarded remove patch
@@ -179,8 +179,10 @@  discard block
 block discarded – undo
179 179
                 $origin_state = $this->setting->first()->state; //Get the State of origin
180 180
                 $tax_class_id = TaxProductRelation::where('product_id', $productid)->pluck('tax_class_id')->toArray();
181 181
 
182
-                if ($tax_class_id) {//If the product is allowed for tax (Check in tax_product relation table)
183
-                   if ($tax_enable == 1) {//If GST is Enabled
182
+                if ($tax_class_id) {
183
+//If the product is allowed for tax (Check in tax_product relation table)
184
+                   if ($tax_enable == 1) {
185
+//If GST is Enabled
184 186
 
185 187
                        $state_code = '';
186 188
                        $c_gst = '';
@@ -191,45 +193,52 @@  discard block
 block discarded – undo
191 193
                        $rate = '';
192 194
                        $status = 1;
193 195
 
194
-                       if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
196
+                       if ($user_state != '') {
197
+//Get the CGST,SGST,IGST,STATE_CODE of the user
195 198
                            $c_gst = $user_state->c_gst;
196 199
                            $s_gst = $user_state->s_gst;
197 200
                            $i_gst = $user_state->i_gst;
198 201
                            $ut_gst = $user_state->ut_gst;
199 202
                            $state_code = $user_state->state_code;
200 203
 
201
-                           if ($state_code == $origin_state) {//If user and origin state are same
204
+                           if ($state_code == $origin_state) {
205
+//If user and origin state are same
202 206
                                $rateForSameState = $this->getTaxWhenIndianSameState($user_state,
203 207
                                 $origin_state, $productid, $c_gst, $s_gst, $state_code, $status);
204 208
 
205 209
                                $taxes = $rateForSameState['taxes'];
206 210
                                $status = $rateForSameState['status'];
207 211
                                $value = $rateForSameState['value'];
208
-                           } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {//If user is from other state
212
+                           } elseif ($state_code != $origin_state && $ut_gst == 'NULL') {
213
+//If user is from other state
209 214
                                $rateForOtherState = $this->getTaxWhenIndianOtherState($user_state,
210 215
                                 $origin_state, $productid, $i_gst, $state_code, $status);
211 216
                                $taxes = $rateForOtherState['taxes'];
212 217
                                $status = $rateForOtherState['status'];
213 218
                                $value = $rateForOtherState['value'];
214
-                           } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {//if user from Union Territory
219
+                           } elseif ($state_code != $origin_state && $ut_gst != 'NULL') {
220
+//if user from Union Territory
215 221
                                $rateForUnionTerritory = $this->getTaxWhenUnionTerritory($user_state,
216 222
                                 $origin_state, $productid, $c_gst, $ut_gst, $state_code, $status);
217 223
                                $taxes = $rateForUnionTerritory['taxes'];
218 224
                                $status = $rateForUnionTerritory['status'];
219 225
                                $value = $rateForUnionTerritory['value'];
220 226
                            }
221
-                       } else {//If user from other Country
227
+                       } else {
228
+//If user from other Country
222 229
                            $taxClassId = Tax::where('state', $geoip_state)
223 230
                            ->orWhere('country', $geoip_country)
224 231
                            ->pluck('tax_classes_id')->first();
225
-                           if ($taxClassId) { //if state equals the user State or country equals user country
232
+                           if ($taxClassId) {
233
+//if state equals the user State or country equals user country
226 234
                                $taxForSpecificCountry = $this->getTaxForSpecificCountry($taxClassId,
227 235
                                 $productid, $status);
228 236
                                $taxes = $taxForSpecificCountry['taxes'];
229 237
                                $status = $taxForSpecificCountry['status'];
230 238
                                $value = $taxForSpecificCountry['value'];
231 239
                                $rate = $taxForSpecificCountry['value'];
232
-                           } else {//if Tax is selected for Any Country Any State
240
+                           } else {
241
+//if Tax is selected for Any Country Any State
233 242
                                $taxClassId = Tax::where('country', '')
234 243
                                ->where('state', 'Any State')
235 244
                                ->pluck('tax_classes_id')->first();
@@ -270,7 +279,8 @@  discard block
 block discarded – undo
270 279
                                          ]);
271 280
                            }
272 281
                        }
273
-                   } elseif ($tax_enable == 0) {//If Tax enable is 0
282
+                   } elseif ($tax_enable == 0) {
283
+//If Tax enable is 0
274 284
                        $status = 1;
275 285
                        if ($this->tax_option->findOrFail(1)->tax_enable == 0) {
276 286
                            $taxClassId = Tax::where('country', '')
@@ -295,13 +305,15 @@  discard block
 block discarded – undo
295 305
                                             'value'  => $value,
296 306
                                         ]);
297 307
                                }
298
-                           } else {//In case of other country
308
+                           } else {
309
+//In case of other country
299 310
                                //when tax is available and tax is not enabled
300 311
                                //(Applicable when Global Tax class for any country and state is not there)
301 312
                                $taxClassId = Tax::where('state', $geoip_state)
302 313
                                ->orWhere('country', $geoip_country)
303 314
                                ->pluck('tax_classes_id')->first();
304
-                               if ($taxClassId) { //if state equals the user State
315
+                               if ($taxClassId) {
316
+//if state equals the user State
305 317
                                    $taxes = $this->getTaxByPriority($taxClassId);
306 318
                                    $value = $this->getValueForOthers($productid, $taxClassId, $taxes);
307 319
                                    if ($value == '') {
@@ -883,7 +895,8 @@  discard block
 block discarded – undo
883 895
         try {
884 896
             $currency = Setting::find(1)->default_currency;
885 897
             $currency_symbol = Setting::find(1)->default_symbol;
886
-            if (!\Auth::user()) {//When user is not logged in
898
+            if (!\Auth::user()) {
899
+//When user is not logged in
887 900
                 $location = \GeoIP::getLocation();
888 901
                 $country = \App\Http\Controllers\Front\CartController::findCountryByGeoip($location['iso_code']);
889 902
                 $userCountry = Country::where('country_code_char2', $country)->first();
@@ -901,7 +914,8 @@  discard block
 block discarded – undo
901 914
                 $currency = \Auth::user()->currency;
902 915
                 $currency_symbol = \Auth::user()->currency_symbol;
903 916
             }
904
-            if ($userid != '') {//For Admin Panel Clients
917
+            if ($userid != '') {
918
+//For Admin Panel Clients
905 919
                 $currencyAndSymbol = $this->getCurrency($userid);
906 920
                 $currency = $currencyAndSymbol['currency'];
907 921
                 $currency_symbol = $currencyAndSymbol['symbol'];
Please login to merge, or discard this patch.
app/Http/Controllers/Common/SocialMediaController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,20 +35,20 @@
 block discarded – undo
35 35
             $social = $this->social->get();
36 36
 
37 37
             return \DataTables::of($social)
38
-                            ->addColumn('#', function ($model) {
38
+                            ->addColumn('#', function($model) {
39 39
                                 return "<input type='checkbox' value=".$model->id.' name=select[] id=check>';
40 40
                             })
41
-                            ->addColumn('name', function ($model) {
41
+                            ->addColumn('name', function($model) {
42 42
                                 return $model->name;
43 43
                             })
44
-                            ->addColumn('class', function ($model) {
44
+                            ->addColumn('class', function($model) {
45 45
                                 return $model->class;
46 46
                             })
47
-                            ->addColumn('link', function ($model) {
47
+                            ->addColumn('link', function($model) {
48 48
                                 return $model->link;
49 49
                             })
50 50
                             // ->showColumns('name', 'class', 'link')
51
-                            ->addColumn('action', function ($model) {
51
+                            ->addColumn('action', function($model) {
52 52
                                 return '<a href='.url('social-media/'.$model->id.'/edit')
53 53
                                 ." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit'
54 54
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
Please login to merge, or discard this patch.
app/Http/Controllers/Front/PageController.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,30 +30,30 @@
 block discarded – undo
30 30
     public function getPages()
31 31
     {
32 32
         return \DataTables::of($this->page->get())
33
-                        ->addColumn('checkbox', function ($model) {
33
+                        ->addColumn('checkbox', function($model) {
34 34
                             return "<input type='checkbox' class='page_checkbox' 
35 35
                             value=".$model->id.' name=select[] id=check>';
36 36
                         })
37
-                        ->addColumn('name', function ($model) {
37
+                        ->addColumn('name', function($model) {
38 38
                             return ucfirst($model->name);
39 39
                         })
40
-                        ->addColumn('url', function ($model) {
40
+                        ->addColumn('url', function($model) {
41 41
                             return $model->url;
42 42
                         })
43
-                        ->addColumn('created_at', function ($model) {
43
+                        ->addColumn('created_at', function($model) {
44 44
                             return $model->created_at;
45 45
                         })
46 46
 
47
-                        ->addColumn('content', function ($model) {
47
+                        ->addColumn('content', function($model) {
48 48
                             return str_limit($model->content, 10, '...');
49 49
                         })
50
-                        ->addColumn('action', function ($model) {
50
+                        ->addColumn('action', function($model) {
51 51
                             return '<a href='.url('pages/'.$model->id.'/edit')
52 52
                             ." class='btn btn-sm btn-primary btn-xs'><i class='fa fa-edit'
53 53
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
54 54
                         })
55 55
 
56
-                          ->rawColumns(['checkbox', 'name', 'url',  'created_at', 'content', 'action'])
56
+                          ->rawColumns(['checkbox', 'name', 'url', 'created_at', 'content', 'action'])
57 57
                         ->make(true);
58 58
         // ->searchColumns('name', 'content')
59 59
                         // ->orderColumns('name')
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                                  style='color:white;'> </i>&nbsp;&nbsp;Edit</a>";
54 54
                         })
55 55
 
56
-                          ->rawColumns(['checkbox', 'name', 'url',  'created_at', 'content', 'action'])
56
+                            ->rawColumns(['checkbox', 'name', 'url',  'created_at', 'content', 'action'])
57 57
                         ->make(true);
58 58
         // ->searchColumns('name', 'content')
59 59
                         // ->orderColumns('name')
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
             //servicedesk
327 327
             $sevice_desk_products = $product->where('id', '!=', 1)
328 328
         ->where('category', '=', 'servicedesk')
329
-         ->where('hidden', '=', '0')
329
+            ->where('hidden', '=', '0')
330 330
         ->orderBy('created_at', 'asc')
331 331
         ->get()
332 332
         ->toArray();
Please login to merge, or discard this patch.
app/Http/Controllers/Order/TaxRatesAndCodeExpiryController.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@
 block discarded – undo
271 271
                 return redirect()->back()->with('fails', 'Can not delete');
272 272
             }
273 273
 
274
-            return redirect()->back()->with('success', "Invoice $invoice->number has been Deleted Successfully");
274
+            return redirect()->back()->with('success', "invoice $invoice->number has been Deleted Successfully");
275 275
         } catch (\Exception $e) {
276 276
             Bugsnag::notifyException($e);
277 277
 
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
                         '<td style="border-bottom: 1px solid#ccc; color: #333; 
187 187
                         font-family: Arial,sans-serif; font-size: 14px; line-height: 20px;
188 188
                          padding: 15px 8px;" valign="top">'.$this->currency($invoiceid).' '
189
-                         .$item->subtotal.'</td>'.
189
+                            .$item->subtotal.'</td>'.
190 190
                         '</tr>';
191 191
             }
192 192
         }
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
             return view('themes.default1.invoice.editPayment',
288 288
                 compact('amountReceived','clientid', 'client', 'invoices',  'orders',
289
-                  'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol'));
289
+                    'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol'));
290 290
         } catch (\Exception $e) {
291 291
             Bugsnag::notifyException($e);
292 292
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -285,7 +285,7 @@
 block discarded – undo
285 285
             $orders = $order->where('client', $clientid)->get();
286 286
 
287 287
             return view('themes.default1.invoice.editPayment',
288
-                compact('amountReceived','clientid', 'client', 'invoices',  'orders',
288
+                compact('amountReceived', 'clientid', 'client', 'invoices', 'orders',
289 289
                   'invoiceSum', 'amountReceived', 'pendingAmount', 'currency', 'symbol'));
290 290
         } catch (\Exception $e) {
291 291
             Bugsnag::notifyException($e);
Please login to merge, or discard this patch.
app/Http/Controllers/Front/BaseClientController.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -168,9 +168,9 @@
 block discarded – undo
168 168
             }
169 169
 
170 170
             return \DataTables::of($invoices->get())
171
-             ->addColumn('number', function ($model) {
172
-                 return $model->number;
173
-             })
171
+                ->addColumn('number', function ($model) {
172
+                    return $model->number;
173
+                })
174 174
             ->addColumn('products', function ($model) {
175 175
                 $invoice = $this->invoice->find($model->id);
176 176
                 $products = $invoice->invoiceItem()->pluck('product_name')->toArray();
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -182,27 +182,27 @@
 block discarded – undo
182 182
             }
183 183
 
184 184
             return \DataTables::of($invoices->get())
185
-             ->addColumn('number', function ($model) {
185
+             ->addColumn('number', function($model) {
186 186
                  return $model->number;
187 187
              })
188
-            ->addColumn('products', function ($model) {
188
+            ->addColumn('products', function($model) {
189 189
                 $invoice = $this->invoice->find($model->id);
190 190
                 $products = $invoice->invoiceItem()->pluck('product_name')->toArray();
191 191
 
192 192
                 return ucfirst(implode(',', $products));
193 193
             })
194
-            ->addColumn('date', function ($model) {
194
+            ->addColumn('date', function($model) {
195 195
                 $date = date_create($model->created_at);
196 196
 
197 197
                 return date_format($date, 'M j, Y, g:i a');
198 198
             })
199
-            ->addColumn('total', function ($model) {
199
+            ->addColumn('total', function($model) {
200 200
                 return $model->grand_total;
201 201
             })
202
-            ->addColumn('status', function ($model) {
202
+            ->addColumn('status', function($model) {
203 203
                 return ucfirst($model->status);
204 204
             })
205
-            ->addColumn('action', function ($model) {
205
+            ->addColumn('action', function($model) {
206 206
                 if (\Auth::user()->role == 'admin') {
207 207
                     $url = '/invoices/show?invoiceid='.$model->id;
208 208
                 } else {
Please login to merge, or discard this patch.
app/Http/Controllers/Front/ClientController.php 3 patches
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -77,20 +77,20 @@  discard block
 block discarded – undo
77 77
                     ->select('number', 'created_at', 'grand_total', 'id', 'status');
78 78
 
79 79
             return \DataTables::of($invoices->get())
80
-                            ->addColumn('number', function ($model) {
80
+                            ->addColumn('number', function($model) {
81 81
                                 return $model->number;
82 82
                             })
83
-                            ->addColumn('date', function ($model) {
83
+                            ->addColumn('date', function($model) {
84 84
                                 $date = $model->created_at;
85 85
 
86 86
                                 return $date;
87 87
                                 // $myobject->created_at->timezone($this->auth->user()->timezone);
88 88
                             })
89 89
                             // ->showColumns('created_at')
90
-                            ->addColumn('total', function ($model) {
90
+                            ->addColumn('total', function($model) {
91 91
                                 return $model->grand_total;
92 92
                             })
93
-                            ->addColumn('Action', function ($model) {
93
+                            ->addColumn('Action', function($model) {
94 94
                                 $status = $model->status;
95 95
                                 $payment = '';
96 96
                                 if ($status == 'Pending' && $model->grand_total > 0) {
@@ -147,19 +147,19 @@  discard block
 block discarded – undo
147 147
             }
148 148
 
149 149
             return \DataTables::of($versions)
150
-                            ->addColumn('id', function ($versions) {
150
+                            ->addColumn('id', function($versions) {
151 151
                                 return ucfirst($versions->id);
152 152
                             })
153
-                            ->addColumn('version', function ($versions) {
153
+                            ->addColumn('version', function($versions) {
154 154
                                 return ucfirst($versions->version);
155 155
                             })
156
-                            ->addColumn('title', function ($versions) {
156
+                            ->addColumn('title', function($versions) {
157 157
                                 return ucfirst($versions->title);
158 158
                             })
159
-                            ->addColumn('description', function ($versions) {
159
+                            ->addColumn('description', function($versions) {
160 160
                                 return ucfirst($versions->description);
161 161
                             })
162
-                            ->addColumn('file', function ($versions) use ($countExpiry, $countVersions,$clientid, $invoiceid, $productid) {
162
+                            ->addColumn('file', function($versions) use ($countExpiry, $countVersions, $clientid, $invoiceid, $productid) {
163 163
                                 $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
164 164
                                 $order = Order::where('invoice_id', '=', $invoice_id)->first();
165 165
                                 $order_id = $order->id;
@@ -258,18 +258,18 @@  discard block
 block discarded – undo
258 258
             }
259 259
 
260 260
             return \DataTables::of($link)
261
-                            ->addColumn('version', function ($link) {
261
+                            ->addColumn('version', function($link) {
262 262
                                 return ucfirst($link['tag_name']);
263 263
                             })
264
-                            ->addColumn('name', function ($link) {
264
+                            ->addColumn('name', function($link) {
265 265
                                 return ucfirst($link['name']);
266 266
                             })
267
-                            ->addColumn('description', function ($link) {
267
+                            ->addColumn('description', function($link) {
268 268
                                 $markdown = Markdown::convertToHtml(ucfirst($link['body']));
269 269
 
270 270
                                 return $markdown;
271 271
                             })
272
-                            ->addColumn('file', function ($link) use ($countExpiry,$countVersions,$invoiceid, $productid) {
272
+                            ->addColumn('file', function($link) use ($countExpiry, $countVersions, $invoiceid, $productid) {
273 273
                                 $order = Order::where('invoice_id', '=', $invoiceid)->first();
274 274
                                 $order_id = $order->id;
275 275
                                 $orderEndDate = Subscription::select('ends_at')
@@ -316,20 +316,20 @@  discard block
 block discarded – undo
316 316
             $orders = Order::where('client', \Auth::user()->id);
317 317
 
318 318
             return \DataTables::of($orders->get())
319
-                            ->addColumn('id', function ($model) {
319
+                            ->addColumn('id', function($model) {
320 320
                                 return $model->id;
321 321
                             })
322
-                            ->addColumn('product_name', function ($model) {
322
+                            ->addColumn('product_name', function($model) {
323 323
                                 return $model->product()->first()->name;
324 324
                             })
325
-                            ->addColumn('expiry', function ($model) {
325
+                            ->addColumn('expiry', function($model) {
326 326
                                 $tz = \Auth::user()->timezone()->first()->name;
327 327
                                 $end = $this->getExpiryDate($model);
328 328
 
329 329
                                 return $end;
330 330
                             })
331 331
 
332
-                            ->addColumn('Action', function ($model) {
332
+                            ->addColumn('Action', function($model) {
333 333
                                 $sub = $model->subscription()->first();
334 334
                                 $order = Order::where('id', $model->id)->select('product')->first();
335 335
                                 $productid = $order->product;
@@ -444,17 +444,17 @@  discard block
 block discarded – undo
444 444
                     ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at');
445 445
 
446 446
             return \DataTables::of($payments->get())
447
-                            ->addColumn('checkbox', function ($model) {
447
+                            ->addColumn('checkbox', function($model) {
448 448
                                 if (\Input::get('client') != 'true') {
449 449
                                     return "<input type='checkbox' class='payment_checkbox' 
450 450
                                     value=".$model->id.' name=select[] id=check>';
451 451
                                 }
452 452
                             })
453
-                            ->addColumn('number', function ($model) {
453
+                            ->addColumn('number', function($model) {
454 454
                                 return $model->invoice()->first()->number;
455 455
                             })
456 456
                             ->addColumn('amount', 'payment_method', 'payment_status', 'created_at')
457
-                            ->addColumn('total', function ($model) {
457
+                            ->addColumn('total', function($model) {
458 458
                                 return $model->grand_total;
459 459
                             })
460 460
                             ->rawColumns(['checkbox', 'number', 'total',
@@ -481,13 +481,13 @@  discard block
 block discarded – undo
481 481
                     ->select('id', 'invoice_id', 'user_id', 'payment_method', 'payment_status', 'created_at', 'amount');
482 482
             //dd(\Input::all());
483 483
             return \DataTables::of($payments->get())
484
-                            ->addColumn('number', function ($model) {
484
+                            ->addColumn('number', function($model) {
485 485
                                 return $model->invoice()->first()->number;
486 486
                             })
487
-                              ->addColumn('total', function ($model) {
487
+                              ->addColumn('total', function($model) {
488 488
                                   return $model->amount;
489 489
                               })
490
-                               ->addColumn('created_at', function ($model) {
490
+                               ->addColumn('created_at', function($model) {
491 491
                                    $date1 = new DateTime($model->created_at);
492 492
                                    $tz = \Auth::user()->timezone()->first()->name;
493 493
                                    $date1->setTimezone(new DateTimeZone($tz));
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -169,11 +169,13 @@
 block discarded – undo
169 169
 
170 170
                                 //if product has expiry date ie sunscriptioon is generated
171 171
                                 if ($endDate) {
172
-                                    if ($getDownloadCondition == 1) {//Perpetual download till expiry selected
172
+                                    if ($getDownloadCondition == 1) {
173
+//Perpetual download till expiry selected
173 174
                                         $getDownload = $this->whenDownloadTillExpiry($endDate, $productid, $versions, $clientid, $invoiceid);
174 175
 
175 176
                                         return $getDownload;
176
-                                    } elseif ($getDownloadCondition == 0) {//When download retires after subscription
177
+                                    } elseif ($getDownloadCondition == 0) {
178
+//When download retires after subscription
177 179
 
178 180
                                         $getDownload = $this->whenDownloadExpiresAfterExpiry($countExpiry, $countVersions, $endDate, $productid, $versions, $clientid, $invoiceid);
179 181
 
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
         try {
130 130
             $versions = ProductUpload::where('product_id', $productid)
131 131
             ->select('id', 'product_id', 'version',
132
-             'title', 'description', 'file', 'created_at')->get();
132
+                'title', 'description', 'file', 'created_at')->get();
133 133
             $countVersions = count($versions);
134 134
             $countExpiry = 0;
135 135
             $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
 
138 138
             $order_id = $order->id;
139 139
             $endDate = Subscription::select('ends_at')
140
-                 ->where('product_id', $productid)->where('order_id', $order_id)->first();
140
+                    ->where('product_id', $productid)->where('order_id', $order_id)->first();
141 141
             if ($endDate) {
142 142
                 foreach ($versions as $version) {
143 143
                     if ($version->created_at->toDateTimeString()
144
-               < $endDate->ends_at->toDateTimeString()) {
144
+                < $endDate->ends_at->toDateTimeString()) {
145 145
                         $countExpiry = $countExpiry + 1;
146 146
                     }
147 147
                 }
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
             $bussinesses = \App\Model\Common\Bussiness::pluck('name', 'short')->toArray();
394 394
 
395 395
             return view('themes.default1.front.clients.profile',
396
-             compact('user', 'timezones', 'state', 'states', 'bussinesses'));
396
+                compact('user', 'timezones', 'state', 'states', 'bussinesses'));
397 397
         } catch (Exception $ex) {
398 398
             Bugsnag::notifyException($ex);
399 399
 
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
                                 return $model->grand_total;
473 473
                             })
474 474
                             ->rawColumns(['checkbox', 'number', 'total',
475
-                             'payment_method', 'payment_status', 'created_at', ])
475
+                                'payment_method', 'payment_status', 'created_at', ])
476 476
                             ->make(true);
477 477
         } catch (Exception $ex) {
478 478
             Bugsnag::notifyException($ex);
@@ -498,17 +498,17 @@  discard block
 block discarded – undo
498 498
                             ->addColumn('number', function ($model) {
499 499
                                 return $model->invoice()->first()->number;
500 500
                             })
501
-                              ->addColumn('total', function ($model) {
502
-                                  return $model->amount;
503
-                              })
504
-                               ->addColumn('created_at', function ($model) {
505
-                                   $date1 = new DateTime($model->created_at);
506
-                                   $tz = \Auth::user()->timezone()->first()->name;
507
-                                   $date1->setTimezone(new DateTimeZone($tz));
508
-                                   $date = $date1->format('M j, Y, g:i a');
509
-
510
-                                   return $date;
511
-                               })
501
+                                ->addColumn('total', function ($model) {
502
+                                    return $model->amount;
503
+                                })
504
+                                ->addColumn('created_at', function ($model) {
505
+                                    $date1 = new DateTime($model->created_at);
506
+                                    $tz = \Auth::user()->timezone()->first()->name;
507
+                                    $date1->setTimezone(new DateTimeZone($tz));
508
+                                    $date = $date1->format('M j, Y, g:i a');
509
+
510
+                                    return $date;
511
+                                })
512 512
 
513 513
                             ->addColumn('payment_method', 'payment_status', 'created_at')
514 514
 
Please login to merge, or discard this patch.
app/Http/Controllers/Product/CategoryController.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -56,21 +56,21 @@
 block discarded – undo
56 56
             $allCategories = $this->productCategory->select('id', 'category_name')->get();
57 57
 
58 58
             return \DataTables::of($allCategories)
59
-         ->addColumn('checkbox', function ($model) {
60
-             return "<input type='checkbox' class='category_checkbox' 
59
+            ->addColumn('checkbox', function ($model) {
60
+                return "<input type='checkbox' class='category_checkbox' 
61 61
             value=".$model->id.' name=select[] id=check>';
62
-         })
63
-         ->addColumn('category_name', function ($model) {
64
-             return ucfirst($model->category_name);
65
-         })
66
-         ->addColumn('action', function ($model) {
67
-             return "<p><button data-toggle='modal' 
62
+            })
63
+            ->addColumn('category_name', function ($model) {
64
+                return ucfirst($model->category_name);
65
+            })
66
+            ->addColumn('action', function ($model) {
67
+                return "<p><button data-toggle='modal' 
68 68
              data-id=".$model->id." data-name= '$model->category_name' 
69 69
              class='btn btn-sm btn-primary btn-xs editCat'><i class='fa fa-edit'
70 70
              style='color:white;'> </i>&nbsp;&nbsp;Edit</button>&nbsp;</p>";
71
-         })
72
-         ->rawColumns(['checkbox', 'category_name', 'action'])
73
-         ->make(true);
71
+            })
72
+            ->rawColumns(['checkbox', 'category_name', 'action'])
73
+            ->make(true);
74 74
         } catch (\Exception $ex) {
75 75
             return redirect()->back()->with('fails', $ex->getMessage());
76 76
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,14 +56,14 @@
 block discarded – undo
56 56
             $allCategories = $this->productCategory->select('id', 'category_name')->get();
57 57
 
58 58
             return \DataTables::of($allCategories)
59
-         ->addColumn('checkbox', function ($model) {
59
+         ->addColumn('checkbox', function($model) {
60 60
              return "<input type='checkbox' class='category_checkbox' 
61 61
             value=".$model->id.' name=select[] id=check>';
62 62
          })
63
-         ->addColumn('category_name', function ($model) {
63
+         ->addColumn('category_name', function($model) {
64 64
              return ucfirst($model->category_name);
65 65
          })
66
-         ->addColumn('action', function ($model) {
66
+         ->addColumn('action', function($model) {
67 67
              return "<p><button data-toggle='modal' 
68 68
              data-id=".$model->id." data-name= '$model->category_name' 
69 69
              class='btn btn-sm btn-primary btn-xs editCat'><i class='fa fa-edit'
Please login to merge, or discard this patch.