← The Machine Room · Case file 009: Sales Quotation Automation Used on real customer quotes · Sheet 1 of 9
Case file: Sales Quotation Automation, from enquiry to priced quotation Drawing no. AH-CS-009

Quotations that took hours were priced in minutes, and no price came from AI.

A quotation system for a UAE engineering company’s water-meter sales. AI reads the customer’s enquiry and never sees the price list: fixed rules and the company’s own Excel costing sheet set every price, and the sales engineer keeps the margin.

Enquiry email → line items → product by rule → price by formula → customer offer
3decisions stay with the sales engineer on every quote: margin, freight and clearance, delivery time Verified
0
Prices written by AI. AI never sees the price list; every price comes from it through fixed rules and the costing sheet’s formulas Verified
Drawn byAbu Huraira Mukhtar
RoleDesigner and sole developer
AI boundaryReads the enquiry, never the price list
ProductsResidential and bulk water meters
OutputThe company’s own Excel workbook
OrganisationWithheld; UAE engineering company
StatusUsed on real customer quotes
SourceSource code and project records
Sheet 2 of 9: In briefThe case in four parts

01 · The short version

The problem
Every enquiry was priced by hand. For each line the sales engineer searched the price list, converted the supplier’s price, added freight, fittings and margin, then typed it again into the offer template. A large quote took two to three hours Estimate, and an engineer could see 10 to 20 large enquiries a month Estimate.
What I built
A system that reads the enquiry email and returns the company’s own Excel workbook: a costing sheet built from formulas and a customer offer linked to it. AI only reads the enquiry. Fixed rules choose every product, and the costing sheet prices it from the price list.
How it went
It was used on real customer quotes. A large quote was ready to check in about five minutes Estimate, and every price came from the price list. The margin, freight and delivery time stayed the engineer’s decision on every quote.
What you’d get
The same system on your own price list and costing rules, writing into the offer template your team already uses. AI reads your enquiries and never sees your price list. Your engineers check and send every quotation.
Sheet 3 of 9: Field notesThe before-state

02 · Every quote was priced by hand

A contractor’s procurement team emails a list of water meters for a building: sizes, flow rates, M-Bus or radio, quantities. Nothing can go back until every line is priced.

For each line, the sales engineer finds the product by size and protocol in the price list, converts the supplier’s price into dirhams, and adds freight and clearance, the fittings and the margin. Then every line is typed again into the offer template, with VAT, the letterhead and the customer’s details, and checked against the costing sheet.

The time grows with the lines. A small quote took at least 30 minutes, and a large one with several sizes and variants took two to three hours Estimate. A sales engineer could see 10 to 20 large enquiries a month Estimate.

That is selling time spent on typing. In a busy week, enquiries queue for the back office while the customer waits for a price, and every figure typed twice is one more chance to misprice.

General notes
1. Two ultrasonic water-meter lines, residential and bulk, from a European manufacturer
2. Supplier prices in foreign currency; offers in dirhams with 5% VAT
3. The company’s own costing sheet and offer template
4. Organisation withheld: detail available in interview
Fig. 1: Where a quote’s time wentBefore the system
Sheet 4 of 9: Before and afterOne enquiry, step by step

03 · AI reads; it never prices

The system draws one hard line. AI reads the email and lists what the customer asked for. Past that line, only fixed rules and the company’s own formulas touch a number, and every commercial decision stays with the engineer.

StepBy handWith the system
Read the enquiryRead the email and its list, line by lineThe engineer drops the email into the system and sets the margin, freight and delivery time. AI reads who is asking and the items they asked for
List the itemsCopy each size, flow rate, protocol and quantity into the costing sheetAI turns the customer’s text into line items. When it cannot read a list it can trust, it does not guess one
Choose each productSearch the price list for each size and protocol, line by lineFixed rules choose: same type, same protocol, the exact size or else the nearest one, then the shortest body. AI has no part in this step
Price itConvert the currency, add freight, fittings and margin, with a calculator beside ExcelAI never sees the price list. The costing sheet prices every line with formulas: supplier price, freight, exchange rate, fittings, margin
Write the offerRetype every line into the offer template, then add VAT, the letterhead and the customer’s detailsThe offer’s lines are formulas that point at the costing sheet, with the customer’s details, the delivery time and VAT filled in
Check and sendCheck every figure against the costing sheet, or wait for the back officeThe engineer checks one workbook and sends it. Nothing goes to a customer automatically
What the engineer receivedOne enquiry and the workbook it produced, redrawn in outline with fictional names and prices
1. The enquiry. The engineer drops the email file into the system and sets three things: margin 20%, freight and clearance 18%, delivery 8 to 10 weeks.
Try the link between the sheets
Margin on the costing sheet

Each unit price on the offer is a formula such as ='Costing Sheet'!N2, so a change on the costing sheet reprices the offer, with its subtotal, VAT and total.

Every figure here follows the same arithmetic as the real workbook.

Costing sheet, internalFacsimile, fictional prices
N2fx=L2/(1-0.2)=L2/(1-0.25)
#ItemSupplier €Landed AEDQtyUnit AED @20%@25%Line AED
1RW-15-MB Residential DN15 M-Bus39.00184.08120230.10245.4427,612.0029,452.80
2RW-20-MB Residential DN20 M-Bus45.00212.4024265.50283.206,372.006,796.80
3BW-50-RD Bulk DN50 radio411.001,939.9222,424.902,586.564,849.805,173.12
4BW-40-RD Bulk DN40 radio366.001,727.5212,159.402,303.362,159.402,303.36

Line 4: the customer asked for DN32. The bulk range has no DN32, so the rule took the nearest size, DN40. The sheet did not mark the swap, so it rested on the engineer’s check.

Landed = supplier € × 1.18 freight × 4.00 rate
Total cost32,794.56
Total price40,993.2043,726.08
Profit on cost25.0%33.3%
Margin on price20.0%25.0%
Costing sheetOffer
2. The costing sheet. Every price is a formula: landed cost from the supplier’s price, freight and the exchange rate, then unit price = cost ÷ (1 − margin). A 20% margin on the price is a 25% mark-up on cost. The real sheet also adds the fittings to each supplier price and costs the tailpieces in their own columns; the facsimile leaves both out.
Customer offerFacsimile, fictional
Commercial offerCompany letterhead
OfferQ-0118/26
ToHarbourline Contracting
AttnRana Haddad
ProjectMarina Heights, Tower B
Your refDEMO-RFQ-118
I20fx='Costing Sheet'!N2
#Item and descriptionQtyUnit price AEDTotal AED
1RW-15-MB Residential DN15 M-Bus120230.10245.4427,612.0029,452.80
2RW-20-MB Residential DN20 M-Bus24265.50283.206,372.006,796.80
3BW-50-RD Bulk DN50 radio22,424.902,586.564,849.805,173.12
4BW-40-RD Bulk DN40 radio12,159.402,303.362,159.402,303.36
Subtotal40,993.2043,726.08
VAT 5%2,049.662,186.30
Total AED43,042.8645,912.38

Delivery: 8 to 10 weeks from payment confirmation.

Costing sheetOffer
3. The customer offer. The second sheet of the same workbook: letterhead, offer reference, the customer block read from the email, the lines linked to the costing sheet, VAT and the delivery time. The engineer checked it and sent it.
Sheet 5 of 9: Approval plateWhat the case rests on

04 · Minutes per quote, no price from AI

2–3 h → about 5 minA large quote, from the email arriving to a checked offer ready to send. A small one took at least 30 minutes by hand, and an engineer could see 10 to 20 large enquiries a monthEstimate
0 prices by AIAI never saw the price list. Every price came from it, through fixed rules and the costing sheet’s formulasVerified
3 decisionsStayed with the engineer on every quote: margin, freight and clearance, delivery time. The engineer checked and sent every offerVerified
1 workbookThe company’s own Excel template: the costing sheet and the customer offer, linked by formula. Nothing new for the team to learnVerified

How I’d start in your company

I’d start with your last ten quotes: the enquiries that came in and the offers that went out.

They show how long your quotes take, which rules already decide your prices, and which decisions must stay with your engineers. The first version writes into the costing sheet and offer template your team already uses, so every quotation still goes out on your letterhead, checked by your engineer.

Discuss a system like this
Sheet 6 of 9: General arrangementDrawing 009-A

05 · Built around the boundary

The system was a single Python web page. The model’s job ended at reading text: it never saw the price list, and choosing products and every figure on the sheets belonged to code and Excel formulas.

A Streamlit page took the email file and the three settings. OpenAI assistants each did one reading job and answered in JSON: the customer and the product text, whether that text was enough to quote, a separate check of that verdict, and the line items. Plain pandas code then matched each line to the catalogue.

openpyxl copied the company’s workbook template and wrote formulas into it, inserting a row per line with the template’s formatting, merged cells and letterhead image kept in place. The output was one .xlsx with two sheets for the engineer to download.

As built
Python, Streamlit, OpenAI Assistants API, MarkItDown, pypdf, pandas, openpyxl
One reading job per model call; no call is sent a price Verified
Template, price list and catalogue fetched from a shared drive
Fig. 2: The system’s general arrangementFunction names are the source code’s
Detail A, see fig. 2, where the work splits

AI reads, rules price

The model turns free text into fields: who the customer is and what they asked for. It never sees the price list. Product choice and every figure come from code and formulas.

Chose to stop the model at reading, because a price must be repeatable and explainable to a customer. Cost: the rules know only the catalogue they were written for, so a new product range needs new rules. Gained: the same line items always price the same way, and every price traces to the price list.
Detail B, the workbook

Live formulas in the company’s template

Each costing line is written as formulas such as =(D2*F2)*(E2) and =L2/(1-0.2), and each offer line points at it with ='Costing Sheet'!N2. Totals use SUMPRODUCT, VAT 5%, profit and margin.

Chose to write live formulas into the company’s own template, because the engineer must be able to change a cost or the margin after the run and see the offer follow. Cost: the code writes to fixed rows and columns, so a change to the template’s layout breaks it. Gained: any figure can be audited in Excel, and the offer cannot drift from its costing.
Detail C, see sheet 7, step 5

Nearest size, then shortest body

Within the requested type and protocol, the rule takes the exact size and the shortest meter body. With no exact size, it takes the nearest size the catalogue holds for that type and protocol, then the shortest body. If nothing fits, it stops with an error.

Chose to take the nearest size, because enquiries name sizes a range does not stock, and the engineer still checks every line. Cost: a nearest size has to be caught in the engineer’s check. Gained: every line came back priced, and an impossible line stopped the run without a guess.
Detail D, see sheet 7, step 3

Stop when unsure

One call judges whether the product text is enough to quote; a second, separate call checks that verdict against the text it came from. A flagged verdict counts as not found, and nothing is priced from that text.

Chose to stop when unsure, because a wrong line on an offer costs more than typing a list by hand. Cost: a messy enquiry still needs the engineer. Gained: every priced line came from text that passed the check, or from the engineer.
Sheet 7 of 9: Section A-A, one enquiryDrawing 009-B: cut through one run

06 · The model reads; code writes every figure

Follow the fictional enquiry from sheet 4 through the system, from the dropped email to the workbook. The left edge of the drawing shows who does each step.

Fig. 3: Section A-A, one enquiry through the systemFictional enquiry; the steps and formulas are the code’s
Beat 1: the engineer’s settings

1Drop and set

The engineer drops the .eml file into the page and sets the margin, freight and clearance, and the delivery time, then presses one button. For this enquiry: 20%, 18%, and 8 to 10 weeks.

Beat 2: the customer

2Read the customer

The email’s HTML is cleaned and converted to Markdown with its From, To and Subject lines. The first call returns the company, address, project reference, contact person, phone, fax and email, and the product text as the customer wrote it.

Beat 3: is it enough to quote?

3Judge, then check

A second call judges whether the product text is enough to quote. A third, separate call checks that verdict against its source, and a flagged verdict counts as not found.

Beat 4: text becomes lines

4List the line items

The fourth call turns the product text into line items, each with a type, a size in DN, a flow rate, a protocol and a quantity. This is the last thing the model does.

Beat 5: code chooses

5Choose each product

Code filters the catalogue by meter type and by radio or M-Bus, then takes the exact size with the shortest body. The bulk range has no DN32, so line 4 gets the nearest size, DN40. Lines that land on the same item code have their quantities added together.

Beat 6: every figure a formula

6Cost each line

openpyxl writes each line into a copy of the template as formulas: supplier price plus fittings, times freight, times the exchange rate, plus the tailpiece; then unit price = cost ÷ (1 − margin). Totals follow: cost by SUMPRODUCT, price, VAT 5%, profit and margin.

Beat 7: the offer, and the engineer’s loop

7Link the offer

The offer’s item, description, quantity and unit price point at the costing sheet. The letterhead, offer reference, customer block and delivery line are filled in, and the engineer downloads one workbook. Change the margin on the costing sheet and the offer reprices. Nothing is sent until the engineer sends it.

Sheet 8 of 9: For your teamWhat a team version adds

07 · What a version for your team adds

The system covered two product lines. A version for your team keeps the same boundary, with AI reading and your rules pricing, and adds what a team needs.

Each row is one part of the system: what it does, and what your version adds.

Row
Part
What it does
Your version adds
A
Products and prices
Two product linesWater meters, priced from the company’s price list
Your catalogueEvery product you sell, with prices and rates on a settings sheet your team keeps up to date
B
Enquiries
The emailReads the enquiry email and the list in its body
Attachments tooSchedules sent as PDF or Excel files, read with the same check
C
Substitutions
Checked by the engineerWhen a range lacks the size asked for, the nearest one is picked and the engineer checks every line
Marked on the sheetEvery substitution marked on the costing sheet for review
D
Access
One web pageA page the sales engineer opens to run a quote
Your sign-inBehind your company sign-in, with every quote and every change logged
E
Quality
A reading checkEach reading of an enquiry is checked against the email before anything is priced
A test setYour past enquiries and checked offers, rerun on every change
F
Results
A workbook per quoteEach quote ends as a workbook for the engineer to check and send
A quote registerEvery quotation logged when it is sent, so response time and win rate can be measured
Engineering recordChecked in the source code
4Model calls in the traced run, each with one reading job; none is sent a priceVerified
12Formulas written for each quoted line: seven on the costing sheet, five on the offerVerified
2Sheets in one workbook, the offer’s lines linked to the costing sheet by formulaVerified
Sheet 9 of 9: Close-outPlain voice

08 · How to read the figures

The times on this page are estimates from doing the work, by hand and with the system. Everything else is checked in the source code.

In the code, no price came from AI, and the offer was linked to the costing sheet by formula. The margin, freight and delivery time were the engineer’s on every quote. The 10 to 20 large enquiries a month is an estimate too.

The system covered two water-meter product lines. The method fits any business that prices from a catalogue: the rules and the template are written for yours, and AI still only reads the enquiry.

Discuss a system like this
Scope
Times: estimates
Prices: price list, rules and formulas
Product lines: two
Output: the company’s Excel workbook
Drawn & built by
Abu Huraira Mukhtar, designer and sole developer
A. H. M.
Sheet 9 of 9
End of case file 009
The Drawing Office: after hours

Give your engineers their hours back, and keep every price in your own rules.

If your sales engineers spend their evenings retyping price lists into offer templates, the fix starts with your last ten quotes. Bring them.

Contact me Back to the Machine Room
Next case file: 001 ProcessOS: a client document portal Sheet 1 of 9