fix: Stationsabschluss absichern und Kundenformulare anpassen
Sperrt nachträgliche Aufgabenabschlüsse in App und Backend und zeigt erledigte Aufträge trotz offener optionaler Aufgaben grün an. Ergänzt Regressionstests, die Anredeauswahl und optionale Steuerangaben für Kunden. Enthält App-Version 0.9.25, Backend-Version 0.9.26 und das aktualisierte Frontend-Bundle.
This commit is contained in:
1 parent
8758c53e5b
commit
5e6044e4b1
16 files changed
+638
-69
No files matched your search
@@ -6,6 +6,7 @@ import 'l10n/app_localizations.dart';
|
||||
import 'l10n/localization_helpers.dart';
|
||||
import 'models/delivery_station.dart';
|
||||
import 'models/job.dart';
|
||||
import 'models/job_progress.dart';
|
||||
import 'services/database_service.dart';
|
||||
import 'task_view.dart';
|
||||
import 'widgets/offline_banner.dart';
|
||||
@@ -13,8 +14,10 @@ import 'widgets/offline_banner.dart';
|
||||
@visibleForTesting
|
||||
Color? deliveryStationCardBackgroundColor(
|
||||
DeliveryStation station,
|
||||
Map<String, bool> taskStatuses,
|
||||
) {
|
||||
Map<String, bool> taskStatuses, {
|
||||
bool isClosed = false,
|
||||
}) {
|
||||
if (isClosed) return AppColors.successSoft;
|
||||
if (station.tasks.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
@@ -37,6 +40,7 @@ class CargoItemsView extends StatefulWidget {
|
||||
class _CargoItemsViewState extends State<CargoItemsView> {
|
||||
final DatabaseService _databaseService = DatabaseService();
|
||||
Map<String, bool> _taskStatuses = const {};
|
||||
Set<int> _completedStations = const {};
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@@ -46,9 +50,13 @@ class _CargoItemsViewState extends State<CargoItemsView> {
|
||||
|
||||
Future<void> _loadLocalTaskStatuses() async {
|
||||
final map = await _databaseService.loadAllTaskStatuses();
|
||||
final completedStations = await _databaseService.loadCompletedStationOrders(
|
||||
widget.job,
|
||||
);
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_taskStatuses = map;
|
||||
_completedStations = completedStations;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -311,6 +319,11 @@ class _CargoItemsViewState extends State<CargoItemsView> {
|
||||
final backgroundColor = deliveryStationCardBackgroundColor(
|
||||
station,
|
||||
_taskStatuses,
|
||||
isClosed: JobProgress(
|
||||
widget.job,
|
||||
taskStatuses: _taskStatuses,
|
||||
localCompletedStations: _completedStations,
|
||||
).isStationClosed(station.stationOrder),
|
||||
);
|
||||
final title =
|
||||
station.displayName.isNotEmpty ? station.displayName : station.company;
|
||||
|
||||
Reference in new issue
Block a user