فهرست منبع

【多币别】【核销单多币别调整】

rainco 7 سال پیش
والد
کامیت
cd6644e82a

+ 41 - 29
frontend/saas-web/app/view/money/verification/FormPanel.js

@@ -535,10 +535,9 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         }, {
                             from: 'cr_rate', to: 'vc_rate'
                         }],
-                        // defaultValue: {
-                        //     vc_currency: 'RMB',
-                        //     vc_rate: 1
-                        // },
+                        listeners: {
+                            change: 'clearDetails'
+                        },
                         supFieldConfig: {
                             xtype: 'numberfield',
                             readOnly: false,
@@ -596,10 +595,9 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         }, {
                             from: 'cr_rate', to: 'vc_rate'
                         }],
-                        // defaultValue: {
-                        //     vc_currency: 'RMB',
-                        //     vc_rate: 1
-                        // },
+                        listeners: {
+                            change: 'clearDetails'
+                        },
                         supFieldConfig: {
                             xtype: 'numberfield',
                             readOnly: false,
@@ -641,7 +639,7 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         fieldLabel: '客户名称',
                         xtype: 'customerDbfindTrigger',
                         name: 'vc_custname',
-                        allowBlank: false,
+                        allowBlank: false
                     }, {
                         xtype: 'hidden',
                         name: 'vc_vendid',
@@ -657,7 +655,19 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         xtype: "vendorDbfindTrigger",
                         name: "vc_vendname",
                         fieldLabel: "供应商名称",
-                        allowBlank: false
+                        allowBlank: false,
+                        dbfinds: [{
+                            from: 'id',
+                            to: 'vc_vendid',
+                            ignore: true
+                        }, {
+                            from: 've_code',
+                            to: 'vc_vendcode'
+                        }, {
+                            from: 've_name',
+                            to: 'vc_vendname'
+                        }
+                        ],
                     }, {
                         fieldLabel: '日期',
                         xtype: 'datefield',
@@ -674,10 +684,9 @@ Ext.define('saas.view.money.verification.FormPanel', {
                             }, {
                                 from: 'cr_rate', to: 'vc_rate'
                             }],
-                            // defaultValue: {
-                            //     vc_currency: 'RMB',
-                            //     vc_rate: 1
-                            // },
+                            listeners: {
+                                change: 'clearDetails'
+                            },
                             supFieldConfig: {
                                 xtype: 'numberfield',
                                 readOnly: false,
@@ -751,10 +760,9 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         }, {
                             from: 'cr_rate', to: 'vc_rate'
                         }],
-                        // defaultValue: {
-                        //     vc_currency: 'RMB',
-                        //     vc_rate: 1
-                        // },
+                        listeners: {
+                            change: 'clearDetails'
+                        },
                         supFieldConfig: {
                             xtype: 'numberfield',
                             readOnly: false,
@@ -828,10 +836,9 @@ Ext.define('saas.view.money.verification.FormPanel', {
                         }, {
                             from: 'cr_rate', to: 'vc_rate'
                         }],
-                        // defaultValue: {
-                        //     vc_currency: 'RMB',
-                        //     vc_rate: 1
-                        // },
+                        listeners: {
+                            change: 'clearDetails'
+                        },
                         supFieldConfig: {
                             xtype: 'numberfield',
                             readOnly: false,
@@ -855,32 +862,37 @@ Ext.define('saas.view.money.verification.FormPanel', {
                 },
 
                 defaultConditions: {
-                    receipts_offset_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
+                    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)))',
-                        'ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+
+
+                        '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)))'
                     ],
-                    prepaid_offset_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)<>0 and ifnull(sl_namount,0)<>0 ' +
+                    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)))',
+
+
                         '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)))'
                     ],
-                    receivable_offset_payable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+                    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)))',
-                        'ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
+
+                        '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)))'
                     ],
-                    receivable_to_receivable: ['ifnull(sl_custid,0)={vc_custid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0 ' +
+                    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)))'
                     ],
-                    payable_to_payable: ['ifnull(sl_vendid,0)={vc_vendid} and ifnull(sl_preamount,0)=0 and ifnull(sl_namount,0)<>0' +
+                    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)))'
                     ]

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

@@ -20,7 +20,7 @@ Ext.define('saas.view.money.verification.FormPanelController', {
                             from:'cu_currency',to:'vc_currency'
                         },{
                             from:'cr_rate',to:'vc_rate'
-                        }
+                        } 
                         ],
                     }) ;   
 
@@ -57,7 +57,7 @@ Ext.define('saas.view.money.verification.FormPanelController', {
                             from: 've_name',
                             to: 'vc_vendname'
                         },{
-                            from:'cu_currency',to:'vc_currency'
+                            from:'ve_currency',to:'vc_currency'
                         },{
                             from:'cr_rate',to:'vc_rate'
                         }
@@ -213,7 +213,7 @@ Ext.define('saas.view.money.verification.FormPanelController', {
             var fieldName = a.replace(/[{|}]/g, '');
             var fieldLabel = Ext.Array.findBy(formItems, function(f) {
                 return f.name == fieldName;
-            }).fieldLabel;
+            });
             var fieldValue = viewModel.get(fieldName);
             fields[fieldName] = fieldValue;