<% if (user.profile_photo_path) { %>

<% } else { %>
<%= user.first_name.charAt(0).toUpperCase() %><%= user.last_name.charAt(0).toUpperCase() %>
<% } %>
Card Reference ID
<%= user.card_last_digits %>
<% if (spending.limit > 0) { %>
<%
const CCpct = Math.min(100, (spending.total / spending.limit) * 100);
const CCapprovedPct = Math.min(100, (spending.approved / spending.limit) * 100);
const CCpendingPct = Math.min(100, (spending.pending / spending.limit) * 100);
%>
Approved
$<%= spending.approved.toFixed(2) %>
Pending
$<%= spending.pending.toFixed(2) %>
Remaining
$<%= spending.remaining.toFixed(2) %>
Limit: $<%= spending.limit.toFixed(2) %>
· Card Used: $<%= spending.total.toFixed(2) %>
<% } %>
<% if (spending.reimb && spending.reimb.limit > 0) { %>
<%
const RePct = Math.min(100, (spending.reimb.total / spending.reimb.limit) * 100);
const ReApprovedPct = Math.min(100, (spending.reimb.approved / spending.reimb.limit) * 100);
const RePendingPct = Math.min(100, (spending.reimb.pending / spending.reimb.limit) * 100);
%>
Approved
$<%= spending.reimb.approved.toFixed(2) %>
Pending
$<%= spending.reimb.pending.toFixed(2) %>
Remaining
$<%= spending.reimb.remaining.toFixed(2) %>
Cap: $<%= spending.reimb.limit.toFixed(2) %>
· Claims Total: $<%= spending.reimb.total.toFixed(2) %>
<% } %>
<% } else if (locals.activeView === 'add-reimb' || locals.activeView === 'add-cc') { %>
<% if (expenses && expenses.length > 0) { %>
<%
const reimburseExp = expenses.filter(e => e.payment_type !== 'Company Card' && e.status !== 'voided');
const cardExp = expenses.filter(e => e.payment_type === 'Company Card' && e.status !== 'voided');
const voidedExp = expenses.filter(e => e.status === 'voided');
%>
<% function expenseRow(exp) { %>
| <%= (exp.date || '').toString().split('T')[0] %> |
<%= exp.store_name %>
ID: <%= exp.transaction_id %>
<% if (!exp.receipt_photo_path) { %>
⚠ Receipt Missing
<% } %>
<% if (exp.description) { %>
<%= exp.description %>
<% } %>
<% if (exp.rejection_reason) { %>
Rejected: <%= exp.rejection_reason %>
<% } %>
|
<%= exp.job_number || '—' %> |
<%= exp.supervisor || '—' %> |
$<%= parseFloat(exp.net_amount).toFixed(2) %>
<% if (exp.tax_amount > 0) { %> +$<%= parseFloat(exp.tax_amount).toFixed(2) %> tax <% } %>
<% try { const fees = JSON.parse(exp.fees_json || '[]'); if (fees.length > 0) { const ft = fees.reduce((s,f) => s + (parseFloat(f.amount)||0), 0); %>+$<%= ft.toFixed(2) %> fees <% } } catch(e){} %>
|
$<%= parseFloat(exp.total_amount).toFixed(2) %> |
<% if (exp.status === 'approved') { %>
Approved
<% if (exp.approved_at) { %> <%= (exp.approved_at||'').toString().split('T')[0] %> <% } %>
<% } else if (exp.status === 'rejected') { %>
Rejected
<% } else { %>
Pending
<% } %>
|
<% if (exp.receipt_photo_path) { %>
<% } %>
<% if (exp.status === 'pending' || exp.status === 'rejected') { %>
<% } %>
<% if (exp.status === 'pending') { %>
<% } %>
|
<% } %>
<% if (reimburseExp.length > 0) { %>
Employee Reimbursement Claims
<%= reimburseExp.length %> claim(s)
| Date |
Store / Vendor |
Job # |
Supervisor |
Amount |
Total |
Status |
Actions |
<% reimburseExp.forEach(exp => { expenseRow(exp); }) %>
<% } %>
<% if (cardExp.length > 0) { %>
Company Credit Card Expenses
<%= cardExp.length %> expense(s)
| Date |
Store / Vendor |
Job # |
Supervisor |
Amount |
Total |
Status |
Actions |
<% cardExp.forEach(exp => { expenseRow(exp); }) %>
<% } %>
<% if (voidedExp.length > 0) { %>
<%= voidedExp.length %> Voided Expense(s) – click to show
| Date | Store / Vendor | Job # | Amount | Void Reason |
<% voidedExp.forEach(exp => { %>
| <%= (exp.date||'').toString().split('T')[0] %> |
<%= exp.store_name %> |
<%= exp.job_number || '—' %> |
$<%= parseFloat(exp.total_amount).toFixed(2) %> |
<%= exp.void_reason || '—' %> |
<% }) %>
<% } %>
<% if (reimburseExp.length === 0 && cardExp.length === 0 && voidedExp.length === 0) { %>
No expenses submitted yet.
Add your first expense using the form.
<% } %>
<% } else { %>
No expenses submitted yet.
Add your first expense using the form.
<% } %>