u
This commit is contained in:
@@ -97,6 +97,7 @@ class LieferungNeuPage extends PureComponent {
|
||||
this.handleExternalNumberChange = this.handleExternalNumberChange.bind(this);
|
||||
this.handleLineChange = this.handleLineChange.bind(this);
|
||||
this.handleAddLine = this.handleAddLine.bind(this);
|
||||
this.handleAddArticleLine = this.handleAddArticleLine.bind(this);
|
||||
this.handleRemoveLine = this.handleRemoveLine.bind(this);
|
||||
this.handleRemoveAllLines = this.handleRemoveAllLines.bind(this);
|
||||
this.handleSave = this.handleSave.bind(this);
|
||||
@@ -506,6 +507,35 @@ class LieferungNeuPage extends PureComponent {
|
||||
this.automat.actions.addLineitem();
|
||||
}
|
||||
|
||||
handleAddArticleLine(article) {
|
||||
if (!article) return;
|
||||
const netVal =
|
||||
article.price != null
|
||||
? String(article.price)
|
||||
: article.vknetto != null
|
||||
? String(article.vknetto)
|
||||
: article.net != null
|
||||
? String(article.net)
|
||||
: '';
|
||||
const taxVal =
|
||||
article.taxrate != null
|
||||
? String(article.taxrate)
|
||||
: article.tax != null
|
||||
? String(article.tax)
|
||||
: '';
|
||||
|
||||
this.automat.actions.addLineitem({
|
||||
amount: 1,
|
||||
sku: article.sku || '',
|
||||
name: article.name || '',
|
||||
tax: taxVal,
|
||||
taxrate: taxVal,
|
||||
net: netVal,
|
||||
netprice: netVal,
|
||||
pu: 1,
|
||||
});
|
||||
}
|
||||
|
||||
handleRemoveLine(key) {
|
||||
const index = this.findLineIndex(key);
|
||||
this.automat.actions.removeLineitem(index >= 0 ? index : key);
|
||||
@@ -1307,6 +1337,7 @@ class LieferungNeuPage extends PureComponent {
|
||||
onLineChange={this.handleLineChange}
|
||||
onSkuBlur={this.handleSkuBlur}
|
||||
onAddLine={this.handleAddLine}
|
||||
onAddArticleLine={this.handleAddArticleLine}
|
||||
onRemoveLine={this.handleRemoveLine}
|
||||
onRemoveAllLines={this.handleRemoveAllLines}
|
||||
onSave={() => void this.handleSave()}
|
||||
|
||||
Reference in New Issue
Block a user