|
@@ -10,6 +10,7 @@
|
|
|
|
|
|
const Ledger = require('./ledger');
|
|
|
const splitChar = '-';
|
|
|
+const mergeChar = ';';
|
|
|
|
|
|
class BillsPosConvert {
|
|
|
|
|
@@ -122,9 +123,19 @@ class BillsPosConvert {
|
|
|
for (const p of pos) {
|
|
|
const posUnit = xmj.unitTree.addNode({pos_name: p.name,
|
|
|
b_code: null, name: '', unit: null, unit_price: null});
|
|
|
+ if (p.drawing_code && posUnit.drawing_code.indexOf(p.drawing_code) <= 0)
|
|
|
+ posUnit.drawing_code.push(p.drawing_code);
|
|
|
+ if (p.memo) posUnit.memo.push(p.memo);
|
|
|
+ if (node.postil) posUnit.postil.push(node.postil);
|
|
|
+
|
|
|
const gclUnit = xmj.unitTree.addNode({pos_name: '',
|
|
|
b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price
|
|
|
}, posUnit);
|
|
|
+ if (node.drawing_code && gclUnit.drawing_code.indexOf(node.drawing_code) <= 0)
|
|
|
+ gclUnit.drawing_code.push(node.drawing_code);
|
|
|
+ if (node.memo) gclUnit.memo.push(node.memo);
|
|
|
+ if (node.postil) gclUnit.postil.push(node.postil);
|
|
|
+
|
|
|
//loadField(gclUnit, p, baseCalcFields);
|
|
|
this._loadPosCalcFields(gclUnit, p);
|
|
|
if (!gclUnit.changes) gclUnit.changes = [];
|
|
@@ -135,9 +146,15 @@ class BillsPosConvert {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- const unit = xmj.unitTree.addNode({pos_name: '',
|
|
|
- b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price});
|
|
|
- //loadField(unit, node, baseCalcFields);
|
|
|
+ const unit = xmj.unitTree.addNode({
|
|
|
+ pos_name: '',
|
|
|
+ b_code: node.b_code, name: node.name, unit: node.unit, unit_price: node.unit_price,
|
|
|
+ });
|
|
|
+ if (node.drawing_code && unit.drawing_code.indexOf(node.drawing_code) <= 0)
|
|
|
+ unit.drawing_code.push(node.drawing_code);
|
|
|
+ if (node.memo) unit.memo.push(node.memo);
|
|
|
+ if (node.postil) unit.postil.push(node.postil);
|
|
|
+
|
|
|
this._loadBillsCalcFields(unit, node);
|
|
|
if (!unit.changes) unit.changes = [];
|
|
|
for (const c of this.bpcChange) {
|
|
@@ -226,6 +243,13 @@ class BillsPosConvert {
|
|
|
} else {
|
|
|
this._calculateChild(node);
|
|
|
}
|
|
|
+
|
|
|
+ if (node.drawing_code && node.drawing_code.length > 0)
|
|
|
+ node.drawing_code_merge = node.drawing_code.join(mergeChar);
|
|
|
+ if (node.memo && node.memo.length > 0)
|
|
|
+ node.memo_merge = node.memo.join(mergeChar);
|
|
|
+ if (node.postil && node.postil.length > 0)
|
|
|
+ node.postil_merge = node.postil.join(mergeChar);
|
|
|
}
|
|
|
}
|
|
|
_recursiveCalculateAndSort(nodes) {
|