Completed
Pull Request — development (#456)
by Ashutosh
20:09 queued 09:41
created
app/Http/Controllers/Order/InvoiceController.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -110,34 +110,34 @@
 block discarded – undo
110 110
         // $new_invoice = $invoice->select('id', 'user_id', 'number', 'date', 'grand_total', 'status', 'created_at');
111 111
 
112 112
         return \DataTables::of($invoice->get())
113
-                        ->addColumn('checkbox', function ($model) {
113
+                        ->addColumn('checkbox', function($model) {
114 114
                             return "<input type='checkbox' class='invoice_checkbox' 
115 115
                             value=".$model->id.' name=select[] id=check>';
116 116
                         })
117
-                        ->addColumn('user_id', function ($model) {
117
+                        ->addColumn('user_id', function($model) {
118 118
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
119 119
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
120 120
                             $id = $this->user->where('id', $model->user_id)->first()->id;
121 121
 
122 122
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
123 123
                         })
124
-                         ->addColumn('number', function ($model) {
124
+                         ->addColumn('number', function($model) {
125 125
                              return ucfirst($model->number);
126 126
                          })
127 127
 
128
-                        ->addColumn('date', function ($model) {
128
+                        ->addColumn('date', function($model) {
129 129
                             $date = date_create($model->created_at);
130 130
 
131 131
                             return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
132 132
                         })
133
-                         ->addColumn('grand_total', function ($model) {
133
+                         ->addColumn('grand_total', function($model) {
134 134
                              return ucfirst($model->number);
135 135
                          })
136
-                          ->addColumn('status', function ($model) {
136
+                          ->addColumn('status', function($model) {
137 137
                               return ucfirst($model->status);
138 138
                           })
139 139
 
140
-                        ->addColumn('action', function ($model) {
140
+                        ->addColumn('action', function($model) {
141 141
                             $action = '';
142 142
 
143 143
                             $check = $this->checkExecution($model->id);
Please login to merge, or discard this patch.
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -121,21 +121,21 @@  discard block
 block discarded – undo
121 121
 
122 122
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
123 123
                         })
124
-                         ->addColumn('number', function ($model) {
125
-                             return ucfirst($model->number);
126
-                         })
124
+                            ->addColumn('number', function ($model) {
125
+                                return ucfirst($model->number);
126
+                            })
127 127
 
128 128
                         ->addColumn('date', function ($model) {
129 129
                             $date = date_create($model->created_at);
130 130
 
131 131
                             return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
132 132
                         })
133
-                         ->addColumn('grand_total', function ($model) {
134
-                             return ucfirst($model->number);
135
-                         })
136
-                          ->addColumn('status', function ($model) {
137
-                              return ucfirst($model->status);
138
-                          })
133
+                            ->addColumn('grand_total', function ($model) {
134
+                                return ucfirst($model->number);
135
+                            })
136
+                            ->addColumn('status', function ($model) {
137
+                                return ucfirst($model->status);
138
+                            })
139 139
 
140 140
                         ->addColumn('action', function ($model) {
141 141
                             $action = '';
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                                     ."   $action";
155 155
                         })
156 156
 
157
-                         ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
157
+                            ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
158 158
                         ->make(true);
159 159
     }
160 160
 
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
             $symbol = $attributes[0]['currency'][0]['code'];
284 284
             //dd($symbol);
285 285
             $invoice = $this->invoice->create(['user_id' => $user_id, 'number' => $number,
286
-             'date'                                      => $date, 'grand_total' => $grand_total, 'status' => 'pending',
287
-             'currency'                                  => $symbol, ]);
286
+                'date'                                      => $date, 'grand_total' => $grand_total, 'status' => 'pending',
287
+                'currency'                                  => $symbol, ]);
288 288
 
289 289
             foreach (\Cart::getContent() as $cart) {
290 290
                 $this->createInvoiceItems($invoice->id, $cart);
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                 'currency'                        => $currency, 'status' => 'pending', 'description' => $description, ]);
389 389
 
390 390
             $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid,
391
-             $code, $total, $currency, $qty, $plan, $user_id, $tax_name, $tax_rate);
391
+                $code, $total, $currency, $qty, $plan, $user_id, $tax_name, $tax_rate);
392 392
             $result = $this->getMessage($items, $user_id);
393 393
         } catch (\Exception $ex) {
394 394
             app('log')->useDailyFiles(storage_path().'/laravel.log');
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
                 } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
538 538
 
539 539
                     $taxClassId = Tax::where('country', '')->where('state', 'Any State')
540
-                     ->pluck('tax_classes_id')->first(); //In case of India when
540
+                        ->pluck('tax_classes_id')->first(); //In case of India when
541 541
                     //other tax is available and tax is not enabled
542 542
                     if ($taxClassId) {
543 543
                         $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
@@ -606,10 +606,10 @@  discard block
 block discarded – undo
606 606
         foreach ($taxes as $key => $tax) {
607 607
             if ($taxes[0]) {
608 608
                 $tax_attribute[$key] = ['name' => $tax->name, 'name1' => $name1,
609
-                 'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
610
-                 'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
611
-                 'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
612
-                  'origin_state'               => $origin_state, ];
609
+                    'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
610
+                    'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
611
+                    'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
612
+                    'origin_state'               => $origin_state, ];
613 613
 
614 614
                 $rate = $tax->rate;
615 615
 
@@ -819,8 +819,8 @@  discard block
 block discarded – undo
819 819
                 }
820 820
 
821 821
                 return view('themes.default1.invoice.payment',
822
-                 compact('invoice_status', 'payment_status',
823
-                  'payment_method', 'invoice_id', 'domain', 'invoice', 'userid'));
822
+                    compact('invoice_status', 'payment_status',
823
+                    'payment_method', 'invoice_id', 'domain', 'invoice', 'userid'));
824 824
             }
825 825
 
826 826
             return redirect()->back();
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
                 case 1:
859 859
                     $percentage = $price * ($value / 100);
860 860
 
861
-                     return $price - $percentage;
861
+                        return $price - $percentage;
862 862
                 case 2:
863 863
                     return $price - $value;
864 864
                 case 3:
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
             $payment_date = \Carbon\Carbon::now()->toDateTimeString();
891 891
             $amount = $grand_total;
892 892
             $paymentRenewal = $this->updateInvoicePayment($invoiceid, $payment_method,
893
-             $payment_status, $payment_date, $amount);
893
+                $payment_status, $payment_date, $amount);
894 894
 
895 895
             return redirect()->back()->with('success', 'Payment Accepted Successfully');
896 896
         } catch (\Exception $ex) {
Please login to merge, or discard this patch.
app/Http/Controllers/Product/ProductController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -107,42 +107,42 @@
 block discarded – undo
107 107
 
108 108
                 return\ DataTables::of($new_product)
109 109
 
110
-                            ->addColumn('checkbox', function ($model) {
110
+                            ->addColumn('checkbox', function($model) {
111 111
                                 return "<input type='checkbox' class='product_checkbox' 
112 112
                                 value=".$model->id.' name=select[] id=check>';
113 113
                             })
114
-                            ->addColumn('name', function ($model) {
114
+                            ->addColumn('name', function($model) {
115 115
                                 return ucfirst($model->name);
116 116
                             })
117
-                            ->addColumn('type', function ($model) {
117
+                            ->addColumn('type', function($model) {
118 118
                                 if ($this->type->where('id', $model->type)->first()) {
119 119
                                     return $this->type->where('id', $model->type)->first()->name;
120 120
                                 } else {
121 121
                                     return 'Not available';
122 122
                                 }
123 123
                             })
124
-                            ->addColumn('group', function ($model) {
124
+                            ->addColumn('group', function($model) {
125 125
                                 if ($this->group->where('id', $model->group)->first()) {
126 126
                                     return $this->group->where('id', $model->group)->first()->name;
127 127
                                 } else {
128 128
                                     return 'Not available';
129 129
                                 }
130 130
                             })
131
-                            ->addColumn('price', function ($model) {
131
+                            ->addColumn('price', function($model) {
132 132
                                 if ($this->price->where('product_id', $model->id)->first()) {
133 133
                                     return $this->price->where('product_id', $model->id)->first()->price;
134 134
                                 } else {
135 135
                                     return 'Not available';
136 136
                                 }
137 137
                             })
138
-                            ->addColumn('currency', function ($model) {
138
+                            ->addColumn('currency', function($model) {
139 139
                                 if ($this->price->where('product_id', $model->id)->first()) {
140 140
                                     return $this->price->where('product_id', $model->id)->first()->currency;
141 141
                                 } else {
142 142
                                     return 'Not available';
143 143
                                 }
144 144
                             })
145
-                            ->addColumn('Action', function ($model) {
145
+                            ->addColumn('Action', function($model) {
146 146
                                 $url = '';
147 147
                                 if ($model->type == 2) {
148 148
                                     $url = '<a href='.url('product/download/'.$model->id).
Please login to merge, or discard this patch.