Browse Source

Merge branch 'dev' of ssh://10.10.100.21/source/saas-platform into dev

chenw 6 years ago
parent
commit
49cbc8a2e6

+ 1 - 1
applications/money/money-server/src/main/resources/application.yml

@@ -49,7 +49,7 @@ eureka:
   client:
     registryFetchIntervalSeconds: 5
     serviceUrl:
-      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@10.1.81.61:8510/eureka/
+      defaultZone: http://${spring.security.user.name}:${spring.security.user.password}@10.1.80.137:8500/eureka/
 management:
   endpoints:
     web:

+ 4 - 7
frontend/saas-web/app/view/document/customer/BasePanel.js

@@ -120,13 +120,10 @@ Ext.define('saas.view.document.customer.BasePanel', {
                         return Ext.util.Format.number(v, '0');
                     }
                 }, {
-                    text: '应收余额(元)',
-                    xtype: 'numbercolumn',
-                    dataIndex: 'cu_leftamount',
-                    width: 120,
-                    renderer : function(v, m, r) {
-                        return saas.util.BaseUtil.numberFormat(v, 2, true);
-                    }
+                    text: '币别',
+                    dataIndex: 'cu_currency',
+                    align: 'center',
+                    width: 65
                 }, {
                     text : "业务员", 
                     dataIndex : "cu_sellername",

+ 0 - 13
frontend/saas-web/app/view/document/customer/FormPanel.js

@@ -176,19 +176,6 @@ Ext.define('saas.view.document.customer.FormPanel', {
                 renderer: function(v, m, r) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-            }, {
-                xtype: 'textfield',
-                name: "cu_leftamount",
-                fieldLabel: "应收余额(元)",
-                allowBlank: true,
-                readOnly: true,
-                columnWidth: 0.25,
-                decimalPrecision: 2,
-                thousandSeparator: ',',
-                group: '交易信息',
-                renderer: function(v, m, r) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
             }, {
                 xtype: "numberfield",
                 hideTrigger: true,

+ 4 - 7
frontend/saas-web/app/view/document/vendor/BasePanel.js

@@ -111,13 +111,10 @@ Ext.define('saas.view.document.vendor.BasePanel', {
                         return Ext.util.Format.number(v, '0');
                     }
                 }, {
-                    text: '应付余额(元)',
-                    xtype: 'numbercolumn',
-                    dataIndex: 've_leftamount',
-                    width: 120,
-                    renderer: function(v, m, r) {
-                        return saas.util.BaseUtil.numberFormat(v, 2, true);
-                    }
+                    text: '币别',
+                    dataIndex: 've_currency',
+                    align: 'center',
+                    width: 65
                 }, {
                     text: "备注",
                     dataIndex: "ve_remark",

+ 0 - 14
frontend/saas-web/app/view/document/vendor/FormPanel.js

@@ -183,20 +183,6 @@ Ext.define('saas.view.document.vendor.FormPanel', {
                 renderer: function(v, m, r) {
                     return saas.util.BaseUtil.numberFormat(v, 2, true);
                 },
-            }, {
-                xtype: "numberfield",
-                name: "ve_leftamount",
-                fieldLabel: "应付余额(元)",
-                allowBlank: true,
-                readOnly: true,
-                ignore: true,
-                columnWidth: 0.25,
-                decimalPrecision: 2,
-                thousandSeparator: ',',
-                group: '交易信息',
-                renderer: function(v, m, r) {
-                    return saas.util.BaseUtil.numberFormat(v, 2, true);
-                },
             }, {
                 xtype: "numberfield",
                 hideTrigger: true,

+ 32 - 17
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -927,38 +927,53 @@ Ext.define('saas.view.money.verification.FormPanel', {
 
                 defaultConditions: {
                     receipts_offset_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind=\'收款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
-
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind=\'收款单\') or ' +
+                              '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                                            'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
 
                         'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and (sl_kind in (\'出货单\',\'销售退货单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'出货单\',\'销售退货单\') or '+
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     prepaid_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind=\'付款单\') or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind=\'付款单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\'' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
 
 
                         'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\'' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     receivable_offset_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))',
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))',
 
                         'ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     receivable_to_receivable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
-                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or (sl_kind=\'期初余额\' and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and ((sl_kind in (\'出货单\',\'销售退货单\')) or' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_custid,0)={vc_custid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ],
                     payable_to_payable: ['ifnull(sl_currency,\'RMB\') = \'{vc_currency}\' and ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
-                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or (sl_kind in (\'期初余额\') and sl_ym=' +
-                        '(select min(pd_detno) from periodsdetail where pd_status=0 and periodsdetail.companyid=subledger.companyid)))'
+                        'and sl_ym<=DATE_FORMAT(str_to_date(\'{vc_date}\', \'%Y-%m-%d\'),\'%Y%m\')' +
+                        ' and (sl_kind in (\'采购验收单\',\'采购验退单\') or ' +
+                        '( sl_id =(select sl_id from subledger where ifnull(sl_vendid,0)={vc_vendid} and sl_kind=\'期初余额\' ' +
+                        'and sl_ym>=(select min(pd_detno) from periodsdetail  where pd_status=0 and periodsdetail.companyid=subledger.companyid) order by sl_ym limit 1)))'
                     ]
                 }
             },

+ 3 - 1
frontend/saas-web/app/view/money/verification/FormPanelController.js

@@ -216,8 +216,10 @@ Ext.define('saas.view.money.verification.FormPanelController', {
             });
             var fieldLabel = field.fieldLabel || field.name;
             var fieldValue = viewModel.get(fieldName);
+            if(Ext.isDate(fieldValue)) {
+                fieldValue = Ext.Date.format(fieldValue, 'Y-m-d');
+            }
             fields[fieldName] = fieldValue;
-            
             if(!fieldValue && nullFields.indexOf(fieldLabel) == -1) {
                 nullFields.push(fieldLabel);
             }