diff --git a/app.py b/app.py index f76fba9..ebc88ca 100644 --- a/app.py +++ b/app.py @@ -269,6 +269,7 @@ def init_db(): 'ALTER TABLE materials ADD COLUMN total_wasted_g REAL DEFAULT 0', 'ALTER TABLE jobs ADD COLUMN client_token TEXT DEFAULT NULL', 'ALTER TABLE jobs ADD COLUMN plate_name TEXT DEFAULT ""', + 'ALTER TABLE jobs ADD COLUMN marge_pct_on_ht REAL DEFAULT 0', 'ALTER TABLE printers ADD COLUMN ha_entity_prefix TEXT DEFAULT ""', 'ALTER TABLE print_slots ADD COLUMN pieces_ignored INTEGER DEFAULT 0', 'ALTER TABLE print_slots ADD COLUMN pieces_override INTEGER DEFAULT NULL', @@ -1249,7 +1250,7 @@ def new_job(): weight_g,print_time_s,design_multiplier,gross_margin_pct,discount_pct, pieces_per_plate,order_qty, material_cost,material_margin,design_cost,handling_cost,wear_cost,electricity_cost, - cout_fixe,total_marge,subtotal,margin_amount, + cout_fixe,total_marge,subtotal,margin_amount,marge_pct_on_ht, cotisations_amount,vfl_amount,tva_amount,other_taxes_amount,tax_amount, price_per_piece,final_price,notes) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)''', @@ -1259,7 +1260,7 @@ def new_job(): pieces_per_plate,order_qty, r['material_cost'],r['material_margin'],r['design_cost'],r['handling_cost'], r['wear_cost'],r['electricity_cost'], - r['cout_fixe'],r['total_marge'],r['subtotal'],r['margin_amount'], + r['cout_fixe'],r['total_marge'],r['subtotal'],r['margin_amount'],r['marge_pct_on_ht'], r['cotisations_amount'],r['vfl_amount'],r['tva_amount'],r['other_taxes_amount'], r['tax_amount'],r['final_price'],round(r['final_price'],2), request.form.get('notes',''))) diff --git a/templates/jobs.html b/templates/jobs.html index c040ea7..5be8cdf 100644 --- a/templates/jobs.html +++ b/templates/jobs.html @@ -21,8 +21,8 @@
| Date | Nom | Client | Poids | -Durée | Design | Marge | Remise | +Date | Nom | Client | Réf. plateau | Poids | +Durée | Design | Marge brute | Total marge | Remise | Prix final | {{ j.created_at[:10] }} | {{ j.name }} | {{ j.client_name or '—' }} | +{{ j.plate_name or '—' }} | {{ j.weight_g }} g | {{ j.print_time_s | fmt_time }} | ×{{ j.design_multiplier }} | {{ j.gross_margin_pct }}% | +{% if j.total_marge %}{{ '%.2f'|format(j.total_marge) }} € {% if j.marge_pct_on_ht %}{{ j.marge_pct_on_ht }}% du HT{% endif %}{% else %}—{% endif %} |
{% if j.discount_pct > 0 %}
-{{ j.discount_pct }}%
@@ -69,7 +71,4 @@
Aucune commande enregistrée. Créer le premier calcul - {% endif %} - - -{% endblock %} + \ No newline at end of file |
|---|