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, total: 0,
unfilteredTotal: 0, unfilteredTotal: 0,
filter: '', filter: '',
onlyUnbooked: false, onlyUnbooked: true,
supplierId: null, supplierId: null,
seekMonths: 0, seekMonths: 0,
seekYears: 0, seekYears: 0,
@@ -365,7 +365,7 @@ export function getChunkStats() {
status: automat?.state?.status ?? 'idle', status: automat?.state?.status ?? 'idle',
queryEpoch, queryEpoch,
filter: automat?.state?.filter ?? '', filter: automat?.state?.filter ?? '',
onlyUnbooked: automat?.state?.onlyUnbooked ?? false, onlyUnbooked: automat?.state?.onlyUnbooked ?? true,
supplierId: automat?.state?.supplierId ?? null, supplierId: automat?.state?.supplierId ?? null,
negativeSeekMonths: automat?.state?.negativeSeekMonths ?? 0, negativeSeekMonths: automat?.state?.negativeSeekMonths ?? 0,
items, items,
@@ -885,7 +885,7 @@ const actions = {
resetFilters() { resetFilters() {
automat.setState({ automat.setState({
filter: '', filter: '',
onlyUnbooked: false, onlyUnbooked: true,
supplierId: null, supplierId: null,
seekMonths: 0, seekMonths: 0,
seekYears: 0, seekYears: 0,

View File

@@ -162,6 +162,10 @@ export class Attachment extends PureComponent {
const name = attachment?.name || 'Dokument'; const name = attachment?.name || 'Dokument';
const size = attachment?.size; const size = attachment?.size;
const isPdf = attachment?.type === 'application/pdf' || name.toLowerCase().endsWith('.pdf'); 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 isCsv = attachment?.type === 'text/csv' || name.toLowerCase().endsWith('.csv');
const isText = attachment?.type?.startsWith('text/') || name.toLowerCase().endsWith('.txt') || isCsv; const isText = attachment?.type?.startsWith('text/') || name.toLowerCase().endsWith('.txt') || isCsv;
@@ -282,7 +286,7 @@ export class Attachment extends PureComponent {
}} }}
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
{kind === 'delivery' && Boolean(onRescan) && isPdf ? ( {kind === 'delivery' && Boolean(onRescan) && isPdf && !isGeneratedDeliveryPdf ? (
<IconButton <IconButton
size="small" size="small"
disabled={disabled} disabled={disabled}

View File

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

View File

@@ -394,6 +394,7 @@ export async function restoreAttachmentsFromApi(apiFiles = [], existingAttachmen
text, text,
parentPdfId, parentPdfId,
uploadedAt: apiFile.created, uploadedAt: apiFile.created,
meta: apiFile.meta || matchingExisting?.meta || null,
}); });
} catch (err) { } catch (err) {
console.error('Fehler beim Wiederherstellen von Datei:', err); console.error('Fehler beim Wiederherstellen von Datei:', err);

View File

@@ -741,6 +741,10 @@ class LieferungNeuPage extends PureComponent {
async handlePdfRescan(attachment) { async handlePdfRescan(attachment) {
if (!attachment || this.state.pdfUploading) return; if (!attachment || this.state.pdfUploading) return;
const name = attachment.name || '';
if (name.toLowerCase().startsWith('wareneingang-') || attachment.meta?.type === 'delivery_pdf') {
return;
}
let targetAttachment = attachment; let targetAttachment = attachment;
if (!targetAttachment.file || targetAttachment.file.size === 0) { if (!targetAttachment.file || targetAttachment.file.size === 0) {