From 3d264130b9be0b9fa4d4d669a5abf7e5ccdfd51b Mon Sep 17 00:00:00 2001 From: renee-png Date: Mon, 8 Jun 2026 12:15:48 -0400 Subject: [PATCH] Checks: print the General Settings mailing address as the return address Banking check printing hardcoded companyAddress: undefined, so the association mailing/office address (accounting.companies.address, set in General Settings) never printed below the name. Now loads and passes it. Bills check printing falls back to the company name/address when no company_check_layouts payer is set. Co-Authored-By: Claude Opus 4.8 --- src/pages/accounting/AccountingBankingPage.tsx | 6 ++++-- src/pages/accounting/AccountingBillsPage.tsx | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pages/accounting/AccountingBankingPage.tsx b/src/pages/accounting/AccountingBankingPage.tsx index 57ac34c..7cfa733 100644 --- a/src/pages/accounting/AccountingBankingPage.tsx +++ b/src/pages/accounting/AccountingBankingPage.tsx @@ -376,6 +376,8 @@ export default function AccountingBankingPage() { }) => { const cs = checkSettings as any; const bankAccount = (bankAccounts as any[]).find((a) => a.id === bankAccountId); + // Return address = association name + mailing/office address from General Settings. + const { data: companyInfo } = await accounting.from("companies").select("name, address").eq("id", cid).maybeSingle(); await accounting.from("checks").insert({ company_id: cid, @@ -397,8 +399,8 @@ export default function AccountingBankingPage() { } const dataUrl = generateCheckPDF([{ - companyName: associationName ?? "Association", - companyAddress: undefined, + companyName: (companyInfo as any)?.name ?? associationName ?? "Association", + companyAddress: (companyInfo as any)?.address ?? undefined, bankName: cs?.bank_name ?? bankAccount?.name ?? undefined, bankAddress: cs?.bank_address ?? undefined, routingNumber: cs?.routing_number ?? undefined, diff --git a/src/pages/accounting/AccountingBillsPage.tsx b/src/pages/accounting/AccountingBillsPage.tsx index aa3439a..936037e 100644 --- a/src/pages/accounting/AccountingBillsPage.tsx +++ b/src/pages/accounting/AccountingBillsPage.tsx @@ -360,9 +360,11 @@ export default function AccountingBillsPage() { .from("company_check_layouts") .select("payer_name, payer_address, show_payer_block") .maybeSingle(); - const payerName = (layout?.payer_name || "").trim(); + // Fall back to the association's General Settings name/address (accounting.companies). + const { data: companyInfo } = await accounting.from("companies").select("name, address").eq("id", cid).maybeSingle(); + const payerName = (layout?.payer_name || "").trim() || ((companyInfo as any)?.name ?? ""); const showPayer = layout?.show_payer_block !== false; - const returnAddress = showPayer ? (layout?.payer_address || undefined) : undefined; + const returnAddress = showPayer ? (layout?.payer_address || (companyInfo as any)?.address || undefined) : undefined; const dataUrl = generateCheckPDF( [{