diff --git a/src/components/unit-profile/UnitLedgerTransactionForm.tsx b/src/components/unit-profile/UnitLedgerTransactionForm.tsx index fe8d72f..1897176 100644 --- a/src/components/unit-profile/UnitLedgerTransactionForm.tsx +++ b/src/components/unit-profile/UnitLedgerTransactionForm.tsx @@ -357,8 +357,15 @@ export default function UnitLedgerTransactionForm({ open, onOpenChange, unitId: } const numAmount = parseFloat(formData.amount); - if (!formData.amount || isNaN(numAmount) || numAmount <= 0) { - toast({ variant: "destructive", title: "Invalid Amount", description: "Please enter a valid positive amount." }); + // Allow a $0.00 charge (used as a note/memo on the ledger). Payments and + // prepayments still require a positive amount. + const allowZero = ["Charge", "Expense", "WriteOff"].includes(formData.type); + if (isNaN(numAmount) || numAmount < 0 || (numAmount === 0 && !allowZero)) { + toast({ + variant: "destructive", + title: "Invalid Amount", + description: allowZero ? "Please enter a valid amount ($0.00 is allowed)." : "Please enter a valid positive amount.", + }); return; }