This commit is contained in:
seb
2026-10-18 19:36:56 +02:00
parent 587170ce9b
commit 94f385e753
3 changed files with 15 additions and 4 deletions

View File

@@ -274,9 +274,11 @@ class ManifestHeader extends PureComponent {
const hasArticles = this.hasArticles();
const isEdit = docId != null;
const hasAttachments = Array.isArray(attachments) && attachments.length > 0;
const canSave = isEdit
? Boolean(isDirty)
: Boolean(hasArticles || hasAttachments);
const hasParty = partyId != null && partyId !== '';
const partyValid = kind !== 'order' || hasParty;
const canSave =
partyValid &&
(isEdit ? Boolean(isDirty) : Boolean(hasArticles || hasAttachments));
// Delivery: number is server-allocated/read-only; the caller reference
// lives in the editable externalNumber field.
@@ -375,8 +377,8 @@ class ManifestHeader extends PureComponent {
{...params}
inputRef={this.partyInputRef}
label={dirtyFields?.partyId ? `${partyLabel} *` : partyLabel}
required={kind === 'order'}
error={isPartyEmpty}
helperText={Boolean(partyError) && isPartyEmpty ? 'Kunde für Bestellung erforderlich' : undefined}
onKeyDown={this.handlePartyKeyDown}
slotProps={{
...params.slotProps,