Add cost/time estimate card to job detail page

app/estimation.py:
  - 20% infill → material volume → weight (density per material)
  - print time at 20 g/h (conservative FDM average)
  - filament cost at FILAMENT_PRICE_PER_KG EUR/kg (env, default 15)
  - +20% misprint buffer, +30% gross profit margin
  - net price (ex. VAT) and gross price (VAT_RATE %, env, default 19)

Card shows three columns: Material & Time / Production cost / Suggested price.
Only rendered when STL volume is available. Assumptions shown in card header.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Martin Hohenberg
2026-06-18 22:40:52 +02:00
parent 4a3c370317
commit bc6e06a2e2
4 changed files with 120 additions and 0 deletions

View File

@@ -6,3 +6,5 @@ MYSQL_PASSWORD=
STL_UPLOAD_DIR=/data/stl
TZ=Europe/Berlin
FILAMENTDB_URL=https://web.filamentdb.orb.local
VAT_RATE=19
FILAMENT_PRICE_PER_KG=15