|
@@ -1914,7 +1914,8 @@ const masterCross = {
|
|
masterKey: 'id', subKey: 'gather_gcl_id', gatherKey: 'mb_id',
|
|
masterKey: 'id', subKey: 'gather_gcl_id', gatherKey: 'mb_id',
|
|
prefix: 's_',
|
|
prefix: 's_',
|
|
fields: ['code', 'name', 'units'],
|
|
fields: ['code', 'name', 'units'],
|
|
- gatherFields: ['quantity'],
|
|
|
|
|
|
+ quoteFields: ['quantity'],
|
|
|
|
+ gatherFields: [],
|
|
},
|
|
},
|
|
target: 'master_converse'
|
|
target: 'master_converse'
|
|
},
|
|
},
|
|
@@ -1937,14 +1938,21 @@ const masterCross = {
|
|
for (const f of options.main.fields) {
|
|
for (const f of options.main.fields) {
|
|
temp[options.main.prefix + f] = m[f];
|
|
temp[options.main.prefix + f] = m[f];
|
|
}
|
|
}
|
|
- const rela = subTable.filter(x => { return x[options.sub.subKey] === m[options.masterKey]; });
|
|
|
|
|
|
+ const rela = subTable.filter(x => { return x[options.sub.subKey] === m[options.sub.masterKey]; });
|
|
for (const cd of converseData) {
|
|
for (const cd of converseData) {
|
|
const nd = JSON.parse(JSON.stringify(temp));
|
|
const nd = JSON.parse(JSON.stringify(temp));
|
|
|
|
+ nd.quote = false;
|
|
for (const prop in cd) {
|
|
for (const prop in cd) {
|
|
nd[options.sub.prefix + prop] = cd[prop];
|
|
nd[options.sub.prefix + prop] = cd[prop];
|
|
}
|
|
}
|
|
rela.forEach(x => {
|
|
rela.forEach(x => {
|
|
if (x[options.sub.gatherKey] !== cd[options.sub.gatherKey]) return;
|
|
if (x[options.sub.gatherKey] !== cd[options.sub.gatherKey]) return;
|
|
|
|
+ if (!nd.quote) {
|
|
|
|
+ for (const f of options.sub.quoteFields) {
|
|
|
|
+ nd[options.sub.prefix + f] = x[f];
|
|
|
|
+ }
|
|
|
|
+ nd.quote = true;
|
|
|
|
+ }
|
|
for (const f of options.sub.gatherFields) {
|
|
for (const f of options.sub.gatherFields) {
|
|
nd[options.sub.prefix + f] = ctx.helper.add(nd[options.sub.prefix + f], x[f]);
|
|
nd[options.sub.prefix + f] = ctx.helper.add(nd[options.sub.prefix + f], x[f]);
|
|
}
|
|
}
|