This commit is contained in:
seb
2026-10-15 00:20:54 +02:00
parent 7ce2e3216f
commit 39aa898324
6 changed files with 126 additions and 10 deletions

View File

@@ -99,6 +99,7 @@ class LieferungNeuPage extends PureComponent {
this.handleAddLine = this.handleAddLine.bind(this);
this.handleAddArticleLine = this.handleAddArticleLine.bind(this);
this.handleRemoveLine = this.handleRemoveLine.bind(this);
this.handleMoveLine = this.handleMoveLine.bind(this);
this.handleRemoveAllLines = this.handleRemoveAllLines.bind(this);
this.handleSave = this.handleSave.bind(this);
this.handlePdfUpload = this.handlePdfUpload.bind(this);
@@ -541,6 +542,13 @@ class LieferungNeuPage extends PureComponent {
this.automat.actions.removeLineitem(index >= 0 ? index : key);
}
handleMoveLine(key, delta) {
const fromIndex = this.findLineIndex(key);
if (fromIndex < 0) return;
const toIndex = fromIndex + delta;
this.automat.actions.moveLineitem(fromIndex, toIndex);
}
handleRemoveAllLines() {
this.automat.actions.clearLineitems();
}
@@ -1340,6 +1348,7 @@ class LieferungNeuPage extends PureComponent {
onAddLine={this.handleAddLine}
onAddArticleLine={this.handleAddArticleLine}
onRemoveLine={this.handleRemoveLine}
onMoveLine={this.handleMoveLine}
onRemoveAllLines={this.handleRemoveAllLines}
onSave={() => void this.handleSave()}
onCreateArticle={this.handleCreateArticleForLine}