Client Invoicing & Reminders — business view
Technical trace: Client Invoicing & Reminders
1. Business Summary
Generates client invoices from POs/jobs/tasks, applies brand-specific templates, dispatches emails, manages reminders and pause/resume of reminders, syncs to SAP, and tracks payment status.
2. Business Value
Bills customers and tracks AR — primary revenue stream control.
3. Users / Stakeholders
Finance, AMs, clients, executives.
4. Workflows
- Aggregate jobs/tasks under PO into Client Invoice.
- Compute totals (price, discount, tax, extra fees, currency).
- Generate brand-specific PDF; email contacts.
- Submit to SAP; mark posted.
- Manage reminders via cron; pause/resume per dispute.
- Reconcile payments via SAP receive endpoints.
5. Sub-Features
- Invoice line items (jobs).
- Recipients (contacts).
- Mail logs.
- Brand-specific templates.
- Reminder schedules.
6. Business Rules
- An issue date threshold is hard-coded for SAP eligibility.
- Submitted-and-not-yet-posted invoices are eligible to sync.
- Currency conversion to a "main currency" is performed for reporting.
- Minimum price applied if configured.
7. Data Entities
Client Invoice, Client Invoice Job, Client Invoice Contact, Client Invoice Mail, Invoicing Status, Payment Status.
8. Entry Points
- Finance invoicing screens; common submit; SAP sync cron.
9. Inputs & Outputs
- Inputs: PO/jobs/tasks, account, currency, contacts, dates.
- Outputs: invoice record, PDF, emails, SAP records.
10. Integrations
- SAP, brand templates, email, Excel.
11. Calculations / Logic
- Tax, gross profit, total price, currency conversion, invoice aggregate.
12. Status Lifecycle
- Draft → submitted → SAP-posted → paid (via payment status).
13. Permissions
- Finance role, brand-scoped.
14. Reports & KPIs
- AR aging, days-to-pay, invoice volume, gross profit.
15. Risks & Observations
- Brand-template fragmentation drives maintenance overhead.
- Hard-coded SAP cutoff date and default currency code introduce silent business gaps.
- Reminder pause/resume relies on flags — easy to misconfigure.
16. Source Code Evidence
app/Plugin/finance/Model/{ClientInvoice, ClientInvoicesJob, ClientInvoicesContact, ClientInvoicesMail}.php.app/Controller/{SapController, ExportInvoicesController, CommonController}.php.