diff --git a/layout.md b/layout.md index 19741d0..e381e07 100644 --- a/layout.md +++ b/layout.md @@ -69,6 +69,8 @@ This is the single source of truth for dashboard/profile visual structure and UI - action buttons group sits on the right using: `margin-left: auto`, `display: flex`, `align-items: center`, `gap: 8` - do not use hardcoded spacer blocks (`width` filler divs) to force alignment - icon-only filter/action buttons share the same row and align vertically with add buttons + - filter button wrapper: `
| {fmtDate(inv.invoice_date)} | {fmtDate(inv.due_date)} |
- |
+ 0 ? '#ef4444' : 'var(--text-muted)' }}> + {Number(inv.stripe_fee) > 0 ? `-${fmtAmt(inv.stripe_fee)}` : '$0.00'} |
{fmtAmt(inv.total)}
@@ -1074,7 +1132,11 @@ export default function Invoices() {
0 ? '#F5A523' : 'var(--text-muted)' }}>{fmtAmt(g.outstanding)} outstanding · {fmtAmt(g.paid)} paid
+
+ 0 ? '#F5A523' : 'var(--text-muted)' }}>{fmtAmt(g.outstanding)} outstanding
+ {' · '}{fmtAmt(g.paid)} paid
+ {g.fees > 0 && · -{fmtAmt(g.fees)} fees}
+
);
})}
@@ -1133,27 +1195,6 @@ export default function Invoices() {
))}
-
-
-
- )}
- { if (!expenseDetailEditing) setViewingExpense(null); }}>
+
+ );
+ })()}
+
{showExpenseForm && (
e.stopPropagation()}>
+ {/* Left: details / edit */}
+
+
+
+ {/* Right: receipt preview — same height as left column */}
+ {viewingExpense.receipt_path && (
+ Expense Detail
+ {expenseDetailEditing ? (
+ setNewExpense(p => ({ ...p, amount: e.target.value }))} />
+ ) : (
+
+ ${Number(viewingExpense.amount).toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}
+
+ )}
+
+
+ Description
+ {expenseDetailEditing
+ ? setNewExpense(p => ({ ...p, description: e.target.value }))} />
+ : {viewingExpense.description || '—'} }
+
+
+ Date
+ {expenseDetailEditing
+ ? setNewExpense(p => ({ ...p, date: e.target.value }))} />
+ : {viewingExpense.date ? new Date(viewingExpense.date + 'T12:00:00').toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }) : '—'} }
+
+
+ Category
+ {expenseDetailEditing
+ ?
+ : {viewingExpense.category || '—'} }
+
+
+ {expenseDetailEditing && (
+ Notes
+ {expenseDetailEditing
+ ? setNewExpense(p => ({ ...p, notes: e.target.value }))} />
+ : {viewingExpense.notes || '—'} }
+
+
+ )}
+ Receipt / Photo
+ setNewExpense(p => ({ ...p, receipt: e.target.files?.[0] || null, removeReceipt: false }))} />
+ {!newExpense.receipt && newExpense.receipt_path && (
+
+ {newExpense.receipt_name || 'Existing receipt'}
+
+ )}
+
+ {expenseDetailEditing ? (
+ <>
+
+
+
+ )}
+ Receipt
+ {expensePreviewUrl ? (
+ isPdf
+ ?
+ : Loading preview…
+ )}
+ {expensePreviewUrl && (
+ Download Receipt
+ )}
+ e.stopPropagation()}>
|