|
|
@@ -428,7 +428,6 @@ function getMultiRptsCommon(user_id, prj_id, rpt_ids, pageSize, orientation, cus
|
|
|
function getBillsSummaryReportPages(req, user_id, prjIds, rpt_id, pageSize, orientation, customizeCfg, option, outputType, cb) {
|
|
|
let rptTpl = null;
|
|
|
rptTplDataFacade.getBudgetSummayDatas(prjIds, req.session.sessionCompilation.overWriteUrl).then(function(summaryRawDataRst) {
|
|
|
- // console.log(summaryRawDataRst);
|
|
|
rptTplFacade.getRptTemplate(rpt_id).then(function(rptTpl) {
|
|
|
let rptDataUtil = new rptDataExtractor();
|
|
|
rptDataUtil.initialize((rptTpl._doc)?rptTpl._doc:rptTpl);
|
|
|
@@ -461,8 +460,8 @@ function getBillsSummaryReportPages(req, user_id, prjIds, rpt_id, pageSize, orie
|
|
|
cb('Exception occurs while on going...', null);
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
});
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function getSummaryComboPages(req, user_id, prjIds, billsSummaryRpt_ids, gljSummaryRpt_ids, pageSize, orientation, customizeCfg, option, outputType, cb) {
|
|
|
@@ -508,26 +507,31 @@ function getSummaryComboPages(req, user_id, prjIds, billsSummaryRpt_ids, gljSumm
|
|
|
if (billRpts.length > 0) {
|
|
|
rptTplDataFacade.getBudgetSummayDatas(prjIds, req.session.sessionCompilation.overWriteUrl).then(function(summaryRawDataRst) {
|
|
|
let savedBillsData = [];
|
|
|
- Object.assign(savedBillsData, summaryRawDataRst.SummaryAuditDetail);
|
|
|
- for (let idx = 0; idx < billRpts.length; idx++) {
|
|
|
- pri_setup_rpt_tpl_data(billRpts[idx], summaryRawDataRst);
|
|
|
- if (idx < billRpts.length - 1) {
|
|
|
- Object.assign(summaryRawDataRst.SummaryAuditDetail, savedBillsData);
|
|
|
+ try {
|
|
|
+ Object.assign(savedBillsData, summaryRawDataRst.SummaryAuditDetail);
|
|
|
+ for (let idx = 0; idx < billRpts.length; idx++) {
|
|
|
+ pri_setup_rpt_tpl_data(billRpts[idx], summaryRawDataRst);
|
|
|
+ if (idx < billRpts.length - 1) {
|
|
|
+ Object.assign(summaryRawDataRst.SummaryAuditDetail, savedBillsData);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (gljRpts && gljRpts.length > 0) {
|
|
|
- rptTplDataFacade.getGLJSummayDatas(prjIds).then(function(summaryRawDataRst) {
|
|
|
- let savedBillsData = [];
|
|
|
- Object.assign(savedBillsData, summaryRawDataRst.SummaryAuditDetail);
|
|
|
- for (let idx = 0; idx < gljRpts.length; idx++) {
|
|
|
- pri_setup_rpt_tpl_data(gljRpts[idx], summaryRawDataRst);
|
|
|
- if (idx < gljRpts.length - 1) {
|
|
|
- Object.assign(summaryRawDataRst.SummaryAuditDetail, savedBillsData);
|
|
|
+ if (gljRpts && gljRpts.length > 0) {
|
|
|
+ rptTplDataFacade.getGLJSummayDatas(prjIds).then(function(summaryRawDataRst) {
|
|
|
+ let savedBillsData = [];
|
|
|
+ Object.assign(savedBillsData, summaryRawDataRst.SummaryAuditDetail);
|
|
|
+ for (let idx = 0; idx < gljRpts.length; idx++) {
|
|
|
+ pri_setup_rpt_tpl_data(gljRpts[idx], summaryRawDataRst);
|
|
|
+ if (idx < gljRpts.length - 1) {
|
|
|
+ Object.assign(summaryRawDataRst.SummaryAuditDetail, savedBillsData);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ cb(null, pageRstArr);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
cb(null, pageRstArr);
|
|
|
- });
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ } catch (ex) {
|
|
|
+ console.log(ex);
|
|
|
cb(null, pageRstArr);
|
|
|
}
|
|
|
});
|