fix enrollment, invoice, payment and financila aid
This commit is contained in:
@@ -126,13 +126,22 @@
|
||||
return name;
|
||||
}
|
||||
function renderInvoiceRow(r) {
|
||||
const isCarryForward = !!r.is_carry_forward;
|
||||
const ts = Date.parse(r.invoice_date || new Date().toISOString());
|
||||
const genBtn = `<button type=\"button\" class=\"btn btn-primary btn-sm gen-invoice\" data-parent-id=\"${esc(r.parent_id)}\" onclick=\"return window.__genInvoice && window.__genInvoice(this)\">Generate Invoice</button>`;
|
||||
const pdf = r.invoice_id ? `<a href=\"<?= base_url('invoice/pdf') ?>/${esc(r.invoice_id)}\" target=\"_blank\" class=\"btn btn-info btn-sm external-link\">View/Print PDF</a>` : '<span class=\"text-muted\">No invoice yet</span>';
|
||||
const genBtn = isCarryForward
|
||||
? '<span class="text-muted small">Audit only</span>'
|
||||
: `<button type=\"button\" class=\"btn btn-primary btn-sm gen-invoice\" data-parent-id=\"${esc(r.parent_id)}\" onclick=\"return window.__genInvoice && window.__genInvoice(this)\">Generate Invoice</button>`;
|
||||
const invoiceLabel = isCarryForward
|
||||
? `<div><span class="badge bg-secondary me-1">Carry-over</span>${esc(r.invoice_description || 'Carry over balance')}</div>`
|
||||
+ (r.invoice_number ? `<div class="text-muted small">${esc(r.invoice_number)}</div>` : '')
|
||||
: renderStudents(r.enrolledKids || []);
|
||||
const pdf = r.invoice_id
|
||||
? `<a href=\"<?= base_url('invoice/pdf') ?>/${esc(r.invoice_id)}\" target=\"_blank\" class=\"btn btn-info btn-sm external-link\">View/Print PDF</a>`
|
||||
: (isCarryForward ? '<span class=\"text-muted\">—</span>' : '<span class=\"text-muted\">No invoice yet</span>');
|
||||
|
||||
return [
|
||||
renderParentCell(r),
|
||||
renderStudents(r.enrolledKids || []),
|
||||
invoiceLabel,
|
||||
genBtn,
|
||||
fmtMoney(r.invoice_amount),
|
||||
renderRefundCell(r),
|
||||
|
||||
Reference in New Issue
Block a user