Tarification + écran récap avec prix

Config admin :
- Tarification activable avec paliers (ex: 1-5 = 0.50€, 6-10 = 0.40€)
- Fonction calculate_price() utilitaire

Galerie :
- Affiche "X impressions — Y.YY €" quand tarification activée

Écran impression/récap :
- Galerie des photos sélectionnées avec miniatures + quantité (xN)
- Prix total en haut
- Choix du format d'impression
- Bouton IMPRIMER

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-21 23:54:10 +01:00
parent 2f96447919
commit c2c27b1892
5 changed files with 277 additions and 175 deletions

View File

@@ -8,6 +8,7 @@ from PyQt6.QtCore import Qt, QSize
from PyQt6.QtGui import QFont, QPixmap, QIcon
from ui.style import scale, scaled_font, Sizes, back_btn_style, green_btn
from ui.widgets.config_dialog import load_config, calculate_price
class PhotoCard(QFrame):
@@ -317,9 +318,17 @@ class ImportScreen(QWidget):
total = sum(c.quantity for c in self.cards)
selected = sum(1 for c in self.cards if c.quantity > 0)
if total > 0:
self.summary_label.setText(
f"{selected} photo{'s' if selected > 1 else ''} sélectionnée{'s' if selected > 1 else ''} — {total} impression{'s' if total > 1 else ''}"
)
config = load_config()
pricing = config.get("pricing", {})
if pricing.get("enabled", False):
price = calculate_price(total, config)
self.summary_label.setText(
f"{total} impression{'s' if total > 1 else ''} — {price:.2f} €"
)
else:
self.summary_label.setText(
f"{selected} photo{'s' if selected > 1 else ''} — {total} impression{'s' if total > 1 else ''}"
)
self.summary_label.setStyleSheet("color: #4CAF50; font-weight: bold;")
else:
self.summary_label.setText("Appuyez sur + pour sélectionner des photos à imprimer")