@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | // The number of active members is saved in the round, so its current |
102 | 102 | // value can be retrieved forever, even when the membership will change. |
103 | 103 | $round = $this->tenantService->round(); |
104 | - if(!isset($round->properties['members'])) |
|
104 | + if (!isset($round->properties['members'])) |
|
105 | 105 | { |
106 | 106 | // Create and save the property with the content |
107 | 107 | $this->saveActiveMembers(); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $tontine = $this->tenantService->tontine(); |
145 | 145 | $members = $tontine->members()->createMany($values); |
146 | 146 | // Create members bills |
147 | - foreach($members as $member) |
|
147 | + foreach ($members as $member) |
|
148 | 148 | { |
149 | 149 | $this->memberCreated($tontine, $member); |
150 | 150 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | ->withCount('receivables') |
161 | 161 | ->get() |
162 | 162 | ->sortBy('receivables_count'); |
163 | - if($subscriptions->count() === 0) |
|
163 | + if ($subscriptions->count() === 0) |
|
164 | 164 | { |
165 | 165 | throw new MessageException(trans('tontine.subscription.errors.not_found')); |
166 | 166 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function unsetPayableSession(Subscription $subscription) |
211 | 211 | { |
212 | - if(($subscription->payable->session_id)) |
|
212 | + if (($subscription->payable->session_id)) |
|
213 | 213 | { |
214 | 214 | $subscription->payable->session()->dissociate(); |
215 | 215 | $subscription->payable->save(); |
@@ -232,10 +232,10 @@ discard block |
||
232 | 232 | $session = $this->tenantService->getSession($sessionId); |
233 | 233 | $currSubscription = null; |
234 | 234 | $nextSubscription = null; |
235 | - if($currSubscriptionId > 0) |
|
235 | + if ($currSubscriptionId > 0) |
|
236 | 236 | { |
237 | 237 | $currSubscription = $pool->subscriptions()->with('payable')->find($currSubscriptionId); |
238 | - if(($currSubscription !== null && $currSubscription->payable !== null && |
|
238 | + if (($currSubscription !== null && $currSubscription->payable !== null && |
|
239 | 239 | $currSubscription->payable->remitment !== null) || $session->closed) |
240 | 240 | { |
241 | 241 | // Can't chage the beneficiary if the session is closed or if |
@@ -243,19 +243,19 @@ discard block |
||
243 | 243 | return false; |
244 | 244 | } |
245 | 245 | } |
246 | - if($nextSubscriptionId > 0) |
|
246 | + if ($nextSubscriptionId > 0) |
|
247 | 247 | { |
248 | 248 | $nextSubscription = $pool->subscriptions()->with('payable')->find($nextSubscriptionId); |
249 | 249 | } |
250 | 250 | |
251 | 251 | DB::transaction(function() use($session, $currSubscription, $nextSubscription) { |
252 | 252 | // If the beneficiary already has a session assigned, first remove it. |
253 | - if($currSubscription !== null) |
|
253 | + if ($currSubscription !== null) |
|
254 | 254 | { |
255 | 255 | $this->unsetPayableSession($currSubscription); |
256 | 256 | } |
257 | 257 | // If there is a new session assigned to the beneficiary, then save it. |
258 | - if($nextSubscription !== null) |
|
258 | + if ($nextSubscription !== null) |
|
259 | 259 | { |
260 | 260 | $this->setPayableSession($nextSubscription, $session); |
261 | 261 | } |
@@ -22,8 +22,7 @@ |
||
22 | 22 | $page = $this->browser->createPage(); |
23 | 23 | $page->setHtml($html); |
24 | 24 | return $page->pdf($config)->getBase64(); |
25 | - } |
|
26 | - finally |
|
25 | + } finally |
|
27 | 26 | { |
28 | 27 | $this->browser->close(); |
29 | 28 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | $config = [ |
24 | 24 | ...$this->config, |
25 | 25 | ...$config, |
26 | - 'headerTemplate' => (string)view("$templatePath.tpl.header"), |
|
27 | - 'footerTemplate' => (string)view("$templatePath.tpl.footer"), |
|
26 | + 'headerTemplate' => (string) view("$templatePath.tpl.header"), |
|
27 | + 'footerTemplate' => (string) view("$templatePath.tpl.footer"), |
|
28 | 28 | ]; |
29 | - return GeneratorFacade::getPdf((string)view($templatePath), $config); |
|
29 | + return GeneratorFacade::getPdf((string) view($templatePath), $config); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -20,7 +20,7 @@ |
||
20 | 20 | 'reports.template' => 'required|string|in:default,raptor', |
21 | 21 | ]); |
22 | 22 | |
23 | - if($validator->fails()) |
|
23 | + if ($validator->fails()) |
|
24 | 24 | { |
25 | 25 | throw new ValidationException($validator); |
26 | 26 | } |
@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | $this->response->html('section-title', trans('tontine.menus.tontines')); |
62 | 62 | $this->response->html('content-home', $this->render('pages.tontine.home')); |
63 | 63 | |
64 | - if(($tontine = $this->tenantService->tontine())) |
|
64 | + if (($tontine = $this->tenantService->tontine())) |
|
65 | 65 | { |
66 | 66 | $this->selectTontine($tontine); |
67 | 67 | } |
68 | - if(($round = $this->tenantService->round())) |
|
68 | + if (($round = $this->tenantService->round())) |
|
69 | 69 | { |
70 | 70 | $this->selectRound($round); |
71 | 71 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | 'title' => trans('common.actions.cancel'), |
117 | 117 | 'class' => 'btn btn-tertiary', |
118 | 118 | 'click' => 'close', |
119 | - ],[ |
|
119 | + ], [ |
|
120 | 120 | 'title' => trans('common.actions.save'), |
121 | 121 | 'class' => 'btn btn-primary', |
122 | 122 | 'click' => $this->rq()->create(pm()->form('tontine-form')), |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'title' => trans('common.actions.cancel'), |
163 | 163 | 'class' => 'btn btn-tertiary', |
164 | 164 | 'click' => 'close', |
165 | - ],[ |
|
165 | + ], [ |
|
166 | 166 | 'title' => trans('common.actions.save'), |
167 | 167 | 'class' => 'btn btn-primary', |
168 | 168 | 'click' => $this->rq()->update($tontine->id, pm()->form('tontine-form')), |
@@ -48,7 +48,7 @@ |
||
48 | 48 | 'title' => trans('common.actions.cancel'), |
49 | 49 | 'class' => 'btn btn-tertiary', |
50 | 50 | 'click' => 'close', |
51 | - ],[ |
|
51 | + ], [ |
|
52 | 52 | 'title' => trans('common.actions.save'), |
53 | 53 | 'class' => 'btn btn-primary', |
54 | 54 | 'click' => $this->rq()->saveOptions(pm()->form('options-form')), |
@@ -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->render('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'); |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | // Don't show the page if there is no session or no member. |
35 | 35 | $sessions = $this->tenantService->getSessions(orderAsc: false) |
36 | 36 | ->filter(fn($session) => $session->opened || $session->closed); |
37 | - if($sessions->count() === 0) |
|
37 | + if ($sessions->count() === 0) |
|
38 | 38 | { |
39 | 39 | return $this->response; |
40 | 40 | } |
41 | 41 | $members = $this->tontineService->getMembers(); |
42 | - if($members->count() === 0) |
|
42 | + if ($members->count() === 0) |
|
43 | 43 | { |
44 | 44 | return $this->response; |
45 | 45 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | public function showSession(int $sessionId) |
81 | 81 | { |
82 | - if(!($session = $this->tenantService->getSession($sessionId))) |
|
82 | + if (!($session = $this->tenantService->getSession($sessionId))) |
|
83 | 83 | { |
84 | 84 | return $this->response; |
85 | 85 | } |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | |
90 | 90 | public function showMember(int $sessionId, int $memberId) |
91 | 91 | { |
92 | - if(!($session = $this->tenantService->getSession($sessionId))) |
|
92 | + if (!($session = $this->tenantService->getSession($sessionId))) |
|
93 | 93 | { |
94 | 94 | return $this->response; |
95 | 95 | } |
96 | - if(!($member = $this->tontineService->getMember($memberId))) |
|
96 | + if (!($member = $this->tontineService->getMember($memberId))) |
|
97 | 97 | { |
98 | 98 | return $this->response; |
99 | 99 | } |