Ensure Pick Complete reveals picked items

This commit is contained in:
beatz174-bit
2025-11-23 14:48:54 +10:00
parent 7eb6c5d5d2
commit 4c0570af56
+15 -1
View File
@@ -112,6 +112,16 @@ export const ActivePickListScreen = () => {
await db.pickItems.delete(itemId);
};
const handleMarkAllPicked = async () => {
setShowPicked(true);
const timestamp = Date.now();
await Promise.all(
items.map((item) =>
db.pickItems.update(item.id, { status: 'picked', updated_at: timestamp }),
),
);
};
const addOrUpdateItem = async (product: Product) => {
if (!id) return;
@@ -221,6 +231,7 @@ export const ActivePickListScreen = () => {
<FormControlLabel value="cartons" control={<Radio />} label="Cartons" />
<FormControlLabel value="units" control={<Radio />} label="Units" />
</RadioGroup>
<Stack direction="row" spacing={1} alignItems="center" sx={{ ml: { xs: 0, sm: 2 } }}>
<FormControlLabel
control={
<Checkbox
@@ -229,8 +240,11 @@ export const ActivePickListScreen = () => {
/>
}
label="Show picked"
sx={{ ml: { xs: 0, sm: 2 } }}
/>
<Button variant="contained" size="small" onClick={handleMarkAllPicked}>
Pick Complete
</Button>
</Stack>
</Stack>
</FormControl>
</Stack>