Consulting
← Case studies

Custom software

A 76-tab Excel file, and one cell everything depended on.

farma.vitamina is a compounding pharmacy lab. Every formula is made to order, with its own supplies and its own cost. We built them a system that puts all of that in order and quotes straight from the customer's order, exactly as it arrives.

The problem

The spreadsheet grew along with the business.

76 tabs. One formula sheet per product, twelve dilution calculations, six sheets built for one doctor's specific order, and a quotation template held together with VLOOKUP.

Everything depended on one cell: the dollar rate. Change that number and the whole file recalculated.

A spreadsheet like that doesn't break with an error. It goes stale in silence. When we migrated the data, 118 of the 170 prices had fallen behind the supplies that fed them.

  • 76tabs in a single file
  • 191raw materials
  • 172products in the catalog
  • 62custom formula sheets

The diagnosis

Quoting was the bottleneck.

They called us to tidy up the spreadsheet. The first thing we did was look at where the lab's day was actually going.

In compounding, quoting isn't looking up a price on a list. The prescription arrives, you check whether the supplies are in stock, review the doses, calculate over a custom formula, and only then can you say what it costs. It's a step with professional judgment inside, and it was being done by hand, order by order, while the lab kept serving customers.

That's where we put the focus.

Understanding how the lab works came before writing the system. Where the process was worth tightening, we defined it with them.

Automatic quoting

The order comes in as it arrives.

Nobody writes to you with the exact product name. They send “2 NAC x60 and creatine”, they send a photo of the prescription their nutritionist wrote, they forward a list with three things mixed together.

That's the text that gets pasted into the system. Or the photo, dragged in or pasted straight from the clipboard. What comes back is the quotation, line by line, with the catalog product already identified and the price calculated.

magistralia.appreal recording
From the customer's message, on the real system (it runs in Spanish, like the lab). Demo data: the lab's information is confidential.

And from the photo of a handwritten prescription.

The same feature takes an image. The photo of a handwritten prescription goes in like text does, and the system reads it product by product.

Handwritten prescription: Ashwagandha 500 mg, NAC 600 mg, Creatine 250 g, Mg Aspartate.
magistralia.appreal recording

The system proposes. The pharmacist confirms.

Every line arrives with its confidence level in view. If something doesn't match exactly but there are close dose variants, instead of leaving a dead line the system proposes the nearest one and marks it as approximate, ready to correct in one click.

Nothing enters the quotation without a human looking at it. That's a design decision. In a lab, mixing up 4000 IU with 5000 IU isn't a typo.

Two things we learned testing it live

“x60” is not a quantity. At first the system read “NAC x60” and quoted sixty units. That “60” is the package size; the customer wanted two. Now only what's said explicitly counts as a quantity: “2 jars”, “give me 3”.

“NAC” is N-Acetyl Cysteine. The trade's abbreviations resolve on their own, with nobody maintaining a synonym table product by product.

What the model sees, and what it doesn't

We send it the catalog with names and units. No prices, no costs, no margins. It doesn't need them to do its job, so they never leave the system.

Variants and pricing

Any quantity gets a price.

A preparation sells in packs of 30, 60 or 90. But a doctor can prescribe 12 capsules, and that order needs a price too.

Instead of maintaining a price table per package size, we defined the pricing policy as a curve. The package sizes are points on that curve. Any quantity in between quotes itself, with the right volume discount.

The lab sees the curve drawn on screen, and sees which of its prices are pinned by hand outside it. Want a steeper volume discount? Move one number.

The jar doesn't multiply by 60.

In a formula, some things scale and some don't. 500 mg of magnesium per capsule scales with the order. The jar, the label and the box are one per batch.

The system keeps them apart. Without that distinction, doubling an order bills the packaging sixty times and the price comes out wrong, upward.

The output

It leaves the way it came in.

The order arrived by chat. The quotation goes back by chat.

One button copies it as formatted text, items numbered and the total in bold, ready to paste into the conversation. Another exports it as an image with the lab's brand, to send from a phone without touching a computer.

The text, ready to paste into the chat.
Quotation document with the lab's brand: 4 products and the total.
The branded image, to send from a phone.

Supplies and stock

Log one purchase and everything that depends on it falls into place.

You log that creatine came in at a new price. The system recalculates the cost of every product that uses it in its formula, and of every package size of those products.

Stock isn't stored anywhere. It's derived from what came in minus what got used, so it can't drift. Failed production runs subtract supplies too, because they spent them.

That's what the spreadsheet couldn't do: stay current without someone remembering to update it.

The interface

It handles like the spreadsheet they already knew.

They came from years of Excel. We could've made them learn a new system. We chose to make the system feel like what they already knew by muscle memory.

You edit inside the cell. Tab moves to the next one. Ctrl+F searches. Changes accumulate and save together, like hitting save on a spreadsheet. The catalog is in Spanish, and search finds “cafeina” even when it says “Cafeína”.

Profit shows as a multiplier because that's how they think about it and how they'd been calculating it.

magistralia.appreal recording
The grid navigates by keyboard, like a spreadsheet.

Why custom

We cleared the bottleneck that was keeping the business from growing.

farma.vitamina works to a quality standard that off-the-shelf software doesn't keep up with. Generic tools ask you to quote the way everyone quotes, and in a compounding lab that's not enough.

The brake wasn't doing the work. It was quoting it. Once quoting stops jamming the operation, the lab can take more orders without adding hours. That's what a system built to their measure made possible.

Is there a part of your business holding you back from growing? Tell us which one.