@@ -178,8 +178,7 @@ |
||
| 178 | 178 | $session->disabledPools()->detach(); |
| 179 | 179 | $session->delete(); |
| 180 | 180 | }); |
| 181 | - } |
|
| 182 | - catch(Exception $e) |
|
| 181 | + } catch(Exception $e) |
|
| 183 | 182 | { |
| 184 | 183 | throw new MessageException(trans('tontine.session.errors.delete')); |
| 185 | 184 | } |
@@ -107,14 +107,14 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function createSessions(array $values): bool |
| 109 | 109 | { |
| 110 | - foreach($values as &$value) |
|
| 110 | + foreach ($values as &$value) |
|
| 111 | 111 | { |
| 112 | 112 | $value['start_at'] = $value['date'] . ' ' . $value['start'] . ':00'; |
| 113 | 113 | $value['end_at'] = $value['date'] . ' ' . $value['end'] . ':00'; |
| 114 | 114 | } |
| 115 | 115 | DB::transaction(function() use($values) { |
| 116 | 116 | $sessions = $this->tenantService->round()->sessions()->createMany($values); |
| 117 | - foreach($sessions as $session) |
|
| 117 | + foreach ($sessions as $session) |
|
| 118 | 118 | { |
| 119 | 119 | $this->disableSessionOnPools($session); |
| 120 | 120 | } |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | // Make sure the host belongs to the same tontine |
| 139 | 139 | $hostId = intval($values['host_id']); |
| 140 | 140 | $values['host_id'] = null; |
| 141 | - if($hostId > 0) |
|
| 141 | + if ($hostId > 0) |
|
| 142 | 142 | { |
| 143 | 143 | $values['host_id'] = $this->tenantService->tontine()->members()->find($hostId)->id; |
| 144 | 144 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $session->delete(); |
| 180 | 180 | }); |
| 181 | 181 | } |
| 182 | - catch(Exception $e) |
|
| 182 | + catch (Exception $e) |
|
| 183 | 183 | { |
| 184 | 184 | throw new MessageException(trans('tontine.session.errors.delete')); |
| 185 | 185 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | // { |
| 214 | 214 | // return; |
| 215 | 215 | // } |
| 216 | - if($session->enabled($pool)) |
|
| 216 | + if ($session->enabled($pool)) |
|
| 217 | 217 | { |
| 218 | 218 | return; |
| 219 | 219 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | // { |
| 240 | 240 | // return; |
| 241 | 241 | // } |
| 242 | - if($session->disabled($pool)) |
|
| 242 | + if ($session->disabled($pool)) |
|
| 243 | 243 | { |
| 244 | 244 | return; |
| 245 | 245 | } |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | $year = now()->format('Y'); |
| 265 | 265 | $date = Carbon::createFromDate($year, 1, 5, 'Africa/Douala')->locale('fr'); |
| 266 | 266 | $sessions = []; |
| 267 | - for($i = 0; $i < 12; $i++) |
|
| 267 | + for ($i = 0; $i < 12; $i++) |
|
| 268 | 268 | { |
| 269 | 269 | $session = new \stdClass(); |
| 270 | 270 | $session->title = 'Séance de ' . $date->isoFormat('MMMM YYYY'); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $member->libre_bills->first()->bill : null; |
| 247 | 247 | }); |
| 248 | 248 | // Check if there is a settlement target. |
| 249 | - if(!($target = $this->targetService->getTarget($charge, $session))) |
|
| 249 | + if (!($target = $this->targetService->getTarget($charge, $session))) |
|
| 250 | 250 | { |
| 251 | 251 | return $members; |
| 252 | 252 | } |
@@ -287,12 +287,12 @@ discard block |
||
| 287 | 287 | int $memberId, bool $paid, float $amount = 0): void |
| 288 | 288 | { |
| 289 | 289 | $member = $this->tenantService->tontine()->members()->find($memberId); |
| 290 | - if(!$member) |
|
| 290 | + if (!$member) |
|
| 291 | 291 | { |
| 292 | 292 | throw new MessageException(trans('tontine.member.errors.not_found')); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | - if($amount !== 0) |
|
| 295 | + if ($amount !== 0) |
|
| 296 | 296 | { |
| 297 | 297 | $amount = $this->localeService->convertMoneyToInt($amount); |
| 298 | 298 | } |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | $libreBill->session()->associate($session); |
| 310 | 310 | $libreBill->bill()->associate($bill); |
| 311 | 311 | $libreBill->save(); |
| 312 | - if($paid) |
|
| 312 | + if ($paid) |
|
| 313 | 313 | { |
| 314 | 314 | $settlement = new Settlement(); |
| 315 | 315 | $settlement->bill()->associate($bill); |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | */ |
| 329 | 329 | public function getBill(Charge $charge, Session $session, int $memberId): ?LibreBill |
| 330 | 330 | { |
| 331 | - if(!($member = $this->tenantService->tontine()->members()->find($memberId))) |
|
| 331 | + if (!($member = $this->tenantService->tontine()->members()->find($memberId))) |
|
| 332 | 332 | { |
| 333 | 333 | throw new MessageException(trans('tontine.member.errors.not_found')); |
| 334 | 334 | } |
@@ -350,7 +350,7 @@ discard block |
||
| 350 | 350 | */ |
| 351 | 351 | public function updateBill(Charge $charge, Session $session, int $memberId, float $amount): void |
| 352 | 352 | { |
| 353 | - if(!($libreBill = $this->getBill($charge, $session, $memberId))) |
|
| 353 | + if (!($libreBill = $this->getBill($charge, $session, $memberId))) |
|
| 354 | 354 | { |
| 355 | 355 | return; // throw new MessageException(trans('tontine.bill.errors.not_found')); |
| 356 | 356 | } |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | */ |
| 370 | 370 | public function deleteBill(Charge $charge, Session $session, int $memberId): void |
| 371 | 371 | { |
| 372 | - if(!($libreBill = $this->getBill($charge, $session, $memberId))) |
|
| 372 | + if (!($libreBill = $this->getBill($charge, $session, $memberId))) |
|
| 373 | 373 | { |
| 374 | 374 | return; // throw new MessageException(trans('tontine.bill.errors.not_found')); |
| 375 | 375 | } |
@@ -377,10 +377,10 @@ discard block |
||
| 377 | 377 | DB::transaction(function() use($libreBill, $session) { |
| 378 | 378 | $bill = $libreBill->bill; |
| 379 | 379 | $libreBill->delete(); |
| 380 | - if($bill !== null) |
|
| 380 | + if ($bill !== null) |
|
| 381 | 381 | { |
| 382 | 382 | // Delete the settlement only if it is on the same session |
| 383 | - if($bill->settlement !== null && $bill->settlement->session_id === $session->id) |
|
| 383 | + if ($bill->settlement !== null && $bill->settlement->session_id === $session->id) |
|
| 384 | 384 | { |
| 385 | 385 | $bill->settlement->delete(); |
| 386 | 386 | } |
@@ -36,13 +36,13 @@ |
||
| 36 | 36 | 'amount' => 'required|regex:/^\d+(\.\d{1,2})?$/', |
| 37 | 37 | 'deadline' => 'required|integer|min:1', |
| 38 | 38 | ]); |
| 39 | - if($validator->fails()) |
|
| 39 | + if ($validator->fails()) |
|
| 40 | 40 | { |
| 41 | 41 | throw new ValidationException($validator); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | $validated = $validator->validated(); |
| 45 | - $validated['amount'] = $this->localeService->convertMoneyToInt((float)$validated['amount']); |
|
| 45 | + $validated['amount'] = $this->localeService->convertMoneyToInt((float) $validated['amount']); |
|
| 46 | 46 | return $validated; |
| 47 | 47 | } |
| 48 | 48 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $this->target()->args()[0] : $this->bag('meeting')->get('charge.id'); |
| 68 | 68 | $this->session = $this->chargeService->getSession($sessionId); |
| 69 | 69 | $this->charge = $this->chargeService->getCharge($chargeId); |
| 70 | - if($this->session !== null && $this->charge !== null) |
|
| 70 | + if ($this->session !== null && $this->charge !== null) |
|
| 71 | 71 | { |
| 72 | 72 | $this->target = $this->targetService->getTarget($this->charge, $this->session); |
| 73 | 73 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function page(int $pageNumber = 0) |
| 105 | 105 | { |
| 106 | - if($this->target === null) |
|
| 106 | + if ($this->target === null) |
|
| 107 | 107 | { |
| 108 | 108 | return $this->response; |
| 109 | 109 | } |
@@ -143,16 +143,16 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function add() |
| 145 | 145 | { |
| 146 | - if($this->session->closed) |
|
| 146 | + if ($this->session->closed) |
|
| 147 | 147 | { |
| 148 | 148 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 149 | 149 | return $this->response; |
| 150 | 150 | } |
| 151 | - if($this->session === null || $this->charge === null) |
|
| 151 | + if ($this->session === null || $this->charge === null) |
|
| 152 | 152 | { |
| 153 | 153 | return $this->response; |
| 154 | 154 | } |
| 155 | - if($this->target !== null) |
|
| 155 | + if ($this->target !== null) |
|
| 156 | 156 | { |
| 157 | 157 | return $this->response; |
| 158 | 158 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | 'title' => trans('common.actions.cancel'), |
| 166 | 166 | 'class' => 'btn btn-tertiary', |
| 167 | 167 | 'click' => 'close', |
| 168 | - ],[ |
|
| 168 | + ], [ |
|
| 169 | 169 | 'title' => trans('common.actions.save'), |
| 170 | 170 | 'class' => 'btn btn-primary', |
| 171 | 171 | 'click' => $this->rq()->create(pm()->form('target-form')), |
@@ -184,16 +184,16 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public function create(array $formValues) |
| 186 | 186 | { |
| 187 | - if($this->session->closed) |
|
| 187 | + if ($this->session->closed) |
|
| 188 | 188 | { |
| 189 | 189 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 190 | 190 | return $this->response; |
| 191 | 191 | } |
| 192 | - if($this->session === null || $this->charge === null) |
|
| 192 | + if ($this->session === null || $this->charge === null) |
|
| 193 | 193 | { |
| 194 | 194 | return $this->response; |
| 195 | 195 | } |
| 196 | - if($this->target !== null) |
|
| 196 | + if ($this->target !== null) |
|
| 197 | 197 | { |
| 198 | 198 | return $this->response; |
| 199 | 199 | } |
@@ -215,12 +215,12 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | public function edit() |
| 217 | 217 | { |
| 218 | - if($this->session->closed) |
|
| 218 | + if ($this->session->closed) |
|
| 219 | 219 | { |
| 220 | 220 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 221 | 221 | return $this->response; |
| 222 | 222 | } |
| 223 | - if($this->target === null) |
|
| 223 | + if ($this->target === null) |
|
| 224 | 224 | { |
| 225 | 225 | return $this->response; |
| 226 | 226 | } |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | 'title' => trans('common.actions.cancel'), |
| 235 | 235 | 'class' => 'btn btn-tertiary', |
| 236 | 236 | 'click' => 'close', |
| 237 | - ],[ |
|
| 237 | + ], [ |
|
| 238 | 238 | 'title' => trans('common.actions.save'), |
| 239 | 239 | 'class' => 'btn btn-primary', |
| 240 | 240 | 'click' => $this->rq()->update(pm()->form('target-form')), |
@@ -254,12 +254,12 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | public function update(array $formValues) |
| 256 | 256 | { |
| 257 | - if($this->session->closed) |
|
| 257 | + if ($this->session->closed) |
|
| 258 | 258 | { |
| 259 | 259 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 260 | 260 | return $this->response; |
| 261 | 261 | } |
| 262 | - if($this->target === null) |
|
| 262 | + if ($this->target === null) |
|
| 263 | 263 | { |
| 264 | 264 | return $this->response; |
| 265 | 265 | } |
@@ -281,11 +281,11 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | public function remove() |
| 283 | 283 | { |
| 284 | - if($this->session === null || $this->charge === null) |
|
| 284 | + if ($this->session === null || $this->charge === null) |
|
| 285 | 285 | { |
| 286 | 286 | return $this->response; |
| 287 | 287 | } |
| 288 | - if($this->target === null) |
|
| 288 | + if ($this->target === null) |
|
| 289 | 289 | { |
| 290 | 290 | return $this->response; |
| 291 | 291 | } |
@@ -62,19 +62,19 @@ discard block |
||
| 62 | 62 | // The select('bills.*') is important here, otherwise Eloquent overrides the |
| 63 | 63 | // Bill model id fields with those of another model, then making the dataset incorrect. |
| 64 | 64 | $query = Bill::select('bills.*'); |
| 65 | - if($charge->is_variable) |
|
| 65 | + if ($charge->is_variable) |
|
| 66 | 66 | { |
| 67 | 67 | return $query->join('libre_bills', 'libre_bills.bill_id', '=', 'bills.id') |
| 68 | 68 | ->where('libre_bills.charge_id', $charge->id) |
| 69 | 69 | ->where('libre_bills.session_id', $session->id); |
| 70 | 70 | } |
| 71 | - if($charge->period_session) |
|
| 71 | + if ($charge->period_session) |
|
| 72 | 72 | { |
| 73 | 73 | return $query->join('session_bills', 'session_bills.bill_id', '=', 'bills.id') |
| 74 | 74 | ->where('session_bills.charge_id', $charge->id) |
| 75 | 75 | ->where('session_bills.session_id', $session->id); |
| 76 | 76 | } |
| 77 | - if($charge->period_round) |
|
| 77 | + if ($charge->period_round) |
|
| 78 | 78 | { |
| 79 | 79 | return $query->join('round_bills', 'round_bills.bill_id', '=', 'bills.id') |
| 80 | 80 | ->where('round_bills.charge_id', $charge->id); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | { |
| 98 | 98 | $bill = $this->getQuery($charge, $session)->with('settlement')->find($billId); |
| 99 | 99 | // Return if the bill is not found or the bill is already settled. |
| 100 | - if(!$bill || ($bill->settlement)) |
|
| 100 | + if (!$bill || ($bill->settlement)) |
|
| 101 | 101 | { |
| 102 | 102 | throw new MessageException(trans('tontine.bill.errors.not_found')); |
| 103 | 103 | } |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | { |
| 121 | 121 | $bill = $this->getQuery($charge, $session)->with('settlement')->find($billId); |
| 122 | 122 | // Return if the bill is not found or the bill is not settled. |
| 123 | - if(!$bill || !($bill->settlement)) |
|
| 123 | + if (!$bill || !($bill->settlement)) |
|
| 124 | 124 | { |
| 125 | 125 | throw new MessageException(trans('tontine.bill.errors.not_found')); |
| 126 | 126 | } |
| 127 | - if((!$bill->settlement->editable)) |
|
| 127 | + if ((!$bill->settlement->editable)) |
|
| 128 | 128 | { |
| 129 | 129 | throw new MessageException(trans('tontine.errors.editable')); |
| 130 | 130 | } |
@@ -142,13 +142,13 @@ discard block |
||
| 142 | 142 | public function createAllSettlements(Charge $charge, Session $session): void |
| 143 | 143 | { |
| 144 | 144 | $bills = $this->getQuery($charge, $session)->whereDoesntHave('settlement')->get(); |
| 145 | - if($bills->count() === 0) |
|
| 145 | + if ($bills->count() === 0) |
|
| 146 | 146 | { |
| 147 | 147 | return; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | DB::transaction(function() use($bills, $session) { |
| 151 | - foreach($bills as $bill) |
|
| 151 | + foreach ($bills as $bill) |
|
| 152 | 152 | { |
| 153 | 153 | $settlement = new Settlement(); |
| 154 | 154 | $settlement->bill()->associate($bill); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | ->filter(function($bill) { |
| 176 | 176 | return $bill->settlement->editable; |
| 177 | 177 | }); |
| 178 | - if($bills->count() === 0) |
|
| 178 | + if ($bills->count() === 0) |
|
| 179 | 179 | { |
| 180 | 180 | return; |
| 181 | 181 | } |
@@ -196,14 +196,14 @@ discard block |
||
| 196 | 196 | $query = DB::table('settlements') |
| 197 | 197 | ->select(DB::raw('count(*) as total'), DB::raw('sum(bills.amount) as amount')) |
| 198 | 198 | ->join('bills', 'settlements.bill_id', '=', 'bills.id'); |
| 199 | - if($charge->is_variable) |
|
| 199 | + if ($charge->is_variable) |
|
| 200 | 200 | { |
| 201 | 201 | return $query->join('libre_bills', 'libre_bills.bill_id', '=', 'bills.id') |
| 202 | 202 | ->where('settlements.session_id', $session->id) |
| 203 | 203 | ->where('libre_bills.charge_id', $charge->id) |
| 204 | 204 | ->first(); |
| 205 | 205 | } |
| 206 | - if($charge->period_session) |
|
| 206 | + if ($charge->period_session) |
|
| 207 | 207 | { |
| 208 | 208 | // For session charges, count the bills in the current session that are settled. |
| 209 | 209 | return $query->join('session_bills', 'session_bills.bill_id', '=', 'bills.id') |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | ->where('session_bills.session_id', $session->id) |
| 212 | 212 | ->first(); |
| 213 | 213 | } |
| 214 | - if($charge->period_round) |
|
| 214 | + if ($charge->period_round) |
|
| 215 | 215 | { |
| 216 | 216 | return $query->join('round_bills', 'round_bills.bill_id', '=', 'bills.id') |
| 217 | 217 | ->where('settlements.session_id', $session->id) |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | 'title' => trans('common.actions.cancel'), |
| 87 | 87 | 'class' => 'btn btn-tertiary', |
| 88 | 88 | 'click' => 'close', |
| 89 | - ],[ |
|
| 89 | + ], [ |
|
| 90 | 90 | 'title' => trans('common.actions.next'), |
| 91 | 91 | 'class' => 'btn btn-primary', |
| 92 | 92 | 'click' => $this->rq()->showDepositFixed(), |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | 'title' => trans('common.actions.cancel'), |
| 110 | 110 | 'class' => 'btn btn-tertiary', |
| 111 | 111 | 'click' => 'close', |
| 112 | - ],[ |
|
| 112 | + ], [ |
|
| 113 | 113 | 'title' => trans('common.actions.next'), |
| 114 | 114 | 'class' => 'btn btn-primary', |
| 115 | 115 | 'click' => $this->rq()->saveDepositFixed(pm()->checked('pool_deposit_fixed')), |
@@ -140,11 +140,11 @@ discard block |
||
| 140 | 140 | 'title' => trans('common.actions.cancel'), |
| 141 | 141 | 'class' => 'btn btn-tertiary', |
| 142 | 142 | 'click' => 'close', |
| 143 | - ],[ |
|
| 143 | + ], [ |
|
| 144 | 144 | 'title' => trans('common.actions.prev'), |
| 145 | 145 | 'class' => 'btn btn-primary', |
| 146 | 146 | 'click' => $this->rq()->showDepositFixed(), |
| 147 | - ],[ |
|
| 147 | + ], [ |
|
| 148 | 148 | 'title' => trans('common.actions.next'), |
| 149 | 149 | 'class' => 'btn btn-primary', |
| 150 | 150 | 'click' => $this->rq()->saveRemitFixed(pm()->checked('pool_remit_fixed')), |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $properties = $this->bag('pool')->get('add', []); |
| 160 | 160 | $properties['remit']['fixed'] = $fixed; |
| 161 | 161 | |
| 162 | - if(!$properties['deposit']['fixed'] && !$properties['remit']['fixed']) |
|
| 162 | + if (!$properties['deposit']['fixed'] && !$properties['remit']['fixed']) |
|
| 163 | 163 | { |
| 164 | 164 | $properties['remit']['planned'] = true; |
| 165 | 165 | $properties['remit']['auction'] = false; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | return $this->showRemitLendable(); |
| 169 | 169 | } |
| 170 | - if(!$properties['deposit']['fixed'] && $properties['remit']['fixed']) |
|
| 170 | + if (!$properties['deposit']['fixed'] && $properties['remit']['fixed']) |
|
| 171 | 171 | { |
| 172 | 172 | $properties['remit']['planned'] = true; |
| 173 | 173 | $properties['remit']['auction'] = false; |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | return $this->add(); |
| 178 | 178 | } |
| 179 | - if($properties['deposit']['fixed'] && !$properties['remit']['fixed']) |
|
| 179 | + if ($properties['deposit']['fixed'] && !$properties['remit']['fixed']) |
|
| 180 | 180 | { |
| 181 | 181 | $properties['remit']['planned'] = false; |
| 182 | 182 | $this->bag('pool')->set('add', $properties); |
@@ -201,11 +201,11 @@ discard block |
||
| 201 | 201 | 'title' => trans('common.actions.cancel'), |
| 202 | 202 | 'class' => 'btn btn-tertiary', |
| 203 | 203 | 'click' => 'close', |
| 204 | - ],[ |
|
| 204 | + ], [ |
|
| 205 | 205 | 'title' => trans('common.actions.prev'), |
| 206 | 206 | 'class' => 'btn btn-primary', |
| 207 | 207 | 'click' => $this->rq()->showRemitFixed(), |
| 208 | - ],[ |
|
| 208 | + ], [ |
|
| 209 | 209 | 'title' => trans('common.actions.next'), |
| 210 | 210 | 'class' => 'btn btn-primary', |
| 211 | 211 | 'click' => $this->rq()->saveRemitPlanned(pm()->checked('pool_remit_planned')), |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | $properties = $this->bag('pool')->get('add', []); |
| 232 | 232 | $prevAction = $this->rq()->showRemitPlanned(); |
| 233 | - if($properties['deposit']['fixed'] && !$properties['remit']['fixed']) |
|
| 233 | + if ($properties['deposit']['fixed'] && !$properties['remit']['fixed']) |
|
| 234 | 234 | { |
| 235 | 235 | $prevAction = $this->rq()->showRemitFixed(); |
| 236 | 236 | } |
@@ -242,11 +242,11 @@ discard block |
||
| 242 | 242 | 'title' => trans('common.actions.cancel'), |
| 243 | 243 | 'class' => 'btn btn-tertiary', |
| 244 | 244 | 'click' => 'close', |
| 245 | - ],[ |
|
| 245 | + ], [ |
|
| 246 | 246 | 'title' => trans('common.actions.prev'), |
| 247 | 247 | 'class' => 'btn btn-primary', |
| 248 | 248 | 'click' => $prevAction, |
| 249 | - ],[ |
|
| 249 | + ], [ |
|
| 250 | 250 | 'title' => trans('common.actions.next'), |
| 251 | 251 | 'class' => 'btn btn-primary', |
| 252 | 252 | 'click' => $this->rq()->saveRemitAuction(pm()->checked('pool_remit_auction')), |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | $properties = $this->bag('pool')->get('add', []); |
| 273 | 273 | $prevAction = $this->rq()->showRemitAuction(); |
| 274 | - if(!$properties['deposit']['fixed'] && !$properties['remit']['fixed']) |
|
| 274 | + if (!$properties['deposit']['fixed'] && !$properties['remit']['fixed']) |
|
| 275 | 275 | { |
| 276 | 276 | $prevAction = $this->rq()->showRemitFixed(); |
| 277 | 277 | } |
@@ -283,11 +283,11 @@ discard block |
||
| 283 | 283 | 'title' => trans('common.actions.cancel'), |
| 284 | 284 | 'class' => 'btn btn-tertiary', |
| 285 | 285 | 'click' => 'close', |
| 286 | - ],[ |
|
| 286 | + ], [ |
|
| 287 | 287 | 'title' => trans('common.actions.prev'), |
| 288 | 288 | 'class' => 'btn btn-primary', |
| 289 | 289 | 'click' => $prevAction, |
| 290 | - ],[ |
|
| 290 | + ], [ |
|
| 291 | 291 | 'title' => trans('common.actions.next'), |
| 292 | 292 | 'class' => 'btn btn-primary', |
| 293 | 293 | 'click' => $this->rq()->saveRemitLendable(pm()->checked('pool_remit_lendable')), |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | 'title' => trans('common.actions.cancel'), |
| 318 | 318 | 'class' => 'btn btn-tertiary', |
| 319 | 319 | 'click' => 'close', |
| 320 | - ],[ |
|
| 320 | + ], [ |
|
| 321 | 321 | 'title' => trans('common.actions.save'), |
| 322 | 322 | 'class' => 'btn btn-primary', |
| 323 | 323 | 'click' => $this->rq()->create(pm()->form('pool-form')), |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | 'title' => trans('common.actions.cancel'), |
| 355 | 355 | 'class' => 'btn btn-tertiary', |
| 356 | 356 | 'click' => 'close', |
| 357 | - ],[ |
|
| 357 | + ], [ |
|
| 358 | 358 | 'title' => trans('common.actions.save'), |
| 359 | 359 | 'class' => 'btn btn-primary', |
| 360 | 360 | 'click' => $this->rq()->update($pool->id, pm()->form('pool-form')), |
@@ -143,7 +143,7 @@ |
||
| 143 | 143 | $pool->delete(); |
| 144 | 144 | }); |
| 145 | 145 | } |
| 146 | - catch(Exception $e) |
|
| 146 | + catch (Exception $e) |
|
| 147 | 147 | { |
| 148 | 148 | throw new MessageException(trans('tontine.errors.action') . |
| 149 | 149 | '<br/>' . trans('tontine.pool.errors.subscription')); |
@@ -142,8 +142,7 @@ |
||
| 142 | 142 | $pool->subscriptions()->delete(); |
| 143 | 143 | $pool->delete(); |
| 144 | 144 | }); |
| 145 | - } |
|
| 146 | - catch(Exception $e) |
|
| 145 | + } catch(Exception $e) |
|
| 147 | 146 | { |
| 148 | 147 | throw new MessageException(trans('tontine.errors.action') . |
| 149 | 148 | '<br/>' . trans('tontine.pool.errors.subscription')); |
@@ -45,8 +45,7 @@ discard block |
||
| 45 | 45 | $pools = $this->poolService->getPools(); |
| 46 | 46 | $poolLabels = $pools->keyBy('id')->map(function($pool) { |
| 47 | 47 | return $pool->title . ' - ' . ($pool->deposit_fixed ? |
| 48 | - $this->localeService->formatMoney($pool->amount) : |
|
| 49 | - trans('tontine.labels.types.libre')); |
|
| 48 | + $this->localeService->formatMoney($pool->amount) : trans('tontine.labels.types.libre')); |
|
| 50 | 49 | }); |
| 51 | 50 | $html = $this->view()->render('tontine.pages.planning.subscription.home', [ |
| 52 | 51 | 'pools' => $poolLabels, |
@@ -59,7 +58,7 @@ discard block |
||
| 59 | 58 | $this->jq('#btn-pool-select')->click($this->rq()->pool($selectPoolId)); |
| 60 | 59 | |
| 61 | 60 | $pool = $pools->firstWhere('id', $poolId) ?? ($pools->count() > 0 ? $pools[0] : null); |
| 62 | - if(($pool)) |
|
| 61 | + if (($pool)) |
|
| 63 | 62 | { |
| 64 | 63 | return $this->show($pool); |
| 65 | 64 | } |
@@ -90,7 +89,7 @@ discard block |
||
| 90 | 89 | public function planning(int $poolId) |
| 91 | 90 | { |
| 92 | 91 | $pool = $this->poolService->getPool($poolId); |
| 93 | - if(!$pool || !$pool->remit_planned) |
|
| 92 | + if (!$pool || !$pool->remit_planned) |
|
| 94 | 93 | { |
| 95 | 94 | return $this->response; |
| 96 | 95 | } |
@@ -115,7 +114,7 @@ discard block |
||
| 115 | 114 | public function beneficiaries(int $poolId) |
| 116 | 115 | { |
| 117 | 116 | $pool = $this->poolService->getPool($poolId); |
| 118 | - if(!$pool || !$pool->remit_planned) |
|
| 117 | + if (!$pool || !$pool->remit_planned) |
|
| 119 | 118 | { |
| 120 | 119 | return $this->response; |
| 121 | 120 | } |
@@ -147,12 +146,12 @@ discard block |
||
| 147 | 146 | int $currSubscriptionId) |
| 148 | 147 | { |
| 149 | 148 | $pool = $this->poolService->getPool($poolId); |
| 150 | - if(!$pool || !$pool->remit_planned || $pool->remit_auction) |
|
| 149 | + if (!$pool || !$pool->remit_planned || $pool->remit_auction) |
|
| 151 | 150 | { |
| 152 | 151 | return $this->response; |
| 153 | 152 | } |
| 154 | 153 | |
| 155 | - if(!$this->subscriptionService->saveBeneficiary($pool, $sessionId, |
|
| 154 | + if (!$this->subscriptionService->saveBeneficiary($pool, $sessionId, |
|
| 156 | 155 | $currSubscriptionId, $nextSubscriptionId)) |
| 157 | 156 | { |
| 158 | 157 | $message = trans('tontine.beneficiary.errors.cant_change'); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | public function page(int $pageNumber = 0) |
| 88 | 88 | { |
| 89 | 89 | $search = trim($this->bag('meeting')->get('fee.member.search', '')); |
| 90 | - $paid = (bool)$this->bag('meeting')->get('fee.member.paid', false); |
|
| 90 | + $paid = (bool) $this->bag('meeting')->get('fee.member.paid', false); |
|
| 91 | 91 | $filter = $this->bag('meeting')->get('fee.member.filter', null); |
| 92 | 92 | $memberCount = $this->feeService->getMemberCount($this->charge, |
| 93 | 93 | $this->session, $search, $filter); |
@@ -147,18 +147,18 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | public function addBill(int $memberId, bool $paid, string $amount = '') |
| 149 | 149 | { |
| 150 | - if($this->session->closed) |
|
| 150 | + if ($this->session->closed) |
|
| 151 | 151 | { |
| 152 | 152 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 153 | 153 | return $this->response; |
| 154 | 154 | } |
| 155 | 155 | $amount = str_replace(',', '.', trim($amount)); |
| 156 | - if($amount !== '' && filter_var($amount, FILTER_VALIDATE_FLOAT) === false) |
|
| 156 | + if ($amount !== '' && filter_var($amount, FILTER_VALIDATE_FLOAT) === false) |
|
| 157 | 157 | { |
| 158 | 158 | $this->notify->error(trans('meeting.errors.amount.invalid', ['amount' => $amount])); |
| 159 | 159 | return $this->response; |
| 160 | 160 | } |
| 161 | - $amount = $amount === '' ? 0 : (float)$amount; |
|
| 161 | + $amount = $amount === '' ? 0 : (float) $amount; |
|
| 162 | 162 | |
| 163 | 163 | $this->feeService->createBill($this->charge, $this->session, $memberId, $paid, $amount); |
| 164 | 164 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | public function delBill(int $memberId) |
| 177 | 177 | { |
| 178 | - if($this->session->closed) |
|
| 178 | + if ($this->session->closed) |
|
| 179 | 179 | { |
| 180 | 180 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 181 | 181 | return $this->response; |
@@ -194,13 +194,13 @@ discard block |
||
| 194 | 194 | */ |
| 195 | 195 | public function editBill(int $memberId) |
| 196 | 196 | { |
| 197 | - if($this->session->closed) |
|
| 197 | + if ($this->session->closed) |
|
| 198 | 198 | { |
| 199 | 199 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 200 | 200 | return $this->response; |
| 201 | 201 | } |
| 202 | 202 | $bill = $this->feeService->getBill($this->charge, $this->session, $memberId); |
| 203 | - if($bill === null) |
|
| 203 | + if ($bill === null) |
|
| 204 | 204 | { |
| 205 | 205 | return $this->response; |
| 206 | 206 | } |
@@ -227,21 +227,21 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | public function saveBill(int $memberId, string $amount) |
| 229 | 229 | { |
| 230 | - if($this->session->closed) |
|
| 230 | + if ($this->session->closed) |
|
| 231 | 231 | { |
| 232 | 232 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 233 | 233 | return $this->response; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | $amount = str_replace(',', '.', trim($amount)); |
| 237 | - if($amount !== '' && filter_var($amount, FILTER_VALIDATE_FLOAT) === false) |
|
| 237 | + if ($amount !== '' && filter_var($amount, FILTER_VALIDATE_FLOAT) === false) |
|
| 238 | 238 | { |
| 239 | 239 | $this->notify->error(trans('meeting.errors.amount.invalid', ['amount' => $amount])); |
| 240 | 240 | return $this->response; |
| 241 | 241 | } |
| 242 | - $amount = $amount === '' ? 0 : (float)$amount; |
|
| 242 | + $amount = $amount === '' ? 0 : (float) $amount; |
|
| 243 | 243 | |
| 244 | - if(!$amount) |
|
| 244 | + if (!$amount) |
|
| 245 | 245 | { |
| 246 | 246 | $this->feeService->deleteBill($this->charge, $this->session, $memberId); |
| 247 | 247 | return $this->page(); |