Browse Source

采购明细报表、采购付款报表、销售明细报表标准化

rainco 7 years ago
parent
commit
7365c035ec

+ 7 - 0
frontend/saas-web/app/model/report/Purchase.js

@@ -22,6 +22,13 @@ Ext.define('saas.model.report.Purchase', {
         { name: 'pd_total', type: 'float' },
         { name: 'pd_taxprice', type: 'float' },
         { name: 'pd_taxtotal', type: 'float' },
+        { name: 'pd_taxamount', type: 'float',
+            convert: function(v, rec) {
+                debugger;
+                var t = (rec.get('pd_total') || 0.0) - (rec.get('pd_taxtotal') || 0.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            }
+        },
         { name: 'pd_acceptqty', type: 'float' },
         { name: 'pd_accepttotal', type: 'float' },
         { name: 'pd_remark', type: 'string' },

+ 3 - 2
frontend/saas-web/app/view/core/report/ReportPanel.js

@@ -320,11 +320,11 @@ Ext.define('saas.view.core.report.ReportPanel', {
             }
 
             if (c.summaryType) {
-                me.initSummaryType(c);
                 summarys.push({
                     field: c.dataIndex,
-                    operation: c._summaryType == 'last' ? 'customize_last' : c._summaryType,
+                    operation: c.summaryType,
                 });
+                me.initSummaryType(c);
             }
         })
 
@@ -336,6 +336,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
     initSummaryType: function (column) {
         var summaryType = column.summaryType;
         if (Ext.isString(summaryType)) {
+            summaryType = summaryType.replace('customize_','');
             column.summaryTypeName = summaryType;
         }
         if (summaryType == 'sum') {

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

@@ -108,7 +108,7 @@ Ext.define('saas.view.money.report.PayDetail', {
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
-        summaryType: 'last',
+        summaryType: 'customize_last',
         summaryRenderer: function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');

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

@@ -116,7 +116,7 @@ Ext.define('saas.view.money.report.RecDetail', {
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         },
-        summaryType: 'last',
+        summaryType: 'customize_last',
         summaryRenderer: function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');

+ 55 - 45
frontend/saas-web/app/view/purchase/report/Purchase.js

@@ -47,34 +47,24 @@ Ext.define('saas.view.purchase.report.Purchase', {
         text: '采购单号',
         dataIndex: 'pu_code',
         width: 150
-    }, {
-        text: '供应商编号',
-        dataIndex: 'pu_vendcode',
-        hidden: true
     }, {
         text: '供应商名称',
         dataIndex: 'pu_vendname',
-        width: 250
+        width: 200
     }, {
         text: '业务状态',
         align: 'center',
         dataIndex: 'pu_acceptstatus',
-        width: 90
+        width: 80
     }, {
         text: '采购员',
         dataIndex: 'pu_buyername',
-        width: 110
+        width: 80
     }, {
         text: '单据日期',
         xtype: 'datecolumn',
         dataIndex: 'pu_date',
         width: 110
-    }, {
-        text: '序号',
-        dataIndex: 'pd_detno',
-        exportFormat: 'Integer',
-        xtype: 'numbercolumn',
-        width: 80
     }, {
         text: '物料编号',
         width: 150,
@@ -82,7 +72,7 @@ Ext.define('saas.view.purchase.report.Purchase', {
     }, {
         text: '品牌',
         dataIndex: 'pr_brand',
-        width: 200
+        width: 100
     }, {
         text: '名称',
         dataIndex: 'pr_detail',
@@ -94,7 +84,7 @@ Ext.define('saas.view.purchase.report.Purchase', {
     }, {
         text: '规格',
         dataIndex: 'pr_spec',
-        width: 150
+        width: 200
     }, {
         text: '采购数量',
         dataIndex: 'pd_qty',
@@ -117,12 +107,12 @@ Ext.define('saas.view.purchase.report.Purchase', {
     }, {
         text: '单位',
         dataIndex: 'pr_unit',
-        width: 80
+        width: 65
     }, {
         text: '单价(元)',
-        dataIndex: 'pd_price',
+        dataIndex: 'pd_taxprice',
         exportFormat: 'Price',
-        width: 110,
+        width: 120,
         xtype: 'numbercolumn',
         renderer: function(v) {
             var arr = (v + '.').split('.');
@@ -131,17 +121,20 @@ Ext.define('saas.view.purchase.report.Purchase', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-        text: '税率',
-        dataIndex: 'pd_taxrate',
-        exportFormat: 'Integer',
-        width: 80,
+        text: '含税单价(元)',
+        dataIndex: 'pd_price',
+        exportFormat: 'Price',
+        width: 120,
         xtype: 'numbercolumn',
         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: '金额(元)',
-        dataIndex: 'pd_total',
+        dataIndex: 'pd_taxtotal',
         exportFormat: 'Amount',
         width: 110,
         xtype: 'numbercolumn',
@@ -159,28 +152,58 @@ Ext.define('saas.view.purchase.report.Purchase', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-        text: '不含税单价(元)',
-        dataIndex: 'pd_taxprice',
-        exportFormat: 'Price',
-        width: 150,
+        text: '税率(%)',
+        dataIndex: 'pd_taxrate',
+        exportFormat: 'Integer',
+        width: 80,
+        xtype: 'numbercolumn',
+        renderer: function(v) {
+            return Ext.util.Format.number(v, '0');
+        }
+    }, {
+        text: '税额(元)',
+        dataIndex: 'pd_taxamount',
+        exportFormat: 'Amount',
+        width: 110,
         xtype: 'numbercolumn',
         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);
+        },
+        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);
         }
     }, {
-        text: '不含税金额(元)',
+        text: '价税合计(元)',
+        dataIndex: 'pd_total',
         exportFormat: 'Amount',
-        width: 150,
-        dataIndex: 'pd_taxtotal',
+        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);
+        },
+        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: '收货数量',
@@ -201,19 +224,6 @@ Ext.define('saas.view.purchase.report.Purchase', {
             var format = '0.' + xr.join('');
             return Ext.util.Format.number(v, format);
         }
-    }, {
-        text: '收货金额(元)',
-        dataIndex: 'pd_pdaccepttotal',
-        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);
-        }
-
     }, {
         text: '备注',
         dataIndex: 'pd_remark',

+ 25 - 23
frontend/saas-web/app/view/purchase/report/PurchasePay.js

@@ -6,7 +6,6 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
     viewModel: 'purchase-report-purchasepay',
 
     viewName: 'purchase-report-purchasepay',
-//按供应商分组 付款金额合计
     groupField: 'pu_vendname',
     groupHeaderTpl: '供应商名称: {[values.rows[0].data.pu_vendname]}',
     listUrl: '/api/purchase/report/purchasePay',
@@ -38,7 +37,7 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
     }, {
         text: '供应商名称',
         dataIndex: 'pu_vendname',
-        width: 250
+        width: 200
     }, {
         text : "日期", 
         dataIndex : "createTime", 
@@ -49,29 +48,35 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
         dataIndex: 'pbd_slcode',
         width: 150
     }, {
-        text: '类型',
+        text: '业务类型',
         dataIndex: 'pbd_slkind',
-        width: 110
-    }, {//∑求和
-        text: '采购金额(元)',
+        width: 100
+    }, {
+        text: '金额(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex: 'pbd_amount',
-        width: 110,
+        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);
         },
-        // 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: 'pi_taxamount',
+        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: 'pbd_nowbalance',
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
@@ -89,13 +94,6 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
             var format = '0,000.' + xr.join('');
             return Ext.util.Format.number(v, format);
         }
-    }, {
-        text: '应付余额',
-        xtype: 'numbercolumn',
-        exportFormat: 'Amount',
-        dataIndex: 'pb_pbdamount',
-        width: 110,
-        hidden:true
     }, {
         text: '付款比例%',
         //本次付款/采购金额*100%
@@ -108,6 +106,10 @@ Ext.define('saas.view.purchase.report.PurchasePay', {
             var format = '0.' + xr.join('');
             return Ext.util.Format.number(v, format);
         }
+    }, {
+        text: '付款人',
+        dataIndex: 'pb_manname',
+        width: 80
     }, {
         text: '备注',
         dataIndex: 'pb_remark',

+ 55 - 48
frontend/saas-web/app/view/sale/report/Sale.js

@@ -46,35 +46,24 @@ Ext.define('saas.view.sale.report.Sale', {
         text: '销售单号',
         dataIndex: 'sa_code',
         width: 150
-    }, {
-        text: '客户编号',
-        dataIndex: 'sa_custcode',
-        hidden: true
     }, {
         text: '客户名称',
         dataIndex: 'sa_custname',
-        width: 250
+        width: 200
     }, {
         text: '业务状态',
         align: 'center',
-        dataIndex: 'sa_sendstatus'
-    }, {
-        text: '业务员编号',
-        dataIndex: 'sa_sellercode',
-        hidden:true
+        dataIndex: 'sa_sendstatus',
+        width: 80
     }, {
         text: '业务员',
-        dataIndex: 'sa_seller'
+        dataIndex: 'sa_seller',
+        width: 80
     }, {
         text: '单据日期',
         xtype: 'datecolumn',
-        dataIndex: 'sa_date'
-    }, {
-        text: '序号',
-        dataIndex: 'sd_detno',
-        exportFormat: 'Integer',
-        xtype: 'numbercolumn',
-        width: 80
+        dataIndex: 'sa_date',
+        width: 110
     }, {
         text: '物料编号',
         width: 150,
@@ -82,11 +71,11 @@ Ext.define('saas.view.sale.report.Sale', {
     }, {
         text: '品牌',
         dataIndex: 'pr_brand',
-        width: 200
+        width: 100
     }, {
         text: '名称',
         dataIndex: 'pr_detail',
-        width: 200
+        width: 150
     }, {
         text: '型号',
         dataIndex: 'pr_orispeccode',
@@ -94,12 +83,13 @@ Ext.define('saas.view.sale.report.Sale', {
     }, {
         text: '规格',
         dataIndex: 'pr_spec',
-        width: 150
+        width: 200
     }, {
-        text: '数量',
+        text: '销售数量',
         dataIndex: 'sd_qty',
         exportFormat: 'Quantity',
         xtype: 'numbercolumn',
+        width: 110,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 3 ? 3 : arr[1].length)).fill('0');
@@ -109,12 +99,13 @@ Ext.define('saas.view.sale.report.Sale', {
     }, {
         text: '单位',
         dataIndex: 'pr_unit',
-        width: 80
+        width: 65
     }, {
         text: '单价(元)',
-        dataIndex: 'sd_price',
+        dataIndex: 'sd_netprice',
         exportFormat: 'Price',
         xtype: 'numbercolumn',
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
@@ -122,11 +113,11 @@ Ext.define('saas.view.sale.report.Sale', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-        text: '含税单价(元)',
-        dataIndex: 'sd_netprice',
+        text: '含税单价(元)',
+        dataIndex: 'sd_price',
         exportFormat: 'Price',
         xtype: 'numbercolumn',
-        width: 150,
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 4 ? 4 : arr[1].length)).fill('0');
@@ -134,7 +125,26 @@ Ext.define('saas.view.sale.report.Sale', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-        text: '税率',
+        text: '金额(元)',
+        xtype: 'numbercolumn',
+        exportFormat: 'Amount',
+        width: 120,
+        dataIndex: 'sd_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: '税率(%)',
         dataIndex: 'sd_taxrate',
         exportFormat: 'Integer',
         width: 80,
@@ -142,30 +152,39 @@ Ext.define('saas.view.sale.report.Sale', {
         renderer : function(v) {
             return Ext.util.Format.number(v, '0');
         }
-    }, {//∑金额
-        text: '额(元)',
+    }, {
+        text: '额(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex: 'sd_total',
+        dataIndex: 'sd_taxamount',
+        width: 120,
         renderer : function(v) {
+            v = (r.data["sd_total"]||0.0) - (r.data["sd_nettotal"]||0.0);
             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',
+        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['sd_taxamount'];
+            });
+            return Ext.Array.sum(arr);
         }
     }, {
-        text: '不含税金额(元)',
+        text: '价税合计(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        width: 150,
-        dataIndex: 'sd_nettotal',
+        dataIndex: 'sd_total',
+        width: 120,
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -184,25 +203,13 @@ Ext.define('saas.view.sale.report.Sale', {
         dataIndex: 'sd_pdsendqty',
         exportFormat: 'Quantity',
         xtype: 'numbercolumn',
+        width: 110,
         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);
         }
-    }, {
-        text: '出货金额(元)',
-        dataIndex: 'sd_pdsendqtytotal',
-        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);
-        }
-
     }, {
         text : "备注", 
         dataIndex : "sd_remark",