How Customer Statements and Exports Work
Source: `customers_controller.rb`
- Customer statements only include customers who have a positive balance; zero-balance customers are excluded
- Statement constraint types control which customers are included:
email_onlyfilters to customers with an email address,print_onlyfilters to customers without an email, anddefaultincludes all customers - The
include_paidtoggle controls invoice filtering: when true, all non-voided invoices are shown; when false, only invoices withbalance_due > 0appear - CSV export of customer data is deferred to a background job and limited to one concurrent export request per company, with a 2-minute queue delay between requests
Support scenarios
- "A customer isn't appearing on the statement run" → Statements only include customers with a positive balance. If the customer's balance is zero or negative (credit), they won't appear. Also check the constraint type -- email_only excludes customers without email addresses.
- "The CSV export is taking a long time" → CSV exports are background jobs limited to one at a time per company with a 2-minute queue delay. If another export is already running, the new one waits. Let the current export finish before starting another.
- "The statement shows invoices that are already paid" → The
include_paidtoggle is likely set to true, which includes all non-voided invoices regardless of balance. Set it to false to show only unpaid invoices.