@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $member = $this->getMember($values['member']); |
215 | 215 | $charge = $this->getCharge($values['charge']); |
216 | 216 | $category = $this->getCategory($values['category']); |
217 | - if(!$category) |
|
217 | + if (!$category) |
|
218 | 218 | { |
219 | 219 | throw new MessageException(trans('meeting.category.errors.not_found')); |
220 | 220 | } |
@@ -222,11 +222,11 @@ discard block |
||
222 | 222 | $disbursement = new Disbursement(); |
223 | 223 | $disbursement->amount = $values['amount']; |
224 | 224 | $disbursement->comment = trim($values['comment']); |
225 | - if(($member)) |
|
225 | + if (($member)) |
|
226 | 226 | { |
227 | 227 | $disbursement->member()->associate($member); |
228 | 228 | } |
229 | - if(($charge)) |
|
229 | + if (($charge)) |
|
230 | 230 | { |
231 | 231 | $disbursement->charge_lendable = $charge->lendable; |
232 | 232 | $disbursement->charge()->associate($charge); |
@@ -254,19 +254,19 @@ discard block |
||
254 | 254 | $member = $this->getMember($values['member']); |
255 | 255 | $charge = $this->getCharge($values['charge']); |
256 | 256 | $category = $this->getCategory($values['category']); |
257 | - if(!$category) |
|
257 | + if (!$category) |
|
258 | 258 | { |
259 | 259 | throw new MessageException(trans('meeting.category.errors.not_found')); |
260 | 260 | } |
261 | 261 | $disbursement = $session->disbursements()->find($disbursementId); |
262 | - if(!$disbursement) |
|
262 | + if (!$disbursement) |
|
263 | 263 | { |
264 | 264 | throw new MessageException(trans('meeting.disbursement.errors.not_found')); |
265 | 265 | } |
266 | 266 | |
267 | 267 | $disbursement->amount = $values['amount']; |
268 | 268 | $disbursement->comment = trim($values['comment']); |
269 | - if(($member)) |
|
269 | + if (($member)) |
|
270 | 270 | { |
271 | 271 | $disbursement->member()->associate($member); |
272 | 272 | } |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | { |
275 | 275 | $disbursement->member()->dissociate(); |
276 | 276 | } |
277 | - if(($charge)) |
|
277 | + if (($charge)) |
|
278 | 278 | { |
279 | 279 | $disbursement->charge_lendable = $charge->lendable; |
280 | 280 | $disbursement->charge()->associate($charge); |
@@ -230,8 +230,7 @@ discard block |
||
230 | 230 | { |
231 | 231 | $disbursement->charge_lendable = $charge->lendable; |
232 | 232 | $disbursement->charge()->associate($charge); |
233 | - } |
|
234 | - else |
|
233 | + } else |
|
235 | 234 | { |
236 | 235 | $disbursement->charge_lendable = true; |
237 | 236 | } |
@@ -269,8 +268,7 @@ discard block |
||
269 | 268 | if(($member)) |
270 | 269 | { |
271 | 270 | $disbursement->member()->associate($member); |
272 | - } |
|
273 | - else |
|
271 | + } else |
|
274 | 272 | { |
275 | 273 | $disbursement->member()->dissociate(); |
276 | 274 | } |
@@ -278,8 +276,7 @@ discard block |
||
278 | 276 | { |
279 | 277 | $disbursement->charge_lendable = $charge->lendable; |
280 | 278 | $disbursement->charge()->associate($charge); |
281 | - } |
|
282 | - else |
|
279 | + } else |
|
283 | 280 | { |
284 | 281 | $disbursement->charge_lendable = true; |
285 | 282 | $disbursement->charge()->dissociate(); |
@@ -97,8 +97,7 @@ |
||
97 | 97 | if($pool->remit_auction) |
98 | 98 | { |
99 | 99 | $subscriptions = collect([]); |
100 | - } |
|
101 | - else |
|
100 | + } else |
|
102 | 101 | { |
103 | 102 | $subscriptions = $subscriptions->pluck('member.name', 'id')->sort(); |
104 | 103 | $subscriptions->prepend('', 0); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | |
63 | 63 | $figures = new stdClass(); |
64 | 64 | // Expected figures only for pools with fixed deposit amount |
65 | - if($pool->remit_planned /*$pool->deposit_fixed*/) |
|
65 | + if ($pool->remit_planned /*$pool->deposit_fixed*/) |
|
66 | 66 | { |
67 | 67 | $depositCount = $subscriptions->count(); |
68 | 68 | $figures->expected = $this->getExpectedFigures($pool, $sessions, $depositCount); |
@@ -71,11 +71,10 @@ discard block |
||
71 | 71 | // Set the subscriptions that will be pay at each session. |
72 | 72 | // Pad with 0's when the beneficiaries are not yet set. |
73 | 73 | $sessions->each(function($session) use($figures, $pool) { |
74 | - if($session->enabled($pool)) |
|
74 | + if ($session->enabled($pool)) |
|
75 | 75 | { |
76 | 76 | // Pick the subscriptions ids, and fill with 0's to the max available. |
77 | - $remitmentCount = !$pool->deposit_fixed ? 1 : |
|
78 | - $figures->expected[$session->id]->remitment->count; |
|
77 | + $remitmentCount = !$pool->deposit_fixed ? 1 : $figures->expected[$session->id]->remitment->count; |
|
79 | 78 | $session->beneficiaries = $session->payables->map(function($payable) { |
80 | 79 | return $payable->subscription_id; |
81 | 80 | })->pad($remitmentCount, 0); |
@@ -89,7 +88,7 @@ discard block |
||
89 | 88 | }); |
90 | 89 | $beneficiaries = $beneficiaries->pluck('member.name', 'id'); |
91 | 90 | // Do not show the list of subscriptions for pools with auctions |
92 | - if($pool->remit_auction) |
|
91 | + if ($pool->remit_auction) |
|
93 | 92 | { |
94 | 93 | $subscriptions = collect([]); |
95 | 94 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | 'registered_at' => 'nullable|date_format:Y-m-d', |
42 | 42 | 'birthday' => 'nullable|date_format:Y-m-d', |
43 | 43 | ]); |
44 | - if($validator->fails()) |
|
44 | + if ($validator->fails()) |
|
45 | 45 | { |
46 | 46 | throw new ValidationException($validator); |
47 | 47 | } |
@@ -29,7 +29,7 @@ |
||
29 | 29 | 'country_code' => ['required', new CountryCode()], |
30 | 30 | 'currency_code' => ['required', new CurrencyCode()], |
31 | 31 | ]); |
32 | - if($validator->fails()) |
|
32 | + if ($validator->fails()) |
|
33 | 33 | { |
34 | 34 | throw new ValidationException($validator); |
35 | 35 | } |
@@ -35,20 +35,19 @@ |
||
35 | 35 | 'period' => 'required|integer|between:0,3', |
36 | 36 | 'name' => 'required|string|min:1', |
37 | 37 | 'fixed' => [ |
38 | - Rule::requiredIf((int)$values['type'] === 0 && (int)$values['period'] > 0), |
|
38 | + Rule::requiredIf((int) $values['type'] === 0 && (int) $values['period'] > 0), |
|
39 | 39 | 'in:1', |
40 | 40 | 'exclude', |
41 | 41 | ], |
42 | 42 | 'amount' => 'required_if:fixed,1|regex:/^\d+(\.\d{1,2})?$/', |
43 | 43 | ]); |
44 | - if($validator->fails()) |
|
44 | + if ($validator->fails()) |
|
45 | 45 | { |
46 | 46 | throw new ValidationException($validator); |
47 | 47 | } |
48 | 48 | |
49 | 49 | $validated = $validator->validated(); |
50 | - $validated['amount'] = empty($values['fixed']) ? 0 : |
|
51 | - $this->localeService->convertMoneyToInt((float)$validated['amount']); |
|
50 | + $validated['amount'] = empty($values['fixed']) ? 0 : $this->localeService->convertMoneyToInt((float) $validated['amount']); |
|
52 | 51 | $validated['lendable'] = isset($values['lendable']); |
53 | 52 | |
54 | 53 | return $validated; |
@@ -35,13 +35,13 @@ discard block |
||
35 | 35 | 'debt' => 'required|integer|min:1', |
36 | 36 | 'amount' => 'required|regex:/^\d+(\.\d{1,2})?$/', |
37 | 37 | ]); |
38 | - if($validator->fails()) |
|
38 | + if ($validator->fails()) |
|
39 | 39 | { |
40 | 40 | throw new ValidationException($validator); |
41 | 41 | } |
42 | 42 | |
43 | 43 | $validated = $validator->validated(); |
44 | - $validated['amount'] = $this->localeService->convertMoneyToInt((float)$validated['amount']); |
|
44 | + $validated['amount'] = $this->localeService->convertMoneyToInt((float) $validated['amount']); |
|
45 | 45 | return $validated; |
46 | 46 | } |
47 | 47 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $validator = Validator::make($this->values($values), [ |
59 | 59 | 'debt' => 'required|integer|min:1', |
60 | 60 | ]); |
61 | - if($validator->fails()) |
|
61 | + if ($validator->fails()) |
|
62 | 62 | { |
63 | 63 | throw new ValidationException($validator); |
64 | 64 | } |
@@ -36,13 +36,13 @@ |
||
36 | 36 | 'amount' => 'required|regex:/^\d+(\.\d{1,2})?$/', |
37 | 37 | 'comment' => 'present|between:0,150', |
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 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | protected function values(array $values): array |
19 | 19 | { |
20 | 20 | return array_map(function($value) { |
21 | - if(!is_string($value)) |
|
21 | + if (!is_string($value)) |
|
22 | 22 | { |
23 | 23 | return $value; |
24 | 24 | } |
@@ -35,12 +35,11 @@ |
||
35 | 35 | { |
36 | 36 | $icon = '<i class="fa fa-toggle-off"></i>'; |
37 | 37 | $linkClass = "btn-add-$name"; |
38 | - if(($payment)) |
|
38 | + if (($payment)) |
|
39 | 39 | { |
40 | 40 | $icon = '<i class="fa fa-toggle-on"></i>'; |
41 | 41 | $linkClass = "btn-del-$name"; |
42 | 42 | } |
43 | 43 | |
44 | - return $disableLink ? $icon : |
|
45 | - '<a href="javascript:void(0)" class="' . $linkClass . '">' . $icon . '</a>'; |
|
44 | + return $disableLink ? $icon : '<a href="javascript:void(0)" class="' . $linkClass . '">' . $icon . '</a>'; |
|
46 | 45 | } |