|
|
|
@@ -1918,13 +1918,19 @@ open fun getAllJoPickOrders(isDrink: Boolean?, floor: String?): List<AllJoPickOr |
|
|
|
) |
|
|
|
} else null |
|
|
|
|
|
|
|
// Backend filtering by floor: include if there is remaining on that floor OR any no-lot remaining |
|
|
|
// Backend filtering by floor: |
|
|
|
// - When selecting a specific floor (2F/3F/4F), show ONLY remaining on that floor. |
|
|
|
// - When selecting NO_LOT, show ONLY remaining for no-lot items. |
|
|
|
if (normalizedFloorFilter != null) { |
|
|
|
val hasRemainingOnFloor = floorPickCounts.any { c -> |
|
|
|
c.floor == normalizedFloorFilter && (c.totalCount - c.finishedCount) > 0 |
|
|
|
if (normalizedFloorFilter == "NO_LOT") { |
|
|
|
val hasNoLotRemaining = (noLotPickCount?.let { it.totalCount - it.finishedCount } ?: 0) > 0 |
|
|
|
if (!hasNoLotRemaining) return@mapNotNull null |
|
|
|
} else { |
|
|
|
val hasRemainingOnFloor = floorPickCounts.any { c -> |
|
|
|
c.floor == normalizedFloorFilter && (c.totalCount - c.finishedCount) > 0 |
|
|
|
} |
|
|
|
if (!hasRemainingOnFloor) return@mapNotNull null |
|
|
|
} |
|
|
|
val hasNoLotRemaining = (noLotPickCount?.let { it.totalCount - it.finishedCount } ?: 0) > 0 |
|
|
|
if (!hasRemainingOnFloor && !hasNoLotRemaining) return@mapNotNull null |
|
|
|
} |
|
|
|
|
|
|
|
val suggestedFailCount = suggestedFailCountByPickOrderId[pickOrder.id] ?: 0 |
|
|
|
|