A command-line quotation generator for reinforcing steel sales. It builds multi-item quotations, prices each line by grade and size, applies VAT, assigns sequential quotation numbers, stores everything in SQLite, and exports a formatted text quotation.
Status: early-stage, functional. Command-line interface only. No external dependencies.
Preparing a rebar quotation manually means looking up the price for each grade and size, multiplying by quantity, adding VAT, numbering the document, and keeping a record of what was sent to whom. Done by hand, this is slow and error-prone, and there is no structured history of customers, projects, and quotations.
A small Python application that captures customer, project, and line items once, computes the totals, persists the record in a local database, and produces a clean text quotation ready to send.
- Multiple line items per quotation (grade, size, quantity in tons)
- Automatic unit pricing by grade and size from a central price list
- Subtotal, VAT (15%), and grand total
- Sequential quotation numbering (
Q-000001,Q-000002, ...) derived from the database - Quotation date and a 7-day validity date
- SQLite persistence: customers, projects, quotations, quotation items
- Text export of each quotation to
quotations/ - Listing of previously exported quotations
Supported grades: 60, 80 Supported sizes (mm): 10, 12, 14, 16, 18, 20, 25, 32
Each module has a single responsibility.
app.py User interface: menu, input, program flow. No SQL, no business logic.
database.py SQLite connection, schema creation, insert and lookup functions.
models/
item.py Item dataclass: grade, size, quantity, unit price, line total.
quotation.py Quotation: items, totals, dates, numbering, text formatting.
services/
price_service.py Price list and price lookup.
data/ SQLite database (created at runtime, ignored by git).
quotations/ Exported text quotations (created at runtime, ignored by git).
| Table | Purpose |
|---|---|
customers |
Customer name |
projects |
Project name, linked to a customer |
quotations |
Quotation number, dates, subtotal, VAT, grand total, linked to customer and project |
quotation_items |
Grade, size, quantity, unit price, total, linked to a quotation |
- Python 3.9 or later
- Standard library only:
sqlite3,dataclasses,pathlib,datetime
requirements.txt is intentionally empty.
git clone https://github.com/UKDean/SteelQuotationAssistant.git
cd SteelQuotationAssistant
python app.pyNo virtual environment or package installation is required, although a virtual environment is recommended if you extend the project.
======================================
Steel Quotation Assistant
======================================
1. Create New Quotation
2. View Quotations
3. Exit
- Choose
1, enter the customer name and project name. - Enter each item: grade (60 or 80), size (mm), and quantity in tons. Invalid grade or size combinations are rejected and you are prompted again.
- Answer
nwhen finished. The quotation is printed, saved to the database, and exported toquotations/quotation_N.txt. - Choose
2to list exported quotations.
Prices live in services/price_service.py as a PRICE_LIST dictionary keyed by grade and then size. Update this dictionary to reflect current pricing before use. VAT is fixed at 15% in models/quotation.py.
The suite covers the price lookup, quotation totals, VAT, validity dates, text output, and SQLite persistence. Database tests run against a temporary database, so they never touch data/steel.db.
python -m pip install pytest
python -m pytest -v
30 tests, all passing.
Quotation numbers can come from two different sources: database.get_next_quotation_number() reads from the database, while Quotation.get_next_number() counts exported text files. app.py uses the database, but the file-based fallback still runs when a Quotation is created without an explicit number, which can produce a duplicate number. Consolidating on the database as the single source of truth is pending.
Planned, not yet implemented:
- Externalize the price list and VAT rate into a configuration file
- Customer and project lookup instead of creating a new record per quotation
- PDF export
- Graphical interface
Released under the MIT License.