@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | public function addLoan() |
97 | 97 | { |
98 | - if($this->session->closed) |
|
98 | + if ($this->session->closed) |
|
99 | 99 | { |
100 | 100 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
101 | 101 | return $this->response; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'title' => trans('common.actions.cancel'), |
113 | 113 | 'class' => 'btn btn-tertiary', |
114 | 114 | 'click' => 'close', |
115 | - ],[ |
|
115 | + ], [ |
|
116 | 116 | 'title' => trans('common.actions.save'), |
117 | 117 | 'class' => 'btn btn-primary', |
118 | 118 | 'click' => $this->rq()->createLoan(pm()->form('loan-form')), |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function createLoan(array $formValues) |
130 | 130 | { |
131 | - if($this->session->closed) |
|
131 | + if ($this->session->closed) |
|
132 | 132 | { |
133 | 133 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
134 | 134 | return $this->response; |
@@ -149,19 +149,19 @@ discard block |
||
149 | 149 | |
150 | 150 | public function editLoan(int $loanId) |
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; |
156 | 156 | } |
157 | 157 | $loan = $this->loanService->getSessionLoan($this->session, $loanId); |
158 | - if(!$loan) |
|
158 | + if (!$loan) |
|
159 | 159 | { |
160 | 160 | $this->notify->warning(trans('meeting.loan.errors.not_found')); |
161 | 161 | return $this->response; |
162 | 162 | } |
163 | 163 | // A refunded loan, or that was created from a remitment cannot be updated. |
164 | - if($loan->refunds_count > 0 || $loan->remitment_id) |
|
164 | + if ($loan->refunds_count > 0 || $loan->remitment_id) |
|
165 | 165 | { |
166 | 166 | $this->notify->warning(trans('meeting.loan.errors.update')); |
167 | 167 | return $this->response; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | 'title' => trans('common.actions.cancel'), |
176 | 176 | 'class' => 'btn btn-tertiary', |
177 | 177 | 'click' => 'close', |
178 | - ],[ |
|
178 | + ], [ |
|
179 | 179 | 'title' => trans('common.actions.save'), |
180 | 180 | 'class' => 'btn btn-primary', |
181 | 181 | 'click' => $this->rq()->updateLoan($loanId, pm()->form('loan-form')), |
@@ -191,19 +191,19 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function updateLoan(int $loanId, array $formValues) |
193 | 193 | { |
194 | - if($this->session->closed) |
|
194 | + if ($this->session->closed) |
|
195 | 195 | { |
196 | 196 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
197 | 197 | return $this->response; |
198 | 198 | } |
199 | 199 | $loan = $this->loanService->getSessionLoan($this->session, $loanId); |
200 | - if(!$loan) |
|
200 | + if (!$loan) |
|
201 | 201 | { |
202 | 202 | $this->notify->warning(trans('meeting.loan.errors.not_found')); |
203 | 203 | return $this->response; |
204 | 204 | } |
205 | 205 | // A refunded loan, or that was created from a remitment cannot be updated. |
206 | - if($loan->refunds_count > 0 || $loan->remitment_id) |
|
206 | + if ($loan->refunds_count > 0 || $loan->remitment_id) |
|
207 | 207 | { |
208 | 208 | $this->notify->warning(trans('meeting.loan.errors.update')); |
209 | 209 | return $this->response; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | public function deleteLoan(int $loanId) |
225 | 225 | { |
226 | - if($this->session->closed) |
|
226 | + if ($this->session->closed) |
|
227 | 227 | { |
228 | 228 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
229 | 229 | return $this->response; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function addRefund() |
108 | 108 | { |
109 | - if($this->session->closed) |
|
109 | + if ($this->session->closed) |
|
110 | 110 | { |
111 | 111 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
112 | 112 | return $this->response; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | 'title' => trans('common.actions.cancel'), |
120 | 120 | 'class' => 'btn btn-tertiary', |
121 | 121 | 'click' => 'close', |
122 | - ],[ |
|
122 | + ], [ |
|
123 | 123 | 'title' => trans('common.actions.save'), |
124 | 124 | 'class' => 'btn btn-primary', |
125 | 125 | 'click' => $this->rq()->createRefund(pm()->form('refund-form')), |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function createRefund(array $formValues) |
136 | 136 | { |
137 | - if($this->session->closed) |
|
137 | + if ($this->session->closed) |
|
138 | 138 | { |
139 | 139 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
140 | 140 | return $this->response; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | public function deleteRefund(int $refundId) |
160 | 160 | { |
161 | - if($this->session->closed) |
|
161 | + if ($this->session->closed) |
|
162 | 162 | { |
163 | 163 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
164 | 164 | return $this->response; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | public function addFunding() |
85 | 85 | { |
86 | - if($this->session->closed) |
|
86 | + if ($this->session->closed) |
|
87 | 87 | { |
88 | 88 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
89 | 89 | return $this->response; |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'title' => trans('common.actions.cancel'), |
98 | 98 | 'class' => 'btn btn-tertiary', |
99 | 99 | 'click' => 'close', |
100 | - ],[ |
|
100 | + ], [ |
|
101 | 101 | 'title' => trans('common.actions.save'), |
102 | 102 | 'class' => 'btn btn-primary', |
103 | 103 | 'click' => $this->rq()->createFunding(pm()->form('funding-form')), |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function createFunding(array $formValues) |
114 | 114 | { |
115 | - if($this->session->closed) |
|
115 | + if ($this->session->closed) |
|
116 | 116 | { |
117 | 117 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
118 | 118 | return $this->response; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | public function editFunding(int $fundingId) |
134 | 134 | { |
135 | - if($this->session->closed) |
|
135 | + if ($this->session->closed) |
|
136 | 136 | { |
137 | 137 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
138 | 138 | return $this->response; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | 'title' => trans('common.actions.cancel'), |
147 | 147 | 'class' => 'btn btn-tertiary', |
148 | 148 | 'click' => 'close', |
149 | - ],[ |
|
149 | + ], [ |
|
150 | 150 | 'title' => trans('common.actions.save'), |
151 | 151 | 'class' => 'btn btn-primary', |
152 | 152 | 'click' => $this->rq()->updateFunding($fundingId, pm()->form('funding-form')), |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public function updateFunding(int $fundingId, array $formValues) |
163 | 163 | { |
164 | - if($this->session->closed) |
|
164 | + if ($this->session->closed) |
|
165 | 165 | { |
166 | 166 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
167 | 167 | return $this->response; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | public function deleteFunding(int $fundingId) |
183 | 183 | { |
184 | - if($this->session->closed) |
|
184 | + if ($this->session->closed) |
|
185 | 185 | { |
186 | 186 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
187 | 187 | return $this->response; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | public function addDisbursement() |
97 | 97 | { |
98 | - if($this->session->closed) |
|
98 | + if ($this->session->closed) |
|
99 | 99 | { |
100 | 100 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
101 | 101 | return $this->response; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'title' => trans('common.actions.cancel'), |
111 | 111 | 'class' => 'btn btn-tertiary', |
112 | 112 | 'click' => 'close', |
113 | - ],[ |
|
113 | + ], [ |
|
114 | 114 | 'title' => trans('common.actions.save'), |
115 | 115 | 'class' => 'btn btn-primary', |
116 | 116 | 'click' => $this->rq()->createDisbursement(pm()->form('disbursement-form')), |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function createDisbursement(array $formValues) |
127 | 127 | { |
128 | - if($this->session->closed) |
|
128 | + if ($this->session->closed) |
|
129 | 129 | { |
130 | 130 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
131 | 131 | return $this->response; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | public function editDisbursement(int $disbursementId) |
146 | 146 | { |
147 | - if($this->session->closed) |
|
147 | + if ($this->session->closed) |
|
148 | 148 | { |
149 | 149 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
150 | 150 | return $this->response; |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | 'title' => trans('common.actions.cancel'), |
162 | 162 | 'class' => 'btn btn-tertiary', |
163 | 163 | 'click' => 'close', |
164 | - ],[ |
|
164 | + ], [ |
|
165 | 165 | 'title' => trans('common.actions.save'), |
166 | 166 | 'class' => 'btn btn-primary', |
167 | 167 | 'click' => $this->rq()->updateDisbursement($disbursementId, pm()->form('disbursement-form')), |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function updateDisbursement(int $disbursementId, array $formValues) |
178 | 178 | { |
179 | - if($this->session->closed) |
|
179 | + if ($this->session->closed) |
|
180 | 180 | { |
181 | 181 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
182 | 182 | return $this->response; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | public function deleteDisbursement(int $disbursementId) |
197 | 197 | { |
198 | - if($this->session->closed) |
|
198 | + if ($this->session->closed) |
|
199 | 199 | { |
200 | 200 | $this->notify->warning(trans('meeting.warnings.session.closed')); |
201 | 201 | return $this->response; |
@@ -119,8 +119,7 @@ |
||
119 | 119 | { |
120 | 120 | // Show the profits only if they were saved on this session. |
121 | 121 | $profitSessionId = $session->round->properties['profit']['session'] ?? 0; |
122 | - $html = $profitSessionId !== $session->id ? '' : |
|
123 | - $this->view()->render('tontine.pages.report.session.session.profits', [ |
|
122 | + $html = $profitSessionId !== $session->id ? '' : $this->view()->render('tontine.pages.report.session.session.profits', [ |
|
124 | 123 | 'fundings' => $this->profitService->getDistributions($session), |
125 | 124 | 'profitAmount' => $session->round->properties['profit']['amount'] ?? 0, |
126 | 125 | ]); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | 'title' => trans('common.actions.cancel'), |
95 | 95 | 'class' => 'btn btn-tertiary', |
96 | 96 | 'click' => 'close', |
97 | - ],[ |
|
97 | + ], [ |
|
98 | 98 | 'title' => trans('common.actions.save'), |
99 | 99 | 'class' => 'btn btn-primary', |
100 | 100 | 'click' => $this->rq()->create(pm()->form('session-form')), |
@@ -125,11 +125,11 @@ discard block |
||
125 | 125 | 'title' => trans('common.actions.cancel'), |
126 | 126 | 'class' => 'btn btn-tertiary', |
127 | 127 | 'click' => 'close', |
128 | - ],[ |
|
128 | + ], [ |
|
129 | 129 | 'title' => trans('common.actions.year'), |
130 | 130 | 'class' => 'btn btn-primary', |
131 | 131 | 'click' => $this->rq()->years(), |
132 | - ],[ |
|
132 | + ], [ |
|
133 | 133 | 'title' => trans('common.actions.save'), |
134 | 134 | 'class' => 'btn btn-primary', |
135 | 135 | 'click' => $this->rq()->createList(pm()->form('session-list')), |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | private function parseSessionList(string $sessions): array |
159 | 159 | { |
160 | 160 | $sessions = array_map(function($value) { |
161 | - if(!($value = trim($value, " \t\n\r;"))) |
|
161 | + if (!($value = trim($value, " \t\n\r;"))) |
|
162 | 162 | { |
163 | 163 | return []; |
164 | 164 | } |
165 | 165 | $values = explode(";", $value); |
166 | - if(count($values) !== 2) |
|
166 | + if (count($values) !== 2) |
|
167 | 167 | { |
168 | 168 | return []; // Todo: throw an exception |
169 | 169 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | 'title' => trans('common.actions.cancel'), |
209 | 209 | 'class' => 'btn btn-tertiary', |
210 | 210 | 'click' => 'close', |
211 | - ],[ |
|
211 | + ], [ |
|
212 | 212 | 'title' => trans('common.actions.save'), |
213 | 213 | 'class' => 'btn btn-primary', |
214 | 214 | 'click' => $this->rq()->update($session->id, pm()->form('session-form')), |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | 'title' => trans('common.actions.cancel'), |
246 | 246 | 'class' => 'btn btn-tertiary', |
247 | 247 | 'click' => 'close', |
248 | - ],[ |
|
248 | + ], [ |
|
249 | 249 | 'title' => trans('common.actions.save'), |
250 | 250 | 'class' => 'btn btn-primary', |
251 | 251 | 'click' => $this->rq()->saveVenue($session->id, pm()->form('session-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->view()->render('tontine.pages.planning.subscription.home') |
52 | 51 | ->with('pools', $poolLabels) |
@@ -58,7 +57,7 @@ discard block |
||
58 | 57 | $this->jq('#btn-pool-select')->click($this->rq()->pool($selectPoolId)); |
59 | 58 | |
60 | 59 | $pool = $pools->firstWhere('id', $poolId) ?? ($pools->count() > 0 ? $pools[0] : null); |
61 | - if(($pool)) |
|
60 | + if (($pool)) |
|
62 | 61 | { |
63 | 62 | return $this->show($pool); |
64 | 63 | } |
@@ -87,7 +86,7 @@ discard block |
||
87 | 86 | public function planning(int $poolId) |
88 | 87 | { |
89 | 88 | $pool = $this->poolService->getPool($poolId); |
90 | - if(!$pool || !$pool->remit_planned) |
|
89 | + if (!$pool || !$pool->remit_planned) |
|
91 | 90 | { |
92 | 91 | return $this->response; |
93 | 92 | } |
@@ -111,7 +110,7 @@ discard block |
||
111 | 110 | public function beneficiaries(int $poolId) |
112 | 111 | { |
113 | 112 | $pool = $this->poolService->getPool($poolId); |
114 | - if(!$pool || !$pool->remit_planned) |
|
113 | + if (!$pool || !$pool->remit_planned) |
|
115 | 114 | { |
116 | 115 | return $this->response; |
117 | 116 | } |
@@ -142,12 +141,12 @@ discard block |
||
142 | 141 | int $currSubscriptionId) |
143 | 142 | { |
144 | 143 | $pool = $this->poolService->getPool($poolId); |
145 | - if(!$pool || !$pool->remit_planned || $pool->remit_auction) |
|
144 | + if (!$pool || !$pool->remit_planned || $pool->remit_auction) |
|
146 | 145 | { |
147 | 146 | return $this->response; |
148 | 147 | } |
149 | 148 | |
150 | - if(!$this->subscriptionService->saveBeneficiary($pool, $sessionId, |
|
149 | + if (!$this->subscriptionService->saveBeneficiary($pool, $sessionId, |
|
151 | 150 | $currSubscriptionId, $nextSubscriptionId)) |
152 | 151 | { |
153 | 152 | $message = trans('tontine.beneficiary.errors.cant_change'); |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | protected function getPool() |
51 | 51 | { |
52 | - $poolId = $this->target()->method() === 'home' ? $this->target()->args()[0] : |
|
53 | - intval($this->bag('subscription')->get('pool.id')); |
|
52 | + $poolId = $this->target()->method() === 'home' ? $this->target()->args()[0] : intval($this->bag('subscription')->get('pool.id')); |
|
54 | 53 | $this->pool = $this->poolService->getPool($poolId); |
55 | 54 | } |
56 | 55 | |
@@ -69,7 +68,7 @@ discard block |
||
69 | 68 | ->with('pool', $this->pool); |
70 | 69 | $this->response->html('pool-subscription-sessions', $html); |
71 | 70 | $this->jq('#btn-subscription-sessions-refresh')->click($this->rq()->home($poolId)); |
72 | - if($this->pool->remit_planned) |
|
71 | + if ($this->pool->remit_planned) |
|
73 | 72 | { |
74 | 73 | $this->jq('#btn-subscription-planning') |
75 | 74 | ->click($this->cl(Subscription::class)->rq()->planning($poolId)); |
@@ -50,8 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | protected function getPool() |
52 | 52 | { |
53 | - $poolId = $this->target()->method() === 'home' ? $this->target()->args()[0] : |
|
54 | - intval($this->bag('subscription')->get('pool.id')); |
|
53 | + $poolId = $this->target()->method() === 'home' ? $this->target()->args()[0] : intval($this->bag('subscription')->get('pool.id')); |
|
55 | 54 | $this->pool = $this->poolService->getPool($poolId); |
56 | 55 | } |
57 | 56 | |
@@ -71,7 +70,7 @@ discard block |
||
71 | 70 | $this->response->html('pool-subscription-members', $html); |
72 | 71 | $this->jq('#btn-subscription-members-filter')->click($this->rq()->filter()); |
73 | 72 | $this->jq('#btn-subscription-members-refresh')->click($this->rq()->home($poolId)); |
74 | - if($this->pool->remit_planned) |
|
73 | + if ($this->pool->remit_planned) |
|
75 | 74 | { |
76 | 75 | $this->jq('#btn-subscription-beneficiaries') |
77 | 76 | ->click($this->cl(Subscription::class)->rq()->beneficiaries($poolId)); |