Invoice AutomationFinanceWorkflow

How I Automated Invoice Generation for Two Companies

Invoicing across two companies, two countries, and two currencies used to take hours. Here's how AI agents handle it in minutes.

H
Hichem Refes ·
How I Automated Invoice Generation for Two Companies

Digital Fennec bills in Algerian dinar. Allwebzone bills in British pounds. Different currencies, different tax requirements, different invoice formats, different banking systems.

For the first year, I generated invoices manually. It took roughly three hours per week when you add up the data collection, formatting, currency conversion, and triple-checking that the right tax treatment was applied to the right client in the right jurisdiction.

Three hours per week is 156 hours per year. That is nearly four full work weeks spent on a task that follows the same pattern every single time. I automated it.

The Problem in Detail

Invoicing seems simple until you do it across borders.

Different legal requirements. Algerian invoices need specific fields that UK invoices do not. UK invoices have VAT considerations that Algerian invoices do not. Getting either one wrong creates accounting headaches that are disproportionately expensive to fix.

Different numbering systems. Each company has its own invoice numbering sequence. Cross-referencing between them matters for financial reporting. Getting the numbering wrong means manual reconciliation at month-end.

Different payment terms. Some clients pay on 15-day terms. Others on 30. Some have milestone-based payments tied to project deliverables. Tracking which invoice is due when, across both companies, is the kind of detail that gets dropped when you are busy with actual work.

Currency complexity. When Allwebzone does work for a client but the cost is partially borne by Digital Fennec (shared infrastructure, for example), the intercompany transfer needs to be tracked at the exchange rate on the date of the work. This is not hard. It is just tedious and easy to get wrong.

AI Agent Blueprint — futuristic system architecture diagram
Free Resource

Want the blueprint behind this system?

The exact architecture, memory layers, and delegation patterns I use to run 50 agents across two businesses.

Get the AI Agent Blueprint →

The Automation Architecture

The invoice automation runs on three components.

A structured data layer. Every client engagement has a record in the database. The record includes the client entity, billing currency, tax treatment, payment terms, and the current invoice number sequence. When a new project starts, this record is created during onboarding. The invoice agent pulls from this record rather than requiring me to remember or look up the details each time.

A trigger system. Invoices are generated based on triggers rather than manual initiation. For time-based billing, the trigger is the end of the billing period. For milestone billing, the trigger is the completion of a deliverable (confirmed by the project management system). For recurring retainers, the trigger is the first of each month.

When a trigger fires, the agent pulls the client record, calculates the amount, applies the correct tax treatment, formats the invoice according to the company’s template, and drops it into my review queue.

A review and send pipeline. I review every invoice before it goes out. The agent presents the invoice with a summary: client name, amount, line items, payment terms, and any notes. I approve, edit, or reject. Approved invoices are sent to the client. Rejected invoices go back for correction with my notes.

The review step is fast because the data is already correct 95% of the time. I scan for errors rather than checking every field from scratch.

Building the Templates

Hichem watching Ayla orchestrate dual invoice streams flowing in parallel across two glowing holographic company dashboards
Hichem watching Ayla orchestrate dual invoice streams flowing in parallel across two glowing holographic company dashboards

Each company has its own invoice template. The templates encode the legal requirements for their jurisdiction.

Digital Fennec’s template includes the company registration number, the Algerian tax identification, line items with descriptions and amounts in dinar, and the total with any applicable taxes broken out.

Allwebzone’s template includes the UK company number, VAT registration, line items in GBP, VAT calculations where applicable, and bank details for BACS transfer.

Both templates are stored as structured formats that the agent fills in. The styling matches each company’s brand. The output is a PDF that looks professional and contains all required legal information.

Building the templates was the most time-consuming part of the setup. Not the visual design, but ensuring every legally required field was present and correctly positioned. I had my accountant review both templates before putting them into production.

The Currency Handling

Currency conversion comes up in two scenarios.

Client billing in non-home currency. Occasionally, a Digital Fennec client wants to be billed in euros or dollars instead of dinar. The agent converts at the day’s rate, notes the rate on the invoice, and keeps the home currency amount in the financial records for tax purposes.

Intercompany transfers. When one company incurs costs on behalf of the other, the transfer is logged at the exchange rate on the date of the expense. The agent pulls rates from a reliable API and maintains a log of all intercompany transactions for month-end reconciliation.

The currency handling is not sophisticated. It is just consistent. And consistency is what matters in financial operations where small errors compound into real problems.

What Changed After Automation

The three hours per week dropped to about twenty minutes. Most of that twenty minutes is review time. The actual generation is instant.

But the bigger change was accuracy. Manual invoicing had an error rate I never measured but know was not zero. Wrong payment terms on an invoice. Misapplied tax treatment. A typo in a line item description. These errors required correction emails, revised invoices, and occasional awkward conversations with clients.

Automated invoicing has had zero errors that reached a client in four months of operation. Every error the system has made was caught in my review step before sending.

The other benefit is visibility. Because all invoice data flows through the same system, I have a real-time view of outstanding receivables across both companies. Which invoices are pending, which are overdue, what the total outstanding balance is. Before automation, getting this view required pulling data from two different accounting systems and merging it in a spreadsheet.

What I Would Do Differently

If I were starting from scratch, two things would change.

Start with the data model. I built the invoice templates first and the data layer second. This meant retrofitting client records to match what the templates needed. Starting with a clean data model and building templates that pull from it would have been faster.

Integrate with accounting earlier. The invoices feed into accounting software for both companies. I set up this integration after the invoice system was running, which meant a month of invoices that needed manual entry into the accounting system. Connecting the two from the beginning would have saved that effort.

The blueprint covers the complete financial automation stack, from invoicing through reconciliation.

Get the blueprint

Invoice generation is exactly the kind of task AI should handle. Repetitive. Rule-based. High cost of errors. Low creative input required. If you are still doing this manually across multiple entities, it is the easiest automation win you will find.