1.6 KiB
1.6 KiB
| name | description |
|---|---|
| invoice-generator | Generate and send time tracking invoice Excel files from FreeScout data. Use when the user asks for an invoice, time report, or hours summary for a customer and time period. |
Invoice Generator
Generate Excel invoices from FreeScout time tracking data and send them via WhatsApp.
Workflow
- Identify customer name and date range from the user's request
- Run:
bin/freescout excel --from YYYY-MM-DD --to YYYY-MM-DD --customer "NAME" --output /tmp/invoice-CUSTOMER-PERIOD.xlsx - Send the file to the user via the
messagetool - Reply with NO_REPLY (the file message is the reply)
CLI Reference
freescout mailboxes # List mailboxes
freescout users # List users
freescout report --from DATE --to DATE # Show time report (tab-separated)
[--mailbox ID] [--user ID] [--customer NAME]
freescout excel --from DATE --to DATE # Generate invoice Excel
[--mailbox ID] [--user ID] [--customer NAME] [--output file.xlsx]
Technical Details
- Credentials:
.credentials/services.env(CLOONAR_DB_* + FREESCOUT_DB_NAME) - Queries timelogs table directly (API doesn't expose time tracking)
- Excel groups by conversation, shows subject, customer, website, hours
- Customer and Website are custom field dropdowns (resolved to labels)
time_spentis stored in seconds, displayed as decimal hours- Only timelogs within the date range are counted (not conversation dates)
Finding Customers
Pass a wrong --customer name — the script prints all available customers.