← Back to work

Case study

Invoice & Payables Management Platform

Custom-built for a pharmaceutical distributor.

A bespoke web application that replaced spreadsheets and manual tracking — giving a pharmaceutical distribution business full control over supplier invoices, payment deadlines, and cash-flow visibility. It then evolved into a multi-tenant SaaS platform that other companies can subscribe to.

Role
Design & development — solo
Type
Custom build → SaaS product
Industry
Pharmaceutical distribution
Localisation
Bulgarian business & EUR

The challenge

Tight margins, strict terms, high invoice volume

Pharmaceutical distributors operate on thin margins and strict supplier payment terms while processing a high volume of incoming invoices, credit notes, and debit notes. For the client, the day-to-day reality was:

  • Payment deadlines slipping through the cracks

    A missed due date strains supplier relationships and, in pharma, can disrupt the medicine supply chain.

  • No single source of truth

    Invoice data lived across spreadsheets and email, with no reliable view of what was owed, overdue, or already paid.

  • Partial payments were hard to track

    A single invoice is often paid in instalments, and reconciling that manually is slow and error-prone.

  • No accountability trail

    In a regulated industry, "who changed what and when" genuinely matters.

  • Bulgarian accounting specifics

    Reverse-charge VAT, credit/debit notes, EUR handling, and local date/number formatting that generic tools handle poorly.

What I built

A platform modelled on how a pharma distributor actually works

A tailored, Bulgarian-language platform that models the real workflow — not a generic accounting tool bent to fit.

Invoice & document register

  • Full lifecycle tracking for invoices, credit notes, and debit notes — the document types that actually occur in pharmaceutical trade (returns, rebates, discounts).
  • Scanned invoice / PDF attachments stored securely against each record.
  • Reverse-charge VAT support and multi-currency (EUR-ready).

Payments & cash-flow control

  • Full payment history per invoice, including partial instalments.
  • Automatic status derivation — unpaid, partially paid, paid, overdue, overpaid — always calculated from real payments, never entered by hand.
  • Record a payment directly from the invoice list for a fast daily workflow.

Deadline management & reminders

  • A live dashboard surfacing what's unpaid, overdue, due within 7/14 days, and paid this month — at a glance.
  • Automated email reminders for upcoming and overdue due dates, sent on a schedule so nothing is forgotten.

Suppliers & organisation

  • Contractor directory with fast autocomplete, EIK (company ID), IBAN, and contacts.
  • Custom categories, powerful filtering, and one-click Excel export for accounting.

Roles, permissions & audit

  • Role-based access (administrators vs. employees) with invoice-level ownership.
  • A complete audit log recording every change — who, what, when — for compliance and accountability.

Security, built in — not bolted on

  • Custom authentication with signed session tokens, hardened password hashing (bcrypt), and CSRF protection.
  • Rate limiting on login and registration to resist brute-force and automated abuse.
  • Email verification on sign-up, so only real, confirmed accounts gain access.
  • Defense-in-depth authorization checked on every request, resilient to known framework auth-bypass vulnerabilities.

From custom tool to product

Extended into a multi-tenant SaaS platform

What started as a single-company application became a repeatable product that other distributors and SMEs with the same pain points can subscribe to.

Strict tenant isolation

Every company's data is walled off at the data-access layer, so no tenant can ever see another's invoices.

Self-service onboarding

A company signs up, gets its own isolated workspace instantly, and starts on a trial.

Per-tenant branding

Each customer applies its own logo and colour scheme across the interface.

Technology

The stack

Built on a modern, type-safe stack and fully localised for Bulgarian business — dd.mm.yyyy dates, comma decimals, and EUR.

  • Next.js (App Router)
  • TypeScript
  • PostgreSQL
  • Prisma
  • Tailwind CSS
  • Vercel
  • Secure file storage
  • Transactional email (Resend / SMTP)

The outcome

Real-time visibility, zero missed deadlines, full accountability

A purpose-built system that gives a pharmaceutical distributor real-time visibility over its payables, eliminates missed payment deadlines, and enforces accountability through a full audit trail — and now serves as the foundation of a subscription SaaS product.

Have a project like this?

If you need a custom platform built with the same care, let's talk about it.