Accounting Banking: allow cash deposits with no homeowner

The Banking-page deposit form required a homeowner, blocking general/cash
deposits. Drop that requirement: a deposit still needs an income account, and
post_transaction_gl already books Dr Bank / Cr income when no customer is set
(vs. Dr Bank / Cr A/R with one). The Homeowner field is now optional with an
explicit "No homeowner (general deposit)" choice.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 22:35:33 -04:00
parent 215ecb3153
commit d18296c3a6
@@ -298,7 +298,8 @@ export default function AccountingBankingPage() {
if (!amount || amount <= 0) return toast.error("Amount can't be zero");
if (!coa_account_id) return toast.error(`${type === "credit" ? "Income" : "Expense"} account (COA) required`);
if (type === "debit" && !vendor_id) return toast.error("Vendor required for payments");
if (type === "credit" && !customer_id) return toast.error("Homeowner required for deposits");
// Homeowner is optional on a deposit: a cash/general deposit posts Dr Bank /
// Cr the chosen income account (no A/R). With a homeowner it clears A/R instead.
const coaName = (accounts as any[]).find((a) => a.id === coa_account_id)?.name ?? "";
const vendorName = (vendors as any[]).find((v) => v.id === vendor_id)?.name ?? "";
@@ -910,10 +911,11 @@ export default function AccountingBankingPage() {
</div>
) : (
<div>
<Label>Homeowner *</Label>
<Select value={txForm.customer_id} onValueChange={(v) => setTxForm({ ...txForm, customer_id: v })}>
<SelectTrigger><SelectValue placeholder="Select homeowner" /></SelectTrigger>
<Label>Homeowner <span className="text-muted-foreground text-xs">(optional leave blank for a cash/general deposit)</span></Label>
<Select value={txForm.customer_id || "__none"} onValueChange={(v) => setTxForm({ ...txForm, customer_id: v === "__none" ? "" : v })}>
<SelectTrigger><SelectValue placeholder="No homeowner (general deposit)" /></SelectTrigger>
<SelectContent>
<SelectItem value="__none">No homeowner (general deposit)</SelectItem>
{(customers as any[]).map((c: any) => (
<SelectItem key={c.id} value={c.id}>{c.name}</SelectItem>
))}