|
@@ -389,10 +389,10 @@ const stageIm = (function () {
|
|
|
if (im.calc_memo !== undefined && im.calc_memo !== null && im.calc_memo !== '') return;
|
|
|
|
|
|
if (im.leafXmjs && im.leafXmjs.length > 0) {
|
|
|
- const memo = ['本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit];
|
|
|
+ const memo = ['本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + (im.qc_minus_jl ? (` (不计价 ${im.qc_minus_jl}) `) : ' ') + im.unit];
|
|
|
for (const lx of im.leafXmjs) {
|
|
|
for (const p of lx.pos) {
|
|
|
- memo.push(p.name + ':' + p.jl + ' ' + im.unit);
|
|
|
+ memo.push(p.name + ':' + p.jl + (p.qc_minus_jl ? (` (不计价 ${p.qc_minus_jl}) `) : ' ') + im.unit);
|
|
|
}
|
|
|
}
|
|
|
im.calc_memo = memo.join('\n');
|
|
@@ -405,10 +405,10 @@ const stageIm = (function () {
|
|
|
if (b.pos && b.pos.length > 0) {
|
|
|
memo.push('清单' + (i+1) + ':' + b.b_code + ' ' + b.name);
|
|
|
for (const p of b.pos) {
|
|
|
- memo.push(p.name + ':' + p.jl + ' ' + b.unit);
|
|
|
+ memo.push(p.name + ':' + p.jl + (p.qc_minus_jl ? (` (不计价 ${p.qc_minus_jl}) `) : ' ') + b.unit);
|
|
|
}
|
|
|
} else {
|
|
|
- memo.push('清单' + (i+1) + ':' + b.b_code + ' ' + b.name + ':' + (checkZero(b.jl) ? 0 : b.jl) + ' ' + b.unit);
|
|
|
+ memo.push('清单' + (i+1) + ':' + b.b_code + ' ' + b.name + ':' + (checkZero(b.jl) ? 0 : b.jl) + (b.qc_minus_jl ? (` (不计价 ${b.qc_minus_jl}) `) : ' ') + b.unit);
|
|
|
}
|
|
|
}
|
|
|
im.calc_memo = memo.join('\n');
|
|
@@ -466,6 +466,7 @@ const stageIm = (function () {
|
|
|
lp.jl = ZhCalc.add(lp.jl, p.gather_qty);
|
|
|
lp.contract_jl = ZhCalc.add(lp.contract_jl, p.contract_qty);
|
|
|
lp.qc_jl = ZhCalc.add(lp.qc_jl, p.qc_qty);
|
|
|
+ lp.qc_minus_jl = ZhCalc.add(lp.qc_minus_jl, p.qc_minus_qty);
|
|
|
}
|
|
|
}
|
|
|
function recursiveGenerateTzGclBills(node, im) {
|
|
@@ -488,6 +489,7 @@ const stageIm = (function () {
|
|
|
b.jl = ZhCalc.add(b.jl, p.gather_qty);
|
|
|
b.contract_jl = ZhCalc.add(b.contract_jl, p.contract_qty);
|
|
|
b.qc_jl = ZhCalc.add(b.qc_jl, p.qc_qty);
|
|
|
+ b.qc_minus_jl = ZhCalc.add(b.qc_minus_jl, p.qc_minus_qty);
|
|
|
generateTzPosData(p, b);
|
|
|
}
|
|
|
}
|
|
@@ -533,23 +535,23 @@ const stageIm = (function () {
|
|
|
for (const p of posterity) {
|
|
|
if (p.children && p.children.length > 0) continue;
|
|
|
if (!checkZero(p.contract_qty) || !checkZero(p.contract_tp) ||
|
|
|
- !checkZero(p.qc_qty) || !checkZero(p.qc_tp))
|
|
|
+ !checkZero(p.qc_qty) || !checkZero(p.qc_tp) || !checkZero(p.qc_minus_qty))
|
|
|
return true;
|
|
|
const pPos = gsPos.getLedgerPos(p.id);
|
|
|
if (!pPos || pPos.length === 0) continue;
|
|
|
for (const pp of pPos) {
|
|
|
- if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty)) return true;
|
|
|
+ if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty) || !checkZero(pp.qc_minus_qty)) return true;
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
} else {
|
|
|
if (!checkZero(node.contract_qty) || !checkZero(node.contract_tp) ||
|
|
|
- !checkZero(node.qc_qty) || !checkZero(node.qc_tp))
|
|
|
+ !checkZero(node.qc_qty) || !checkZero(node.qc_tp) || !checkZero(node.qc_minus_qty))
|
|
|
return true;
|
|
|
const pPos = gsPos.getLedgerPos(node.id);
|
|
|
if (!pPos || pPos.length === 0) return false;
|
|
|
for (const pp of pPos) {
|
|
|
- if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty)) return true;
|
|
|
+ if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty) || !checkZero(pp.qc_minus_qty)) return true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -558,7 +560,7 @@ const stageIm = (function () {
|
|
|
const pPos = gsPos.getLedgerPos(node.id);
|
|
|
if (!pPos || pPos.length === 0) return null;
|
|
|
for (const pp of pPos) {
|
|
|
- if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty)) return pp;
|
|
|
+ if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty) || !checkZero(pp.qc_minus_qty)) return pp;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -587,7 +589,7 @@ const stageIm = (function () {
|
|
|
const peg = getPegNode(node);
|
|
|
const im = {
|
|
|
lid: node.id, pid: '', code: node.code,
|
|
|
- jl: node.gather_tp, contract_jl: node.contract_tp, qc_jl: node.qc_tp,
|
|
|
+ jl: node.gather_tp, contract_jl: node.contract_tp, qc_jl: node.qc_tp, qc_minus_jl: 0,
|
|
|
//im_code: getNewImCode(),
|
|
|
peg: peg ? getPegStr(peg.name) : '', drawing_code: getDrawingCode(node),
|
|
|
position: '',
|
|
@@ -625,11 +627,13 @@ const stageIm = (function () {
|
|
|
}
|
|
|
gcl.contract_jl = ZhCalc.add(gcl.contract_jl, bills.contract_jl);
|
|
|
gcl.qc_jl = ZhCalc.add(gcl.qc_jl, bills.qc_jl);
|
|
|
+ gcl.qc_minus_jl = ZhCalc.add(gcl.qc_minus_jl, bills.qc_minus_jl);
|
|
|
gcl.jl = ZhCalc.add(gcl.jl, bills.jl);
|
|
|
}
|
|
|
function calculateBwBillsIm(im) {
|
|
|
im.contract_jl = 0;
|
|
|
im.qc_jl = 0;
|
|
|
+ im.qc_minus_jl = 0;
|
|
|
for (const b of im.gclBills) {
|
|
|
im.contract_jl = ZhCalc.add(im.contract_jl, ZhCalc.mul(b.contract_jl, b.unit_price, decimal.tp));
|
|
|
im.qc_jl = ZhCalc.add(im.qc_jl, ZhCalc.mul(b.qc_jl, b.unit_price, decimal.tp));
|
|
@@ -689,7 +693,7 @@ const stageIm = (function () {
|
|
|
}
|
|
|
addBwBillsGclBills(im, {
|
|
|
b_code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
|
|
|
- jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty
|
|
|
+ jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty, qc_minus_jl: pp.qc_minus_jl,
|
|
|
});
|
|
|
|
|
|
if (pp.drawing_code && im.drawing_code instanceof Array)
|
|
@@ -707,11 +711,12 @@ const stageIm = (function () {
|
|
|
|
|
|
imDefault.contract_jl = ZhCalc.add(imDefault.contract_jl, p.contract_tp);
|
|
|
imDefault.qc_jl = ZhCalc.add(imDefault.qc_jl, p.qc_tp);
|
|
|
+ imDefault.qc_jl = 0;
|
|
|
imDefault.used = true;
|
|
|
|
|
|
addBwBillsGclBills(imDefault, {
|
|
|
b_code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
|
|
|
- jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_jl,
|
|
|
+ jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_jl, qc_minus_jl: 0,
|
|
|
});
|
|
|
}
|
|
|
}
|
|
@@ -737,7 +742,7 @@ const stageIm = (function () {
|
|
|
const posRange = gsPos.getLedgerPos(node.id);
|
|
|
if (!posRange) { return }
|
|
|
for (const p of posRange) {
|
|
|
- if (!p.gather_qty || checkZero(p.gather_qty)) { continue; }
|
|
|
+ if (checkZero(p.contract_qty) && checkZero(p.qc_qty) && checkZero(p.qc_minus_qty)) { continue; }
|
|
|
let lp = _.find(lx.pos, {name: p.name});
|
|
|
if (!lp) {
|
|
|
lp = {name: p.name};
|
|
@@ -746,6 +751,7 @@ const stageIm = (function () {
|
|
|
lp.jl = ZhCalc.add(lp.jl, p.gather_qty);
|
|
|
lp.contract_jl = ZhCalc.add(lp.contract_jl, p.contract_qty);
|
|
|
lp.qc_jl = ZhCalc.add(lp.qc_jl, p.qc_qty);
|
|
|
+ lp.qc_minus_jl = ZhCalc.add(lp.qc_minus_jl, p.qc_minus_qty);
|
|
|
}
|
|
|
}
|
|
|
function generateZlLeafXmjData(node, im) {
|
|
@@ -766,6 +772,7 @@ const stageIm = (function () {
|
|
|
lx.jl = ZhCalc.add(lx.jl, node.gather_qty);
|
|
|
lx.contract_jl = ZhCalc.add(lx.contract_jl, node.contract_qty);
|
|
|
lx.qc_jl = ZhCalc.add(lx.qc_jl, node.qc_qty);
|
|
|
+ lx.qc_minus_jl = ZhCalc.add(lx.qc_minus_jl, node.qc_minus_qty);
|
|
|
generateZlPosData(node, lx);
|
|
|
}
|
|
|
function generateZlChangeData(node, im) {
|
|
@@ -809,7 +816,7 @@ const stageIm = (function () {
|
|
|
const peg = getPegNode(node);
|
|
|
im = {
|
|
|
lid: node.id, pid: '', code: p.b_code, name: p.name, unit: p.unit, unit_price: p[up_field],
|
|
|
- jl: 0, contract_jl: 0, qc_jl: 0,
|
|
|
+ jl: 0, contract_jl: 0, qc_jl: 0, qc_minus_jl: 0,
|
|
|
peg: peg ? getPegStr(peg.name) : '',
|
|
|
position: '',
|
|
|
lIndex: nodeIndex,
|
|
@@ -837,6 +844,7 @@ const stageIm = (function () {
|
|
|
im.jl = ZhCalc.add(im.jl, p.gather_qty);
|
|
|
im.contract_jl = ZhCalc.add(im.contract_jl, p.contract_qty);
|
|
|
im.qc_jl = ZhCalc.add(im.qc_jl, p.qc_qty);
|
|
|
+ im.qc_minus_jl = ZhCalc.add(im.qc_minus_jl, p.qc_minus_qty);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -854,7 +862,7 @@ const stageIm = (function () {
|
|
|
if (checkZero(pp.contract_qty) && checkZero(pp.qc_qty)) { continue }
|
|
|
const im = {
|
|
|
lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p[up_field], pid: pp.id,
|
|
|
- jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty,
|
|
|
+ jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty, qc_minus_jl: pp.qc_minus_jl,
|
|
|
//im_code: getNewImCode(),
|
|
|
bw: bw, jldy: pp.name,
|
|
|
peg: CheckPeg(pp.name) ? getPegStr(pp.name) : (peg ? getPegStr(peg.name) : ''),
|
|
@@ -880,7 +888,7 @@ const stageIm = (function () {
|
|
|
|
|
|
const im = {
|
|
|
lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p[up_field], pid: '',
|
|
|
- jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_qty,
|
|
|
+ jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_qty, qc_minus_jl: p.qc_minus_qty,
|
|
|
im_code: getNewImCode(),
|
|
|
bw: bw,
|
|
|
peg: peg ? getPegStr(peg.name) : '',
|