Batch-Uebernahme: Auftraege wie API-Auftraege unter einer Charge gruppieren

Uebernommene Uebermittlungen bekommen api_client gesetzt und werden im
Board (renderGruppiert) wie API-Auftraege als Charge gruppiert (bildeChargen:
Kunde+Produkt+Tag). Quelle bleibt 'operator' (keine Kundenmail). So liegen
alle uebernommenen Auftraege eines Zugangs/Tages unter einer Charge und
lassen sich dort wie gewohnt sammeldrucken.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
s4luorth
2026-09-28 10:31:58 +02:00
parent c6c682d48f
commit 1f98aa4196
2 changed files with 7 additions and 3 deletions

View File

@@ -1409,7 +1409,7 @@ const handler = (router, { services, getSchema, logger }) => {
const fmtA4 = (await svc('formats').readByQuery({ filter: { key: { _eq: 'a4' } }, limit: 1, fields: ['id'] }))?.[0]?.id ?? null;
const subs = await svc('batch_submissions').readMany(ids, {
fields: ['id', 'firma', 'vorname', 'nachname', 'zeile1', 'zeile2', 'zeile3', 'plz', 'stadt', 'land', 'text', 'pdf_file', 'status', 'customer'],
fields: ['id', 'firma', 'vorname', 'nachname', 'zeile1', 'zeile2', 'zeile3', 'plz', 'stadt', 'land', 'text', 'pdf_file', 'status', 'customer', 'api_client'],
});
const naechsteNummer = async () => {
@@ -1430,6 +1430,8 @@ const handler = (router, { services, getSchema, logger }) => {
.map((x) => String(x || '').trim()).filter(Boolean).slice(0, 5);
const orderData = {
customer: s.customer || null,
// Zugang mitführen → im Board wie API-Aufträge unter einer Charge gruppiert.
api_client: s.api_client || null,
product: product.id, format: fmtA4,
person_type: 'unternehmen', font: 'tilda',
source: 'operator', status: 'in_queue', production_status: 'eingegangen',

View File

@@ -1446,8 +1446,10 @@ const Board = defineComponent({
// gebündelt – in allen Status-Reitern gleich.
function renderGruppiert(list, opts) {
if (suche.value.trim()) return list.map((o) => orderCard(o, opts));
const apiO = list.filter((o) => o.source === 'api');
const restO = list.filter((o) => o.source !== 'api');
// API-Aufträge UND aus Batch-Übermittlungen übernommene (haben api_client)
// werden als Charge gruppiert; der Rest als Einzelkarten.
const apiO = list.filter((o) => o.source === 'api' || o.api_client);
const restO = list.filter((o) => !(o.source === 'api' || o.api_client));
return [
...bildeChargen(apiO).map((c) => chargeCard(c, opts)),
...restO.map((o) => orderCard(o, opts)),