This commit is contained in:
seb
2026-10-17 23:32:21 +02:00
parent 0d11dd5014
commit b8f226bd39
5 changed files with 15 additions and 6 deletions

View File

@@ -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 ? (
<IconButton
size="small"
disabled={disabled}

View File

@@ -407,7 +407,7 @@ class DeliverySearchField extends PureComponent {
const stats = deliveryAutomat.getChunkStats?.();
this.state = {
input: s.filter ?? '',
onlyUnbooked: s.onlyUnbooked ?? false,
onlyUnbooked: s.onlyUnbooked ?? true,
seekMonths: s.seekMonths ?? 0,
seekYears: s.seekYears ?? 0,
negativeSeekMonths: s.negativeSeekMonths ?? 0,
@@ -420,7 +420,7 @@ class DeliverySearchField extends PureComponent {
componentDidMount() {
this.unsub = deliveryAutomat.subscribe(this, (state) => ({
input: state.filter ?? '',
onlyUnbooked: state.onlyUnbooked ?? false,
onlyUnbooked: state.onlyUnbooked ?? true,
seekMonths: state.seekMonths ?? 0,
seekYears: state.seekYears ?? 0,
negativeSeekMonths: state.negativeSeekMonths ?? 0,

View File

@@ -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);