diff --git a/client/src/components/MissingProductsModal.tsx b/client/src/components/MissingProductsModal.tsx index 9b5ad6d..44657f7 100644 --- a/client/src/components/MissingProductsModal.tsx +++ b/client/src/components/MissingProductsModal.tsx @@ -86,10 +86,19 @@ export const MissingProductsModal: React.FC = ({ try { const newProducts: any[] = []; const existingMatches: any[] = []; + let skipped = 0; for (const product of missingProducts) { const data = productData[product.title] || {}; - + + // Skip rows the user didn't act on (no existing product chosen and no + // printing cost entered) so they can resolve a few now and the rest + // later — untouched items stay unmatched instead of becoming £0 products + if (!data.useExisting && data.printingCost === undefined) { + skipped++; + continue; + } + // If user selected to use an existing product, save the packing-slip // title as an alias on it so this and all future imports match it // deterministically @@ -166,6 +175,9 @@ export const MissingProductsModal: React.FC = ({ if (existingMatches.length > 0) { toast.success(`Matched ${existingMatches.length} items to existing products`); } + if (skipped > 0) { + toast(`${skipped} item(s) left for later — they'll still show as unmatched`); + } console.log('Products processed successfully, calling onComplete...'); @@ -199,10 +211,12 @@ export const MissingProductsModal: React.FC = ({

- Found unmatched product: "{missingProducts[0]?.title}" + {missingProducts.length} unmatched item{missingProducts.length === 1 ? '' : 's'}

- This product isn't in your database yet. Add printing costs to complete the import. + Match each to an existing product or enter a printing cost to create it. + You don't have to do them all now — rows you leave blank stay unmatched + and you can resolve them next time.