Document engine, 2026

Invoice and Quotation Engine for Pehesara Engineers

In daily usePehesara Engineers, aluminium and glass

A phone-first app that produces invoices and quotations indistinguishable from the company letterhead, and every PDF it makes can be opened again for editing.

Windows6

PEHESARA ENGINEERS

Aluminium & Glass Fixing Specialists

QUOTATION

No. PE-0142

To: Client name, Colombo
Dear Sir,

Product or serviceQtyRateAmount
Aluminium sliding window, 1800 × 1200 mm, fitted638,500231,000.00
10 mm tempered glass partition240 sq ft1,150276,000.00
Aluminium door frame with fittings264,000128,000.00
Installation and site labour185,00085,000.00
Subtotal
Rs. 720,000.00
Discount (5%)
minus Rs. 36,000.00
Total
Rs. 684,000.00
Advance required (50%)
Rs. 342,000.00
Balance
Rs. 342,000.00

Thank you.

Pehesara Engineers · stand-in signature

TERMS & CONDITIONS Any additional work or changes will be charged separately. Delivery or installation timelines may vary depending on site conditions and material availability.

The letterhead layout assembling line by line. Illustrative figures, not a real invoice, and the signature is a stand-in.
Python version pinned to end the Streamlit Cloud crashes
3.12
Databases needed to reopen a document: the PDF carries its data
0
Document types from one form, invoice and quotation
2

The problem

Pehesara Engineers is a family aluminium and glass fixing firm. Its invoices and quotations were Word documents, edited by hand for every job, including the documents for Hayleys PLC’s Farmers Building refurbishment. When the client is a listed company, a mistyped figure or a misaligned letterhead is not a small thing.

The constraint

  • Faithful, not inspired by. The PDF had to be indistinguishable from the company letterhead: the black-to-red bars, the layout, the signature and the terms and conditions.
  • Exact figures. Line items, discount, tax, total, an advance payment request and the balance, formatted the same way every time.
  • From a phone. Quotations are often needed on site, by someone who is not going to open a laptop.

The decision

A Streamlit form, a ReportLab renderer, and a lot of care in between.

  • Typography by metrics. The Word documents used Calibri. Carlito is its open, metric-compatible twin, so it is embedded in the PDF and every line breaks exactly where Word broke it.
  • Totals computed once. Subtotal, discount, tax, total, advance and balance are calculated in one place and formatted by one function, so the page can never disagree with itself.
  • The PDF remembers. After the document is drawn, the form data is appended to the file behind a %PEHESARA-DOC-V1: comment line. PDF readers ignore it and the app reads it back. Upload last month’s quotation and it becomes an editable form again, with no database and nothing extra to host.

The outcome

Most of the engineering story is about the host. Streamlit Community Cloud started pulling newer pandas and pyarrow builds that crashed the items table with a segmentation fault, and it could choose a Python version for which the pinned packages had no prebuilt wheels, so the build itself failed. The fix was to pin what the app actually imports (Streamlit 1.50 and ReportLab 4.2.5), pin the runtime to Python 3.12, and document the one deployment setting that matters for whoever deploys next.

Then a mobile pass, because the people using it are on phones. The engine is in daily use for the firm’s invoices and quotations.