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

@@ -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,

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

View File

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