This commit is contained in:
seb
2026-10-27 00:28:06 +01:00
parent f52ab1be0c
commit 75691e6afc
21 changed files with 2458 additions and 60 deletions

View File

@@ -2,6 +2,7 @@ import {
delivery as deliveryApi,
quote as quoteApi,
order as orderApi,
retoure as retoureApi,
} from '../../api';
import supplierAutomat from '../../automats/supplierAutomat';
import entityAutomat from '../../automats/entityAutomat';
@@ -9,6 +10,7 @@ import customergroupAutomat from '../../automats/customergroupAutomat';
import deliveryAutomat from '../../automats/deliveryAutomat';
import quoteAutomat from '../../automats/quoteAutomat';
import orderAutomat from '../../automats/orderAutomat';
import retoureAutomat from '../../automats/retoureAutomat';
import { getArticle } from '../../automats/artikelAutomat';
import { selectCompanyTaxrate } from '../../automats/companyAutomat';
import { netFromGross } from '../../utils/price';
@@ -18,6 +20,7 @@ import {
ORANGE_PANEL,
PURPLE_PANEL,
YELLOW_PANEL,
RED_PANEL,
} from '../../colors';
/** Groups that are not sales customers (filter client-side). */
@@ -632,6 +635,7 @@ export function apiFor(cfgOrKind) {
if (kind === 'delivery') return deliveryApi;
if (kind === 'quote') return quoteApi;
if (kind === 'order') return orderApi;
if (kind === 'retoure') return retoureApi;
throw new Error(`Unknown manifest kind: ${kind}`);
}
@@ -776,6 +780,40 @@ export function manifestConfig(cfgOrKind) {
columns: ORDER_LINE_COLUMNS,
};
}
if (kind === 'retoure') {
return {
kind: 'retoure',
api: 'retoure',
listField: 'retoures',
docField: 'retoure',
partyField: 'entityId',
listPath: '/auftrag/retoure',
createPath: '/auftrag/retoure/neu',
editPath: (id) => `/auftrag/retoure/${id}`,
dateLabel: 'Retourendatum',
partyLabel: 'Kunde',
emptyList: 'Noch keine Retouren.',
createButton: 'Neue Retoure',
createdMsg: 'Retoure angelegt.',
savedMsg: 'Retoure gespeichert.',
deletedMsg: 'Retoure gelöscht.',
confirmDelete: (number) => `Retoure „${number}“ wirklich löschen?`,
invalidId: 'Ungültige Retouren-ID.',
partyGateMessage: null,
getPathLabel: 'GET /api/retoure/:id',
postPathLabel: 'POST /api/retoure',
patchPathLabel: 'PUT /api/retoure/:id',
listColor: RED_PANEL,
headerColor: RED_PANEL,
linesColor: GREEN_PANEL,
requirePartyBeforeLines: false,
listAutomat: retoureAutomat,
partiesByIdFromList: (parties) =>
Object.fromEntries(parties.map((row) => [row.id, row])),
externalNumber: true,
columns: ORDER_LINE_COLUMNS,
};
}
throw new Error(`Unknown manifest kind: ${kind}`);
}