This commit is contained in:
Dennis Nemec
2026-04-28 13:03:09 +02:00
parent de8668c11a
commit 2470299a10
53 changed files with 2409 additions and 1433 deletions

View File

@ -60,6 +60,23 @@ class Tour {
.length;
}
/// Returns true if the car still has loaded articles assigned to a delivery
/// that has not been finished yet. Scannable articles count when their
/// effective scanned amount (scanned minus removed) is positive; non-scannable
/// articles count when their target amount is greater than zero.
bool hasUndeliveredLoadedArticles(int carId) {
return deliveries.any((delivery) {
if (delivery.carId != carId) return false;
if (delivery.state == DeliveryState.finished) return false;
return delivery.articles.any((article) {
if (article.scannable) {
return article.scannedAmount > article.scannedRemovedAmount;
}
return article.amount > 0;
});
});
}
Tour copyWith({
DateTime? date,
String? discountArticleNumber,