Completed
Push — development ( 7c599c...c0476d )
by Bhanu
20:27 queued 09:50
created
app/Http/Controllers/Order/TaxRatesAndCodeExpiryController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@
 block discarded – undo
183 183
                         '<td style="border-bottom: 1px solid#ccc; color: #333; 
184 184
                         font-family: Arial,sans-serif; font-size: 14px; line-height: 20px;
185 185
                          padding: 15px 8px;" valign="top">'.$this->currency($invoiceid).' '
186
-                         .$item->subtotal.'</td>'.
186
+                            .$item->subtotal.'</td>'.
187 187
                         '</tr>';
188 188
             }
189 189
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Order/InvoiceController.php 3 patches
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -475,7 +475,8 @@  discard block
 block discarded – undo
475 475
             if ($this->tax_option->findOrFail(1)->inclusive == 0) {
476 476
                 if ($this->tax_option->findOrFail(1)->tax_enable == 1) {
477 477
                     $taxs = $this->getTaxWhenEnable($productid, $taxs[0], $userid);
478
-                } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
478
+                } elseif ($this->tax_option->tax_enable == 0) {
479
+//if tax_enable is 0
479 480
 
480 481
                     $taxClassId = Tax::where('country', '')->where('state', 'Any State')
481 482
                      ->pluck('tax_classes_id')->first(); //In case of India when
@@ -484,13 +485,15 @@  discard block
 block discarded – undo
484 485
                         $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
485 486
                         $taxs = $rate['taxes'];
486 487
                         $rate = $rate['rate'];
487
-                    } elseif ($geoip_country != 'IN') {//In case of other country
488
+                    } elseif ($geoip_country != 'IN') {
489
+//In case of other country
488 490
                         // when tax is available and tax is not enabled(Applicable
489 491
                         //when Global Tax class for any country and state is not there)
490 492
 
491 493
                         $taxClassId = Tax::where('state', $geoip_state)
492 494
                         ->orWhere('country', $geoip_country)->pluck('tax_classes_id')->first();
493
-                        if ($taxClassId) { //if state equals the user State
495
+                        if ($taxClassId) {
496
+//if state equals the user State
494 497
                             $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
495 498
                             $taxs = $rate['taxes'];
496 499
                             $rate = $rate['rate'];
@@ -533,11 +536,13 @@  discard block
 block discarded – undo
533 536
         $i_gst = 0;
534 537
         $ut_gst = 0;
535 538
         $state_code = '';
536
-        if ($user_state != '') {//Get the CGST,SGST,IGST,STATE_CODE of the user
539
+        if ($user_state != '') {
540
+//Get the CGST,SGST,IGST,STATE_CODE of the user
537 541
             $tax = $this->getTaxWhenState($user_state, $productid, $origin_state);
538 542
             $taxes = $tax['taxes'];
539 543
             $value = $tax['value'];
540
-        } else {//If user from other Country
544
+        } else {
545
+//If user from other Country
541 546
             $tax = $this->getTaxWhenOtherCountry($geoip_state, $geoip_country, $productid);
542 547
             $taxes = $tax['taxes'];
543 548
             $value = $tax['value'];
Please login to merge, or discard this patch.
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -122,10 +122,10 @@  discard block
 block discarded – undo
122 122
         $query = $this->advanceSearch($name, $invoice_no, $status, $currency, $from, $till);
123 123
 
124 124
         return \DataTables::of($query->get())
125
-         ->addColumn('checkbox', function ($model) {
126
-             return "<input type='checkbox' class='invoice_checkbox' 
125
+            ->addColumn('checkbox', function ($model) {
126
+                return "<input type='checkbox' class='invoice_checkbox' 
127 127
                             value=".$model->id.' name=select[] id=check>';
128
-         })
128
+            })
129 129
                         ->addColumn('user_id', function ($model) {
130 130
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
131 131
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
@@ -133,21 +133,21 @@  discard block
 block discarded – undo
133 133
 
134 134
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
135 135
                         })
136
-                         ->addColumn('number', function ($model) {
137
-                             return ucfirst($model->number);
138
-                         })
136
+                            ->addColumn('number', function ($model) {
137
+                                return ucfirst($model->number);
138
+                            })
139 139
 
140 140
                         ->addColumn('date', function ($model) {
141 141
                             $date = date_create($model->created_at);
142 142
 
143 143
                             return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
144 144
                         })
145
-                         ->addColumn('grand_total', function ($model) {
146
-                             return ucfirst($model->number);
147
-                         })
148
-                          ->addColumn('status', function ($model) {
149
-                              return ucfirst($model->status);
150
-                          })
145
+                            ->addColumn('grand_total', function ($model) {
146
+                                return ucfirst($model->number);
147
+                            })
148
+                            ->addColumn('status', function ($model) {
149
+                                return ucfirst($model->status);
150
+                            })
151 151
 
152 152
                         ->addColumn('action', function ($model) {
153 153
                             $action = '';
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                                     ."   $action";
167 167
                         })
168 168
 
169
-                         ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
169
+                            ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
170 170
                         ->make(true);
171 171
     }
172 172
 
@@ -356,8 +356,8 @@  discard block
 block discarded – undo
356 356
             $symbol = $attributes[0]['currency'][0]['code'];
357 357
             //dd($symbol);
358 358
             $invoice = $this->invoice->create(['user_id' => $user_id, 'number' => $number,
359
-             'date'                                      => $date, 'grand_total' => $grand_total, 'status' => 'pending',
360
-             'currency'                                  => $symbol, ]);
359
+                'date'                                      => $date, 'grand_total' => $grand_total, 'status' => 'pending',
360
+                'currency'                                  => $symbol, ]);
361 361
 
362 362
             foreach (\Cart::getContent() as $cart) {
363 363
                 $this->createInvoiceItems($invoice->id, $cart);
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
                 'currency'                        => $currency, 'status' => 'pending', 'description' => $description, ]);
462 462
 
463 463
             $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid,
464
-             $code, $total, $currency, $qty, $plan, $user_id, $tax_name, $tax_rate);
464
+                $code, $total, $currency, $qty, $plan, $user_id, $tax_name, $tax_rate);
465 465
             $result = $this->getMessage($items, $user_id);
466 466
         } catch (\Exception $ex) {
467 467
             app('log')->useDailyFiles(storage_path().'/laravel.log');
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
                 } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
611 611
 
612 612
                     $taxClassId = Tax::where('country', '')->where('state', 'Any State')
613
-                     ->pluck('tax_classes_id')->first(); //In case of India when
613
+                        ->pluck('tax_classes_id')->first(); //In case of India when
614 614
                     //other tax is available and tax is not enabled
615 615
                     if ($taxClassId) {
616 616
                         $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
@@ -679,10 +679,10 @@  discard block
 block discarded – undo
679 679
         foreach ($taxes as $key => $tax) {
680 680
             if ($taxes[0]) {
681 681
                 $tax_attribute[$key] = ['name' => $tax->name, 'name1' => $name1,
682
-                 'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
683
-                 'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
684
-                 'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
685
-                  'origin_state'               => $origin_state, ];
682
+                    'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
683
+                    'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
684
+                    'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
685
+                    'origin_state'               => $origin_state, ];
686 686
 
687 687
                 $rate = $tax->rate;
688 688
 
@@ -892,8 +892,8 @@  discard block
 block discarded – undo
892 892
                 }
893 893
 
894 894
                 return view('themes.default1.invoice.payment',
895
-                 compact('invoice_status', 'payment_status',
896
-                  'payment_method', 'invoice_id', 'domain', 'invoice', 'userid'));
895
+                    compact('invoice_status', 'payment_status',
896
+                    'payment_method', 'invoice_id', 'domain', 'invoice', 'userid'));
897 897
             }
898 898
 
899 899
             return redirect()->back();
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
                 case 1:
932 932
                     $percentage = $price * ($value / 100);
933 933
 
934
-                     return $price - $percentage;
934
+                        return $price - $percentage;
935 935
                 case 2:
936 936
                     return $price - $value;
937 937
                 case 3:
@@ -963,7 +963,7 @@  discard block
 block discarded – undo
963 963
             $payment_date = \Carbon\Carbon::now()->toDateTimeString();
964 964
             $amount = $grand_total;
965 965
             $paymentRenewal = $this->updateInvoicePayment($invoiceid, $payment_method,
966
-             $payment_status, $payment_date, $amount);
966
+                $payment_status, $payment_date, $amount);
967 967
 
968 968
             return redirect()->back()->with('success', 'Payment Accepted Successfully');
969 969
         } catch (\Exception $ex) {
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             $from = $request->input('from');
103 103
             $till = $request->input('till');
104 104
 
105
-            return view('themes.default1.invoice.index', compact('name','invoice_no','status','currency','from',
105
+            return view('themes.default1.invoice.index', compact('name', 'invoice_no', 'status', 'currency', 'from',
106 106
                 'till'));
107 107
         } catch (\Exception $ex) {
108 108
             Bugsnag::notifyException($ex);
@@ -122,34 +122,34 @@  discard block
 block discarded – undo
122 122
         $query = $this->advanceSearch($name, $invoice_no, $status, $currency, $from, $till);
123 123
 
124 124
         return \DataTables::of($query->get())
125
-         ->addColumn('checkbox', function ($model) {
125
+         ->addColumn('checkbox', function($model) {
126 126
              return "<input type='checkbox' class='invoice_checkbox' 
127 127
                             value=".$model->id.' name=select[] id=check>';
128 128
          })
129
-                        ->addColumn('user_id', function ($model) {
129
+                        ->addColumn('user_id', function($model) {
130 130
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
131 131
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
132 132
                             $id = $this->user->where('id', $model->user_id)->first()->id;
133 133
 
134 134
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
135 135
                         })
136
-                         ->addColumn('number', function ($model) {
136
+                         ->addColumn('number', function($model) {
137 137
                              return ucfirst($model->number);
138 138
                          })
139 139
 
140
-                        ->addColumn('date', function ($model) {
140
+                        ->addColumn('date', function($model) {
141 141
                             $date = date_create($model->created_at);
142 142
 
143 143
                             return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
144 144
                         })
145
-                         ->addColumn('grand_total', function ($model) {
145
+                         ->addColumn('grand_total', function($model) {
146 146
                              return ucfirst($model->number);
147 147
                          })
148
-                          ->addColumn('status', function ($model) {
148
+                          ->addColumn('status', function($model) {
149 149
                               return ucfirst($model->status);
150 150
                           })
151 151
 
152
-                        ->addColumn('action', function ($model) {
152
+                        ->addColumn('action', function($model) {
153 153
                             $action = '';
154 154
 
155 155
                             $check = $this->checkExecution($model->id);
Please login to merge, or discard this patch.
app/Http/Controllers/Front/ClientController.php 1 patch
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) {
@@ -132,19 +132,19 @@  discard block
 block discarded – undo
132 132
              'title', 'description', 'file', 'created_at')->get();
133 133
 
134 134
             return \DataTables::of($versions)
135
-                            ->addColumn('id', function ($versions) {
135
+                            ->addColumn('id', function($versions) {
136 136
                                 return ucfirst($versions->id);
137 137
                             })
138
-                            ->addColumn('version', function ($versions) {
138
+                            ->addColumn('version', function($versions) {
139 139
                                 return ucfirst($versions->version);
140 140
                             })
141
-                            ->addColumn('title', function ($versions) {
141
+                            ->addColumn('title', function($versions) {
142 142
                                 return ucfirst($versions->title);
143 143
                             })
144
-                            ->addColumn('description', function ($versions) {
144
+                            ->addColumn('description', function($versions) {
145 145
                                 return ucfirst($versions->description);
146 146
                             })
147
-                            ->addColumn('file', function ($versions) use ($clientid, $invoiceid, $productid) {
147
+                            ->addColumn('file', function($versions) use ($clientid, $invoiceid, $productid) {
148 148
                                 $invoice_id = Invoice::where('number', $invoiceid)->pluck('id')->first();
149 149
                                 $order = Order::where('invoice_id', '=', $invoice_id)->first();
150 150
                                 $order_id = $order->id;
@@ -196,18 +196,18 @@  discard block
 block discarded – undo
196 196
             $link = (array_slice($link, 0, 10, true));
197 197
 
198 198
             return \DataTables::of($link)
199
-                            ->addColumn('version', function ($link) {
199
+                            ->addColumn('version', function($link) {
200 200
                                 return ucfirst($link['tag_name']);
201 201
                             })
202
-                            ->addColumn('name', function ($link) {
202
+                            ->addColumn('name', function($link) {
203 203
                                 return ucfirst($link['name']);
204 204
                             })
205
-                            ->addColumn('description', function ($link) {
205
+                            ->addColumn('description', function($link) {
206 206
                                 $markdown = Markdown::convertToHtml(ucfirst($link['body']));
207 207
 
208 208
                                 return $markdown;
209 209
                             })
210
-                            ->addColumn('file', function ($link) use ($invoiceid, $productid) {
210
+                            ->addColumn('file', function($link) use ($invoiceid, $productid) {
211 211
                                 $order = Order::where('invoice_id', '=', $invoiceid)->first();
212 212
                                 $order_id = $order->id;
213 213
                                 $orderEndDate = Subscription::select('ends_at')
@@ -255,20 +255,20 @@  discard block
 block discarded – undo
255 255
             $orders = Order::where('client', \Auth::user()->id);
256 256
 
257 257
             return \DataTables::of($orders->get())
258
-                            ->addColumn('id', function ($model) {
258
+                            ->addColumn('id', function($model) {
259 259
                                 return $model->id;
260 260
                             })
261
-                            ->addColumn('product_name', function ($model) {
261
+                            ->addColumn('product_name', function($model) {
262 262
                                 return $model->product()->first()->name;
263 263
                             })
264
-                            ->addColumn('expiry', function ($model) {
264
+                            ->addColumn('expiry', function($model) {
265 265
                                 $tz = \Auth::user()->timezone()->first()->name;
266 266
                                 $end = $this->getExpiryDate($model);
267 267
 
268 268
                                 return $end;
269 269
                             })
270 270
 
271
-                            ->addColumn('Action', function ($model) {
271
+                            ->addColumn('Action', function($model) {
272 272
                                 $sub = $model->subscription()->first();
273 273
                                 $order = Order::where('id', $model->id)->select('product')->first();
274 274
                                 $productid = $order->product;
@@ -383,17 +383,17 @@  discard block
 block discarded – undo
383 383
                     ->select('id', 'invoice_id', 'user_id', 'amount', 'payment_method', 'payment_status', 'created_at');
384 384
 
385 385
             return \DataTables::of($payments->get())
386
-                            ->addColumn('checkbox', function ($model) {
386
+                            ->addColumn('checkbox', function($model) {
387 387
                                 if (\Input::get('client') != 'true') {
388 388
                                     return "<input type='checkbox' class='payment_checkbox' 
389 389
                                     value=".$model->id.' name=select[] id=check>';
390 390
                                 }
391 391
                             })
392
-                            ->addColumn('number', function ($model) {
392
+                            ->addColumn('number', function($model) {
393 393
                                 return $model->invoice()->first()->number;
394 394
                             })
395 395
                             ->addColumn('amount', 'payment_method', 'payment_status', 'created_at')
396
-                            ->addColumn('total', function ($model) {
396
+                            ->addColumn('total', function($model) {
397 397
                                 return $model->grand_total;
398 398
                             })
399 399
                             ->rawColumns(['checkbox', 'number', 'total',
@@ -420,13 +420,13 @@  discard block
 block discarded – undo
420 420
                     ->select('id', 'invoice_id', 'user_id', 'payment_method', 'payment_status', 'created_at', 'amount');
421 421
             //dd(\Input::all());
422 422
             return \DataTables::of($payments->get())
423
-                            ->addColumn('number', function ($model) {
423
+                            ->addColumn('number', function($model) {
424 424
                                 return $model->invoice()->first()->number;
425 425
                             })
426
-                              ->addColumn('total', function ($model) {
426
+                              ->addColumn('total', function($model) {
427 427
                                   return $model->amount;
428 428
                               })
429
-                               ->addColumn('created_at', function ($model) {
429
+                               ->addColumn('created_at', function($model) {
430 430
                                    $date1 = new DateTime($model->created_at);
431 431
                                    $tz = \Auth::user()->timezone()->first()->name;
432 432
                                    $date1->setTimezone(new DateTimeZone($tz));
Please login to merge, or discard this patch.
app/Http/Controllers/DashboardController.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
         return view('themes.default1.common.dashboard', compact('totalSalesINR', 'totalSalesUSD',
55 55
                 'yearlySalesINR', 'yearlySalesUSD', 'monthlySalesINR', 'monthlySalesUSD', 'users',
56 56
 
57
-                 'count_users', 'arraylists', 'productSoldlists','orders','subscriptions','invoices',
58
-                 'products', 'arrayCountList'));
57
+                    'count_users', 'arraylists', 'productSoldlists','orders','subscriptions','invoices',
58
+                    'products', 'arrayCountList'));
59 59
     }
60 60
 
61 61
     /**
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
     public function getAllUsers()
158 158
     {
159 159
         $allUsers = User::orderBy('created_at', 'desc')->where('active', 1)->where('mobile_verified', 1)
160
-              ->take(20)
161
-              ->get()
162
-              ->toArray();
160
+                ->take(20)
161
+                ->get()
162
+                ->toArray();
163 163
 
164 164
         return $allUsers;
165 165
     }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         $dayUtc = new Carbon('-30 days');
195 195
         $minus30Day = $dayUtc->toDateTimeString();
196 196
         $recentOrders = Order::where('created_at', '>', $minus30Day)->orderBy('created_at', 'desc')
197
-                 ->where('price_override', '>', 0)->get();
197
+                    ->where('price_override', '>', 0)->get();
198 198
 
199 199
         return $recentOrders;
200 200
     }
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   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 $user->profile_pic = $fileName;
115 115
             }
116 116
             $user->fill($request->input())->save();
117
-            $response = ['type' => 'success',  'message' =>'Updated Successfully..'];
117
+            $response = ['type' => 'success', 'message' =>'Updated Successfully..'];
118 118
 
119 119
             return $response;
120 120
         } catch (Exception $ex) {
@@ -168,27 +168,27 @@  discard block
 block discarded – undo
168 168
             }
169 169
 
170 170
             return \DataTables::of($invoices->get())
171
-             ->addColumn('number', function ($model) {
171
+             ->addColumn('number', function($model) {
172 172
                  return $model->number;
173 173
              })
174
-            ->addColumn('products', function ($model) {
174
+            ->addColumn('products', function($model) {
175 175
                 $invoice = $this->invoice->find($model->id);
176 176
                 $products = $invoice->invoiceItem()->pluck('product_name')->toArray();
177 177
 
178 178
                 return ucfirst(implode(',', $products));
179 179
             })
180
-            ->addColumn('date', function ($model) {
180
+            ->addColumn('date', function($model) {
181 181
                 $date = date_create($model->created_at);
182 182
 
183 183
                 return date_format($date, 'M j, Y, g:i a');
184 184
             })
185
-            ->addColumn('total', function ($model) {
185
+            ->addColumn('total', function($model) {
186 186
                 return $model->grand_total;
187 187
             })
188
-            ->addColumn('status', function ($model) {
188
+            ->addColumn('status', function($model) {
189 189
                 return ucfirst($model->status);
190 190
             })
191
-            ->addColumn('action', function ($model) {
191
+            ->addColumn('action', function($model) {
192 192
                 if (\Auth::user()->role == 'admin') {
193 193
                     $url = '/invoices/show?invoiceid='.$model->id;
194 194
                 } else {
Please login to merge, or discard this patch.