Rodolfo Gaspary
Back to the index

Mallas Trujillo

A safety-netting company was quoting by hand: measure on site, work out the area, apply whichever discount applied, and assemble the document. The system turns that into a form and a printable quote, and puts pricing in the owner's hands.

Role
Design and full development
Client
Mallas Trujillo
Stack
PHP, MySQL, PDO, Bootstrap
Scope
Quoting, history and pricing
Source
View repository

The problem

The cost of an installation depends on total area, and the area depends on how many panels were measured on site. On top of that sit volume discounts, additional costs that vary with access difficulty, and an installation minimum below which the job stops being worth doing. Done by hand, every quote is a different spreadsheet, and every arithmetic slip is either lost money or an unhappy client.

Pricing lives in the database

The decision that defines the system is that the price per square metre and the three area-based discount tiers are not in the code: they are in a table, editable from a screen inside the system. When material costs rise, the owner changes a number and every subsequent quote uses the new value. Nobody has to call the developer, and there is never one version of the price in the app and another in the salesperson's head.

The server recalculates the total

The form calculates as the user types, so they see the figure before saving. But on save, the server recomputes everything from the stored line items — area, subtotal, discount, extras and the installation minimum — and writes that result. The browser proposes; the database decides. The whole operation runs inside a transaction, so a quote is never left half-saved.

PDF without a PDF library

The quote is delivered as a PDF, but the system does not generate PDFs. It renders a page with a print stylesheet — A4 size, margins, forced colours — and lets the browser export it. No dependency to maintain, and it works on the phone the installer carries to site. The mobile version shows instructions instead of firing the print dialog, because the save-as-PDF flow on a phone is not obvious to anyone who hasn't done it before.

The rest of the system

The repository holds the local development version. This page describes the approach and architecture; the code is published as it stands.