Fix wrong activity wording for add/remove stock [SCI-9721] (#6671)

This commit is contained in:
Soufiane 2023-11-21 14:55:07 +01:00 committed by GitHub
parent ee49dd1895
commit 86b6f4243c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -176,7 +176,7 @@
return unit ? unit[1] : '' return unit ? unit[1] : ''
}, },
newAmount: function() { newAmount: function() {
const currentAmount = new Decimal(this.stockValue.amount || 0); const currentAmount = new Decimal(this.stockValue?.amount || 0);
const amount = new Decimal(this.amount || 0) const amount = new Decimal(this.amount || 0)
let value; let value;
switch (this.operation) { switch (this.operation) {
@ -271,7 +271,7 @@
comment: this.comment, comment: this.comment,
low_stock_threshold: this.reminderEnabled ? this.lowStockTreshold : null low_stock_threshold: this.reminderEnabled ? this.lowStockTreshold : null
}, },
operator: this.operations.find(operation => operation[0] = this.operation)?.[1], operator: this.operations.find(operation => operation[0] == this.operation)?.[1],
change_amount: Math.abs(this.amount), change_amount: Math.abs(this.amount),
}, },
success: function(result) { success: function(result) {