|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace App\Ajax\App\Meeting\Summary; |
|
4
|
|
|
|
|
5
|
|
|
use App\Ajax\CallableClass; |
|
6
|
|
|
use Siak\Tontine\Model\Session as SessionModel; |
|
7
|
|
|
use Siak\Tontine\Service\Meeting\Summary\SessionService; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* @exclude |
|
11
|
|
|
*/ |
|
12
|
|
|
class Session extends CallableClass |
|
13
|
|
|
{ |
|
14
|
|
|
/** |
|
15
|
|
|
* @var SessionService |
|
16
|
|
|
*/ |
|
17
|
|
|
protected SessionService $sessionService; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* @var SessionModel |
|
21
|
|
|
*/ |
|
22
|
|
|
private SessionModel $session; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* @param SessionModel $session |
|
26
|
|
|
* @param boolean $isFinancial |
|
27
|
|
|
* @param SessionService $sessionService |
|
28
|
|
|
* |
|
29
|
|
|
* @return Response |
|
|
|
|
|
|
30
|
|
|
*/ |
|
31
|
|
|
public function show(SessionModel $session, bool $isFinancial, SessionService $sessionService) |
|
32
|
|
|
{ |
|
33
|
|
|
$this->session = $session; |
|
34
|
|
|
$this->sessionService = $sessionService; |
|
35
|
|
|
|
|
36
|
|
|
$this->deposits(); |
|
37
|
|
|
$this->remitments(); |
|
38
|
|
|
if($isFinancial) |
|
39
|
|
|
{ |
|
40
|
|
|
$this->fundings(); |
|
41
|
|
|
$this->loans(); |
|
42
|
|
|
} |
|
43
|
|
|
$this->fees(); |
|
44
|
|
|
$this->fines(); |
|
45
|
|
|
|
|
46
|
|
|
return $this->response; |
|
|
|
|
|
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
private function deposits() |
|
50
|
|
|
{ |
|
51
|
|
|
$html = $this->view()->render('tontine.pages.meeting.summary.session.deposits', [ |
|
52
|
|
|
'pools' => $this->sessionService->getDeposits($this->session), |
|
53
|
|
|
]); |
|
54
|
|
|
$this->response->html('member-deposits', $html); |
|
|
|
|
|
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
private function remitments() |
|
58
|
|
|
{ |
|
59
|
|
|
$html = $this->view()->render('tontine.pages.meeting.summary.session.remitments', [ |
|
60
|
|
|
'pools' => $this->sessionService->getRemitments($this->session), |
|
61
|
|
|
]); |
|
62
|
|
|
$this->response->html('member-remitments', $html); |
|
|
|
|
|
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
private function fundings() |
|
66
|
|
|
{ |
|
67
|
|
|
$html = $this->view()->render('tontine.pages.meeting.summary.session.fundings', [ |
|
68
|
|
|
'funding' => $this->sessionService->getFunding($this->session), |
|
69
|
|
|
]); |
|
70
|
|
|
$this->response->html('member-fundings', $html); |
|
|
|
|
|
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
private function loans() |
|
74
|
|
|
{ |
|
75
|
|
|
$html = $this->view()->render('tontine.pages.meeting.summary.session.loans', [ |
|
76
|
|
|
'loan' => $this->sessionService->getLoan($this->session), |
|
77
|
|
|
]); |
|
78
|
|
|
$this->response->html('member-loans', $html); |
|
|
|
|
|
|
79
|
|
|
|
|
80
|
|
|
$refund = $this->sessionService->getRefund($this->session); |
|
81
|
|
|
$html = $this->view()->render('tontine.pages.meeting.summary.session.refunds.principal', [ |
|
82
|
|
|
'refund' => $refund, |
|
83
|
|
|
]); |
|
84
|
|
|
$this->response->html('member-refunds-principal', $html); |
|
85
|
|
|
|
|
86
|
|
|
$html = $this->view()->render('tontine.pages.meeting.summary.session.refunds.interest', [ |
|
87
|
|
|
'refund' => $refund, |
|
88
|
|
|
]); |
|
89
|
|
|
$this->response->html('member-refunds-interest', $html); |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
private function fees() |
|
93
|
|
|
{ |
|
94
|
|
|
$html = $this->view()->render('tontine.pages.meeting.summary.session.fees', [ |
|
95
|
|
|
'fees' => $this->sessionService->getFees($this->session), |
|
96
|
|
|
]); |
|
97
|
|
|
$this->response->html('member-fees', $html); |
|
|
|
|
|
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
private function fines() |
|
101
|
|
|
{ |
|
102
|
|
|
$html = $this->view()->render('tontine.pages.meeting.summary.session.fines', [ |
|
103
|
|
|
'fines' => $this->sessionService->getFines($this->session), |
|
104
|
|
|
]); |
|
105
|
|
|
$this->response->html('member-fines', $html); |
|
|
|
|
|
|
106
|
|
|
} |
|
107
|
|
|
} |
|
108
|
|
|
|