@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | public function setup() |
| 28 | 28 | { |
| 29 | 29 | CRUD::setModel(\App\Models\Partner::class); |
| 30 | - CRUD::setRoute(config('backpack.base.route_prefix') . '/partner'); |
|
| 30 | + CRUD::setRoute(config('backpack.base.route_prefix').'/partner'); |
|
| 31 | 31 | CRUD::setEntityNameStrings(__('partnership'), __('partnerships')); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | 'type' => 'date', |
| 99 | 99 | ]); |
| 100 | 100 | |
| 101 | - CRUD::addField([ // Checkbox |
|
| 101 | + CRUD::addField([// Checkbox |
|
| 102 | 102 | 'name' => 'auto_renewal', |
| 103 | 103 | 'label' => __('Tacit renewal'), |
| 104 | 104 | 'type' => 'checkbox' |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | 'attribute' => 'lastname', |
| 80 | 80 | 'label' => __('Last Name'), |
| 81 | 81 | 'type' => 'relationship', |
| 82 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
| 83 | - $query->orWhereHas('student', function ($q) use ($searchTerm) { |
|
| 84 | - $q->whereHas('user', function ($q) use ($searchTerm) { |
|
| 82 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
| 83 | + $query->orWhereHas('student', function($q) use ($searchTerm) { |
|
| 84 | + $q->whereHas('user', function($q) use ($searchTerm) { |
|
| 85 | 85 | $q->where('lastname', 'like', '%'.$searchTerm.'%'); |
| 86 | 86 | }); |
| 87 | 87 | }); |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | 'attribute' => 'firstname', |
| 95 | 95 | 'label' => __('First Name'), |
| 96 | 96 | 'type' => 'relationship', |
| 97 | - 'searchLogic' => function ($query, $column, $searchTerm) { |
|
| 98 | - $query->orWhereHas('student', function ($q) use ($searchTerm) { |
|
| 99 | - $q->whereHas('user', function ($q) use ($searchTerm) { |
|
| 97 | + 'searchLogic' => function($query, $column, $searchTerm) { |
|
| 98 | + $query->orWhereHas('student', function($q) use ($searchTerm) { |
|
| 99 | + $q->whereHas('user', function($q) use ($searchTerm) { |
|
| 100 | 100 | $q->where('firstname', 'like', '%'.$searchTerm.'%'); |
| 101 | 101 | }); |
| 102 | 102 | }); |
@@ -146,10 +146,10 @@ discard block |
||
| 146 | 146 | 'name' => 'status_id', |
| 147 | 147 | 'type' => 'select2_multiple', |
| 148 | 148 | 'label'=> __('Status'), |
| 149 | - ], function () { |
|
| 149 | + ], function() { |
|
| 150 | 150 | return EnrollmentStatusType::all()->pluck('name', 'id')->toArray(); |
| 151 | 151 | }, |
| 152 | - function ($values) { |
|
| 152 | + function($values) { |
|
| 153 | 153 | // if the filter is active |
| 154 | 154 | foreach (json_decode($values) as $value) { |
| 155 | 155 | CRUD::addClause('orWhere', 'status_id', $value); |
@@ -160,9 +160,9 @@ discard block |
||
| 160 | 160 | 'name' => 'period_id', |
| 161 | 161 | 'type' => 'select2', |
| 162 | 162 | 'label'=> __('Period'), |
| 163 | - ], function () { |
|
| 163 | + ], function() { |
|
| 164 | 164 | return Period::all()->pluck('name', 'id')->toArray(); |
| 165 | - }, function ($value) { |
|
| 165 | + }, function($value) { |
|
| 166 | 166 | // if the filter is active |
| 167 | 167 | CRUD::addClause('period', $value); |
| 168 | 168 | }); |
@@ -173,14 +173,14 @@ discard block |
||
| 173 | 173 | 'type' => 'select2', |
| 174 | 174 | 'label'=> __('Scholarship'), |
| 175 | 175 | ], |
| 176 | - function () { |
|
| 176 | + function() { |
|
| 177 | 177 | return Scholarship::all()->pluck('name', 'id')->toArray(); |
| 178 | 178 | }, |
| 179 | - function ($value) { // if the filter is active |
|
| 179 | + function($value) { // if the filter is active |
|
| 180 | 180 | if ($value == 'all') { |
| 181 | 181 | CRUD::addClause('whereHas', 'scholarships'); |
| 182 | 182 | } else { |
| 183 | - CRUD::addClause('whereHas', 'scholarships', function ($q) use ($value) { |
|
| 183 | + CRUD::addClause('whereHas', 'scholarships', function($q) use ($value) { |
|
| 184 | 184 | $q->where('scholarships.id', $value); |
| 185 | 185 | }); |
| 186 | 186 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | //$enrollment->load('invoices')->load('invoices.payments'); |
| 208 | 208 | |
| 209 | - $writeaccess = $enrollment->status_id !== 2 && backpack_user()->can('enrollments.edit'); |
|
| 209 | + $writeaccess = $enrollment->status_id !== 2 && backpack_user()->can('enrollments.edit'); |
|
| 210 | 210 | |
| 211 | 211 | // then load the page |
| 212 | 212 | return view('enrollments.show', compact('enrollment', 'products', 'comments', 'scholarships', 'availablePaymentMethods', 'writeaccess')); |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | 'model' => "App\Models\Course", // foreign key model |
| 224 | 224 | 'attribute' => 'name', // foreign key attribute that is shown to user |
| 225 | 225 | |
| 226 | - 'options' => (function ($query) { |
|
| 226 | + 'options' => (function($query) { |
|
| 227 | 227 | return $query->orderBy('level_id', 'ASC')->where('period_id', $this->crud->getCurrentEntry()->course->period_id)->get(); |
| 228 | 228 | }), |
| 229 | 229 | ]); |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | ], $currency)); |
| 242 | 242 | |
| 243 | 243 | if (config('invoicing.allow_scheduled_payments')) { |
| 244 | - CRUD::addField(['name' => 'scheduledPayments', 'label' => __('Scheduled Payments'), 'type' => 'repeatable', 'fields' => [['name' => 'date', 'type' => 'date', 'label' => __('Date'), 'wrapper' => ['class' => 'form-group col-md-4'],], array_merge(['name' => 'value', 'type' => 'number', 'attributes' => ["step" => 0.01, "min" => 0], 'label' => __('Value'), 'wrapper' => ['class' => 'form-group col-md-4'],], $currency), ['name' => 'status', 'type' => 'radio', 'label' => __('Status'), 'wrapper' => ['class' => 'form-group col-md-4'], 'options' => [1 => __("Pending"), 2 => __("Paid"),], 'inline' => true,],],]); |
|
| 244 | + CRUD::addField(['name' => 'scheduledPayments', 'label' => __('Scheduled Payments'), 'type' => 'repeatable', 'fields' => [['name' => 'date', 'type' => 'date', 'label' => __('Date'), 'wrapper' => ['class' => 'form-group col-md-4'], ], array_merge(['name' => 'value', 'type' => 'number', 'attributes' => ["step" => 0.01, "min" => 0], 'label' => __('Value'), 'wrapper' => ['class' => 'form-group col-md-4'], ], $currency), ['name' => 'status', 'type' => 'radio', 'label' => __('Status'), 'wrapper' => ['class' => 'form-group col-md-4'], 'options' => [1 => __("Pending"), 2 => __("Paid"), ], 'inline' => true, ], ], ]); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | CRUD::addField([ |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | { |
| 20 | 20 | public function create(Enrollment $enrollment) |
| 21 | 21 | { |
| 22 | - return view ('invoices.create_scheduled_payments', [ |
|
| 22 | + return view('invoices.create_scheduled_payments', [ |
|
| 23 | 23 | 'enrollment' => $enrollment, |
| 24 | 24 | ]); |
| 25 | 25 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | $teachers = Teacher::all()->toArray(); |
| 28 | 28 | |
| 29 | - $teachers = array_map(function ($teacher) { |
|
| 29 | + $teachers = array_map(function($teacher) { |
|
| 30 | 30 | return [ |
| 31 | 31 | 'id' => $teacher['id'], |
| 32 | 32 | 'title' => $teacher['name'] ?? '', |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | array_push($teachers, ['id' => 'tbd', 'title' => 'Unassigned']); |
| 37 | 37 | |
| 38 | - $events = array_map(function ($event) { |
|
| 38 | + $events = array_map(function($event) { |
|
| 39 | 39 | return [ |
| 40 | 40 | 'title' => $event['name'] ?? '', |
| 41 | 41 | 'resourceId' => $event['teacher_id'], |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $unassigned_events = Event::where('teacher_id', null)->get()->toArray(); |
| 51 | 51 | |
| 52 | - $unassigned_events = array_map(function ($event) { |
|
| 52 | + $unassigned_events = array_map(function($event) { |
|
| 53 | 53 | return [ |
| 54 | 54 | 'title' => $event['name'] ?? '', |
| 55 | 55 | 'resourceId' => 'tbd', |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $leaves = Leave::orderBy('date', 'desc')->limit(10000)->get()->toArray(); |
| 65 | 65 | |
| 66 | - $leaves = array_map(function ($event) { |
|
| 66 | + $leaves = array_map(function($event) { |
|
| 67 | 67 | return [ |
| 68 | 68 | 'title' => $event->leaveType->name ?? 'ABS', // todo fix |
| 69 | 69 | 'resourceId' => $event['teacher_id'], |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | $events = $teacher->events->toArray(); |
| 95 | - $events = array_map(function ($event) { |
|
| 95 | + $events = array_map(function($event) { |
|
| 96 | 96 | return [ |
| 97 | 97 | 'title' => $event['name'], |
| 98 | 98 | 'start' => $event['start'], |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | }, $events); |
| 104 | 104 | |
| 105 | 105 | $leaves = $teacher->leaves->toArray(); |
| 106 | - $leaves = array_map(function ($event) { |
|
| 106 | + $leaves = array_map(function($event) { |
|
| 107 | 107 | return [ |
| 108 | - 'title' => $event->leaveType->name ?? 'vacances', // todo fix |
|
| 108 | + 'title' => $event->leaveType->name ?? 'vacances', // todo fix |
|
| 109 | 109 | 'start' => $event['date'], |
| 110 | 110 | 'allDay' => true, |
| 111 | 111 | ]; |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | public function get() |
| 12 | 12 | { |
| 13 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 13 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 14 | 14 | abort(403); |
| 15 | 15 | } |
| 16 | 16 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function update(UpdateConfigRequest $request) |
| 25 | 25 | { |
| 26 | - if (! backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 26 | + if (!backpack_user()->hasPermissionTo('courses.edit')) { |
|
| 27 | 27 | abort(403); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | // persist the products |
| 88 | 88 | foreach ($request->products as $f => $product) { |
| 89 | - $productType = match ($product['type']) { |
|
| 89 | + $productType = match($product['type']) { |
|
| 90 | 90 | 'enrollment' => Enrollment::class, |
| 91 | 91 | 'scheduledPayment' => Enrollment::class, |
| 92 | 92 | 'fee' => Fee::class, |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | Payment::create([ |
| 156 | 156 | 'responsable_id' => backpack_user()->id, |
| 157 | 157 | 'invoice_id' => $invoice->id, |
| 158 | - 'payment_method' => isset($payment['method']) ? $payment['method'] : null , |
|
| 158 | + 'payment_method' => isset($payment['method']) ? $payment['method'] : null, |
|
| 159 | 159 | 'value' => $payment['value'], |
| 160 | 160 | 'date' => isset($payment['date']) ? Carbon::parse($payment['date']) : Carbon::now(), |
| 161 | 161 | ]); |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | // if the sync with external mailing system is enabled |
| 20 | 20 | if (config('mailing-system.external_mailing_enabled') == true) { |
| 21 | 21 | |
| 22 | - match ($request->input('status')) { |
|
| 22 | + match($request->input('status')) { |
|
| 23 | 23 | 1 => $listId = config('mailing-system.mailerlite.activeStudentsListId'), |
| 24 | 24 | 2, 3 => $listId = config('mailing-system.mailerlite.inactiveStudentsListId'), |
| 25 | 25 | default => abort(422, 'List ID not found'), |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | $report_end_date = $request->report_end_date ? Carbon::parse($request->report_end_date) : Carbon::parse($period->end); |
| 33 | 33 | |
| 34 | 34 | // if we are dealing with a complete period, add theoretical volumes |
| 35 | - if (! $request->report_start_date && ! $request->report_end_date) { |
|
| 35 | + if (!$request->report_start_date && !$request->report_end_date) { |
|
| 36 | 36 | // ensure the report end date is not before the end date to avoid inconsistent results. |
| 37 | 37 | $report_end_date = $report_start_date->max($report_end_date); |
| 38 | 38 | |
@@ -24,6 +24,6 @@ |
||
| 24 | 24 | |
| 25 | 25 | public function build() |
| 26 | 26 | { |
| 27 | - return $this->subject('Facturation ' . $this->data['partner_name'])->view('emails.external_courses_report'); |
|
| 27 | + return $this->subject('Facturation '.$this->data['partner_name'])->view('emails.external_courses_report'); |
|
| 28 | 28 | } |
| 29 | 29 | } |