This commit is contained in:
seb
2026-10-18 18:38:38 +02:00
parent 9cb93bddeb
commit c15fa0a53e
4 changed files with 18 additions and 5 deletions

View File

@@ -28,6 +28,7 @@ import {
buildManifestBody,
restoreAttachmentsFromApi,
dateInputValue,
todayInputValue,
emptyLine,
lineFromApi,
manifestConfig,
@@ -107,8 +108,13 @@ class LieferungNeuPage extends PureComponent {
super(props);
this.cfg = manifestConfig('delivery');
this.automat = getDeliveryEditorAutomat(props.docId);
const initialDate = this.automat.state.date || (props.docId == null ? todayInputValue() : null);
if (props.docId == null && !this.automat.state.date) {
this.automat.actions.setDate(initialDate);
}
this.state = {
...this.automat.state,
date: initialDate,
status: props.docId != null ? 'loading' : 'loadingParties',
error: null,
partiesLoading: true,
@@ -199,6 +205,9 @@ class LieferungNeuPage extends PureComponent {
if (this.props.docId != null) {
void this.loadEdit();
} else {
if (!this.automat.state.date) {
this.automat.actions.setDate(todayInputValue());
}
void this.loadPartiesOnly();
if (this.props.initialDelivery) {
this.automat.actions.setDelivery(this.props.initialDelivery);