|
@@ -466,8 +466,8 @@ const join = {
|
|
|
{main: 'unit_price', sub: 'unit_price',type: 'number'},
|
|
|
],
|
|
|
importFields: [
|
|
|
- {main: 'ex_value1', sub: 'quantity', type: 'number'},
|
|
|
- {main: 'ex_value2', sub: 'total_price', type: 'number'}
|
|
|
+ {main: 'ex_value1', sub: 'quantity', type: 'sum'},
|
|
|
+ {main: 'ex_value2', sub: 'total_price', type: 'sum'}
|
|
|
],
|
|
|
joinType: 'outer', //'outer', 'main', 'sub', 'inner',
|
|
|
},
|
|
@@ -510,7 +510,12 @@ const join = {
|
|
|
result.push(r);
|
|
|
}
|
|
|
for (const i of options.importFields) {
|
|
|
- r[i.main] = s[i.sub];
|
|
|
+ //r[i.main] = s[i.sub];
|
|
|
+ if (i.type === 'sum') {
|
|
|
+ r[i.main] = ctx.helper.add(r[i.main], s[i.sub]);
|
|
|
+ } else {
|
|
|
+ r[i.main] = s[i.sub];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
switch (options.joinType) {
|