Browse Source

销售明细model,销售收款报表标准化

rainco 7 years ago
parent
commit
3820bfcca0

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

@@ -24,10 +24,10 @@ Ext.define('saas.model.report.Purchase', {
         { 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));
-            }
+            },
+            depends: ['pd_total', 'pd_taxtotal']
         },
         { name: 'pd_acceptqty', type: 'float' },
         { name: 'pd_accepttotal', type: 'float' },

+ 35 - 0
frontend/saas-web/app/model/report/Sale.js

@@ -0,0 +1,35 @@
+Ext.define('saas.model.report.Sale', {
+    extend: 'saas.model.Base',
+
+    fields: [
+        { name: 'id', type: 'int' },
+        { name: 'sa_code', type: 'string' },
+        { name: 'sa_custname', type: 'string' },
+        { name: 'sa_sendstatus', type: 'string' },
+        { name: 'sa_seller', type: 'string' },
+        { name: 'sa_date', type: 'date' },
+        { name: 'sd_prodcode', type: 'string' },
+        { name: 'pr_brand', type: 'string' },
+        { name: 'pr_detail', type: 'string' },
+        { name: 'pr_orispeccode', type: 'string' },
+        { name: 'pr_spec', type: 'string' },
+        { name: 'sd_qty', type: 'float' },
+        { name: 'pr_unit', type: 'string' },
+        { name: 'sd_price', type: 'float' },
+        { name: 'sd_netprice', type: 'float' },
+        { name: 'sd_price', type: 'float' },
+        { name: 'sd_nettotal', type: 'float' },
+        { name: 'sd_taxrate', type: 'float' },
+        { name: 'sd_taxamount', type: 'float',
+            convert: function(v, rec) {
+                debugger;
+                var t = (rec.get('sd_total') || 0.0) - (rec.get('sd_nettotal') || 0.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['sd_total', 'sd_nettotal']
+        },
+        { name: 'sd_total', type: 'float' },
+        { name: 'sd_pdsendqty', type: 'float' },
+        { name: 'sd_remark', type: 'string' },
+    ],
+});

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

@@ -196,8 +196,8 @@ Ext.define('saas.view.core.report.ReportPanel', {
             }
         }
         var store = Ext.create('Ext.data.Store', Ext.Object.merge({
-            fields: me.getFields(),
-            // model: me.reportModel,
+            //fields: me.getFields(),
+            model: me.reportModel,
             autoLoad: me.autoLoad,
             pageSize: 15,
             data: [],

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

@@ -36,7 +36,7 @@ Ext.define('saas.view.sale.report.Sale', {
             ["CLOSE", "已关闭"]
         ]
     }],
-
+    reportModel: 'saas.model.report.Sale',
     reportColumns: [
     {
         text: 'id',

+ 25 - 14
frontend/saas-web/app/view/sale/report/SaleRec.js

@@ -33,17 +33,10 @@ Ext.define('saas.view.sale.report.SaleRec', {
         text: '收款单号',
         dataIndex: 'rb_code',
         width: 150
-    }, {
-        text: '客户编号',
-        dataIndex: 'rb_custcode',
-        width: 150
     }, {
         text: '客户名称',
         dataIndex: 'rb_custname',
         width: 200
-    }, {
-        text: '业务员',
-        dataIndex: 'rb_manname'
     }, {
         text: '日期',
         dataIndex: 'rb_date',
@@ -53,13 +46,13 @@ Ext.define('saas.view.sale.report.SaleRec', {
         dataIndex: 'rbd_slcode',
         width: 150
     }, {
-        text: '类型',
+        text: '业务类型',
         dataIndex: 'rbd_slkind'
     }, {
-        text: '销售金额(元)',
+        text: '金额(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex: 'rbd_amount',
+        dataIndex: 'pi_nettotal',
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -67,10 +60,10 @@ Ext.define('saas.view.sale.report.SaleRec', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-        text: '收款金额(元)',
+        text: '额(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex: 'rbd_nowbalance',
+        dataIndex: 'rbd_taxamount',
         renderer : function(v) {
             var arr = (v + '.').split('.');
             var xr = (new Array(arr[1].length > 2 ? 2 : arr[1].length)).fill('0');
@@ -85,10 +78,28 @@ Ext.define('saas.view.sale.report.SaleRec', {
             return Ext.util.Format.number(v, format);
         }
     }, {
-        text: '应收余额',
+        text: '价税合计(元)',
         xtype: 'numbercolumn',
         exportFormat: 'Amount',
-        dataIndex: 'rb_rbdamount',
+        dataIndex: 'pi_total',
+        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: '收款余额(元)',
+        xtype: 'numbercolumn',
+        exportFormat: 'Amount',
+        dataIndex: 'rbd_nowbalance',
         hidden:true,
         renderer : function(v) {
             var arr = (v + '.').split('.');