upload stuff
This commit is contained in:
@@ -70,8 +70,10 @@ export const initialDelivery = {
|
||||
supplierArticlesLoading: false,
|
||||
loadingLineKeys: {},
|
||||
supplierArticlesError: null,
|
||||
unmatchedSupplierName: null,
|
||||
};
|
||||
|
||||
|
||||
export const initialState = {
|
||||
deliveryEntities: [],
|
||||
...initialDelivery,
|
||||
@@ -137,6 +139,7 @@ export function createDeliveryEditorAutomat(options = {}) {
|
||||
automat.setState({
|
||||
deliveryEntity: entityId,
|
||||
partyId: entityId,
|
||||
unmatchedSupplierName: entityId != null ? null : automat.state.unmatchedSupplierName,
|
||||
...(idChanged
|
||||
? {
|
||||
supplierArticles: [],
|
||||
@@ -152,6 +155,11 @@ export function createDeliveryEditorAutomat(options = {}) {
|
||||
}
|
||||
},
|
||||
|
||||
setUnmatchedSupplierName(name) {
|
||||
automat.setState({ unmatchedSupplierName: name ?? null });
|
||||
},
|
||||
|
||||
|
||||
setPartyId(partyId) {
|
||||
automat.actions.setDeliveryEntity(partyId);
|
||||
},
|
||||
@@ -464,6 +472,7 @@ export const {
|
||||
setAttachments,
|
||||
updateAttachment,
|
||||
removeAttachment,
|
||||
setUnmatchedSupplierName,
|
||||
resetDelivery,
|
||||
resetDeliveryEditor,
|
||||
} = deliveryEditorAutomat.actions;
|
||||
@@ -473,7 +482,9 @@ export const selectDeliveryId = (state = deliveryEditorAutomat.state) => state.d
|
||||
export const selectDeliveryEntities = (state = deliveryEditorAutomat.state) => state.deliveryEntities;
|
||||
export const selectDeliveryDate = (state = deliveryEditorAutomat.state) => state.date;
|
||||
export const selectDeliveryEntity = (state = deliveryEditorAutomat.state) => state.deliveryEntity ?? state.partyId;
|
||||
export const selectUnmatchedSupplierName = (state = deliveryEditorAutomat.state) => state.unmatchedSupplierName;
|
||||
export const selectDeliveryExternalNumber = (state = deliveryEditorAutomat.state) => state.externalNumber ?? state.external_number;
|
||||
|
||||
export const selectDeliveryNumber = (state = deliveryEditorAutomat.state) => state.number;
|
||||
export const selectDeliveryType = (state = deliveryEditorAutomat.state) => state.type;
|
||||
export const selectDeliveryLineitems = (state = deliveryEditorAutomat.state) => state.lines ?? state.lineitems;
|
||||
|
||||
Reference in New Issue
Block a user