Passed
Pull Request — master (#25)
by
unknown
04:11
created
app/Http/Controllers/InvoicesController.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -167,23 +167,23 @@
 block discarded – undo
167 167
         try {
168 168
             $invoice_total = $request->admission_amount + $request->subscription_amount + $request->taxes_amount - $request->discount_amount;
169 169
             $already_paid = PaymentDetail::leftJoin('trn_cheque_details', 'trn_payment_details.id', '=', 'trn_cheque_details.payment_id')
170
-                                       ->whereRaw("trn_payment_details.invoice_id = $id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)")
171
-                                       ->sum('trn_payment_details.payment_amount');
170
+                                        ->whereRaw("trn_payment_details.invoice_id = $id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)")
171
+                                        ->sum('trn_payment_details.payment_amount');
172 172
 
173 173
             $pending = $invoice_total - $already_paid;
174 174
 
175 175
             $status = \Utilities::setInvoiceStatus($pending, $invoice_total);
176 176
 
177 177
             Invoice::where('id', $id)->update(['invoice_number'=> $request->invoice_number,
178
-                                         'total'=> $invoice_total,
179
-                                         'status'=> $status,
180
-                                         'pending_amount'=> $pending,
181
-                                         'discount_amount'=> $request->discount_amount,
182
-                                         'discount_percent'=> $request->discount_percent,
183
-                                         'discount_note'=> $request->discount_note,
184
-                                         'tax'=> $request->taxes_amount,
185
-                                         'additional_fees'=> $request->additional_fees,
186
-                                         'note'=>' ', ]);
178
+                                            'total'=> $invoice_total,
179
+                                            'status'=> $status,
180
+                                            'pending_amount'=> $pending,
181
+                                            'discount_amount'=> $request->discount_amount,
182
+                                            'discount_percent'=> $request->discount_percent,
183
+                                            'discount_note'=> $request->discount_note,
184
+                                            'tax'=> $request->taxes_amount,
185
+                                            'additional_fees'=> $request->additional_fees,
186
+                                            'note'=>' ', ]);
187 187
 
188 188
             DB::commit();
189 189
             flash()->success('Discount was successfully updated');
Please login to merge, or discard this patch.
app/Http/Controllers/DataMigrationController.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -153,18 +153,18 @@  discard block
 block discarded – undo
153 153
                 }
154 154
 
155 155
                 $invoice = Invoice::create(['invoice_number'=> $invoice_number,
156
-                                             'member_id'=> $member->id,
157
-                                             'total'=> $invoice_total,
158
-                                             'status'=> $paymentStatus,
159
-                                             'pending_amount'=> $pending,
160
-                                             'discount_amount'=> $discount,
161
-                                             'discount_percent'=> $discountPercent,
162
-                                             'discount_note'=> null,
163
-                                             'tax'=> ($tax_percent / 100) * $invoice_total,
164
-                                             'additional_fees'=> '0',
165
-                                             'note'=> null,
166
-                                             'created_by'=> Auth::user()->id,
167
-                                             'updated_by'=> Auth::user()->id,
156
+                                                'member_id'=> $member->id,
157
+                                                'total'=> $invoice_total,
158
+                                                'status'=> $paymentStatus,
159
+                                                'pending_amount'=> $pending,
160
+                                                'discount_amount'=> $discount,
161
+                                                'discount_percent'=> $discountPercent,
162
+                                                'discount_note'=> null,
163
+                                                'tax'=> ($tax_percent / 100) * $invoice_total,
164
+                                                'additional_fees'=> '0',
165
+                                                'note'=> null,
166
+                                                'created_by'=> Auth::user()->id,
167
+                                                'updated_by'=> Auth::user()->id,
168 168
                                             ]);
169 169
 
170 170
                 $start_date = Carbon::createFromFormat('d/m/Y', $line->get('start_date'));
@@ -198,19 +198,19 @@  discard block
 block discarded – undo
198 198
                                                     ]);
199 199
 
200 200
                 $invoiceDetail = InvoiceDetail::create(['invoice_id'=> $invoice->id,
201
-                                                       'plan_id'=> (int) $planId,
202
-                                                       'item_amount'=> $line->get('total_amount'),
203
-                                                       'item_amount'=> $line->get('total_amount'),
204
-                                                       'created_by'=> Auth::user()->id,
205
-                                                       'updated_by'=> Auth::user()->id,
201
+                                                        'plan_id'=> (int) $planId,
202
+                                                        'item_amount'=> $line->get('total_amount'),
203
+                                                        'item_amount'=> $line->get('total_amount'),
204
+                                                        'created_by'=> Auth::user()->id,
205
+                                                        'updated_by'=> Auth::user()->id,
206 206
                                                         ]);
207 207
 
208 208
                 $paymentDetail = PaymentDetail::create(['invoice_id'=> $invoice->id,
209
-                                                         'payment_amount'=> $payment_amount,
210
-                                                         'mode'=> '1',
211
-                                                         'note'=> ' ',
212
-                                                         'created_by'=> Auth::user()->id,
213
-                                                         'updated_by'=> Auth::user()->id,
209
+                                                            'payment_amount'=> $payment_amount,
210
+                                                            'mode'=> '1',
211
+                                                            'note'=> ' ',
212
+                                                            'created_by'=> Auth::user()->id,
213
+                                                            'updated_by'=> Auth::user()->id,
214 214
                                                         ]);
215 215
 
216 216
                 Setting::where('key', '=', 'invoice_last_number')->update(['value' => $invoiceCounter]);
Please login to merge, or discard this patch.
app/Http/Controllers/PaymentsController.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
             if ($request->mode == \constPaymentMode::Cheque) {
53 53
                 // Store Cheque Details
54 54
                 $chequeData = ['payment_id'=> $payment_detail->id,
55
-                                  'number'=> $request->number,
56
-                                  'date'=> $request->date,
57
-                                  'status'=> \constChequeStatus::Recieved, ];
55
+                                    'number'=> $request->number,
56
+                                    'date'=> $request->date,
57
+                                    'status'=> \constChequeStatus::Recieved, ];
58 58
 
59 59
                 $cheque_details = new ChequeDetail($chequeData);
60 60
                 $cheque_details->createdBy()->associate(Auth::user());
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                 // Store Cheque Details
135 135
                 $cheque_detail = ChequeDetail::where('payment_id', $id)->first();
136 136
                 $cheque_detail->update(['number' => $request->number,
137
-                                      'date' => $request->date,
137
+                                        'date' => $request->date,
138 138
                                     ]);
139 139
                 $cheque_detail->updatedBy()->associate(Auth::user());
140 140
                 $cheque_detail->save();
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
 
180 180
             $invoice_total = $invoice->total;
181 181
             $payment_total = PaymentDetail::leftJoin('trn_cheque_details', 'trn_payment_details.id', '=', 'trn_cheque_details.payment_id')
182
-                                           ->whereRaw("trn_payment_details.invoice_id = $invoice->id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)")
183
-                                           ->sum('trn_payment_details.payment_amount');
182
+                                            ->whereRaw("trn_payment_details.invoice_id = $invoice->id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)")
183
+                                            ->sum('trn_payment_details.payment_amount');
184 184
 
185 185
             $amount_due = $invoice_total - $payment_total;
186 186
 
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
             $invoice_total = $payment_detail->invoice->total;
225 225
 
226 226
             $payment_total = PaymentDetail::leftJoin('trn_cheque_details', 'trn_payment_details.id', '=', 'trn_cheque_details.payment_id')
227
-                                           ->whereRaw("trn_payment_details.invoice_id = $payment_detail->invoice_id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)")
228
-                                           ->sum('trn_payment_details.payment_amount');
227
+                                            ->whereRaw("trn_payment_details.invoice_id = $payment_detail->invoice_id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)")
228
+                                            ->sum('trn_payment_details.payment_amount');
229 229
 
230 230
             $amount_due = $invoice_total - $payment_total;
231 231
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         $paymentTotal = PaymentDetail::indexQuery($request->sort_field, $request->sort_direction, $request->drp_start, $request->drp_end)->search('"'.$request->input('search').'"')->get();
24 24
         $count = $paymentTotal->sum('payment_amount');
25 25
 
26
-        if (! $request->has('drp_start') or ! $request->has('drp_end')) {
26
+        if (!$request->has('drp_start') or !$request->has('drp_end')) {
27 27
             $drp_placeholder = 'Select daterange filter';
28 28
         } else {
29 29
             $drp_placeholder = $request->drp_start.' - '.$request->drp_end;
Please login to merge, or discard this patch.
app/Http/Controllers/MembersController.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
     {
145 145
         // Member Model Validation
146 146
         $this->validate($request, ['email' => 'unique:mst_members,email',
147
-                                   'contact' => 'unique:mst_members,contact',
148
-                                   'member_code' => 'unique:mst_members,member_code', ]);
147
+                                    'contact' => 'unique:mst_members,contact',
148
+                                    'member_code' => 'unique:mst_members,member_code', ]);
149 149
 
150 150
         // Start Transaction
151 151
         DB::beginTransaction();
@@ -202,16 +202,16 @@  discard block
 block discarded – undo
202 202
 
203 203
             // Storing Invoice
204 204
             $invoiceData = ['invoice_number'=> $request->invoice_number,
205
-                                     'member_id'=> $member->id,
206
-                                     'total'=> $invoice_total,
207
-                                     'status'=> $paymentStatus,
208
-                                     'pending_amount'=> $pending,
209
-                                     'discount_amount'=> $request->discount_amount,
210
-                                     'discount_percent'=> $request->discount_percent,
211
-                                     'discount_note'=> $request->discount_note,
212
-                                     'tax'=> $request->taxes_amount,
213
-                                     'additional_fees'=> $request->additional_fees,
214
-                                     'note'=>' ', ];
205
+                                        'member_id'=> $member->id,
206
+                                        'total'=> $invoice_total,
207
+                                        'status'=> $paymentStatus,
208
+                                        'pending_amount'=> $pending,
209
+                                        'discount_amount'=> $request->discount_amount,
210
+                                        'discount_percent'=> $request->discount_percent,
211
+                                        'discount_note'=> $request->discount_note,
212
+                                        'tax'=> $request->taxes_amount,
213
+                                        'additional_fees'=> $request->additional_fees,
214
+                                        'note'=>' ', ];
215 215
 
216 216
             $invoice = new Invoice($invoiceData);
217 217
             $invoice->createdBy()->associate(Auth::user());
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
 
236 236
                 //Adding subscription to invoice(Invoice Details)
237 237
                 $detailsData = ['invoice_id'=> $invoice->id,
238
-                                       'plan_id'=> $plan['id'],
239
-                                       'item_amount'=> $plan['price'], ];
238
+                                        'plan_id'=> $plan['id'],
239
+                                        'item_amount'=> $plan['price'], ];
240 240
 
241 241
                 $invoice_details = new InvoiceDetail($detailsData);
242 242
                 $invoice_details->createdBy()->associate(Auth::user());
@@ -246,9 +246,9 @@  discard block
 block discarded – undo
246 246
 
247 247
             // Store Payment Details
248 248
             $paymentData = ['invoice_id'=> $invoice->id,
249
-                                     'payment_amount'=> $request->payment_amount,
250
-                                     'mode'=> $request->mode,
251
-                                     'note'=> ' ', ];
249
+                                        'payment_amount'=> $request->payment_amount,
250
+                                        'mode'=> $request->mode,
251
+                                        'note'=> ' ', ];
252 252
 
253 253
             $payment_details = new PaymentDetail($paymentData);
254 254
             $payment_details->createdBy()->associate(Auth::user());
@@ -258,9 +258,9 @@  discard block
 block discarded – undo
258 258
             if ($request->mode == 0) {
259 259
                 // Store Cheque Details
260 260
                 $chequeData = ['payment_id'=> $payment_details->id,
261
-                                      'number'=> $request->number,
262
-                                      'date'=> $request->date,
263
-                                      'status'=> \constChequeStatus::Recieved, ];
261
+                                        'number'=> $request->number,
262
+                                        'date'=> $request->date,
263
+                                        'status'=> \constChequeStatus::Recieved, ];
264 264
 
265 265
                 $cheque_details = new ChequeDetail($chequeData);
266 266
                 $cheque_details->createdBy()->associate(Auth::user());
Please login to merge, or discard this patch.
app/Http/Controllers/SubscriptionsController.php 1 patch
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
     {
79 79
         // For Tax calculation
80 80
         JavaScript::put([
81
-          'taxes' => \Utilities::getSetting('taxes'),
82
-          'gymieToday' => Carbon::today()->format('Y-m-d'),
83
-          'servicesCount' => Service::count(),
84
-      ]);
81
+            'taxes' => \Utilities::getSetting('taxes'),
82
+            'gymieToday' => Carbon::today()->format('Y-m-d'),
83
+            'servicesCount' => Service::count(),
84
+        ]);
85 85
 
86 86
         //Get Numbering mode
87 87
         $invoice_number_mode = \Utilities::getSetting('invoice_number_mode');
@@ -123,16 +123,16 @@  discard block
 block discarded – undo
123 123
 
124 124
             // Storing Invoice
125 125
             $invoiceData = ['invoice_number'=> $request->invoice_number,
126
-                                     'member_id'=> $request->member_id,
127
-                                     'total'=> $invoice_total,
128
-                                     'status'=> $paymentStatus,
129
-                                     'pending_amount'=> $pending,
130
-                                     'discount_amount'=> $request->discount_amount,
131
-                                     'discount_percent'=> $request->discount_percent,
132
-                                     'discount_note'=> $request->discount_note,
133
-                                     'tax'=> $request->taxes_amount,
134
-                                     'additional_fees'=> $request->additional_fees,
135
-                                     'note'=>' ', ];
126
+                                        'member_id'=> $request->member_id,
127
+                                        'total'=> $invoice_total,
128
+                                        'status'=> $paymentStatus,
129
+                                        'pending_amount'=> $pending,
130
+                                        'discount_amount'=> $request->discount_amount,
131
+                                        'discount_percent'=> $request->discount_percent,
132
+                                        'discount_note'=> $request->discount_note,
133
+                                        'tax'=> $request->taxes_amount,
134
+                                        'additional_fees'=> $request->additional_fees,
135
+                                        'note'=>' ', ];
136 136
 
137 137
             $invoice = new Invoice($invoiceData);
138 138
             $invoice->createdBy()->associate(Auth::user());
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
 
157 157
                 //Adding subscription to invoice(Invoice Details)
158 158
                 $detailsData = ['invoice_id'=> $invoice->id,
159
-                                       'plan_id'=> $plan['id'],
160
-                                       'item_amount'=> $plan['price'], ];
159
+                                        'plan_id'=> $plan['id'],
160
+                                        'item_amount'=> $plan['price'], ];
161 161
 
162 162
                 $invoice_details = new InvoiceDetail($detailsData);
163 163
                 $invoice_details->createdBy()->associate(Auth::user());
@@ -167,9 +167,9 @@  discard block
 block discarded – undo
167 167
 
168 168
             //Payment Details
169 169
             $paymentData = ['invoice_id'=> $invoice->id,
170
-                                   'payment_amount'=> $request->payment_amount,
171
-                                   'mode'=> $request->mode,
172
-                                   'note'=> ' ', ];
170
+                                    'payment_amount'=> $request->payment_amount,
171
+                                    'mode'=> $request->mode,
172
+                                    'note'=> ' ', ];
173 173
 
174 174
             $payment_details = new PaymentDetail($paymentData);
175 175
             $payment_details->createdBy()->associate(Auth::user());
@@ -281,10 +281,10 @@  discard block
 block discarded – undo
281 281
         $gymieDiff = $subscription->end_date->addDays($diff);
282 282
 
283 283
         JavaScript::put([
284
-          'gymieToday' => Carbon::today()->format('Y-m-d'),
285
-          'gymieEndDate' => $subscription->end_date->format('Y-m-d'),
286
-          'gymieDiff' => $gymieDiff->format('Y-m-d'),
287
-      ]);
284
+            'gymieToday' => Carbon::today()->format('Y-m-d'),
285
+            'gymieEndDate' => $subscription->end_date->format('Y-m-d'),
286
+            'gymieDiff' => $gymieDiff->format('Y-m-d'),
287
+        ]);
288 288
 
289 289
         return view('subscriptions.edit', compact('subscription'));
290 290
     }
@@ -390,14 +390,14 @@  discard block
 block discarded – undo
390 390
         $subscription = Subscription::findOrFail($id);
391 391
 
392 392
         $already_paid = PaymentDetail::leftJoin('trn_cheque_details', 'trn_payment_details.id', '=', 'trn_cheque_details.payment_id')
393
-                                     ->whereRaw("trn_payment_details.invoice_id = $subscription->invoice_id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)")
394
-                                     ->sum('trn_payment_details.payment_amount');
393
+                                        ->whereRaw("trn_payment_details.invoice_id = $subscription->invoice_id AND (trn_cheque_details.`status` = 2 or trn_cheque_details.`status` IS NULL)")
394
+                                        ->sum('trn_payment_details.payment_amount');
395 395
 
396 396
         JavaScript::put([
397
-          'taxes' => \Utilities::getSetting('taxes'),
398
-          'gymieToday' => Carbon::today()->format('Y-m-d'),
399
-          'servicesCount' => Service::count(),
400
-      ]);
397
+            'taxes' => \Utilities::getSetting('taxes'),
398
+            'gymieToday' => Carbon::today()->format('Y-m-d'),
399
+            'servicesCount' => Service::count(),
400
+        ]);
401 401
 
402 402
         return view('subscriptions.change', compact('subscription', 'already_paid'));
403 403
     }
@@ -427,15 +427,15 @@  discard block
 block discarded – undo
427 427
             }
428 428
 
429 429
             Invoice::where('id', $subscription->invoice_id)->update(['invoice_number'=> $request->invoice_number,
430
-                                                               'total'=> $invoice_total,
431
-                                                               'status'=> $paymentStatus,
432
-                                                               'pending_amount'=> $pending,
433
-                                                               'discount_amount'=> $request->discount_amount,
434
-                                                               'discount_percent'=> $request->discount_percent,
435
-                                                               'discount_note'=> $request->discount_note,
436
-                                                               'tax'=> $request->taxes_amount,
437
-                                                               'additional_fees'=> $request->additional_fees,
438
-                                                               'note'=>' ', ]);
430
+                                                                'total'=> $invoice_total,
431
+                                                                'status'=> $paymentStatus,
432
+                                                                'pending_amount'=> $pending,
433
+                                                                'discount_amount'=> $request->discount_amount,
434
+                                                                'discount_percent'=> $request->discount_percent,
435
+                                                                'discount_note'=> $request->discount_note,
436
+                                                                'tax'=> $request->taxes_amount,
437
+                                                                'additional_fees'=> $request->additional_fees,
438
+                                                                'note'=>' ', ]);
439 439
 
440 440
             foreach ($request->plan as $plan) {
441 441
                 $subscription->update(['plan_id'=> $plan['id'],
@@ -447,14 +447,14 @@  discard block
 block discarded – undo
447 447
                 //Adding subscription to invoice(Invoice Details)
448 448
 
449 449
                 InvoiceDetail::where('invoice_id', $subscription->invoice_id)->update(['plan_id'=> $plan['id'],
450
-                                                                                         'item_amount'=> $plan['price'], ]);
450
+                                                                                            'item_amount'=> $plan['price'], ]);
451 451
             }
452 452
 
453 453
             //Payment Details
454 454
             $paymentData = ['invoice_id'=> $subscription->invoice_id,
455
-                                   'payment_amount'=> $request->payment_amount,
456
-                                   'mode'=> $request->mode,
457
-                                   'note'=> ' ', ];
455
+                                    'payment_amount'=> $request->payment_amount,
456
+                                    'mode'=> $request->mode,
457
+                                    'note'=> ' ', ];
458 458
 
459 459
             $payment_details = new PaymentDetail($paymentData);
460 460
             $payment_details->createdBy()->associate(Auth::user());
Please login to merge, or discard this patch.