Ext.namespace('Shipping');
Shipping.FeeEditGrid = function (config) {
Ext.applyIf(this, config);
this.initUIComponents();
window.Shipping.FeeEditGrid.superclass.constructor.call(this);
};
Ext.extend(Shipping.FeeEditGrid, Ext.Panel, {
ParentWin: null, //弹出式
ParentPanel: null, //Tab页编辑模式
OpStatus: 'add',
StoreBill: null,
StoreCustType: null,
EditRecord: null,
RefBillNo: '*',
DataLoading: true,
stroplb: '',
strbltype: '',
strBSNO: '',
strPBSNO: '',
strMBLNO: '',
WMSOUTBSNO: '',
feeType: 0,
SelectFeeGid: '',
amendfee:'',
// region: 'center',
initUIComponents: function () {
this.feeDrSerialNo = 0;
this.feeDrBodyDel = [];
this.feeCrSerialNo = 0;
this.feeCrBodyDel = [];
this.CustTypeMust = 0;
this.FeeFrtMust = 0;
this.FEELOCKNOTPR=0;
this.AMENDSELFWORKFLOW = 0;
this.FEENOTPR=false;
this.FEEMANGERMUSTBE=0;
this.MODIFYCUSTBFFEELOCK=0;
this.FEENEWSAMECUST = 0;
this.StoreDrOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeOP',
proxy: { url: '/MvcShipping/MsChFee/GetFeeOpRang' }
});
this.StoreCrOpRange = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeOP',
proxy: { url: '/MvcShipping/MsChFee/GetFeeOpRang' }
});
this.storeBodyList_GuDingFeeWeiHu = Ext.create('Ext.data.Store', {
model: 'MsInfoClientFeeDetailModel',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsInfoClient/GetGDFYWHList',
reader: {
id: 'GID',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.StoreCustType = Ext.create('Ext.data.Store', {
fields: ['SCUSTTYPE', 'CUSTTYPE', 'CUSTNAME']
});
this.StoreCustTypeCr = Ext.create('Ext.data.Store', {
fields: ['SCUSTTYPE', 'CUSTTYPE', 'CUSTNAME']
});
this.StoreCustTypeModify = Ext.create('Ext.data.Store', {
fields: ['SCUSTTYPE', 'CUSTTYPE', 'CUSTNAME']
});
this.StoreCustType.on('datachanged', function (store) {
_thisfee.StoreCustTypeCr.loadData(_thisfee.StoreCustType.data.items);
_thisfee.StoreCustTypeModify.loadData(_thisfee.StoreCustType.data.items);
}, this);
_thisfee = this;
this.comboxCustType = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCustType,
forceSelection: true,
name: 'CustomerType',
valueField: 'CUSTTYPE',
displayField: 'SCUSTTYPE'
});
this.comboxCustTypeCr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCustTypeCr,
forceSelection: true,
name: 'CustomerType',
valueField: 'CUSTTYPE',
displayField: 'SCUSTTYPE'
//,
//listeners: {
// scope: this,
// 'focus': function (combo, records, eOpts) {
// if (_thisfee.StoreCustTypeCr.getCount()==0)
// _thisfee.StoreCustTypeCr.loadData(_thisfee.StoreCustType.data.items);
// }
//}
});
this.StoreFeeFrt = Ext.create('Ext.data.Store', {
fields: ['Frt']
});
this.StoreFeeFrt.add({ "Frt": "PP" });
this.StoreFeeFrt.add({ "Frt": "CC" });
this.comboxFeeFrt = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreFeeFrt,
forceSelection: true,
name: 'FeeFrt',
valueField: 'Frt',
displayField: 'Frt'
});
this.comboxFeeFrtCr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreFeeFrt,
forceSelection: true,
name: 'FeeFrt',
valueField: 'Frt',
displayField: 'Frt'
});
this.storeFeeNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.FeeTypeRefModel',
proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' }
});
this.comboxFeeNameRef = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeNameRef,
forceSelection: true,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName'
});
this.comboxFeeENameRef = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeNameRef,
forceSelection: true,
name: 'FeeDescription',
valueField: 'Description',
displayField: 'Description'
});
this.storeFeeNameRefCr = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.FeeTypeRefModel',
proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' }
});
this.storeFeeNameRef.on('load', function (store, records) {
if (store.getCount() > 0) {
_thisfee.storeFeeNameRefCr.add(records);
}
}, this);
this.comboxFeeNameRefCr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeNameRefCr,
forceSelection: true,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName'
});
this.comboxFeeENameRefCr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeNameRefCr,
forceSelection: true,
name: 'FeeDescription',
valueField: 'Description',
displayField: 'Description'
});
this.storeCustomerNameRef = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' }
});
this.storeCustomerNameRefDr = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' }
});
this.storeCustomerNameRefCr = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' }
});
this.storeCustomerNameRef.load();
// this.storeCustomerNameRef.load({ params: { condition: "" },
// callback: function (r, options, success) {
// if (success) {
// _thisfee.storeCustomerNameRefCr.add(r);
// }
// }
// });
this.comboxCustomerNameRef = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCustomerNameRefDr,
forceSelection: true,
queryMode: 'remote',
minChars : 1,
queryParam: 'CODENAME',
name: 'CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.comboxCustomerNameRefCr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCustomerNameRefCr,
forceSelection: true,
queryMode: 'remote',
minChars : 1,
queryParam: 'CODENAME',
name: 'CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.StoreUnit = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeUnit',
proxy: { url: '/MvcShipping/MsChFee/GetCtnUnitList' }
});
this.StoreUnitCr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeUnit',
proxy: { url: '/MvcShipping/MsChFee/GetCtnUnitList' }
});
this.StoreUnit.on('load', function (store, records) {
if (store.getCount() > 0) {
_thisfee.StoreUnitCr.add(records);
}
}, this);
this.comboxUnit = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreUnit,
name: 'Unit',
valueField: 'UNIT',
displayField: 'SUNIT'
});
this.comboxUnitCr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreUnitCr,
name: 'Unit',
valueField: 'UNIT',
displayField: 'SUNIT'
});
this.StoreDateCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeDateCurrList' }
});
this.StoreCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' }
});
this.StoreCurrCr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' }
});
this.StoreCurr.load({ params: { condition: "" },
callback: function (r, options, success) {
if (success) {
_thisfee.StoreCurrCr.add(r);
}
}
});
this.comboxCurr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCurr,
forceSelection: true,
name: 'Currency',
valueField: 'CURR',
displayField: 'CURR'
});
this.comboxCurrCr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCurrCr,
forceSelection: true,
name: 'Currency',
valueField: 'CURR',
displayField: 'CURR'
});
this.storeManagerDr = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.storeManagerDr.load({ params: { condition: ""} });
this.comboxMANAGERDr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeManagerDr,
forceSelection: true,
name: 'MANAGER',
valueField: 'GID',
displayField: 'CodeAndName'
});
this.storeManagerCr = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.storeManagerCr.load({ params: { condition: ""} });
this.comboxMANAGERCr = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeManagerCr,
forceSelection: true,
name: 'MANAGER',
valueField: 'GID',
displayField: 'CodeAndName',
value: SHOWNAME
});
//明细表-数据集
this.storeDrChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetDataList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeCrChFee = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetDataList',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeChFeeGain = Ext.create('Ext.data.Store', {
model: 'MsChFeeGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetGainData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeChFeeMasterGain = Ext.create('Ext.data.Store', {
model: 'MsChFeeGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetMasterGainData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.storeChFeeModify = Ext.create('Ext.data.Store', {
model: 'MsChFee',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetModifyData',
reader: {
id: 'GId',
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.cellEditingDrChFee = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.feeDrGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
this.initgirdDrcolums = [{
sortable: true,
dataIndex: 'GId',
header: Zi.LAN.FEE.GID2, //'惟一编号',
hidden: true,
width: 160
}, {
sortable: true,
dataIndex: 'BsNo',
header: Zi.LAN.FEE.BSNO2, //'业务编号',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'FeeStatus',
header: Zi.LAN.FEE.FEESTATUS, //'费用状态',
renderer: function (value, p, record) {
return record.data.FeeStatus_Ref;
},
width: 66
}, {
sortable: true,
dataIndex: 'FeeName',
header: Zi.LAN.FEE.FeeName, //'应收费用名称',
editor: this.comboxFeeNameRef,
width: 90
}, {
sortable: true,
dataIndex: 'CustomerType',
header: Zi.LAN.FEE.CustomerType, //'客户类别',
editor: this.comboxCustType,
// hidden: true,
width: 75
}, {
sortable: true,
dataIndex: 'CustomerName',
header: Zi.LAN.FEE.CUSTOMERNAME, //'结算对象',
editor: this.comboxCustomerNameRef,
width: 110
}, {
sortable: true,
dataIndex: 'CustomerFullName',
header: Zi.LAN.FEE.CUSTOMERFULLNAME, //'结算对象',
width: 160
}, {
sortable: true,
dataIndex: 'Unit',
header: Zi.LAN.FEE.Unit, //'单位标准',
editor: this.comboxUnit,
width: 60
}, {
sortable: true,
dataIndex: 'UnitPrice',
header: Zi.LAN.FEE.UnitPrice, //'不含税单价',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
decimalPrecision: 4,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(1, 8)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(1, 8)
}
}
}
},
// renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
// try {
// var lsValue = usMoney(value, 4, '', false);
// if (lsValue != "NaN") {
// value = lsValue; if (parseFloat(lsValue) < 0) {
// return '' + lsValue + '';
// }
// }
// else {
// return value;
// }
// }
// catch (e) {
// return value;
// }
// return value;
// },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TaxRate',
header: Zi.LAN.FEE.TaxRate, //'税率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(1, 9)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(1, 9)
}
}
}
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'TaxUnitPrice',
header: Zi.LAN.FEE.TaxUnitPrice, //'单价',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
decimalPrecision: 4,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(1, 10)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(1, 10)
}
}
}
},
// renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
// try {
// var lsValue = usMoney(value, 4, '', false);
// if (lsValue != "NaN") {
// value = lsValue; if (parseFloat(lsValue) < 0) {
// return '' + lsValue + '';
// }
// }
// else {
// return value;
// }
// }
// catch (e) {
// return value;
// }
// return value;
// },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Quantity',
header: Zi.LAN.FEE.Quantity, //'数量',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
allowDecimals: true,
decimalPrecision: 8,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(1, 11)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(1, 11)
}
}
}
},
width: 60
}, {
sortable: true,
dataIndex: 'NoTaxAmount',
header: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(1, 12)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(1, 12)
}
}
}
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Amount',
header: Zi.LAN.FEE.Amount, //'金额',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(1, 13)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(1, 13)
}
}
}
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Currency',
header: Zi.LAN.FEE.Currency, //'币别',
editor: this.comboxCurr,
width: 40
}, {
sortable: true,
dataIndex: 'ExChangerate',
header: Zi.LAN.FEE.ExChangerate, //'汇率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
decimalPrecision: 6,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(1, 15)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(1, 15)
}
}
}
},
// renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
// try {
// var lsValue = usMoney(value, 6, '', false);
// if (lsValue != "NaN") {
// value = lsValue; if (parseFloat(lsValue) < 0) {
// return '' + lsValue + '';
// }
// }
// else {
// return value;
// }
// }
// catch (e) {
// return value;
// }
// return value;
// },
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'AccTaxRate',
header: Zi.LAN.FEE.AccTaxRate2, //'销项税率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(1, 16)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(1, 16)
}
}
}
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Remark',
header: Zi.LAN.FEE.REMARK, //'备注',
editor: {
xtype: 'textfield',
selectOnFocus: true,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(1, 17)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(1, 17)
}
}
}
},
width: 150
}, {
sortable: true,
dataIndex: 'FeeDescription',
header: Zi.LAN.FEE.FeeDescription, //'费用英文名称',
editor: this.comboxFeeENameRef,
width: 150
}, {
sortable: true,
dataIndex: 'IsOpen',
header: Zi.LAN.FEE.IsOpen, //'是否机密',
hidden: true,
editor: {
xtype: 'checkboxfield',
inputValue: '1',
uncheckedValue: '0'
// selectOnFocus: true
},
renderer: function (value, cellmeta) {
if (value == 'true' || value == '1') {
return "√";
} else return "";
},
width: 60
}, {
sortable: true,
dataIndex: 'IsAdvancedpay',
header: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
editor: {
xtype: 'checkboxfield',
inputValue: '1',
uncheckedValue: '0'
// selectOnFocus: true
},
renderer: function (value, cellmeta) {
if (value == '1') {
return "√";
}
},
width: 60
}, {
sortable: true,
dataIndex: 'IsInvoice',
header: Zi.LAN.FEE.NoIvoice, //'不开发票',
editor: {
xtype: 'checkboxfield',
inputValue: '1',
uncheckedValue: '0'
// selectOnFocus: true
},
renderer: function (value, cellmeta) {
if (value == '1') {
return "√";
}
},
width: 60
}, {
sortable: true,
dataIndex: 'FeeFrt',
header: Zi.LAN.FEE.FeeFrt, //'FRT',
editor: this.comboxFeeFrt,
width: 40
}, {
sortable: true,
dataIndex: 'Commissionrate',
header: Zi.LAN.FEE.Commissionrate, //'佣金比率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(1, 20)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(1, 20)
}
}
}
},
width: 60
}, {
sortable: true,
dataIndex: 'OpName',
header: Zi.LAN.FEE.OpName, //'录入人',
width: 60
}, {
sortable: true,
dataIndex: 'EnterDate',
header: Zi.LAN.FEE.EnterDate, //'录入日期',
// renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Auditoperator',
header: Zi.LAN.FEE.Auditoperator, //'审核人',
width: 60
}, {
sortable: true,
dataIndex: 'AuditDate',
header: Zi.LAN.FEE.AuditDate, //'审核日期',
// renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Settlement',
header: Zi.LAN.FEE.Settlement, //'结算金额',
align: 'right',
width: 80,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'Invoice',
header: Zi.LAN.FEE.Invoice, //'已开票金额',
align: 'right',
width: 80,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
},
// {
// sortable: true,
// dataIndex: 'InvoiceNum',
// header: Zi.LAN.FEE.InvoiceNum, //'发票号码',
// width: 80
// },
{
sortable: true,
dataIndex: 'DebitNo',
header: Zi.LAN.FEE.DebitNo, //'対帐编号',
width: 80
}, {
sortable: true,
dataIndex: 'MODIFIEDUSER',
header: Zi.LAN.FEE.MODIFIEDUSER, //'修改人',
width: 60
}, {
sortable: true,
dataIndex: 'MODIFIEDTIME',
header: Zi.LAN.FEE.MODIFIEDTIME, //'修改日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s'),
width: 130
}, {
sortable: true,
dataIndex: 'OrderInvoice',
header: Zi.LAN.FEE.OrderInvoice, //'发票申请金额',
align: 'right',
width: 80,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
dataIndex: 'UNINVOICE',
header: Zi.LAN.FEE.UNINVOICE, //'未开票金额',
width: 60,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'LOCALCURR',
header: Zi.LAN.FEE.LOCALCURR, //'本地货币',
width: 150
}, {
sortable: true,
dataIndex: 'MANAGER',
header: Zi.LAN.FEE.MANAGER, //'MANAGER',
editor: this.comboxMANAGERDr,
renderer: function (value, p, record) {
return record.data.MANAGERREF;
},
width: 100
}];
this.girdDrcolums = this.initgirdDrcolums;
this.gridDrChFee = new Ext.grid.GridPanel({
store: this.storeDrChFee,
enableHdMenu: false,
region: 'center',
id: 'gridDrChFee',
// allowDeselect:true,
loadMask: { msg: Zi.LAN.FEE.ShuJuJiaZaiZhongQingShaoDeng }, //"数据加载中,请稍等..."
trackMouseOver: true,
disableSelection: false,
plugins: [this.cellEditingDrChFee],
selModel: this.feeDrGridCheckBoxModel,
selType: 'cellmodel',
viewConfig: {
autoFill: true,
enableTextSelection: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('FeeStatus');
var ISSEL = record.get('ISSEL');
if (ISSEL == '1')
return Shipping.FeeGetRowClassFont(feeStatus);
else
return Shipping.FeeGetRowClass(feeStatus);
}
},
tbar: [{ xtype: 'label', text: Zi.LAN.FEE.DRFEESTATUS, //'应收费用',
style: 'font-size:18px',
labelColor: '#000',
//style:'background-color: #4b9bf5',
x: '5%',
y: '5%'
}, {
text: '',
tooltip: Zi.LAN.FEE.btnFeeAddDr, //添加应收费用',
iconCls: "btnadd",
handler: function (button, event) {
this.onAddDetailClick(button, event, 1);
},
scope: this
}, {
text: '复制', //'申请修改',
tooltip: '复制添加', //'申请修改',
id: 'btnFeeCopyDr',
handler: function (button, event) {
this.onCopyAddDetailClick(button, event, 1);
},
scope: this
}, '-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeeSaveDr, //保存应收费用',
iconCls: "btnsave",
handler: function (button, event) {
this.onPostDetailClick(button, event, 1);
},
scope: this
},
'-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeeDelDr, //删除应收费用',
iconCls: "btndelete",
handler: function (button, event) {
this.onDelDetailClick(button, event, 1);
},
scope: this
}, '-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeeCancel, //取消修改',
iconCls: "btncancel",
handler: function (button, event) {
this.onCancelDetailClick(button, event, 1);
},
scope: this
}, '-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeeRefDr, //刷新应收',
iconCls: "btnrefresh",
handler: function (button, event) {
//this.storeDrChFee.load({ params: { billno: this.strBSNO, type: 1, optype: this.stroplb} });
this.LoadDrChFee(button, event);
},
scope: this
}, '-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeePrintDr, //打印应收',
iconCls: "btnprint",
menu:
[
{ text: Zi.LAN.FEE.DaYinYingShouZhangDan, //"打印应收账单",
menu:
[//海运进口应收应付列表
{text: Zi.LAN.FEE.PrintSelectDetailDr, //"所选应收打印",
handler: function (menu, event) {
_thisfee.onPrintSelectDetailClick(menu, event, 1);
}
}, { text: Zi.LAN.FEE.PrintCustDetailDr, //"应收客户打印",
handler: function (menu, event) {
_thisfee.onPrintCustDetailClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.PrintAllDetailDr, //"所有应收打印",
handler: function (menu, event) {
_thisfee.onPrintAllDetailClick(menu, event, 1);
}
}
]
},
'-',
{ text: Zi.LAN.FEE.PrintGain, //"利润核算单打印",
handler: function (menu, event) {
_thisfee.onPrintGainClick(menu, event, 1);
}
}
],
/*
handler: function (button, event) {
this.onPrintDetailClick(button, event, 1);
},
*/
scope: this
}, '-', {
text: Zi.LAN.FEE.btnFeeAuditDr, //'提交审核',
tooltip: Zi.LAN.FEE.btnFeeAuditDr, //'提交审核',
menu:
[
{ text: Zi.LAN.FEE.btnFeeAuditDr, //"提交审核",
handler: function (menu, event) {
_thisfee.onSubmitAuditClick(menu, event, 1);
}
}, { text: Zi.LAN.FEE.SubmitAuditDr, //"应收提交",
handler: function (menu, event) {
_thisfee.onSubmitAuditAllClick(menu, event, 1);
}
}, { text: Zi.LAN.FEE.SubmitAuditBill, //"整票提交",
handler: function (menu, event) {
_thisfee.onSubmitAuditBillClick(menu, event, 1);
}
},{ text: Zi.LAN.FEE.btnFeeAuditOpDr, //"提交审核",
handler: function (menu, event) {
_thisfee.onSubmitAuditOpClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.CancelAuditNew, //"撤销提交",
handler: function (menu, event) {
_thisfee.onCancelAuditNewClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.ShenModify, //"申请修改",
handler: function (menu, event) {
_thisfee.onShenModifyClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.ShenDelete, //"申请删除",
handler: function (menu, event) {
_thisfee.onShenDeleteClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.CancelShen, //"取消申请",
handler: function (menu, event) {
_thisfee.onCancelShenClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.ShenIvoice, //"申请开票",
handler: function (menu, event) {
_thisfee.onShenIvoiceClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.ViewWorkFlow, //"查看工作流",
handler: function (menu, event) {
_thisfee.onViewWorkFlowDetailClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.NewCustNameShow, //"批量修改费用对象",
handler: function (menu, event) {
_thisfee.onCreateNewCustNameClick(menu, event, 1);
}
}, {
text: '禁开发票',
tooltip: '禁开发票',
handler: function (button, event) {
this.onNoIvoiceClick(button, event, 1);
},
scope: this
}, {
text: Zi.LAN.FEE.ViewSort, //'查看信息',
tooltip: Zi.LAN.FEE.ViewSort, //查看信息',
handler: function (button, event) {
this.onViewSortClick(button, event, 1);
},
scope: this
}
// , {
// text: '不开发票',
// tooltip: 不开发票',
// handler: function (button, event) {
// this.onNoIvoiceClick(button, event, 1);
// },
// scope: this
// }, {
// text: '解禁发票',
// tooltip: 解禁发票',
// handler: function (button, event) {
// this.onCancelNoIvoiceClick(button, event, 1);
// },
// scope: this
// }
],
scope: this
}, '-', {
text: Zi.LAN.FEE.ViewDetail, //'查看信息',
tooltip: Zi.LAN.FEE.ViewDetail, //'查看信息',
handler: function (button, event) {
this.onViewDetailClick(button, event, 1);
},
scope: this
}, '-', {
text: Zi.LAN.FEE.btnFeeImpAddDr, //'引入费用',
tooltip: Zi.LAN.FEE.btnFeeImpAddDr, //'引入费用',
menu:
[
{ text: Zi.LAN.FEE.HistryAddDetail, //"历史引入",
handler: function (menu, event) {
_thisfee.onHistryAddDetailClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.TemplateAddDetail, //"引入费用模板",
handler: function (menu, event) {
_thisfee.onTemplateAddDetailClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.SaveFeeTemplate, //"保存为费用模板",
handler: function (menu, event) {
_thisfee.onSaveFeeTemplateClick(menu, event, 1);
}
}, { text: Zi.LAN.FEE.CtnTkAddDetail, //"罐箱费用引入",
handler: function (menu, event) {
_thisfee.onCtnTkAddDetailClick(menu, event, 1);
}
},
'-',
{ text: Zi.LAN.FEE.ShengChengYingFu, //"生成应付",
menu:
[
{ text: Zi.LAN.FEE.AddSelectDetailCr, //"所选生成应付",
handler: function (menu, event) {
_thisfee.onAddSelectDetailClick(menu, event, 2);
}
},
{ text: Zi.LAN.FEE.AddAllDetailCr, //"所有生成应付",
handler: function (menu, event) {
_thisfee.onAddAllDetailClick(menu, event, 2);
}
}
]
},
'-',
{
text: Zi.LAN.FEE.YinYongBaoJia, //"查看报价",
handler: function (menu, event) {
_thisfee.onQuotationClick(menu, event, 2);
}
}
],
/*
handler: function (button, event) {
this.onCopyAddClick(button, event, 1);
},
*/
scope: this
}, '-', {
text: Zi.LAN.FEE.btntest, //"保存列表样式",
menu: [
{ text: Zi.LAN.FEE.SaveGridPanel, //"保存",
handler: function (button, event) {
_thisfee.girdDrcolums = DsTruck.SaveGridPanel(GID, 'FEEDRGRID', _thisfee.gridDrChFee.columns, _thisfee.girdDrcolums, 0, true);
_thisfee.CustSumColumn = DsTruck.SaveGridPanel(GID, 'FEECUSTSUMGRID', _thisfee.gridListCust.columns, _thisfee.CustSumColumn, 0, true);
}
}, { text: Zi.LAN.FEE.SaveGridPanel2, //"初始化",
handler: function (menu, event) {
_thisfee.gridDrChFee.reconfigure(this.storeList, _thisfee.initgirdDrcolums);
_thisfee.girdDrcolums = DsTruck.SaveGridPanel(GID, 'FEEDRGRID', _thisfee.gridDrChFee.columns, _thisfee.initgirdDrcolums, 0, true);
}
}],
scope: this
}, {
xtype: 'label',
// flex: 0.4,
id: 'DRSELECTSTR',
html: ""
}
//, '-', {
// id: 'btnSubmitFee2',
// text: '开票链接', //锁定
// tooltip: Zi.LAN.SubmitFee,
// handler: function (button, event) {
// this.onSubmitFeeClick();
// },
// scope: this
//}
],
columns: this.girdDrcolums
});
this.girdDrcolums = DsTruck.GetGridPanel(GID, 'FEEDRGRID', this.girdDrcolums, 0); //使用者id,表名,中间column数组,跳过一开始的几列
// this.gridDrChFee.reconfigure(this.storeDrChFee, this.girdDrcolums);
this.gridDrChFee.on('edit', function (editor, e, eOpts) {
this.gridListChFeeAfterEdit(editor, e, eOpts);
}, this);
this.cellEditingDrChFee.on('beforeedit', function (editor, e) {
return this.cellEditingChFeeBeforeEdit(editor, e);
}, this);
this.cellEditingCrChFee = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.feeCrGridCheckBoxModel = Ext.create('Ext.selection.CheckboxModel');
_thisfee = this;
this.initgirdCrcolums = [{
sortable: true,
dataIndex: 'GId',
header: Zi.LAN.FEE.GID2, //'惟一编号',
hidden: true,
width: 160
}, {
sortable: true,
dataIndex: 'BsNo',
header: Zi.LAN.FEE.BSNO2, //'业务编号',
hidden: true,
width: 200
}, {
sortable: true,
dataIndex: 'FeeStatus',
header: Zi.LAN.FEE.FEESTATUS, //'费用状态',
renderer: function (value, p, record) {
return record.data.FeeStatus_Ref;
},
width: 66
}, {
sortable: true,
dataIndex: 'FeeName',
header: Zi.LAN.FEE.FeeName2, //'应付费用名称',
editor: this.comboxFeeNameRefCr,
width: 100
}, {
sortable: true,
dataIndex: 'CustomerType',
header: Zi.LAN.FEE.CustomerType, //'客户类别',
editor: this.comboxCustTypeCr,
// hidden: true,
width: 80
}, {
sortable: true,
dataIndex: 'CustomerName',
header: Zi.LAN.FEE.CUSTOMERNAME, //'结算对象',
editor: this.comboxCustomerNameRefCr,
width: 120
}, {
sortable: true,
dataIndex: 'CustomerFullName',
header: Zi.LAN.FEE.CUSTOMERFULLNAME, //'结算对象',
width: 160
}, {
sortable: true,
dataIndex: 'Unit',
header: Zi.LAN.FEE.Unit, //'单位标准',
editor: this.comboxUnitCr,
width: 60
}, {
sortable: true,
dataIndex: 'UnitPrice',
header: Zi.LAN.FEE.UnitPrice, //'不含税单价',
editor: {
xtype: 'numberfield',
allowDecimals: true,
//这里允许保留3位小数,所以你输入11.996就不会进位了
decimalPrecision: 6,
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textField, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(2, 8)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(2, 8)
}
}
}
},
// renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
// try {
// var lsValue = usMoney(value, 6, '', false);
// if (lsValue != "NaN") {
// value = lsValue; if (parseFloat(lsValue) < 0) {
// return '' + lsValue + '';
// }
// }
// else {
// return value;
// }
// }
// catch (e) {
// return value;
// }
// return value;
// },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TaxRate',
header: Zi.LAN.FEE.TaxRate, //'税率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textField, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(2, 9)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(2, 9)
}
}
}
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'TaxUnitPrice',
header: Zi.LAN.FEE.TaxUnitPrice, //'单价',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
decimalPrecision: 4,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textField, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(2, 10)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(2, 10)
}
}
}
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Quantity',
header: Zi.LAN.FEE.Quantity, //'数量',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
allowDecimals: true,
decimalPrecision: 8,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textfield, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(2, 11)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(2, 11)
}
}
}
},
width: 60
}, {
sortable: true,
dataIndex: 'NoTaxAmount',
header: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
enableKeyEvents: true,
hideTrigger: true,
mouseWheelEnabled: false,
listeners: {
keydown: function (textField, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(2, 12)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(2, 12)
}
}
}
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Amount',
header: Zi.LAN.FEE.Amount, //'金额',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textField, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(2, 13)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(2, 13)
}
}
}
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Currency',
header: Zi.LAN.FEE.Currency, //'币别',
editor: this.comboxCurrCr,
width: 40
}, {
sortable: true,
dataIndex: 'ExChangerate',
header: Zi.LAN.FEE.ExChangerate, //'汇率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
decimalPrecision: 6,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textField, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(2, 15)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(2, 15)
}
}
}
},
// renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 6, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 60
}, {
sortable: true,
dataIndex: 'AccTaxRate',
header: Zi.LAN.FEE.AccTaxRate, //'进项税率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
hideTrigger: true,
mouseWheelEnabled: false,
enableKeyEvents: true,
listeners: {
keydown: function (textField, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(2, 16)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(2, 16)
}
}
}
},
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'Remark',
header: Zi.LAN.FEE.REMARK, //'备注',
editor: {
xtype: 'textfield',
selectOnFocus: true,
enableKeyEvents: true,
listeners: {
keydown: function (textField, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(2, 17)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(2, 17)
}
}
}
},
width: 150
}, {
sortable: true,
dataIndex: 'FeeDescription',
header: Zi.LAN.FEE.FeeDescription, //'费用英文名称',
editor: this.comboxFeeENameRefCr,
width: 150
}, {
sortable: true,
dataIndex: 'IsAdvancedpay',
header: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
editor: {
xtype: 'checkboxfield',
inputValue: '1',
uncheckedValue: '0'
// selectOnFocus: true
},
renderer: function (value, cellmeta) {
if (value == '1') {
return "√";
}
},
width: 60
}, {
sortable: true,
dataIndex: 'IsOpen',
header: Zi.LAN.FEE.IsOpen, //'是否机密',
hidden: true,
editor: {
xtype: 'checkboxfield',
inputValue: '1',
uncheckedValue: '0'
// selectOnFocus: true
},
renderer: function (value, cellmeta) {
if (value == '1') {
return "√";
}
},
width: 60
}, {
sortable: true,
dataIndex: 'IsInvoice',
header: Zi.LAN.FEE.NoIvoice, //'不开发票',
editor: {
xtype: 'checkboxfield',
inputValue: '1',
uncheckedValue: '0'
// selectOnFocus: true
},
renderer: function (value, cellmeta) {
if (value == '1') {
return "√";
}
},
width: 60
}, {
sortable: true,
dataIndex: 'FeeFrt',
header: Zi.LAN.FEE.FeeFrt, //'FRT',
editor: this.comboxFeeFrtCr,
width: 40
}, {
sortable: true,
dataIndex: 'Commissionrate',
header: Zi.LAN.FEE.Commissionrate, //'佣金比率',
editor: {
xtype: 'numberfield',
keyNavEnabled: false,
selectOnFocus: true,
enableKeyEvents: true,
hideTrigger: true,
mouseWheelEnabled: false,
listeners: {
keydown: function (textField, e) {
if (e.getKey() == 40) {
_thisfee.onNextKeyClick(2, 21)
} else if (e.getKey() == 38) {
_thisfee.onUpKeyClick(2, 21)
}
}
}
},
width: 60
}, {
sortable: true,
dataIndex: 'OpName',
header: Zi.LAN.FEE.OpName, //'录入人',
width: 60
}, {
sortable: true,
dataIndex: 'EnterDate',
header: Zi.LAN.FEE.EnterDate, //'录入日期',
// renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Auditoperator',
header: Zi.LAN.FEE.Auditoperator, //'审核人',
width: 60
}, {
sortable: true,
dataIndex: 'AuditDate',
header: Zi.LAN.FEE.AuditDate, //'审核日期',
// renderer: Ext.util.Format.dateRenderer('Y-m-d'),
width: 80
}, {
sortable: true,
dataIndex: 'Settlement',
header: Zi.LAN.FEE.Settlement, //'结算金额',
align: 'right',
width: 80,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'Invoice',
header: Zi.LAN.FEE.Invoice, //'已开票金额',
align: 'right',
width: 80,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'OrderAmount',
header: Zi.LAN.FEE.OrderAmount, //'申请金额',
align: 'right',
width: 80,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'DebitNo',
header: Zi.LAN.FEE.DebitNo, //'対帐编号',
width: 80
}, {
sortable: true,
dataIndex: 'MODIFIEDUSER',
header: Zi.LAN.FEE.MODIFIEDUSER, //'修改人',
width: 60
}, {
sortable: true,
dataIndex: 'MODIFIEDTIME',
header: Zi.LAN.FEE.MODIFIEDTIME, //'修改日期',
renderer: Ext.util.Format.dateRenderer('Y-m-d H:i:s'),
width: 130
}, {
sortable: true,
dataIndex: 'OrderInvoice',
header: Zi.LAN.FEE.OrderInvoice, //'发票申请金额',
align: 'right',
width: 80,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
dataIndex: 'UNINVOICE',
header: Zi.LAN.FEE.UNINVOICE, //'未开票金额',
width: 60,
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
sortable: true,
dataIndex: 'LOCALCURR',
header: Zi.LAN.FEE.LOCALCURR, //'本地货币',
width: 150
}, {
sortable: true,
dataIndex: 'MANAGER',
header: Zi.LAN.FEE.MANAGER, //'MANAGER',
editor: this.comboxMANAGERCr,
renderer: function (value, p, record) {
return record.data.MANAGERREF;
},
width: 100
}];
this.girdCrcolums = this.initgirdCrcolums;
this.storeProfitType = Ext.create('Ext.data.Store', {
fields: ['DC', 'NAME']
});
this.storeProfitType.add({ "DC": "", "NAME": Zi.LAN.FEE.DRCRPR });
this.storeProfitType.add({ "DC": "NOTAX", "NAME": Zi.LAN.FEE.NORATE });
this.comboxProfitType = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.FEE.PRDP,
store: this.storeProfitType,
valueField: 'DC',
displayField: 'NAME',
labelWidth: 60,
width: 120,
forceSelection: true,
id: 'PROFITTYPE',
name: 'PROFITTYPE',
value: '',
enableKeyEvents: true,
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
_thisfee.setTotalHead();
}
}
}
});
this.gridCrChFee = new Ext.grid.GridPanel({
store: this.storeCrChFee,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.FEE.ShuJuJiaZaiZhongQingShaoDeng },
trackMouseOver: true,
disableSelection: false,
plugins: [this.cellEditingCrChFee],
selModel: this.feeCrGridCheckBoxModel,
selType: 'cellmodel',
viewConfig: {
autoFill: true,
enableTextSelection: true,
getRowClass: function (record, rowIndex, rowParams, store) {
var feeStatus = record.get('FeeStatus');
var ISSEL = record.get('ISSEL');
if (ISSEL == '1')
return Shipping.FeeGetRowClassFont(feeStatus);
else
return Shipping.FeeGetRowClass(feeStatus);
}
},
tbar: [{ xtype: 'label', text: Zi.LAN.FEE.CRFEESTATUS, //'应付费用',
style: 'font-size:18px',
labelColor: '#000',
//style:'background-color: #4b9bf5',
x: '5%',
y: '5%'
}, {
text: '',
tooltip: Zi.LAN.FEE.btnFeeAddCr, //添加应付费用',
iconCls: "btnadd",
handler: function (button, event) {
this.onAddDetailClick(button, event, 2);
},
scope: this
}, {
text: '复制', //'申请修改',
tooltip: '复制添加', //'申请修改',
id: 'btnFeeCopyCr',
handler: function (button, event) {
this.onCopyAddDetailClick(button, event, 2);
},
scope: this
}, '-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeeSaveCr, //保存应付费用',
iconCls: "btnsave",
handler: function (button, event) {
this.onPostDetailClick(button, event, 2);
},
scope: this
},
'-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeeDelCr, //删除应付费用',
iconCls: "btndelete",
handler: function (button, event) {
this.onDelDetailClick(button, event, 2);
},
scope: this
}, '-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeeCancel, //取消修改',
iconCls: "btncancel",
handler: function (button, event) {
this.onCancelDetailClick(button, event, 2);
},
scope: this
}, '-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeeRefCr, //刷新应付',
iconCls: "btnrefresh",
handler: function (button, event) {
//this.storeCrChFee.load({ params: { billno: this.strBSNO, type: 2, optype: this.stroplb} });
this.LoadCrChFee(button, event);
},
scope: this
}, '-', {
text: '',
tooltip: Zi.LAN.FEE.btnFeePrintCr, //打印应付',
iconCls: "btnprint",
menu:
[
{ text: Zi.LAN.FEE.DaYinYingFuZhangDan, //"打印应付账单",
menu:
[
{ text: Zi.LAN.FEE.PrintSelectDetailCr, //"所选应付打印",
handler: function (menu, event) {
_thisfee.onPrintSelectDetailClick(menu, event, 2);
}
}, { text: Zi.LAN.FEE.PrintCustDetailCr, //"应付客户打印",
handler: function (menu, event) {
_thisfee.onPrintCustDetailClick(menu, event, 2);
}
},
{ text: Zi.LAN.FEE.PrintAllDetailCr, //"所有应付打印",
handler: function (menu, event) {
_thisfee.onPrintAllDetailClick(menu, event, 2);
}
}
]
},
'-',
{ text: Zi.LAN.FEE.PrintGain, //"利润核算单打印",
handler: function (menu, event) {
_thisfee.onPrintGainClick(menu, event, 1);
}
}
],
scope: this
}, '-', {
text: Zi.LAN.FEE.btnFeeAuditDr, //'提交审核',
tooltip: Zi.LAN.FEE.btnFeeAuditDr, //'提交审核',
menu:
[
{ text: Zi.LAN.FEE.btnFeeAuditDr, //"提交审核",
handler: function (menu, event) {
_thisfee.onSubmitAuditClick(menu, event, 2);
}
}, { text: Zi.LAN.FEE.SubmitAuditCr, //"应付提交",
handler: function (menu, event) {
_thisfee.onSubmitAuditAllClick(menu, event, 2);
}
}, { text: Zi.LAN.FEE.SubmitAuditBill, //"整票提交",
handler: function (menu, event) {
_thisfee.onSubmitAuditBillClick(menu, event, 2);
}
},{ text: Zi.LAN.FEE.btnFeeAuditOpDr, //"提交审核",
handler: function (menu, event) {
_thisfee.onSubmitAuditOpClick(menu, event, 2);
}
},
{ text: Zi.LAN.FEE.CancelAuditNew, //"撤销提交",
handler: function (menu, event) {
_thisfee.onCancelAuditNewClick(menu, event, 2);
}
}, {
text: Zi.LAN.FEE.ShenModify, //'申请修改',
tooltip: Zi.LAN.FEE.ShenModify, //'申请修改',
handler: function (menu, event) {
this.onShenModifyClick(menu, event, 2);
},
scope: this
}, {
text: Zi.LAN.FEE.ShenDelete, //'申请删除',
tooltip: Zi.LAN.FEE.ShenDelete, //'申请删除',
handler: function (menu, event) {
this.onShenDeleteClick(menu, event, 2);
},
scope: this
}, {
text: Zi.LAN.FEE.CancelShen, //'取消申请',
tooltip: Zi.LAN.FEE.CancelShen, //'取消申请',
handler: function (menu, event) {
this.onCancelShenClick(menu, event, 2);
},
scope: this
},
{ text: Zi.LAN.FEE.ShenPay, //"申请开票",
handler: function (menu, event) {
_thisfee.onShenPayClick(menu, event, 2);
}
},
{ text: Zi.LAN.FEE.ViewWorkFlow, //"查看工作流",
handler: function (menu, event) {
_thisfee.onViewWorkFlowDetailClick(menu, event, 2);
}
},
{ text: Zi.LAN.FEE.NewCustNameShow, //"批量修改费用对象",
handler: function (menu, event) {
_thisfee.onCreateNewCustNameClick(menu, event, 2);
}
}, {
text: '禁开发票',
tooltip: '禁开发票',
handler: function (button, event) {
this.onNoIvoiceClick(button, event, 2);
},
scope: this
}, {
text: Zi.LAN.FEE.ViewSort, //'查看信息',
tooltip: Zi.LAN.FEE.ViewSort, //查看信息',
handler: function (button, event) {
this.onViewSortClick(button, event, 2);
},
scope: this
}
// , {
// text: '不开发票',
// tooltip: 不开发票',
// handler: function (menu, event) {
// this.onNoIvoiceClick(menu, event, 2);
// },
// scope: this
// }, {
// text: '解禁发票',
// tooltip: 解禁发票',
// handler: function (menu, event) {
// this.onCancelNoIvoiceClick(menu, event, 2);
// },
// scope: this
// }
],
scope: this
}, '-', {
text: Zi.LAN.FEE.ViewDetail, //'查看信息',
tooltip: Zi.LAN.FEE.ViewDetail, //查看信息',
handler: function (button, event) {
this.onViewDetailClick(button, event, 2);
},
scope: this
}, '-', {
text: Zi.LAN.FEE.btnFeeImpAddDr, //'引入费用',
tooltip: Zi.LAN.FEE.btnFeeImpAddDr, //'引入费用',
menu:
[
{ text: Zi.LAN.FEE.HistryAddDetail, //"历史引入",
handler: function (menu, event) {
_thisfee.onHistryAddDetailClick(menu, event, 2);
}
},
{ text: Zi.LAN.FEE.TemplateAddDetail, //"引入费用模板",
handler: function (menu, event) {
_thisfee.onTemplateAddDetailClick(menu, event, 2);
}
},
{ text: Zi.LAN.FEE.SaveFeeTemplate, //"保存为费用模板",
handler: function (menu, event) {
_thisfee.onSaveFeeTemplateClick(menu, event, 2);
}
}, { text: Zi.LAN.FEE.CtnTkAddDetail, //"罐箱费用引入",
handler: function (menu, event) {
_thisfee.onCtnTkAddDetailClick(menu, event, 2);
}
},
'-',
{ text: Zi.LAN.FEE.ShengChengYingShou, //"生成应收",
menu:
[
{ text: Zi.LAN.FEE.AddSelectDetailDr, //"所选生成应收",
handler: function (menu, event) {
_thisfee.onAddSelectDetailClick(menu, event, 1);
}
},
{ text: Zi.LAN.FEE.AddAllDetailDr, //"所有生成应收",
handler: function (menu, event) {
_thisfee.onAddAllDetailClick(menu, event, 1);
}
}
]
}
],
scope: this
}, '-', {
text: Zi.LAN.FEE.btntest, //"保存列表样式",
menu: [
{ text: Zi.LAN.FEE.SaveGridPanel, //"保存",
handler: function (button, event) {
_thisfee.girdCrcolums = DsTruck.SaveGridPanel(GID, 'FEECRGRID', _thisfee.gridCrChFee.columns, _thisfee.girdCrcolums, 0, true);
_thisfee.CustSumColumn = DsTruck.SaveGridPanel(GID, 'FEECUSTSUMGRID', _thisfee.gridListCust.columns, _thisfee.CustSumColumn, 0, true);
}
}, { text: Zi.LAN.FEE.SaveGridPanel2, //"初始化",
handler: function (menu, event) {
_thisfee.gridCrChFee.reconfigure(this.storeList, _thisfee.initgirdCrcolums);
_thisfee.girdCrcolums = DsTruck.SaveGridPanel(GID, 'FEECRGRID', _thisfee.gridCrChFee.columns, _thisfee.initgirdCrcolums, 0, true);
}
}],
scope: this
}, this.comboxProfitType,{
xtype: 'label',
// flex: 0.4,
id: 'CRSELECTSTR',
html: ""
}],
columns: this.girdCrcolums
});
this.girdCrcolums = DsTruck.GetGridPanel(GID, 'FEECRGRID', this.girdCrcolums, 0); //使用者id,表名,中间column数组,跳过一开始的几列
// this.gridCrChFee.reconfigure(this.storeCrChFee, this.girdCrcolums);
this.gridCrChFee.on('edit', function (editor, e, eOpts) {
this.gridListChFeeAfterEdit(editor, e, eOpts);
}, this);
this.cellEditingCrChFee.on('beforeedit', function (editor, e) {
return this.cellEditingChFeeBeforeEdit(editor, e);
}, this);
//#endregion
Ext.grid.RowNumberer = Ext.extend(Ext.grid.RowNumberer, {
width: 26
});
this.girdDrcolums.unshift(new Ext.grid.RowNumberer());
this.girdCrcolums.unshift(new Ext.grid.RowNumberer());
this.InitDrGrid(this.girdDrcolums);
this.InitCrGrid(this.girdCrcolums);
this.storeBodySum = Ext.create('Ext.data.Store', {
model: 'MsOPGain',
remoteSort: false,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsChFee/GetOPGainList',
reader: {
root: 'data',
totalProperty: 'totalCount'
}
}
});
this.gridSum = new Ext.grid.GridPanel({
store: this.storeBodySum,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.FEE.ShuJuJiaZaiZhongQingShaoDeng },
trackMouseOver: true,
disableSelection: false,
columns: [{
header: Zi.LAN.FEE.CURR, //"总 计",
sortable: false,
align: 'center',
dataIndex: 'CURR',
width: 160
}, {
text: Zi.LAN.FEE.YingShou, //'应 收',
columns: [{
header: Zi.LAN.FEE.NORATE, //'不含税',
dataIndex: 'NORATEDR',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 160
}, {
header: Zi.LAN.FEE.DRCRPR, //'含税',
dataIndex: 'DR',
align: 'right',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
width: 160
}]
}, {
text: Zi.LAN.FEE.YingFu, //'应 付',
columns: [{
header: Zi.LAN.FEE.NORATE, //'不含税',
dataIndex: 'NORATECR',
align: 'right',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
width: 160
}, {
header: Zi.LAN.FEE.DRCRPR, //'含税',
dataIndex: 'CR',
align: 'right',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
width: 160
}]
}, {
text: Zi.LAN.FEE.LiRun, //'利 润',
columns: [{
header: Zi.LAN.FEE.NORATE, //'不含税',
dataIndex: 'NORATEPR',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { if (value=="***") return value;try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
align: 'right',
width: 160
}, {
header: Zi.LAN.FEE.DRCRPR, //'含税',
dataIndex: 'PR',
align: 'right',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) { if (value=="***") return value;try { var lsValue = usMoney(value, 2, '', false); if (lsValue != "NaN") { value = lsValue; if (parseFloat(lsValue) < 0) { return '' + lsValue + ''; } } else { return value; } } catch (e) { return value; } return value; },
width: 160
}]
}
]
});
this.initCustSumColumn = [{
sortable: true,
dataIndex: 'CUSTOMERNAME',
header: Zi.LAN.FEE.CUSTOMERNAME, //'结算对象',
// summaryRenderer: function () {
// return '合计'
// },
width: 110
}, {
sortable: true,
dataIndex: 'RMBDR',
header: Zi.LAN.FEE.RMBDR, //'RMB应收',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
width: 80
}, {
sortable: true,
dataIndex: 'RMBCR',
header: Zi.LAN.FEE.RMBCR, //'RMB应付',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'RMBPROFIT',
header: Zi.LAN.FEE.RMBPROFIT, //'RMB利润',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
if (value == "***") return value;
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDDR',
header: Zi.LAN.FEE.USDDR, //'USD应收',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDCR',
header: Zi.LAN.FEE.USDCR, //'USD应付',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'USDPROFIT',
header: Zi.LAN.FEE.USDPROFIT, //'USD利润',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
if (value == "***") return value;
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTDR',
header: Zi.LAN.FEE.OTDR, //'其他币别应收',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTCR',
header: Zi.LAN.FEE.OTCR, //'其他币别应付',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'OTPROFIT',
header: Zi.LAN.FEE.OTPROFIT, //'其他币别利润',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
if (value == "***") return value;
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
align: 'right',
width: 80
}, {
sortable: true,
dataIndex: 'TTLDR',
header: Zi.LAN.FEE.TTLDR, //'合计应收',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
width: 80
}, {
sortable: true,
dataIndex: 'TTLCR',
header: Zi.LAN.FEE.TTLCR, //'合计应付',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
width: 80
}, {
sortable: true,
dataIndex: 'TTLPROFIT',
header: Zi.LAN.FEE.TTLPROFIT, //'合计利润',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
if (value == "***") return value;
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
align: 'right',
// summaryType: 'sum',
// summaryRenderer: Ext.util.Format.numberRenderer('00.00'),
width: 80
}
];
this.CustSumColumn = this.initCustSumColumn;
//定义Grid
this.gridListCust = new Ext.grid.GridPanel({
store: this.storeChFeeGain,
enableHdMenu: false,
region: 'center',
loadMask: { msg: Zi.LAN.FEE.ShuJuJiaZaiZhongQingShaoDeng },
trackMouseOver: true,
disableSelection: false,
// features: [{
// ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
// }],
columns: this.CustSumColumn,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeChFeeGain,
displayInfo: true,
displayMsg: Zi.LAN.FEE.displayMsg, //'当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: Zi.LAN.FEE.emptyMsg, //"没有数据"
})
});
this.CustSumColumn = DsTruck.GetGridPanel(GID, 'FEECUSTSUMGRID', this.CustSumColumn, 0);
this.gridListCust.reconfigure(this.storeChFeeGain, this.CustSumColumn);
this.panelCustSum = new Ext.Panel({
title: Zi.LAN.FEE.CustSum, //'客户合计',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
//containerScroll: true,
frame: false,
items: [this.gridListCust]
});
//#region 主票费用合计
this.MasterSumColumn = this.initCustSumColumn;
//定义Grid
this.gridListMaster = new Ext.grid.GridPanel({
store: this.storeChFeeMasterGain,
enableHdMenu: false,
columnLines: true,
region: 'center',
loadMask: { msg: Zi.LAN.FEE.ShuJuJiaZaiZhongQingShaoDeng },
trackMouseOver: true,
viewConfig: {
autoFill: true,
enableTextSelection: true
},
disableSelection: false,
// features: [{
// ftype: 'summary'//Ext.grid.feature.Summary表格汇总特性
// }],
columns: this.MasterSumColumn,
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: this.storeChFeeMasterGain,
displayInfo: true,
displayMsg: Zi.LAN.FEE.displayMsg, //'当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: Zi.LAN.FEE.emptyMsg, //"没有数据"
})
});
this.panelCustMaster = new Ext.Panel({
title: Zi.LAN.FEE.MasterSum, //'客户合计',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
//containerScroll: true,
frame: false,
items: [this.gridListMaster]
});
//#endregion
this.panelCurrSum = new Ext.Panel({
title: Zi.LAN.FEE.CurrSum, //'币别合计',
layout: "border",
region: 'center',
animate: true,
autoScroll: true,
//containerScroll: true,
frame: false,
items: [this.gridSum]
});
this.tabTotal = new Ext.TabPanel({
activeTab: 0,
autoWidth: true,
border: true,
frame: false,
region: 'south',
height: 210,
enableHdMenu: false,
// region: 'center',
title: Zi.LAN.FEE.LiRunTongJi, //"利润统计",
collapsed: true,
collapsible: true,
split: true,
enableTabScroll: true,
items:
[
this.panelCustSum,
this.panelCurrSum
]
});
// this.formtotal = Ext.widget('form', {
// region: 'south',
// title: "利润统计",
// //height: 150,
// items: [this.tabTotal]
// });
//#region 申请修改和删除界面
this.comboxFeeFrtModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreFeeFrt,
forceSelection: true,
fieldLabel: Zi.LAN.FEE.Frt, //'FRT',
name: 'FeeFrt',
valueField: 'Frt',
displayField: 'Frt'
});
this.storeFeeNameRefModify = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.FeeTypeRefModel',
proxy: { url: '/MvcShipping/MsChFee/GetFeeTypeRefList' }
});
this.storeFeeNameRefModify.load({ params: { condition: ""} });
this.comboxFeeNameRefModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeFeeNameRefModify,
fieldLabel: Zi.LAN.FEE.FeeName3, //'费用名称',
forceSelection: true,
name: 'FeeName',
valueField: 'Name',
displayField: 'CodeAndName'
});
this.storeCustomerNameRefM = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' }
});
// this.storeCustomerNameRefM.load({ params: { condition: ""} });
this.comboxCustomerNameRefModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCustomerNameRefM,
forceSelection: true,
fieldLabel: Zi.LAN.FEE.CUSTOMERNAME, //'结费对象',
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
lazyRender: false,
name: 'CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.comboxUnitModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreUnit,
fieldLabel: Zi.LAN.FEE.Unit, //'单位标准',
name: 'Unit',
valueField: 'UNIT',
displayField: 'SUNIT'
});
this.CheckIsAdvancedpay = new Ext.form.Checkbox({
fieldLabel: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
uncheckedValue: '0',
inputValue: '1',
name: 'IsAdvancedpay'
});
this.comboxCurrModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCurr,
fieldLabel: Zi.LAN.FEE.Currency, //'币别',
forceSelection: true,
name: 'Currency',
valueField: 'CURR',
displayField: 'CURR',
listeners: {
scope: this,
'select': function (combo, records, eOpts) {
if (records.length > 0) {
if (this.DataLoading == true) return;
var CURR = records[0].data.CURR;
var form = _thisfee.NewFeeEdit.getForm();
if (CURR == 'RMB') {
form.findField('ExChangerate').setValue(1);
} else {
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', CURR);
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
var DEFRATE = ffdata.DEFRATE;
form.findField('ExChangerate').setValue(DEFRATE);
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', CURR);
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
var DEFRATE = dfdata.DEFRATE;
form.findField('ExChangerate').setValue(DEFRATE);
} else {
form.findField('ExChangerate').setValue(1);
}
}
}
}
}
}
});
this.storeManagerModify = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.UserRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetUserLinkRefList' }
});
this.storeManagerModify.load({ params: { condition: ""} });
this.comboxMANAGERModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeManagerModify,
fieldLabel: Zi.LAN.FEE.MANAGER, //'费用对象',
forceSelection: true,
name: 'MANAGER',
valueField: 'GID',
displayField: 'CodeAndName'
});
_thisfee = this;
this.comboxCustTypeModify = Ext.create('DsExt.ux.RefTableCombox', {
store: this.StoreCustTypeModify,
fieldLabel: Zi.LAN.FEE.CustomerType,
forceSelection: true,
name: 'CustomerType',
valueField: 'CUSTTYPE',
displayField: 'SCUSTTYPE'
});
this.NewFeeEdit = Ext.widget('form', {
frame: true,
region: 'center',
trackResetOnLoad: true,
title: Zi.LAN.FEE.NewFeeEdit, //'费用新值',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.BSNO2, //'业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.FEE.GID, //'GId',,
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeType, //'FeeType',
name: 'FeeType', flex: 0, hidden: true, margins: '0'
}, this.comboxFeeNameRefModify, this.comboxCustomerNameRefModify, this.comboxUnitModify, this.comboxCustTypeModify]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.UnitPrice, //'不含税单价',
xtype: 'numberfield',
decimalPrecision: 6,
name: 'UnitPrice',
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
var form = _thisfee.NewFeeEdit.getForm();
if (newValue == null || newValue == '') newValue = 0;
var unitPrice = newValue;
var FeeName = form.findField('FeeName').getValue();
var quantity = form.findField('Quantity').getValue();
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (taxrate != null) {
var taxrateb = parseFloat(1 + parseFloat(taxrate / 100));
var TaxUnitPrice = (parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
var notaxamount = (parseFloat(unitPrice).mul(quantity)).toFixed(2);
form.findField('NoTaxAmount').setValue(notaxamount);
taxrate = parseFloat(taxrate) / 100;
var tax = parseFloat(notaxamount).mul(taxrate);
var amount = (parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
form.findField('Amount').setValue(amount);
var FeeType = form.findField('FeeType').getValue();
var ExChangerate = form.findField('ExChangerate').getValue();
var BPROFIT = form.findField('BPROFIT').getValue();
var oldAmount=_thisfee.OldFee.getForm().findField('Amount').getValue();
var oldExChangerate=_thisfee.OldFee.getForm().findField('ExChangerate').getValue();
if (FeeType=='1'){
var aprofit = parseFloat(BPROFIT)-Mul(oldAmount, oldExChangerate)+Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
} else {
var aprofit = parseFloat(BPROFIT)+Mul(oldAmount, oldExChangerate)-Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
}
_thisfee.NewFeeEdit.getForm().findField('APROFIT').setValue(parseFloat(aprofit).toFixed(2));
_thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setValue(parseFloat(difprofit).toFixed(2));
if (difprofit < 0) _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' });
else _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FFFFFF' });
this.DataLoading = false;
}
}
}, {
fieldLabel: Zi.LAN.FEE.TaxRate, //'税率',
xtype: 'numberfield',
decimalPrecision: 6,
name: 'TaxRate',
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
if (newValue == null || newValue == '') newValue = 0;
var form = _thisfee.NewFeeEdit.getForm();
var unitPrice = form.findField('UnitPrice').getValue();
var FeeName = form.findField('FeeName').getValue();
var quantity = form.findField('Quantity').getValue();
var taxrate = newValue;
this.DataLoading = true;
if (unitPrice != null) {
var taxrateb = parseFloat(1 + parseFloat(taxrate / 100));
var TaxUnitPrice = (parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
var notaxamount = form.findField('NoTaxAmount').getValue();
taxrate = parseFloat(taxrate) / 100;
var tax = parseFloat(notaxamount).mul(taxrate);
var amount = (parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
form.findField('Amount').setValue(amount);
var FeeType = form.findField('FeeType').getValue();
var ExChangerate = form.findField('ExChangerate').getValue();
var BPROFIT = form.findField('BPROFIT').getValue();
var oldAmount=_thisfee.OldFee.getForm().findField('Amount').getValue();
var oldExChangerate=_thisfee.OldFee.getForm().findField('ExChangerate').getValue();
if (FeeType=='1'){
var aprofit = parseFloat(BPROFIT)-Mul(oldAmount, oldExChangerate)+Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
} else {
var aprofit = parseFloat(BPROFIT)+Mul(oldAmount, oldExChangerate)-Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
}
_thisfee.NewFeeEdit.getForm().findField('APROFIT').setValue(parseFloat(aprofit).toFixed(2));
_thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setValue(parseFloat(difprofit).toFixed(2));
if (difprofit < 0) _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' });
else _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FFFFFF' });
this.DataLoading = false;
}
}
}, {
fieldLabel: Zi.LAN.FEE.TaxUnitPrice2, //'含税单价',
xtype: 'numberfield',
decimalPrecision: 6,
name: 'TaxUnitPrice',
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
if (newValue == null || newValue == '') newValue = 0;
var form = _thisfee.NewFeeEdit.getForm();
var quantity = form.findField('Quantity').getValue();
var TaxUnitPrice = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (TaxUnitPrice != 0) {
var taxrateb = parseFloat(1 + parseFloat(taxrate / 100));
var unitPrice = (parseFloat(TaxUnitPrice).div(parseFloat(taxrateb))).toFixed(2);
form.findField('UnitPrice').setValue(unitPrice);
}
if (quantity != null) {
var amount = (parseFloat(TaxUnitPrice).mul(quantity)).toFixed(2);
form.findField('Amount').setValue(amount);
var notaxamount = (parseFloat(amount).div(taxrateb)).toFixed(2);
form.findField('NoTaxAmount').setValue(notaxamount);
var FeeType = form.findField('FeeType').getValue();
var ExChangerate = form.findField('ExChangerate').getValue();
var BPROFIT = form.findField('BPROFIT').getValue();
var oldAmount=_thisfee.OldFee.getForm().findField('Amount').getValue();
var oldExChangerate=_thisfee.OldFee.getForm().findField('ExChangerate').getValue();
if (FeeType=='1'){
var aprofit = parseFloat(BPROFIT)-Mul(oldAmount, oldExChangerate)+Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
} else {
var aprofit = parseFloat(BPROFIT)+Mul(oldAmount, oldExChangerate)-Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
}
_thisfee.NewFeeEdit.getForm().findField('APROFIT').setValue(parseFloat(aprofit).toFixed(2));
_thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setValue(parseFloat(difprofit).toFixed(2));
if (difprofit < 0) _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' });
else _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FFFFFF' });
}
this.DataLoading = false;
}
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Quantity2, //'计费数量',
xtype: 'numberfield',
decimalPrecision: 6,
name: 'Quantity',
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
if (newValue == null || newValue == '') newValue = 0;
var form = _thisfee.NewFeeEdit.getForm();
var unitPrice = form.findField('UnitPrice').getValue();
var FeeName = form.findField('FeeName').getValue();
var quantity = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (taxrate != null) {
var taxrateb = parseFloat(1 + parseFloat(taxrate / 100));
var TaxUnitPrice = (parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
var notaxamount = (parseFloat(unitPrice).mul(quantity)).toFixed(2);
form.findField('NoTaxAmount').setValue(notaxamount);
taxrate = parseFloat(taxrate) / 100;
var tax = parseFloat(notaxamount).mul(taxrate);
var amount = (parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
form.findField('Amount').setValue(amount);
var FeeType = form.findField('FeeType').getValue();
var ExChangerate = form.findField('ExChangerate').getValue();
var BPROFIT = form.findField('BPROFIT').getValue();
var oldAmount=_thisfee.OldFee.getForm().findField('Amount').getValue();
var oldExChangerate=_thisfee.OldFee.getForm().findField('ExChangerate').getValue();
if (FeeType=='1'){
var aprofit = parseFloat(BPROFIT)-Mul(oldAmount, oldExChangerate)+Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
} else {
var aprofit = parseFloat(BPROFIT)+Mul(oldAmount, oldExChangerate)-Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
}
_thisfee.NewFeeEdit.getForm().findField('APROFIT').setValue(parseFloat(aprofit).toFixed(2));
_thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setValue(parseFloat(difprofit).toFixed(2));
if (difprofit < 0) _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' });
else _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FFFFFF' });
this.DataLoading = false;
}
}
}, {
fieldLabel: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
xtype: 'numberfield',
name: 'NoTaxAmount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
if (newValue == null || newValue == '') newValue = 0;
var form = _thisfee.NewFeeEdit.getForm();
var notaxamount = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
var quantity = form.findField('Quantity').getValue();
if (quantity != null && quantity != 0) {
var unitPrice = Div(notaxamount, quantity); //(parseFloat(notaxamount).div(parseFloat(quantity))).toFixed(2);
form.findField('UnitPrice').setValue(unitPrice);
var TaxUnitPrice = Div(amount, quantity);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
if (taxrate != null) {
taxrate = parseFloat(taxrate) / 100;
var tax = parseFloat(notaxamount).mul(taxrate);
var amount = (parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
form.findField('Amount').setValue(amount);
var FeeType = form.findField('FeeType').getValue();
var ExChangerate = form.findField('ExChangerate').getValue();
var BPROFIT = form.findField('BPROFIT').getValue();
var oldAmount=_thisfee.OldFee.getForm().findField('Amount').getValue();
var oldExChangerate=_thisfee.OldFee.getForm().findField('ExChangerate').getValue();
if (FeeType=='1'){
var aprofit = parseFloat(BPROFIT)-Mul(oldAmount, oldExChangerate)+Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
} else {
var aprofit = parseFloat(BPROFIT)+Mul(oldAmount, oldExChangerate)-Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
}
_thisfee.NewFeeEdit.getForm().findField('APROFIT').setValue(parseFloat(aprofit).toFixed(2));
_thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setValue(parseFloat(difprofit).toFixed(2));
if (difprofit < 0) _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' });
else _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FFFFFF' });
}
this.DataLoading = false;
}
}
}, {
fieldLabel: Zi.LAN.FEE.Amount2, //'含税金额',
xtype: 'numberfield',
name: 'Amount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
},
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
if (newValue == null || newValue == '') newValue = 0;
var form = _thisfee.NewFeeEdit.getForm();
var amount = newValue;
var taxrate = form.findField('TaxRate').getValue();
this.DataLoading = true;
if (taxrate != null) {
var taxrateb = Add(1, Mul(taxrate, 0.01)); //parseFloat(1 + parseFloat(taxrate.mul(0.01)));
var notaxamount = Div(amount, taxrateb); //(parseFloat(amount).div(taxrateb)).toFixed(2);
form.findField('NoTaxAmount').setValue(notaxamount);
var quantity = form.findField('Quantity').getValue();
if (quantity != null && quantity != 0) {
var unitPrice = Div(notaxamount, quantity); //(parseFloat(notaxamount).div(parseFloat(quantity))).toFixed(2);
form.findField('UnitPrice').setValue(unitPrice);
var TaxUnitPrice = Div(amount, quantity);
form.findField('TaxUnitPrice').setValue(TaxUnitPrice);
}
var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
form.findField('Tax').setValue(tax);
}
var FeeType = form.findField('FeeType').getValue();
var ExChangerate = form.findField('ExChangerate').getValue();
var BPROFIT = form.findField('BPROFIT').getValue();
var oldAmount=_thisfee.OldFee.getForm().findField('Amount').getValue();
var oldExChangerate=_thisfee.OldFee.getForm().findField('ExChangerate').getValue();
if (FeeType=='1'){
var aprofit = parseFloat(BPROFIT)-Mul(oldAmount, oldExChangerate)+Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
} else {
var aprofit = parseFloat(BPROFIT)+Mul(oldAmount, oldExChangerate)-Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
}
_thisfee.NewFeeEdit.getForm().findField('APROFIT').setValue(parseFloat(aprofit).toFixed(2));
_thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setValue(parseFloat(difprofit).toFixed(2));
if (difprofit < 0) _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' });
else _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FFFFFF' });
this.DataLoading = false;
}
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [this.comboxCurrModify, {
fieldLabel: Zi.LAN.FEE.ExChangerate, //'汇率',
labelWidth: 60,
decimalPrecision: 6,
xtype: 'numberfield',
name: 'ExChangerate',
listeners: {
scope: this,
'change': function (ths, newValue, oldValue, eOpts) {
if (this.DataLoading == true) return;
if (newValue == oldValue) return;
if (newValue == null || newValue == '') newValue = 0;
var form = _thisfee.NewFeeEdit.getForm();
var amount = form.findField('Amount').getValue();
var FeeType = form.findField('FeeType').getValue();
var ExChangerate = form.findField('ExChangerate').getValue();
var BPROFIT = form.findField('BPROFIT').getValue();
var oldAmount=_thisfee.OldFee.getForm().findField('Amount').getValue();
var oldExChangerate=_thisfee.OldFee.getForm().findField('ExChangerate').getValue();
if (FeeType=='1'){
var aprofit = parseFloat(BPROFIT)-Mul(oldAmount, oldExChangerate)+Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
} else {
var aprofit = parseFloat(BPROFIT)+Mul(oldAmount, oldExChangerate)-Mul(amount, ExChangerate);
var difprofit = Add(aprofit, -parseFloat(BPROFIT));
}
_thisfee.NewFeeEdit.getForm().findField('APROFIT').setValue(parseFloat(aprofit).toFixed(2));
_thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setValue(parseFloat(difprofit).toFixed(2));
if (difprofit < 0) _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FF0000' });
else _thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setFieldStyle({ background: '#FFFFFF' });
this.DataLoading = false;
}
}
}, {
fieldLabel: Zi.LAN.FEE.Tax, //'汇率',
xtype: 'numberfield',
labelWidth: 40,
decimalPrecision: 6,
name: 'Tax'
}, {
fieldLabel: Zi.LAN.FEE.AccTaxRate3, //'财务税率',
labelWidth: 60,
xtype: 'numberfield',
name: 'AccTaxRate'
}, this.CheckIsAdvancedpay
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Reason3, //'修改原因',
flex: 2,
name: 'Reason'
}, this.comboxMANAGERModify]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.REMARK, //'备注',
name: 'Remark'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.ChangeProBefore,
labelWidth: 70,
readOnly: true,
name: 'BPROFIT',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.ChangeProfit,
labelWidth: 70,
readOnly: true,
name: 'APROFIT',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.ProfitMargin,
labelWidth: 70,
readOnly: true,
name: 'DIFPROFIT',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.OldFee = Ext.widget('form', {
frame: true,
region: 'center',
title: Zi.LAN.FEE.OldFee, //'费用旧值',
trackResetOnLoad: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.BSNO2, //'业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.FEE.GID, //'GId',,
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel:'IsOpen', //'GId',,
name: 'IsOpen', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeName3, //'费用名称',
readOnly: true,
name: 'FeeName'
}, {
fieldLabel: Zi.LAN.FEE.CUSTOMERNAME2, //'费用对象',
readOnly: true,
name: 'CustomerName'
}, {
fieldLabel: Zi.LAN.FEE.Unit, //'单位标准',
readOnly: true,
name: 'Unit'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.UnitPrice, //'不含税单价',
readOnly: true,
name: 'UnitPrice',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.FEE.TaxRate, //'税率',
readOnly: true,
name: 'TaxRate'
}, {
fieldLabel: Zi.LAN.FEE.TaxUnitPrice2, //'含税单价',
readOnly: true,
name: 'TaxUnitPrice',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Quantity2, //'计费数量',
readOnly: true,
name: 'Quantity'
}, {
fieldLabel: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
readOnly: true,
name: 'NoTaxAmount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.FEE.Amount2, //'含税金额',
readOnly: true,
name: 'Amount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Currency, //'币别',
readOnly: true,
name: 'Currency'
}, {
fieldLabel: Zi.LAN.FEE.ExChangerate, //'汇率',
readOnly: true,
labelWidth: 60,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.FEE.AccTaxRate3, //'财务税率',
readOnly: true,
labelWidth: 60,
name: 'AccTaxRate'
}, {
fieldLabel: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
readOnly: true,
name: 'IsAdvancedpay'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.DeleteFee = Ext.widget('form', {
frame: true,
region: 'center',
trackResetOnLoad: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.BSNO2, //'业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.FEE.GID, //'GId',,
name: 'GId', flex: 0, hidden: true, margins: '0'
},{
fieldLabel:'IsOpen', //'GId',,
name: 'IsOpen', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeType, //'FeeType',
name: 'FeeType', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeName3, //'费用名称',
name: 'FeeName', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.CUSTOMERNAME2, //'费用对象',
name: 'CustomerName', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.Unit, //'单位标准',
name: 'Unit', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.UnitPrice, //'不含税单价',
name: 'UnitPrice', flex: 0, hidden: true, margins: '0',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.FEE.TaxRate, //'税率',
name: 'TaxRate', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.TaxUnitPrice2, //'含税单价',
name: 'TaxUnitPrice', flex: 0, hidden: true, margins: '0',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.FEE.Quantity2, //'计费数量',
name: 'Quantity', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
name: 'NoTaxAmount', flex: 0, hidden: true, margins: '0',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.FEE.Amount2, //'含税金额',
name: 'Amount', flex: 0, hidden: true, margins: '0',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.FEE.Currency, //'币别',
name: 'Currency', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.ExChangerate, //'汇率',
name: 'ExChangerate', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.AccTaxRate3, //'财务税率',
name: 'AccTaxRate', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
name: 'IsAdvancedpay', flex: 0, hidden: true, margins: '0'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Reason2, //'删除原因',
name: 'Reason'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.NewFeeShowDr = Ext.widget('form', {
frame: true,
region: 'south',
height: 210,
hidden: true,
title: Zi.LAN.FEE.NewFeeShow, //'费用修改新值',
trackResetOnLoad: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.BSNO2, //'业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.FEE.GID, //'GId',,
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeName3, //'费用名称',
readOnly: true,
name: 'FeeName'
}, {
fieldLabel: Zi.LAN.FEE.CUSTOMERNAME2, //'费用对象',
readOnly: true,
name: 'CustomerName'
}, {
fieldLabel: Zi.LAN.FEE.Unit, //'单位标准',
readOnly: true,
name: 'Unit'
}, {
fieldLabel: Zi.LAN.FEE.CustomerType, //'单位标准',
readOnly: true,
name: 'CustomerType'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.UnitPrice, //'不含税单价',
readOnly: true,
name: 'UnitPrice'
}, {
fieldLabel: Zi.LAN.FEE.TaxRate, //'税率',
readOnly: true,
name: 'TaxRate'
}, {
fieldLabel: Zi.LAN.FEE.TaxUnitPrice2, //'含税单价',
readOnly: true,
name: 'TaxUnitPrice'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Quantity2, //'计费数量',
readOnly: true,
name: 'Quantity'
}, {
fieldLabel: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
readOnly: true,
name: 'NoTaxAmount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.FEE.Amount2, //'含税金额',
readOnly: true,
name: 'Amount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Currency, //'币别',
readOnly: true,
name: 'Currency'
}, {
fieldLabel: Zi.LAN.FEE.ExChangerate, //'汇率',
readOnly: true,
labelWidth: 60,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.FEE.AccTaxRate3, //'财务税率',
readOnly: true,
labelWidth: 60,
name: 'AccTaxRate'
}, {
fieldLabel: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
readOnly: true,
name: 'IsAdvancedpay'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Reason3, //'修改原因',
readOnly: true,
name: 'Reason'
}, {
fieldLabel: Zi.LAN.FEE.REMARK, //'备注',
readOnly: true,
name: 'Remark'
}]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.NewFeeShowCr = Ext.widget('form', {
frame: true,
region: 'south',
height: 210,
hidden: true,
title: Zi.LAN.FEE.NewFeeShow, //'费用修改新值',
trackResetOnLoad: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.BSNO2, //'业务编号',
name: 'BsNo', hidden: true
}, {
fieldLabel: Zi.LAN.FEE.GID, //'GId',,
name: 'GId', flex: 0, hidden: true, margins: '0'
}, {
fieldLabel: Zi.LAN.FEE.FeeName3, //'费用名称',
readOnly: true,
name: 'FeeName'
}, {
fieldLabel: Zi.LAN.FEE.CUSTOMERNAME2, //'费用对象',
readOnly: true,
name: 'CustomerName'
}, {
fieldLabel: Zi.LAN.FEE.Unit, //'单位标准',
readOnly: true,
name: 'Unit'
}, {
fieldLabel: Zi.LAN.FEE.CustomerType, //'单位标准',
readOnly: true,
name: 'CustomerType'
}]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.UnitPrice, //'不含税单价',
readOnly: true,
name: 'UnitPrice'
}, {
fieldLabel: Zi.LAN.FEE.TaxRate, //'税率',
readOnly: true,
name: 'TaxRate'
}, {
fieldLabel: Zi.LAN.FEE.TaxUnitPrice2, //'含税单价',
readOnly: true,
name: 'TaxUnitPrice'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Quantity2, //'计费数量',
readOnly: true,
name: 'Quantity'
}, {
fieldLabel: Zi.LAN.FEE.NoTaxAmount, //'不含税金额',
readOnly: true,
name: 'NoTaxAmount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}, {
fieldLabel: Zi.LAN.FEE.Amount2, //'含税金额',
readOnly: true,
name: 'Amount',
renderer: function (value, cellmeta, record, rowIndex, columnIndex, store) {
try {
var lsValue = usMoney(value, 2, '', false);
if (lsValue != "NaN") {
value = lsValue; if (parseFloat(lsValue) < 0) {
return '' + lsValue + '';
}
}
else {
return value;
}
}
catch (e) {
return value;
}
return value;
}
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Currency, //'币别',
readOnly: true,
name: 'Currency'
}, {
fieldLabel: Zi.LAN.FEE.ExChangerate, //'汇率',
readOnly: true,
labelWidth: 60,
name: 'ExChangerate'
}, {
fieldLabel: Zi.LAN.FEE.Tax, //'汇率',
xtype: 'numberfield',
labelWidth: 40,
decimalPrecision: 6,
name: 'Tax'
}, {
fieldLabel: Zi.LAN.FEE.AccTaxRate3, //'财务税率',
readOnly: true,
labelWidth: 60,
name: 'AccTaxRate'
}, {
fieldLabel: Zi.LAN.FEE.IsAdvancedpay, //'是否垫付',
readOnly: true,
name: 'IsAdvancedpay'
}
]
}, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel: Zi.LAN.FEE.Reason3, //'修改原因',
readOnly: true,
name: 'Reason'
}, {
fieldLabel: Zi.LAN.FEE.REMARK, //'备注',
readOnly: true,
name: 'Remark'
}]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
me = this;
this.winShenModifyShow = Ext.create('Ext.window.Window', {
title: Zi.LAN.FEE.winShenModifyShow, //"费用申请修改",
region: 'south',
height: 440,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
layout: "anchor",
items: [this.OldFee, this.NewFeeEdit],
buttons: [{
text: Zi.LAN.FEE.TiJiaoShenQing, //"提交申请",
minWidth: 70,
handler: function () {
var form = me.NewFeeEdit.getForm();
var FeeName = form.findField('FeeName').getValue();
if (FeeName == '' || FeeName == null || FeeName == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var CustomerName = form.findField('CustomerName').getValue();
if (CustomerName == '' || CustomerName == null || CustomerName == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JieFeiDuiXiangBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//结费对象不能为空!
return;
};
var TaxRate = form.findField('TaxRate').getValue();
if (TaxRate == null || TaxRate == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.ShuiLvBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = form.findField('Currency').getValue();
if (Currency == '' || Currency == null || Currency == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//币别不能为空!
return;
};
var ExChangerate = form.findField('ExChangerate').getValue();
if (ExChangerate == '' || ExChangerate == null || ExChangerate == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var REASON = form.findField('Reason').getValue();
if (REASON == '' || REASON == null || REASON == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.XiuGaiYuanYinBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var type = form.findField('FeeType').getValue();
me.onCreateModifyClick(type);
}
}, {
text: Zi.LAN.FEE.CancelShen, //"取消申请",
minWidth: 70,
handler: function () {
me.winShenModifyShow.close();
}
}]
});
this.winShenDeleteShow = Ext.create('Ext.window.Window', {
title: Zi.LAN.FEE.winShenDeleteShow, //"费用申请删除",
region: 'south',
height: 210,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
layout: "anchor",
items: [this.DeleteFee],
buttons: [{
text: Zi.LAN.FEE.TiJiaoShenQing, //"提交申请",
minWidth: 70,
handler: function () {
var form = me.DeleteFee.getForm();
var REASON = form.findField('Reason').getValue();
if (REASON == '' || REASON == null || REASON == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.ShanChuYuanYinBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var type = form.findField('FeeType').getValue();
me.onCreateDeleteClick(type);
}
}, {
text: Zi.LAN.FEE.CancelShen, //"取消申请",
minWidth: 70,
handler: function () {
me.winShenDeleteShow.close();
}
}]
});
this.AuditBackReasonDr = Ext.widget('form', {
frame: true,
region: 'south',
height: 210,
trackResetOnLoad: true,
hidden: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.FEE.Reason4, //'驳回原因',
height: 70,
name: 'Reason',
anchor: '100%'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.AuditBackReasonCr = Ext.widget('form', {
frame: true,
region: 'south',
height: 210,
trackResetOnLoad: true,
hidden: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
xtype: 'textareafield',
grow: true,
fieldLabel: Zi.LAN.FEE.Reason4, //'驳回原因',
height: 70,
name: 'Reason',
anchor: '100%'
}
]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.storeCustomerNameRefM2 = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListRm' }
});
this.comboxCustomerNameRefModify2 = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeCustomerNameRefM2,
forceSelection: true,
fieldLabel: Zi.LAN.FEE.CUSTOMERNAME, //'结费对象',
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
lazyRender: false,
name: 'CustomerName',
valueField: 'CustName',
displayField: 'CodeAndName'
});
this.NewCustNameShow = Ext.widget('form', {
frame: true,
region: 'north',
// title: Zi.LAN.FEE.NewCustNameShow, //'批量更改费用对象',
height: 100,
trackResetOnLoad: true,
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 90,
msgTarget: 'qtip'
},
items: [
{//fieldset 1
xtype: 'container',
defaultType: 'textfield',
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [{
fieldLabel:'type', //'业务编号',
name: 'type', hidden: true
},this.comboxCustomerNameRefModify2]
}
]//end items(fieldset 1)
}//end fieldset 1
]//end root items
});
this.winNewCustNameShow = Ext.create('Ext.window.Window', {
title: Zi.LAN.FEE.NewCustNameShow, //"费用申请删除",
width: 300,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.NewCustNameShow],
buttons: [{
text: Zi.LAN.FEE.TiJiaoShenQing, //"提交申请",
minWidth: 70,
handler: function () {
var form = _thisfee.NewCustNameShow.getForm();
var CustomerName = form.findField('CustomerName').getValue();
if (CustomerName == '' || CustomerName == null || CustomerName == undefined) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.CustNameIsNotNull, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//删除原因不能为空!
return;
};
_thisfee.CreateNewCustName();
}
}, {
text: Zi.LAN.FEE.btnFeeCancel, //"取消申请",
minWidth: 70,
handler: function () {
_thisfee.winNewCustNameShow.close();
}
}]
});
//#endregion
this.panelDrChFee = new Ext.Panel({
//title: '应收费用',
layout: "border",
flex: 1,
frame: true,
split: true,
region: 'west',
width: 520,
items: [this.gridDrChFee, this.NewFeeShowDr, this.AuditBackReasonDr]
});
this.panelCrChFee = new Ext.Panel({
//title: '应付费用',
layout: "border",
flex: 1,
// hbox: '100% 50%',
region: 'center',
frame: true,
items: [this.gridCrChFee, this.NewFeeShowCr, this.AuditBackReasonCr]
});
this.panelFee = new Ext.Panel({
layout: "border",
// layout: 'hbox',
// layoutConfig: {
// align: 'stretch',
// pack: 'start'
// },
region: 'center',
items: [this.panelDrChFee, this.panelCrChFee
]
});
//#region 布局
Ext.apply(this, {
items: [this.panelFee, this.tabTotal]
});
//#endregion
this.opStatus = 'add';
/*
parentWin = window.parent.opener;
{
if (parentWin) {
var ret = parentWin.OprationSwap();
var fun = ret[4];
}
}
*/
_thisfee = this;
this.gridDrChFee.getSelectionModel().on('select', function (model, record, index) {
var CustomerName = record.data.CustomerName;
var FeeStatus = record.data.FeeStatus;
var GId = record.data.GId;
if (FeeStatus == 3) {
this.NewFeeShowDr.setVisible(true);
this.storeChFeeModify.load({ params: { FeeID: GId, ApplyType: 2 },
callback: function (r, options, success) {
if (success) {
_thisfee.NewFeeShowDr.getForm().loadRecord(_thisfee.storeChFeeModify.getAt(0));
}
},
scope: this
});
} else {
this.NewFeeShowDr.setVisible(false);
}
if (FeeStatus == 6) {
var reason = this.AuditBackReasonDr.getForm().findField('Reason').setValue(record.data.Reason);
this.AuditBackReasonDr.setVisible(true);
} else {
this.AuditBackReasonDr.setVisible(false);
}
var FeeName = record.data.FeeName;
for (i = 0; i < this.storeCrChFee.getCount(); i += 1) {
var memberyf = this.storeCrChFee.getAt(i);
var recchange = memberyf.getChanges();
if (memberyf.data.FeeName == FeeName) {
memberyf.set("ISSEL", '1');
} else {
memberyf.set("ISSEL", '0');
}
if (isEmptyObject(recchange)) memberyf.commit();
};
if (CustomerName!=''){
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId:NewGuid(),
CustCode: CustomerName,
CustName: CustomerName,
CodeAndName: CustomerName,
DESCRIPTION:CustomerName
});
_thisfee.storeCustomerNameRefM.add(recordCustCode);
}
}, this);
this.gridCrChFee.getSelectionModel().on('select', function (model, record, index) {
var CustomerName = record.data.CustomerName;
var FeeStatus = record.data.FeeStatus;
var GId = record.data.GId;
if (FeeStatus == 3) {
this.NewFeeShowCr.setVisible(true);
this.storeChFeeModify.load({ params: { FeeID: GId, ApplyType: 2 },
callback: function (r, options, success) {
if (success) {
_thisfee.NewFeeShowCr.getForm().loadRecord(_thisfee.storeChFeeModify.getAt(0));
}
},
scope: this
});
} else {
this.NewFeeShowCr.setVisible(false);
}
if (FeeStatus == 6) {
var reason = this.AuditBackReasonCr.getForm().findField('Reason').setValue(record.data.Reason);
this.AuditBackReasonCr.setVisible(true);
} else {
this.AuditBackReasonCr.setVisible(false);
}
var FeeName = record.data.FeeName;
for (i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var memberyf = this.storeDrChFee.getAt(i);
var recchange = memberyf.getChanges();
if (memberyf.data.FeeName == FeeName) {
memberyf.set("ISSEL", '1');
} else {
memberyf.set("ISSEL", '0');
}
if (isEmptyObject(recchange)) memberyf.commit();
};
if (CustomerName!=''){
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId:NewGuid(),
CustCode: CustomerName,
CustName: CustomerName,
CodeAndName: CustomerName,
DESCRIPTION:CustomerName
});
_thisfee.storeCustomerNameRefM.add(recordCustCode);
}
}, this);
this.gridDrChFee.on({
selectionchange: function (sm, selections) {
if (selections.length == 0) {
for (i = 0; i < _thisfee.storeCrChFee.getCount(); i += 1) {
var memberyf = _thisfee.storeCrChFee.getAt(i);
var recchange = memberyf.getChanges();
memberyf.set("ISSEL", '0');
if (isEmptyObject(recchange)) memberyf.commit();
};
var DRSELECTSTR = Ext.getCmp('DRSELECTSTR');
DRSELECTSTR.setText('', false);
} else {
var rec = selections[0];
var custname = rec.data.CustomerName;
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: custname,
CustName: custname,
CodeAndName: custname,
DESCRIPTION: custname
});
_thisfee.storeCustomerNameRefDr.add(recordCustCode);
var storeSelect = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsSelectFee',
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
});
for (var i = 0; i < selections.length; i++) {
var memberyf = selections[i];
var records = DsStoreQueryBy(storeSelect, 'CURR', memberyf.data.Currency)
if (records.getCount() > 0) {
var rec = records.getAt(0);
var AMOUNT = Add(rec.data.AMOUNT, memberyf.data.Amount);
rec.set('AMOUNT', AMOUNT);
} else {
var rec = Ext.create('MsSelectFee', {
CURR: memberyf.data.Currency,
AMOUNT: memberyf.data.Amount
});
storeSelect.add(rec);
}
}
if (storeSelect.getCount() > 0) {
str = '选中费用合计[';
for (i = 0; i < storeSelect.getCount(); i += 1) {
var memberyf = storeSelect.getAt(i);
str = str + memberyf.data.CURR + ':' + memberyf.data.AMOUNT + ';';
}
str = str + ']';
var DRSELECTSTR = Ext.getCmp('DRSELECTSTR');
DRSELECTSTR.setText(str, false);
} else {
var DRSELECTSTR = Ext.getCmp('DRSELECTSTR');
DRSELECTSTR.setText('', false);
}
}
}
});
this.gridCrChFee.on({
selectionchange: function (sm, selections) {
if (selections.length == 0) {
for (i = 0; i < _thisfee.storeDrChFee.getCount(); i += 1) {
var memberyf = _thisfee.storeDrChFee.getAt(i);
var recchange = memberyf.getChanges();
memberyf.set("ISSEL", '0');
if (isEmptyObject(recchange)) memberyf.commit();
};
var DRSELECTSTR = Ext.getCmp('CRSELECTSTR');
DRSELECTSTR.setText('', false);
} else {
var rec = selections[0];
var custname = rec.data.CustomerName;
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: custname,
CustName: custname,
CodeAndName: custname,
DESCRIPTION: custname
});
_thisfee.storeCustomerNameRefCr.add(recordCustCode);
var storeSelect = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsSelectFee',
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
});
for (var i = 0; i < selections.length; i++) {
var memberyf = selections[i];
var records = DsStoreQueryBy(storeSelect, 'CURR', memberyf.data.Currency)
if (records.getCount() > 0) {
var rec = records.getAt(0);
var AMOUNT = Add(rec.data.AMOUNT, memberyf.data.Amount);
rec.set('AMOUNT', AMOUNT);
} else {
var rec = Ext.create('MsSelectFee', {
CURR: memberyf.data.Currency,
AMOUNT: memberyf.data.Amount
});
storeSelect.add(rec);
}
}
if (storeSelect.getCount() > 0) {
str = '选中费用合计[';
for (i = 0; i < storeSelect.getCount(); i += 1) {
var memberyf = storeSelect.getAt(i);
str = str + memberyf.data.CURR + ':' + memberyf.data.AMOUNT + ' ';
}
str = str + ']';
var DRSELECTSTR = Ext.getCmp('CRSELECTSTR');
DRSELECTSTR.setText(str, false);
} else {
var DRSELECTSTR = Ext.getCmp('CRSELECTSTR');
DRSELECTSTR.setText('', false);
}
}
}
});
this.InitData();
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='FEECUSTTYPEMUST'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
this.CustTypeMust = 1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='FEEFRTMUST'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
this.FeeFrtMust = 1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='FEELOCKNOTPR'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
this.FEELOCKNOTPR = 1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='AMENDSELFWORKFLOW'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
this.AMENDSELFWORKFLOW = 1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsBaseInfo/GetUserModuleEnable',
params: {
modulename: "modFeenotPr"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
_thisfee.FEENOTPR=true;
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='FEEMANGERMUSTBE'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
this.FEEMANGERMUSTBE =1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='MODIFYCUSTBFFEELOCK'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
this.MODIFYCUSTBFFEELOCK = 1;
} else {
}
}
} else {
}
},
scope: this
});
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetData',
params: {
condition: "PARAMNAME='FEENEWSAMECUST'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var data = result.data;
if (data.PARAMVALUE == '1') {
this.FEENEWSAMECUST = 1;
} else {
}
}
} else {
}
},
scope: this
});
}, //end initUIComponents
//#region 加载数据
InitData: function () {
var condition = '';
/*
if (this.ParentPanel) {
var ret = this.ParentPanel.OprationSwap();
this.opStatus = ret[0];
this.StoreList = ret[1];
this.editRecord = ret[2];
this.RefBillNo = ret[3];
}
*/
this.LoadData(this.opStatus, condition, this.RefBillNo);
}, //end InitData
LoadData: function (opstatus, condition, refbillno) {
this.feeCrSerialNo = 0;
this.feeCrBodyDel = [];
this.feeCrSerialNo = 0;
this.feeCrBodyDel = [];
this.opStatus = opstatus;
// var el = Ext.get("gridDrChFee");
/*
this.storeDrChFee.load({ params: { billno: this.gid, type: 1} });
this.storeCrChFee.load({ params: { billno: this.gid, type: 2} });
this.storeChFeeGain.load({ params: { bsno: this.gid },
callback: function (r, options, success) {
if (success) {
this.formtotal.getForm().loadRecord(this.storeChFeeGain.getAt(0));
}
},
scope: this
});
*/
}, // end LoadDate
//#endregion
//#region 明细操作
onNextKeyClick: function (type, col) {
if (type == 1) {
var rows = this.gridDrChFee.getSelectionModel().getSelection();
var row = rows[rows.length - 1];
var s = this.gridDrChFee.getStore();
var number = s.indexOf(row) + 1;
if (number == this.gridDrChFee.getStore().getCount()) {
this.onAddDetailClick(s, event, type);
} else {
this.cellEditingDrChFee.startEditByPosition({ row: number, column: col });
}
} else {
var rows = this.gridCrChFee.getSelectionModel().getSelection();
var row = rows[rows.length - 1];
var s = this.gridCrChFee.getStore();
var number = s.indexOf(row) + 1;
if (number == this.gridCrChFee.getStore().getCount()) {
this.onAddDetailClick(s, event, type);
} else {
this.cellEditingCrChFee.startEditByPosition({ row: number, column: col });
}
}
},
onUpKeyClick: function (type, col) {
if (type == 1) {
var rows = this.gridDrChFee.getSelectionModel().getSelection();
var row = rows[rows.length - 1];
var s = this.gridDrChFee.getStore();
var number = s.indexOf(row) - 1;
if (number < 0) number = 0;
this.cellEditingDrChFee.startEditByPosition({ row: number, column: col });
} else {
var rows = this.gridCrChFee.getSelectionModel().getSelection();
var row = rows[rows.length - 1];
var s = this.gridCrChFee.getStore();
var number = s.indexOf(row) - 1;
if (number < 0) number = 0;
this.cellEditingCrChFee.startEditByPosition({ row: number, column: col });
}
},
onAddDetailClick: function (button, event, type) {
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
if (type == 1) {
store = this.storeDrChFee;
} else if (type == 2) {
store = this.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
var custtype = '';
if (type == 1)
custtype = '委托单位'
else
custtype = ''
var records = DsStoreQueryBy(this.StoreCustType, 'CUSTTYPE', custtype);
var custname = '';
if (records.getCount() > 0) {
var data = records.getAt(0).data;
custname = this.EditRecord.get(data.CUSTNAME);
if (type == 1) {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: custname,
CustName: custname,
CodeAndName: custname,
DESCRIPTION: custname
});
this.storeCustomerNameRefDr.add(recordCustCode);
} else {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: custname,
CustName: custname,
CodeAndName: custname,
DESCRIPTION: custname
});
this.storeCustomerNameRefCr.add(recordCustCode);
}
} else {
custname = '';
}
var newSerialno = this.GetHandleSerialNo(store);
var newsort = store.getCount() + 1;
var myDate = new Date();
var MANAGER ='';
var MANAGERREF ='';
if (store.getCount() > 0) {
var memberbody =store.getAt(store.getCount()-1);
MANAGER = memberbody.data.MANAGER;
MANAGERREF = memberbody.data.MANAGERREF;
}
if (MANAGER==''){
var SALE=this.EditRecord.get('SALE');
if (SALE!=undefined&&SALE!=NaN&&SALE!=''){
var records = DsStoreQueryBy(this.storeManagerModify, 'UserName', SALE);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
MANAGER =data.GID;
MANAGERREF=SALE;
} else {
MANAGER = '';
MANAGERREF = '';
}
}
}
if (this.FEENEWSAMECUST == 1) {
if (custname == '' || custname == undefined) {
if (store.getCount() > 0) {
var memberbody = store.getAt(store.getCount() - 1);
custname = memberbody.data.CustomerName;
}
}
}
var custfullname='';
if (custname!=''){
var records = DsStoreQueryBy(this.storeCustomerNameRef, 'CustName',custname);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var DESCRIPTION = data.DESCRIPTION;
if (DESCRIPTION != '')
custfullname=DESCRIPTION;
}
}
// if (type == 2) {
// var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
// GId:NewGuid(),
// CustCode: custname,
// CustName: custname,
// CodeAndName: custname,
// DESCRIPTION:custfullname
// });
// this.storeCustomerNameRefCr.add(recordCustCode);
// }else {
// var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
// GId:NewGuid(),
// CustCode: custname,
// CustName: custname,
// CodeAndName: custname,
// DESCRIPTION:custfullname
// });
// this.storeCustomerNameRefDr.add(recordCustCode);
// }
var record = null;
record = Ext.create('MsChFee', {
GId: NewGuid(),
BsNo: '*',
FeeStatus: 1,
FeeStatus_Ref: '录入状态',
FeeType: type,
FeeName: '',
FeeDescription: '',
CustomerType: custtype,
CustomerName: custname,
CustomerFullName: custfullname,
Unit: '',
UnitPrice: 0,
TaxUnitPrice: 0,
Quantity: 1,
TaxRate: 0,
NoTaxAmount: 0,
Amount: 0,
AccTaxRate: 0,
Currency: 'RMB',
ExChangerate: 1,
Reason: '',
Remark: '',
Commissionrate: 0,
Settlement: 0,
Invoice: 0,
OrderAmount: 0,
OrderInvoice: 0,
SubmitDate: null,
Auditoperator: '',
AuditDate: null,
EnteroPerator: USERID,
OpName: SHOWNAME,
EnterDate: myDate,
DebitNo: '',
IsDebit: "0",
IsOpen: "0",
ISACC: "0",
IsAdvancedpay: "0",
Sort: newSerialno,
IsInvoice: "0",
FeeFrt: '',
IsCrmOrderFee: "0",
AuditStatus: 0,
InvoiceNum: '',
ChequeNum: '',
LOCALCURR: LOCALCURR,
WmsOutBsNo: this.WMSOUTBSNO,
MANAGER: MANAGER,
MANAGERREF: MANAGERREF,
UNINVOICE: 0
});
store.add(record);
var editColumnIndex = 0;
var cellediting = null;
if (type == 1) {
cellediting = this.cellEditingDrChFee;
editColumnIndex = 5;
} else if (type == 2) {
cellediting = this.cellEditingCrChFee;
editColumnIndex = 5;
}
var n = store.getCount();
cellediting.startEditByPosition({ row: n - 1, column: editColumnIndex });
},
onAddSelectDetailClick: function (button, event, type) {
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var selectedRecords = [];
var storeadd = null;
if (type == 2) {
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
storeadd = this.storeCrChFee;
} else if (type == 1) {
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
storeadd = this.storeDrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var myDate = new Date();
var MANAGER ='';
var MANAGERREF ='';
if (storeadd.getCount() > 0) {
var memberbody =storeadd.getAt(storeadd.getCount()-1);
MANAGER = memberbody.data.MANAGER;
MANAGERREF = memberbody.data.MANAGERREF;
}
for (var i = 0; i < selectedRecords.length; i++) {
var memberyf = selectedRecords[i];
var custtype = '';
if (type == 1)
custtype = '委托单位'
else
custtype = '订舱代理'
var records = DsStoreQueryBy(this.StoreCustType, 'CUSTTYPE', custtype);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var custname = this.EditRecord.get(data.CUSTNAME);
} else {
var custname = '';
}
var custfullname='';
if (custname!=''){
var records = DsStoreQueryBy(this.storeCustomerNameRef, 'CustName',custname);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var DESCRIPTION = data.DESCRIPTION;
if (DESCRIPTION != '')
custfullname=DESCRIPTION;
}
}
// if (type == 2) {
// var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
// GId:NewGuid(),
// CustCode: custname,
// CustName: custname,
// CodeAndName: custname,
// DESCRIPTION:custfullname
// });
// this.storeCustomerNameRefCr.add(recordCustCode);
// }else {
// var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
// GId:NewGuid(),
// CustCode: custname,
// CustName: custname,
// CodeAndName: custname,
// DESCRIPTION:custfullname
// });
// this.storeCustomerNameRefDr.add(recordCustCode);
//
//
// }
var newSerialno = this.GetHandleSerialNo(storeadd);
var newsort = storeadd.getCount() + 1;
var record = null;
record = Ext.create('MsChFee', {
GId: NewGuid(),
BsNo: '*',
FeeStatus: 1,
FeeStatus_Ref: '录入状态',
FeeType: type,
FeeName: memberyf.data.FeeName,
FeeDescription: memberyf.data.FeeDescription,
CustomerType: custtype,
CustomerName: custname,
CustomerFullName: custfullname,
Unit: memberyf.data.Unit,
UnitPrice: memberyf.data.UnitPrice,
TaxUnitPrice: memberyf.data.TaxUnitPrice,
Quantity: memberyf.data.Quantity,
TaxRate: memberyf.data.TaxRate,
NoTaxAmount: memberyf.data.NoTaxAmount,
Amount: memberyf.data.Amount,
AccTaxRate: memberyf.data.AccTaxRate,
Currency: memberyf.data.Currency,
ExChangerate: memberyf.data.ExChangerate,
Reason: '',
Remark: memberyf.data.Remark,
Commissionrate: memberyf.data.Commissionrate,
Settlement: 0,
Invoice: 0,
OrderAmount: 0,
OrderInvoice: 0,
SubmitDate: null,
Auditoperator: '',
AuditDate: null,
EnteroPerator: USERID,
OpName: SHOWNAME,
EnterDate: myDate,
DebitNo: '',
IsDebit: "0",
IsOpen: "0",
IsAdvancedpay: "0",
Sort: newSerialno,
IsInvoice: "0",
ISACC: "0",
FeeFrt: memberyf.data.FeeFrt,
IsCrmOrderFee: "0",
AuditStatus: 0,
InvoiceNum: '',
ChequeNum: '',
LOCALCURR: LOCALCURR,
MANAGER: MANAGER,
MANAGERREF: MANAGERREF,
WmsOutBsNo: this.WMSOUTBSNO
});
storeadd.add(record);
};
var editColumnIndex = 0;
var cellediting = null;
if (type == 2) {
cellediting = this.cellEditingDrChFee;
editColumnIndex = 4;
} else if (type == 1) {
cellediting = this.cellEditingCrChFee;
editColumnIndex = 4;
}
var n = storeadd.getCount();
cellediting.startEditByPosition({ row: n - 1, column: editColumnIndex });
this.calcDetailTotal();
},
onCopyAddDetailClick: function (button, event, type) {
var allow = this.getAllowOperationDetail();
if (allow == false) {
return;
}
if (type == 1) {
if (_thisfee.DRCLOSE == 1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '应收费用已锁定,无法添加费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var records = DsStoreQueryBy(this.StoreDrOpRange, 'OPID', USERID);
if (records.getCount() > 0) {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限添加费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
} else if (type == 2) {
if (_thisfee.CRCLOSE == 1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '应付费用已锁定,无法添加费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var records = DsStoreQueryBy(this.StoreCrOpRange, 'OPID', USERID);
if (records.getCount() > 0) {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限添加费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
}
var selectedRecords = [];
var storeadd = null;
if (type == 1) {
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
storeadd = this.storeDrChFee;
} else if (type == 2) {
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
storeadd = this.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//请先选择要添加的费用!
return;
}
var myDate = new Date();
var MANAGER = '';
var MANAGERREF = '';
if (storeadd.getCount() > 0) {
var memberbody = storeadd.getAt(storeadd.getCount() - 1);
MANAGER = memberbody.data.MANAGER;
MANAGERREF = memberbody.data.MANAGERREF;
}
for (var i = 0; i < selectedRecords.length; i++) {
var memberyf = selectedRecords[i];
var newSerialno = this.GetHandleSerialNo(storeadd);
var newsort = storeadd.getCount() + 1;
var record = null;
record = Ext.create('MsChFee', {
GId: NewGuid(),
BsNo: '*',
FeeStatus: 1,
FeeStatus_Ref: '录入状态',
FeeType: type,
FeeName: memberyf.data.FeeName,
FeeDescription: memberyf.data.FeeDescription,
CustomerType: memberyf.data.CustomerType,
CustomerName: memberyf.data.CustomerName,
CustomerFullName: memberyf.data.CustomerFullName,
Unit: memberyf.data.Unit,
UnitPrice: memberyf.data.UnitPrice,
TaxUnitPrice: memberyf.data.TaxUnitPrice,
Quantity: memberyf.data.Quantity,
TaxRate: memberyf.data.TaxRate,
NoTaxAmount: memberyf.data.NoTaxAmount,
Amount: memberyf.data.Amount,
AccTaxRate: memberyf.data.AccTaxRate,
Currency: memberyf.data.Currency,
ExChangerate: memberyf.data.ExChangerate,
Reason: '',
Remark: memberyf.data.Remark,
Commissionrate: memberyf.data.Commissionrate,
Settlement: 0,
Invoice: 0,
OrderAmount: 0,
OrderInvoice: 0,
SubmitDate: null,
Auditoperator: '',
AuditDate: null,
EnteroPerator: USERID,
OpName: SHOWNAME,
EnterDate: myDate,
DebitNo: '',
IsDebit: "0",
IsOpen: "0",
IsAdvancedpay: "0",
Sort: newSerialno,
IsInvoice: "0",
FeeFrt: memberyf.data.FeeFrt,
IsCrmOrderFee: "0",
AuditStatus: 0,
InvoiceNum: '',
ChequeNum: '',
LOCALCURR: LOCALCURR,
MANAGER: MANAGER,
MANAGERREF: MANAGERREF,
WmsOutBsNo: this.WMSOUTBSNO,
SALECORP: memberyf.data.SALECORP,
ISACC: "0"
});
storeadd.add(record);
};
var editColumnIndex = 0;
var cellediting = null;
if (type == 1) {
cellediting = this.cellEditingDrChFee;
editColumnIndex = 4;
} else if (type == 2) {
cellediting = this.cellEditingCrChFee;
editColumnIndex = 4;
}
var n = storeadd.getCount();
cellediting.startEditByPosition({ row: n - 1, column: editColumnIndex });
this.calcDetailTotal();
},
onAddAllDetailClick: function (button, event, type) {
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
var storeadd = null;
if (type == 2) {
store = this.storeDrChFee;
storeadd = this.storeCrChFee;
} else if (type == 1) {
store = this.storeCrChFee;
storeadd = this.storeDrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
var myDate = new Date();
var MANAGER ='';
var MANAGERREF ='';
if (storeadd.getCount() > 0) {
var memberbody =storeadd.getAt(storeadd.getCount()-1);
MANAGER = memberbody.data.MANAGER;
MANAGERREF = memberbody.data.MANAGERREF;
}
for (i = 0; i < store.getCount(); i += 1) {
var memberyf = store.getAt(i);
var custtype = '';
if (type == 1)
custtype = '委托单位'
else
custtype = '订舱代理'
var records = DsStoreQueryBy(this.StoreCustType, 'CUSTTYPE', custtype);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var custname = this.EditRecord.get(data.CUSTNAME);
} else {
var custname = '';
}
var custfullname='';
if (custname!=''){
var records = DsStoreQueryBy(this.storeCustomerNameRef, 'CustName',custname);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var DESCRIPTION = data.DESCRIPTION;
if (DESCRIPTION != '')
custfullname=DESCRIPTION;
}
}
// if (type == 2) {
// var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
// GId:NewGuid(),
// CustCode: custname,
// CustName: custname,
// CodeAndName: custname,
// DESCRIPTION:custfullname
// });
// this.storeCustomerNameRefCr.add(recordCustCode);
// }else {
// var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
// GId:NewGuid(),
// CustCode: custname,
// CustName: custname,
// CodeAndName: custname,
// DESCRIPTION:custfullname
// });
// this.storeCustomerNameRefDr.add(recordCustCode);
//
//
// }
var newSerialno = this.GetHandleSerialNo(storeadd);
var newsort = storeadd.getCount() + 1;
var record = null;
record = Ext.create('MsChFee', {
GId: NewGuid(),
BsNo: '*',
FeeStatus: 1,
FeeStatus_Ref: '录入状态',
FeeType: type,
FeeName: memberyf.data.FeeName,
FeeDescription: memberyf.data.FeeDescription,
CustomerType: custtype,
CustomerName: custname,
CustomerFullName: custfullname,
Unit: memberyf.data.Unit,
UnitPrice: memberyf.data.UnitPrice,
TaxUnitPrice: memberyf.data.TaxUnitPrice,
Quantity: memberyf.data.Quantity,
TaxRate: memberyf.data.TaxRate,
NoTaxAmount: memberyf.data.NoTaxAmount,
Amount: memberyf.data.Amount,
AccTaxRate: memberyf.data.AccTaxRate,
Currency: memberyf.data.Currency,
ExChangerate: memberyf.data.ExChangerate,
Reason: '',
Remark: memberyf.data.Remark,
Commissionrate: memberyf.data.Commissionrate,
Settlement: 0,
Invoice: 0,
OrderAmount: 0,
OrderInvoice: 0,
SubmitDate: null,
Auditoperator: '',
AuditDate: null,
EnteroPerator: USERID,
OpName: SHOWNAME,
EnterDate: myDate,
DebitNo: '',
IsDebit: "0",
IsOpen: "0",
ISACC: "0",
IsAdvancedpay: "0",
Sort: newSerialno,
IsInvoice: "0",
FeeFrt: memberyf.data.FeeFrt,
IsCrmOrderFee: "0",
AuditStatus: 0,
InvoiceNum: '',
ChequeNum: '',
LOCALCURR: LOCALCURR,
MANAGER: MANAGER,
MANAGERREF: MANAGERREF,
WmsOutBsNo: this.WMSOUTBSNO
});
storeadd.add(record);
};
var editColumnIndex = 0;
var cellediting = null;
if (type == 2) {
cellediting = this.cellEditingDrChFee;
editColumnIndex = 4;
} else if (type == 1) {
cellediting = this.cellEditingCrChFee;
editColumnIndex = 4;
}
var n = storeadd.getCount();
cellediting.startEditByPosition({ row: n - 1, column: editColumnIndex });
this.calcDetailTotal();
},
onHistryAddDetailClick: function (menu, event, type) {
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
this.feeType = type;
var store = null;
if (type == 1) {
store = this.storeDrChFee;
} else if (type == 2) {
store = this.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
if (this.stroplb == 'op_Seae') {
DsOpenEditWin("/MvcShipping/MsOpSeae/HistryFeeIndex", "历史引入费用");
} else if (this.stroplb == 'op_Apply') {
DsOpenEditWin("/MvcShipping/MsOpApply/HistryFeeIndex", "历史引入费用");
} else if (this.stroplb == 'op_Seai') {
DsOpenEditWin("/MvcShipping/MsOpSeai/HistryFeeIndex", "历史引入费用");
} else if (this.stroplb == 'op_Bulk') {
DsOpenEditWin("/MvcShipping/MsOpBulk/HistryFeeIndex", "历史引入费用");
} else if (this.stroplb == 'op_other') {
DsOpenEditWin("/MvcShipping/MsOpOther/HistryFeeIndex", "历史引入费用");
} else if (this.stroplb == 'op_railway') {
DsOpenEditWin("/MvcShipping/MsOpRailway/HistryFeeIndex", "历史引入费用");
} else if (this.stroplb == 'op_Aire') {
DsOpenEditWin("/MvcShipping/MsOpAire/HistryFeeIndex", "历史引入费用");
} else if (this.stroplb == 'op_Airi') {
DsOpenEditWin("/MvcShipping/MsOpAiri/HistryFeeIndex", "历史引入费用");
}
},
onTemplateAddDetailClick: function (menu, event, type) {
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
this.feeType = type;
var store = null;
if (type == 1) {
store = this.storeDrChFee;
} else if (type == 2) {
store = this.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
// window.open('/MvcShipping/MsFeeTemplate/AddFeeIndex', "模板引入费用", 'width=1200,height=760,top=0,left=0,resizable=yes,status=yes,menubar=no,scrollbars=yes');
DsOpenEditWin("/MvcShipping/MsFeeTemplate/AddFeeIndex", "模板引入费用");
},
onSaveFeeTemplateClick: function (menu, event, type) {
this.onPostDetailClick(menu, event, type);
this.feeType = type;
var store = null;
if (type == 1) {
store = this.storeDrChFee;
} else if (type == 2) {
store = this.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
DsOpenEditWin("/MvcShipping/MsCodeFeeTemplate/Edit?handle=check&feeaddtemplate=true", "模板费用保存");
},
onCtnTkAddDetailClick: function (menu, event, type) {
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
this.onPostDetailClick(menu, event, type);
this.feeType = type;
var store = null;
if (type == 1) {
store = this.storeDrChFee;
} else if (type == 2) {
store = this.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
DsOpenEditWin("/MvcContainer/MsOpCtnBsCard/CtnStatusFee", "引入罐箱费用");
},
onCancelDetailClick: function (menu, event, type) {
var store = null;
if (type == 1) {
store = this.storeDrChFee;
} else if (type == 2) {
store = this.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui2);
return;
}
for (var i = 0; i < store.getCount(); i += 1) {
var member = store.getAt(i);
member.reject();
}
this.calcDetailTotal();
},
GetHandleSerialNo: function (store) {
var result = 0;
if (result == 0) {
for (var i = 0; i < store.getCount(); i += 1) {
var member = store.getAt(i);
if (parseInt(member.data.Sort) > parseInt(result)) {
result = member.data.Sort;
}
}
}
result = parseInt(result) + 1;
return result;
},
onDelDetailClick: function (button, event, type) {
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var feeGidSql = '';
var selectedRecords = [];
if (type == '1') {
selectedRecords = _thisfee.feeDrGridCheckBoxModel.selected.items;
var candelete = _thisfee.CheckChFeeDelete(selectedRecords, 1);
if (candelete == false)
return;
} else if (type == '2') {
selectedRecords = _thisfee.feeCrGridCheckBoxModel.selected.items;
var candelete = _thisfee.CheckChFeeDelete(selectedRecords, 2);
if (candelete == false)
return;
}
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
Ext.MessageBox.confirm(Zi.LAN.FEE.TiShi, '确定要删除选中(' + selectedRecords.length +'条)的费用吗?', function (btn) {
if (btn == 'yes') {
if (selectedRecords.length > 0) {
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.BsNo == "*") //如果是新增但没有保存的数据,没有必要提交到后台
{
if (type == '1') {
this.storeDrChFee.remove(selectedRecords[i]);
} else if (type == '2') {
this.storeCrChFee.remove(selectedRecords[i]);
}
this.calcDetailTotal();
} else {
var feeGId = "'" + rec.data.GId + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
}
}
}
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
if (feeGidSql != '') {
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在删除数据...',
url: '/MvcShipping/MsChFee/Delete',
params: {
bsno: _thisfee.strBSNO,
data: feeGidSql
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
for (var i = 0; i < selectedRecords.length; i++) {
if (type == '1') {
_thisfee.storeDrChFee.remove(selectedRecords[i]);
} else if (type == '2') {
_thisfee.storeCrChFee.remove(selectedRecords[i]);
}
}
// this.calcDetailTotal();
_thisfee.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
_thisfee.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, oplb: _thisfee.stroplb },
callback: function (r, options, success) {
if (success) {
_thisfee.setTotalHead();
}
}
});
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: Zi.LAN.FEE.JingGao, msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//'服务器响应出错,请重试'
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: "删除成功!", icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
}
}, this);
},
CheckChFeeDelete: function (records, type) {
var canDelete=true;
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
if (feeStatus != 1&&feeStatus != 6)
canDelete =false;
if (canDelete == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.ZiNengShanChuFuHeTiaoJianDeFeiYong, //'只能删除费用状态为[录入状态]和[驳回提交]的费用,请重新选择',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
if (canDelete) {
var op = rec.data.EnteroPerator;
var opname = rec.data.OpName;
if (type == 1) {
var recop = DsStoreQueryBy(this.StoreDrOpRange, 'OPID', op);
if (recop.getCount() > 0) {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限删除' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canDelete = false;
}
} else if (type == 2) {
var recop = DsStoreQueryBy(this.StoreCrOpRange, 'OPID', op);
if (recop.getCount() > 0) {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限删除' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canDelete = false;
}
}
}
if (canDelete) {
if (rec.data.Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiKaiChuFaPiaoWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canDelete = false;
}
}
if (canDelete) {
if (rec.data.OrderAmount != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canDelete = false;
}
}
if (canDelete) {
if (rec.data.OrderInvoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canDelete = false;
}
}
if (canDelete) {
if (rec.data.IsDebit == 'True' || rec.data.IsDebit == '1') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canDelete = false;
}
}
}
return canDelete;
},
onPostDetailClick: function (button, event, type) {
var bodyDrChFeeDatas = [];
var i;
if (type == '1') {
for (i = 0; i < _thisfee.storeDrChFee.getCount(); i += 1) {
var memberyf = _thisfee.storeDrChFee.getAt(i);
if (memberyf.data.Currency ==LOCALCURR&&memberyf.data.ExChangerate!=1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BenWeiBiHuiLvBiXuShiYi, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
bodyDrChFeeDatas.push(memberyf);
var ExChangerate = memberyf.data.ExChangerate;
};
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
} else if (type == '2') {
for (i = 0; i < _thisfee.storeCrChFee.getCount(); i += 1) {
var memberyf = _thisfee.storeCrChFee.getAt(i);
if (memberyf.data.Currency ==LOCALCURR&&memberyf.data.ExChangerate!=1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BenWeiBiHuiLvBiXuShiYi, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
bodyDrChFeeDatas.push(memberyf);
var amount = memberyf.data.Amount;
var ExChangerate = memberyf.data.ExChangerate;
};
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
};
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
url: '/MvcShipping/MsChFee/Save',
scope: this,
params: {
bsno: _thisfee.strBSNO,
type: type,
chfeebody: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (type == 1) {
_thisfee.LoadDrChFee();
} else {
_thisfee.LoadCrChFee();
}
_thisfee.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
_thisfee.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, oplb: _thisfee.stroplb },
callback: function (r, options, success) {
if (success) {
_thisfee.setTotalHead();
}
}
});
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
onPostDetailfn: function (fn,button, event, type) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < _thisfee.storeDrChFee.getCount(); i += 1) {
var memberyf = _thisfee.storeDrChFee.getAt(i);
if (memberyf.data.Currency == LOCALCURR && memberyf.data.ExChangerate != 1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BenWeiBiHuiLvBiXuShiYi, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
bodyDrChFeeDatas.push(memberyf);
var ExChangerate = memberyf.data.ExChangerate;
};
for (i = 0; i < _thisfee.storeCrChFee.getCount(); i += 1) {
var memberyf = _thisfee.storeCrChFee.getAt(i);
if (memberyf.data.Currency == LOCALCURR && memberyf.data.ExChangerate != 1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BenWeiBiHuiLvBiXuShiYi, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
bodyDrChFeeDatas.push(memberyf);
};
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
url: '/MvcShipping/MsChFee/Save',
scope: this,
params: {
bsno: _thisfee.strBSNO,
type: type,
chfeebody: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
fn(button, event, type);
if (type == 1) {
_thisfee.LoadDrChFee();
} else {
_thisfee.LoadCrChFee();
}
_thisfee.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb } });
_thisfee.storeBodySum.load({
params: { bsno: _thisfee.strBSNO, oplb: _thisfee.stroplb },
callback: function (r, options, success) {
if (success) {
_thisfee.setTotalHead();
}
}
});
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}, //end save
onShenModifyClick: function (button, event, type) {
var allow = this.getAllowOperationDetail();
if (allow == false) {
return;
}
var selectedRecords = [];
if (type == '1') {
if (_thisfee.DRCLOSE == 1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '应收费用已锁定,无法添加费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
if (_thisfee.CRCLOSE == 1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '应付费用已锁定,无法添加费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
}
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var rec = selectedRecords[0];
if (rec.data.FeeStatus != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongZhangTaiWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.Settlement != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiJieSuanWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.IsDebit == 'True' || rec.data.IsDebit == '1') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已対帐无法申请修改!'
return;
}
if (rec.data.Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiKaiChuFaPiaoWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.INVLINKGID != '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShengChenFaPiaoZizhuWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var canModify = true;
var op = rec.data.EnteroPerator;
var opname = rec.data.OpName;
if (type == 1) {
var recop = DsStoreQueryBy(this.StoreDrOpRange, 'OPID', op);
if (recop.getCount() > 0) {
} else {
canModify = false;
}
} else if (type == 2) {
var recop = DsStoreQueryBy(this.StoreCrOpRange, 'OPID', op);
if (recop.getCount() > 0) {
} else {
canModify = false;
}
}
if (!canModify) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.MeiYouQuanXianShenQingXiuGaiDanQianFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已开出发票无法删除!'
return;
}
if (rec.data.VOUALLNO != '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenChenPingZhengShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已开出发票无法删除!'
return;
}
if (rec.data.OrderAmount != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.OrderInvoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.DataLoading = true;
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId: NewGuid(),
CustCode: rec.data.CustomerName,
CustName: rec.data.CustomerName,
CodeAndName: rec.data.CustomerName
});
this.NewFeeEdit.getForm().loadRecord(rec);
for (i = 0; i < _thisfee.storeBodySum.getCount(); i += 1) {
var memberyf = _thisfee.storeBodySum.getAt(i);
if (memberyf.data.CURR == '合计') {
var ttlprofit = memberyf.data.PR;
_thisfee.NewFeeEdit.getForm().findField('BPROFIT').setValue(parseFloat(ttlprofit).toFixed(2));
_thisfee.NewFeeEdit.getForm().findField('APROFIT').setValue(parseFloat(ttlprofit).toFixed(2));
_thisfee.NewFeeEdit.getForm().findField('DIFPROFIT').setValue(0);
}
}
this.OldFee.getForm().loadRecord(rec);
this.DataLoading = false;
this.winShenModifyShow.show();
},
onCreateModifyClick: function (type) {
var feeGIdSql = '';
var form = this.NewFeeEdit.getForm();
var data = this.NewFeeEdit.getForm().getValues();
var olddata = this.OldFee.getForm().getValues();
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: '/Account/Chfee_Audit/ShenModify',
params: {
data: Ext.JSON.encode(data),
olddata: Ext.JSON.encode(olddata),
optype: _thisfee.stroplb,
isamend:_thisfee.amendfee
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1)
//_this.storeDrChFee.load({ params: { billno: _this.strBSNO, type: 1, optype: _this.stroplb} });
_thisfee.LoadDrChFee();
if (type == 2)
//_this.storeCrChFee.load({ params: { billno: _this.strBSNO, type: 2, optype: _this.stroplb} });
_thisfee.LoadCrChFee();
_thisfee.winShenModifyShow.close();
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
},
onShenDeleteClick: function (button, event, type) {
var allow = this.getAllowOperationDetail();
if (allow == false) {
return;
}
var selectedRecords = [];
if (type == '1') {
if (_thisfee.DRCLOSE == 1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '应收费用已锁定,无法添加费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
if (_thisfee.CRCLOSE == 1) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '应收费用已锁定,无法添加费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
}
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//没有选择要申请删除的业务!
return;
}
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYaoTiJiaoShenHeDeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//请先选择要提交审核的费用!
return;
}
var insert;
for (var i = 0; i < records.length; i++) {
var rec = records[i];
// var rec = selectedRecords[0];
if (rec.data.FeeStatus != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongZhuangTaiWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.Settlement != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiJieSuanWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.SangQianFeiYongYiKaiChuFaPiaoWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.IsDebit == 'True' || rec.data.IsDebit == '1') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已対帐无法申请删除!'
return;
}
if (rec.data.VOUALLNO != '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenChenPingZhengShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已开出发票无法删除!'
return;
}
if (rec.data.OrderAmount != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.OrderInvoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShenQingShanChu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.INVLINKGID != '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShengChenFaPiaoZizhuWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
}
var rec = selectedRecords[0];
this.DataLoading = true;
this.DeleteFee.getForm().loadRecord(rec);
this.DataLoading = false;
this.winShenDeleteShow.show();
},
onCreateDeleteClick: function (type) {
var feeGIdSql = '';
var form = this.DeleteFee.getForm();
var data = this.DeleteFee.getForm().getValues();
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在申请删除...',
url: '/Account/Chfee_Audit/ShenDelete',
params: {
data: Ext.JSON.encode(data),
optype: _thisfee.stroplb,
isamend:_thisfee.amendfee
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1)
//_this.storeDrChFee.load({ params: { billno: _this.strBSNO, type: 1, optype: _this.stroplb} });
_thisfee.LoadDrChFee();
if (type == 2)
//_this.storeCrChFee.load({ params: { billno: _this.strBSNO, type: 2, optype: _this.stroplb} });
_thisfee.LoadCrChFee();
_thisfee.winShenDeleteShow.close();
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
},
onCancelShenClick: function (button, event, type) {
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var selectedRecords = [];
if (type == '1') {
selectedRecords = _thisfee.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
selectedRecords = _thisfee.feeCrGridCheckBoxModel.selected.items;
}
if (selectedRecords.count == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//没有选择要取消申请的业务!
return;
}
var rec = selectedRecords[0];
if (rec.data.FeeStatus != 3 && rec.data.FeeStatus != 4) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongZhuangTaiWuFaQuXiaoShenQing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
// var bodyDrChFeeDatas = [];
// bodyDrChFeeDatas.push(rec);
// var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在取消申请...',
url: '/Account/Chfee_Audit/CancelShen',
params: {
Feeid: rec.data.GId,
optype: _thisfee.stroplb,
isamend: _thisfee.amendfee,
isopen: rec.data.IsOpen
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
/*
_this.storeDrChFee.load({ params: { billno: _this.strBSNO, type: 1, optype: _this.stroplb },
callback: function (r, options, success) {
if (success) {
if (r.length > 0) {
_this.storeDrChFee.getSelectionModel().select(0);
} else {
}
}
},
scope: this
});*/
_thisfee.LoadDrChFee(button, event);
_thisfee.NewFeeShowDr.setVisible(false);
}
if (type == 2) {
/*
_this.storeCrChFee.load({ params: { billno: _this.strBSNO, type: 2, optype: _this.stroplb },
callback: function (r, options, success) {
if (r.length > 0) {
_this.storeCrChFee.getSelectionModel().select(0);
} else {
}
},
scope: this
});*/
_thisfee.LoadCrChFee(button, event);
_thisfee.NewFeeShowCr.setVisible(false);
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
},
onCreateNewCustNameClick: function (button, event, type) {
if (_thisfee.MODIFYCUSTBFFEELOCK==0){
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
}
var selectedRecords = [];
if (type == '1') {
selectedRecords = _thisfee.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
selectedRecords = _thisfee.feeCrGridCheckBoxModel.selected.items;
}
if (selectedRecords.count == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.Settlement != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiJieSuanWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.IsDebit == 'True' || rec.data.IsDebit == '1') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//当前费用已対帐无法申请修改!'
return;
}
if (rec.data.Invoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiKaiChuFaPiaoWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.OrderAmount != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (rec.data.OrderInvoice != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
}
var form = _thisfee.NewCustNameShow.getForm();
form.findField('type').setValue(type);
_thisfee.winNewCustNameShow.show();
},
CreateNewCustName: function () {
var form = _thisfee.NewCustNameShow.getForm();
var CustomerName = form.findField('CustomerName').getValue();
var type = form.findField('type').getValue();
var selectedRecords = [];
if (type == '1') {
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
}
var bodyAddDatas = [];
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
bodyAddDatas.push(rec);
}
var jsonbodyAddDatas = ConvertRecordsToJsonAll(bodyAddDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在申请删除...',
url: '/Account/Chfee_Audit/ShenNewCustName',
params: {
data:jsonbodyAddDatas,
CustomerName:CustomerName
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1)
//_this.storeDrChFee.load({ params: { billno: _this.strBSNO, type: 1, optype: _this.stroplb} });
_thisfee.LoadDrChFee();
if (type == 2)
//_this.storeCrChFee.load({ params: { billno: _this.strBSNO, type: 2, optype: _this.stroplb} });
_thisfee.LoadCrChFee();
_thisfee.winNewCustNameShow.close();
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
},
onShenIvoiceClick: function (button, event, type) {
var selectedRecords = [];
if (type == '1') {
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
}
if (selectedRecords.count == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//没有选择要申请的费用!
return;
}
var invcurr = '';
var invcurrusd = '';
var invcust = '';
var bsno = '';
var GidStr = '';
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.FeeStatus != 0 && rec.data.FeeStatus != 8 && rec.data.FeeStatus != 9) {
// Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '当前费用状态无法申请开票!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
} else {
invcust = rec.data.CustomerName;
if (rec.data.Currency == 'RMB')
invcurr = rec.data.Currency;
if (rec.data.Currency != 'RMB')
invcurrusd = rec.data.Currency;
bsno = rec.data.BsNo;
var Gid = "'" + rec.data.GId + "'";
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
}
if (GidStr == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//没有选择要申请的费用!
return;
}
this.SelectFeeGid = " f.GID IN (" + GidStr + ")";
var StoreCurr = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsFeeCurr',
proxy: { url: '/MvcShipping/MsChFee/GetFeeCurrList' }
});
StoreCurr.load({ params: { condition: ""} });
if (invcurr == '' && invcurrusd != '') invcurr = invcurrusd;
if (this.winIFTMBFShow==undefined||this.winIFTMBFShow==NaN){
this.comboxInvCurr = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.FEE.ShenCurr, //'实收币别',
store: StoreCurr,
id: 'ShenCurr',
forceSelection: true,
allowBlank: false,
name: 'CURR',
value: invcurr,
valueField: 'CURR',
displayField: 'CURR'
});
this.storeINVFEENAME = Ext.create('Ext.data.Store', {
fields: ['FSTATUS', 'NAME']
});
this.storeINVFEENAME.add({ "FSTATUS": "0", "NAME": "否" });
this.storeINVFEENAME.add({ "FSTATUS": "1", "NAME": "是" });
this.comboxINVFEENAME= Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '是否明细',
store: this.storeINVFEENAME,
valueField: 'FSTATUS',
displayField: 'NAME',
id:'INVFEENAME',
forceSelection: true,
name: 'INVFEENAME',
value: '0'
});
this.formIFTMBFSShow = Ext.widget('form', {
frame: true,
region: 'center',
bodyPadding: 5,
fieldDefaults: {
margins: '2 2 2 2',
labelAlign: 'right',
flex: 1,
labelWidth: 80,
msgTarget: 'qtip'
},
items: [{
xtype: 'container',
defaultType: 'textfield',
layout: 'hbox',
defaults: {
anchor: '100%'
},
items: [this.comboxInvCurr,this.comboxINVFEENAME]
}]
});
me = this;
this.winIFTMBFShow = Ext.create('Ext.window.Window', {
width: 320,
height: 160,
//plain : true,
iconCls: "addicon",
resizable: false,
// 是否可以拖动
// draggable:false,
collapsible: true, // 允许缩放条
closeAction: 'close',
closable: true,
modal: 'true',
buttonAlign: "center",
bodyStyle: "padding:0 0 0 0",
items: [this.formIFTMBFSShow],
buttons: [{
text: Zi.LAN.FEE.QueRenShengCheng, //"确认生成",
minWidth: 70,
handler: function () {
var ShenCurr = Ext.getCmp('ShenCurr');
var Curr = ShenCurr.getValue();
var isfeename=Ext.getCmp('INVFEENAME').getValue();
_thisfee.onCreateInvShenClick(Curr, invcust,isfeename);
_thisfee.winIFTMBFShow.close();
}
}, {
text: Zi.LAN.FEE.GuanBi, //"关闭",
minWidth: 70,
handler: function () {
_thisfee.winIFTMBFShow.close();
}
}]
});
} else {
Ext.getCmp('ShenCurr').setValue(invcurr);
}
this.winIFTMBFShow.show();
},
onCreateInvShenClick: function (Curr, invcust,isfeename) {
DsOpenEditWin("/Account/Chfee_invoiceapplication/BLEdit?handle=check&bsnosql=feelist&bsCurr=" + Curr + "&bsCust=" + invcust+ "&isfeename=" + isfeename, '发票申请');
},
onShenPayClick: function (button, event, type) {
var selectedRecords = [];
if (type == '1') {
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
}
if (selectedRecords.count == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//没有选择要申请的费用!
return;
}
var invcurr = '';
var invcurrusd = '';
var invcust = '';
var bsno = '';
var GidStr = '';
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
if (rec.data.FeeStatus != 0 && rec.data.FeeStatus != 8 && rec.data.FeeStatus != 9) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '当前费用状态无法申请开票!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
if (invcust=='') {
invcust = rec.data.CustomerName;
bsno = rec.data.BsNo;
var Gid = "'" + rec.data.GId + "'";
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
} else{
if (invcust!=rec.data.CustomerName){
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '当前只有同一客户名称才可以申请付费!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
} else {
bsno = rec.data.BsNo;
var Gid = "'" + rec.data.GId + "'";
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
}
}
}
if (GidStr == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//没有选择要申请的费用!
return;
}
this.SelectFeeGid = " f.GID IN (" + GidStr + ")";
DsOpenEditWin("/Account/Chfee_payapplication/BLEdit?handle=check&bsnosql=feelist&bsCust=" + invcust, '付费申请');
},
onViewDetailClick: function (button, event, type) {
var openSet = "height=540, width=890, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " + (screen.height - 540) / 2 + ",Left= " + (screen.width - 890) / 2
var openType = "_blank";
//打开费用“历史信息查询”页面
// var openUrl = "../../Shipping/FeeHistory.aspx?bsno=" + this.strBSNO + "&oplb=" + this.stroplb + "&type=" + type;
var openUrl = "../../MvcShipping/MsOpBill/MsFeeHistoryView??bsno=" + this.strBSNO + "&oplb=" + this.stroplb + "&type=" + type;
window.open(openUrl, openType, openSet);
},
onViewSortClick: function (button, event, type) {
var openSet = "height=740, width=890, toolbar=no, menubar=no,scrollbars=no, resizable=no,location=no, status=no,Top= " + (screen.height - 540) / 2 + ",Left= " + (screen.width - 890) / 2
var openType = "_blank";
//打开费用“历史信息查询”页面
// var openUrl = "../../Shipping/FeeHistory.aspx?bsno=" + this.strBSNO + "&oplb=" + this.stroplb + "&type=" + type;
var openUrl = "../../MvcShipping/MsChFee/MsFeeSortEdit?bsno=" + this.strBSNO + "&oplb=" + this.stroplb + "&type=" + type;
window.open(openUrl, openType, openSet);
},
getAllowOperationDetail: function () {
var feeStatus = _thisfee.getFeeStatus();
if (feeStatus == '0' || feeStatus == '' || feeStatus == false || feeStatus == 'false' || typeof (feeStatus) == 'undefined'){
var ISCANCEL = _thisfee.EditRecord.get('ISCANCEL');
if ( typeof (ISCANCEL)!= 'undefined'&&(ISCANCEL=='1'||ISCANCEL=='2')){
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: "此票委托已退舱或申请退舱,不允许操作费用!", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return false;
} else return true;
}else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: "此票委托已费用已锁定,不允许操作费用!", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return false;
}
},
//#endregion
InitDrGrid: function (grid) {
var agirdcolums = grid;
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetFeeParam',
params: {
condition: "PARAMNAME='Feenotopen'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
_thisfee.gridDrChFee.reconfigure(_thisfee.storeDrChFee, agirdcolums);
} else {
var data = result.data;
for (var j = 0; j < agirdcolums.length; j++) {
if (agirdcolums[j].dataIndex == 'IsOpen'){
if (data.Feenotopen)
agirdcolums[j].hidden = false;
else agirdcolums[j].hidden = false;
}
if (agirdcolums[j].dataIndex == 'ExChangerate'){
if (data.EXCHANGERATEISREADONLY)
agirdcolums[j].editor=null;
}
}
_thisfee.gridDrChFee.reconfigure(_thisfee.storeDrChFee, agirdcolums);
}
} else {
_this.gridDrChFee.reconfigure(_this.storeDrChFee, agirdcolums);
}
},
scope: this
});
},
InitCrGrid: function (grid) {
var agirdcolums = grid;
// this.gridCrChFee.reconfigure(this.storeCrChFee, agirdcolums);
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsSysParamSet/GetFeeParam',
params: {
condition: "PARAMNAME='Feenotopen'"
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
_thisfee.gridCrChFee.reconfigure(_thisfee.storeCrChFee, agirdcolums);
} else {
var data = result.data;
for (var j = 0; j < agirdcolums.length; j++) {
if (agirdcolums[j].dataIndex == 'IsOpen'){
if (data.Feenotopen)
agirdcolums[j].hidden = false;
else agirdcolums[j].hidden = false;
}
if (agirdcolums[j].dataIndex == 'ExChangerate'){
if (data.EXCHANGERATEISREADONLY)
agirdcolums[j].editor=null;
}
}
_thisfee.gridCrChFee.reconfigure(_thisfee.storeCrChFee, agirdcolums);
}
} else {
_thisfee.gridCrChFee.reconfigure(_thisfee.storeCrChFee, agirdcolums);
}
},
scope: this
});
},
//#region 表格的AfterEdit
gridListChFeeAfterEdit: function (editor, e, eOpts) {
if (e.value == e.originalValue) return;
//var BSNO = e.record.get('BSNO');
if (e.field == 'UnitPrice') {
var unitPrice = e.record.data['UnitPrice'];
var quantity = e.record.data['Quantity'];
var taxrate = e.record.data['TaxRate'];
if (taxrate != null) {
var taxrateb = Add(1, Div(taxrate, 100));
//parseFloat(1 + parseFloat(taxrate).mul(0.01));
var TaxUnitPrice = Mul(unitPrice, taxrateb);
//(parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
e.record.set('TaxUnitPrice', TaxUnitPrice);
}
var notaxamount = Mul(unitPrice, quantity); //(parseFloat(unitPrice).mul(quantity)).toFixed(2);
e.record.set('NoTaxAmount', notaxamount);
////taxrate = Div(taxrate, 100);
//parseFloat(taxrate).mul(0.01);
// tax = notaxamount * taxrate;
var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
e.record.set('Tax', tax);
var amount = Add(notaxamount, tax); //(parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);// e.record.set('Amount', Ext.util.Format.number(amount, '0.00'));
e.record.set('Amount', amount);
this.calcDetailTotal();
}
else if (e.field == 'CustomerName') {
var records = DsStoreQueryBy(this.storeCustomerNameRef, 'CustName', e.value);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var FEEFRT = data.FEEFRT;
if (FEEFRT != '')
e.record.set('FeeFrt', FEEFRT);
var DESCRIPTION = data.DESCRIPTION;
if (DESCRIPTION != '')
e.record.set('CustomerFullName', DESCRIPTION);
}
}
else if (e.field == 'TaxUnitPrice') {
var TaxUnitPrice = e.record.data['TaxUnitPrice'];
var quantity = e.record.data['Quantity'];
var taxrate = e.record.data['TaxRate'];
var taxrateb = Add(1, Div(taxrate, 100), 4); //parseFloat(1 + parseFloat(taxrate).mul(0.01));
var unitPrice = Div(TaxUnitPrice, taxrateb); //(parseFloat(TaxUnitPrice).div(parseFloat(taxrateb))).toFixed(2);
e.record.set('UnitPrice', unitPrice);
if (quantity != null) {
var amount = Mul(TaxUnitPrice, quantity);
//(parseFloat(TaxUnitPrice).mul(quantity)).toFixed(2);
e.record.set('Amount', amount);
var notaxamount = Div(amount, taxrateb);
//(parseFloat(amount).div(taxrateb)).toFixed(2);
e.record.set('NoTaxAmount', notaxamount);
var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
e.record.set('Tax', tax);
}
this.calcDetailTotal();
} else if (e.field == 'Quantity') {
var unitPrice = e.record.data['UnitPrice'];
var quantity = e.record.data['Quantity'];
var TaxUnitPrice = e.record.data['TaxUnitPrice'];
var taxrate = e.record.data['TaxRate'];
if (taxrate != null) {
var taxrateb = Add(1, Div(taxrate, 100));
if ((TaxUnitPrice == null || TaxUnitPrice == 0 || TaxUnitPrice == NaN) && (unitPrice != null)) {
var TaxUnitPrice = Mul(unitPrice, taxrateb);
e.record.set('TaxUnitPrice', TaxUnitPrice);
}
}
if (unitPrice != null) {
var notaxamount = Mul(unitPrice, quantity); //(parseFloat(unitPrice).mul(quantity)).toFixed(2);
e.record.set('NoTaxAmount', notaxamount);
var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
e.record.set('Tax', tax);
}
if (TaxUnitPrice != null) {
var amount = Mul(TaxUnitPrice, quantity); //(parseFloat(unitPrice).mul(quantity)).toFixed(2);
e.record.set('Amount', amount);
}
this.calcDetailTotal();
}
else if (e.field == 'FeeName'||e.field == 'FeeDescription') {
if (e.field == 'FeeDescription'){
if (e.value =='') return;
}
if (e.field == 'FeeDescription'){
var records = DsStoreQueryBy(this.storeFeeNameRef, 'Description', e.value);
} else {
var records = DsStoreQueryBy(this.storeFeeNameRef, 'Name', e.value);
var FEENAME = e.value;
}
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var FEENAME = data.Name;
var Currency = data.DefaultCurr;
var Description = data.Description;
var DEFAULTUNIT = data.DefaultUnit;
var DefaultDebitRef = data.DefaultDebitRef;
var DefaultCreditRef = data.DefaultCreditRef;
var DefTaxRate = data.TAXRATE;
var UNIT = '';
var custtype = '';
var FeeType = e.record.data['FeeType'];
var codeFEETYPE = data.FEETYPE;
var FEEFRT = data.FEEFRT;
var ISADVANCEDPAY=data.ISADVANCEDPAY;
//alert(codeFEETYPE);
e.record.set('Currency', Currency);
e.record.set('FeeDescription', Description);
if (e.field == 'FeeDescription'){
e.record.set('FeeName', FEENAME);
}
if (FEEFRT != '') {
e.record.set('FeeFrt', FEEFRT);
}
if (ISADVANCEDPAY != '') {
e.record.set('IsAdvancedpay', ISADVANCEDPAY);
}
if (DefTaxRate!=0){
e.record.set('TaxRate', DefTaxRate);
}
if (DEFAULTUNIT == "1" || DEFAULTUNIT == "11") {
e.record.set('Unit', "单票");
e.record.set('Quantity', 1);
UNIT = '单票';
} else if (DEFAULTUNIT == "2") {
e.record.set('Unit', "重量");
UNIT = '重量';
//设置重量,如果是进口的设置净重 Quantity
//获取业务类型 获取重量 设置
} else if (DEFAULTUNIT == "5") {
e.record.set('Unit', "TEU");
UNIT = 'TEU';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else if (DEFAULTUNIT == "6") {
e.record.set('Unit', "净重");
UNIT = '净重';
//如果是进口的设置净重
} else if (DEFAULTUNIT == "10" || DEFAULTUNIT == "3") {
e.record.set('Unit', "尺码");
UNIT = '尺码';
//如果是进口的设置净重
} else if (DEFAULTUNIT == "9") {
var Unitrecords = DsStoreQueryLikeBy(this.StoreUnit, 'UNIT', 1, '2');
if (Unitrecords.getCount() > 0) {
var ffdata = Unitrecords.getAt(0).data;
var aUNIT = ffdata.UNIT;
e.record.set('Unit', aUNIT);
UNIT = aUNIT;
} else {
var Unitrecords = DsStoreQueryLikeBy(this.StoreUnit, 'UNIT', 1, '4');
if (Unitrecords.getCount() > 0) {
var ffdata = Unitrecords.getAt(0).data;
var aUNIT = ffdata.UNIT;
e.record.set('Unit', aUNIT);
UNIT = aUNIT;
}
}
//如果是进口的设置净重
} else if (DEFAULTUNIT == "12") {
e.record.set('Unit', "天");
UNIT = '天';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else if (DEFAULTUNIT == "13") {
e.record.set('Unit', "个");
UNIT = '个';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else if (DEFAULTUNIT == "14") {
e.record.set('Unit', "小时");
UNIT = '小时';
//设置数量
//获取业务类型 获取所有集装箱信息 折算TEU
} else {
e.record.set('Unit', DEFAULTUNIT);
UNIT = DEFAULTUNIT;
}
if (FeeType == 1 && this.storeBodyList_GuDingFeeWeiHu.getCount() > 0) {
var Gdrecords = DsStoreQueryBy(this.storeBodyList_GuDingFeeWeiHu, 'FEENAME', FEENAME);
if (Gdrecords.getCount() > 0) {
var Gddata = Gdrecords.getAt(0).data;
e.record.set('UnitPrice', Gddata.UNITPRICE);
e.record.set('TaxUnitPrice', Gddata.UNITPRICE);
Currency = Gddata.CURRENCY;
e.record.set('Currency', Currency);
UNIT = Gddata.UNIT;
e.record.set('Unit', UNIT);
e.record.set('TaxRate', Gddata.TAXRATE);
e.record.set('IsInvoice', Gddata.ISINVOICE);
e.record.set('Remark', Gddata.REMARK);
e.record.set('FeeFrt', Gddata.FEEFRT);
e.record.set('IsAdvancedpay', Gddata.ISADVANCEDPAY);
e.record.set('AccTaxRate', Gddata.ACCTAXRATE);
}
}
if (Currency != LOCALCURR) {
var FeeType = e.record.data['FeeType'];
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', Currency);
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
if (FeeType == 2)
var DEFRATE = ffdata.CRDEFRATE;
else
var DEFRATE = ffdata.DEFRATE;
e.record.set('ExChangerate', DEFRATE);
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', Currency);
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
if (FeeType == 2)
var DEFRATE = dfdata.DEFRATE;
else
var DEFRATE = dfdata.DEFRATE;
e.record.set('ExChangerate', DEFRATE);
} else {
e.record.set('ExChangerate', 0);
}
}
} else { e.record.set('ExChangerate', 1); };
var Unitrecords = DsStoreQueryBy(this.StoreUnit, 'UNIT', UNIT);
var QUANTITY = 1;
if (Unitrecords.getCount() > 0) {
var Unitdata = Unitrecords.getAt(0).data;
QUANTITY = Unitdata.QUANTITY;
if ((UNIT == '重量') && (QUANTITY == 0)) {
Unitrecords = DsStoreQueryBy(this.StoreUnit, 'UNIT', '净重');
if (Unitrecords.getCount() > 0) {
Unitdata = Unitrecords.getAt(0).data;
QUANTITY = Unitdata.QUANTITY;
}
}
e.record.set('Quantity', QUANTITY);
} else {
e.record.set('Quantity', 1);
}
var taxrate = e.record.data['TaxRate'];
if (taxrate == null) taxrate = 0;
var unitPrice = e.record.data['UnitPrice'];
var notaxamount = Mul(unitPrice, QUANTITY); //(parseFloat(unitPrice).mul(QUANTITY)).toFixed(2);
if (notaxamount == null || notaxamount == NaN) notaxamount = 0;
e.record.set('NoTaxAmount', notaxamount); //taxrate = parseFloat(taxrate) / 100;
var tax = Mul3(notaxamount, taxrate, 0.01); //parseFloat(notaxamount).mul(taxrate);
var amount = Add(notaxamount, tax); //(parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
if (amount == null || amount == NaN) amount = 0;
e.record.set('Amount', amount);
// var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
e.record.set('Tax', tax);
this.calcDetailTotal();
var CustomerName = e.record.data['CustomerName'];
if (FeeType == 2) {
e.record.set('CustomerType', DefaultCreditRef);
} else {
e.record.set('CustomerType', DefaultDebitRef);
}
if (CustomerName == '') {
if (FeeType == 2) {
var recordcust = DsStoreQueryBy(this.StoreCustTypeCr, 'CUSTTYPE', DefaultCreditRef);
if (recordcust.getCount() > 0) {
var data = recordcust.getAt(0).data;
var custname = this.EditRecord.get(data.CUSTNAME);
e.record.set('CustomerType', DefaultCreditRef);
e.record.set('CustomerName', custname);
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId:NewGuid(),
CustCode: custname,
CustName: custname,
CodeAndName: custname,
DESCRIPTION:custname
});
this.storeCustomerNameRefCr.add(recordCustCode);
} else {
}
} else {
var recordcust = DsStoreQueryBy(this.StoreCustType, 'CUSTTYPE', DefaultDebitRef);
if (recordcust.getCount() > 0) {
var data = recordcust.getAt(0).data;
var custname = this.EditRecord.get(data.CUSTNAME);
e.record.set('CustomerName', custname);
e.record.set('CustomerType', DefaultDebitRef);
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId:NewGuid(),
CustCode: custname,
CustName: custname,
CodeAndName: custname,
DESCRIPTION:custname
});
this.storeCustomerNameRefDr.add(recordCustCode);
} else {
}
}
}
} else {
e.record.set('Currency', LOCALCURR);
e.record.set('FeeDescription', '');
}
}
else if (e.field == 'TaxRate') {
var taxrate = e.record.data['TaxRate'];
var unitPrice = e.record.data['UnitPrice'];
var quantity = e.record.data['Quantity'];
if (unitPrice != null) {
var taxrateb = Add(1, Div(taxrate, 100, 4), 4);
//parseFloat(1 + parseFloat(taxrate).mul(0.01));
var TaxUnitPrice = Mul(unitPrice, taxrateb);
//(parseFloat(unitPrice).mul(taxrateb)).toFixed(2);
e.record.set('TaxUnitPrice', TaxUnitPrice);
}
var notaxamount = e.record.data['NoTaxAmount'];
////taxrate = Div(taxrate, 100);
//parseFloat(taxrate).mul(0.01);
var tax = Div(Mul(notaxamount, taxrate), 100);
//parseFloat(notaxamount).mul(taxrate);
var amount = Add(notaxamount, tax);
//(parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
e.record.set('Amount', amount);
e.record.set('Tax', tax);
this.calcDetailTotal();
}
else if (e.field == 'NoTaxAmount') {
var taxrate = e.record.data['TaxRate'];
var notaxamount = e.record.data['NoTaxAmount'];
////taxrate = parseFloat(taxrate).mul(0.01);
var tax = Div(Mul(notaxamount, taxrate), 100);
//parseFloat(notaxamount).mul(taxrate);
var amount = Add(notaxamount, tax);
//(parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
var quantity = e.record.data['Quantity'];
if (quantity != null && quantity != 0) {
var unitPrice = Div(notaxamount, quantity); //(parseFloat(notaxamount).div(parseFloat(quantity))).toFixed(2);
e.record.set('UnitPrice', unitPrice);
var TaxUnitPrice = Div(amount, quantity);
e.record.set('TaxUnitPrice', TaxUnitPrice);
}
e.record.set('Amount', amount);
e.record.set('Tax', tax);
/*
var amount = parseFloat(notaxamount) + parseFloat(notaxamount * taxrate / 100);
e.record.set('Amount', Ext.util.Format.number(amount, '0.00'));
*/
this.calcDetailTotal();
}
else if (e.field == 'Amount') {
var taxrate = e.record.data['TaxRate'];
var amount = e.record.data['Amount'];
if (taxrate != null) {
var taxrateb = Add(1, Mul(taxrate, 0.01)); //parseFloat(1 + parseFloat(taxrate.mul(0.01)));
var notaxamount = Div(amount, taxrateb); //(parseFloat(amount).div(taxrateb)).toFixed(2);
e.record.set('NoTaxAmount', notaxamount);
var quantity = e.record.data['Quantity'];
if (quantity != null && quantity != 0) {
var unitPrice = Div(notaxamount, quantity); //(parseFloat(notaxamount).div(parseFloat(quantity))).toFixed(2);
e.record.set('UnitPrice', unitPrice);
var TaxUnitPrice = Div(amount, quantity);
e.record.set('TaxUnitPrice', TaxUnitPrice);
}
var tax = Div(Mul(notaxamount, taxrate), 100); //parseFloat(notaxamount).mul(taxrate);
e.record.set('Tax', tax);
};
this.calcDetailTotal();
}
else if (e.field == 'Unit') {
var records = DsStoreQueryBy(this.StoreUnit, 'UNIT', e.value);
var QUANTITY = 1;
if (records.getCount() > 0) {
var data = records.getAt(0).data;
QUANTITY = data.QUANTITY;
e.record.set('Quantity', QUANTITY);
} else {
e.record.set('Quantity', 1);
}
var taxrate = e.record.data['TaxRate'];
if (taxrate == null) taxrate = 0;
var unitPrice = e.record.data['UnitPrice'];
var notaxamount = Mul(unitPrice, QUANTITY); //(parseFloat(unitPrice).mul(QUANTITY)).toFixed(2);
e.record.set('NoTaxAmount', notaxamount); //taxrate = parseFloat(taxrate) / 100;
var tax = Mul3(notaxamount, taxrate, 0.01); //parseFloat(notaxamount).mul(taxrate);
var amount = Add(notaxamount, tax); //(parseFloat(notaxamount).add(parseFloat(tax))).toFixed(2);
e.record.set('Amount', amount);
e.record.set('Tax', tax);
this.calcDetailTotal();
} else if (e.field == 'Currency') {
var FeeType = e.record.data['FeeType'];
if (e.value == LOCALCURR) {
e.record.set('ExChangerate', 1);
} else {
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', e.value);
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
if (FeeType == 2)
var DEFRATE = ffdata.CRDEFRATE;
else
var DEFRATE = ffdata.DEFRATE;
e.record.set('ExChangerate', DEFRATE);
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', e.value);
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
if (FeeType == 2)
var DEFRATE = dfdata.DEFRATE;
else
var DEFRATE = dfdata.DEFRATE;
e.record.set('ExChangerate', DEFRATE);
} else {
e.record.set('ExChangerate', 0);
}
}
}
this.calcDetailTotal();
} else if (e.field == 'CustomerType') {
var records = DsStoreQueryBy(this.StoreCustType, 'CUSTTYPE', e.value);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
var custname = this.EditRecord.get(data.CUSTNAME);
e.record.set('CustomerName', custname);
var FeeType = e.record.data['FeeType'];
if (FeeType == 2) {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId:NewGuid(),
CustCode: custname,
CustName: custname,
CodeAndName: custname,
DESCRIPTION:custname
});
this.storeCustomerNameRefCr.add(recordCustCode);
}else {
var recordCustCode = Ext.create('DsShipping.ux.CustomRefModel', {
GId:NewGuid(),
CustCode: custname,
CustName: custname,
CodeAndName: custname,
DESCRIPTION:custname
});
this.storeCustomerNameRefDr.add(recordCustCode);
}
} else {
// e.record.set('CustomerName', 0);
}
}else if (e.field == 'MANAGER') {
var records = DsStoreQueryBy(this.storeManagerDr, 'GID', e.value);
if (records.getCount() > 0) {
var data = records.getAt(0).data;
e.record.set('MANAGERREF', data.UserName);
} else {
// e.record.set('CustomerName', 0);
}
}
},
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');
if (curr == LOCALCURR) {
rmbdr = parseFloat(rmbdr) + parseFloat(value);
notaxrmbdr = parseFloat(notaxrmbdr) + parseFloat(notaxvalue);
} else if (curr == 'USD') {
usddr = parseFloat(usddr) + parseFloat(value);
notaxusddr = parseFloat(notaxusddr) + parseFloat(notaxvalue);
} else {
otdr = parseFloat(otdr) + parseFloat(value);
notaxotdr = parseFloat(notaxotdr) + parseFloat(notaxvalue);
}
ttldr = parseFloat(ttldr) + parseFloat(value) * parseFloat(rate);
notaxttldr = parseFloat(notaxttldr) + parseFloat(notaxvalue) * parseFloat(rate);
}
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');
if (curr == LOCALCURR) {
rmbcr = parseFloat(rmbcr) + parseFloat(value);
notaxrmbcr = parseFloat(notaxrmbcr) + parseFloat(notaxvalue);
} else if (curr == 'USD') {
usdcr = parseFloat(usdcr) + parseFloat(value);
notaxusdcr = parseFloat(notaxusdcr) + parseFloat(notaxvalue);
} else {
otcr = parseFloat(otcr) + parseFloat(value);
notaxotcr = parseFloat(notaxotcr) + parseFloat(notaxvalue);
}
ttlcr = parseFloat(ttlcr) + parseFloat(value) * parseFloat(rate);
notaxttlcr = parseFloat(notaxttlcr) + parseFloat(notaxvalue) * parseFloat(rate);
}
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);
}
for (i = 0; i < this.storeBodySum.getCount(); i += 1) {
var memberyf = this.storeBodySum.getAt(i);
if (memberyf.data.CURR == LOCALCURR) {
memberyf.set("NORATEDR", notaxrmbdr);
memberyf.set("DR", rmbdr);
memberyf.set("NORATECR", notaxrmbcr);
memberyf.set("CR", rmbcr);
memberyf.set("NORATEPR", notaxrmbprofit);
memberyf.set("PR", rmbprofit);
memberyf.commit();
} else if (memberyf.data.CURR == 'USD') {
memberyf.set("NORATEDR", notaxusddr);
memberyf.set("DR", usddr);
memberyf.set("NORATECR", notaxusdcr);
memberyf.set("CR", usdcr);
memberyf.set("NORATEPR", notaxusdprofit);
memberyf.set("PR", usdprofit);
memberyf.commit();
} if (memberyf.data.CURR == '其他币别') {
memberyf.set("NORATEDR", notaxotdr);
memberyf.set("DR", otdr);
memberyf.set("NORATECR", notaxotcr);
memberyf.set("CR", otcr);
memberyf.set("NORATEPR", notaxotprofit);
memberyf.set("PR", otprofit);
memberyf.commit();
} if (memberyf.data.CURR == '合计') {
memberyf.set("NORATEDR", notaxttldr);
memberyf.set("DR", ttldr);
memberyf.set("NORATECR", notaxttlcr);
memberyf.set("CR", ttlcr);
memberyf.set("NORATEPR", notaxttlprofit);
memberyf.set("PR", ttlprofit);
memberyf.commit();
}
}
this.setTotalHead();
},
setHeadFieldValue: function (fieldName, value) {
var field = this.formtotal.getForm().findField(fieldName);
field.setValue(value);
},
setTotalHead: 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 rmbprofit = 0;
var usdprofit = 0;
var otprofit = 0;
var ttlprofit = 0;
var profitrate = 0;
var amendstr = '';
var PROFITTYPE = Ext.getCmp('PROFITTYPE').getValue();
if (PROFITTYPE == 'NOTAX') {
for (i = 0; i < this.storeBodySum.getCount(); i += 1) {
var memberyf = this.storeBodySum.getAt(i);
if (memberyf.data.CURR == LOCALCURR) {
amendstr = memberyf.data.AMENDSTR;
rmbdr = memberyf.data.NORATEDR;
rmbcr = memberyf.data.NORATECR;
rmbprofit = memberyf.data.NORATEPR;
} else if (memberyf.data.CURR == 'USD') {
usddr = memberyf.data.NORATEDR;
usdcr = memberyf.data.NORATECR;
usdprofit = memberyf.data.NORATEPR;
} if (memberyf.data.CURR == '其他币别') {
otdr = memberyf.data.NORATEDR;
otcr = memberyf.data.NORATECR;
otprofit = memberyf.data.PR;
} if (memberyf.data.CURR == '合计') {
ttldr = memberyf.data.NORATEDR;
ttlcr = memberyf.data.NORATECR;
ttlprofit = memberyf.data.NORATEPR;
profitrate = memberyf.data.NOTAXPROFITRATE;
}
}
} else {
for (i = 0; i < this.storeBodySum.getCount(); i += 1) {
var memberyf = this.storeBodySum.getAt(i);
if (memberyf.data.CURR == LOCALCURR) {
amendstr = memberyf.data.AMENDSTR;
rmbdr = memberyf.data.DR;
rmbcr = memberyf.data.CR;
rmbprofit = memberyf.data.PR;
} else if (memberyf.data.CURR == 'USD') {
usddr = memberyf.data.DR;
usdcr = memberyf.data.CR;
usdprofit = memberyf.data.PR;
} if (memberyf.data.CURR == '其他币别') {
otdr = memberyf.data.DR;
otcr = memberyf.data.CR;
otprofit = memberyf.data.PR;
} if (memberyf.data.CURR == '合计') {
ttldr = memberyf.data.DR;
ttlcr = memberyf.data.CR;
ttlprofit = memberyf.data.PR;
profitrate = memberyf.data.PROFITRATE;
}
}
}
var rmblb = "";
var usdlb = "";
var otlb = "";
var ttllb = "";
if (rmbdr != 0 || rmbcr != 0 || (rmbprofit != 0&&rmbprofit !="***")) {
rmblb = "   " + LOCALCURR + "应收:" + returnfloat(rmbdr) + "    " + LOCALCURR + "应付: " + returnfloat(rmbcr) + "   " + LOCALCURR + "利润:" + returnfloat(rmbprofit) + "   |";
// rmblb = "统计信息(文字标题)(字段名-中文):(字段值-负值)(字段名-中文):(字段值-正值)";
}
if (usddr != 0 || usdcr != 0 || (usdprofit != 0&&usdprofit !="***")) {
usdlb = "   USD应收: " + returnfloat(usddr) + "   USD应付:" + returnfloat(usdcr) + "   USD利润" + returnfloat(usdprofit) + "   |";
}
if (otdr != 0 || otcr != 0 || (otprofit != 0&&otprofit !="***")) {
otlb = "   其他币别应收: " + returnfloat(otdr) + "    其他币别应付:" + returnfloat(otcr) + "   其他币别利润" + returnfloat(otprofit) + "   |";
}
if (ttlprofit<0){
//if (ttldr != 0 || ttlcr != 0 || (ttlprofit != 0&&ttlprofit!="***")) {
ttllb = "   合计应收: " + returnfloat(ttldr) + "   合计应付:" + returnfloat(ttlcr) + "   合计利润" + returnfloat(ttlprofit) + "  利润率" + returnfloat(profitrate) + "";
//}
} else {
//if (ttldr != 0 || ttlcr != 0 || (ttlprofit != 0&&ttlprofit!="***")) {
ttllb = "   合计应收: " + returnfloat(ttldr) + "   合计应付:" + returnfloat(ttlcr) + "   合计利润" + returnfloat(ttlprofit) + "  利润率" + returnfloat(profitrate) + "";
//}
}
if (amendstr != '') {
amendstr = "   " + amendstr + ""
}
this.tabTotal.setTitle("利润合计:" + rmblb + usdlb + otlb + ttllb + amendstr);
},
//#endregion
cellEditingChFeeBeforeEdit: function (editor, e) {
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return false;
}
var chfeefeeStatus = e.record.get('FeeStatus');
var canedit = chfeefeeStatus == 1 || chfeefeeStatus == 6;
var IsDebit = e.record.get('IsDebit');
if (canedit) {
if (IsDebit == 'True' || IsDebit == '1') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiDuiZhangWuFaXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
};
if (canedit) {
if (e.record.get('Invoice') != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiKaiChuFaPiaoWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
}
if (canedit) {
if (e.record.get('OrderAmount') != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingFeiYongWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
}
if (canedit) {
if (e.record.get('OrderInvoice') != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShenQingKaiPiaoWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
}
if (canedit) {
if (e.record.get('INVLINKGID') != '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.DangQianFeiYongYiShengChenFaPiaoZizhuWuFaShenQingXiuGai, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
}
if (canedit) {
var type = e.record.get('FeeType');
var op = e.record.get('EnteroPerator');
var opname = e.record.get('OpName');
if (type == 1) {
var records = DsStoreQueryBy(this.StoreDrOpRange, 'OPID', op);
if (records.getCount() > 0) {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限修改' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
} else if (type == 2) {
var records = DsStoreQueryBy(this.StoreCrOpRange, 'OPID', op);
if (records.getCount() > 0) {
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: '你没有权限修改' + opname + '录入的费用!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
canedit = false;
}
}
}
return canedit;
},
refBillNoSeChange: function (field, newValue, oldValue) {
// if (newValue != oldValue) {
// alert(newValue + "," + oldValue);
// }
},
onSubmitAuditClick: function (button, event, type) {
var GidStr = '';
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
if (type == 1) {
store = _thisfee.storeDrChFee;
} else if (type == 2) {
store = _thisfee.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
if (type == '1') {
var records = _thisfee.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = _thisfee.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYaoTiJiaoShenHeDeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var insert;
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var bsno = rec.data.BsNo;
if (bsno == '*') {
insert = true;
}
var custname = rec.data.CustomerName;
if (custname == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var FeeName = rec.data.FeeName;
if (FeeName == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = rec.data.Currency;
if (Currency == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = rec.data.ExChangerate;
if (ExChangerate == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiLing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//汇率不能为0!
return;
};
var Amount = rec.data.Amount;
if (Amount == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JinEWeiLingBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (_thisfee.CustTypeMust == 1) {
var CustomerType = rec.data.CustomerType;
if (CustomerType == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FeeFrtMust == 1) {
var FeeFrt = rec.data.FeeFrt;
if (FeeFrt == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FRTWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FEEMANGERMUSTBE == 1) {
var MANAGER = rec.data.MANAGER;
if (MANAGER == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.MANAGERWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
}
//if (insert == true) {
// Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//}
var iSuccess = 0;
var iFailure = 0;
var postCount = 0;
var postBillNO = "";
var loadVal = 0;
var bodyDrChFeeDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 1 || feeStatus == 6;
if (canDelete == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.ZiNengTiJiaoFuHeTiaoJianDeFeiYong, //'只能费用状态为[录入状态]和[驳回提交]的费用才能提交审核,请重新选择',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
bodyDrChFeeDatas.push(rec);
GidStr = GidStr + Gid;
}
}
var jsonChFeeBody = ConvertRecordsToJsonAll(bodyDrChFeeDatas);
if (GidStr == '') {
} else {
var urlStr='/Account/Chfee_Audit/SubmitAuditNew';
if (_thisfee.amendfee=='1')
urlStr='/Account/Chfee_Audit/SubmitAuditNewAmend';
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: urlStr,
params: {
feebody: jsonChFeeBody,
optype: _thisfee.stroplb,
bsno: _thisfee.strBSNO
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
//_this.storeDrChFee.load({ params: { billno: _this.strBSNO, type: 1, optype: _this.stroplb} });
_thisfee.LoadDrChFee(button, event);
} else {
//_this.storeCrChFee.load({ params: { billno: _this.strBSNO, type: 2, optype: _this.stroplb} });
_thisfee.LoadCrChFee(button, event);
}
_thisfee.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
_thisfee.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, oplb: _thisfee.stroplb },
callback: function (r, options, success) {
if (success) {
_thisfee.setTotalHead();
}
}
});
if (result.Data != '') {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: '已提交审核,' + result.Data,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onSubmitAuditOpClick: function (button, event, type) {
var GidStr = '';
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
if (type == 1) {
store = _thisfee.storeDrChFee;
} else if (type == 2) {
store = _thisfee.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
//var modifyrecords = store.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
//var phantoms = store.getNewRecords(); //获得幻影行
//modifyrecords = modifyrecords.concat(phantoms); //将幻影数据与真实数据合并
//if (modifyrecords.length != 0) {
// Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//}
if (type == '1') {
var records = _thisfee.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = _thisfee.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYaoTiJiaoShenHeDeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//请先选择要提交审核的费用!
return;
}
var insert;
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var bsno = rec.data.BsNo;
if (bsno == '*') {
insert = true;
}
var custname = rec.data.CustomerName;
if (custname == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var FeeName = rec.data.FeeName;
if (FeeName == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = rec.data.Currency;
if (Currency == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = rec.data.ExChangerate;
if (ExChangerate == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiLing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Amount = rec.data.Amount;
if (Amount == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JinEWeiLingBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (_thisfee.CustTypeMust == 1) {
var CustomerType = rec.data.CustomerType;
if (CustomerType == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FeeFrtMust == 1) {
var FeeFrt = rec.data.FeeFrt;
if (FeeFrt == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FRTWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FEEMANGERMUSTBE == 1) {
var MANAGER = rec.data.MANAGER;
if (MANAGER == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.MANAGERWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
}
//if (insert == true) {
// Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
// return;
//}
var iSuccess = 0;
var iFailure = 0;
var postCount = 0;
var postBillNO = "";
var loadVal = 0;
var bodyDrChFeeDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 1 || feeStatus == 6;
if (canDelete == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.ZiNengTiJiaoFuHeTiaoJianDeFeiYong, //'只能费用状态为[录入状态]和[驳回提交]的费用才能提交审核,请重新选择',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
bodyDrChFeeDatas.push(rec);
GidStr = GidStr + Gid;
}
}
var jsonChFeeBody = ConvertRecordsToJsonAll(bodyDrChFeeDatas);
if (GidStr == '') {
} else {
var urlStr='/Account/Chfee_Audit/SubmitAuditOp';
if (_thisfee.amendfee=='1')
urlStr='/Account/Chfee_Audit/SubmitAuditOpAmend';
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url:urlStr,
params: {
feebody: jsonChFeeBody,
optype: _thisfee.stroplb,
bsno: _thisfee.strBSNO
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
//_this.storeDrChFee.load({ params: { billno: _this.strBSNO, type: 1, optype: _this.stroplb} });
_thisfee.LoadDrChFee(button, event);
} else {
//_this.storeCrChFee.load({ params: { billno: _this.strBSNO, type: 2, optype: _this.stroplb} });
_thisfee.LoadCrChFee(button, event);
}
this.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
this.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, oplb: _thisfee.stroplb },
callback: function (r, options, success) {
if (success) {
_thisfee.setTotalHead();
}
}
});
if (result.Data != '') {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: '已提交审核,' + result.Data,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onSubmitAuditNewClick: function (button, event, type) {
var GidStr = '';
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
if (type == 1) {
store = _thisfee.storeDrChFee;
} else if (type == 2) {
store = _thisfee.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
var modifyrecords = store.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
var phantoms = store.getNewRecords(); //获得幻影行
modifyrecords = modifyrecords.concat(phantoms); //将幻影数据与真实数据合并
if (modifyrecords.length != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (type == '1') {
var records = _thisfee.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = _thisfee.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYaoTiJiaoShenHeDeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var insert;
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var bsno = rec.data.BsNo;
if (bsno == '*') {
insert = true;
}
var custname = rec.data.CustomerName;
if (custname == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var FeeName = rec.data.FeeName;
if (FeeName == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = rec.data.Currency;
if (Currency == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = rec.data.ExChangerate;
if (ExChangerate == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiLing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Amount = rec.data.Amount;
if (Amount == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JinEWeiLingBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//金额为0,不能提交!
return;
};
if (_thisfee.CustTypeMust == 1) {
var CustomerType = rec.data.CustomerType;
if (CustomerType == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FeeFrtMust == 1) {
var FeeFrt = rec.data.FeeFrt;
if (FeeFrt == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FRTWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FEEMANGERMUSTBE == 1) {
var MANAGER = rec.data.MANAGER;
if (MANAGER == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.MANAGERWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
}
if (insert == true) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });//有未保存的费用,请先保存费用然后再提交审核!
return;
}
var iSuccess = 0;
var iFailure = 0;
var postCount = 0;
var postBillNO = "";
var loadVal = 0;
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 1 || feeStatus == 6;
if (canDelete == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.ZiNengTiJiaoFuHeTiaoJianDeFeiYong, //'只能费用状态为[录入状态]和[驳回提交]的费用才能提交审核,请重新选择',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
}
if (GidStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: '/Account/Chfee_Audit/SubmitAudit',
params: {
GidStr: GidStr,
optype: _thisfee.stroplb
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
//_this.storeDrChFee.load({ params: { billno: _this.strBSNO, type: 1, optype: _this.stroplb} });
_thisfee.LoadDrChFee(button, event);
} else {
//_this.storeCrChFee.load({ params: { billno: _this.strBSNO, type: 2, optype: _this.stroplb} });
_thisfee.LoadCrChFee(button, event);
}
this.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
this.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, oplb: _thisfee.stroplb },
callback: function (r, options, success) {
if (success) {
_thisfee.setTotalHead();
}
}
});
if (result.Data != '' && result.Data != null) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: '已提交审核,' + result.Data,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onSubmitAuditAllClick: function (button, event, type) {
var GidStr = '';
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
if (type == 1) {
store = _thisfee.storeDrChFee;
} else if (type == 2) {
store = _thisfee.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
for (var i = 0; i < store.getCount(); i++) {
var rec = store.getAt(i);
var bsno = rec.data.BsNo;
if (bsno == '*') {
insert = true;
}
var custname = rec.data.CustomerName;
if (custname == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var FeeName = rec.data.FeeName;
if (FeeName == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = rec.data.Currency;
if (Currency == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = rec.data.ExChangerate;
if (ExChangerate == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiLing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Amount = rec.data.Amount;
if (Amount == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JinEWeiLingBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (_thisfee.CustTypeMust == 1) {
var CustomerType = rec.data.CustomerType;
if (CustomerType == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FeeFrtMust == 1) {
var FeeFrt = rec.data.FeeFrt;
if (FeeFrt == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FRTWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FEEMANGERMUSTBE == 1) {
var MANAGER = rec.data.MANAGER;
if (MANAGER == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.MANAGERWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
}
var modifyrecords = store.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
var phantoms = store.getNewRecords(); //获得幻影行
modifyrecords = modifyrecords.concat(phantoms); //将幻影数据与真实数据合并
if (modifyrecords.length != 0) {
var bodyDrChFeeDatas = [];
var i;
if (type == '1') {
for (i = 0; i < _thisfee.storeDrChFee.getCount(); i += 1) {
var memberyf = _thisfee.storeDrChFee.getAt(i);
bodyDrChFeeDatas.push(memberyf);
var ExChangerate = memberyf.data.ExChangerate;
};
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
} else if (type == '2') {
for (i = 0; i < _thisfee.storeCrChFee.getCount(); i += 1) {
var memberyf = _thisfee.storeCrChFee.getAt(i);
bodyDrChFeeDatas.push(memberyf);
var amount = memberyf.data.Amount;
var ExChangerate = memberyf.data.ExChangerate;
};
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
};
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
url: '/MvcShipping/MsChFee/Save',
scope: this,
params: {
bsno: _thisfee.strBSNO,
type: type,
chfeebody: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
if (type == '1') {
for (var i = 0; i < _thisfee.storeDrChFee.getCount(); i += 1) {
var member = _thisfee.storeDrChFee.getAt(i);
member.set("BsNo", _thisfee.strBSNO);
member.commit();
}
} else if (type == '2') {
for (var i = 0; i < _thisfee.storeCrChFee.getCount(); i += 1) {
var member = _thisfee.storeCrChFee.getAt(i);
member.set("BsNo", _thisfee.strBSNO);
member.commit();
}
}
_thisfee.onSubmitAuditAllfn(button, event, type);
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
} else {
_thisfee.onSubmitAuditAllfn(button, event, type);
}
},
onSubmitAuditAllfn: function (button, event, type) {
var GidStr = '';
var store = null;
if (type == 1) {
store = this.storeDrChFee;
} else if (type == 2) {
store = this.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
var bodyDrChFeeDatas = [];
for (var i = 0; i < store.getCount(); i++) {
var rec = store.getAt(i);
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 1 || feeStatus == 6;
if (canDelete == false) {
} else {
bodyDrChFeeDatas.push(rec);
GidStr = GidStr + ',' + Gid;
}
}
if (GidStr == '') {
} else {
var jsonChFeeBody = ConvertRecordsToJsonAll(bodyDrChFeeDatas);
var urlStr='/Account/Chfee_Audit/SubmitAuditNew';
if (_thisfee.amendfee=='1')
urlStr='/Account/Chfee_Audit/SubmitAuditNewAmend';
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: urlStr,
params: {
feebody: jsonChFeeBody,
optype: _thisfee.stroplb
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
//_this.storeDrChFee.load({ params: { billno: _this.strBSNO, type: 1, optype: _this.stroplb} });
_thisfee.LoadDrChFee(button, event);
} else {
//_this.storeCrChFee.load({ params: { billno: _this.strBSNO, type: 2, optype: _this.stroplb} });
_thisfee.LoadCrChFee(button, event);
}
_thisfee.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
_thisfee.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, oplb: _thisfee.stroplb} });
if (result.Data != '' && result.Data != null) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: '已提交审核,' + result.Data,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onSubmitAuditBillClick: function (button, event, type) {
var GidStr = '';
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
if (type == 1) {
store = _thisfee.storeDrChFee;
} else if (type == 2) {
store = _thisfee.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
for (var i = 0; i < _thisfee.storeDrChFee.getCount(); i++) {
var rec = _thisfee.storeDrChFee.getAt(i);
var bsno = rec.data.BsNo;
if (bsno == '*') {
insert = true;
}
var custname = rec.data.CustomerName;
if (custname == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var FeeName = rec.data.FeeName;
if (FeeName == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = rec.data.Currency;
if (Currency == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = rec.data.ExChangerate;
if (ExChangerate == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiLing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Amount = rec.data.Amount;
if (Amount == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JinEWeiLingBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (_thisfee.CustTypeMust == 1) {
var CustomerType = rec.data.CustomerType;
if (CustomerType == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FeeFrtMust == 1) {
var FeeFrt = rec.data.FeeFrt;
if (FeeFrt == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FRTWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FEEMANGERMUSTBE == 1) {
var MANAGER = rec.data.MANAGER;
if (MANAGER == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.MANAGERWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
}
for (var i = 0; i < _thisfee.storeCrChFee.getCount(); i++) {
var rec = _thisfee.storeCrChFee.getAt(i);
var bsno = rec.data.BsNo;
if (bsno == '*') {
insert = true;
}
var custname = rec.data.CustomerName;
if (custname == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var FeeName = rec.data.FeeName;
if (FeeName == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FeiYongMingChengBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Currency = rec.data.Currency;
if (Currency == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.BiBieBuNengWeiKong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var ExChangerate = rec.data.ExChangerate;
if (ExChangerate == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.HuiLvBuNengWeiLing, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
var Amount = rec.data.Amount;
if (Amount == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.JinEWeiLingBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
if (_thisfee.CustTypeMust == 1) {
var CustomerType = rec.data.CustomerType;
if (CustomerType == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.KeHuLeiBieWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FeeFrtMust == 1) {
var FeeFrt = rec.data.FeeFrt;
if (FeeFrt == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.FRTWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
if (_thisfee.FEEMANGERMUSTBE == 1) {
var MANAGER = rec.data.MANAGER;
if (MANAGER == '') {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.MANAGERWeiKongBuNengTiJiao, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
};
}
}
var modifyrecords = _thisfee.storeDrChFee.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
var phantoms = _thisfee.storeDrChFee.getNewRecords(); //获得幻影行
modifyrecords = modifyrecords.concat(phantoms); //将幻影数据与真实数据合并
var crmodifyrecords = _thisfee.storeCrChFee.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
var crphantoms = _thisfee.storeCrChFee.getNewRecords(); //获得幻影行
crmodifyrecords = crmodifyrecords.concat(crphantoms); //将幻影数据与真实数据合并
if (modifyrecords.length != 0 || crmodifyrecords.length != 0) {
var bodyDrChFeeDatas = [];
var i;
for (i = 0; i < _thisfee.storeDrChFee.getCount(); i += 1) {
var memberyf = _thisfee.storeDrChFee.getAt(i);
bodyDrChFeeDatas.push(memberyf);
var ExChangerate = memberyf.data.ExChangerate;
};
for (i = 0; i < _thisfee.storeCrChFee.getCount(); i += 1) {
var memberyf = _thisfee.storeCrChFee.getAt(i);
bodyDrChFeeDatas.push(memberyf);
var amount = memberyf.data.Amount;
var ExChangerate = memberyf.data.ExChangerate;
};
var jsonChFeeBody = ConvertFeeRecordsToJson(bodyDrChFeeDatas);
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiCaoZuoShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在保存数据...',
url: '/MvcShipping/MsChFee/Save',
scope: this,
params: {
bsno: _thisfee.strBSNO,
type: type,
chfeebody: jsonChFeeBody
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
for (var i = 0; i < _thisfee.storeDrChFee.getCount(); i += 1) {
var member = _thisfee.storeDrChFee.getAt(i);
member.set("BsNo", _thisfee.strBSNO);
member.commit();
}
for (var i = 0; i < _thisfee.storeCrChFee.getCount(); i += 1) {
var member = _thisfee.storeCrChFee.getAt(i);
member.set("BsNo", _thisfee.strBSNO);
member.commit();
}
_thisfee.onSubmitAuditBillfn(button, event, type);
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
} else {
_thisfee.onSubmitAuditBillfn(button, event, type);
}
},
onSubmitAuditBillfn: function (button, event, type) {
var GidStr = '';
var bsno = _thisfee.strBSNO;
var ttlproft = 0;
for (var i = 0; i < _thisfee.storeBodySum.getCount(); i++) {
var rec = _thisfee.storeBodySum.getAt(i);
var CURR = rec.data.CURR;
if (CURR == '合计') ttlproft = parseFloat(rec.data.PR).toFixed(2);
}
var bodyDrChFeeDatas = [];
for (var i = 0; i < _thisfee.storeDrChFee.getCount(); i++) {
var rec = _thisfee.storeDrChFee.getAt(i);
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 1 || feeStatus == 6;
if (canDelete == false) {
} else {
bodyDrChFeeDatas.push(rec);
GidStr = GidStr + ',' + Gid;
}
}
for (var i = 0; i < _thisfee.storeCrChFee.getCount(); i++) {
var rec = _thisfee.storeCrChFee.getAt(i);
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 1 || feeStatus == 6;
if (canDelete == false) {
} else {
bodyDrChFeeDatas.push(rec);
GidStr = GidStr + ',' + Gid;
}
}
var urlStr = '/Account/Chfee_Audit/SubmitAuditBL';
if (_thisfee.amendfee == '1')
urlStr = '/Account/Chfee_Audit/SubmitAuditBLAmend';
if (ttlproft <= 0) {
Ext.MessageBox.confirm(Zi.LAN.FEE.TiShi, '利润为' + ttlproft + '确定要整票提交吗?', function (btn) {
if (btn == 'yes') {
if (GidStr == '') {
} else {
var jsonChFeeBody = ConvertRecordsToJsonAll(bodyDrChFeeDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: urlStr,
params: {
feebody: jsonChFeeBody,
optype: _thisfee.stroplb,
bsno: bsno
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_thisfee.LoadDrChFee(button, event);
_thisfee.LoadCrChFee(button, event);
_thisfee.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
_thisfee.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb } });
if (result.Data != '') {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: '已提交审核,' + result.Data,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
}
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiChaXunShuJu, //'正在组织数据...',
url: '/MvcShipping/MsChFee/GetFeeLock',
scope: this,
params: {
bsno: _thisfee.strBSNO
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
_thisfee.EditRecord.set('FEESTATUS', true);
} else {
}
} else {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
}
});
} else {
if (GidStr == '') {
} else {
var jsonChFeeBody = ConvertRecordsToJsonAll(bodyDrChFeeDatas);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: urlStr,
params: {
feebody: jsonChFeeBody,
optype: _thisfee.stroplb,
bsno: bsno
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
_thisfee.LoadDrChFee(button, event);
_thisfee.LoadCrChFee(button, event);
_thisfee.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
_thisfee.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
}
},
onCancelAuditNewClick: function (menu, event, type) {
var GidStr = '';
var allow = _thisfee.getAllowOperationDetail();
if (allow == false) {
return;
}
var store = null;
if (type == 1) {
store = _thisfee.storeDrChFee;
} else if (type == 2) {
store = _thisfee.storeCrChFee;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
var modifyrecords = store.getUpdatedRecords(); // 获取修改的行的数据,无法获取幻影数据
var phantoms = store.getNewRecords(); //获得幻影行
modifyrecords = modifyrecords.concat(phantoms); //将幻影数据与真实数据合并
if (modifyrecords.length != 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianBaoCunFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (type == '1') {
var records = _thisfee.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = _thisfee.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var iSuccess = 0;
var iFailure = 0;
var postCount = 0;
var postBillNO = "";
var loadVal = 0;
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
var canDelete = feeStatus == 2;
if (canDelete == false) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.ZiNengTiJiaoFuHeTiaoJianDeFeiYong2, //'只能费用状态为[提交审核]的费用才能撤销提交审核,请重新选择',
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
} else {
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
}
if (GidStr == '') {
} else {
var urlStr='/Account/Chfee_Audit/CancelAudit';
if (_thisfee.amendfee=='1')
urlStr='/Account/Chfee_Audit/CancelAuditAmend';
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在添加数据...',
url: urlStr,
params: {
GidStr: GidStr,
optype: _thisfee.stroplb
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
//_this.storeDrChFee.load({ params: { billno: _this.strBSNO, type: 1, optype: _this.stroplb} });
_thisfee.LoadDrChFee();
} else {
//_this.storeCrChFee.load({ params: { billno: _this.strBSNO, type: 2, optype: _this.stroplb} });
_thisfee.LoadCrChFee();
}
_thisfee.storeChFeeGain.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
_thisfee.storeBodySum.load({ params: { bsno: _thisfee.strBSNO, optype: _thisfee.stroplb} });
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onViewWorkFlowDetailClick:function(button, event, type){
if (type == '1') {
var records = _thisfee.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = _thisfee.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var record = records[0];
var feeStatus = record.data.FeeStatus;
var Gid = record.data.GId;
var IsOpen = record.data.IsOpen;
var WorkFlowName = "FeeOpOpOtherRecvPayAudit";
if (IsOpen == '1' || IsOpen == 'True') {
WorkFlowName = "YjFeefyAudit";
} else if ((_thisfee.amendfee == '1') && (_thisfee.AMENDSELFWORKFLOW == 1)) {
WorkFlowName = "AmendFeefyAudit";
} else {
if (feeStatus == 3 || feeStatus == 4) {
WorkFlowName = "FeeOpOtherModifyAudit";
if (_thisfee.stroplb == "op_Seae") {
WorkFlowName = "FeeModifyAudit";
} if (_thisfee.stroplb == "op_Seai") {
WorkFlowName = "FeeSeaiModifyAudit";
} if (_thisfee.stroplb == "op_Aire") {
WorkFlowName = "AireFeeModify";
} if (_thisfee.stroplb == "op_Airi") {
WorkFlowName = "AiriFeeModify";
} if (_thisfee.stroplb == "op_Apply") {
WorkFlowName = "ApplyFeeModify";
} if (_thisfee.stroplb == "op_Bulk") {
WorkFlowName = "BulkFeeModify";
} if (_thisfee.stroplb == "op_other" || this.stroplb == "tMsWlPcHead" || this.stroplb == "OpCtnBsCard") {
WorkFlowName = "FeeOpOtherModifyAudit";
} if (_thisfee.stroplb == "op_railway") {
WorkFlowName = "RailwayFeeModify";
}
} else {
if (_thisfee.stroplb == "op_Seae") {
WorkFlowName = "FeeRecvPayAudit";
} if (_thisfee.stroplb == "op_Seai") {
WorkFlowName = "FeeSeaiRecvPayAudit";
} if (_thisfee.stroplb == "op_Aire") {
WorkFlowName = "AireFeeAudit";
} if (_thisfee.stroplb == "op_Airi") {
WorkFlowName = "AiriFeeAudit";
} if (_thisfee.stroplb == "op_Apply") {
WorkFlowName = "ApplyFeeAudit";
} if (_thisfee.stroplb == "op_Bulk") {
WorkFlowName = "BulkFeeAudit";
} if (_thisfee.stroplb == "op_other" || this.stroplb == "tMsWlPcHead" || this.stroplb == "OpCtnBsCard") {
WorkFlowName = "FeeOpOpOtherRecvPayAudit";
} if (_thisfee.stroplb == "op_railway") {
WorkFlowName = "RailwayFeeAudit";
}
}
}
var openSet = "height=700, width=1024, toolbar=no, menubar=no,scrollbars=1, resizable=1,location=no, status=no,Top= " + (screen.height - 750) / 2 + ",Left= " + (screen.width - 1100) / 2
var openType = "_blank";
var openUrl = "";
var openUrl = "../../Account/Chfee_payapplication/Map?bsno=" + Gid + "&name=";
window.open(openUrl, openType, openSet);
},
onNoIvoiceClick: function (button, event, type) {
var GidStr = '';
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
_this = this;
if (GidStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在提交数据...',
url: '/Account/Chfee_Audit/NoIvoice',
params: {
bill: GidStr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
_thisfee.LoadDrChFee();
} else {
_thisfee.LoadCrChFee();
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
onCancelNoIvoiceClick: function (button, event, type) {
var GidStr = '';
if (type == '1') {
var records = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == '2') {
var records = this.feeCrGridCheckBoxModel.selected.items;
};
if (records.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeFeiYong, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
// isAll = this.comboxaddDCType.getValue();
for (var i = 0; i < records.length; i++) {
var rec = records[i];
var feeStatus = rec.data.FeeStatus;
var Gid = rec.data.GId;
if (GidStr == '')
GidStr = Gid;
else {
GidStr = GidStr + ',' + Gid;
}
}
_this = this;
if (GidStr == '') {
} else {
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiCaoZuoShuJu, //'正在提交数据...',
url: '/Account/Chfee_Audit/CancelNoIvoice',
params: {
bill: GidStr
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (!result.Success) {
Ext.Msg.show({
title: Zi.LAN.FEE.TiShi,
msg: result.Message,
icon: Ext.MessageBox.ERROR,
buttons: Ext.Msg.OK
});
return;
} else {
if (type == 1) {
_thisfee.LoadDrChFee();
} else {
_thisfee.LoadCrChFee();
}
}
} else {
Ext.MessageBox.alert(Zi.LAN.FEE.FuWuQiXiangYingChuCuo, response.responseText);
}
},
scope: this
});
}
},
getModifyStatus: function () {
var drmodify = this.storeDrChFee.getModifiedRecords();
var crmodify = this.storeCrChFee.getModifiedRecords();
if (drmodify.length != 0 || crmodify.length != 0) {
return true
} else {
for (i = 0; i < this.storeDrChFee.getCount(); i += 1) {
var memberyf = this.storeDrChFee.getAt(i);
if (memberyf.data.BsNo == "*")
return true
}
for (i = 0; i < this.storeCrChFee.getCount(); i += 1) {
var memberyf = this.storeCrChFee.getAt(i);
if (memberyf.data.BsNo == "*")
return true
}
return false;
}
},
loadUnit: function () {
this.StoreUnit.reload();
},
getFeeStatus: function () {
var feeStatus = this.EditRecord.get('FEESTATUS');
return feeStatus;
},
getBillStatus: function () {
// var basicForm = this.formEdit.getForm();
// var billStatus = basicForm.findField('BillStatus').value;
// return billStatus;
},
getCustName: function () {
// var custName = this.formEdit.getForm().findField('RefCustomerName');
//return custName.getValue();
},
setSaveBtnStatus: function (enable) {
var bsbtnSave = Ext.getCmp('pcbtnSave');
var bsbtnSaveAndClose = Ext.getCmp('pcbtnSaveAndClose');
var bsbtnSaveAndNew = Ext.getCmp('pcbtnSaveAndNew');
var pcbtnNew = Ext.getCmp('pcbtnNew');
if (enable) {
bsbtnSave.enable();
bsbtnSaveAndClose.enable();
bsbtnSaveAndNew.enable();
pcbtnNew.enable();
} else {
//bsbtnSave.disable();
//bsbtnSaveAndClose.disable();
bsbtnSaveAndNew.disable();
pcbtnNew.disable();
}
},
OprationSwap: function () {
var ret = new Array();
ret[0] = this.stroplb;
ret[1] = this.feeType;
ret[2] = this.storeDrChFee;
ret[3] = this.storeCrChFee;
ret[4] = " b.BSNO='" + this.strBSNO + "' and " + this.SelectFeeGid;
ret[5] = this.SelectFeeGid;
return ret;
},
onPrintSelectDetailClick: function (button, event, type) {
var MBLNO = "";
var USDEXRATE = 0;
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', 'USD');
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
USDEXRATE = ffdata.DEFRATE;
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', 'USD');
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
USDEXRATE = dfdata.DEFRATE;
}
}
var selectedRecords = [];
var storeadd = null;
if (type == 1) {
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
MBLNO = this.strMBLNO + "应收费用";
} else if (type == 2) {
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
MBLNO = this.strMBLNO + "应付费用";
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (_thisfee.strPBSNO=='') _thisfee.strPBSNO=_thisfee.strBSNO;
if (this.stroplb == 'op_Seae') {
var printType = '';
if (type == 1) {
printType = 'SEAEDRFEE';
} else { printType = 'SEAECRFEE'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seae WHERE BsNo = '" + _thisfee.strPBSNO + "'";
} else if (this.stroplb == 'op_Apply') {
var printType = '';
if (type == 1) {
printType = 'APPLYDRFEE';
} else { printType = 'APPLYCRFEE'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_apply WHERE BsNo = '" + _thisfee.strPBSNO + "'";
} else if (this.stroplb == 'op_Seai') {
var printType = '';
if (type == 1) {
printType = 'SEAIDRFEE';
} else { printType = 'SEAICRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_seai WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_Bulk') {
var printType = '';
if (type == 1) {
printType = 'BULKDRFEE';
} else { printType = 'BULKCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_bulk WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_other') {
var printType = '';
if (type == 1) {
printType = 'OTHERDRFEE';
} else { printType = 'OTHERCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_other WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_railway') {
var printType = '';
if (type == 1) {
printType = 'RAILWAYDRFEE';
} else { printType = 'RAILWAYCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_railway WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_Aire') {
var printType = '';
if (type == 1) {
printType = 'AIREDRFEE';
} else { printType = 'AIRECRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_aire WHERE BsNo = '" + _thisfee.strPBSNO + "'";
} else if (this.stroplb == 'op_Airi') {
var printType = '';
if (type == 1) {
printType = 'AIRIDRFEE';
} else { printType = 'AIRICRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_airi WHERE BsNo = '" + _thisfee.strPBSNO + "'";
};
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "''" + record.get('GId') + "''";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var sql2 = " declare @sql varchar(8000) ";
sql2 = sql2 + " set @sql = 'select bsno '";
sql2 = sql2 + " select @sql = @sql + ' , sum(case feename when ''' + feename + ''' then amount else 0 end) [' + feename + ']' ";
sql2 = sql2 + " from (select name as feename from code_fee where name in ";
sql2 = sql2 + " ('掏箱费','港杂费','关税','增值税','监管费','滞报金','保证金','滞纳金', ";
sql2 = sql2 + " '二次换单费','换单费','报检费','仓储费','分拨费','港杂费','港建费','港口包干费', ";
sql2 = sql2 + " '验货费','熏蒸费','还柜吊柜费','转栈费','海运费','空运费','捆绑费', ";
sql2 = sql2 + " '铁路运费','公路运费','短途运输费','木检运费','搬倒费','装箱费','修箱费', ";
sql2 = sql2 + " '滞箱费','出入库费','拆箱费','吊箱费',";
sql2 = sql2 + " '国际运费','报关费','保险费','包干费','THC','运费','商检验货费','集装箱费'";
sql2 = sql2 + " )) as a set @sql = @sql + ' from ch_fee where bsno=''" + this.strBSNO + "'' ' ";
if (feeGidSql != '') {
sql2 = sql2 + " set @sql = @sql + ' and Gid in (" + feeGidSql + ") '";
}
sql2 = sql2 + "set @sql = @sql +' group by bsno ' exec(@sql) ";
var feeGidSql = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
var feeGId = "'" + record.get('GId') + "'";
if (feeGidSql == '') {
feeGidSql = feeGId;
} else {
feeGidSql = feeGidSql + "," + feeGId;
}
};
var sql3 = "";
if (feeGidSql != '') {
sql3 = sql3 + " Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人,(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where c.Gid in (" + feeGidSql + ") order by sort,LineNum ";
}
var sql4 = " Select ic.*,icc.showname,icc.addr from info_client ic ";
sql4 = sql4 + " left join info_client_contact icc on icc.linkid=ic.gid where shortname=(select customername from v_op_bill where bsno='" + this.strBSNO + "')";
var sql5 = "";
if (feeGidSql != '') {
sql5 = sql5 + " Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人,(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where c.feetype=1 and c.bsno='"+this.strBSNO+"' and c.FEENAME in (SELECT FEENAME FROM CH_FEE WHERE GID IN (" + feeGidSql + ")) order by sort,LineNum ";
}
var sql6 = " SELECT " + USDEXRATE + " AS USDEXRATE FROM [USER]";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO);
},
onPrintCustDetailClick: function (button, event, type) {
var MBLNO = ""; var USDEXRATE = 0;
var FFrecords = DsStoreQueryBy(this.StoreDateCurr, 'CURR', 'USD');
if (FFrecords.getCount() > 0) {
var ffdata = FFrecords.getAt(0).data;
USDEXRATE = ffdata.DEFRATE;
} else {
var DFrecords = DsStoreQueryBy(this.StoreCurr, 'CURR', 'USD');
if (DFrecords.getCount() > 0) {
var dfdata = DFrecords.getAt(0).data;
USDEXRATE = dfdata.DEFRATE;
}
}
var selectedRecords = [];
var storeadd = null;
if (type == 1) {
selectedRecords = this.feeDrGridCheckBoxModel.selected.items;
} else if (type == 2) {
selectedRecords = this.feeCrGridCheckBoxModel.selected.items;
} else {
alert(Zi.LAN.FEE.HanShuCanShuSheZhiBuDui);
return;
}
if (selectedRecords.length == 0) {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi, msg: Zi.LAN.FEE.QingXianXuanZeYeWu, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
if (_thisfee.strPBSNO=='') _thisfee.strPBSNO=_thisfee.strBSNO;
if (this.stroplb == 'op_Seae') {
var printType = '';
if (type == 1) {
printType = 'SEAEDRFEE';
} else { printType = 'SEAECRFEE'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seae WHERE BsNo = '" + _thisfee.strPBSNO + "'";
} else if (this.stroplb == 'op_Apply') {
var printType = '';
if (type == 1) {
printType = 'APPLYDRFEE';
} else { printType = 'APPLYCRFEE'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_apply WHERE BsNo = '" + _thisfee.strPBSNO + "'";
} else if (this.stroplb == 'op_Seai') {
var printType = '';
if (type == 1) {
printType = 'SEAIDRFEE';
} else { printType = 'SEAICRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_seai WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_Bulk') {
var printType = '';
if (type == 1) {
printType = 'BULKDRFEE';
} else { printType = 'BULKCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_bulk WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_other') {
var printType = '';
if (type == 1) {
printType = 'OTHERDRFEE';
} else { printType = 'OTHERCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_other WHERE BsNo = '" +_thisfee.strPBSNO + "'";
} else if (this.stroplb == 'op_railway') {
var printType = '';
if (type == 1) {
printType = 'RAILWAYDRFEE';
} else { printType = 'RAILWAYCRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_railway WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_Aire') {
var printType = '';
if (type == 1) {
printType = 'AIREDRFEE';
} else { printType = 'AIRECRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_aire WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_Airi') {
var printType = '';
if (type == 1) {
printType = 'AIRIDRFEE';
} else { printType = 'AIRICRFEE'; };
var sql1 = /*"SET LANGUAGE 'us_english' "
+ */" select * from op_airi WHERE BsNo = '" +_thisfee.strPBSNO+ "'";
};
var feeGidSql = '';
var custname = '';
for (var i = 0; i < selectedRecords.length; i++) {
var record = selectedRecords[i];
custname = record.get('CustomerName');
var FeeType = record.get('FeeType');
var BsNo = record.get('BsNo');
};
if (type == 1) {
MBLNO = this.strMBLNO + "应收费用" + custname;
} else if (type == 2) {
MBLNO = this.strMBLNO + "应付费用" + custname;
}
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsChFee/GetRangDAStr',
params: {
type:type,
optype:_thisfee.stroplb
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var RangDaStr = result.data;
var sql2 = " declare @sql varchar(8000) ";
sql2 = sql2 + " set @sql = 'select bsno '";
sql2 = sql2 + " select @sql = @sql + ' , sum(case feename when ''' + feename + ''' then amount else 0 end) [' + feename + ']' ";
sql2 = sql2 + " from (select name as feename from code_fee where name in ";
sql2 = sql2 + " ('掏箱费','港杂费','关税','增值税','监管费','滞报金','保证金','滞纳金', ";
sql2 = sql2 + " '二次换单费','换单费','报检费','仓储费','分拨费','港杂费','港建费','港口包干费', ";
sql2 = sql2 + " '验货费','熏蒸费','还柜吊柜费','转栈费','海运费','空运费','捆绑费', ";
sql2 = sql2 + " '铁路运费','公路运费','短途运输费','木检运费','搬倒费','装箱费','修箱费', ";
sql2 = sql2 + " '滞箱费','出入库费','拆箱费','吊箱费',";
sql2 = sql2 + " '国际运费','报关费','保险费','包干费','THC','运费','商检验货费','集装箱费'";
sql2 = sql2 + " )) as a set @sql = @sql + ' from ch_fee where bsno=''" + this.strBSNO + "'' ' ";
if (custname != '') {
sql2 = sql2 + " set @sql = @sql + ' and CustomerName=''" + custname + "'' and Bsno=''" + BsNo + "'' and feetype=" + FeeType + " '";
}
sql2 = sql2 + "set @sql = @sql +' group by bsno ' exec(@sql) ";
var sql3 = "";
sql3 = sql3 + " Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人,(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where c.CustomerName='" + custname + "' and c.BsNo='" + BsNo + "' and c.feetype=" + FeeType;
sql3 = sql3 +" and "+RangDaStr+ " order by sort,LineNum ";
var sql4 = " Select ic.*,icc.showname,icc.addr from info_client ic ";
sql4 = sql4 + " left join info_client_contact icc on icc.linkid=ic.gid where shortname=(select customername from v_op_bill where bsno='" + _thisfee.strBSNO + "')";
var sql5 = "";
var sql6 = " SELECT " + USDEXRATE + " AS USDEXRATE FROM [USER]";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO);
}
} else {
}
},
scope: this
});
},
onPrintAllDetailClick: function (button, event, type) {
var MBLNO = "";
if (type == 1) {
MBLNO = this.strMBLNO + "应收费用";
} else if (type == 2) {
MBLNO = this.strMBLNO + "应付费用";
}
if (_thisfee.strPBSNO=='') _thisfee.strPBSNO=_thisfee.strBSNO;
if (this.stroplb == 'op_Seae') {
var printType = '';
if (type == 1) {
printType = 'SEAEDRFEEALL';
} else { printType = 'SEAECRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seae WHERE BsNo = '" + _thisfee.strPBSNO + "'";
} else if (this.stroplb == 'op_Apply') {
var printType = '';
if (type == 1) {
printType = 'APPLYDRFEEALL';
} else { printType = 'APPLYCRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_apply WHERE BsNo = '" + _thisfee.strPBSNO + "'";
} else if (this.stroplb == 'op_Seai') {
var printType = '';
if (type == 1) {
printType = 'SEAIDRFEEALL';
} else { printType = 'SEAICRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seai WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_Bulk') {
var printType = '';
if (type == 1) {
printType = 'BULKDRFEEALL';
} else { printType = 'BULKCRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_bulk WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_other') {
var printType = '';
if (type == 1) {
printType = 'OTHERDRFEEALL';
} else { printType = 'OTHERCRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_other WHERE BsNo = '" +_thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_railway') {
var printType = '';
if (type == 1) {
printType = 'RAILWAYDRFEEALL';
} else { printType = 'RAILWAYCRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_railway WHERE BsNo = '" +_thisfee.strPBSNO + "'";
} else if (this.stroplb == 'op_Aire') {
var printType = '';
if (type == 1) {
printType = 'AIREDRFEEALL';
} else { printType = 'AIRECRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_aire WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
} else if (this.stroplb == 'op_Airi') {
var printType = '';
if (type == 1) {
printType = 'AIRIDRFEEALL';
} else { printType = 'AIRICRFEEALL'; };
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_airi WHERE BsNo = '" + _thisfee.strPBSNO+ "'";
};
Ext.Ajax.request({
waitMsg: '',
url: '/MvcShipping/MsChFee/GetRangDAStr',
params: {
type:type,
optype:this.stroplb
},
callback: function (options, success, response) {
if (success) {
var result = Ext.JSON.decode(response.responseText);
if (result.Success != true) {
} else {
var RangDaStr = result.data;
var sql2 ="";
sql2 ="SET LANGUAGE 'us_english' SELECT *,(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where BsNo='" + _thisfee.strBSNO + "' and FEETYPE=" + type +" and "+RangDaStr+ " order by sort,LineNum ";
var sql3 = "";
var sql4 = "";
var sql5 = "";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO);
}
} else {
}
},
scope: this
});
},
onPrintGainClick: function (button, event, type) {
if (this.FEELOCKNOTPR==1){
var feeStatus = this.getFeeStatus();
if (feeStatus == '0' || feeStatus == '' || feeStatus == false || feeStatus == 'false' || typeof (feeStatus) == 'undefined'){
}
else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: "此票委托已费用已锁定,不允许打印核算单!", icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
return ;
}
}
if (_thisfee.strPBSNO=='') _thisfee.strPBSNO=_thisfee.strBSNO;
var MBLNO = this.strMBLNO;
_this = this;
Ext.Msg.wait(Zi.LAN.FEE.ZhengZaiChaXunShuJu);
Ext.Ajax.request({
waitMsg: Zi.LAN.FEE.ZhengZaiChaXunShuJu, //'正在组织数据...',
url: '/MvcShipping/MsChFee/GetGainPrint',
scope: this,
params: {
bsno: _this.strBSNO,
oplb: _this.stroplb
},
callback: function (options, success, response) {
if (success) {
Ext.MessageBox.hide();
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
var printsql = jsonresult.Data;
var printdrsql = jsonresult.Message;
var printcrsql = jsonresult.Message2;
if (_this.stroplb == 'op_Seae') {
var printType = 'SEAEGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seae WHERE BSNO = '" + _thisfee.strPBSNO + "'";
} else if (_this.stroplb == 'op_Apply') {
var printType = 'APPLYGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_apply WHERE BSNO = '" + _thisfee.strPBSNO + "'";
} else if (_this.stroplb == 'op_Seai') {
var printType = 'SEAIGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_seai WHERE BSNO = '" + _thisfee.strPBSNO + "'";
} else if (_this.stroplb == 'op_Bulk') {
var printType = 'BULKGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_bulk WHERE BSNO = '" + _thisfee.strPBSNO+ "'";
} else if (_this.stroplb == 'op_other') {
var printType = 'OTHERGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_other WHERE BSNO = '" +_thisfee.strPBSNO + "'";
} else if (_this.stroplb == 'op_railway') {
var printType = 'RAILWAYGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_railway WHERE BSNO = '" + _thisfee.strPBSNO + "'";
} else if (_this.stroplb == 'op_Aire') {
var printType = 'AIREGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_aire WHERE BSNO = '" + _thisfee.strPBSNO+ "'";
} else if (_this.stroplb == 'op_Airi') {
var printType = 'AIRIGAIN';
var sql1 = "SET LANGUAGE 'us_english' "
+ " select * from op_airi WHERE BSNO = '" +_thisfee.strPBSNO+ "'";
};
// sql3 = sql3 + " Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人 from ch_fee c where c.Gid in (" + feeGidSql + ") order by sort,LineNum ";
var inputby = '';
if (strLANGUAGES == 'en-us') {
inputby = 'INPUTBYREF'
} else {
inputby = '录入人'
}
// sql3 = sql3 + " Select c.*,(select showname from [user] where gid=c.enteroperator) as 录入人 from ch_fee c where c.Gid in (" + feeGidSql + ") order by sort,LineNum ";
var sql2 = "SET LANGUAGE 'us_english' Select c.*,(select showname from [user] where gid=c.enteroperator) as " + inputby + ",(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where c.BSNO='" + _this.strBSNO + "' and " + printdrsql + " and c.FEETYPE=1 order by sort,LineNum ";
var sql3 = "SET LANGUAGE 'us_english' Select c.*,(select showname from [user] where gid=c.enteroperator) as " + inputby + ",(select DESCRIPTION from info_client where SHORTNAME=c.CUSTOMERNAME) CUSTFULLNAME from ch_fee c where c.BSNO='" + _this.strBSNO + "' and " + printcrsql + " and c.FEETYPE=2 order by sort,LineNum ";
//全部费用利润 或 海运费利润 或 仓储利润
var sql4 = "SELECT BSNO"
+ ",SUM(RMBDR) as RMBDR,SUM(RMBCR) as RMBCR,SUM(USDDR) as USDDR,SUM(USDCR) as USDCR"
+ ",SUM(RMBDR+USDTORMBDR) as DRTTL"
+ ",SUM(RMBCR+USDTORMBCR) as CRTTL"
+ ",(SUM(RMBDR)-SUM(RMBCR)) AS RMBPROFIT"
+ ",(SUM(USDDR)-SUM(USDCR)) AS USDPROFIT"
+ ",SUM(RMBDR+USDTORMBDR)- SUM(RMBCR+USDTORMBCR) as TTLPROFIT"
//+ ",(CAST(CAST(CASE WHEN SUM(RMBCR+USDTORMBCR) = 0 THEN 100 ELSE (ROUND((case when SUM(RMBDR+USDTORMBDR)=0 then 0 else (SUM(RMBDR+USDTORMBDR)- SUM(RMBCR+USDTORMBCR))/SUM(RMBDR+USDTORMBDR) END),4))*100 END as decimal(18,2)) as varchar(20))+'%') AS PROFITRATE"
+ ",(CAST(CAST(CASE WHEN SUM(RMBCR+USDTORMBCR) = 0 THEN 100 ELSE (ROUND(((SUM(RMBDR+USDTORMBDR)- SUM(RMBCR+USDTORMBCR))/SUM(RMBCR+USDTORMBCR)),4))*100 END as decimal(18,2)) as varchar(20))+'%') AS PROFITRATE"
+ ",'" + SHOWNAME + "' as CREATEUSER,GETDATE() as CREATETIME "
+ " FROM ("
+ "SELECT BSNO,CURRENCY,FEETYPE"
+ ",SUM(CASE WHEN CURRENCY='RMB' AND FEETYPE = 1 THEN AMOUNT ELSE 0 END) as RMBDR"
+ ",SUM(CASE WHEN CURRENCY='RMB' AND FEETYPE = 2 THEN AMOUNT ELSE 0 END) as RMBCR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 1 THEN AMOUNT ELSE 0 END) as USDDR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 2 THEN AMOUNT ELSE 0 END) as USDCR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 1 THEN AMOUNT*EXCHANGERATE ELSE 0 END) as USDTORMBDR"
+ ",SUM(CASE WHEN CURRENCY='USD' AND FEETYPE = 2 THEN AMOUNT*EXCHANGERATE ELSE 0 END) as USDTORMBCR "
+ " FROM ch_fee WHERE 1=1 and BSNO='" + _thisfee.strBSNO + "'"
+ " GROUP BY BSNO,CURRENCY,EXCHANGERATE,FEETYPE "
+ " ) AS C GROUP BY BSNO ";
var sql5 = "exec GetPrintDataNew '" + _this.strBSNO + "','" + printsql.replace(new RegExp("'", "gm"), "''") + "'";
var sql6 = "";
PrintComm(printType, sql1, sql2, sql3, sql4, sql5, sql6, MBLNO);
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.ChuoWu, msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
} else {
Ext.Msg.show({ title: Zi.LAN.FEE.TiShi,
msg: Zi.LAN.FEE.FuWuQiXiangYingChuCuo,
icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK
});
}
}
});
},
LoadDrChFee: function (button, event) {
var fieldcomm = [];
var valuecomm = [];
if (this.WMSOUTBSNO != "") {
fieldcomm.push("WMSOUTBSNO");
valuecomm.push(this.WMSOUTBSNO);
}
if (fieldcomm.length == 0) {
this.storeDrChFee.load({ params: { billno: this.strBSNO, type: 1, optype: this.stroplb }
, callback: function (r, options, success) {
if (success) {
if (r.length > 0) {
// _thisfee.storeDrChFee.getSelectionModel().select(0);
} else {
}
}
},
scope: this
});
} else {
this.storeDrChFee.load({ params: { billno: this.strBSNO, type: 1, optype: this.stroplb, Fields: fieldcomm, Values: valuecomm }
, callback: function (r, options, success) {
if (success) {
if (r.length > 0) {
// _thisfee.storeDrChFee.getSelectionModel().select(0);
} else {
}
}
},
scope: this
});
}
this.storeBodySum.load({
params: { bsno: this.strBSNO, optype: this.stroplb },
callback: function (r, options, success) {
if (success) {
_thisfee.setTotalHead();
}
}
});
this.storeChFeeGain.load({ params: { bsno: this.strBSNO, optype: this.stroplb} });
},
LoadCrChFee: function (button, event) {
var fieldcomm = [];
var valuecomm = [];
if (this.WMSOUTBSNO != "") {
fieldcomm.push("WMSOUTBSNO");
valuecomm.push(this.WMSOUTBSNO);
}
if (fieldcomm.length == 0) {
_thisfee.storeCrChFee.load({ params: { billno: this.strBSNO, type: 2, optype: this.stroplb },
callback: function (r, options, success) {
if (r.length > 0) {
// _thisfee.storeCrChFee.getSelectionModel().select(0);
} else {
}
},
scope: this
});
} else {
_thisfee.storeCrChFee.load({ params: { billno: this.strBSNO, type: 2, optype: this.stroplb, Fields: fieldcomm, Values: valuecomm },
callback: function (r, options, success) {
if (r.length > 0) {
// _thisfee.storeCrChFee.getSelectionModel().select(0);
} else {
}
},
scope: this
});
}
this.storeBodySum.load({
params: { bsno: this.strBSNO, optype: this.stroplb },
callback: function (r, options, success) {
if (success) {
_thisfee.setTotalHead();
}
}
});
this.storeChFeeGain.load({ params: { bsno: this.strBSNO, optype: this.stroplb} });
}
});