@@ -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')); |
@@ -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(); |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | private function getLatestTontine(User $user): ?Tontine |
41 | 41 | { |
42 | 42 | $tontineId = session('tontine.id', 0); |
43 | - if($tontineId > 0 && ($tontine = $user->tontines()->find($tontineId)) !== null) |
|
43 | + if ($tontineId > 0 && ($tontine = $user->tontines()->find($tontineId)) !== null) |
|
44 | 44 | { |
45 | 45 | return $tontine; |
46 | 46 | } |
47 | 47 | $tontineId = $user->properties['latest']['tontine'] ?? 0; |
48 | - if($tontineId > 0 && ($tontine = $user->tontines()->find($tontineId)) !== null) |
|
48 | + if ($tontineId > 0 && ($tontine = $user->tontines()->find($tontineId)) !== null) |
|
49 | 49 | { |
50 | 50 | return $tontine; |
51 | 51 | } |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | private function getLatestRound(Tontine $tontine): ?Round |
63 | 63 | { |
64 | 64 | $roundId = session('round.id', 0); |
65 | - if($roundId > 0 && ($round = $tontine->rounds()->find($roundId)) !== null) |
|
65 | + if ($roundId > 0 && ($round = $tontine->rounds()->find($roundId)) !== null) |
|
66 | 66 | { |
67 | 67 | return $round; |
68 | 68 | } |
69 | 69 | $roundId = $tontine->user->properties['latest']['round'] ?? 0; |
70 | - if($roundId > 0 && ($round = $tontine->rounds()->find($roundId)) !== null) |
|
70 | + if ($roundId > 0 && ($round = $tontine->rounds()->find($roundId)) !== null) |
|
71 | 71 | { |
72 | 72 | return $round; |
73 | 73 | } |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | |
91 | 91 | $tontineId = 0; |
92 | 92 | $roundId = 0; |
93 | - if(($tontine = $this->getLatestTontine($user)) !== null) |
|
93 | + if (($tontine = $this->getLatestTontine($user)) !== null) |
|
94 | 94 | { |
95 | 95 | $tontineId = $tontine->id; |
96 | 96 | $this->tenantService->setTontine($tontine); |
97 | - if(($round = $this->getLatestRound($tontine)) !== null) |
|
97 | + if (($round = $this->getLatestRound($tontine)) !== null) |
|
98 | 98 | { |
99 | 99 | $roundId = $round->id; |
100 | 100 | $this->tenantService->setRound($round); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $this->localeService->setCurrency($tontine->currency_code); |
67 | 67 | // Save as latest tontine id if it has changed. |
68 | 68 | $tontineId = $this->user->properties['latest']['tontine'] ?? 0; |
69 | - if($tontineId === $tontine->id) |
|
69 | + if ($tontineId === $tontine->id) |
|
70 | 70 | { |
71 | 71 | return; |
72 | 72 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $this->round = $round; |
86 | 86 | // Save as latest round id if it has changed. |
87 | 87 | $roundId = $this->user->properties['latest']['round'] ?? 0; |
88 | - if($roundId === $round->id) |
|
88 | + if ($roundId === $round->id) |
|
89 | 89 | { |
90 | 90 | return; |
91 | 91 | } |
@@ -152,10 +152,8 @@ discard block |
||
152 | 152 | ->orderBy('start_at', $orderAsc ? 'asc' : 'desc') |
153 | 153 | ->get(); |
154 | 154 | |
155 | - return $lastSession === null ? $sessions : |
|
156 | - $sessions->filter(function($session) use($lastSession, $withCurrent) { |
|
157 | - return $withCurrent ? $session->start_at <= $lastSession->start_at : |
|
158 | - $session->start_at < $lastSession->start_at; |
|
155 | + return $lastSession === null ? $sessions : $sessions->filter(function($session) use($lastSession, $withCurrent) { |
|
156 | + return $withCurrent ? $session->start_at <= $lastSession->start_at : $session->start_at < $lastSession->start_at; |
|
159 | 157 | }); |
160 | 158 | } |
161 | 159 | |
@@ -209,7 +207,7 @@ discard block |
||
209 | 207 | public function getPool(int $poolId, bool $with = false): ?Pool |
210 | 208 | { |
211 | 209 | $pools = $this->round->pools(); |
212 | - if($with) |
|
210 | + if ($with) |
|
213 | 211 | { |
214 | 212 | $pools->with(['subscriptions.receivables.deposit']); |
215 | 213 | } |
@@ -36,8 +36,7 @@ |
||
36 | 36 | */ |
37 | 37 | public function saveProperties(array $content) |
38 | 38 | { |
39 | - $this->property ? $this->property->update(['content' => $content]) : |
|
40 | - $this->property()->create(['content' => $content]); |
|
39 | + $this->property ? $this->property->update(['content' => $content]) : $this->property()->create(['content' => $content]); |
|
41 | 40 | // Refresh the relation; |
42 | 41 | $this->load('property'); |
43 | 42 | } |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | ->each(function($payable) use($session) { |
120 | 120 | $payable->amount = $this->balanceCalculator->getPayableAmount($payable, $session); |
121 | 121 | }); |
122 | - if(!$pool->remit_planned) |
|
122 | + if (!$pool->remit_planned) |
|
123 | 123 | { |
124 | 124 | return $payables; |
125 | 125 | } |
126 | 126 | |
127 | 127 | // When the number of remitments is planned, the list is padded to the expected number. |
128 | 128 | $remitmentCount = $this->summaryService->getSessionRemitmentCount($pool, $session); |
129 | - $emptyPayable = (object)[ |
|
129 | + $emptyPayable = (object) [ |
|
130 | 130 | 'id' => 0, |
131 | 131 | 'amount' => $pool->amount * $this->tenantService->countEnabledSessions($pool), |
132 | 132 | 'remitment' => null, |
@@ -161,18 +161,18 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public function savePlannedRemitment(Pool $pool, Session $session, int $payableId): void |
163 | 163 | { |
164 | - if(!$pool->remit_planned || $pool->remit_auction) |
|
164 | + if (!$pool->remit_planned || $pool->remit_auction) |
|
165 | 165 | { |
166 | 166 | // Only when remitments are planned and without auctions. |
167 | 167 | return; |
168 | 168 | } |
169 | 169 | // The payable is supposed to already have been associated to the session. |
170 | 170 | $payable = $this->getPayable($pool, $session, $payableId); |
171 | - if(!$payable) |
|
171 | + if (!$payable) |
|
172 | 172 | { |
173 | 173 | throw new MessageException(trans('tontine.subscription.errors.not_found')); |
174 | 174 | } |
175 | - if($payable->remitment) |
|
175 | + if ($payable->remitment) |
|
176 | 176 | { |
177 | 177 | return; |
178 | 178 | } |
@@ -199,11 +199,11 @@ discard block |
||
199 | 199 | ->whereDoesntHave('remitment') |
200 | 200 | ->whereIn('subscription_id', $pool->subscriptions()->pluck('id')) |
201 | 201 | ->find($payableId); |
202 | - if(!$payable) |
|
202 | + if (!$payable) |
|
203 | 203 | { |
204 | 204 | throw new MessageException(trans('tontine.subscription.errors.not_found')); |
205 | 205 | } |
206 | - if($payable->session_id !== null && $payable->session_id !== $session->id) |
|
206 | + if ($payable->session_id !== null && $payable->session_id !== $session->id) |
|
207 | 207 | { |
208 | 208 | // The selected member is already planned on another session. |
209 | 209 | throw new MessageException(trans('tontine.remitment.errors.planning')); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | // Create the remitment. |
217 | 217 | $remitment = $payable->remitment()->create(['amount' => $amount]); |
218 | 218 | |
219 | - if($pool->remit_auction && $auction > 0) |
|
219 | + if ($pool->remit_auction && $auction > 0) |
|
220 | 220 | { |
221 | 221 | // Create the corresponding auction. |
222 | 222 | Auction::create([ |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $payable = $this->getQuery($pool, $session) |
244 | 244 | ->with(['remitment', 'remitment.auction']) |
245 | 245 | ->find($payableId); |
246 | - if(!$payable || !($remitment = $payable->remitment)) |
|
246 | + if (!$payable || !($remitment = $payable->remitment)) |
|
247 | 247 | { |
248 | 248 | return; |
249 | 249 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | $remitment->auction()->delete(); |
254 | 254 | $remitment->delete(); |
255 | 255 | // Detach from the session, but only if the remitment was not planned. |
256 | - if(!$pool->remit_planned || $pool->remit_auction) |
|
256 | + if (!$pool->remit_planned || $pool->remit_auction) |
|
257 | 257 | { |
258 | 258 | $payable->session()->dissociate(); |
259 | 259 | $payable->save(); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | ->with(['payable', 'member']) |
279 | 279 | ->select('subscriptions.*') |
280 | 280 | ->get(); |
281 | - if($pool->remit_planned && !$pool->remit_auction) |
|
281 | + if ($pool->remit_planned && !$pool->remit_auction) |
|
282 | 282 | { |
283 | 283 | // Only the beneficiaries planned for this session. |
284 | 284 | return $subscriptions |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function getDisbursedAmounts(Collection $chargeIds, Collection $sessionIds): Collection |
113 | 113 | { |
114 | - if($chargeIds->count() === 0) |
|
114 | + if ($chargeIds->count() === 0) |
|
115 | 115 | { |
116 | 116 | return collect(); |
117 | 117 | } |
@@ -225,12 +225,12 @@ discard block |
||
225 | 225 | |
226 | 226 | $charges = $this->tenantService->tontine()->charges()->active()->get(); |
227 | 227 | $disbursements = $this->getDisbursedAmounts($charges->pluck('id'), $sessionIds); |
228 | - if($member !== null) |
|
228 | + if ($member !== null) |
|
229 | 229 | { |
230 | 230 | // The disbursement part of each member id calculated by dividing each amount |
231 | 231 | // by the number of members. |
232 | 232 | $memberCount = $this->memberService->countActiveMembers(); |
233 | - foreach($disbursements as $disbursement) |
|
233 | + foreach ($disbursements as $disbursement) |
|
234 | 234 | { |
235 | 235 | $disbursement->total_amount /= $memberCount; |
236 | 236 | } |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | ->groupBy('debts.type') |
259 | 259 | ->pluck('total_amount', 'type'); |
260 | 260 | |
261 | - return (object)[ |
|
261 | + return (object) [ |
|
262 | 262 | 'principal' => $loan[Debt::TYPE_PRINCIPAL] ?? 0, |
263 | 263 | 'interest' => $loan[Debt::TYPE_INTEREST] ?? 0, |
264 | 264 | ]; |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | ->groupBy('debts.type') |
284 | 284 | ->pluck('total_amount', 'type'); |
285 | 285 | |
286 | - return (object)[ |
|
286 | + return (object) [ |
|
287 | 287 | 'principal' => ($refund[Debt::TYPE_PRINCIPAL] ?? 0) + |
288 | 288 | ($partialRefund[Debt::TYPE_PRINCIPAL] ?? 0), |
289 | 289 | 'interest' => ($refund[Debt::TYPE_INTEREST] ?? 0) + |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | ->select(DB::raw('sum(amount) as total_amount'), DB::raw('count(id) as total_count')) |
303 | 303 | ->where('session_id', $session->id) |
304 | 304 | ->first(); |
305 | - if(!$saving->total_amount) |
|
305 | + if (!$saving->total_amount) |
|
306 | 306 | { |
307 | 307 | $saving->total_amount = 0; |
308 | 308 | } |
309 | - if(!$saving->total_count) |
|
309 | + if (!$saving->total_count) |
|
310 | 310 | { |
311 | 311 | $saving->total_count = 0; |
312 | 312 | } |
@@ -325,11 +325,11 @@ discard block |
||
325 | 325 | ->select(DB::raw('sum(amount) as total_amount'), DB::raw('count(id) as total_count')) |
326 | 326 | ->where('session_id', $session->id) |
327 | 327 | ->first(); |
328 | - if(!$disbursement->total_amount) |
|
328 | + if (!$disbursement->total_amount) |
|
329 | 329 | { |
330 | 330 | $disbursement->total_amount = 0; |
331 | 331 | } |
332 | - if(!$disbursement->total_count) |
|
332 | + if (!$disbursement->total_count) |
|
333 | 333 | { |
334 | 334 | $disbursement->total_count = 0; |
335 | 335 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | $fund = $values['fund_id'] === 0 ? null : |
112 | 112 | $this->fundService->getFund($values['fund_id']); |
113 | 113 | $member = $this->getMember($values['member']); |
114 | - if(!$member) |
|
114 | + if (!$member) |
|
115 | 115 | { |
116 | 116 | throw new MessageException(trans('tontine.member.errors.not_found')); |
117 | 117 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $saving->amount = $values['amount']; |
121 | 121 | $saving->member()->associate($member); |
122 | 122 | $saving->session()->associate($session); |
123 | - if($fund !== null) |
|
123 | + if ($fund !== null) |
|
124 | 124 | { |
125 | 125 | $saving->fund()->associate($fund); |
126 | 126 | } |
@@ -140,19 +140,19 @@ discard block |
||
140 | 140 | $fund = $values['fund_id'] === 0 ? null : |
141 | 141 | $this->fundService->getFund($values['fund_id']); |
142 | 142 | $member = $this->getMember($values['member']); |
143 | - if(!$member) |
|
143 | + if (!$member) |
|
144 | 144 | { |
145 | 145 | throw new MessageException(trans('tontine.member.errors.not_found')); |
146 | 146 | } |
147 | 147 | $saving = $session->savings()->find($savingId); |
148 | - if(!$saving) |
|
148 | + if (!$saving) |
|
149 | 149 | { |
150 | 150 | throw new MessageException(trans('meeting.saving.errors.not_found')); |
151 | 151 | } |
152 | 152 | |
153 | 153 | $saving->amount = $values['amount']; |
154 | 154 | $saving->member()->associate($member); |
155 | - if($fund !== null) |
|
155 | + if ($fund !== null) |
|
156 | 156 | { |
157 | 157 | $saving->fund()->associate($fund); |
158 | 158 | } |
@@ -219,10 +219,10 @@ discard block |
||
219 | 219 | { |
220 | 220 | $tontine = $this->tenantService->tontine(); |
221 | 221 | $properties = $tontine->properties; |
222 | - if(isset($properties['closings'][$session->id][$fundId])) |
|
222 | + if (isset($properties['closings'][$session->id][$fundId])) |
|
223 | 223 | { |
224 | 224 | unset($properties['closings'][$session->id][$fundId]); |
225 | - if(count($properties['closings'][$session->id]) == 0) |
|
225 | + if (count($properties['closings'][$session->id]) == 0) |
|
226 | 226 | { |
227 | 227 | unset($properties['closings'][$session->id]); |
228 | 228 | } |
@@ -155,8 +155,7 @@ |
||
155 | 155 | if($fund !== null) |
156 | 156 | { |
157 | 157 | $saving->fund()->associate($fund); |
158 | - } |
|
159 | - else |
|
158 | + } else |
|
160 | 159 | { |
161 | 160 | $saving->fund()->dissociate(); |
162 | 161 | } |