12 lines
1.6 KiB
PHP
12 lines
1.6 KiB
PHP
<?= $this->extend('layout/management_layout') ?>
|
|
<?= $this->section('content') ?>
|
|
<?php $money = static fn ($v): string => '$' . number_format(((int) $v) / 100, 2); ?>
|
|
<div class="container py-4">
|
|
<div class="d-flex justify-content-between align-items-center mb-3"><h2>Invoice #<?= (int) $invoiceId ?> Withdrawal Breakdown</h2><a class="btn btn-outline-secondary" href="<?= site_url('refunds/list') ?>">Back to refunds</a></div>
|
|
<?php foreach ($calculations as $c): ?>
|
|
<div class="card mb-3"><div class="card-header d-flex justify-content-between"><strong><?= esc(trim(($c['student_firstname'] ?? '') . ' ' . ($c['student_lastname'] ?? ''))) ?></strong><span class="badge bg-<?= ($c['status'] ?? '') === 'posted' ? 'success' : 'danger' ?>"><?= esc($c['status'] ?? '') ?></span></div><div class="card-body"><div class="row g-2"><div class="col-md-3">Studied: <strong><?= (int) ($c['studied_weeks'] ?? 0) ?> week(s)</strong></div><div class="col-md-3">Books: <strong><?= $money($c['issued_book_charge_cents'] ?? 0) ?></strong></div><div class="col-md-3">Earned tuition: <strong><?= $money($c['earned_tuition_cents'] ?? 0) ?></strong></div><div class="col-md-3">Retained: <strong><?= $money($c['retained_charge_cents'] ?? 0) ?></strong></div></div><div class="mt-2"><a href="<?= site_url('administrator/withdrawal-calculations/' . (int) $c['id']) ?>">Calculation #<?= (int) $c['id'] ?> version <?= (int) $c['version'] ?></a></div></div></div>
|
|
<?php endforeach; ?>
|
|
<?php if (empty($calculations)): ?><div class="alert alert-warning">No posted withdrawal calculations were found for this invoice.</div><?php endif; ?>
|
|
</div>
|
|
<?= $this->endSection() ?>
|