|
|
@ -157,6 +157,8 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
|
|
|
|
var curr = this.formADVANCE.getForm().findField('ADVANCE_CURRENCY');
|
|
|
|
var curr = this.formADVANCE.getForm().findField('ADVANCE_CURRENCY');
|
|
|
|
curr.setValue(records[0].data.CURR);
|
|
|
|
curr.setValue(records[0].data.CURR);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.LoadDateCurr(true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -173,6 +175,7 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
|
|
|
|
this.comboxStlMode = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
|
this.comboxStlMode = Ext.create('DsExt.ux.RefTableCombox', {
|
|
|
|
fieldLabel: Zi.LAN.SettlementType,
|
|
|
|
fieldLabel: Zi.LAN.SettlementType,
|
|
|
|
store: this.StoreStlMode,
|
|
|
|
store: this.StoreStlMode,
|
|
|
|
|
|
|
|
flex:0.5,
|
|
|
|
forceSelection: true,
|
|
|
|
forceSelection: true,
|
|
|
|
name: 'SETTLETYPE',
|
|
|
|
name: 'SETTLETYPE',
|
|
|
|
valueField: 'STLCODE',
|
|
|
|
valueField: 'STLCODE',
|
|
|
@ -325,11 +328,13 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
fieldLabel: 'HXBILLNO',
|
|
|
|
fieldLabel: 'HXBILLNO',
|
|
|
|
name: 'HXBILLNO', flex: 0, hidden: true, margins: '0'
|
|
|
|
name: 'HXBILLNO', flex: 0, hidden: true, margins: '0'
|
|
|
|
}, {
|
|
|
|
},
|
|
|
|
fieldLabel: '汇率',
|
|
|
|
|
|
|
|
hidden: true,
|
|
|
|
// {
|
|
|
|
name: 'RATE'
|
|
|
|
// fieldLabel: '汇率',
|
|
|
|
},
|
|
|
|
// hidden: true,
|
|
|
|
|
|
|
|
// name: 'RATE'
|
|
|
|
|
|
|
|
//},
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
fieldLabel: Zi.LAN.BillNo,
|
|
|
|
fieldLabel: Zi.LAN.BillNo,
|
|
|
@ -343,7 +348,12 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
|
|
|
|
fieldLabel: Zi.LAN.SettlementTime,
|
|
|
|
fieldLabel: Zi.LAN.SettlementTime,
|
|
|
|
format: 'Y-m-d H:i:s',
|
|
|
|
format: 'Y-m-d H:i:s',
|
|
|
|
xtype: 'datefield',
|
|
|
|
xtype: 'datefield',
|
|
|
|
name: 'SETTLETIME'
|
|
|
|
name: 'SETTLETIME',
|
|
|
|
|
|
|
|
listeners: {
|
|
|
|
|
|
|
|
change: function () {
|
|
|
|
|
|
|
|
_this.LoadDateCurr(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
}, {
|
|
|
|
fieldLabel: Zi.LAN.SettlementUser,
|
|
|
|
fieldLabel: Zi.LAN.SettlementUser,
|
|
|
|
readOnly: true,
|
|
|
|
readOnly: true,
|
|
|
@ -377,7 +387,14 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return value;
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, this.comboxStlMode, this.comboxBANK, {
|
|
|
|
}, this.comboxStlMode, {
|
|
|
|
|
|
|
|
fieldLabel: Zi.LAN.ExchangeRate,
|
|
|
|
|
|
|
|
flex: 0.5,
|
|
|
|
|
|
|
|
labelWidth: 50,
|
|
|
|
|
|
|
|
name: 'RATE'
|
|
|
|
|
|
|
|
}, this.comboxBANK
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
, {
|
|
|
|
fieldLabel: Zi.LAN.SettlementNo,
|
|
|
|
fieldLabel: Zi.LAN.SettlementNo,
|
|
|
|
flex: 1,
|
|
|
|
flex: 1,
|
|
|
|
name: 'SETTLENO'
|
|
|
|
name: 'SETTLENO'
|
|
|
@ -3182,6 +3199,8 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
|
|
|
|
_this.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: data.BILLNO } });
|
|
|
|
_this.storeChfeeFile.load({ params: { start: 0, limit: 9999, BillNo: data.BILLNO } });
|
|
|
|
if (_this.opStatus == 'add') {
|
|
|
|
if (_this.opStatus == 'add') {
|
|
|
|
_this.formEdit.getForm().findField('CURR').setValue('');
|
|
|
|
_this.formEdit.getForm().findField('CURR').setValue('');
|
|
|
|
|
|
|
|
_this.formEdit.getForm().findField('RATE').setValue(1);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_this.storeBodyList.load({ params: { billno: billno },
|
|
|
|
_this.storeBodyList.load({ params: { billno: billno },
|
|
|
|
callback: function (r, options, success) {
|
|
|
|
callback: function (r, options, success) {
|
|
|
@ -3471,11 +3490,14 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
|
|
|
|
var CUSTOMERNAME = this.formEdit.getForm().findField('CUSTOMERNAME').getValue();
|
|
|
|
var CUSTOMERNAME = this.formEdit.getForm().findField('CUSTOMERNAME').getValue();
|
|
|
|
var CURR = this.formEdit.getForm().findField('CURR').getValue();
|
|
|
|
var CURR = this.formEdit.getForm().findField('CURR').getValue();
|
|
|
|
if (addcurr == '') {
|
|
|
|
if (addcurr == '') {
|
|
|
|
if ((CURR == '') || (CURR == null))
|
|
|
|
if ((CURR == '') || (CURR == null)) {
|
|
|
|
this.formEdit.getForm().findField('CURR').setValue('RMB');
|
|
|
|
this.formEdit.getForm().findField('CURR').setValue('RMB');
|
|
|
|
|
|
|
|
this.formEdit.getForm().findField('RATE').setValue(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
if ((CURR == '') || (CURR == null))
|
|
|
|
if ((CURR == '') || (CURR == null)) {
|
|
|
|
this.formEdit.getForm().findField('CURR').setValue(addcurr);
|
|
|
|
this.formEdit.getForm().findField('CURR').setValue(addcurr);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//if ((CUSTOMERNAME == '') || (CUSTOMERNAME == null) || (CURR == '') || (CURR == null)) {
|
|
|
|
//if ((CUSTOMERNAME == '') || (CUSTOMERNAME == null) || (CURR == '') || (CURR == null)) {
|
|
|
|
var selectedRecords = this.gridAddFeeList.selModel.getSelection();
|
|
|
|
var selectedRecords = this.gridAddFeeList.selModel.getSelection();
|
|
|
@ -3485,12 +3507,61 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
|
|
|
|
var addcurr2 = rec.data.CURR;
|
|
|
|
var addcurr2 = rec.data.CURR;
|
|
|
|
if ((CUSTOMERNAME == '') || (CUSTOMERNAME == null))
|
|
|
|
if ((CUSTOMERNAME == '') || (CUSTOMERNAME == null))
|
|
|
|
this.formEdit.getForm().findField('CUSTOMERNAME').setValue(cust);
|
|
|
|
this.formEdit.getForm().findField('CUSTOMERNAME').setValue(cust);
|
|
|
|
if ((CURR == '') || (CURR == null)) {
|
|
|
|
//if ((CURR == '') || (CURR == null)) {
|
|
|
|
if (addcurr2 != '')
|
|
|
|
// if (addcurr2 != '')
|
|
|
|
this.formEdit.getForm().findField('CURR').setValue(addcurr2);
|
|
|
|
// this.formEdit.getForm().findField('CURR').setValue(addcurr2);
|
|
|
|
else {
|
|
|
|
// else {
|
|
|
|
if (rec.data.BALAMOUNT != 0) this.formEdit.getForm().findField('CURR').setValue('RMB');
|
|
|
|
// if (rec.data.BALAMOUNT != 0) this.formEdit.getForm().findField('CURR').setValue('RMB');
|
|
|
|
else if (rec.data.USDBALAMOUNT != 0) this.formEdit.getForm().findField('CURR').setValue('USD');
|
|
|
|
// else if (rec.data.USDBALAMOUNT != 0) this.formEdit.getForm().findField('CURR').setValue('USD');
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
if (CURR != curr) {
|
|
|
|
|
|
|
|
this.formEdit.getForm().findField('CURR').setValue(curr);
|
|
|
|
|
|
|
|
if (curr == 'RMB') {
|
|
|
|
|
|
|
|
this.formEdit.getForm().findField('RATE').setValue(1);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
//var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', curr);
|
|
|
|
|
|
|
|
//if (FFrecords.getCount() > 0) {
|
|
|
|
|
|
|
|
// var ffdata = FFrecords.getAt(0).data;
|
|
|
|
|
|
|
|
// var DEFRATE = ffdata.DEFRATE;
|
|
|
|
|
|
|
|
// this.formEdit.getForm().findField('RATE').setValue(DEFRATE);
|
|
|
|
|
|
|
|
//} else {
|
|
|
|
|
|
|
|
// var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', curr);
|
|
|
|
|
|
|
|
// if (DFrecords.getCount() > 0) {
|
|
|
|
|
|
|
|
// var dfdata = DFrecords.getAt(0).data;
|
|
|
|
|
|
|
|
// var DEFRATE = dfdata.DEFRATE;
|
|
|
|
|
|
|
|
// this.formEdit.getForm().findField('RATE').setValue(DEFRATE);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// this.formEdit.getForm().findField('RATE').setValue(1);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
this.LoadDateCurr()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//this.LoadDateCurr();
|
|
|
|
|
|
|
|
////等待300毫秒后重新执行
|
|
|
|
|
|
|
|
//_return = true;
|
|
|
|
|
|
|
|
//setTimeout(this.addDetail, 300);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CUST = this.formEdit.getForm().findField('CUSTOMERNAME').getValue();
|
|
|
|
|
|
|
|
var recs = DsStoreQueryBy(this.storeCustCode, 'CustName', CUST);
|
|
|
|
|
|
|
|
var CUSTBANK = this.formEdit.getForm().findField('CUSTBANK');
|
|
|
|
|
|
|
|
var CUSTACCOUNT = this.formEdit.getForm().findField('CUSTACCOUNT');
|
|
|
|
|
|
|
|
var CURR = this.formEdit.getForm().findField('CURR').getValue();
|
|
|
|
|
|
|
|
if (recs.getCount() > 0) {
|
|
|
|
|
|
|
|
var data = recs.getAt(0).data;
|
|
|
|
|
|
|
|
if (CURR == 'RMB') {
|
|
|
|
|
|
|
|
CUSTBANK.setValue(data.RMBBank);
|
|
|
|
|
|
|
|
CUSTACCOUNT.setValue(data.RMBAccount);
|
|
|
|
|
|
|
|
} else if (CURR == 'USD') {
|
|
|
|
|
|
|
|
CUSTBANK.setValue(data.USDBank);
|
|
|
|
|
|
|
|
CUSTACCOUNT.setValue(data.USDAccount);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
CUSTBANK.setValue('');
|
|
|
|
|
|
|
|
CUSTACCOUNT.setValue('');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.formEdit.getForm().findField('SETTLETYPE').setValue(rec.data.SETTLETYPE);
|
|
|
|
this.formEdit.getForm().findField('SETTLETYPE').setValue(rec.data.SETTLETYPE);
|
|
|
@ -5389,7 +5460,125 @@ Ext.extend(Shipping.MsChRecvAppSettlementEdit, Ext.Panel, {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
win.show();
|
|
|
|
win.show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//#endregion
|
|
|
|
//#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//#region 载入汇率信息
|
|
|
|
|
|
|
|
,
|
|
|
|
|
|
|
|
async LoadDateCurr(needload = false) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_this = this;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DateStr = _this.formEdit.getForm().findField("SETTLETIME").getRawValue();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (needload) {
|
|
|
|
|
|
|
|
this.StoreDateCurr.load({
|
|
|
|
|
|
|
|
async: false,
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
DateStr: DateStr
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
callback: function (r, options, success) {
|
|
|
|
|
|
|
|
if (success) {
|
|
|
|
|
|
|
|
if (_this.StoreDateCurr.getCount() > 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < _this.StoreDateCurr.getCount(); i += 1) {
|
|
|
|
|
|
|
|
var member = _this.StoreDateCurr.getAt(i);
|
|
|
|
|
|
|
|
if (member.data.CURR == CURR) {
|
|
|
|
|
|
|
|
this.formEdit.getForm().findField('RATE').setValue(member.data.DEFRATE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', CURR);
|
|
|
|
|
|
|
|
if (DFrecords.getCount() > 0) {
|
|
|
|
|
|
|
|
var dfdata = DFrecords.getAt(0).data;
|
|
|
|
|
|
|
|
var DEFRATE = dfdata.DEFRATE;
|
|
|
|
|
|
|
|
this.formEdit.getForm().findField('RATE').setValue(DEFRATE);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.formEdit.getForm().findField('RATE').setValue(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
scope: this
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var CURR = this.formEdit.getForm().findField('CURR').getValue();
|
|
|
|
|
|
|
|
if (CURR == 'RMB') {
|
|
|
|
|
|
|
|
this.StoreDateCurr.load({
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
DateStr: DateStr
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
callback: function (r, options, success) {
|
|
|
|
|
|
|
|
if (success) {
|
|
|
|
|
|
|
|
//_this.LoadDateCurr();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
scope: this
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
this.formEdit.getForm().findField('RATE').setValue(1);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (_this.StoreDateCurr.getCount() > 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < _this.StoreDateCurr.getCount(); i += 1) {
|
|
|
|
|
|
|
|
var member = _this.StoreDateCurr.getAt(i);
|
|
|
|
|
|
|
|
if (member.data.CURR == CURR) {
|
|
|
|
|
|
|
|
this.formEdit.getForm().findField('RATE').setValue(member.data.DEFRATE);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.StoreDateCurr.load({
|
|
|
|
|
|
|
|
async: false,
|
|
|
|
|
|
|
|
params: {
|
|
|
|
|
|
|
|
DateStr: DateStr
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
callback: function (r, options, success) {
|
|
|
|
|
|
|
|
if (success) {
|
|
|
|
|
|
|
|
_this.LoadDateCurr();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
scope: this
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//await this.StoreDateCurr.load({
|
|
|
|
|
|
|
|
// async:false,
|
|
|
|
|
|
|
|
// params: {
|
|
|
|
|
|
|
|
// DateStr: DateStr
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// callback: function (r, options, success) {
|
|
|
|
|
|
|
|
// if (success) {
|
|
|
|
|
|
|
|
// if (_this.StoreDateCurr.getCount() > 0) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for (var i = 0; i < _this.StoreDateCurr.getCount(); i += 1) {
|
|
|
|
|
|
|
|
// var member = _this.StoreDateCurr.getAt(i);
|
|
|
|
|
|
|
|
// if (member.data.CURR == CURR) {
|
|
|
|
|
|
|
|
// this.formEdit.getForm().findField('RATE').setValue(member.data.DEFRATE);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', CURR);
|
|
|
|
|
|
|
|
// if (DFrecords.getCount() > 0) {
|
|
|
|
|
|
|
|
// var dfdata = DFrecords.getAt(0).data;
|
|
|
|
|
|
|
|
// var DEFRATE = dfdata.DEFRATE;
|
|
|
|
|
|
|
|
// this.formEdit.getForm().findField('RATE').setValue(DEFRATE);
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// this.formEdit.getForm().findField('RATE').setValue(1);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
// scope: this
|
|
|
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//#endregion
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|