diff --git a/client/src/components/Packing/PackingListPanel.tsx b/client/src/components/Packing/PackingListPanel.tsx index 9311cbc1b..80a9850cc 100644 --- a/client/src/components/Packing/PackingListPanel.tsx +++ b/client/src/components/Packing/PackingListPanel.tsx @@ -1311,8 +1311,8 @@ export default function PackingListPanel({ tripId, items, openImportSignal = 0, {bags.map(bag => { const bagItems = items.filter(i => i.bag_id === bag.id) - const totalWeight = bagItems.reduce((sum, i) => sum + (i.weight_grams || 0), 0) - const maxWeight = bag.weight_limit_grams || Math.max(...bags.map(b => items.filter(i => i.bag_id === b.id).reduce((s, i) => s + (i.weight_grams || 0), 0)), 1) + const totalWeight = bagItems.reduce((sum, i) => sum + (i.weight_grams * i.quantity || 0), 0) + const maxWeight = bag.weight_limit_grams || Math.max(...bags.map(b => items.filter(i => i.bag_id === b.id).reduce((s, i) => s + (i.weight_grams * i.quantity || 0), 0)), 1) const pct = Math.min(100, Math.round((totalWeight / maxWeight) * 100)) return ( handleDeleteBag(bag.id)} onUpdate={handleUpdateBag} onSetMembers={handleSetBagMembers} t={t} compact />