|
@@ -76,11 +76,15 @@ const getLedgerSpreadSetting = async function(ctx, tid, readOnly) {
|
|
|
const pos = projectSpread[`${prefix}_ledger_pos_spread`];
|
|
|
if (!tender.info.display.ledger.clQty) {
|
|
|
const billsColIndex = ledger.cols.findIndex(x => { return x.field === spreadConst.withoutClReplace.indexField; });
|
|
|
- removeFieldCols(ledger, spreadConst.withoutClReplace.remove);
|
|
|
- ledger.cols.splice(billsColIndex, 0, ...spreadConst.withoutClReplace.billsCols);
|
|
|
+ if (billsColIndex >= 0) {
|
|
|
+ removeFieldCols(ledger, spreadConst.withoutClReplace.remove);
|
|
|
+ ledger.cols.splice(billsColIndex, 0, ...spreadConst.withoutClReplace.billsCols);
|
|
|
+ }
|
|
|
const posColIndex = pos.cols.findIndex(x => { return x.field === spreadConst.withoutClReplace.indexField; });
|
|
|
- removeFieldCols(pos, spreadConst.withoutClReplace.remove);
|
|
|
- pos.cols.splice(posColIndex, 0, ...spreadConst.withoutClReplace.posCols);
|
|
|
+ if (posColIndex >= 0) {
|
|
|
+ removeFieldCols(pos, spreadConst.withoutClReplace.remove);
|
|
|
+ pos.cols.splice(posColIndex, 0, ...spreadConst.withoutClReplace.posCols);
|
|
|
+ }
|
|
|
}
|
|
|
// const setting = tender.data.measure_type === measureType.tz.value
|
|
|
// ? (tender.info.display.ledger.clQty ? spreadConst.withCl : spreadConst.withoutCl)
|
|
@@ -104,7 +108,7 @@ const getStageSpreadSetting = async function (ctx, tid, readOnly, funInfo) {
|
|
|
|
|
|
const projectSpread = await ctx.service.projectSpread.getProjectSpread(ctx.session.sessionProject.id, tender.info.s_type);
|
|
|
const prefix = tender.data.measure_type === measureType.tz.value ? 'tz' : 'gcl';
|
|
|
- const ledger = projectSpread[`${prefix}_stage_bills_spread`];
|
|
|
+ const ledger = projectSpread[`${prefix}_stage_bills_spread`];
|
|
|
const pos = projectSpread[`${prefix}_stage_pos_spread`];
|
|
|
if (!tender.info.display.ledger.dgnQty) {
|
|
|
removeFieldCols(ledger, spreadConst.filterCols.stageDgnCols);
|