From b8f226bd39ca3467f7c6c901b7727f7335d197a6 Mon Sep 17 00:00:00 2001 From: seb Date: Sat, 17 Oct 2026 23:32:21 +0200 Subject: [PATCH] u --- src/automats/deliveryAutomat.js | 6 +++--- src/components/manifest/Attachment.jsx | 6 +++++- src/components/manifest/DeliveryList.jsx | 4 ++-- src/components/manifest/manifestConfig.js | 1 + src/routes/lieferung/neu.jsx | 4 ++++ 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/automats/deliveryAutomat.js b/src/automats/deliveryAutomat.js index e0e91a5..308f863 100644 --- a/src/automats/deliveryAutomat.js +++ b/src/automats/deliveryAutomat.js @@ -83,7 +83,7 @@ const initialState = { total: 0, unfilteredTotal: 0, filter: '', - onlyUnbooked: false, + onlyUnbooked: true, supplierId: null, seekMonths: 0, seekYears: 0, @@ -365,7 +365,7 @@ export function getChunkStats() { status: automat?.state?.status ?? 'idle', queryEpoch, filter: automat?.state?.filter ?? '', - onlyUnbooked: automat?.state?.onlyUnbooked ?? false, + onlyUnbooked: automat?.state?.onlyUnbooked ?? true, supplierId: automat?.state?.supplierId ?? null, negativeSeekMonths: automat?.state?.negativeSeekMonths ?? 0, items, @@ -885,7 +885,7 @@ const actions = { resetFilters() { automat.setState({ filter: '', - onlyUnbooked: false, + onlyUnbooked: true, supplierId: null, seekMonths: 0, seekYears: 0, diff --git a/src/components/manifest/Attachment.jsx b/src/components/manifest/Attachment.jsx index 3fd7fb1..c340f8d 100644 --- a/src/components/manifest/Attachment.jsx +++ b/src/components/manifest/Attachment.jsx @@ -162,6 +162,10 @@ export class Attachment extends PureComponent { const name = attachment?.name || 'Dokument'; const size = attachment?.size; const isPdf = attachment?.type === 'application/pdf' || name.toLowerCase().endsWith('.pdf'); + const isGeneratedDeliveryPdf = + name.toLowerCase().startsWith('wareneingang-') || + attachment?.meta?.type === 'delivery_pdf' || + attachment?.meta?.type === 'wareneingang_pdf'; const isCsv = attachment?.type === 'text/csv' || name.toLowerCase().endsWith('.csv'); const isText = attachment?.type?.startsWith('text/') || name.toLowerCase().endsWith('.txt') || isCsv; @@ -282,7 +286,7 @@ export class Attachment extends PureComponent { }} onClick={(e) => e.stopPropagation()} > - {kind === 'delivery' && Boolean(onRescan) && isPdf ? ( + {kind === 'delivery' && Boolean(onRescan) && isPdf && !isGeneratedDeliveryPdf ? ( ({ input: state.filter ?? '', - onlyUnbooked: state.onlyUnbooked ?? false, + onlyUnbooked: state.onlyUnbooked ?? true, seekMonths: state.seekMonths ?? 0, seekYears: state.seekYears ?? 0, negativeSeekMonths: state.negativeSeekMonths ?? 0, diff --git a/src/components/manifest/manifestConfig.js b/src/components/manifest/manifestConfig.js index 8de78b2..2549df3 100644 --- a/src/components/manifest/manifestConfig.js +++ b/src/components/manifest/manifestConfig.js @@ -394,6 +394,7 @@ export async function restoreAttachmentsFromApi(apiFiles = [], existingAttachmen text, parentPdfId, uploadedAt: apiFile.created, + meta: apiFile.meta || matchingExisting?.meta || null, }); } catch (err) { console.error('Fehler beim Wiederherstellen von Datei:', err); diff --git a/src/routes/lieferung/neu.jsx b/src/routes/lieferung/neu.jsx index 0992762..516fd22 100644 --- a/src/routes/lieferung/neu.jsx +++ b/src/routes/lieferung/neu.jsx @@ -741,6 +741,10 @@ class LieferungNeuPage extends PureComponent { async handlePdfRescan(attachment) { if (!attachment || this.state.pdfUploading) return; + const name = attachment.name || ''; + if (name.toLowerCase().startsWith('wareneingang-') || attachment.meta?.type === 'delivery_pdf') { + return; + } let targetAttachment = attachment; if (!targetAttachment.file || targetAttachment.file.size === 0) {