hanxuntao 2 months ago
parent bb4af31167
commit 0d073bf41f

@ -24,6 +24,7 @@ using System.Web.UI.WebControls;
using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using DSWeb.MvcShipping.DAL.MsInfoClient;
using DSWeb.MvcShipping.Models.SysBillType;
using DSWeb.MvcShipping.DAL.MsCompanysDAL;
namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
{
@ -311,6 +312,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
{
var result = new DBResult();
var BankdataList = ChBankdataDAL.GetDataList(condition, userid, username, companyid);
var stlBankdataList = new List<ChBankdata>();
if (BankdataList != null&& BankdataList.Count!=0)
{
@ -632,7 +634,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
var result2 = modb.Save(head);
if (result2.Success)
{
var addinvlist =ChsettlementDAL.GetPayDCDataAllList("BILLNO in (select BILLNO FROM ch_fee_bankdata_fitdetail WHERE LINKGID='" + Bankdata.GID + "')","","RMB");
var addinvlist =ChsettlementDAL.GetPayDCDataList("BILLNO in (select BILLNO FROM ch_fee_bankdata_fitdetail WHERE LINKGID='" + Bankdata.GID + "')", userid, username, companyid,"","RMB");
if (addinvlist != null && addinvlist.Count != 0)
{
var exrateList = ChsettlementDAL.GetAppCurrExrateData(addinvlist, head.CURR, "", true);
@ -662,6 +664,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
public static DBResult AddAutoBankDataSTL(List<ChBankdata> BankdataList, string userid, string username, string companyid)
{
var result = new DBResult();
var companylist = MsCompanysDAL.GetNoPicDataList("");
if (BankdataList != null && BankdataList.Count != 0)
{
foreach (var Bankdata in BankdataList)
@ -680,18 +683,18 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
head.SETTLEUSER = userid;
head.SETTLEUSERREF = username;
var period = ChMonthCloseDAL.GetData("", companyid);
if (Convert.ToDateTime(period.FDAY) > DateTime.Now)
if (Convert.ToDateTime(period.FDAY) >Convert.ToDateTime(Bankdata.TRANSDATE))
{
head.SETTLETIME = period.FDAY;
}
else
head.SETTLETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
head.SETTLETIME = Bankdata.TRANSDATE;
head.CURR = Bankdata.CURRENCY.Replace("CNY", "RMB").Trim();
head.CUSTOMERNAME= MsInfoClientDAL.GetData("[DESCRIPTION]='"+Bankdata.DRAWEE_NAME.Trim()+"'").SHORTNAME;
if (string.IsNullOrEmpty(head.CUSTOMERNAME)) {
if (addinvlist != null && addinvlist.Count != 0)
{
head.CUSTOMERNAME = addinvlist[0].CUSTOMERNAME;
head.CUSTOMERNAME = addinvlist[0].CUSTOMERNAME;
}
}
@ -704,6 +707,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
head.BILLNO = MsSysBillNoSetDAL.GetBillNo(billnoset, head.SETTLETIME.ToString().Trim(), head.BILLDATE.ToString().Trim());
else head.BILLNO = PubSysDAL.GetBillNo("0305");
head.COMPANYID = companyid;
var salecorp = companylist.Find(x=>x.FULLNAME==Bankdata.PAYEE_NAME);
if (salecorp != null) {
head.SALECORPID = salecorp.GID;
}
head.DbOperationType = DbOperationType.DbotIns;
var bankList = MsBaseInfoDAL.GetBANKList("ACCOUNT='" + Bankdata.PAYEE_ACCOUNT.Trim() + "'","");
if (bankList != null && bankList.Count != 0)
@ -749,12 +757,12 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
head.SETTLEUSER = userid;
head.SETTLEUSERREF = username;
var period = ChMonthCloseDAL.GetData("", companyid);
if (Convert.ToDateTime(period.FDAY) > DateTime.Now)
if (Convert.ToDateTime(period.FDAY) > Convert.ToDateTime(Bankdata.TRANSDATE))
{
head.SETTLETIME = period.FDAY;
}
else
head.SETTLETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
head.SETTLETIME = Bankdata.TRANSDATE;
head.CURR = Bankdata.CURRENCY.Replace("CNY", "RMB").Trim();
head.SETTLETYPE = 7;
head.RATE = 1;
@ -787,6 +795,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
}
}
var salecorp = companylist.Find(x => x.FULLNAME == Bankdata.PAYEE_NAME);
if (salecorp != null)
{
head.SALECORPID = salecorp.GID;
}
var modb = new ModelObjectDB();
var result2 = modb.Save(head);

@ -828,9 +828,71 @@ Ext.extend(Shipping.MsChBankdataInvIndex, Ext.Panel, {
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.InvPagenum]
}), this.InvPagenum,{
xtype: 'label',
id: 'DRSELECTSTR',
html: "<font color='green'></font>"
}]
});
this.InvgridList.on({
selectionchange: function (sm, selections) {
if (selections.length == 0) {
var DRSELECTSTR = Ext.getCmp('DRSELECTSTR');
DRSELECTSTR.setText('', false);
} else {
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.RECVCURR)
if (records.getCount() > 0) {
var rec = records.getAt(0);
if (memberyf.data.RECVCURR == "RMB") {
var AMOUNT = Add(rec.data.AMOUNT, memberyf.data.AMOUNT);
rec.set('AMOUNT', AMOUNT);
} else {
var AMOUNT = Add(rec.data.AMOUNT, memberyf.data.OTCURRAMOUNT);
rec.set('AMOUNT', AMOUNT);
}
} else {
if (memberyf.data.RECVCURR == "RMB") {
var rec = Ext.create('MsSelectFee', {
CURR: memberyf.data.RECVCURR,
AMOUNT: memberyf.data.AMOUNT
});
storeSelect.add(rec);
} else {
var rec = Ext.create('MsSelectFee', {
CURR: memberyf.data.RECVCURR,
AMOUNT: memberyf.data.OTCURRAMOUNT
});
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.InvgridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
this.SelectedRecord = record;
this.OprationStatus = 'edit';

@ -75,4 +75,27 @@ Ext.define('MsInfoClientBankModel', {
{ name: 'CREATETIME', type: 'string' },
{ name: 'CWGLACCID', type: 'string' }
]
});
Ext.define('MsSelectFee', {
extend: 'Ext.data.Model',
idProperty: 'GId',
fields: [
{ name: 'CUST', type: 'string' },
{ name: 'CURR', type: 'string' },
{ name: 'QUANTITY', type: 'number' },
{ name: 'AMOUNT', type: 'number' }
]
});
Ext.define('MsSelectPay', {
extend: 'Ext.data.Model',
idProperty: 'GId',
fields: [
{ name: 'AMOUNTRMB', type: 'number' },
{ name: 'AMOUNTUSD', type: 'number' },
{ name: 'AMOUNTOT', type: 'number' }
]
});

@ -891,7 +891,11 @@ Ext.extend(Shipping.MsChBankdataPayIndex, Ext.Panel, {
displayInfo: true,
displayMsg: '当前显示 {0} - {1}条记录 /共 {2}条记录',
emptyMsg: "没有数据"
}), this.InvPagenum]
}), this.InvPagenum, {
xtype: 'label',
id: 'DRSELECTSTR',
html: "<font color='green'></font>"
}]
});
this.InvgridList.addListener('itemdblclick', function (dataview, record, item, index, e, b) {
@ -909,6 +913,45 @@ Ext.extend(Shipping.MsChBankdataPayIndex, Ext.Panel, {
}
}, this);
this.InvgridList.on({
selectionchange: function (sm, selections) {
if (selections.length == 0) {
var DRSELECTSTR = Ext.getCmp('DRSELECTSTR');
DRSELECTSTR.setText('', false);
} else {
var storeSelect = Ext.create('DsExt.ux.RefTableStore', {
model: 'MsSelectPay',
proxy: { url: '/MvcShipping/MsCompanys/GetNoPicDataList' }
});
var AMOUNTRMB = 0;
var AMOUNTUSD = 0;
var AMOUNTOT = 0;
for (var i = 0; i < selections.length; i++) {
var memberyf = selections[i];
var AMOUNTRMB = Add(AMOUNTRMB, memberyf.data.AMOUNTRMB);
var AMOUNTUSD = Add(AMOUNTUSD, memberyf.data.AMOUNTUSD);
var AMOUNTOT = Add(AMOUNTOT, memberyf.data.AMOUNTOT);
}
str = '选中合计:' + '[';
if (AMOUNTRMB != 0) {
str = str + 'RMB:' + AMOUNTRMB + ' ';
}
if (AMOUNTUSD != 0) {
str = str + 'USD:' + AMOUNTUSD + ' ';
}
if (AMOUNTOT != 0) {
str = str + '其他:' + AMOUNTOT + ' ';
}
str = str + ']';
var DRSELECTSTR = Ext.getCmp('DRSELECTSTR');
DRSELECTSTR.setText(str, false);
}
}
});
this.Invgirdcolums = DsTruck.GetGridPanel(USERID, this.formname+'Pay', this.Invgirdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.Invgirdcolums.unshift(new Ext.grid.RowNumberer());
this.InvgridList.reconfigure(this.storeInvList, this.Invgirdcolums);
@ -1422,6 +1465,7 @@ Ext.extend(Shipping.MsChBankdataPayIndex, Ext.Panel, {
}, this);
this.FitInvgirdcolums = DsTruck.GetGridPanel(USERID, this.formname + 'FitPay', this.FitInvgirdcolums, 1); //使用者id表名中间column数组跳过一开始的几列
this.FitInvgirdcolums.unshift(new Ext.grid.RowNumberer());
this.FitInvgridList.reconfigure(this.storeFitInvList, this.FitInvgirdcolums);

Loading…
Cancel
Save