mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 01:40:01 +00:00
Accounting platform: remove Zoho, unify reports, board access, vendor sharing
- Remove the Zoho Books integration (edge functions, sync libs, settings, reports/overview, banking links, fees tab, import dialog); preserve fee rules as a standalone FeesTab and the COA accounting_system classification. - Financial Overview/Reports (staff + board) render the Accounting dashboard and reports; board reports mirror the rich Accounting Reports. - New Reserve Fund Schedule report + an is_reserve flag on accounts. - Unify all report exports to a branded format (logo + centered header + footer): shared ReportSheet (on-screen) and reportHeader (PDF). Budget vs Actuals and Bank Reconciliation PDFs now match the reference layout. - Render financial reports inline (no preview pop-up). - Budget Management mirrors Accounting Budgeting (staff-accessible) with SPA navigation; editable bills in the Accounting Bills page. - Negative opening balances flow through to the GL and reports (allow negative input; keep non-zero on save; signed CSV import). - Upload a per-account trial balance via CSV on Opening Balances. - Board members: read-only RLS access to their association's accounting ledger; editable board-members panel on the association page; share vendor contacts with the board (toggle + directory section). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,8 @@ export type RenderOpts = {
|
||||
showZero: boolean;
|
||||
/** Optional metadata lines for the header block (bold label + value). */
|
||||
meta?: { label: string; value: string }[];
|
||||
/** Preloaded logo (dataURL + dimensions) for the branded header. */
|
||||
logo?: { dataURL: string; w: number; h: number } | null;
|
||||
};
|
||||
|
||||
type RGB = [number, number, number];
|
||||
@@ -91,10 +93,16 @@ function buildReport(doc: jsPDF, report: StructuredReport, opts: RenderOpts): js
|
||||
|
||||
// Full header (page 1): title + metadata block + column header
|
||||
const drawFullHeader = () => {
|
||||
y = 50;
|
||||
doc.setFont("helvetica", "bold"); doc.setFontSize(14); doc.setTextColor(...TEXT);
|
||||
doc.text(report.title, ML, y);
|
||||
y += 20;
|
||||
// Branded logo (top-left) + centered title — matches the main reports.
|
||||
if (opts.logo) {
|
||||
try {
|
||||
const lh = 40; const lw = Math.min(150, lh * (opts.logo.w / opts.logo.h));
|
||||
doc.addImage(opts.logo.dataURL, "PNG", ML, 26, lw, lh, undefined, "FAST");
|
||||
} catch { /* ignore */ }
|
||||
}
|
||||
doc.setFont("helvetica", "bold"); doc.setFontSize(16); doc.setTextColor(...TEXT);
|
||||
doc.text(report.title, W / 2, 48, { align: "center" });
|
||||
y = 82;
|
||||
|
||||
const meta = opts.meta ?? [
|
||||
{ label: "Properties:", value: opts.companyName || "—" },
|
||||
@@ -114,24 +122,24 @@ function buildReport(doc: jsPDF, report: StructuredReport, opts: RenderOpts): js
|
||||
drawColHeader();
|
||||
};
|
||||
|
||||
// Continuation header (page 2+): title + column header only
|
||||
// Continuation header (page 2+): centered title + column header only
|
||||
const drawContHeader = () => {
|
||||
y = 50;
|
||||
doc.setFont("helvetica", "bold"); doc.setFontSize(12); doc.setTextColor(...TEXT);
|
||||
doc.text(report.title, ML, y);
|
||||
y += 16;
|
||||
doc.text(report.title, W / 2, 40, { align: "center" });
|
||||
y = 56;
|
||||
drawColHeader();
|
||||
};
|
||||
|
||||
const drawFooter = () => {
|
||||
const total = doc.getNumberOfPages();
|
||||
const created = new Date().toLocaleDateString("en-US");
|
||||
const gen = new Date().toLocaleString("en-US");
|
||||
const pages = total - firstPage + 1;
|
||||
// Footer only on content pages (skip any preceding cover page).
|
||||
for (let p = firstPage; p <= total; p++) {
|
||||
doc.setPage(p);
|
||||
doc.setFont("helvetica", "normal"); doc.setFontSize(8); doc.setTextColor(...MUTED);
|
||||
doc.text(`Created on ${created}`, ML, H - 28);
|
||||
doc.text(`Page ${p - firstPage + 1}`, contentR, H - 28, { align: "right" });
|
||||
doc.text(`Generated ${gen}`, ML, H - 28);
|
||||
doc.text(`Page ${p - firstPage + 1} of ${pages}`, contentR, H - 28, { align: "right" });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user