|
@@ -183,24 +183,20 @@ export default {
|
|
row['unit'] = res?.unit
|
|
row['unit'] = res?.unit
|
|
row['stockQty'] = res?.stockQty
|
|
row['stockQty'] = res?.stockQty
|
|
row['insideQty'] =
|
|
row['insideQty'] =
|
|
- [
|
|
|
|
- 0,
|
|
|
|
- 0,
|
|
|
|
- 0,
|
|
|
|
- ...res.items.filter(item => item.type === 'INSIDE').map(item => item.qty)
|
|
|
|
- ].reduce((accumulator, currentValue) => accumulator + currentValue, 0) * Number(row?.qty)
|
|
|
|
|
|
+ res.items
|
|
|
|
+ .filter(item => item.type === 'INSIDE')
|
|
|
|
+ .map(item => item.qty)
|
|
|
|
+ .reduce((accumulator, currentValue) => accumulator + currentValue, 0) * Number(row?.qty)
|
|
row['outQty'] =
|
|
row['outQty'] =
|
|
- [0, 0, 0, ...res.items.filter(item => item.type === 'OUT').map(item => item.qty)].reduce(
|
|
|
|
- (accumulator, currentValue) => accumulator + currentValue,
|
|
|
|
- 0
|
|
|
|
- ) * Number(row?.qty)
|
|
|
|
|
|
+ res.items
|
|
|
|
+ .filter(item => item.type === 'OUT')
|
|
|
|
+ .map(item => item.qty)
|
|
|
|
+ .reduce((accumulator, currentValue) => accumulator + currentValue, 0) * Number(row?.qty)
|
|
row['partsQty'] =
|
|
row['partsQty'] =
|
|
- [
|
|
|
|
- 0,
|
|
|
|
- 0,
|
|
|
|
- 0,
|
|
|
|
- ...res.items.filter(item => item.type === 'PARTS').map(item => item.qty)
|
|
|
|
- ].reduce((accumulator, currentValue) => accumulator + currentValue, 0) * Number(row?.qty)
|
|
|
|
|
|
+ res.items
|
|
|
|
+ .filter(item => item.type === 'PARTS')
|
|
|
|
+ .map(item => item.qty)
|
|
|
|
+ .reduce((accumulator, currentValue) => accumulator + currentValue, 0) * Number(row?.qty)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
@@ -276,25 +272,22 @@ export default {
|
|
res => {
|
|
res => {
|
|
if (this.formDialogType == 0) {
|
|
if (this.formDialogType == 0) {
|
|
row['insideQty'] =
|
|
row['insideQty'] =
|
|
- [
|
|
|
|
- 0,
|
|
|
|
- 0,
|
|
|
|
- 0,
|
|
|
|
- ...res.items.filter(item => item.type === 'INSIDE').map(item => item.qty)
|
|
|
|
- ].reduce((accumulator, currentValue) => accumulator + currentValue, 0) *
|
|
|
|
|
|
+ res.items
|
|
|
|
+ .filter(item => item.type === 'INSIDE')
|
|
|
|
+ .map(item => item.qty)
|
|
|
|
+ .reduce((accumulator, currentValue) => accumulator + currentValue, 0) *
|
|
row[column.columnAttributes.prop]
|
|
row[column.columnAttributes.prop]
|
|
row['outQty'] =
|
|
row['outQty'] =
|
|
- [0, 0, 0, ...res.items.filter(item => item.type === 'OUT').map(item => item.qty)].reduce(
|
|
|
|
- (accumulator, currentValue) => accumulator + currentValue,
|
|
|
|
- 0
|
|
|
|
- ) * row[column.columnAttributes.prop]
|
|
|
|
|
|
+ res.items
|
|
|
|
+ .filter(item => item.type === 'OUT')
|
|
|
|
+ .map(item => item.qty)
|
|
|
|
+ .reduce((accumulator, currentValue) => accumulator + currentValue, 0) *
|
|
|
|
+ row[column.columnAttributes.prop]
|
|
row['partsQty'] =
|
|
row['partsQty'] =
|
|
- [
|
|
|
|
- 0,
|
|
|
|
- 0,
|
|
|
|
- 0,
|
|
|
|
- ...res.items.filter(item => item.type === 'PARTS').map(item => item.qty)
|
|
|
|
- ].reduce((accumulator, currentValue) => accumulator + currentValue, 0) *
|
|
|
|
|
|
+ res.items
|
|
|
|
+ .filter(item => item.type === 'PARTS')
|
|
|
|
+ .map(item => item.qty)
|
|
|
|
+ .reduce((accumulator, currentValue) => accumulator + currentValue, 0) *
|
|
row[column.columnAttributes.prop]
|
|
row[column.columnAttributes.prop]
|
|
}
|
|
}
|
|
}
|
|
}
|