u
This commit is contained in:
@@ -22,6 +22,7 @@ import {
|
||||
buildManifestBody,
|
||||
restoreAttachmentsFromApi,
|
||||
dateInputValue,
|
||||
todayInputValue,
|
||||
emptyLine,
|
||||
lineFromApi,
|
||||
loadParties,
|
||||
@@ -55,12 +56,25 @@ class ManifestForm extends PureComponent {
|
||||
: null;
|
||||
const initialDoc = initialDraft || initialEdit;
|
||||
|
||||
const initialDate =
|
||||
initialDoc?.date ||
|
||||
(props.mode === 'create' && props.kind === 'quote' ? todayInputValue() : '');
|
||||
|
||||
if (
|
||||
props.mode === 'create' &&
|
||||
props.kind === 'quote' &&
|
||||
this.draftAutomat &&
|
||||
!this.draftAutomat.state.date
|
||||
) {
|
||||
this.draftAutomat.setState({ date: initialDate });
|
||||
}
|
||||
|
||||
this.state = {
|
||||
status: props.mode === 'edit' && !initialEdit ? 'loading' : (partiesReady ? 'ready' : 'loadingParties'),
|
||||
error: null,
|
||||
parties: initialParties,
|
||||
partiesLoading: !partiesReady,
|
||||
date: initialDoc?.date || '',
|
||||
date: initialDate,
|
||||
partyId: initialDoc?.partyId ?? null,
|
||||
number: initialDoc?.number || '',
|
||||
externalNumber: initialDoc?.externalNumber || '',
|
||||
|
||||
Reference in New Issue
Block a user