|
|
|
@ -10611,126 +10611,107 @@ Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
calcDetailTotal: function () {
|
|
|
|
|
var rmbdr = 0;
|
|
|
|
|
var rmbcr = 0;
|
|
|
|
|
var usddr = 0;
|
|
|
|
|
var usdcr = 0;
|
|
|
|
|
var otdr = 0;
|
|
|
|
|
var otcr = 0;
|
|
|
|
|
var ttldr = 0;
|
|
|
|
|
var ttlcr = 0;
|
|
|
|
|
var notaxrmbdr = 0;
|
|
|
|
|
var notaxrmbcr = 0;
|
|
|
|
|
var notaxusddr = 0;
|
|
|
|
|
var notaxusdcr = 0;
|
|
|
|
|
var notaxotdr = 0;
|
|
|
|
|
var notaxotcr = 0;
|
|
|
|
|
var notaxttldr = 0;
|
|
|
|
|
var notaxttlcr = 0;
|
|
|
|
|
for (var i = 0; i < this.storeDrChFee.getCount(); i += 1) {
|
|
|
|
|
var member = this.storeDrChFee.getAt(i);
|
|
|
|
|
var value = member.get('Amount');
|
|
|
|
|
var notaxvalue = member.get('NoTaxAmount');
|
|
|
|
|
var curr = member.get('Currency');
|
|
|
|
|
var rate = member.get('ExChangerate');
|
|
|
|
|
rmbdr = parseFloat(value);
|
|
|
|
|
notaxrmbdr = parseFloat(notaxvalue);
|
|
|
|
|
|
|
|
|
|
ttldr =parseFloat(value) * parseFloat(rate);
|
|
|
|
|
notaxttldr = parseFloat(notaxvalue) * parseFloat(rate);
|
|
|
|
|
var isfind = false;
|
|
|
|
|
for (j = 0; j < this.storeBodySum.getCount(); j += 1) {
|
|
|
|
|
var memberyf = this.storeBodySum.getAt(j);
|
|
|
|
|
if (memberyf.data.CURR == curr) {
|
|
|
|
|
memberyf.set("NORATEDR", memberyf.data.NORATEDR+notaxrmbdr);
|
|
|
|
|
memberyf.set("DR", memberyf.data.DR +rmbdr);
|
|
|
|
|
memberyf.set("NORATEPR", memberyf.data.NORATEDR - memberyf.data.NORATEPR);
|
|
|
|
|
memberyf.set("PR", memberyf.data.DR - memberyf.data.CR);
|
|
|
|
|
memberyf.commit();
|
|
|
|
|
isfind = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!isfind) {
|
|
|
|
|
|
|
|
|
|
var record = Ext.create('MsOPGain', {
|
|
|
|
|
CURR: curr,
|
|
|
|
|
NORATEDR: notaxrmbdr,
|
|
|
|
|
DR: rmbdr,
|
|
|
|
|
NORATECR: 0,
|
|
|
|
|
CR: 0,
|
|
|
|
|
NORATEPR: notaxrmbdr,
|
|
|
|
|
PR: rmbdr,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.storeBodySum.add(record);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//var rmbdr = 0;
|
|
|
|
|
//var rmbcr = 0;
|
|
|
|
|
//var usddr = 0;
|
|
|
|
|
//var usdcr = 0;
|
|
|
|
|
//var otdr = 0;
|
|
|
|
|
//var otcr = 0;
|
|
|
|
|
//var ttldr = 0;
|
|
|
|
|
//var ttlcr = 0;
|
|
|
|
|
//var notaxrmbdr = 0;
|
|
|
|
|
//var notaxrmbcr = 0;
|
|
|
|
|
//var notaxusddr = 0;
|
|
|
|
|
//var notaxusdcr = 0;
|
|
|
|
|
//var notaxotdr = 0;
|
|
|
|
|
//var notaxotcr = 0;
|
|
|
|
|
//var notaxttldr = 0;
|
|
|
|
|
//var notaxttlcr = 0;
|
|
|
|
|
//for (var i = 0; i < this.storeDrChFee.getCount(); i += 1) {
|
|
|
|
|
// var member = this.storeDrChFee.getAt(i);
|
|
|
|
|
// var value = member.get('Amount');
|
|
|
|
|
// var notaxvalue = member.get('NoTaxAmount');
|
|
|
|
|
// var curr = member.get('Currency');
|
|
|
|
|
// var rate = member.get('ExChangerate');
|
|
|
|
|
// rmbdr = parseFloat(value);
|
|
|
|
|
// notaxrmbdr = parseFloat(notaxvalue);
|
|
|
|
|
|
|
|
|
|
// ttldr =parseFloat(value) * parseFloat(rate);
|
|
|
|
|
// notaxttldr = parseFloat(notaxvalue) * parseFloat(rate);
|
|
|
|
|
// var isfind = false;
|
|
|
|
|
// for (j = 0; j < this.storeBodySum.getCount(); j += 1) {
|
|
|
|
|
// var memberyf = this.storeBodySum.getAt(j);
|
|
|
|
|
// if (memberyf.data.CURR == curr) {
|
|
|
|
|
// memberyf.set("NORATEDR", memberyf.data.NORATEDR+notaxrmbdr);
|
|
|
|
|
// memberyf.set("DR", memberyf.data.DR +rmbdr);
|
|
|
|
|
// memberyf.set("NORATEPR", memberyf.data.NORATEDR - memberyf.data.NORATEPR);
|
|
|
|
|
// memberyf.set("PR", memberyf.data.DR - memberyf.data.CR);
|
|
|
|
|
// memberyf.commit();
|
|
|
|
|
// isfind = true;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (!isfind) {
|
|
|
|
|
|
|
|
|
|
// var record = Ext.create('MsOPGain', {
|
|
|
|
|
// CURR: curr,
|
|
|
|
|
// NORATEDR: notaxrmbdr,
|
|
|
|
|
// DR: rmbdr,
|
|
|
|
|
// NORATECR: 0,
|
|
|
|
|
// CR: 0,
|
|
|
|
|
// NORATEPR: notaxrmbdr,
|
|
|
|
|
// PR: rmbdr,
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// this.storeBodySum.add(record);
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < this.storeCrChFee.getCount(); i += 1) {
|
|
|
|
|
var member = this.storeCrChFee.getAt(i);
|
|
|
|
|
var value = member.get('Amount');
|
|
|
|
|
var curr = member.get('Currency');
|
|
|
|
|
var rate = member.get('ExChangerate');
|
|
|
|
|
var notaxvalue = member.get('NoTaxAmount');
|
|
|
|
|
rmbcr = parseFloat(value);
|
|
|
|
|
notaxrmbcr = parseFloat(notaxvalue);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
ttlcr = parseFloat(value) * parseFloat(rate);
|
|
|
|
|
notaxttlcr = parseFloat(notaxvalue) * parseFloat(rate);
|
|
|
|
|
var isfind = false;
|
|
|
|
|
for (j = 0; j < this.storeBodySum.getCount(); j += 1) {
|
|
|
|
|
var memberyf = this.storeBodySum.getAt(j);
|
|
|
|
|
if (memberyf.data.CURR == curr) {
|
|
|
|
|
memberyf.set("NORATECR", memberyf.data.NORATECR + notaxrmbcr);
|
|
|
|
|
memberyf.set("CR", memberyf.data.CR + rmbcr);
|
|
|
|
|
memberyf.set("NORATEPR", memberyf.data.NORATEDR - memberyf.data.NORATEPR);
|
|
|
|
|
memberyf.set("PR", memberyf.data.DR - memberyf.data.CR);
|
|
|
|
|
memberyf.commit();
|
|
|
|
|
isfind = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!isfind) {
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
var record = Ext.create('MsOPGain', {
|
|
|
|
|
CURR: curr,
|
|
|
|
|
NORATEDR: 0,
|
|
|
|
|
DR: 0,
|
|
|
|
|
NORATECR: notaxrmbcr,
|
|
|
|
|
CR: rmbcr,
|
|
|
|
|
NORATEPR: -notaxrmbdr,
|
|
|
|
|
PR: -rmbdr,
|
|
|
|
|
});
|
|
|
|
|
//for (var i = 0; i < this.storeCrChFee.getCount(); i += 1) {
|
|
|
|
|
// var member = this.storeCrChFee.getAt(i);
|
|
|
|
|
// var value = member.get('Amount');
|
|
|
|
|
// var curr = member.get('Currency');
|
|
|
|
|
// var rate = member.get('ExChangerate');
|
|
|
|
|
// var notaxvalue = member.get('NoTaxAmount');
|
|
|
|
|
// rmbcr = parseFloat(value);
|
|
|
|
|
// notaxrmbcr = parseFloat(notaxvalue);
|
|
|
|
|
|
|
|
|
|
// ttlcr = parseFloat(value) * parseFloat(rate);
|
|
|
|
|
// notaxttlcr = parseFloat(notaxvalue) * parseFloat(rate);
|
|
|
|
|
// var isfind = false;
|
|
|
|
|
// for (j = 0; j < this.storeBodySum.getCount(); j += 1) {
|
|
|
|
|
// var memberyf = this.storeBodySum.getAt(j);
|
|
|
|
|
// if (memberyf.data.CURR == curr) {
|
|
|
|
|
// memberyf.set("NORATECR", memberyf.data.NORATECR + notaxrmbcr);
|
|
|
|
|
// memberyf.set("CR", memberyf.data.CR + rmbcr);
|
|
|
|
|
// memberyf.set("NORATEPR", memberyf.data.NORATEDR - memberyf.data.NORATEPR);
|
|
|
|
|
// memberyf.set("PR", memberyf.data.DR - memberyf.data.CR);
|
|
|
|
|
// memberyf.commit();
|
|
|
|
|
// isfind = true;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// if (!isfind) {
|
|
|
|
|
|
|
|
|
|
// var record = Ext.create('MsOPGain', {
|
|
|
|
|
// CURR: curr,
|
|
|
|
|
// NORATEDR: 0,
|
|
|
|
|
// DR: 0,
|
|
|
|
|
// NORATECR: notaxrmbcr,
|
|
|
|
|
// CR: rmbcr,
|
|
|
|
|
// NORATEPR: -notaxrmbdr,
|
|
|
|
|
// PR: -rmbdr,
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
this.storeBodySum.add(record);
|
|
|
|
|
// this.storeBodySum.add(record);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//if (this.FEENOTPR){
|
|
|
|
|
// var rmbprofit ="***";
|
|
|
|
|
// var usdprofit ="***";
|
|
|
|
|
// var otprofit ="***";
|
|
|
|
|
// var ttlprofit ="***";
|
|
|
|
|
// var notaxrmbprofit ="***";
|
|
|
|
|
// var notaxusdprofit ="***";
|
|
|
|
|
// var notaxotprofit ="***";
|
|
|
|
|
// var notaxttlprofit ="***";
|
|
|
|
|
|
|
|
|
|
//} else {
|
|
|
|
|
//var rmbprofit = parseFloat(rmbdr) - parseFloat(rmbcr);
|
|
|
|
|
//var usdprofit = parseFloat(usddr) - parseFloat(usdcr);
|
|
|
|
|
//var otprofit = parseFloat(otdr) - parseFloat(otcr);
|
|
|
|
|
//var ttlprofit = parseFloat(ttldr) - parseFloat(ttlcr);
|
|
|
|
|
//var notaxrmbprofit = parseFloat(notaxrmbdr) - parseFloat(notaxrmbcr);
|
|
|
|
|
//var notaxusdprofit = parseFloat(notaxusddr) - parseFloat(notaxusdcr);
|
|
|
|
|
//var notaxotprofit = parseFloat(notaxotdr) - parseFloat(notaxotcr);
|
|
|
|
|
//var notaxttlprofit = parseFloat(notaxttldr) - parseFloat(notaxttlcr);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setTotalHead();
|
|
|
|
|
|
|
|
|
|
//this.setTotalHead();
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|