Merge pull request #54 from beatz174-bit/codex/add-button-to-check-all-products

Ensure Pick Complete shows picked items
This commit is contained in:
beatz174-bit authored and GitHub committed 2025-11-23 14:49:13 +10:00
commit 6d024b2d25
1 file changed
+15 -1
+15 -1
View File
@@ -115,6 +115,16 @@ export const ActivePickListScreen = () => {
await db.pickItems.delete(itemId); 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) => { const addOrUpdateItem = async (product: Product) => {
if (!id) return; if (!id) return;
@@ -241,6 +251,7 @@ export const ActivePickListScreen = () => {
<FormControlLabel value="cartons" control={<Radio />} label="Cartons" /> <FormControlLabel value="cartons" control={<Radio />} label="Cartons" />
<FormControlLabel value="units" control={<Radio />} label="Units" /> <FormControlLabel value="units" control={<Radio />} label="Units" />
</RadioGroup> </RadioGroup>
<Stack direction="row" spacing={1} alignItems="center" sx={{ ml: { xs: 0, sm: 2 } }}>
<FormControlLabel <FormControlLabel
control={ control={
<Checkbox <Checkbox
@@ -249,8 +260,11 @@ export const ActivePickListScreen = () => {
/> />
} }
label="Show picked" label="Show picked"
sx={{ ml: { xs: 0, sm: 2 } }}
/> />
<Button variant="contained" size="small" onClick={handleMarkAllPicked}>
Pick Complete
</Button>
</Stack>
</Stack> </Stack>
</FormControl> </FormControl>
</Stack> </Stack>