Merge branch 'feature/travel-cost-calculator' into main
This commit is contained in:
@@ -256,6 +256,20 @@ class EventFormController extends ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
/// Ajoute ou met à jour l'option FRAIS_KM avec le prix calculé.
|
||||
/// L'option est au format attendu par Firestore : { id: "FRAIS_KM", price: <valeur> }
|
||||
void addTravelCostOption(double price) {
|
||||
// Retirer l'éventuelle option FRAIS_KM existante
|
||||
_selectedOptions.removeWhere((opt) => opt['id'] == 'FRAIS_KM');
|
||||
// Ajouter la nouvelle
|
||||
_selectedOptions.add({
|
||||
'id': 'FRAIS_KM',
|
||||
'price': double.parse(price.toStringAsFixed(2)),
|
||||
});
|
||||
_onAnyFieldChanged();
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void setAssignedEquipment(List<EventEquipment> equipment, List<String> containers) {
|
||||
_assignedEquipment = equipment;
|
||||
_assignedContainers = containers;
|
||||
|
||||
Reference in New Issue
Block a user