Browse Source

报表调整

zhuth 7 years ago
parent
commit
5da6d81546

+ 29 - 0
frontend/saas-web/app/model/report/CustomerCheck.js

@@ -0,0 +1,29 @@
+Ext.define('saas.model.report.CustomerCheck', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'pi_date', type: 'date' }, // 单据日期
+        { name: 'pi_inoutno', type: 'string' }, // 单号
+        { name: 'pi_class', type: 'string' }, // 业务类型
+        { name: 'pd_pdno', type: 'int' }, // 序号
+        { name: 'pr_code', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'qty', type: 'float' }, // 数量
+        { name: 'pd_unit', type: 'string' }, // 单位
+        { name: 'pd_netprice', type: 'float' }, // 单价
+        { name: 'pd_orderprice', type: 'float' }, // 含税单价
+        { name: 'pd_nettotal', type: 'float' }, // 金额
+        { name: 'pd_taxrate', type: 'float' }, // 税率
+        { name: 'pd_ordertotal-pd_nettotal', type: 'float', // 税额
+            convert: function(v, rec) {
+                var t = (rec.get('pd_ordertotal') || 0.0) - (rec.get('pd_nettotal') || 0.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_ordertotal', 'pd_nettotal']
+        },
+        { name: 'pd_ordertotal', type: 'float' }, // 价税合计
+    ],
+});

+ 20 - 0
frontend/saas-web/app/model/report/ProfitDetail.js

@@ -0,0 +1,20 @@
+Ext.define('saas.model.report.ProfitDetail', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'cu_type', type: 'string' }, // 客户类型
+        { name: 'pi_custname', type: 'string' }, // 客户名称
+        { name: 'netamount', type: 'float' }, // 金额
+        { name: 'saamount-netamount', type: 'float', // 税额
+            convert: function(v, rec) {
+                var t = (rec.get('saamount') || 0.0) - (rec.get('netamount') || 0.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['saamount', 'netamount']    
+        },
+        { name: 'saamount', type: 'float' }, // 价税合计
+        { name: 'costamount', type: 'float' }, // 成本金额
+        { name: 'profit', type: 'float' }, // 毛利润
+        { name: 'profitpresent', type: 'float' }, // 毛利率
+    ],
+});

+ 13 - 23
frontend/saas-web/app/model/report/Purchase.js

@@ -3,34 +3,24 @@ Ext.define('saas.model.report.Purchase', {
 
     fields: [
 
-        { name: 'id', type: 'int' },
-        { name: 'pu_code', type: 'string' },
-        { name: 'pu_vendcode', type: 'string' },
-        { name: 'pu_vendname', type: 'string' },
-        { name: 'pu_acceptstatus', type: 'string' },
-        { name: 'pu_buyername', type: 'string' },
-        { name: 'pu_date', type: 'date' },
-        { name: 'pd_detno', type: 'int' },
-        { name: 'pd_prodcode', type: 'string' },
-        { name: 'pr_detail', type: 'string' },
-        { name: 'pr_spec', type: 'string' },
-        { name: 'pr_brand', type: 'string' },
-        { name: 'pr_unit', type: 'string' },
-        { name: 'pd_qyt', type: 'float' },
-        { name: 'pd_price', type: 'float' },
-        { name: 'pd_taxrate', type: 'float' },
-        { name: 'pd_total', type: 'float' },
-        { name: 'pd_taxprice', type: 'float' },
-        { name: 'pd_taxtotal', type: 'float' },
-        { name: 'pd_taxamount', type: 'float',
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'pd_qty', type: 'float' }, // 采购数量
+        { name: 'pr_unit', type: 'string' }, // 单位
+        { name: 'pd_taxprice', type: 'float' }, // 单价
+        { name: 'pd_price', type: 'float' }, // 含税单价
+        { name: 'pd_taxtotal', type: 'float' }, // 金额
+        { name: 'pd_taxrate', type: 'int' }, // 税率
+        { name: 'pd_total-pd_taxtotal', type: 'float', // 税额
             convert: function(v, rec) {
                 var t = (rec.get('pd_total') || 0.0) - (rec.get('pd_taxtotal') || 0.0);
                 return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
             },
             depends: ['pd_total', 'pd_taxtotal']
         },
-        { name: 'pd_acceptqty', type: 'float' },
-        { name: 'pd_accepttotal', type: 'float' },
-        { name: 'pd_remark', type: 'string' },
+        { name: 'pd_total', type: 'float' }, // 价税合计
+        { name: 'pd_pdacceptqty', type: 'float' }, // 收货数量
+        { name: 'pd_remark', type: 'string' }, // 备注
     ],
 });

+ 24 - 0
frontend/saas-web/app/model/report/PurchasePay.js

@@ -0,0 +1,24 @@
+Ext.define('saas.model.report.PurchasePay', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'pb_code', type: 'string' }, // 付款单号
+        { name: 'pu_vendname', type: 'string' }, // 供应商名称
+        { name: 'createTime', type: 'date' }, // 日期
+        { name: 'pbd_slcode', type: 'string' }, // 来源单号
+        { name: 'pbd_slkind', type: 'string' }, // 业务类型
+        { name: 'pi_nettotal', type: 'float' }, // 金额
+        { name: 'pd_total-pi_nettotal', type: 'float', // 税额
+            convert: function(v, rec) {
+                var t = (rec.get('pi_total') || 0.0) - (rec.get('pi_nettotal') || 0.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pi_total', 'pi_nettotal']
+        },
+        { name: 'pi_total', type: 'float' }, // 价税合计
+        { name: 'pbd_nowbalance', type: 'float' }, // 付款金额
+        { name: 'pb_payrate', type: 'float', }, // 付款比例
+        { name: 'pb_manname', type: 'string' }, // 付款人
+        { name: 'pb_remark', type: 'string' }, // 备注
+    ],
+});

+ 28 - 0
frontend/saas-web/app/model/report/VendorCheck.js

@@ -0,0 +1,28 @@
+Ext.define('saas.model.report.PurchasePay', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'pi_date', type: 'date' }, // 单据日期
+        { name: 'pi_inoutno', type: 'string' }, // 单号
+        { name: 'pi_class', type: 'string' }, // 业务类型
+        { name: 'pd_pdno', type: 'int' }, // 序号
+        { name: 'pr_code', type: 'string' }, // 物料编号
+        { name: 'pr_brand', type: 'string' }, // 品牌
+        { name: 'pr_detail', type: 'string' }, // 名称
+        { name: 'pr_orispeccode', type: 'string' }, // 型号
+        { name: 'pr_spec', type: 'string' }, // 规格
+        { name: 'qty', type: 'float' }, // 数量
+        { name: 'pd_unit', type: 'string' }, // 单位
+        { name: 'pd_netprice', type: 'float' }, // 单价
+        { name: 'pd_nettotal', type: 'float' }, // 金额
+        { name: 'pd_taxrate', type: 'float' }, // 税率
+        { name: 'pd_ordertotal-pi_nettotal', type: 'float', // 税额
+            convert: function(v, rec) {
+                var t = (rec.get('pd_ordertotal') || 0.0) - (rec.get('pd_nettotal') || 0.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_ordertotal', 'pd_nettotal']
+        },
+        { name: 'pd_ordertotal', type: 'float' }, // 价税合计
+    ],
+});

+ 6 - 0
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -189,6 +189,12 @@ Ext.define('saas.view.core.report.ReportPanel', {
 
     initStore: function () {
         var me = this, cfg = {};
+        // if(me.groupField) {
+        //     cfg.sorters = {
+        //         property: me.groupField,
+        //         direction: 'ASC'
+        //     }
+        // }
         if(me.reportModel) {
             cfg.model = me.reportModel;
         }else {

+ 18 - 43
frontend/saas-web/app/view/money/report/AccountBalance.js

@@ -13,7 +13,7 @@ Ext.define('saas.view.money.report.AccountBalance', {
     defaultCondition: null,
     reportTitle: '账户收支明细表',
     QueryWidth: 0.25,
-    //筛选:账户、日期(必填)
+
     searchItems: [{
         xtype: 'bandinfoDbfindTrigger',
         name: 'bankname',
@@ -27,81 +27,56 @@ Ext.define('saas.view.money.report.AccountBalance', {
     }],
 
     reportColumns: [{
+        text: '日期',
+        dataIndex: 'date',
+        xtype: 'datecolumn',
+        width: 110
+    }, {
         text: '账户编号',
         dataIndex: 'bankcode',
-        width: 150
+        width: 80
     }, {
         text: '账户名称',
         dataIndex: 'bankname',
-        width: 200
-    }, {
-        text: '日期',
-        dataIndex: 'date',
-        xtype: 'datecolumn',
-        width: 110
+        width: 150
     }, {
         text: '业务类型',
         dataIndex: 'kind',
-        width: 110
+        width: 100
     }, {
         text: '收入',
         dataIndex: 'inamount',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 110,
+        width: 120,
         renderer: function (v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
         summaryType: 'sum',
         summaryRenderer: function (v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
     }, {
         text: '支出',
         dataIndex: 'outamount',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        width: 110,
+        width: 120,
         renderer: function (v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
         summaryType: 'sum',
         summaryRenderer: function (v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
-    },
-    //     {
-    //     text: '账户余额',
-    //     dataIndex: 'thisamount',
-    //     xtype: 'numbercolumn',
-    //     width: 110,
-    //     renderer: function (v) {
-    //         var arr = (v + '.').split('.');
-    //         var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-    //         var format = '0,000.' + xr.join('');
-    //         return Ext.util.Format.number(v, format);
-    //     }
-    // },
-        {
+    }, {
         text: '往来单位',
         dataIndex: 'bname',
-        width: 150
+        width: 200
     }, {
         text: '收付款人',
         dataIndex: 'bmanname',
-        width: 110
+        width: 80
     }, {
         text: '备注',
         dataIndex: 'remark',

+ 17 - 26
frontend/saas-web/app/view/money/report/AccountDetails.js

@@ -50,18 +50,20 @@ Ext.define('saas.view.money.report.AccountDetails', {
         emptyText: '供应商编号/名称',
         columnWidth: 0.15
     }],
+
     reportColumns: [{
-        text: 'id',
-        dataIndex: 'pi_id',
-        hidden: true
-    }, {
-        text: '单据编号',
-        dataIndex: 'sl_code',
+        text: '核销单号',
+        dataIndex: 'pb_code',
         width: 150
     }, {
-        text: '单据类型',
-        dataIndex: 'sl_kind',
+        text: '单据日期',
+        dataIndex: 'pb_date',
+        xtype: 'datecolumn',
         width: 110
+    }, {
+        text: '业务类型',
+        dataIndex: 'sl_kind',
+        width: 100
     }, {
         text: '供应商名称',
         dataIndex: 've_name',
@@ -71,37 +73,26 @@ Ext.define('saas.view.money.report.AccountDetails', {
         dataIndex: 'cu_name',
         width: 200
     }, {
-        text: '核销单号',
-        dataIndex: 'pb_code',
-        width: 200
-    }, {
-        text: '单据日期',
-        dataIndex: 'pb_date',
-        xtype: 'datecolumn',
-        width: 110
+        text: '来源单号',
+        dataIndex: 'sl_code',
+        width: 150
     }, {
         text: '本期核销金额(元)',
         dataIndex: 'pbd_nowbalance',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 130,
+        width: 150,
         renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
     }, {
         text: '总金额(元)',
         dataIndex: 'sl_orderamount',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        width: 110,
+        width: 120,
         renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
     }],
 });

+ 41 - 69
frontend/saas-web/app/view/money/report/CustomerCheck.js

@@ -31,11 +31,9 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
         columnWidth: 0.4
     }],
 
+    reportModel: 'saas.model.report.CustomerCheck',
+
     reportColumns: [{
-        text: 'id',
-        dataIndex: 'pi_id',
-        hidden: true
-    },  {
         text: '单据日期',
         dataIndex: 'pi_date',
         xtype: 'datecolumn',
@@ -44,12 +42,16 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
         text: '单号',
         dataIndex: 'pi_inoutno',
         width: 150
+    }, {
+        text: '业务类型',
+        dataIndex: 'pi_class',
+        width: 100
     }, {
         text: '序号',
         dataIndex: 'pd_pdno',
         exportFormat: 'Integer',
         xtype: 'numbercolumn',
-        width: 80
+        width: 65
     }, {
         text: '物料编号',
         width: 150,
@@ -57,11 +59,11 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
     }, {
         text: '品牌',
         dataIndex: 'pr_brand',
-        width: 200
+        width: 100
     }, {
         text: '名称',
         dataIndex: 'pr_detail',
-        width: 200
+        width: 150
     }, {
         text: '型号',
         dataIndex: 'pr_orispeccode',
@@ -69,7 +71,7 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
     }, {
         text: '规格',
         dataIndex: 'pr_spec',
-        width: 150
+        width: 200
     }, {
         text: '数量',
         xtype: 'numbercolumn',
@@ -85,13 +87,13 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
     }, {
         text: '单位',
         dataIndex: 'pd_unit',
-        width: 80
+        width: 65
     }, {
         text: '单价(元)',
-        dataIndex: 'pd_orderprice',
+        dataIndex: 'pd_netprice',
         exportFormat: 'Price',
         xtype: 'numbercolumn',
-        width: 110,
+        width: 120,
         renderer: function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
@@ -99,92 +101,62 @@ Ext.define('saas.view.money.report.CustomerCheckCheck', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-        text: '税率',
-        dataIndex: 'pd_taxrate',
-        exportFormat: 'Integer',
+        text: '含税单价(元)',
+        dataIndex: 'pd_orderprice',
+        exportFormat: 'Price',
         xtype: 'numbercolumn',
-        width: 80,
+        width: 120,
         renderer: function(v) {
-            return Ext.util.Format.number(v, '0');
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join('');
+            return Ext.util.Format.number(v, format);
         }
     }, {
         text: '金额(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        width: 110,
-        dataIndex: 'pd_total',
+        width: 120,
+        dataIndex: 'pd_nettotal',
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
-        // summaryType: 'sum',
-        // summaryRenderer: function(v) {
-        //     var arr = (v + '.').split('.');
-        //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-        //     var format = '0,000.' + xr.join('');
-        //     return Ext.util.Format.number(v, format);
-        // }
-    }, {
-        text: '不含税单价(元)',
-        width: 150,
-        dataIndex: 'pd_netprice',
-        exportFormat: 'Price',
+    }, {
+        text: '税率(%)',
+        dataIndex: 'pd_taxrate',
+        exportFormat: 'Integer',
         xtype: 'numbercolumn',
+        width: 80,
         renderer: function(v) {
+            return Ext.util.Format.number(v, '0');
+        }
+    }, {
+        text: '税额(元)',
+        width: 120,
+        xtype: 'numbercolumn',
+        exportFormat: 'Amount',
+        dataIndex: 'pd_ordertotal-pd_nettotal',
+        renderer : function(v) {
             var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         }
     }, {
-        text: '不含税金额(元)',
-        width: 150,
+        text: '价税合计(元)',
+        width: 120,
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex: 'pd_nettotal',
+        dataIndex: 'pd_ordertotal',
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         }
-        // summaryType: 'sum',
-        // summaryRenderer: function(v) {
-        //     var arr = (v + '.').split('.');
-        //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-        //     var format = '0,000.' + xr.join('');
-        //     return Ext.util.Format.number(v, format);
-        // }
-    }, {
-        text: '单据类型',
-        dataIndex: 'pi_class',
-        width: 110
-    }, {
-        text: '期初应收',
-        dataIndex: 'beginamount',
-        hidden: true,
-        width: 0,
-        summaryType: 'cus',
-    }, {
-        text: '增加应收',
-        dataIndex: 'nowamount',
-        hidden: true,
-        width: 0,
-        summaryType: 'cus',
-    }, {
-        text: '增加预收',
-        dataIndex: 'nowpay',
-        hidden: true,
-        width: 0,
-        summaryType: 'cus',
-    }, {
-        text: '应收余额',
-        dataIndex: 'nowbalance',
-        hidden: true,
-        width: 0,
-        summaryType: 'cus',
     }],
 
     listeners: {

+ 7 - 7
frontend/saas-web/app/view/money/report/OtherIODetail.js

@@ -66,15 +66,15 @@ Ext.define('saas.view.money.report.OtherIODetail', {
     reportColumns: [{
         text: '日期',
         dataIndex: 'bl_date',
-        width: 200
+        width: 110
     }, {
         text: '单据编号',
         dataIndex: 'bl_code',
-        width: 200,
+        width: 150,
     }, {
         text: '收支类别',
         dataIndex: 'bl_kind',
-        width: 200,
+        width: 100,
     }, {
         text: '资金账户',
         dataIndex: 'bl_bankname',
@@ -83,7 +83,7 @@ Ext.define('saas.view.money.report.OtherIODetail', {
         text: '收入',
         dataIndex: 'bl_income',
         exportFormat: 'Amount',
-        width: 150,
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -101,7 +101,7 @@ Ext.define('saas.view.money.report.OtherIODetail', {
         text: '支出',
         dataIndex: 'bl_spending',
         exportFormat: 'Amount',
-        width: 150,
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -118,10 +118,10 @@ Ext.define('saas.view.money.report.OtherIODetail', {
     }, {
         text: '往来单位',
         dataIndex: 'bl_assname',
-        width: 150,
+        width: 200,
     }, {
         text: '备注',
         dataIndex: 'bl_remark',
-        width: 150
+        width: 250
     }]
 });

+ 7 - 24
frontend/saas-web/app/view/money/report/PayDetail.js

@@ -28,10 +28,6 @@ Ext.define('saas.view.money.report.PayDetail', {
     }],
 
     reportColumns: [{
-        text: 'id',
-        dataIndex: 'pd_id',
-        hidden: true
-    }, {
         text: '单据日期',
         xtype: 'datecolumn',
         dataIndex: 'pd_date',
@@ -41,29 +37,19 @@ Ext.define('saas.view.money.report.PayDetail', {
         dataIndex: 'pd_code',
         width: 150
     }, {
-        text: '单据类型',
+        text: '业务类型',
         dataIndex: 'pd_kind',
-        width: 110
-    }, {
-        text:'供应商编号',
-        dataIndex:'pd_vendcode',
-        width: 150,
-        hidden: true
-    },{
-        text:'供应商名称',
-        width: 200,
-        dataIndex:'pd_vendname',
-        hidden: true
+        width: 100
     },{
         text: '采购员',
         dataIndex: 'pd_buyername',
-        width: 110
+        width: 80
     },{
         text: '增加应付',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
         dataIndex: 'pd_addpay',
-        width: 180,
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -82,7 +68,7 @@ Ext.define('saas.view.money.report.PayDetail', {
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
         dataIndex: 'pd_addpre',
-        width: 180,
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -101,7 +87,7 @@ Ext.define('saas.view.money.report.PayDetail', {
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
         dataIndex: 'pd_remain',
-        width: 110,
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -142,10 +128,7 @@ Ext.define('saas.view.money.report.PayDetail', {
             return Ext.Array.sum(arr);
         }
     }, {
-        text: '供应商名称',
-        dataIndex: 'pd_vendname',
-        hidden:true
-    }, {
+        dataIndex: '',
         flex: 1
     }]
 });

+ 31 - 20
frontend/saas-web/app/view/money/report/ProfitDetail.js

@@ -38,55 +38,65 @@ Ext.define('saas.view.money.report.ProfitDetail', {
         columnWidth: 0.5
     }],
 
+    reportModel: 'saas.model.report.ProfitDetail',
+
     reportColumns: [{
-        text: '客户',
-        dataIndex: 'pi_custname',
-        width: 200,
-    },{
         text: '客户类型',
         dataIndex: 'cu_type',
-        width: 200,
+        width: 100,
     }, {
-        text: '业务员',
-        dataIndex: 'cu_sellername',
+        text: '客户名称',
+        dataIndex: 'pi_custname',
         width: 200,
     }, {
-        text: '销售总额',
-        dataIndex: 'saamount',
+        text: '金额(元)',
+        dataIndex: 'netamount',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 110,
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
-        summaryType: 'sum',
-        summaryRenderer: function(v) {
+    }, {
+        text: '税额(元)',
+        dataIndex: 'saamount-netamount',
+        exportFormat: 'Amount',
+        xtype: 'numbercolumn',
+        width: 120,
+        renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
-        }
+        },
     }, {
-        text: '不含税金额(元)',
-        dataIndex: 'netamount',
+        text: '价税合计(元)',
+        dataIndex: 'saamount',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 150,
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
+        summaryType: 'sum',
+        summaryRenderer: function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join('');
+            return Ext.util.Format.number(v, format);
+        }
     }, {
         text: '成本金额(元)',
         dataIndex: 'costamount',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 110,
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -98,7 +108,7 @@ Ext.define('saas.view.money.report.ProfitDetail', {
         dataIndex: 'profit',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 110,
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -113,9 +123,9 @@ Ext.define('saas.view.money.report.ProfitDetail', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-        text: '毛利率%',
+        text: '毛利率(%)',
         dataIndex: 'profitpresent',
-        width: 130,
+        width: 100,
         xtype: 'numbercolumn',
         renderer : function(v) {
             var arr = (v + '.').split('.');
@@ -124,6 +134,7 @@ Ext.define('saas.view.money.report.ProfitDetail', {
             return Ext.util.Format.number(v * 100, format);
         },
     },{
+        dataIndex: '',
         flex: 1
     }]
 });

+ 30 - 54
frontend/saas-web/app/view/money/report/RecDetail.js

@@ -12,11 +12,11 @@ Ext.define('saas.view.money.report.RecDetail', {
     listUrl: '/api/money/report/recDetail',
     defaultCondition: null,
     reportTitle: '应收账款明细',
-    QueryWidth:0.25,
+    QueryWidth: 0.25,
     allowPaging: false,
 
     //筛选:客户、日期(必填)
-    searchItems: [ {
+    searchItems: [{
         xtype: 'customerDbfindTrigger',
         name: 'rd_custname',
         fieldLabel: '客户名称',
@@ -29,10 +29,6 @@ Ext.define('saas.view.money.report.RecDetail', {
     }],
 
     reportColumns: [{
-        text: 'id',
-        dataIndex: 'rd_id',
-        hidden: true
-    }, {
         text: '单据日期',
         xtype: 'datecolumn',
         dataIndex: 'rd_date',
@@ -44,97 +40,80 @@ Ext.define('saas.view.money.report.RecDetail', {
     }, {
         text: '单据类型',
         dataIndex: 'rd_kind',
-        width: 110
-    },{
-        text: '客户编号',
-        dataIndex: 'pi_custcode',
-        width: 150,
-        hidden: true
+        width: 100
     }, {
-        text: '客户名称',
-        dataIndex: 'pi_custname',
-        width: 200,
-        hidden: true
-    },{
         text: '业务员',
         dataIndex: 'rd_sellername',
-        width: 110
+        width: 80
     }, {
-        text: '序号',
-        dataIndex: 'rd_detno',
-        exportFormat: 'Integer',
-        xtype: 'numbercolumn',
-        width: 80,
-        hidden: true
-    },{
-        text:'增加应收',
-        dataIndex:'rd_addrec',
+        text: '增加应收',
+        dataIndex: 'rd_addrec',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 110,
-        renderer : function(v) {
+        width: 120,
+        renderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
         summaryType: 'sum',
-        summaryRenderer: function(v) {
+        summaryRenderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         }
-    },{
-        text:'增加预收',
+    }, {
+        text: '增加预收',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex:'rd_addpre',
-        width: 180,
-        renderer : function(v) {
+        dataIndex: 'rd_addpre',
+        width: 120,
+        renderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
         summaryType: 'sum',
-        summaryRenderer: function(v) {
+        summaryRenderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         }
-    },{
+    }, {
         text: '应收余额',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
         dataIndex: 'rd_remain',
-        width: 110,
-        renderer : function(v) {
+        width: 120,
+        renderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
         summaryType: 'customize_last',
-        summaryRenderer: function(v) {
+        summaryRenderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
-        mySummaryRenderer: function(grid, column, datas) {
+        mySummaryRenderer: function (grid, column, datas) {
             datas = datas || [];
             var store = grid.store,
-            dataIndex = column.dataIndex,
-            groupField = store.getGroupField(),
-            count = datas.length,
-            data = datas,
-            lasts = {},
-            keys = [],
-            arr = [];
+                dataIndex = column.dataIndex,
+                groupField = store.getGroupField(),
+                count = datas.length,
+                data = datas,
+                lasts = {},
+                keys = [],
+                arr = [];
 
-            for(var i = 0; i < count; i++) {
+            for (var i = 0; i < count; i++) {
                 var d = data[i];
                 var n = Number(d[dataIndex]);
                 var v = isNaN(n) ? 0 : n;
@@ -144,17 +123,14 @@ Ext.define('saas.view.money.report.RecDetail', {
             }
 
             keys = Ext.Object.getAllKeys(lasts);
-            arr = keys.map(function(key) {
+            arr = keys.map(function (key) {
                 return lasts[key];
             });
 
             return Ext.Array.sum(arr);
         }
     }, {
-        text: '客户名称',
-        dataIndex: 'rd_custname',
-        hidden:true
-    }, {
+        dataIndex: '',
         flex: 1
     }]
 });

+ 113 - 77
frontend/saas-web/app/view/money/report/TotalPayDetail.js

@@ -23,8 +23,8 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
         name: 'vm_vendcode',
         emptyText: '供应商编号/名称',
         columnWidth: 0.25,
-        getCondition: function(v) {
-            return "(upper(vm_vendcode) like '%"+v.toUpperCase()+"%' or upper(vm_vendname) like '%"+v.toUpperCase()+"%')";
+        getCondition: function (v) {
+            return "(upper(vm_vendcode) like '%" + v.toUpperCase() + "%' or upper(vm_vendname) like '%" + v.toUpperCase() + "%')";
         },
     }, {
         xtype: 'conmonthfield',
@@ -33,106 +33,142 @@ Ext.define('saas.view.money.report.TotalPayDetail', {
         columnWidth: 0.4
     }],
 
-    reportColumns: [
-        {
+    reportColumns: [{
         text: '期间',
         dataIndex: 'vm_yearmonth',
-        width: 110,
-        },{
-        text: '供应商编号',
-        dataIndex: 'vm_vendcode',
-        width: 190
+        width: 80,
     }, {
         text: '供应商名称',
         dataIndex: 'vm_vendname',
-        width: 210,
+        width: 200,
     }, {
-        text: '期初预付',
-        xtype: 'numbercolumn',
-        exportFormat: 'Amount',
-        dataIndex: 'vm_beginpreamount',
-        width: 110,
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        }
-    },{
-        text: '期初应付',
-        xtype: 'numbercolumn',
-        exportFormat: 'Amount',
-        dataIndex: 'vm_beginamount',
-        width: 110,
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        }
+        text: '期初',
+        columns: [{
+            text: '预付',
+            xtype: 'numbercolumn',
+            exportFormat: 'Amount',
+            dataIndex: 'vm_beginpreamount',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '应付',
+            xtype: 'numbercolumn',
+            exportFormat: 'Amount',
+            dataIndex: 'vm_beginamount',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }]
     }, {
-        text: '本期应付',
-        xtype: 'numbercolumn',
-        exportFormat: 'Amount',
-        dataIndex: 'vm_nowamount',
-        width: 110,
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        }
+        text: '本期',
+        columns: [{
+            text: '预付',
+            xtype: 'numbercolumn',
+            exportFormat: 'Amount',
+            dataIndex: 'vm_nowpreamount',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '应付',
+            xtype: 'numbercolumn',
+            exportFormat: 'Amount',
+            dataIndex: 'vm_nowamount',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '核销',
+            xtype: 'numbercolumn',
+            exportFormat: 'Amount',
+            dataIndex: 'vm_nowpayamount',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            } 
+        }]
     }, {
-        text: '本期核销',
-        xtype: 'numbercolumn',
-        exportFormat: 'Amount',
-        dataIndex: 'vm_nowpayamount',
-        width: 110,
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        }
+        text: '期末',
+        columns: [{
+            text: '预付',
+            dataIndex: '',
+            exportFormat: 'Amount',
+            xtype: 'numbercolumn',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '应付',
+            dataIndex: '',
+            exportFormat: 'Amount',
+            xtype: 'numbercolumn',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }]
     }, {
-        text: '预付余额',
-        dataIndex: 'vm_endpreamount',
-        exportFormat: 'Amount',
-        xtype: 'numbercolumn',
-        width: 110,
-        renderer : function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        },
-        summaryType: 'sum',
-        summaryRenderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        }
-    },{
         text: '应付余额',
         dataIndex: 'vm_endamount',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 110,
-        renderer : function(v) {
+        width: 120,
+        renderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
         summaryType: 'sum',
-        summaryRenderer: function(v) {
+        summaryRenderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         }
     }, {
+        dataIndex: '',
         flex: 1
     }]
 });

+ 111 - 75
frontend/saas-web/app/view/money/report/TotalRecDetail.js

@@ -33,106 +33,142 @@ Ext.define('saas.view.money.report.TotalRecDetail', {
         columnWidth: 0.4
     }],
 
-    reportColumns: [
-    {
+    reportColumns: [{
         text: '期间',
         dataIndex: 'cm_yearmonth',
-        width: 110
-    },{
-        text: '客户编号',
-        dataIndex: 'cm_custcode',
-        width: 190
+        width: 80,
     }, {
         text: '客户名称',
         dataIndex: 'cm_custname',
-        width: 210,
-    },{
-        text: '期初预收',
-        dataIndex: 'cm_beginpreamount',
-        exportFormat: 'Amount',
-        xtype: 'numbercolumn',
-        width: 110,
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        }
-    },{
-        text: '期初应收',
-        dataIndex: 'cm_beginamount',
-        exportFormat: 'Amount',
-        xtype: 'numbercolumn',
-        width: 110,
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        }
+        width: 200,
     }, {
-        text: '本期应收',
-        xtype: 'numbercolumn',
-        exportFormat: 'Amount',
-        dataIndex: 'cm_nowamount',
-        width: 110,
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        }
+        text: '期初',
+        columns: [{
+            text: '预收',
+            xtype: 'numbercolumn',
+            exportFormat: 'Amount',
+            dataIndex: 'cm_beginpreamount',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '应收',
+            xtype: 'numbercolumn',
+            exportFormat: 'Amount',
+            dataIndex: 'cm_beginamount',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }]
     }, {
-        text: '本期核销',
-        xtype: 'numbercolumn',
-        exportFormat: 'Amount',
-        dataIndex: 'cm_nowpayamount',
-        width: 110,
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        }
+        text: '本期',
+        columns: [{
+            text: '预收',
+            xtype: 'numbercolumn',
+            exportFormat: 'Amount',
+            dataIndex: 'cm_nowpreamount',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '应收',
+            xtype: 'numbercolumn',
+            exportFormat: 'Amount',
+            dataIndex: 'cm_nowamount',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '核销',
+            xtype: 'numbercolumn',
+            exportFormat: 'Amount',
+            dataIndex: 'cm_nowpayamount',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            } 
+        }]
     }, {
-        text: '预收余额',
-        xtype: 'numbercolumn',
-        exportFormat: 'Amount',
-        dataIndex: 'cm_endpreamount',
-        width: 110,
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        },
-        summaryType: 'sum',
-        summaryRenderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        }
+        text: '期末',
+        columns: [{
+            text: '预收',
+            dataIndex: '',
+            exportFormat: 'Amount',
+            xtype: 'numbercolumn',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }, {
+            text: '应收',
+            dataIndex: '',
+            exportFormat: 'Amount',
+            xtype: 'numbercolumn',
+            width: 120,
+            renderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            },
+            summaryType: 'sum',
+            summaryRenderer: function (v) {
+                var arr = (v + '.').split('.');
+                var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+                var format = '0,000.' + xr.join('');
+                return Ext.util.Format.number(v, format);
+            }
+        }]
     }, {
         text: '应收余额',
         dataIndex: 'cm_endamount',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 110,
-        renderer : function(v) {
+        width: 120,
+        renderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
         summaryType: 'sum',
-        summaryRenderer: function(v) {
+        summaryRenderer: function (v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         }
     }, {
+        dataIndex: '',
         flex: 1
     }]
 });

+ 50 - 78
frontend/saas-web/app/view/money/report/VendorCheck.js

@@ -36,11 +36,9 @@ Ext.define('saas.view.money.report.VendorCheck', {
         columnWidth: 0.4
     }],
 
+    reportModel: 'saas.model.report.VendorCheck',
+
     reportColumns: [{
-        text: 'id',
-        dataIndex: 'pi_id',
-        hidden: true
-    }, {
         text: '单据日期',
         dataIndex: 'pi_date',
         xtype:'datecolumn',
@@ -49,34 +47,28 @@ Ext.define('saas.view.money.report.VendorCheck', {
         text: '单号',
         dataIndex: 'pi_inoutno',
         width: 150
-    },  {
+    }, {
+        text: '业务类型',
+        dataIndex: 'pi_class',
+        width: 100
+    }, {
         text: '序号',
         xtype: 'numbercolumn',
         dataIndex: 'pd_pdno',
         exportFormat: 'Integer',
-        width: 80
-    },{
-        text:'供应商编号',
-        dataIndex:'pi_vendcode',
-        width: 150,
-        hidden:true
-    },{
-        text:'供应商名称',
-        dataIndex:'pi_vendname',
-        width: 250,
-        hidden:true
+        width: 65
     }, {
         text: '物料编号',
-        width: 150,
-        dataIndex: 'pr_code'
+        dataIndex: 'pr_code',
+        width: 150
     }, {
         text: '品牌',
         dataIndex: 'pr_brand',
-        width: 200
+        width: 100
     }, {
         text: '名称',
         dataIndex: 'pr_detail',
-        width: 200
+        width: 150
     }, {
         text: '型号',
         dataIndex: 'pr_orispeccode',
@@ -84,7 +76,7 @@ Ext.define('saas.view.money.report.VendorCheck', {
     }, {
         text: '规格',
         dataIndex: 'pr_spec',
-        width: 150
+        width: 200
     }, {
         text: '数量',
         dataIndex: 'qty',
@@ -100,13 +92,13 @@ Ext.define('saas.view.money.report.VendorCheck', {
     }, {
         text: '单位',
         dataIndex: 'pd_unit',
-        width: 80
+        width: 65
     }, {
         text: '单价(元)',
-        dataIndex: 'pd_orderprice',
+        dataIndex: 'pd_netprice',
         exportFormat: 'Price',
         xtype: 'numbercolumn',
-        width: 110,
+        width: 120,
         renderer: function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
@@ -114,51 +106,47 @@ Ext.define('saas.view.money.report.VendorCheck', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-        text: '税率',
-        dataIndex: 'pd_taxrate',
-        exportFormat: 'Integer',
+        text: '含税单价(元)',
+        dataIndex: 'pd_orderprice',
+        exportFormat: 'Price',
         xtype: 'numbercolumn',
-        width: 80,
+        width: 120,
         renderer: function(v) {
-            return Ext.util.Format.number(v, '0');
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join('');
+            return Ext.util.Format.number(v, format);
         }
     }, {
         text: '金额(元)',
-        xtype: 'numbercolumn',
+        dataIndex: 'pd_nettotal',
         exportFormat: 'Amount',
-        dataIndex: 'pd_total',
-        width: 110,
+        xtype: 'numbercolumn',
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
-        // summaryType: 'sum',
-        // summaryRenderer: function(v) {
-        //     var arr = (v + '.').split('.');
-        //     var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-        //     var format = '0,000.' + xr.join('');
-        //     return Ext.util.Format.number(v, format);
-        // }
-    }, {
-        text: '不含税单价(元)',
-        dataIndex: 'pd_netprice',
-        exportFormat: 'Price',
+    }, {
+        text: '税率(%)',
+        dataIndex: 'pd_taxrate',
+        exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 150,
-        renderer: function(v) {
+        width: 80,
+        renderer : function(v) {
             var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
-        }
+        },
     }, {
-        text: '不含税金额(元)',
-        dataIndex: 'pd_nettotal',
-        exportFormat: 'Amount',
+        text: '税额(元)',
         xtype: 'numbercolumn',
-        width: 150,
+        exportFormat: 'Amount',
+        dataIndex: 'pd_ordertotal-pd_nettotal',
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -166,33 +154,17 @@ Ext.define('saas.view.money.report.VendorCheck', {
             return Ext.util.Format.number(v, format);
         },
     }, {
-        text: '单据类型',
-        dataIndex: 'pi_class',
-        width: 110
-    }, {
-        text: '期初应付',
-        dataIndex: 'beginamount',
-        hidden: true,
-        width: 0,
-        summaryType: 'cus',
-    }, {
-        text: '增加应付',
-        dataIndex: 'nowamount',
-        hidden: true,
-        width: 0,
-        summaryType: 'cus',
-    }, {
-        text: '增加预付',
-        dataIndex: 'nowpay',
-        hidden: true,
-        width: 0,
-        summaryType: 'cus',
-    }, {
-        text: '应付余额',
-        dataIndex: 'nowbalance',
-        hidden: true,
-        width: 0,
-        summaryType: 'cus',
+        text: '价税合计(元)',
+        xtype: 'numbercolumn',
+        exportFormat: 'Amount',
+        dataIndex: 'pd_ordertotal',
+        width: 120,
+        renderer : function(v) {
+            var arr = (v + '.').split('.');
+            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
+            var format = '0,000.' + xr.join('');
+            return Ext.util.Format.number(v, format);
+        },
     }],
 
     listeners: {

+ 43 - 119
frontend/saas-web/app/view/purchase/report/Purchase.js

@@ -11,9 +11,9 @@ Ext.define('saas.view.purchase.report.Purchase', {
     listUrl: '/api/purchase/report/purchaseDetail',
     defaultCondition: null,
     reportTitle: '采购明细报表',
-    QueryWidth:0.2,
+    QueryWidth: 0.2,
     //筛选:供应商、日期(必填)、业务状态			
-    searchItems: [ {
+    searchItems: [{
         xtype: 'vendorDbfindTrigger',
         name: 'pu_vendname',
         fieldLabel: '供应商名称',
@@ -38,45 +38,10 @@ Ext.define('saas.view.purchase.report.Purchase', {
 
     reportModel: 'saas.model.report.Purchase',
 
-    reportColumns: [
-    {
-        text: 'id',
-        dataIndex: 'pu_id',
-        hidden: true
-    }, {
-        text: '采购单号',
-        dataIndex: 'pu_code',
-        width: 150
-    }, {
-        text: '供应商名称',
-        dataIndex: 'pu_vendname',
-        width: 200
-    }, {
-        text: '业务状态',
-        align: 'center',
-        dataIndex: 'pu_acceptstatus',
-        width: 80
-    }, {
-        text: '采购员',
-        dataIndex: 'pu_buyername',
-        width: 80
-    }, {
-        text: '单据日期',
-        xtype: 'datecolumn',
-        dataIndex: 'pu_date',
-        width: 110
-    }, {
-        text: '物料编号',
-        width: 150,
-        dataIndex: 'pd_prodcode'
-    }, {
-        text: '品牌',
-        dataIndex: 'pr_brand',
-        width: 100
-    }, {
+    reportColumns: [{
         text: '名称',
         dataIndex: 'pr_detail',
-        width: 200
+        width: 150
     }, {
         text: '型号',
         dataIndex: 'pr_orispeccode',
@@ -92,17 +57,11 @@ Ext.define('saas.view.purchase.report.Purchase', {
         exportFormat: 'Quantity',
         width: 110,
         summaryType: 'sum',
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-            var format = '0.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        renderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 3, true);
         },
-        summaryRenderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-            var format = '0.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        summaryRenderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 3, true);
         }
     }, {
         text: '单位',
@@ -111,118 +70,83 @@ Ext.define('saas.view.purchase.report.Purchase', {
     }, {
         text: '单价(元)',
         dataIndex: 'pd_taxprice',
-        exportFormat: 'Price',
         width: 120,
         xtype: 'numbercolumn',
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        exportFormat: 'Price',
+        renderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 4, true);
         }
     }, {
         text: '含税单价(元)',
         dataIndex: 'pd_price',
-        exportFormat: 'Price',
         width: 120,
         xtype: 'numbercolumn',
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        exportFormat: 'Price',
+        renderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 4, true);
         }
     }, {
         text: '金额(元)',
         dataIndex: 'pd_taxtotal',
+        width: 120,
         exportFormat: 'Amount',
-        width: 110,
         xtype: 'numbercolumn',
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        renderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
+        summaryLabel: '金额',
         summaryType: 'sum',
-        summaryRenderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        summaryRenderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
     }, {
         text: '税率(%)',
         dataIndex: 'pd_taxrate',
-        exportFormat: 'Integer',
-        width: 80,
         xtype: 'numbercolumn',
-        renderer: function(v) {
-            return Ext.util.Format.number(v, '0');
-        }
+        width: 80
     }, {
         text: '税额(元)',
-        dataIndex: 'pd_taxamount',
+        dataIndex: 'pd_total-pd_taxtotal',
+        xtype: 'numbercolumn',
+        width: 120,
         exportFormat: 'Amount',
-        width: 110,
         xtype: 'numbercolumn',
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        renderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
-        summaryType: 'customize_sum',
-        summaryRenderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
-        },
-        mySummaryRenderer: function(grid, column, datas) {
-            var arr = [];
-            arr = datas.map(function(d) {
-                return d['pd_taxamount'];
-            });
-            return Ext.Array.sum(arr);
+        summaryLabel: '税额',
+        summaryType: 'sum',
+        summaryRenderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
     }, {
         text: '价税合计(元)',
         dataIndex: 'pd_total',
+        xtype: 'numbercolumn',
+        width: 120,
         exportFormat: 'Amount',
-        width: 110,
         xtype: 'numbercolumn',
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        renderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
+        summaryLabel: '价税合计',
         summaryType: 'sum',
-        summaryRenderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        summaryRenderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
     }, {
         text: '收货数量',
         dataIndex: 'pd_pdacceptqty',
-        exportFormat: 'Quantity',
+        xtype: 'numbercolumn',
         width: 110,
+        exportFormat: 'Quantity',
         xtype: 'numbercolumn',
-        renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-            var format = '0.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        renderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 3, true);
         },
         summaryType: 'sum',
-        summaryRenderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-            var format = '0.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+        summaryRenderer: function (v) {
+            return saas.util.BaseUtil.numberFormat(v, 3, true);
         }
     }, {
         text: '备注',

+ 21 - 29
frontend/saas-web/app/view/purchase/report/PurchasePay.js

@@ -25,12 +25,9 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         columnWidth: 0.5
     }],
 
-    reportColumns: [
-    {
-        text: 'id',
-        dataIndex: 'pb_id',
-        hidden: true
-    }, {
+    reportModel: 'saas.model.report.PurchasePay',
+
+    reportColumns: [ {
         text: '付款单号',
         dataIndex: 'pb_code',
         width: 150
@@ -58,53 +55,48 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         dataIndex: 'pi_nettotal',
         width: 120,
         renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
     }, {
         text: '税额(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex: 'pi_taxamount',
+        dataIndex: 'pd_total-pi_nettotal',
+        width: 120,
+        renderer: function(v) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
+        },
+    }, {
+        text: '价税合计(元)',
+        xtype: 'numbercolumn',
+        exportFormat: 'Amount',
+        dataIndex: 'pi_total',
         width: 120,
         renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
     }, {
         text: '付款金额(元)',
         dataIndex: 'pbd_nowbalance',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
-        width: 110,
+        width: 120,
         summaryType: 'sum',
+        summaryLabel: '付款金额',
         renderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
         summaryRenderer: function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0,000.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
     }, {
         text: '付款比例%',
         //本次付款/采购金额*100%
         dataIndex: 'pb_payrate',
         xtype: 'numbercolumn',
-        width: 110,
+        width: 100,
         renderer : function(v) {
-            var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
-            var format = '0.' + xr.join('');
-            return Ext.util.Format.number(v, format);
+            return saas.util.BaseUtil.numberFormat(v, 2, false);
         }
     }, {
         text: '付款人',

+ 27 - 5
frontend/saas-web/ext/packages/ux/src/feature/MySummary.js

@@ -129,7 +129,7 @@ Ext.define('Ext.ux.feature.MySummary', {
                         if(typeof c.mySummaryRenderer == 'function') {
                             c.summaryValue = c.mySummaryRenderer(grid, c, datas);
                         }else {
-                            c.summaryValue = me.getSummaryValue(datas, c);
+                            c.summaryValue = me.applySummaryValue(datas, c);
                         }
                     } else {
                         c.summaryValue = null;
@@ -186,10 +186,10 @@ Ext.define('Ext.ux.feature.MySummary', {
             if(summaryType) {
                 summarys.push({
                     name: c.dataIndex,
-                    label: c.text,
+                    label: me.getSummaryLabel(c),
                     type: summaryType,
                     typeLabel: summaryType ? typeLabels[summaryType] : '',
-                    value: 0
+                    value: me.getSummaryValue(c)
                 });
             } 
         });
@@ -218,13 +218,35 @@ Ext.define('Ext.ux.feature.MySummary', {
                 return c.dataIndex == s.name;
             });
             if(col) {
-                s.value = col.summaryValue || 0;
+                s.value = me.getSummaryValue(col);
             }
         });
         return summarys;
     },
 
-    getSummaryValue: function(datas, c) {
+    getSummaryLabel: function(c) {
+        var text = c.text,
+        summaryLabel = c.summaryLabel;
+        if(typeof summaryLabel === 'string') {
+            return summaryLabel;
+        }else if(typeof summaryLabel === 'function') {
+            return summaryLabel(c, text);
+        }else {
+            return text;
+        }
+    },
+
+    getSummaryValue: function(c) {
+        var summaryValue = c.summaryValue || 0,
+        summaryValueRender = c.summaryValueRender;
+        if(typeof summaryValueRender === 'function') {
+            return summaryValueRender(summaryValue);
+        }else {
+            return summaryValue;
+        }
+    },
+
+    applySummaryValue: function(datas, c) {
         var dataIndex = c.dataIndex,
         type = c.summaryType,
         values = datas.map(function(d) {

+ 2 - 2
frontend/saas-web/overrides/exporter/Stylesheet.js

@@ -44,12 +44,12 @@ Ext.define('saas.override.exporter.Stylesheet', {
         'Quantity': function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
-            var format = '0.' + xr.join('');
+            var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
         'Price': function(v) {
             var arr = (v + '.').split('.');
-            var xr = (new Array(arr[1].length > 8 ? 8 : arr[1].length)).fill('0');
+            var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },