> ## Content Index
> Fetch the complete content index at: https://blog.melardenio.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Four PDFs a Month: Teaching My Tracker to File Its Own Invoices
- URL: https://blog.melardenio.com/four-pdfs-a-month-teaching-my-tracker-to-file-its-own-invoices/
- Published: 2026-11-06T00:18:31.000Z
- Updated: 2026-11-06T00:18:31.000Z
- Author: Rommell Ardenio
- Tags: Software & Homelab, AI & Automation

*A friend dropped by while I was wrapping this up and asked what I'd been busy with. This is more or less how that conversation went.*

**Friend:** You look tired but happy. What did you build this time?

**Me:** Something small that's been bugging me for months. Every month our telecom provider emails me their invoices, one PDF per line we lease. And every month somebody has to download each PDF and upload it by hand to the right bill in our liquidation tracker. Until that's done, nobody can request the payment.

**Friend:** So you automated the downloading?

**Me:** The whole trip. Now my Outlook forwards those emails to a Gmail inbox, a little n8n workflow reads the PDF, finds the right bill, and attaches it. Then it emails the person who handles payments and shows a small badge in the tracker that says "hey, something's waiting for you."

## "How does it know which bill?"

**Friend:** Isn't the account number enough to find the bill?

**Me:** That's what I thought too! Then I checked the data. All four of our lines share the *same* account number. If I'd matched on that alone, every PDF would've matched four bills. Good luck guessing the right one.

**Friend:** So what's the trick?

**Me:** Page two of every invoice has a circuit ID, and each PDF has exactly one. So the match is account number *plus* circuit ID, and the billing period picks the month. The circuit IDs were already written in the notes of each biller, so I just gave them their own proper field.

## "Why not just let it file everything automatically?"

**Me:** Because a wrong attachment is worse than no attachment. So nothing goes straight through. Every invoice lands as "awaiting review," and the bill can't move to payment until a person confirms it. If anything looks off (unknown circuit, bill already paid, a PDF already there), it doesn't guess. It just emails the team with the PDF and says "please handle this one by hand."

**Friend:** And the amount? Doesn't it read the total from the PDF?

**Me:** On purpose, no. These are fixed monthly charges, and the "total amount due" on the invoice also includes old unpaid balances. If I'd copied that number, a fifty-thousand bill would suddenly show as more than a hundred thousand. So the amount on the bill is never touched.

## "Did anything break?"

**Friend:** Come on, something always breaks.

**Me:** (laughs) A few things. The funniest one: my first version rejected *every single invoice*. It looked for invoice numbers on the PDF and found three instead of one. Turns out the bottom of every page prints the official series range, something like "from number one to number nine-hundred-ninety-nine-million." My code thought those were invoices too. I fixed it to read only the line that literally says "Invoice No." on page two.

**Friend:** Classic.

**Me:** And there was a sneaky one. I almost didn't notice that the forwarded emails would also land in the inbox our *other* invoice workflow watches, the one that reads our biggest client's invoices with AI. It would've tried to encode a telecom bill as a client invoice. One line in its filter, "ignore anything that says this provider," and that was solved before it could ever happen.

## "Who checked your work?"

**Me:** This is the part I enjoyed most. I built it with Claude, and instead of one long session, each piece was built by one AI helper and then checked by a *different* one that hadn't seen the work before. The reviewers caught real gaps. One of them noticed that a bill already approved could still sneak an unreviewed invoice through to payment. Another found that if someone cancelled a bill, the little badge would stay stuck forever with no way to clear it.

**Friend:** So the robots argued with each other.

**Me:** Politely! And I still had the final say. Deploying to production, saving the secret key, creating the email rule: those stayed my clicks. At one point the AI even stopped itself and said "this step handles a secret, you should do this part." I liked that.

## "So, worth it?"

**Friend:** All that for four PDFs a month?

**Me:** It's not really about the four PDFs. It's about nobody having to remember, nobody forgetting, and payments not getting stuck because a file is sitting in someone's inbox. Plus the same pattern works for any vendor that sends clean PDFs. The first real run is when the December invoices arrive. I'll tell you how it goes.

**Friend:** Buy me coffee if it works.

**Me:** Deal. And if it doesn't, you'll hear about that too. That's half the fun of writing these.