瀏覽代碼

材差,期汇总相关

MaiXinRong 3 年之前
父節點
當前提交
2a43861f39

+ 1 - 0
app/const/report.js

@@ -15,6 +15,7 @@ rptCustomType[JV.NODE_CUS_GATHER_SELECT] = 2;
 rptCustomType[JV.NODE_CUS_COMPARE_SELECT] = 3;
 rptCustomType[JV.NODE_CUS_STAGE_SELECT] = 4;
 rptCustomType[JV.NODE_CUS_CHANGE_SELECT] = 5;
+rptCustomType[JV.NODE_CUS_MATERIAL_SUM_SELECT] = 6;
 
 const rptDataType = {};
 rptDataType[JV.NODE_CUS_MATERIAL_SELECT] = 1;

+ 3 - 0
app/controller/report_controller.js

@@ -199,6 +199,8 @@ module.exports = app => {
                     reportConst.rptCustomType[JV.NODE_CUS_STAGE_SELECT], ctx.tender.id, -1);
                 customSelects.change_select = await ctx.service.rptCustomDefine.getCustomSelectByRpt(cid,
                     reportConst.rptCustomType[JV.NODE_CUS_CHANGE_SELECT], ctx.tender.id, -1);
+                customSelects.material_sum_select = await ctx.service.rptCustomDefine.getCustomSelectByRpt(cid,
+                    reportConst.rptCustomType[JV.NODE_CUS_MATERIAL_SUM_SELECT], ctx.tender.id, -1);
                 const dataSelects = {};
                 dataSelects.material_select = await ctx.service.rptCustomDefine.getDataSelectByRpt(cid,
                     reportConst.rptDataType[JV.NODE_CUS_MATERIAL_SELECT]);
@@ -385,6 +387,7 @@ module.exports = app => {
             let copyCustomSelect = this.ctx.helper.clone(customSelect);
             if (!params.gather_select && copyCustomSelect) delete copyCustomSelect.gather_select;
             if (!params.stage_select && copyCustomSelect) delete copyCustomSelect.stage_select;
+            if (!params.material_sum_select && copyCustomSelect) delete copyCustomSelect.material_sum_select;
             if (params.change_select) {
                 copyCustomSelect = { tid: params.tender_id, rid: params.rpt_tpl_id, sid: -1, change_select: params.change_select};
             }

+ 48 - 0
app/lib/rpt_data_analysis.js

@@ -1445,6 +1445,53 @@ const stageSelectConverse = {
         }
     },
 };
+const materialSumSelectConverse = {
+    name: '交叉【多期材差汇总】数据',
+    hint: '需搭配 用户交互【材差-多期汇总选择】 一起使用',
+    defaultSetting: {
+        table: ['mem_material_sum_gl'],
+    },
+    _commonConverse(helper, data, materials) {
+        const result = [];
+        const reg = new RegExp('^m_[0-9]+_');
+        for (const s of materials) {
+            const curReg = new RegExp('^m_' + s + '_');
+            for (const [i, d] of data.entries()) {
+                const nd = { cross_index: i + 1, s_order: s };
+                for (const prop in d) {
+                    if (reg.test(prop)) {
+                        if (curReg.test(prop)) {
+                            nd[prop.replace(curReg, 'm_')] = d[prop];
+                        }
+                    } else {
+                        nd[prop] = d[prop];
+                    }
+                }
+                result.push(nd);
+            }
+        }
+        return result;
+    },
+    fun(ctx, data, fieldsKey, options, csRela) {
+        if (!csRela.tplDefine) return;
+
+        const gsDefine = csRela.tplDefine.material_sum_select;
+        if (!gsDefine || !gsDefine.enable || !gsDefine.setting || gsDefine.setting === '') return;
+        const gsCustom = csRela.cDefine ? csRela.cDefine.material_sum_select : null;
+        if (gsCustom) {
+            for (const t of options.table) {
+                switch (t) {
+                    case 'mem_material_sum_gl':
+                        data[t] = this._commonConverse(ctx.helper, data[t], gsCustom.materials);
+                        break;
+                }
+            }
+            console.log(data.mem_material_sum_gl);
+        } else {
+            console.log('gsCustom is null!');
+        }
+    },
+};
 const loadCooperationData = {
     name: '加载协作数据',
     hint: '须使用台账、计量审批流程、协作数据作为基础',
@@ -1793,6 +1840,7 @@ const analysisObj = {
     datetimeFormat,
     gatherSelectConverse,
     stageSelectConverse,
+    materialSumSelectConverse,
     sortPos,
     unionPos,
     splitXmjCode,

+ 88 - 1
app/public/report/js/rpt_custom.js

@@ -158,6 +158,9 @@ const rptCustomObj = (function () {
         },
     };
 
+    // 材差 - 期选择
+    const sMaterialSumSelect = 'material_sum_select';
+
     // 变更令选择
     const sChangeSelect = 'change_select';
     const changeObj = {
@@ -364,6 +367,32 @@ const rptCustomObj = (function () {
     const initChangeSelect = function (gsSetting, rptName, resolve = null) {
         changeObj.show('选择工程变更' + (rptName ? '-' + rptName : ''), resolve);
     };
+    const initMaterialSumSelect = function (gsSetting, gsSelect, rptName, resolve = null) {
+        const setting = JSON.parse(gsSetting);
+        $('#material-sum-select-count').html(gsSelect && gsSelect.materials ? gsSelect.materials.length : 0);
+        $('#material-sum-select-title').html((setting.title || '请选择材差期') + (rptName ? '-' + rptName : ''));
+        // 初始化选择结果
+        $('#material-sum-select-hint').attr('min-select', setting.min).attr('max-select', setting.max).hide();
+        for (const sc of $('[name=material-sum-select-check]')) {
+            sc.checked = false;
+        }
+        if (gsSelect && gsSelect.materials) {
+            for (const s of gsSelect.materials) {
+                $('#material-sum-select-' + s)[0].checked = true;
+            }
+        }
+        if (resolve) {
+            setTimeout(() => { $("#material-sum-select").modal('show'); }, 1000);
+        } else {
+            $("#material-sum-select").modal('show');
+        }
+
+        $('#material-sum-select-ok').unbind('click');
+        $('#material-sum-select-ok').bind('click', () => {
+            rptCustomObj.resetMaterialSumSelect(resolve);
+            // $("#stage-select").modal('hide');
+        });
+    };
     const init = function (cDefine, sfData, cSelect, rptName, resolve = null) {
         stageFlow = sfData;
         if (cDefine && cDefine[sAuditSelect] && cDefine[sAuditSelect].enable && cDefine[sAuditSelect].setting) {
@@ -385,6 +414,12 @@ const rptCustomObj = (function () {
         } else {
             $('#pnl_stage_select').hide();
         }
+        if (cDefine && cDefine[sMaterialSumSelect] && cDefine[sMaterialSumSelect].enable && cDefine[sMaterialSumSelect].setting) {
+            $('#pnl_material_sum_select').show();
+            initMaterialSumSelect(cDefine[sMaterialSumSelect].setting, cSelect ? cSelect[sMaterialSumSelect] : null, rptName, resolve);
+        } else {
+            $('#pnl_material_sum_select').hide();
+        }
         if (cDefine && cDefine[sChangeSelect] && cDefine[sChangeSelect].enable) {
             initChangeSelect(cDefine[sChangeSelect].setting, rptName, resolve);
         }
@@ -626,6 +661,44 @@ const rptCustomObj = (function () {
         }
     };
 
+    const resetMaterialSumSelect = function (resolve = null) {
+        const data = {}, hintObj = $('#material-sum-select-hint');
+        if (!resolve) getCommonParams(data);
+        data[sMaterialSumSelect] = {
+            materials: [],
+        };
+        for (const mc of $('[name=material-sum-select-check]:checked')) {
+            data[sMaterialSumSelect].materials.push(parseInt($(mc).attr('material-order')));
+        }
+        if (data[sMaterialSumSelect].materials.length < parseInt(hintObj.attr('min-select'))) {
+            hintObj.html('请至少选择' + hintObj.attr('min-select') + '期数据').show();
+            return;
+        } else if (data[sMaterialSumSelect].materials.length > parseInt(hintObj.attr('max-select'))) {
+            hintObj.html('最多只能选择' + hintObj.attr('max-select') + '期数据').show();
+            return;
+        }
+        hintObj.hide();
+        if (resolve) {
+            resolve(data);
+        } else {
+            postData('/report/cDefine', data, function (result) {
+                reloadReportData(result);
+                const material_sum_select = customSelects[sMaterialSumSelect].find(function (x) {
+                    return x.id === zTreeOprObj.currentNode.refId;
+                });
+                if (material_sum_select) {
+                    material_sum_select.masterial_sum_select = data[sMaterialSumSelect];
+                }
+                $('#material-sum-select-count').html(data[sMaterialSumSelect].materials.length);
+                $('#material-sum-select').modal('hide');
+                rptArchiveObj.toggleBtn(true);
+                if (PAGE_SHOW.showArchive) {
+                    rptArchiveObj.showArchivedItem(zTreeOprObj.currentNode);
+                }
+            });
+        }
+    };
+
     const resetChangeSelect = function (resolve = null) {
         const data = {}, hintObj = $('#change-select-hint');
         if (!resolve) getCommonParams(data);
@@ -822,6 +895,9 @@ const rptCustomObj = (function () {
             const change_select = customSelects.change_select.find(function (x) {
                 return x.id === rptId;
             });
+            const material_sum_select = customSelects.material_sum_select.find(function (x) {
+                return x.id === rptId;
+            });
             if (gather_select && gather_select.custom_define && gather_select.custom_define[sGatherSelect].enable) {
                 if (rptId === currentRptId) {
                     const data = {};
@@ -855,6 +931,17 @@ const rptCustomObj = (function () {
                     params.customSelect.push(select);
                     $('#change-select').modal('hide');
                 }
+            } else if (material_sum_select && material_sum_select.custom_define && material_sum_select.custom_define[sMaterialSumSelect].enable) {
+                if (rptId === currentRptId) {
+                    const data = {};
+                    data[sMaterialSumSelect] = material_sum_select[sMaterialSumSelect];
+                    params.customSelect.push(data);
+                } else {
+                    const chkNode = chkNodes.find(function (x) { return x.refId === rptId});
+                    const select = await comfirmSelectPromise(chkNode ? chkNode.name : '', material_sum_select);
+                    params.customSelect.push(select);
+                    $('#material-sum-select').modal('hide');
+                }
             } else {
                 params.customSelect.push(null);
             }
@@ -918,7 +1005,7 @@ const rptCustomObj = (function () {
 
     return {
         init,
-        resetAuditSelect, resetGatherSelect, resetStageSelect, resetChangeSelect,
+        resetAuditSelect, resetGatherSelect, resetStageSelect, resetChangeSelect, resetMaterialSumSelect,
         initTenderTree,
         initTenderTreeForCross,
         getCustomSelect,

+ 16 - 0
app/public/report/js/rpt_main.js

@@ -297,6 +297,14 @@ let zTreeOprObj = {
                 return;
             }
 
+            const material_sum_select = customSelects.material_sum_select.find(function (x) {
+                return x.id === treeNode.refId;
+            });
+            if (material_sum_select) {
+                rptCustomObj.init(material_sum_select.custom_define, customSelects.stageFlow, material_sum_select);
+                return;
+            }
+
             const change_select = customSelects.change_select.find(function (x) {
                 return x.id === treeNode.refId;
             });
@@ -365,6 +373,14 @@ let zTreeOprObj = {
                 return;
             }
 
+            const material_sum_select = customSelects.material_sum_select.find(function (x) {
+                return x.id === me.currentNode.refId;
+            });
+            if (material_sum_select) {
+                rptCustomObj.init(material_sum_select.custom_define, customSelects.stageFlow, material_sum_select);
+                return;
+            }
+
             const change_select = customSelects.change_select.find(function (x) {
                 return x.id === me.currentNode.refId;
             });

+ 1 - 0
app/reports/rpt_component/jpc_value_define.js

@@ -57,6 +57,7 @@ module.exports = {
     NODE_CUS_MATERIAL_SELECT: 'material_select',
     NODE_CUS_CHANGE_SELECT: 'change_select',
     NODE_CUS_STAGE_SELECT: 'stage_select',
+    NODE_CUS_MATERIAL_SUM_SELECT: 'material_sum_select',
 
     NODE_MAP_DATA_HANDLE_INFO: '映射数据预处理',
     PROP_DATA_KEY: '映射数据对象',

+ 5 - 1
app/service/report.js

@@ -118,7 +118,6 @@ module.exports = app => {
                         case 'change_audit_list':
                             runnableRst.push(service.changeAuditList.getChangeAuditBills(params.tender_id)); // 获取所有审核通过的变更清单
                             runnableKey.push(filter);
-                            console.log(filter);
                             break;
                         case 'mem_stage_jgcl':
                             runnableRst.push(service.reportMemory.getStageJgcl(params.tender_id, params.stage_id, memFieldKeys[filter]));
@@ -198,6 +197,11 @@ module.exports = app => {
                                 customDefine.stage_select, customSelect ? customSelect.stage_select : null));
                             runnableKey.push(filter);
                             break;
+                        case 'mem_material_sum_gl':
+                            runnableRst.push(service.rptStageSumMemory.getMaterialSumGl(params.tender_id, memFieldKeys[filter],
+                                customDefine.material_sum_select, customSelect ? customSelect.material_sum_select : null));
+                            runnableKey.push(filter);
+                            break;
                         case 'ledger_cooperation':
                             runnableRst.push(service.ledgerCooperation.getValidData(params.tender_id));
                             runnableKey.push(filter);

+ 10 - 19
app/service/rpt_custom_define.js

@@ -24,15 +24,10 @@ module.exports = app => {
 
         async getCustomDefine(tid, sid, rid) {
             const data = await this.getDataByCondition({ tid: tid, sid: sid, rid: rid });
-            if (data && data.audit_select) {
-                data.audit_select = JSON.parse(data.audit_select);
-            }
-            if (data && data.gather_select) {
-                data.gather_select = JSON.parse(data.gather_select);
-            }
-            if (data && data.stage_select) {
-                data.stage_select = JSON.parse(data.stage_select);
-            }
+            if (data && data.audit_select) data.audit_select = JSON.parse(data.audit_select);
+            if (data && data.gather_select) data.gather_select = JSON.parse(data.gather_select);
+            if (data && data.stage_select) data.stage_select = JSON.parse(data.stage_select);
+            if (data && data.material_sum_select) data.material_sum_select = JSON.parse(data.material_sum_select);
             return data;
         }
 
@@ -56,13 +51,14 @@ module.exports = app => {
         }
 
         async saveCustomSelect(data) {
-            const sid = data.gather_select || data.stage_select ? -1 : data.stage_id;
+            const sid = data.audit_select ? data.stage_id : -1;
             const filter = {tid: data.tender_id, sid: sid, rid: data.rpt_tpl_id};
             const count = await this.count(filter);
             const updateData = {};
             if (data.audit_select) updateData.audit_select = JSON.stringify(data.audit_select);
             if (data.gather_select) updateData.gather_select = JSON.stringify(data.gather_select);
             if (data.stage_select) updateData.stage_select = JSON.stringify(data.stage_select);
+            if (data.material_sum_select) updateData.material_sum_select = JSON.stringify(data.material_sum_select);
             if (count > 0) {
                 await this.update(updateData, filter);
             } else {
@@ -89,15 +85,10 @@ module.exports = app => {
                 if (!cs) continue;
                 r.tid = tid;
                 r.sid = sid;
-                if (cs.audit_select) {
-                    r.audit_select = JSON.parse(cs.audit_select);
-                }
-                if (cs.gather_select) {
-                    r.gather_select = JSON.parse(cs.gather_select);
-                }
-                if (cs.stage_select) {
-                    r.stage_select = JSON.parse(cs.stage_select);
-                }
+                if (cs.audit_select) r.audit_select = JSON.parse(cs.audit_select);
+                if (cs.gather_select) r.gather_select = JSON.parse(cs.gather_select);
+                if (cs.stage_select) r.stage_select = JSON.parse(cs.stage_select);
+                if (cs.material_sum_select) r.material_sum_select = JSON.parse(cs.material_sum_select);
             }
             return result;
         }

+ 33 - 0
app/service/rpt_stage_sum_memory.js

@@ -252,6 +252,39 @@ module.exports = app => {
             }
             return payData;
         }
+
+        async getMaterialSumGl(tid, memFieldKeys, gsDefine, gsCustom) {
+            if (!gsDefine || !gsDefine.enable) return [];
+            if (!gsCustom || !gsCustom.materials || gsCustom.materials.length === 0) return [];
+
+            await this.ctx.service.tender.checkTender(tid);
+            const materialData = await this.ctx.service.materialBills.getAllDataByCondition({
+                columns: ['id', 'tid', 'order', 't_type', 'code', 'name', 'unit', 'spec', 'm_type', 'basic_price', 'basic_times', 'in_time', 'origin', 'remark'],
+                where: { tid }
+            });
+            const fields = ['quantity', 'tp', 'm_tax_tp', 'expr', 'msg_tp', 'msg_times', 'msg_spread', 'm_up_risk', 'm_down_risk', 'm_spread', 'm_tax'];
+            const calcPrefix = [];
+
+            for (const m of gsCustom.materials) {
+                const material = await this.db.get(this.ctx.service.material.tableName, { tid: this.ctx.tender.id, order: m });
+                if (!material) continue;
+
+                const prefix = 'm_' + material.order + '_';
+                calcPrefix.push(prefix);
+                const defaultData = {};
+                defaultData[prefix + 'order'] = material.order;
+
+                const curMaterial = material.status === auditConst.material.status.checked
+                    ? await this.ctx.service.materialBillsHistory.getAllDataByCondition({ where: { mid: material.id } })
+                    : await this.ctx.service.materialBills.getAllDataByCondition({ where: { tid }});
+
+                this.ctx.helper.assignRelaData(materialData, [
+                    {data: curMaterial, fields, prefix: prefix, relaId: 'mb_id', defaultData: defaultData}
+                ]);
+            }
+
+            return materialData;
+        }
     }
 
     return RptStageSumMemory;

+ 9 - 4
app/service/stage_change.js

@@ -291,14 +291,19 @@ module.exports = app => {
                 const sql = 'SELECT scf.* ' +
                     '  FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +
                     '  LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
-                    '  WHERE scf.tid = ? And scf.cid = ? And s.order = ?';
+                    '  WHERE scf.tid = ? And scf.cid = ? And s.order <= ?';
                 const result = await this.db.query(sql, [tid, cid, this.ctx.stage.order]);
                 return result;
             } else {
-                const sql = 'SELECT * FROM ' + this.tableName + ' WHERE sid = ? AND (stimes * 100 + sorder) <= (? * 100 + ?)';
-                const curAll = await this.db.query(sql, [this.ctx.stage.id, this.ctx.stage.curTimes, this.ctx.stage.curOrder]);
+                const preSql = 'SELECT scf.* ' +
+                    '  FROM ' + this.ctx.service.stageChangeFinal.tableName + ' scf ' +
+                    '  LEFT JOIN ' + this.ctx.service.stage.tableName + ' s ON scf.sid = s.id' +
+                    '  WHERE scf.tid = ? And scf.cid = ? And s.order < ?';
+                const pre = await this.db.query(preSql, [tid, cid, this.ctx.stage.order]);
+                const sql = 'SELECT * FROM ' + this.tableName + ' WHERE sid';
+                const curAll = await this.db.query(sql, [this.ctx.stage.id]);
                 const cur = this.ctx.helper.filterLastestData(curAll, ['lid', 'pid', 'cid', 'cbid'], 'stimes', 'sorder');
-                return cur;
+                return [...pre, ...cur];
             }
         }
 

+ 9 - 0
app/view/report/index.ejs

@@ -229,6 +229,15 @@
                                     </div>
                                 </div>
                             </div>
+                            <div class="panel" id="pnl_material_sum_select" style="display: none;">
+                                <div class="panel-body">
+                                    <div class="btn-group" role="group">
+                                        <button class="btn btn-primary btn-sm" type="button" data-toggle="modal" data-target="#material-sum-select">
+                                            选择材差期<br><span class="badge badge-light" id="material-sum-select-count">5</span>
+                                        </button>
+                                    </div>
+                                </div>
+                            </div>
                         </div>
                     </div>
                     <div class="sjs-height-4">

+ 29 - 0
app/view/report/rpt_all_popup.ejs

@@ -443,6 +443,35 @@
         </div>
     </div>
 </div>
+<div class="modal fade" id="material-sum-select" data-backdrop="static">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title" id="material-sum-select-title">选择期(材料调差)</h5>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+            </div>
+            <div class="modal-body">
+                <div class="row">
+                    <% for (const m of materialList) { %>
+                    <div class="col-3">
+                        <div class="custom-control custom-checkbox custom-control-inline">
+                            <input type="checkbox" id="material-sum-select-<%- m.order %>" name="material-sum-select-check" material-order="<%- m.order %>" class="custom-control-input">
+                            <label class="custom-control-label" for="material-sum-select-<%- m.order %>">第<%- m.order %>期</label>
+                        </div>
+                    </div>
+                    <% } %>
+                </div>
+                <div class="alert alert-danger my-2 p-2" id="material-sum-select-hint">我是提示呀</div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
+                <button class="btn btn-sm btn-primary" id="material-sum-select-ok">确定</button>
+            </div>
+        </div>
+    </div>
+</div>
 <div class="modal" id="change-select" data-backdrop="static">
     <div class="modal-dialog modal-lg" role="document">
         <div class="modal-content">

+ 44 - 1
builder_report_index_define.js

@@ -1603,6 +1603,48 @@ const stage_sum_pay = {
     ],
 };
 
+const material_sum_gl = {
+    name: '材差期汇总-调差工料-交叉数据表(mem_material_sum_gl)',
+    remark: '',
+    id: 74,
+    key: 'mem_material_sum_gl',
+    prefix: '材差期汇总-调差工料',
+    cols: [
+        { name: 'id', field: 'id', type: dataType.int },
+        { name: '标段id', field: 'tid', type: dataType.int },
+
+        { name: '调差类型', field: 't_type', type: dataType.int },
+        { name: '调差类型s', field: 't_type_str', type: dataType.str },
+        { name: '工料分类', field: 'm_type', type: dataType.int },
+        { name: '工料分类s', field: 'm_type_str', type: dataType.str },
+
+        { name: '编号', field: 'code', type: dataType.str },
+        { name: '名称', field: 'name', type: dataType.str },
+        { name: '单位', field: 'unit', type: dataType.str },
+        { name: '规格', field: 'spec', type: dataType.str },
+
+        { name: '基准价', field: 'basic_price', type: dataType.currency },
+        { name: '基准时间', field: 'basic_time', type: dataType.str },
+        { name: '创建时间', field: 'in_time', type: dataType.str },
+        { name: '备注', field: 'remark', type: dataType.str },
+
+        { name: '交叉排序', field: 'cross_index', type: dataType.int },
+
+        { name: '(期)第几期', field: 'm_order', type: dataType.int },
+        { name: '(期)本期信息价-单价', field: 'm_msg_tp', type: dataType.currency },
+        { name: '(期)本期信息价-时间', field: 'm_msg_times', type: dataType.str },
+        { name: '(期)本期信息价-价差', field: 'm_msg_spread', type: dataType.currency },
+        { name: '(期)本期材料调差-上涨幅度', field: 'm_m_up_risk', type: dataType.int },
+        { name: '(期)本期材料调差-下跌幅度', field: 'm_m_down_risk', type: dataType.int },
+        { name: '(期)本期材料调差-有效价差', field: 'm_m_spread', type: dataType.currency },
+        { name: '(期)本期应耗数据', field: 'm_quantity', type: dataType.currency },
+        { name: '(期)计算式', field: 'm_expr', type: dataType.str },
+        { name: '(期)本期-调差金额', field: 'm_tp', type: dataType.currency },
+        { name: '(期)税率', field: 'm_m_tax', type: dataType.int },
+        { name: '(期)调差金额(材料税)', field: 'm_m_tax_tp', type: dataType.currency },
+    ],
+};
+
 const stage_audit = {
     name: '期-审批人 列表(stage_audit)',
     remark: '',
@@ -2220,7 +2262,8 @@ const defines = [
     stage_rela_im, stage_rela_im_bills,
     gather_stage_bills, gather_tender_info, gather_stage_pay, gather_deal_bills,
     select_material, select_material_audit, material, materialGl, material_bills, material_pos, material_gl_detail,
-    stage_sum_bills, stage_sum_pay, stage_audit, sign_select,
+    stage_sum_bills, stage_sum_pay, material_sum_gl,
+    stage_audit, sign_select,
     stage_change, stage_change_bills, stage_change_ledger,
     gcl_gather_bills, gcl_gather_xmj,
     ledger_tag, stage_tag, all_tag,

+ 3 - 0
sql/update.sql

@@ -325,3 +325,6 @@ ALTER TABLE `zh_material_checklist` CHANGE `quantity` `quantity` DECIMAL(30,8) N
 ALTER TABLE `zh_material_checklist` CHANGE `total_price` `total_price` DECIMAL(30,8) NULL DEFAULT NULL COMMENT '金额';
 
 ALTER TABLE `zh_change` ADD `up_decimal` TINYINT(2) NULL DEFAULT NULL COMMENT '数量小数位数' AFTER `tp_decimal`;
+
+ALTER TABLE `zh_rpt_custom_define`
+ADD COLUMN `material_sum_select`  text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL COMMENT '用户定制信息 - 材差 - 多期汇总表' AFTER `stage_select`;