diff --git a/src/App.tsx b/src/App.tsx index 2d18379..c38d48a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -186,27 +186,19 @@ export default function App() { }); const articleNoIdx = resolvedCols.ARTICLE_NO; - const debugProduct = '59272EN'; const processedRows = rows.map(row => { const articleNo = String(row[articleNoIdx]); const synced = syncedData[articleNo]; const hist = historyData[articleNo]; - if (articleNo === debugProduct) { - console.log('[DEBUG 59272EN] articleNo from row:', articleNo); - console.log('[DEBUG 59272EN] synced exists:', !!synced); - console.log('[DEBUG 59272EN] hist exists:', !!hist); - if (hist) { - console.log('[DEBUG 59272EN] hist[103]:', hist[103]); - console.log('[DEBUG 59272EN] hist length:', hist.length); - } - console.log('[DEBUG 59272EN] historyData keys count:', Object.keys(historyData).length); - console.log('[DEBUG 59272EN] historyData has key?:', debugProduct in historyData); - } - // Start with fresh Dropbox values (prices from Excel) let finalRow = [...row]; + // Pad row to match extendedHeaders length so internal cols (index >= 100) are readable + while (finalRow.length < extendedHeaders.length) { + finalRow.push(null); + } + // Merge logic: Prioritize internal control columns from syncedData or historyData const sourceForInternal = synced?.data || hist; diff --git a/src/lib/supabase.ts b/src/lib/supabase.ts index 3ba8c8f..114122c 100644 --- a/src/lib/supabase.ts +++ b/src/lib/supabase.ts @@ -206,8 +206,6 @@ export async function getHistoryDataForMerge(): Promise return {}; } const entries: Array<{ product_id: string; new_data: ExcelRow }> = await response.json(); - console.log('[getHistoryDataForMerge] Raw entries:', entries.length); - console.log('[getHistoryDataForMerge] Has 59272EN?:', entries.some(e => e.product_id === '59272EN')); const result: Record = {}; const seen = new Set(); @@ -218,11 +216,6 @@ export async function getHistoryDataForMerge(): Promise result[entry.product_id] = entry.new_data; } } - console.log('[getHistoryDataForMerge] Deduplicated count:', Object.keys(result).length); - console.log('[getHistoryDataForMerge] result[59272EN]?:', !!result['59272EN']); - if (result['59272EN']) { - console.log('[getHistoryDataForMerge] result[59272EN][103]:', result['59272EN'][103]); - } return result; } catch (error: any) { console.error('[getHistoryDataForMerge] Exception:', error.message);