u
This commit is contained in:
@@ -85,6 +85,7 @@ class LieferungNeuPage extends PureComponent {
|
||||
this.handleOpenArticleSearchForLine = this.handleOpenArticleSearchForLine.bind(this);
|
||||
this.handleCloseArticleSearch = this.handleCloseArticleSearch.bind(this);
|
||||
this.handleAssignArticleForLine = this.handleAssignArticleForLine.bind(this);
|
||||
this.handleRemoveSupplierArticle = this.handleRemoveSupplierArticle.bind(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
@@ -403,6 +404,26 @@ class LieferungNeuPage extends PureComponent {
|
||||
}
|
||||
}
|
||||
|
||||
async handleRemoveSupplierArticle(line, supplierArticle) {
|
||||
const internalSku = supplierArticle?.article?.sku;
|
||||
const assignmentId = supplierArticle?.id;
|
||||
if (!internalSku || assignmentId == null) {
|
||||
enqueueSnackbar('Verknüpfung konnte nicht ermittelt werden.', { variant: 'warning' });
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.automat.actions.unlinkSupplierArticle(internalSku, assignmentId, line?.key);
|
||||
enqueueSnackbar(
|
||||
`Verknüpfung zu Artikel "${internalSku}" wurde entfernt.`,
|
||||
{ variant: 'success' },
|
||||
);
|
||||
} catch (err) {
|
||||
console.error('Fehler beim Lösen der Lieferanten-Verknüpfung:', err);
|
||||
notifyError(err);
|
||||
}
|
||||
}
|
||||
|
||||
handleAddLine() {
|
||||
this.automat.actions.addLineitem();
|
||||
}
|
||||
@@ -1111,6 +1132,8 @@ class LieferungNeuPage extends PureComponent {
|
||||
onSave={() => void this.handleSave()}
|
||||
onCreateArticle={this.handleCreateArticleForLine}
|
||||
onSearchArticle={this.handleOpenArticleSearchForLine}
|
||||
onRemoveSupplierArticle={this.handleRemoveSupplierArticle}
|
||||
busySupplierArticleLineKeys={this.state.busySupplierArticleLineKeys}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user