v75
This commit is contained in:
parent
0053cb8830
commit
adfd01d74b
@ -79,8 +79,8 @@ if ($user['role'] === 'founder') {
|
||||
// Repayment Summary Calculation
|
||||
$stmt = db()->prepare("
|
||||
SELECT
|
||||
SUM(i.amount) as total_raised,
|
||||
SUM(i.total_return) as total_obligation,
|
||||
SUM(CASE WHEN i.status IN ('approved', 'completed') THEN i.amount ELSE 0 END) as total_raised,
|
||||
SUM(CASE WHEN i.status IN ('approved', 'completed') THEN i.total_return ELSE 0 END) as total_obligation,
|
||||
SUM(CASE WHEN i.status = 'approved' THEN i.monthly_dividend ELSE 0 END) as monthly_outgoing,
|
||||
COUNT(DISTINCT CASE WHEN i.status = 'approved' THEN i.investor_id END) as active_investors,
|
||||
MIN(CASE WHEN i.status = 'approved' THEN i.next_payment_date END) as next_payment_date
|
||||
|
||||
@ -457,13 +457,13 @@ $progress = ($goal > 0) ? round(($raised / $goal) * 100) : 0;
|
||||
<?php foreach ($approvedInvestments as $inv):
|
||||
$monthlyYield = $inv['monthly_dividend'];
|
||||
$nextPayDate = $inv['next_payment_date'];
|
||||
$daysLeft = (new DateTime())->diff(new DateTime($nextPayDate))->days;
|
||||
$daysLeft = (new DateTime())->diff(new DateTime($nextPayDate))->format("%r%a");
|
||||
?>
|
||||
<div class="dividend-item">
|
||||
<div>
|
||||
<div style="font-weight: 700; font-size: 15px;"><?= htmlspecialchars($inv['investor_name']) ?></div>
|
||||
<div style="font-size: 12px; color: var(--text-secondary);">
|
||||
£<?= number_format($inv['amount']) ?> @ <?= number_format($inv['interest_rate'], 1) ?>% over <?= $inv['repayment_term'] ?>mo
|
||||
£<?= number_format($inv['amount']) ?> @ <?= number_format($inv['interest_rate'] ?: 0, 1) ?>% over <?= $inv['repayment_term'] ?: 12 ?>mo
|
||||
</div>
|
||||
</div>
|
||||
<div style="text-align: right;">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user