Browse Source

【多币别】【报表合计栏本位币调整】

rainco 7 years ago
parent
commit
c5651f8458

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

@@ -11,6 +11,13 @@ Ext.define('saas.model.report.Purchase', {
         { name: 'pd_taxprice', type: 'float' }, // 单价
         { name: 'pd_price', type: 'float' }, // 含税单价
         { name: 'pd_taxtotal', type: 'float' }, // 金额
+        { name: 'pd_taxtotal*pu_rate', type: 'float',
+            convert: function(v, rec) {
+                var t = (rec.get('pd_taxtotal') || 0.0) * (rec.get('pu_rate') || 1.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pu_rate', 'pd_taxtotal']
+         }, // 金额本位币
         { name: 'pd_taxrate', type: 'int' }, // 税率
         { name: 'pd_total-pd_taxtotal', type: 'float', // 税额
             convert: function(v, rec) {
@@ -20,6 +27,13 @@ Ext.define('saas.model.report.Purchase', {
             depends: ['pd_total', 'pd_taxtotal']
         },
         { name: 'pd_total', type: 'float' }, // 价税合计
+        { name: 'pd_total*pu_rate', type: 'float',
+            convert: function(v, rec) {
+                var t = (rec.get('pd_total') || 0.0) * (rec.get('pu_rate') || 1.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pu_rate', 'pd_total'] 
+        }, // 价税合计本位币
         { name: 'pd_pdacceptqty', type: 'float' }, // 收货数量
         { name: 'pu_currency', type:'string'},//币别
         { name: 'pu_rate', type:'float'},//汇率

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

@@ -18,7 +18,14 @@ Ext.define('saas.model.report.Sale', {
         { name: 'sd_price', type: 'float' },
         { name: 'sd_netprice', type: 'float' },
         { name: 'sd_price', type: 'float' },
-        { name: 'sd_nettotal', type: 'float' },
+        { name: 'sd_nettotal', type: 'float' },//金额
+        { name: 'sd_nettotal*sa_rate', type: 'float',
+            convert: function(v, rec) {
+                var t = (rec.get('sd_nettotal') || 0.0) * (rec.get('sa_rate') || 1.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['sa_rate', 'sd_nettotal']
+         },//金额本位币
         { name: 'sd_taxrate', type: 'float' },
         { name: 'sd_total - sd_nettotal', type: 'float',
             convert: function(v, rec) {
@@ -27,7 +34,14 @@ Ext.define('saas.model.report.Sale', {
             },
             depends: ['sd_total', 'sd_nettotal']
         },
-        { name: 'sd_total', type: 'float' },
+        { name: 'sd_total', type: 'float' },//价税合计
+        { name: 'sd_total*sa_rate', type: 'float' ,
+            convert: function(v, rec) {
+                var t = (rec.get('sd_total') || 0.0) * (rec.get('sa_rate') || 1.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['sd_total', 'sa_rate']
+        },//价税合计本位币
         { name: 'sd_pdsendqty', type: 'float' },
         { name: 'sa_currency', type: 'string' },//币别
         { name: 'sa_rate', type: 'float' },//税率

+ 29 - 6
frontend/saas-web/app/model/report/SaleProfit.js

@@ -15,9 +15,9 @@ Ext.define('saas.model.report.SaleProfit', {
         { name: 'pd_outqty', type: 'float' },
         { name: 'pr_unit', type: 'string' },
         { name: 'pd_netprice', type: 'float' },
-        { name: 'pd_sendprice', type: 'float' },
+        { name: 'pd_sendprice', type: 'float' },//含税单价
         { name: 'pd_nettotal', type: 'float' },
-        { name: 'pd_taxrate', type: 'int' },
+        { name: 'pd_taxrate', type: 'int' },//税率
         { 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);
@@ -25,11 +25,34 @@ Ext.define('saas.model.report.SaleProfit', {
             },
             depends: ['pd_ordertotal', 'pd_nettotal']
         }, 
-        { name: 'pd_ordertotal', type: 'float' },
-        { name: 'pd_price', type: 'float' },
+        { name: 'pd_ordertotal', type: 'float' },//价税合计
+        { name: 'pd_ordertotal*pi_rate', type: 'float' ,
+            convert: function(v, rec) {
+                var t = (rec.get('pd_ordertotal') || 0.0) * (rec.get('pi_rate') || 1.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_ordertotal', 'pi_rate']
+        },//价税合计本位币
+        { name: 'pd_price', type: 'float' },//成本单价
         { name: 'pd_total', type: 'float' },
-        { name: 'pd_profit', type: 'float' },
-        { name: 'pd_profitpresent', type: 'float' },
+        { name: 'pd_profit', type: 'float' ,
+            convert: function(v, rec) {
+                var t = (((rec.get('pd_sendprice') || 0.0) * (rec.get('pi_rate') || 1.0) / (1 + (rec.get('pd_taxrate') || 0.0)/100 )) 
+                - (rec.get('pd_price') || 0.0) )*(rec.get('pd_outqty') || 0.0);
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_sendprice', 'pi_rate','pd_taxrate','pd_price','pd_outqty']
+        },//毛利润(元) = ( (含税单价 * 汇率) / (1+税率%) - 成本单价 ) *  
+        { name: 'pd_profitpresent', type: 'float',
+            convert: function(v, rec) {
+                var t = (((rec.get('pd_sendprice') || 0.0) * (rec.get('pi_rate') || 1.0) / (1 + (rec.get('pd_taxrate') || 0.0)/100 )) 
+                - (rec.get('pd_price') || 0.0)) 
+                /
+                (((rec.get('pd_sendprice') || 0.0) * (rec.get('pi_rate') || 1.0) / (1 + (rec.get('pd_taxrate') || 0.0)/100 )));
+                return Number(saas.util.BaseUtil.numberFormat(t, 2, false));
+            },
+            depends: ['pd_sendprice', 'pi_rate','pd_taxrate','pd_price']
+        },//毛利润率 = (含税单价*汇率/(1+税率%) - 成本单价) / (含税单价*汇率/(1+税率%))
         { name: 'pd_remark', type: 'string' },
         { name: 'pi_currency', type: 'string' },
         { name: 'pi_rate', type: 'float' }

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

@@ -27,7 +27,7 @@ Ext.define('saas.view.core.report.ReportPanel', {
     exportAble: true,
     showMySummary: true,
     queryMode: 'DETAIL',
-
+   
     calculateProperty: 'data.calculate',
     rootProperty: 'data.list.list',
     totalProperty: 'data.list.total',

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

@@ -104,7 +104,10 @@ Ext.define('saas.view.money.report.AccountDetails', {
         text: '汇率',
         dataIndex: 'rate',
         xtype: 'numbercolumn',
-        width: 80
+        width: 80,
+        renderer: function(v, m, r) {
+            return saas.util.BaseUtil.numberFormat(v, 6, true);
+        }
     }, {
         dataIndex: '',
         flex: 1

+ 28 - 4
frontend/saas-web/app/view/purchase/report/Purchase.js

@@ -142,10 +142,20 @@ Ext.define('saas.view.purchase.report.Purchase', {
         width: 120,
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
+        renderer: function(v, m, r) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
+        }
+    }, {
+        text: '金额本位币(元)',
+        dataIndex: 'pd_taxtotal*pu_rate',
+        width: 120,
+        hidden:true,
+        exportFormat: 'Amount',
+        xtype: 'numbercolumn',
         renderer: function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
-        summaryLabel: '金额',
+        summaryLabel: '金额本位币',
         summaryType: 'sum',
         summaryRenderer: function(v, d, f, m) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
@@ -181,13 +191,24 @@ Ext.define('saas.view.purchase.report.Purchase', {
         width: 120,
         exportFormat: 'Amount',
         xtype: 'numbercolumn',
+        renderer: function(v, m, r) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
+        }
+    }, {
+        text: '价税合计本位币(元)',
+        dataIndex: 'pd_total*pu_rate',
+        xtype: 'numbercolumn',
+        width: 120,
+        hidden:true,
+        exportFormat: 'Amount',
+        xtype: 'numbercolumn',
         renderer: function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
-        summaryLabel: '价税合计',
+        summaryLabel: '价税合计本位币',
         summaryType: 'sum',
         summaryRenderer: function(v, d, f, m) {
-            return saas.util.BaseUtil.numberFormat(v, 2, true);
+            return saas.util.BaseUtil.numberFormat(1, 2, true);
         }
     }, {
         text: '币别',
@@ -198,7 +219,10 @@ Ext.define('saas.view.purchase.report.Purchase', {
         text: '汇率',
         xtype: 'numbercolumn',
         dataIndex: 'pu_rate',
-        width: 80
+        width: 80,
+        renderer: function(v, m, r) {
+            return saas.util.BaseUtil.numberFormat(v, 6, true);
+        }
     }, {
         text: '备注',
         dataIndex: 'pd_remark',

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

@@ -142,11 +142,21 @@ Ext.define('saas.view.sale.report.Sale', {
         exportFormat: 'Amount',
         width: 120,
         dataIndex: 'sd_nettotal',
+        renderer : function(v, m, r) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
+        }
+    }, {
+        text: '金额本位币(元)',
+        xtype: 'numbercolumn',
+        exportFormat: 'Amount',
+        width: 120,
+        hidden:true,
+        dataIndex: 'sd_nettotal*sa_rate',
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
         summaryType: 'sum',
-        summaryLabel: '金额',
+        summaryLabel: '金额本位币',
         summaryRenderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
@@ -179,11 +189,20 @@ Ext.define('saas.view.sale.report.Sale', {
         exportFormat: 'Amount',
         dataIndex: 'sd_total',
         width: 120,
+        renderer : function(v, m, r) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
+        }
+    }, {
+        text: '价税合计(元)',
+        xtype: 'numbercolumn',
+        exportFormat: 'Amount',
+        dataIndex: 'sd_total*sa_rate',
+        width: 120,
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
         summaryType: 'sum',
-        summaryLabel: '价税合计',
+        summaryLabel: '价税合计本位币',
         summaryRenderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         }
@@ -196,7 +215,10 @@ Ext.define('saas.view.sale.report.Sale', {
         text: '汇率',
         xtype: 'numbercolumn',
         dataIndex: 'sa_rate',
-        width: 80
+        width: 80,
+        renderer: function(v, m, r) {
+            return saas.util.BaseUtil.numberFormat(v, 6, true);
+        }
     },  {
         text : "备注", 
         dataIndex : "sd_remark",

+ 15 - 2
frontend/saas-web/app/view/sale/report/SaleProfit.js

@@ -99,7 +99,10 @@ Ext.define('saas.view.sale.report.SaleProfit', {
     }, {
         text: '汇率',
         dataIndex: 'pi_rate',
-        width: 80
+        width: 80,
+        renderer: function(v, m, r) {
+            return saas.util.BaseUtil.numberFormat(v, 6, true);
+        }
     }, {
         text: '单价(元)',
         dataIndex: 'pd_netprice',
@@ -150,11 +153,21 @@ Ext.define('saas.view.sale.report.SaleProfit', {
         dataIndex: 'pd_ordertotal',
         xtype: 'numbercolumn',
         width:120,
+        renderer : function(v, m, r) {
+            return saas.util.BaseUtil.numberFormat(v, 2, true);
+        }
+    }, {
+        text: '价税合计本位币(元)',
+        exportFormat: 'Amount',
+        dataIndex: 'pd_ordertotal*pi_rate',
+        xtype: 'numbercolumn',
+        width:120,
+        hidden:true,
         renderer : function(v, m, r) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         },
         summaryType: 'sum',
-        summaryLabel: '价税合计',
+        summaryLabel: '价税合计本位币',
         summaryRenderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 2, true);
         }

+ 12 - 10
frontend/saas-web/app/view/stock/report/Prodiodetail.js

@@ -53,6 +53,16 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
         text: 'id',
         dataIndex: 'id',
         hidden: true
+    }, {
+        text: '单号',
+        dataIndex: 'pi_inoutno',
+        width: 150,
+        locked: true
+    },  {
+        text: '业务类型',
+        dataIndex: 'pi_class',
+        width: 100,
+        locked: true
     }, {
         text: '单据日期',
         dataIndex: 'pi_date',
@@ -70,14 +80,6 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
         renderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 0, false);
         }
-    }, {
-        text: '单号',
-        dataIndex: 'pi_inoutno',
-        width: 150
-    }, {
-        text: '业务类型',
-        dataIndex: 'pi_class',
-        width: 100
     }, {
         text: '物料编号',
         dataIndex: 'pd_prodcode',
@@ -90,7 +92,7 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
         text: '物料名称',
         dataIndex: 'pr_detail',
         width: 150
-    }, {
+    },  {
         text: '型号',
         dataIndex: 'pr_orispeccode',
         width: 200
@@ -131,7 +133,7 @@ Ext.define('saas.view.stock.report.Prodiodetail', {
         renderer: function(v) {
             return saas.util.BaseUtil.numberFormat(v, 4, true);
         }
-    },  {
+    }, {
         text: '仓库',
         dataIndex: 'pd_whname',
         width: 120