Completed
Pull Request — development (#483)
by Ashutosh
17:57 queued 09:13
created
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   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -125,12 +125,12 @@  discard block
 block discarded – undo
125 125
         $query = $this->advanceSearch($name, $invoice_no, $currency, $status, $from, $till);
126 126
 
127 127
         return \DataTables::of($query->take(100))
128
-         ->setTotalRecords($query->count())
128
+            ->setTotalRecords($query->count())
129 129
 
130
-         ->addColumn('checkbox', function ($model) {
131
-             return "<input type='checkbox' class='invoice_checkbox' 
130
+            ->addColumn('checkbox', function ($model) {
131
+                return "<input type='checkbox' class='invoice_checkbox' 
132 132
                             value=".$model->id.' name=select[] id=check>';
133
-         })
133
+            })
134 134
                         ->addColumn('user_id', function ($model) {
135 135
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
136 136
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
 
139 139
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
140 140
                         })
141
-                         ->addColumn('number', function ($model) {
142
-                             return ucfirst($model->number);
143
-                         })
141
+                            ->addColumn('number', function ($model) {
142
+                                return ucfirst($model->number);
143
+                            })
144 144
 
145 145
                         ->addColumn('date', function ($model) {
146 146
                             $date = ($model->created_at);
@@ -148,12 +148,12 @@  discard block
 block discarded – undo
148 148
                             return $date;
149 149
                             // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
150 150
                         })
151
-                         ->addColumn('grand_total', function ($model) {
152
-                             return ucfirst($model->number);
153
-                         })
154
-                          ->addColumn('status', function ($model) {
155
-                              return ucfirst($model->status);
156
-                          })
151
+                            ->addColumn('grand_total', function ($model) {
152
+                                return ucfirst($model->number);
153
+                            })
154
+                            ->addColumn('status', function ($model) {
155
+                                return ucfirst($model->status);
156
+                            })
157 157
 
158 158
                         ->addColumn('action', function ($model) {
159 159
                             $action = '';
@@ -171,30 +171,30 @@  discard block
 block discarded – undo
171 171
                             style='color:white;'> </i>&nbsp;&nbsp;View</a>"
172 172
                                     ."   $action";
173 173
                         })
174
-                         ->filterColumn('user_id', function ($query, $keyword) {
175
-                             $sql = 'first_name like ?';
176
-                             $query->whereRaw($sql, ["%{$keyword}%"]);
177
-                         })
174
+                            ->filterColumn('user_id', function ($query, $keyword) {
175
+                                $sql = 'first_name like ?';
176
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
177
+                            })
178 178
 
179
-                          ->filterColumn('status', function ($query, $keyword) {
180
-                              $sql = 'status like ?';
181
-                              $query->whereRaw($sql, ["%{$keyword}%"]);
182
-                          })
179
+                            ->filterColumn('status', function ($query, $keyword) {
180
+                                $sql = 'status like ?';
181
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
182
+                            })
183 183
 
184 184
                         ->filterColumn('number', function ($query, $keyword) {
185 185
                             $sql = 'number like ?';
186 186
                             $query->whereRaw($sql, ["%{$keyword}%"]);
187 187
                         })
188
-                         ->filterColumn('grand_total', function ($query, $keyword) {
189
-                             $sql = 'grand_total like ?';
190
-                             $query->whereRaw($sql, ["%{$keyword}%"]);
191
-                         })
192
-                          ->filterColumn('date', function ($query, $keyword) {
193
-                              $sql = 'date like ?';
194
-                              $query->whereRaw($sql, ["%{$keyword}%"]);
195
-                          })
196
-
197
-                         ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
188
+                            ->filterColumn('grand_total', function ($query, $keyword) {
189
+                                $sql = 'grand_total like ?';
190
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
191
+                            })
192
+                            ->filterColumn('date', function ($query, $keyword) {
193
+                                $sql = 'date like ?';
194
+                                $query->whereRaw($sql, ["%{$keyword}%"]);
195
+                            })
196
+
197
+                            ->rawColumns(['checkbox', 'user_id', 'number', 'date', 'grand_total', 'status', 'action'])
198 198
                         ->make(true);
199 199
     }
200 200
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         $join = $join->select('id', 'user_id', 'number', 'date', 'grand_total', 'currency', 'status', 'created_at');
235 235
 
236 236
         $join = $join->orderBy('created_at', 'desc')
237
-         ->select('invoices.id','first_name','invoices.created_at',
237
+            ->select('invoices.id','first_name','invoices.created_at',
238 238
             'invoices.currency', 'user_id', 'number', 'status');
239 239
 
240 240
         return $join;
@@ -384,8 +384,8 @@  discard block
 block discarded – undo
384 384
             $symbol = $attributes[0]['currency'][0]['code'];
385 385
             //dd($symbol);
386 386
             $invoice = $this->invoice->create(['user_id' => $user_id, 'number' => $number,
387
-             'date'                                      => $date, 'grand_total' => $grand_total, 'status' => 'pending',
388
-             'currency'                                  => $symbol, ]);
387
+                'date'                                      => $date, 'grand_total' => $grand_total, 'status' => 'pending',
388
+                'currency'                                  => $symbol, ]);
389 389
 
390 390
             foreach (\Cart::getContent() as $cart) {
391 391
                 $this->createInvoiceItems($invoice->id, $cart);
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
                 'currency'                        => $currency, 'status' => 'pending', 'description' => $description, ]);
490 490
 
491 491
             $items = $this->createInvoiceItemsByAdmin($invoice->id, $productid,
492
-             $code, $total, $currency, $qty, $plan, $user_id, $tax_name, $tax_rate);
492
+                $code, $total, $currency, $qty, $plan, $user_id, $tax_name, $tax_rate);
493 493
             $result = $this->getMessage($items, $user_id);
494 494
         } catch (\Exception $ex) {
495 495
             app('log')->useDailyFiles(storage_path().'/laravel.log');
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
                 } elseif ($this->tax_option->tax_enable == 0) {//if tax_enable is 0
639 639
 
640 640
                     $taxClassId = Tax::where('country', '')->where('state', 'Any State')
641
-                     ->pluck('tax_classes_id')->first(); //In case of India when
641
+                        ->pluck('tax_classes_id')->first(); //In case of India when
642 642
                     //other tax is available and tax is not enabled
643 643
                     if ($taxClassId) {
644 644
                         $rate = $this->getTotalRate($taxClassId, $productid, $taxs);
@@ -707,10 +707,10 @@  discard block
 block discarded – undo
707 707
         foreach ($taxes as $key => $tax) {
708 708
             if ($taxes[0]) {
709 709
                 $tax_attribute[$key] = ['name' => $tax->name, 'name1' => $name1,
710
-                 'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
711
-                 'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
712
-                 'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
713
-                  'origin_state'               => $origin_state, ];
710
+                    'name2'                       => $name2, 'name3' => $name3, 'name4' => $name4,
711
+                    'rate'                        => $value, 'rate1'=>$c_gst, 'rate2'=>$s_gst,
712
+                    'rate3'                       => $i_gst, 'rate4'=>$ut_gst, 'state'=>$state_code,
713
+                    'origin_state'               => $origin_state, ];
714 714
 
715 715
                 $rate = $tax->rate;
716 716
 
@@ -920,8 +920,8 @@  discard block
 block discarded – undo
920 920
                 }
921 921
 
922 922
                 return view('themes.default1.invoice.payment',
923
-                 compact('invoice_status', 'payment_status',
924
-                  'payment_method', 'invoice_id', 'domain', 'invoice', 'userid'));
923
+                    compact('invoice_status', 'payment_status',
924
+                    'payment_method', 'invoice_id', 'domain', 'invoice', 'userid'));
925 925
             }
926 926
 
927 927
             return redirect()->back();
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
                 case 1:
960 960
                     $percentage = $price * ($value / 100);
961 961
 
962
-                     return $price - $percentage;
962
+                        return $price - $percentage;
963 963
                 case 2:
964 964
                     return $price - $value;
965 965
                 case 3:
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
             $payment_date = \Carbon\Carbon::now()->toDateTimeString();
992 992
             $amount = $grand_total;
993 993
             $paymentRenewal = $this->updateInvoicePayment($invoiceid, $payment_method,
994
-             $payment_status, $payment_date, $amount);
994
+                $payment_status, $payment_date, $amount);
995 995
 
996 996
             return redirect()->back()->with('success', 'Payment Accepted Successfully');
997 997
         } catch (\Exception $ex) {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             $from = $request->input('from');
105 105
             $till = $request->input('till');
106 106
 
107
-            return view('themes.default1.invoice.index', compact('name','invoice_no','status','currencies','currency_id','from',
107
+            return view('themes.default1.invoice.index', compact('name', 'invoice_no', 'status', 'currencies', 'currency_id', 'from',
108 108
 
109 109
                 'till'));
110 110
         } catch (\Exception $ex) {
@@ -127,35 +127,35 @@  discard block
 block discarded – undo
127 127
         return \DataTables::of($query->take(100))
128 128
          ->setTotalRecords($query->count())
129 129
 
130
-         ->addColumn('checkbox', function ($model) {
130
+         ->addColumn('checkbox', function($model) {
131 131
              return "<input type='checkbox' class='invoice_checkbox' 
132 132
                             value=".$model->id.' name=select[] id=check>';
133 133
          })
134
-                        ->addColumn('user_id', function ($model) {
134
+                        ->addColumn('user_id', function($model) {
135 135
                             $first = $this->user->where('id', $model->user_id)->first()->first_name;
136 136
                             $last = $this->user->where('id', $model->user_id)->first()->last_name;
137 137
                             $id = $this->user->where('id', $model->user_id)->first()->id;
138 138
 
139 139
                             return '<a href='.url('clients/'.$id).'>'.ucfirst($first).' '.ucfirst($last).'</a>';
140 140
                         })
141
-                         ->addColumn('number', function ($model) {
141
+                         ->addColumn('number', function($model) {
142 142
                              return ucfirst($model->number);
143 143
                          })
144 144
 
145
-                        ->addColumn('date', function ($model) {
145
+                        ->addColumn('date', function($model) {
146 146
                             $date = ($model->created_at);
147 147
 
148 148
                             return $date;
149 149
                             // return "<span style='display:none'>$model->id</span>".$date->format('l, F j, Y H:m');
150 150
                         })
151
-                         ->addColumn('grand_total', function ($model) {
151
+                         ->addColumn('grand_total', function($model) {
152 152
                              return ucfirst($model->number);
153 153
                          })
154
-                          ->addColumn('status', function ($model) {
154
+                          ->addColumn('status', function($model) {
155 155
                               return ucfirst($model->status);
156 156
                           })
157 157
 
158
-                        ->addColumn('action', function ($model) {
158
+                        ->addColumn('action', function($model) {
159 159
                             $action = '';
160 160
 
161 161
                             $check = $this->checkExecution($model->id);
@@ -171,25 +171,25 @@  discard block
 block discarded – undo
171 171
                             style='color:white;'> </i>&nbsp;&nbsp;View</a>"
172 172
                                     ."   $action";
173 173
                         })
174
-                         ->filterColumn('user_id', function ($query, $keyword) {
174
+                         ->filterColumn('user_id', function($query, $keyword) {
175 175
                              $sql = 'first_name like ?';
176 176
                              $query->whereRaw($sql, ["%{$keyword}%"]);
177 177
                          })
178 178
 
179
-                          ->filterColumn('status', function ($query, $keyword) {
179
+                          ->filterColumn('status', function($query, $keyword) {
180 180
                               $sql = 'status like ?';
181 181
                               $query->whereRaw($sql, ["%{$keyword}%"]);
182 182
                           })
183 183
 
184
-                        ->filterColumn('number', function ($query, $keyword) {
184
+                        ->filterColumn('number', function($query, $keyword) {
185 185
                             $sql = 'number like ?';
186 186
                             $query->whereRaw($sql, ["%{$keyword}%"]);
187 187
                         })
188
-                         ->filterColumn('grand_total', function ($query, $keyword) {
188
+                         ->filterColumn('grand_total', function($query, $keyword) {
189 189
                              $sql = 'grand_total like ?';
190 190
                              $query->whereRaw($sql, ["%{$keyword}%"]);
191 191
                          })
192
-                          ->filterColumn('date', function ($query, $keyword) {
192
+                          ->filterColumn('date', function($query, $keyword) {
193 193
                               $sql = 'date like ?';
194 194
                               $query->whereRaw($sql, ["%{$keyword}%"]);
195 195
                           })
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         $join = $join->select('id', 'user_id', 'number', 'date', 'grand_total', 'currency', 'status', 'created_at');
235 235
 
236 236
         $join = $join->orderBy('created_at', 'desc')
237
-         ->select('invoices.id','first_name','invoices.created_at',
237
+         ->select('invoices.id', 'first_name', 'invoices.created_at',
238 238
             'invoices.currency', 'user_id', 'number', 'status');
239 239
 
240 240
         return $join;
Please login to merge, or discard this patch.
app/Http/Controllers/User/ClientController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -75,18 +75,18 @@  discard block
 block discarded – undo
75 75
          $mobile, $email, $country, $industry, $company_type, $company_size, $role, $position);
76 76
 
77 77
         return\ DataTables::of($user->get())
78
-                         ->addColumn('checkbox', function ($model) {
78
+                         ->addColumn('checkbox', function($model) {
79 79
                              return "<input type='checkbox' class='user_checkbox' 
80 80
                             value=".$model->id.' name=select[] id=check>';
81 81
                          })
82
-                        ->addColumn('first_name', function ($model) {
82
+                        ->addColumn('first_name', function($model) {
83 83
                             return '<a href='.url('clients/'.$model->id).'>'
84 84
                             .ucfirst($model->first_name).' '.ucfirst($model->last_name).'</a>';
85 85
                         })
86
-                         ->addColumn('email', function ($model) {
86
+                         ->addColumn('email', function($model) {
87 87
                              return $model->email;
88 88
                          })
89
-                          ->addColumn('created_at', function ($model) {
89
+                          ->addColumn('created_at', function($model) {
90 90
                               $ends = $model->created_at;
91 91
                               if ($ends) {
92 92
                                   $date = date_create($ends);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                               return $end;
97 97
                           })
98 98
                         // ->showColumns('email', 'created_at')
99
-                        ->addColumn('active', function ($model) {
99
+                        ->addColumn('active', function($model) {
100 100
                             if ($model->active == 1) {
101 101
                                 $email = "<span class='glyphicon glyphicon-envelope'
102 102
                                  style='color:green' title='verified email'></span>";
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
                             return $email.'&nbsp;&nbsp;'.$mobile;
116 116
                         })
117
-                        ->addColumn('action', function ($model) {
117
+                        ->addColumn('action', function($model) {
118 118
                             return '<a href='.url('clients/'.$model->id.'/edit')
119 119
                             ." class='btn btn-sm btn-primary btn-xs'>
120 120
                             <i class='fa fa-edit' style='color:white;'> </i>&nbsp;&nbsp;Edit</a>"
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                                     <i class='fa fa-eye' style='color:white;'> </i>&nbsp;&nbsp;View</a>";
124 124
                             // return 'hhhh';
125 125
                         })
126
-                        ->rawColumns(['checkbox', 'first_name', 'email',  'created_at', 'active', 'action'])
126
+                        ->rawColumns(['checkbox', 'first_name', 'email', 'created_at', 'active', 'action'])
127 127
                         ->make(true);
128 128
 
129 129
         // ->searchColumns('email', 'first_name')
Please login to merge, or discard this patch.
app/Http/Controllers/Order/ExtendedBaseInvoiceController.php 3 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             $orders = $order->where('client', $clientid)->get();
36 36
 
37 37
             return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices',  'orders',
38
-                  'invoiceSum', 'amountReceived', 'pendingAmount', 'currency'));
38
+                    'invoiceSum', 'amountReceived', 'pendingAmount', 'currency'));
39 39
         } catch (Exception $ex) {
40 40
             return redirect()->back()->with('fails', $ex->getMessage());
41 41
         }
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
     public function postNewPayment($clientid, Request $request)
45 45
     {
46 46
         $this->validate($request, [
47
-           'payment_date'  => 'required',
48
-           'payment_method'=> 'required',
49
-           'amount'        => 'required',
47
+            'payment_date'  => 'required',
48
+            'payment_method'=> 'required',
49
+            'amount'        => 'required',
50 50
         ]);
51 51
 
52 52
         try {
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             $amtToCredit = $request->amtToCredit;
112 112
             $payment_status = 'success';
113 113
             $payment = $this->multiplePayment($clientid,$invoiceChecked, $payment_method,
114
-             $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
114
+                $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
115 115
             $response = ['type' => 'success', 'message' => 'Payment Updated Successfully'];
116 116
 
117 117
             return response()->json($response);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     }
130 130
 
131 131
     public function multiplePayment($clientid,$invoiceChecked, $payment_method,
132
-             $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
132
+                $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
133 133
     {
134 134
         try {
135 135
             foreach ($invoiceChecked as $key => $value) {
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
             $amtToCredit = $request->amtToCredit;
194 194
             $payment_status = 'success';
195 195
             $payment = $this->updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method,
196
-             $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
196
+                $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
197 197
             $response = ['type' => 'success', 'message' => 'Payment Updated Successfully'];
198 198
 
199 199
             return response()->json($response);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     }
208 208
 
209 209
     public function updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method,
210
-             $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
210
+                $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
211 211
     {
212 212
         try {
213 213
             $sum = 0;
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             $currency = $client->currency;
35 35
             $orders = $order->where('client', $clientid)->get();
36 36
 
37
-            return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices',  'orders',
37
+            return view('themes.default1.invoice.newpayment', compact('clientid', 'client', 'invoices', 'orders',
38 38
                   'invoiceSum', 'amountReceived', 'pendingAmount', 'currency'));
39 39
         } catch (Exception $ex) {
40 40
             return redirect()->back()->with('fails', $ex->getMessage());
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             $invoicAmount = $request->invoiceAmount;
111 111
             $amtToCredit = $request->amtToCredit;
112 112
             $payment_status = 'success';
113
-            $payment = $this->multiplePayment($clientid,$invoiceChecked, $payment_method,
113
+            $payment = $this->multiplePayment($clientid, $invoiceChecked, $payment_method,
114 114
              $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
115 115
             $response = ['type' => 'success', 'message' => 'Payment Updated Successfully'];
116 116
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         }
129 129
     }
130 130
 
131
-    public function multiplePayment($clientid,$invoiceChecked, $payment_method,
131
+    public function multiplePayment($clientid, $invoiceChecked, $payment_method,
132 132
              $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
133 133
     {
134 134
         try {
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             $invoicAmount = $request->invoiceAmount;
193 193
             $amtToCredit = $request->amtToCredit;
194 194
             $payment_status = 'success';
195
-            $payment = $this->updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method,
195
+            $payment = $this->updatePaymentByInvoice($clientid, $invoiceChecked, $payment_method,
196 196
              $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status);
197 197
             $response = ['type' => 'success', 'message' => 'Payment Updated Successfully'];
198 198
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
         }
207 207
     }
208 208
 
209
-    public function updatePaymentByInvoice($clientid,$invoiceChecked, $payment_method,
209
+    public function updatePaymentByInvoice($clientid, $invoiceChecked, $payment_method,
210 210
              $payment_date, $totalAmt, $invoicAmount, $amtToCredit, $payment_status)
211 211
     {
212 212
         try {
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -133,7 +133,8 @@  discard block
 block discarded – undo
133 133
     {
134 134
         try {
135 135
             foreach ($invoiceChecked as $key => $value) {
136
-                if ($key != 0) {//If Payment is linked to Invoice
136
+                if ($key != 0) {
137
+//If Payment is linked to Invoice
137 138
                     $invoice = Invoice::find($value);
138 139
                     $invoice_status = 'pending';
139 140
                     $payment = Payment::where('invoice_id', $value)->create([
@@ -157,7 +158,8 @@  discard block
 block discarded – undo
157 158
                         $invoice->status = $invoice_status;
158 159
                         $invoice->save();
159 160
                     }
160
-                } else {//If Payment is not linked to any invoice and is to be credited to User Accunt
161
+                } else {
162
+//If Payment is not linked to any invoice and is to be credited to User Accunt
161 163
                     $payment = Payment::create([
162 164
                 'invoice_id'     => $value,
163 165
                 'user_id'        => $clientid,
@@ -212,7 +214,8 @@  discard block
 block discarded – undo
212 214
         try {
213 215
             $sum = 0;
214 216
             foreach ($invoiceChecked as $key => $value) {
215
-                if ($key != 0) {//If Payment is linked to Invoice
217
+                if ($key != 0) {
218
+//If Payment is linked to Invoice
216 219
                     $invoice = Invoice::find($value);
217 220
                     Payment::where('user_id', $clientid)->where('invoice_id', 0)->update(['amt_to_credit'=>$amtToCredit]);
218 221
                     $invoice_status = 'pending';
Please login to merge, or discard this patch.