# Invoice sync - ops handover Version 0.9.1 · Written 2026-10-23 · Escalation: RPA dev team, Teams channel **#rpa-support** ## 1. What the bot does Every hour, Windows Task Scheduler starts the bot. It reads the finance export file `data/input/invoices.csv`, which has one approved invoice per row. It checks each row, then sends the invoice to the billing system over the internet. For every run it writes: - a report `data/output/sync_report_.csv`, with one line per invoice and a Status and Message for each; - a short line per invoice in `logs/sync.log`. The bot has no window and drives no desktop app. It talks to the billing system directly, so you can use the machine while it runs. ## 2. How it works ``` Windows Task Scheduler (every hour) └─ starts → Invoice sync (no window) ──sends invoices──> Billing system (online) │ ├─ reads → data/input/invoices.csv ├─ writes → data/output/sync_report_.csv └─ writes → logs/sync.log ``` - **Task Scheduler** starts the bot once an hour. Nothing else starts it. - **Invoice sync** is a background program with no screen. It works through the input file from top to bottom, one invoice at a time. - **Billing system** receives each invoice. It can accept it, reject it, say it already has it, or not answer. - **invoices.csv** is the finance export. The bot never moves, renames or empties it, so every hour it sends the whole file again. - **sync_report_….csv** is the only place where the reason for each result is written. - **sync.log** keeps the invoice number and status for every run, plus a "run done" line when a run finishes. **One run, step by step:** 1. Create a new report file named after the current date and time. 2. For each row of the input file: - Check the row: required fields filled in, and the amount is a number above 0. If the check fails, the row is **Invalid** and the bot moves to the next row. - Send the invoice to billing. - If billing does not answer, or answers with a temporary error, check whether billing already has the invoice. If it does, the row is **Synced**. If not, wait and try again, up to 5 tries in total. - Write the result to the report and the log. 3. Write `run done -> sync_report_