|
@@ -188,52 +188,52 @@ let baseFigureTemplate = {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.common.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
},
|
|
|
'FBFXDEJJRGF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.labour.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.labour) && cbTools.isDef(bill.feesIndex.labour.totalFee) ? bill.feesIndex.labour.totalFee : 0;
|
|
|
},
|
|
|
'FBFXDEJJCLF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.material.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.material) && cbTools.isDef(bill.feesIndex.material.totalFee) ? bill.feesIndex.material.totalFee : 0;
|
|
|
},
|
|
|
'FBFXDEJJJXF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.machine.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.machine) && cbTools.isDef(bill.feesIndex.machine.totalFee) ? bill.feesIndex.machine.totalFee : 0;
|
|
|
},
|
|
|
'FBFXTZRGF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.adjustLabour.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.adjustLabour) && cbTools.isDef(bill.feesIndex.adjustLabour.totalFee) ? bill.feesIndex.adjustLabour.totalFee : 0;
|
|
|
},
|
|
|
'FBFXTZJSRGF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.adjustMachineLabour.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.adjustMachineLabour) && cbTools.isDef(bill.feesIndex.adjustMachineLabour.totalFee) ? bill.feesIndex.adjustMachineLabour.totalFee : 0;
|
|
|
},
|
|
|
'FBFXZCF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.mainMaterial.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.mainMaterial) && cbTools.isDef(bill.feesIndex.mainMaterial.totalFee) ? bill.feesIndex.mainMaterial.totalFee : 0;
|
|
|
},
|
|
|
'FBFXSBF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.SUB_ENGINERRING]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.mainMaterial.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.equipment) && cbTools.isDef(bill.feesIndex.equipment.totalFee) ? bill.feesIndex.equipment.totalFee : 0;
|
|
|
},
|
|
|
'FBFXWJJCLF': function () {
|
|
|
- return 0;
|
|
|
+ return (this['FBFXZCF']() + this['FBFXSBF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
'FBFXRGGR': function () {
|
|
|
return 0;
|
|
@@ -245,13 +245,13 @@ let baseFigureTemplate = {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.MEASURE]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.common.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
},
|
|
|
'ZZCSXMF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.common.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
},
|
|
|
'ZZCSXMDEJJZJGCF': function () {
|
|
|
return (this['ZZCSXMDEJJRGF']() + this['ZZCSXMDEJJCLF']() + this['ZZCSXMDEJJJXF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
@@ -260,67 +260,70 @@ let baseFigureTemplate = {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.labour.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.labour) && cbTools.isDef(bill.feesIndex.labour.totalFee) ? bill.feesIndex.labour.totalFee : 0;
|
|
|
},
|
|
|
'ZZCSXMDEJJCLF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.material.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.material) && cbTools.isDef(bill.feesIndex.material.totalFee) ? bill.feesIndex.material.totalFee : 0;
|
|
|
},
|
|
|
'ZZCSXMDEJJJXF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_ORGANIZATION]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.machine.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.machine) && cbTools.isDef(bill.feesIndex.machine.totalFee) ? bill.feesIndex.machine.totalFee : 0;
|
|
|
},
|
|
|
'JSCSXMF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.common.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
},
|
|
|
'JSCSXMDEJJRGF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.labour.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.labour) && cbTools.isDef(bill.feesIndex.labour.totalFee) ? bill.feesIndex.labour.totalFee : 0;
|
|
|
},
|
|
|
'JSCSXMDEJJCLF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.material.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.material) && cbTools.isDef(bill.feesIndex.material.totalFee) ? bill.feesIndex.material.totalFee : 0;
|
|
|
},
|
|
|
'JSCSXMDEJJJXF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.machine.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.machine) && cbTools.isDef(bill.feesIndex.machine.totalFee) ? bill.feesIndex.machine.totalFee : 0;
|
|
|
},
|
|
|
'JSCSXMTZRGF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.adjustLabour.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.adjustLabour) && cbTools.isDef(bill.feesIndex.adjustLabour.totalFee) ? bill.feesIndex.adjustLabour.totalFee : 0;
|
|
|
},
|
|
|
'JSCSXMTZJSRGF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.adjustMachineLabour.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.adjustMachineLabour) && cbTools.isDef(bill.feesIndex.adjustMachineLabour.totalFee) ? bill.feesIndex.adjustMachineLabour.totalFee : 0;
|
|
|
},
|
|
|
'JSCSXMZCF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.mainMaterial.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.mainMaterial) && cbTools.isDef(bill.feesIndex.mainMaterial.totalFee) ? bill.feesIndex.mainMaterial.totalFee : 0;
|
|
|
},
|
|
|
'JSCSXMSBF': function () {
|
|
|
- return 0;
|
|
|
+ let bill = calcBase.fixedBills[calcBase.fixedFlag.CONSTRUCTION_TECH]['bill'];
|
|
|
+ if(cbTools.isUnDef(bill)) return 0;
|
|
|
+ if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.equipment) && cbTools.isDef(bill.feesIndex.equipment.totalFee) ? bill.feesIndex.equipment.totalFee : 0;
|
|
|
},
|
|
|
'JSCSXMWJJCLF': function () {
|
|
|
- return 0;
|
|
|
+ return (this['JSCSXMZCF']() + this['JSCSXMSBF']()).toDecimal(decimalObj.bills.totalPrice);
|
|
|
},
|
|
|
'JSCSXMRGGR': function () {
|
|
|
return 0;
|
|
@@ -332,19 +335,19 @@ let baseFigureTemplate = {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.OTHER]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.common.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
},
|
|
|
'GF': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.CHARGE]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.common.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
},
|
|
|
'SJ': function () {
|
|
|
let bill = calcBase.fixedBills[calcBase.fixedFlag.TAX]['bill'];
|
|
|
if(cbTools.isUnDef(bill)) return 0;
|
|
|
if(cbTools.isUnDef(bill.feesIndex) || Object.keys(bill.feesIndex).length === 0) return 0;
|
|
|
- return bill.feesIndex.common.totalFee || 0;
|
|
|
+ return cbTools.isDef(bill.feesIndex.common) && cbTools.isDef(bill.feesIndex.common.totalFee) ? bill.feesIndex.common.totalFee : 0;
|
|
|
}
|
|
|
};
|
|
|
|