@@ -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 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @return Builder|Relation |
| 40 | 40 | */ |
| 41 | - private function getSavingQuery(Session $session, int $fundId): Builder|Relation |
|
| 41 | + private function getSavingQuery(Session $session, int $fundId): Builder | Relation |
|
| 42 | 42 | { |
| 43 | 43 | // $fundId < 0 => all the savings |
| 44 | 44 | // $fundId === 0 => savings of the default fund |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $saving->amount = $amount; |
| 143 | 143 | $saving->member()->associate($member); |
| 144 | 144 | $saving->session()->associate($session); |
| 145 | - if($fund !== null) |
|
| 145 | + if ($fund !== null) |
|
| 146 | 146 | { |
| 147 | 147 | $saving->fund()->associate($fund); |
| 148 | 148 | } |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | */ |
| 164 | 164 | public function createSaving(Session $session, array $values): void |
| 165 | 165 | { |
| 166 | - if(!($member = $this->memberService->getMember($values['member']))) |
|
| 166 | + if (!($member = $this->memberService->getMember($values['member']))) |
|
| 167 | 167 | { |
| 168 | 168 | throw new MessageException(trans('tontine.member.errors.not_found')); |
| 169 | 169 | } |
@@ -184,12 +184,12 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public function updateSaving(Session $session, int $savingId, array $values): void |
| 186 | 186 | { |
| 187 | - if(!($member = $this->memberService->getMember($values['member']))) |
|
| 187 | + if (!($member = $this->memberService->getMember($values['member']))) |
|
| 188 | 188 | { |
| 189 | 189 | throw new MessageException(trans('tontine.member.errors.not_found')); |
| 190 | 190 | } |
| 191 | 191 | $saving = $session->savings()->find($savingId); |
| 192 | - if(!$saving) |
|
| 192 | + if (!$saving) |
|
| 193 | 193 | { |
| 194 | 194 | throw new MessageException(trans('meeting.saving.errors.not_found')); |
| 195 | 195 | } |
@@ -210,13 +210,13 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | public function saveSaving(Session $session, int $fundId, int $memberId, int $amount): void |
| 212 | 212 | { |
| 213 | - if(!($member = $this->memberService->getMember($memberId))) |
|
| 213 | + if (!($member = $this->memberService->getMember($memberId))) |
|
| 214 | 214 | { |
| 215 | 215 | throw new MessageException(trans('tontine.member.errors.not_found')); |
| 216 | 216 | } |
| 217 | 217 | $fund = !$fundId ? null : $this->fundService->getFund($fundId); |
| 218 | 218 | $saving = $this->findSaving($session, !$fund ? 0 : $fund->id, $member->id); |
| 219 | - if(!$saving) |
|
| 219 | + if (!$saving) |
|
| 220 | 220 | { |
| 221 | 221 | $saving = new Saving(); |
| 222 | 222 | } |
@@ -236,8 +236,7 @@ discard block |
||
| 236 | 236 | public function deleteSaving(Session $session, int $savingId, int $memberId = 0): void |
| 237 | 237 | { |
| 238 | 238 | $savingId > 0 ? |
| 239 | - $session->savings()->where('id', $savingId)->delete() : |
|
| 240 | - $session->savings()->where('member_id', $memberId)->delete(); |
|
| 239 | + $session->savings()->where('id', $savingId)->delete() : $session->savings()->where('member_id', $memberId)->delete(); |
|
| 241 | 240 | } |
| 242 | 241 | |
| 243 | 242 | /** |
@@ -254,8 +253,7 @@ discard block |
||
| 254 | 253 | $query->where('session_id', $session->id) |
| 255 | 254 | ->where(function(Builder $query) use($fundId) { |
| 256 | 255 | $fundId > 0 ? |
| 257 | - $query->where('fund_id', $fundId) : |
|
| 258 | - $query->whereNull('fund_id'); |
|
| 256 | + $query->where('fund_id', $fundId) : $query->whereNull('fund_id'); |
|
| 259 | 257 | }); |
| 260 | 258 | }; |
| 261 | 259 | } |
@@ -269,7 +267,7 @@ discard block |
||
| 269 | 267 | * @return Builder|Relation |
| 270 | 268 | */ |
| 271 | 269 | private function getMembersQuery(Session $session, int $fundId, |
| 272 | - string $search, ?bool $filter): Builder|Relation |
|
| 270 | + string $search, ?bool $filter): Builder | Relation |
|
| 273 | 271 | { |
| 274 | 272 | $savingsFilter = $this->getMemberSavingsFilter($session, $fundId); |
| 275 | 273 | return $this->tenantService->tontine()->members()->active() |
@@ -393,10 +391,10 @@ discard block |
||
| 393 | 391 | { |
| 394 | 392 | $tontine = $this->tenantService->tontine(); |
| 395 | 393 | $properties = $tontine->properties; |
| 396 | - if(isset($properties['closings'][$session->id][$fundId])) |
|
| 394 | + if (isset($properties['closings'][$session->id][$fundId])) |
|
| 397 | 395 | { |
| 398 | 396 | unset($properties['closings'][$session->id][$fundId]); |
| 399 | - if(count($properties['closings'][$session->id]) == 0) |
|
| 397 | + if (count($properties['closings'][$session->id]) == 0) |
|
| 400 | 398 | { |
| 401 | 399 | unset($properties['closings'][$session->id]); |
| 402 | 400 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function getReceivableAmount(Receivable $receivable): int |
| 37 | 37 | { |
| 38 | - if($receivable->subscription->pool->deposit_fixed) |
|
| 38 | + if ($receivable->subscription->pool->deposit_fixed) |
|
| 39 | 39 | { |
| 40 | 40 | return $receivable->subscription->pool->amount; |
| 41 | 41 | } |
@@ -86,8 +86,7 @@ discard block |
||
| 86 | 86 | ->where('receivables.session_id', $session->id) |
| 87 | 87 | ->where('subscriptions.pool_id', $pool->id); |
| 88 | 88 | |
| 89 | - return !$pool->deposit_fixed ? $query->sum('deposits.amount') : |
|
| 90 | - $pool->amount * $query->count(); |
|
| 89 | + return !$pool->deposit_fixed ? $query->sum('deposits.amount') : $pool->amount * $query->count(); |
|
| 91 | 90 | } |
| 92 | 91 | |
| 93 | 92 | /** |
@@ -98,7 +97,7 @@ discard block |
||
| 98 | 97 | */ |
| 99 | 98 | public function getPayableAmount(Pool $pool, Session $session): int |
| 100 | 99 | { |
| 101 | - if(!$pool->deposit_fixed) |
|
| 100 | + if (!$pool->deposit_fixed) |
|
| 102 | 101 | { |
| 103 | 102 | // Sum the amounts for all deposits |
| 104 | 103 | return $this->getPoolDepositAmount($pool, $session); |
@@ -122,7 +121,7 @@ discard block |
||
| 122 | 121 | */ |
| 123 | 122 | public function getPoolRemitmentAmount(Pool $pool, Session $session): int |
| 124 | 123 | { |
| 125 | - if(!$pool->deposit_fixed) |
|
| 124 | + if (!$pool->deposit_fixed) |
|
| 126 | 125 | { |
| 127 | 126 | // Sum the amounts for all deposits |
| 128 | 127 | return $this->getPoolDepositAmount($pool, $session); |
@@ -282,7 +281,7 @@ discard block |
||
| 282 | 281 | ->join('debts', 'partial_refunds.debt_id', '=', 'debts.id') |
| 283 | 282 | ->join('loans', 'debts.loan_id', '=', 'loans.id') |
| 284 | 283 | ->whereIn('partial_refunds.session_id', $sessionIds) |
| 285 | - ->whereNotExists(function (Builder $query) { |
|
| 284 | + ->whereNotExists(function(Builder $query) { |
|
| 286 | 285 | $query->select(DB::raw(1))->from('refunds') |
| 287 | 286 | ->whereColumn('refunds.debt_id', 'debts.id'); |
| 288 | 287 | }) |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * |
| 49 | 49 | * @return Builder|Relation |
| 50 | 50 | */ |
| 51 | - public function getQuery(Pool $pool, string $search, ?bool $filter): Builder|Relation |
|
| 51 | + public function getQuery(Pool $pool, string $search, ?bool $filter): Builder | Relation |
|
| 52 | 52 | { |
| 53 | 53 | return $this->tenantService->tontine()->members()->active() |
| 54 | 54 | ->when($filter === true, function(Builder $query) use($pool) { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | ->withCount('receivables') |
| 157 | 157 | ->get() |
| 158 | 158 | ->sortBy('receivables_count'); |
| 159 | - if($subscriptions->count() === 0) |
|
| 159 | + if ($subscriptions->count() === 0) |
|
| 160 | 160 | { |
| 161 | 161 | throw new MessageException(trans('tontine.subscription.errors.not_found')); |
| 162 | 162 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | */ |
| 206 | 206 | public function unsetPayableSession(Subscription $subscription) |
| 207 | 207 | { |
| 208 | - if(($subscription->payable->session_id)) |
|
| 208 | + if (($subscription->payable->session_id)) |
|
| 209 | 209 | { |
| 210 | 210 | $subscription->payable->session()->dissociate(); |
| 211 | 211 | $subscription->payable->save(); |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | private function canChangeBeneficiary(Session $session, ?Subscription $subscription): bool |
| 222 | 222 | { |
| 223 | 223 | // Can't change the beneficiary if the session is closed, |
| 224 | - if($session->closed) |
|
| 224 | + if ($session->closed) |
|
| 225 | 225 | { |
| 226 | 226 | return false; |
| 227 | 227 | } |
@@ -246,17 +246,17 @@ discard block |
||
| 246 | 246 | $session = $pool->sessions()->find($sessionId); |
| 247 | 247 | $currSubscription = null; |
| 248 | 248 | $nextSubscription = null; |
| 249 | - if($currSubscriptionId > 0) |
|
| 249 | + if ($currSubscriptionId > 0) |
|
| 250 | 250 | { |
| 251 | 251 | $currSubscription = $pool->subscriptions() |
| 252 | 252 | ->with('payable') |
| 253 | 253 | ->find($currSubscriptionId); |
| 254 | - if(!$this->canChangeBeneficiary($session, $currSubscription)) |
|
| 254 | + if (!$this->canChangeBeneficiary($session, $currSubscription)) |
|
| 255 | 255 | { |
| 256 | 256 | return false; |
| 257 | 257 | } |
| 258 | 258 | } |
| 259 | - if($nextSubscriptionId > 0) |
|
| 259 | + if ($nextSubscriptionId > 0) |
|
| 260 | 260 | { |
| 261 | 261 | $nextSubscription = $pool->subscriptions() |
| 262 | 262 | ->with('payable') |
@@ -265,12 +265,12 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | DB::transaction(function() use($session, $currSubscription, $nextSubscription) { |
| 267 | 267 | // If the beneficiary already has a session assigned, first remove it. |
| 268 | - if($currSubscription !== null) |
|
| 268 | + if ($currSubscription !== null) |
|
| 269 | 269 | { |
| 270 | 270 | $this->unsetPayableSession($currSubscription); |
| 271 | 271 | } |
| 272 | 272 | // If there is a new session assigned to the beneficiary, then save it. |
| 273 | - if($nextSubscription !== null) |
|
| 273 | + if ($nextSubscription !== null) |
|
| 274 | 274 | { |
| 275 | 275 | $this->setPayableSession($nextSubscription, $session); |
| 276 | 276 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @return Builder|Relation |
| 31 | 31 | */ |
| 32 | - private function getQuery(Pool $pool, Session $session): Builder|Relation |
|
| 32 | + private function getQuery(Pool $pool, Session $session): Builder | Relation |
|
| 33 | 33 | { |
| 34 | 34 | return $session->receivables() |
| 35 | 35 | ->select('receivables.*') |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | public function createDeposit(Pool $pool, Session $session, int $receivableId): void |
| 101 | 101 | { |
| 102 | 102 | $receivable = $this->getReceivable($pool, $session, $receivableId); |
| 103 | - if(!$receivable || $receivable->deposit || !$pool->deposit_fixed) |
|
| 103 | + if (!$receivable || $receivable->deposit || !$pool->deposit_fixed) |
|
| 104 | 104 | { |
| 105 | 105 | throw new MessageException(trans('tontine.subscription.errors.not_found')); |
| 106 | 106 | } |
@@ -124,14 +124,14 @@ discard block |
||
| 124 | 124 | public function saveDepositAmount(Pool $pool, Session $session, int $receivableId, int $amount): void |
| 125 | 125 | { |
| 126 | 126 | $receivable = $this->getReceivable($pool, $session, $receivableId); |
| 127 | - if(!$receivable || $pool->deposit_fixed) |
|
| 127 | + if (!$receivable || $pool->deposit_fixed) |
|
| 128 | 128 | { |
| 129 | 129 | throw new MessageException(trans('tontine.subscription.errors.not_found')); |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - if($receivable->deposit !== null) |
|
| 132 | + if ($receivable->deposit !== null) |
|
| 133 | 133 | { |
| 134 | - if((!$receivable->deposit->editable)) |
|
| 134 | + if ((!$receivable->deposit->editable)) |
|
| 135 | 135 | { |
| 136 | 136 | throw new MessageException(trans('tontine.errors.editable')); |
| 137 | 137 | } |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | public function deleteDeposit(Pool $pool, Session $session, int $receivableId): void |
| 161 | 161 | { |
| 162 | 162 | $receivable = $this->getReceivable($pool, $session, $receivableId); |
| 163 | - if(!$receivable || !$receivable->deposit) |
|
| 163 | + if (!$receivable || !$receivable->deposit) |
|
| 164 | 164 | { |
| 165 | 165 | throw new MessageException(trans('tontine.subscription.errors.not_found')); |
| 166 | 166 | } |
| 167 | - if((!$receivable->deposit->editable)) |
|
| 167 | + if ((!$receivable->deposit->editable)) |
|
| 168 | 168 | { |
| 169 | 169 | throw new MessageException(trans('tontine.errors.editable')); |
| 170 | 170 | } |
@@ -182,13 +182,13 @@ discard block |
||
| 182 | 182 | public function createAllDeposits(Pool $pool, Session $session): void |
| 183 | 183 | { |
| 184 | 184 | $receivables = $this->getQuery($pool, $session)->whereDoesntHave('deposit')->get(); |
| 185 | - if($receivables->count() === 0) |
|
| 185 | + if ($receivables->count() === 0) |
|
| 186 | 186 | { |
| 187 | 187 | return; |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | DB::transaction(function() use($session, $receivables) { |
| 191 | - foreach($receivables as $receivable) |
|
| 191 | + foreach ($receivables as $receivable) |
|
| 192 | 192 | { |
| 193 | 193 | $deposit = new Deposit(); |
| 194 | 194 | $deposit->receivable()->associate($receivable); |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | ->filter(function($receivable) { |
| 216 | 216 | return $receivable->deposit->editable; |
| 217 | 217 | }); |
| 218 | - if($receivables->count() === 0) |
|
| 218 | + if ($receivables->count() === 0) |
|
| 219 | 219 | { |
| 220 | 220 | return; |
| 221 | 221 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * |
| 40 | 40 | * @return Builder|Relation |
| 41 | 41 | */ |
| 42 | - private function getQuery(Pool $pool, Session $session): Builder|Relation |
|
| 42 | + private function getQuery(Pool $pool, Session $session): Builder | Relation |
|
| 43 | 43 | { |
| 44 | 44 | return $session->payables() |
| 45 | 45 | ->select('payables.*') |
@@ -79,14 +79,14 @@ discard block |
||
| 79 | 79 | ->each(function($payable) use($amount) { |
| 80 | 80 | $payable->amount = $amount; |
| 81 | 81 | }); |
| 82 | - if(!$pool->remit_planned) |
|
| 82 | + if (!$pool->remit_planned) |
|
| 83 | 83 | { |
| 84 | 84 | return $payables; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | // When the number of remitments is planned, the list is padded to the expected number. |
| 88 | 88 | $remitmentCount = $this->summaryService->getSessionRemitmentCount($pool, $session); |
| 89 | - $emptyPayable = (object)[ |
|
| 89 | + $emptyPayable = (object) [ |
|
| 90 | 90 | 'id' => 0, |
| 91 | 91 | 'member' =>trans('tontine.remitment.labels.not-assigned'), |
| 92 | 92 | 'amount' => $amount, |
@@ -122,18 +122,18 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function savePlannedRemitment(Pool $pool, Session $session, int $payableId): void |
| 124 | 124 | { |
| 125 | - if(!$pool->remit_planned || $pool->remit_auction) |
|
| 125 | + if (!$pool->remit_planned || $pool->remit_auction) |
|
| 126 | 126 | { |
| 127 | 127 | // Only when remitments are planned and without auctions. |
| 128 | 128 | return; |
| 129 | 129 | } |
| 130 | 130 | // The payable is supposed to already have been associated to the session. |
| 131 | 131 | $payable = $this->getPayable($pool, $session, $payableId); |
| 132 | - if(!$payable) |
|
| 132 | + if (!$payable) |
|
| 133 | 133 | { |
| 134 | 134 | throw new MessageException(trans('tontine.subscription.errors.not_found')); |
| 135 | 135 | } |
| 136 | - if($payable->remitment) |
|
| 136 | + if ($payable->remitment) |
|
| 137 | 137 | { |
| 138 | 138 | return; |
| 139 | 139 | } |
@@ -158,11 +158,11 @@ discard block |
||
| 158 | 158 | ->whereDoesntHave('remitment') |
| 159 | 159 | ->whereIn('subscription_id', $pool->subscriptions()->pluck('id')) |
| 160 | 160 | ->find($payableId); |
| 161 | - if(!$payable) |
|
| 161 | + if (!$payable) |
|
| 162 | 162 | { |
| 163 | 163 | throw new MessageException(trans('tontine.subscription.errors.not_found')); |
| 164 | 164 | } |
| 165 | - if($payable->session_id !== null && $payable->session_id !== $session->id) |
|
| 165 | + if ($payable->session_id !== null && $payable->session_id !== $session->id) |
|
| 166 | 166 | { |
| 167 | 167 | // The selected member is already planned on another session. |
| 168 | 168 | throw new MessageException(trans('tontine.remitment.errors.planning')); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | // Create the remitment. |
| 176 | 176 | $remitment = $payable->remitment()->create([]); |
| 177 | 177 | |
| 178 | - if($pool->remit_auction && $auction > 0) |
|
| 178 | + if ($pool->remit_auction && $auction > 0) |
|
| 179 | 179 | { |
| 180 | 180 | // Create the corresponding auction. |
| 181 | 181 | Auction::create([ |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $payable = $this->getQuery($pool, $session) |
| 203 | 203 | ->with(['remitment', 'remitment.auction']) |
| 204 | 204 | ->find($payableId); |
| 205 | - if(!$payable || !($remitment = $payable->remitment)) |
|
| 205 | + if (!$payable || !($remitment = $payable->remitment)) |
|
| 206 | 206 | { |
| 207 | 207 | return; |
| 208 | 208 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $remitment->auction()->delete(); |
| 213 | 213 | $remitment->delete(); |
| 214 | 214 | // Detach from the session, but only if the remitment was not planned. |
| 215 | - if(!$pool->remit_planned || $pool->remit_auction) |
|
| 215 | + if (!$pool->remit_planned || $pool->remit_auction) |
|
| 216 | 216 | { |
| 217 | 217 | $payable->session()->dissociate(); |
| 218 | 218 | $payable->save(); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | ->with(['payable', 'member']) |
| 238 | 238 | ->select('subscriptions.*') |
| 239 | 239 | ->get(); |
| 240 | - if($pool->remit_planned && !$pool->remit_auction) |
|
| 240 | + if ($pool->remit_planned && !$pool->remit_auction) |
|
| 241 | 241 | { |
| 242 | 242 | // Only the beneficiaries that are not yet planned. |
| 243 | 243 | return $subscriptions |
@@ -34,13 +34,13 @@ |
||
| 34 | 34 | 'amount' => 'required|regex:/^\d+(\.\d{1,2})?$/', |
| 35 | 35 | 'fund' => 'required|integer|min:0', |
| 36 | 36 | ]); |
| 37 | - if($validator->fails()) |
|
| 37 | + if ($validator->fails()) |
|
| 38 | 38 | { |
| 39 | 39 | throw new ValidationException($validator); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | $validated = $validator->validated(); |
| 43 | - $validated['amount'] = $this->localeService->convertMoneyToInt((float)$validated['amount']); |
|
| 43 | + $validated['amount'] = $this->localeService->convertMoneyToInt((float) $validated['amount']); |
|
| 44 | 44 | return $validated; |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | 'title' => trans('common.actions.close'), |
| 38 | 38 | 'class' => 'btn btn-tertiary', |
| 39 | 39 | 'click' => 'close', |
| 40 | - ],[ |
|
| 40 | + ], [ |
|
| 41 | 41 | 'title' => trans('common.actions.save'), |
| 42 | 42 | 'class' => 'btn btn-primary', |
| 43 | 43 | 'click' => $this->rq()->saveTontine(pm()->select('tontine_id')->toInt()), |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function saveTontine(int $tontineId) |
| 54 | 54 | { |
| 55 | - if(!($tontine = $this->tontineService->getTontine($tontineId))) |
|
| 55 | + if (!($tontine = $this->tontineService->getTontine($tontineId))) |
|
| 56 | 56 | { |
| 57 | 57 | return $this->response; |
| 58 | 58 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $this->selectTontine($tontine); |
| 64 | 64 | |
| 65 | - if($tontine->rounds->count() === 0) |
|
| 65 | + if ($tontine->rounds->count() === 0) |
|
| 66 | 66 | { |
| 67 | 67 | $this->dialog->hide(); |
| 68 | 68 | $this->notify->info(trans('tontine.messages.selected', ['tontine' => $tontine->name])); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public function showRounds() |
| 77 | 77 | { |
| 78 | - if(!($tontine = $this->tenantService->tontine())) |
|
| 78 | + if (!($tontine = $this->tenantService->tontine())) |
|
| 79 | 79 | { |
| 80 | 80 | return $this->response; |
| 81 | 81 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | 'title' => trans('common.actions.close'), |
| 87 | 87 | 'class' => 'btn btn-tertiary', |
| 88 | 88 | 'click' => 'close', |
| 89 | - ],[ |
|
| 89 | + ], [ |
|
| 90 | 90 | 'title' => trans('common.actions.save'), |
| 91 | 91 | 'class' => 'btn btn-primary', |
| 92 | 92 | 'click' => $this->rq()->saveRound(pm()->select('round_id')->toInt()), |
@@ -101,11 +101,11 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | public function saveRound(int $roundId) |
| 103 | 103 | { |
| 104 | - if(!($tontine = $this->tenantService->tontine())) |
|
| 104 | + if (!($tontine = $this->tenantService->tontine())) |
|
| 105 | 105 | { |
| 106 | 106 | return $this->response; |
| 107 | 107 | } |
| 108 | - if(!($round = $this->roundService->getRound($roundId))) |
|
| 108 | + if (!($round = $this->roundService->getRound($roundId))) |
|
| 109 | 109 | { |
| 110 | 110 | return $this->response; |
| 111 | 111 | } |
@@ -46,9 +46,8 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | protected function getFundId() |
| 48 | 48 | { |
| 49 | - $this->fundId = (int)($this->target()->method() === 'home' ? |
|
| 50 | - $this->target()->args()[0] : |
|
| 51 | - $this->bag('meeting.saving')->get('fund.id', 0)); |
|
| 49 | + $this->fundId = (int) ($this->target()->method() === 'home' ? |
|
| 50 | + $this->target()->args()[0] : $this->bag('meeting.saving')->get('fund.id', 0)); |
|
| 52 | 51 | } |
| 53 | 52 | |
| 54 | 53 | /** |
@@ -137,7 +136,7 @@ discard block |
||
| 137 | 136 | */ |
| 138 | 137 | public function editSaving(int $memberId) |
| 139 | 138 | { |
| 140 | - if($this->session->closed) |
|
| 139 | + if ($this->session->closed) |
|
| 141 | 140 | { |
| 142 | 141 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 143 | 142 | return $this->response; |
@@ -170,14 +169,14 @@ discard block |
||
| 170 | 169 | */ |
| 171 | 170 | public function saveSaving(int $memberId, string $amount) |
| 172 | 171 | { |
| 173 | - if($this->session->closed) |
|
| 172 | + if ($this->session->closed) |
|
| 174 | 173 | { |
| 175 | 174 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 176 | 175 | return $this->response; |
| 177 | 176 | } |
| 178 | 177 | |
| 179 | 178 | $amount = str_replace(',', '.', trim($amount)); |
| 180 | - if($amount === '') |
|
| 179 | + if ($amount === '') |
|
| 181 | 180 | { |
| 182 | 181 | $this->savingService->deleteSaving($this->session, 0, $memberId); |
| 183 | 182 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | { |
| 49 | 49 | $html = $this->render('pages.meeting.saving.home', [ |
| 50 | 50 | 'session' => $this->session, |
| 51 | - 'fundId' => (int)$this->bag('meeting.saving')->get('fund.id', -1), |
|
| 51 | + 'fundId' => (int) $this->bag('meeting.saving')->get('fund.id', -1), |
|
| 52 | 52 | 'funds' => $this->fundService->getFundList()->prepend('', -1), |
| 53 | 53 | ]); |
| 54 | 54 | $this->response->html('meeting-savings', $html); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | public function page(int $pageNumber = 0) |
| 65 | 65 | { |
| 66 | - $fundId = (int)$this->bag('meeting.saving')->get('fund.id', -1); |
|
| 66 | + $fundId = (int) $this->bag('meeting.saving')->get('fund.id', -1); |
|
| 67 | 67 | $savingCount = $this->savingService->getSavingCount($this->session, $fundId); |
| 68 | 68 | $savingSum = $this->savingService->getSavingSum($this->session, $fundId); |
| 69 | 69 | [$pageNumber, $perPage] = $this->pageNumber($pageNumber, $savingCount, |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | public function editSaving(int $savingId) |
| 99 | 99 | { |
| 100 | - if($this->session->closed) |
|
| 100 | + if ($this->session->closed) |
|
| 101 | 101 | { |
| 102 | 102 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 103 | 103 | return $this->response; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | 'title' => trans('common.actions.cancel'), |
| 115 | 115 | 'class' => 'btn btn-tertiary', |
| 116 | 116 | 'click' => 'close', |
| 117 | - ],[ |
|
| 117 | + ], [ |
|
| 118 | 118 | 'title' => trans('common.actions.save'), |
| 119 | 119 | 'class' => 'btn btn-primary', |
| 120 | 120 | 'click' => $this->rq()->updateSaving($savingId, pm()->form('saving-form')), |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public function updateSaving(int $savingId, array $formValues) |
| 132 | 132 | { |
| 133 | - if($this->session->closed) |
|
| 133 | + if ($this->session->closed) |
|
| 134 | 134 | { |
| 135 | 135 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 136 | 136 | return $this->response; |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function deleteSaving(int $savingId) |
| 151 | 151 | { |
| 152 | - if($this->session->closed) |
|
| 152 | + if ($this->session->closed) |
|
| 153 | 153 | { |
| 154 | 154 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
| 155 | 155 | return $this->response; |