The "Generate Cycle Invoice" button on a customer's Rate Card creates a draft invoice in one click. It aggregates everything on the Rate Card into invoice line items for the current billing period and saves the invoice as a draft for you to review before sending.
The flow per customer is: open their profile, click Rate Card, hit "Generate Cycle Invoice." The system calculates the current billing cycle window based on the customer's cycle config, sweeps the Rate Card rows, and creates one line item per active site (plus one line item per Additional Charge on each site). Each line item shows the site name, the units, the rate, and the period — for example, "19201 Bagley Dr — Service for 4 Standard PT · $85.00/unit/month." A toast confirms the invoice was created and links you to it.
The invoice is created in draft status. It does not send automatically. You review it on the Financials tab, edit any line items if needed (you can inline-edit the unit price and total directly on the draft), and click Send when ready. The send flow generates the PDF, emails the customer, and updates the invoice status.
Click the button a second time for the same cycle and the system returns "Already billed" — duplicate prevention is built in. You can only have one Cycle Invoice per customer per cycle window from the rate card path.
If the customer has unbilled completed maintenance reports in the period, those are linked to the invoice line items automatically (so the "unbilled work" query stays clean and you have an audit trail of which service visits were covered by which invoice).
If a site has a missing or $0 rate, the line item is included with a "(rate not set)" flag in the description so you catch it during review instead of sending a $0 line to your customer. Fix the rate on the Rate Card row and the next cycle invoice will be correct.
