hanxuntao 2 months ago
parent 459228bd36
commit 9ed0c7a0d1

@ -17,6 +17,10 @@ using DSWeb.Areas.Account.DAL.Chfee_bankdata;
using System.IO;
using DSWeb.Areas.Account.Models.Chfee_Invoice;
using DSWeb.Areas.Account.Models.Chfee_Settlement;
using DSWeb.SoftMng.Filter;
using DSWeb.Areas.Account.Models.Chfee_Payapplication;
using DSWeb.Areas.Account.DAL.Chfee_Settlement;
using DSWeb.Areas.Dispatch.Helper;
namespace DSWeb.Areas.Account.Controllers
{
@ -45,11 +49,20 @@ namespace DSWeb.Areas.Account.Controllers
{
return View();
}
public ActionResult InvIndex()
{
return View();
}
public ActionResult PayIndex()
{
return View();
}
//
// GET
#region
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetDataList(int start, int limit, string sort, string condition)
{
var dataList = ChBankdataDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), Convert.ToString(Session["COMPANYID"]), sort);
@ -59,7 +72,7 @@ namespace DSWeb.Areas.Account.Controllers
return new ContentResult() { Content = json };
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetData(string handle, string condition)
{
ChBankdata head = null;
@ -90,12 +103,19 @@ namespace DSWeb.Areas.Account.Controllers
return new ContentResult() { Content = json };
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult GetDataSumList(string condition)
{
var dataList = ChBankdataDAL.GetDataSumList(condition, Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", totalCount = dataList.Count, data = dataList.ToList() });
return new ContentResult() { Content = json };
}
//
//
public ContentResult Delete(string data)
public ContentResult Delete(string data)
{
var headData = JsonConvert.Deserialize<ChBankdata>(data);
DBResult result;
@ -148,16 +168,128 @@ namespace DSWeb.Areas.Account.Controllers
var bodyList = JsonConvert.Deserialize<List<ChInvoice>>(data);
DBResult result = ChBankdataDAL.AddBankDataDetail(bodyList, billno, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]));
if (result.Success) {
var dataList = ChBankdataDAL.GetDataList("GID='" + billno + "'", Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), Convert.ToString(Session["COMPANYID"]), null);
var curr = "RMB";
decimal AMOUNT = 0;
decimal FITAMOUNT = 0;
if (dataList != null && dataList.Count != 0) {
foreach (var bill in dataList) {
curr = bill.CURRENCY.Replace("CNY", "RMB").Trim();
AMOUNT = bill.AMOUNT;
}
}
bool isfit = false;
if (bodyList != null && bodyList.Count != 0) {
var addinvlist = ChsettlementDAL.GetRecvInvAllDataList("BILLNO in (select BILLNO FROM ch_fee_bankdata_fitdetail WHERE LINKGID='" + billno + "')", Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), Convert.ToString(Session["COMPANYID"]));
if (addinvlist != null && addinvlist.Count != 0) {
foreach (var inv in addinvlist) {
if (inv.RECVCURR == curr) FITAMOUNT = FITAMOUNT + inv.DOAMOUNT;
}
}
}
if (FITAMOUNT == AMOUNT) isfit = true;
if (isfit)
ChBankdataDAL.AddAutoBankDataSTL(dataList, Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), Convert.ToString(Session["COMPANYID"]));
}
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult AddBankDataPayDetail(string billno, string data)
{
var bodyList = JsonConvert.Deserialize<List<ChPaySettlement>>(data);
DBResult result = ChBankdataDAL.AddBankDataPayDetail(bodyList, billno, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]));
if (result.Success)
{
var dataList = ChBankdataDAL.GetDataList("GID='" + billno + "'", Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), Convert.ToString(Session["COMPANYID"]), null);
var curr = "RMB";
decimal AMOUNT = 0;
decimal FITAMOUNT = 0;
if (dataList != null && dataList.Count != 0)
{
foreach (var bill in dataList)
{
curr = bill.CURRENCY.Replace("CNY", "RMB").Trim();
AMOUNT = bill.AMOUNT;
}
}
bool isfit = false;
if (bodyList != null && bodyList.Count != 0)
{
var addinvlist = ChsettlementDAL.GetPayDCDataAllList("BILLNO in (select BILLNO FROM ch_fee_bankdata_fitdetail WHERE LINKGID='" + billno + "')", "", "RMB");
if (addinvlist != null && addinvlist.Count != 0)
{
foreach (var inv in addinvlist)
{
if (curr=="RMB") FITAMOUNT = FITAMOUNT + inv.STLAMOUNT;
if (curr == "USD") FITAMOUNT = FITAMOUNT + inv.USDSTLAMOUNT;
if (curr != "RMB"&& curr != "USD") FITAMOUNT = FITAMOUNT + inv.OTSTLAMOUNT;
}
}
}
if (FITAMOUNT == AMOUNT) isfit = true;
if (isfit)
ChBankdataDAL.AddAutoBankDataSTL(dataList, Convert.ToString(Session["USERID"]), CookieConfig.GetCookie_UserCode(Request), Convert.ToString(Session["COMPANYID"]));
}
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult AddAutoBankDataDetail(string condition, string fitcondition)
[SqlKeyWordsFilter(Type = "Action")]//sql 防注入过滤器
public ContentResult AddAutoBankDataDetail(string condition, string fitcondition,string payfitcondition)
{
DBResult result = ChBankdataDAL.AddAutoBankDataDetail(condition, fitcondition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
//Dictionary<string, string> dicData = new Dictionary<string, string>();
//dicData.Add("PCNO", "20240821101000");
//dicData.Add("CORPID", "Comcab2d43f60454327af30a131fc1d3abd");
//var rtn = WebRequestHelper.DoPostHead("http://localhost:10200//Account/Chfee_bankdata/AddAutoBankDataDetailJk", dicData,"");
//var jsonRespose = new jsonresponse { success = false, message = rtn };
//return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
DBResult result = ChBankdataDAL.AddAutoBankDataDetail(condition, fitcondition, payfitcondition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
[System.Web.Mvc.HttpPost]
public ContentResult AddAutoBankDataDetailJk()
{
string PCNO = Request.Headers["PCNO"];
if (string.IsNullOrEmpty(PCNO)) {
var json4 = DSWeb.MvcShipping.Helper.JsonConvert.Serialize(
new { Code = 4, Msg = "代码不能为空!" });
return new ContentResult() { Content = json4 };
}
string CORPID = Request.Headers["CORPID"];
string USERID = Request.Headers["USERID"];
DBResult result = ChBankdataDAL.AddAutoBankDataDetail("PCNO='" + PCNO + "'", "", "", USERID, "自动", CORPID);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult DelBankDataDetail(string data)
{

@ -1900,6 +1900,7 @@ namespace DSWeb.Areas.Account.Controllers
head.REDNUM = RedNo;
head.INVOICEPDFURL = "";
head.INVOICEINFOURL = "";
head.INVOICEMAKETIME = DateTime.Now.ToString("yyyy-MM-dd HH;mm:ss");
head.DbOperationType = DbOperationType.DbotIns;
head.ModelUIStatus = "I";
@ -1943,6 +1944,7 @@ namespace DSWeb.Areas.Account.Controllers
detail.SetRed();
detail.PID = "*";
}
head.INVOICEMAKETIME = DateTime.Now.ToString("yyyy-MM-dd HH;mm:ss");
redhead.REMARK = REDREMARK_Quandian(redhead);

@ -14,6 +14,16 @@ using DSWeb.Areas.Account.Models.Chfee_Invoice;
using DSWeb.Areas.Account.DAL.Chfee_Invoice;
using DSWeb.Areas.Account.Models.Chfee_Settlement;
using DSWeb.Areas.Account.DAL.Chfee_Settlement;
using DSWeb.Areas.Account.Models.Chfee_Payapplication;
using DSWeb.Areas.Account.DAL.Chfee_Payapplication;
using DSWeb.MvcShipping.DAL.ChMonthCloseDAL;
using DSWeb.MvcShipping.Models.MsChFee;
using DSWeb.MvcShipping.DAL.MsSysBillNoSet;
using DSWeb.MvcShipping.DAL.MsBaseInfoDAL;
using System.Web.UI.WebControls;
using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using DSWeb.MvcShipping.DAL.MsInfoClient;
using DSWeb.MvcShipping.Models.SysBillType;
namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
{
@ -29,7 +39,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
strSql.Append(" SELECT [GID],[PCNO],[SFNO],[TRANSTYPE],[DRAWEE_BANK] ,[DRAWEE_ACCOUNT],[DRAWEE_NAME],[PAYEE_BANK],[PAYEE_ACCOUNT]");
strSql.Append(",[PAYEE_NAME],[TRANSDATE],[CURRENCY],[AMOUNT],[TRANSNO],[IMPORTDATE],[IMPORTER],[ISFIT],[FITCOUNT],[INVNO],[FITDATE]");
strSql.Append(",[FITTYPE],[PRINTDATE],[ISPRINT],[PRINTER],[SALE],[ATTITIONAL],[REMARK],[SUMMARY],FITUSER,CREATEUSER,CREATETIME");
strSql.Append(",(select ShowName from[user] where GID = ch_fee_bankdata.CREATEUSER) as CREATEUSERREF");
strSql.Append(",(select ShowName from[user] where GID = ch_fee_bankdata.CREATEUSER) as CREATEUSERREF,ACCOUNT,BANK,ISSTL,STLBILLNO,BANKGID,BALANCE");
strSql.Append(" FROM ch_fee_bankdata where CORPID='"+orgcode+"' ");
if (!string.IsNullOrEmpty(strCondition))
@ -44,7 +54,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
}
else
{
strSql.Append(" order by PCNO DESC,SFNO");
strSql.Append(" order by TRANSDATE DESC,PCNO DESC");
}
@ -72,7 +82,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
#region Set DB data to Object
data.GID = Convert.ToString(reader["GID"]);
if (reader["PCNO"] != DBNull.Value)
data.PCNO = Convert.ToInt32(reader["PCNO"]);
data.PCNO = Convert.ToString(reader["PCNO"]);
if (reader["SFNO"] != DBNull.Value)
data.SFNO = Convert.ToInt32(reader["SFNO"]);
@ -117,6 +127,66 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
data.CREATEUSERREF = Convert.ToString(reader["CREATEUSERREF"]);
if (reader["CREATETIME"] != DBNull.Value)
data.CREATETIME = Convert.ToDateTime(reader["CREATETIME"]).ToString("yyyy-MM-dd HH:mm:ss");
data.ACCOUNT = Convert.ToString(reader["ACCOUNT"]);
data.BANK = Convert.ToString(reader["BANK"]);
if (reader["ISSTL"] != DBNull.Value)
data.ISSTL = Convert.ToBoolean(reader["ISSTL"]);
data.STLBILLNO = Convert.ToString(reader["STLBILLNO"]);
data.BANKGID = Convert.ToString(reader["BANKGID"]);
if (reader["BALANCE"] != DBNull.Value)
data.BALANCE = Convert.ToDecimal(reader["BALANCE"]);
#endregion
headList.Add(data);
}
reader.Close();
}
return headList;
}
static public List<ChBankdataSum> GetDataSumList(string strCondition, string userid = "", string usercode = "", string orgcode = "", string sort = null)
{
var strSql = new StringBuilder();
strSql.Append(" SELECT SUM(CASE WHEN TRANSTYPE='来账' AND CURRENCY='CNY' THEN AMOUNT ELSE 0 END) RMBDR ");
strSql.Append(",SUM(CASE WHEN TRANSTYPE='来账' AND CURRENCY='USD' THEN AMOUNT ELSE 0 END) USDDR");
strSql.Append(",SUM(CASE WHEN TRANSTYPE='往账' AND CURRENCY='CNY' THEN AMOUNT ELSE 0 END) RMBCR ");
strSql.Append(",SUM(CASE WHEN TRANSTYPE='往账' AND CURRENCY='USD' THEN AMOUNT ELSE 0 END) USDCR");
strSql.Append(" FROM ch_fee_bankdata where CORPID='" + orgcode + "' ");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" and " + strCondition);
}
return SetSUMData(strSql);
}
private static List<ChBankdataSum> SetSUMData(StringBuilder strSql)
{
var headList = new List<ChBankdataSum>();
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
ChBankdataSum data = new ChBankdataSum();
#region Set DB data to Object
if (reader["RMBDR"] != DBNull.Value)
data.RMBDR = Convert.ToDecimal(reader["RMBDR"]);
if (reader["USDDR"] != DBNull.Value)
data.USDDR = Convert.ToDecimal(reader["USDDR"]);
if (reader["RMBCR"] != DBNull.Value)
data.RMBCR = Convert.ToDecimal(reader["RMBCR"]);
if (reader["USDCR"] != DBNull.Value)
data.USDCR = Convert.ToDecimal(reader["USDCR"]);
#endregion
headList.Add(data);
}
@ -131,7 +201,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
#region 结算匹配
public static DBResult AddAutoBankDataStlDetail(string condition, string fitcondition, string username, string userid, string companyid)
public static DBResult AddAutoBankDataStlDetail(string condition, string fitcondition, string userid, string username, string companyid)
{
var result = new DBResult();
var BankdataList = ChBankdataDAL.GetDataList(condition, userid, username, companyid);
@ -146,7 +216,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
var InvList = ChsettlementDAL.GetDataListAll(fitcondition+ invsql);
if (InvList.Count == 1)
{
result = AddBankDataStlDetail(InvList, Bankdata.GID, username, userid);
result = AddBankDataStlDetail(InvList, Bankdata.GID, userid, username);
}
}
@ -159,7 +229,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
}
public static DBResult AddBankDataStlDetail(List<ChSettlement> boday, string billno, string username, string userid)
public static DBResult AddBankDataStlDetail(List<ChSettlement> boday, string billno, string userid, string username)
{
var result = new DBResult();
@ -237,30 +307,76 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
#endregion
public static DBResult AddAutoBankDataDetail(string condition, string fitcondition, string username, string userid,string companyid)
public static DBResult AddAutoBankDataDetail(string condition, string fitcondition,string payfitcondition, string userid, string username, string companyid)
{
var result = new DBResult();
var BankdataList = ChBankdataDAL.GetDataList(condition, userid, username, companyid);
var stlBankdataList = new List<ChBankdata>();
if (BankdataList != null&& BankdataList.Count!=0)
{
foreach (var Bankdata in BankdataList) {
var invsql = " INVOICECUSTNAME='"+Bankdata.DRAWEE_NAME + "' and RECVCURR='"+ Bankdata.CURRENCY + "' and (AMOUNT="+Bankdata.AMOUNT+ " or OTCURRAMOUNT=" + Bankdata.AMOUNT + ") ";
invsql = invsql + " and EXISTS (select 1 from ch_fee f left join ch_fee_do d on (d.FEEID=f.GID) and cm.BILLNO=d.BILLNO AND F.AMOUNT<>F.SETTLEMENT) ";
var InvList = ChinvoiceDAL.GetDataList(0, 5, fitcondition, userid,username,companyid);
if (InvList.Count == 1) {
result = AddBankDataDetailAuto(InvList,Bankdata.GID,username,userid);
if (!Bankdata.ISFIT)
{
if (Bankdata.TRANSTYPE == "来账")
{
var invsql = " INVOICECUSTNAME='" + Bankdata.DRAWEE_NAME + "' and RECVCURR='" + Bankdata.CURRENCY.Replace("CNY","RMB").Trim() + "' and (AMOUNT=" + Bankdata.AMOUNT + " or OTCURRAMOUNT=" + Bankdata.AMOUNT + ") ";
invsql = invsql + " and EXISTS (select 1 from ch_fee f left join ch_fee_do d on (d.FEEID=f.GID) WHERE cm.BILLNO=d.BILLNO AND F.AMOUNT<>F.SETTLEMENT) ";
if (!string.IsNullOrEmpty(fitcondition))
invsql = invsql + " and " + fitcondition;
var InvList = ChsettlementDAL.GetRecvInvAllDataList( invsql, userid, username, companyid);
if (InvList.Count == 1&& InvList[0].DOAMOUNT==Bankdata.AMOUNT)
{
result = AddBankDataDetail(InvList, Bankdata.GID, userid, username,"自动");
Bankdata.ISFIT = true;
stlBankdataList.Add(Bankdata);
}
}
else
{
var invsql = " CM.BILLSTATUS IN (0,4,5) and (CURR='" + Bankdata.CURRENCY.Replace("CNY", "RMB").Trim() + "' and (AMOUNTUSD+AMOUNTRMB+AMOUNTOT)=" + Bankdata.AMOUNT+")";
invsql = invsql + " and EXISTS (select 1 from ch_fee f left join ch_fee_do d on (d.FEEID=f.GID) WHERE cm.BILLNO=d.BILLNO AND F.AMOUNT<>F.SETTLEMENT) ";
invsql = invsql + " and EXISTS (select 1 from info_client C WHERE C.SHORTNAME=CM.CUSTOMERNAME AND C.[DESCRIPTION]='" + Bankdata.PAYEE_NAME + "') ";
if (!string.IsNullOrEmpty(payfitcondition))
invsql = invsql + " and " + payfitcondition;
var InvList = ChsettlementDAL.GetPayDCDataAllList(invsql, "", "RMB");
var curr = Bankdata.CURRENCY.Replace("CNY", "RMB").Trim();
// var InvList = ChpayapplicationDAL.Do_GetDataList(0,1,invsql);
if (InvList.Count == 1)
{
decimal FITAMOUNT = 0;
if (curr == "RMB") FITAMOUNT = FITAMOUNT + InvList[0].STLAMOUNT;
if (curr == "USD") FITAMOUNT = FITAMOUNT + InvList[0].USDSTLAMOUNT;
if (curr != "RMB" && curr != "USD") FITAMOUNT = FITAMOUNT + InvList[0].OTSTLAMOUNT;
if (FITAMOUNT == Bankdata.AMOUNT)
{
result = AddBankDataPayDetail(InvList, Bankdata.GID, userid, username, "自动");
Bankdata.ISFIT = true;
stlBankdataList.Add(Bankdata);
}
}
}
}
}
AddAutoBankDataSTL(stlBankdataList, userid, username,companyid);
}
result.Success = true;
result.Message = "匹配发票成功";
result.Message = "匹配成功";
return result;
}
public static DBResult AddBankDataDetailAuto(List<ChInvoice> boday, string billno, string username, string userid)
public static DBResult AddBankDataDetail(List<ChInvoice> boday, string billno, string userid, string username, string fittype= "手动")
{
var result = new DBResult();
@ -282,12 +398,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
@"insert into ch_fee_bankdata_fitdetail (GID,LINKGID,INVOICENO,BILLNO,CREATEUSER,CREATETIME)
values (@GID,@LINKGID,@INVOICENO,@BILLNO,@CREATEUSER,@CREATETIME) ");
var cmdupdate = db.GetSqlStringCommand("update ch_fee_bankdata set ISFIT=1,FITDATE=GETDATE(),FITTYPE='自动',FITUSER=@FITUSER,FITCOUNT=@FITCOUNT,INVNO=@INVNO where GID=@GID");
var cmdupdate = db.GetSqlStringCommand("update ch_fee_bankdata set ISFIT=1,FITDATE=GETDATE(),FITTYPE='"+ fittype + "',FITUSER=@FITUSER,FITCOUNT=@FITCOUNT,INVNO=@INVNO where GID=@GID");
int invcount = 0;
string invnostr = "";
decimal amount = 0;
foreach (var enumValue in boday)
{
@ -305,7 +420,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
}
cmdupdate.Parameters.Clear();
db.AddInParameter(cmdupdate, "@FITUSER", DbType.String, username);
db.AddInParameter(cmdupdate, "@FITUSER", DbType.String,username);
db.AddInParameter(cmdupdate, "@FITCOUNT", DbType.Int16, invcount);
db.AddInParameter(cmdupdate, "@INVNO", DbType.String, invnostr);
db.AddInParameter(cmdupdate, "@GID", DbType.String, billno);
@ -330,17 +445,18 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
}
}
result.Success = true;
result.Message = "匹配发票成功";
//result.Success = true;
//result.Message = "匹配发票成功";
return result;
}
public static DBResult AddBankDataDetail(List<ChInvoice> boday, string billno,string username,string userid)
public static DBResult AddBankDataPayDetail(List<ChPaySettlement> boday, string billno, string userid, string username,string fittype="手动")
{
var result = new DBResult();
var bank = GetData("GID='"+billno+"'");
Database db = DatabaseFactory.CreateDatabase();
using (var conn = db.CreateConnection())
{
@ -358,41 +474,29 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
@"insert into ch_fee_bankdata_fitdetail (GID,LINKGID,INVOICENO,BILLNO,CREATEUSER,CREATETIME)
values (@GID,@LINKGID,@INVOICENO,@BILLNO,@CREATEUSER,@CREATETIME) ");
var cmdupdate = db.GetSqlStringCommand("update ch_fee_bankdata set ISFIT=@ISFIT,FITDATE=GETDATE(),FITTYPE='手动',FITUSER=@FITUSER,FITCOUNT=FITCOUNT+@FITCOUNT,INVNO=INVNO+@INVNO where GID=@GID");
var cmdupdate = db.GetSqlStringCommand("update ch_fee_bankdata set ISFIT=1,FITDATE=GETDATE(),FITTYPE='"+ fittype + "',FITUSER=@FITUSER,FITCOUNT=@FITCOUNT,INVNO=@INVNO where GID=@GID");
int invcount = 0;
string invnostr = "";
decimal amount = 0;
foreach (var enumValue in boday)
{
cmdInsert.Parameters.Clear();
db.AddInParameter(cmdInsert, "@GID", DbType.String, Guid.NewGuid().ToString());
db.AddInParameter(cmdInsert, "@LINKGID", DbType.String, billno);
db.AddInParameter(cmdInsert, "@INVOICENO", DbType.String, enumValue.INVOICENO);
db.AddInParameter(cmdInsert, "@INVOICENO", DbType.String, enumValue.INVNO);
db.AddInParameter(cmdInsert, "@BILLNO", DbType.String, enumValue.BILLNO);
db.AddInParameter(cmdInsert, "@CREATEUSER", DbType.String, username);
db.AddInParameter(cmdInsert, "@CREATETIME", DbType.String, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
db.ExecuteNonQuery(cmdInsert, tran);
invcount = invcount + 1;
if (!string.IsNullOrEmpty(invnostr)) invnostr = invnostr + ";" + enumValue.INVOICENO;
else invnostr = enumValue.INVOICENO;
if (enumValue.RECVCURR == "RMB") amount = amount + enumValue.AMOUNT;
else amount = amount + enumValue.OTCURRAMOUNT;
if (!string.IsNullOrEmpty(invnostr)) invnostr = invnostr + ";" + enumValue.INVNO;
else invnostr = enumValue.INVNO;
}
cmdupdate.Parameters.Clear();
db.AddInParameter(cmdupdate, "@FITUSER", DbType.String,username);
if (bank.AMOUNT == amount)
{
db.AddInParameter(cmdupdate, "@ISFIT", DbType.Boolean, true);
}
else {
db.AddInParameter(cmdupdate, "@ISFIT", DbType.Boolean, false);
}
db.AddInParameter(cmdupdate, "@FITUSER", DbType.String, username);
db.AddInParameter(cmdupdate, "@FITCOUNT", DbType.Int16, invcount);
db.AddInParameter(cmdupdate, "@INVNO", DbType.String, invnostr);
db.AddInParameter(cmdupdate, "@GID", DbType.String, billno);
@ -402,7 +506,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
result = new DBResult();
result.Success = true;
result.Message = "匹配发票成功";
result.Message = "匹配付费申请成功";
tran.Commit();
}
@ -411,14 +515,359 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
tran.Rollback();
result.Success = false;
result.Message = "匹配发票出现错误,请重试或联系系统管理员";
result.Message = "匹配付费申请出现错误,请重试或联系系统管理员";
return result;
}
}
result.Success = true;
result.Message = "匹配发票成功";
result.Message = "匹配付费申请成功";
return result;
}
public static DBResult AddAutoBankDataSTL(string condition, string userid, string username, string companyid)
{
var result = new DBResult();
var BankdataList = ChBankdataDAL.GetDataList(condition, userid, username, companyid);
if (BankdataList != null && BankdataList.Count != 0)
{
foreach (var Bankdata in BankdataList)
{
if (Bankdata.ISFIT&&!Bankdata.ISSTL)
{
if (Bankdata.TRANSTYPE == "收入")
{
var head = new ChSettlement();
head.GID = Guid.NewGuid().ToString();
head.BILLDATE = DateTime.Now;
head.SETTLEUSER = userid;
head.SETTLEUSERREF = username;
var period = ChMonthCloseDAL.GetData("", companyid);
if (Convert.ToDateTime(period.FDAY) > DateTime.Now)
{
head.SETTLETIME = period.FDAY;
}
else
head.SETTLETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
head.CURR = Bankdata.CURRENCY;
head.SETTLETYPE = 7;
head.RATE = 1;
head.BILLTYPE = 1;
head.SETTLEMODE = 3;
var billnoset = MsSysBillNoSetDAL.GetData("OPLBNAME='收费结算'", companyid);
if (billnoset.BILLTYPE != "")
head.BILLNO = MsSysBillNoSetDAL.GetBillNo(billnoset, head.SETTLETIME.ToString().Trim(), head.BILLDATE.ToString().Trim());
else head.BILLNO = PubSysDAL.GetBillNo("0305");
head.COMPANYID = companyid;
head.DbOperationType = DbOperationType.DbotIns;
var bankList = MsBaseInfoDAL.GetBANKList("ACCOUNT='" + Bankdata.ACCOUNT + "'", head.COMPANYID);
if (bankList != null && bankList.Count != 0)
{
foreach (var bank in bankList)
{
head.ACCOUNT = bank.GID;
}
}
var modb = new ModelObjectDB();
var result2 = modb.Save(head);
if (result2.Success)
{
var addinvlist = ChsettlementDAL.GetRecvInvAllDataList("BILLNO in (select BILLNO FROM ch_fee_bankdata_fitdetail WHERE LINKGID='" + Bankdata.GID + "')", userid, username, companyid);
if (addinvlist != null && addinvlist.Count != 0)
{
var exrateList = ChsettlementDAL.GetInvCurrExrateData(addinvlist, head.CURR);
result = ChsettlementDAL.RecvInvAddAppDetail(head.BILLNO, addinvlist, head.CURR, companyid, exrateList);
if (result.Success) {
UpdateBankDataStl(Bankdata.GID,head.BILLNO,username,userid);
}
}
}
}
else
{
var head = new ChSettlement();
head.GID = Guid.NewGuid().ToString();
head.BILLDATE = DateTime.Now;
head.SETTLEUSER = userid;
head.SETTLEUSERREF = username;
var period = ChMonthCloseDAL.GetData("", companyid);
if (Convert.ToDateTime(period.FDAY) > DateTime.Now)
{
head.SETTLETIME = period.FDAY;
}
else
head.SETTLETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
head.CURR = Bankdata.CURRENCY;
head.SETTLETYPE = 7;
head.RATE = 1;
head.BILLTYPE = 2;
head.SETTLEMODE = 1;
var billnoset = MsSysBillNoSetDAL.GetData("OPLBNAME='付费结算'", companyid);
if (billnoset.BILLTYPE != "")
head.BILLNO = MsSysBillNoSetDAL.GetBillNo(billnoset, head.SETTLETIME.ToString().Trim(), head.BILLDATE.ToString().Trim());
else
head.BILLNO = PubSysDAL.GetBillNo("0304");
head.COMPANYID = companyid;
head.DbOperationType = DbOperationType.DbotIns;
var bankList = MsBaseInfoDAL.GetBANKList("ACCOUNT='" + Bankdata.ACCOUNT + "'", head.COMPANYID);
if (bankList != null && bankList.Count != 0)
{
foreach (var bank in bankList)
{
head.ACCOUNT = bank.GID;
}
}
var modb = new ModelObjectDB();
var result2 = modb.Save(head);
if (result2.Success)
{
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);
result = ChsettlementDAL.AddAppDCDetail(head.BILLNO, addinvlist, head.CURR, companyid, "",exrateList,true);
if (result.Success)
{
UpdateBankDataStl(Bankdata.GID, head.BILLNO, username, userid);
}
}
}
}
}
}
}
result.Success = true;
result.Message = "结算成功";
return result;
}
public static DBResult AddAutoBankDataSTL(List<ChBankdata> BankdataList, string userid, string username, string companyid)
{
var result = new DBResult();
if (BankdataList != null && BankdataList.Count != 0)
{
foreach (var Bankdata in BankdataList)
{
if (Bankdata.ISFIT && !Bankdata.ISSTL)
{
if (Bankdata.TRANSTYPE == "来账")
{
var addinvlist = ChsettlementDAL.GetRecvInvAllDataList("BILLNO in (select BILLNO FROM ch_fee_bankdata_fitdetail WHERE LINKGID='" + Bankdata.GID + "')", userid, username, companyid);
var head = new ChSettlement();
head.GID = Guid.NewGuid().ToString();
head.BILLDATE = DateTime.Now;
head.SETTLEUSER = userid;
head.SETTLEUSERREF = username;
var period = ChMonthCloseDAL.GetData("", companyid);
if (Convert.ToDateTime(period.FDAY) > DateTime.Now)
{
head.SETTLETIME = period.FDAY;
}
else
head.SETTLETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
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.SETTLETYPE = 7;
head.RATE = 1;
head.BILLTYPE = 1;
head.SETTLEMODE = 3;
var billnoset = MsSysBillNoSetDAL.GetData("OPLBNAME='收费结算'", companyid);
if (billnoset.BILLTYPE != "")
head.BILLNO = MsSysBillNoSetDAL.GetBillNo(billnoset, head.SETTLETIME.ToString().Trim(), head.BILLDATE.ToString().Trim());
else head.BILLNO = PubSysDAL.GetBillNo("0305");
head.COMPANYID = companyid;
head.DbOperationType = DbOperationType.DbotIns;
var bankList = MsBaseInfoDAL.GetBANKList("ACCOUNT='" + Bankdata.PAYEE_ACCOUNT.Trim() + "'","");
if (bankList != null && bankList.Count != 0)
{
foreach (var bank in bankList)
{
head.ACCOUNT = bank.GID;
if (head.CURR == "RMB") head.ACCOUNTRMB = bank.GID;
if (head.CURR == "USD") head.ACCOUNTUSD = bank.GID;
}
}
var modb = new ModelObjectDB();
var result2 = modb.Save(head);
if (result2.Success)
{
if (addinvlist != null && addinvlist.Count != 0)
{
var exrateList = ChsettlementDAL.GetInvCurrExrateData(addinvlist, head.CURR);
result = ChsettlementDAL.RecvInvAddAppDetail(head.BILLNO, addinvlist, head.CURR, companyid, exrateList);
if (result.Success)
{
UpdateBankDataStl(Bankdata.GID, head.BILLNO, username, userid);
ChsettlementDAL.p_update_Amount(head.BILLNO, 1);
ChsettlementDAL.Lock(head.BILLNO,"");
}
}
}
}
else
{
var addinvlist = ChsettlementDAL.GetPayDCDataList("cm.BILLSTATUS=0 and cm.BILLNO in (select BILLNO FROM ch_fee_bankdata_fitdetail WHERE LINKGID='" + Bankdata.GID + "')", userid, username, companyid, "", "RMB");
var head = new ChSettlement();
head.GID = Guid.NewGuid().ToString();
head.BILLDATE = DateTime.Now;
head.SETTLEUSER = userid;
head.SETTLEUSERREF = username;
var period = ChMonthCloseDAL.GetData("", companyid);
if (Convert.ToDateTime(period.FDAY) > DateTime.Now)
{
head.SETTLETIME = period.FDAY;
}
else
head.SETTLETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
head.CURR = Bankdata.CURRENCY.Replace("CNY", "RMB").Trim();
head.SETTLETYPE = 7;
head.RATE = 1;
head.BILLTYPE = 2;
head.SETTLEMODE = 1;
var billnoset = MsSysBillNoSetDAL.GetData("OPLBNAME='付费结算'", companyid);
if (billnoset.BILLTYPE != "")
head.BILLNO = MsSysBillNoSetDAL.GetBillNo(billnoset, head.SETTLETIME.ToString().Trim(), head.BILLDATE.ToString().Trim());
else
head.BILLNO = PubSysDAL.GetBillNo("0304");
head.COMPANYID = companyid;
head.DbOperationType = DbOperationType.DbotIns;
var bankList = MsBaseInfoDAL.GetBANKList("ACCOUNT='" + Bankdata.DRAWEE_ACCOUNT.Trim() + "'","");
if (bankList != null && bankList.Count != 0)
{
foreach (var bank in bankList)
{
head.ACCOUNT = bank.GID;
if (head.CURR == "RMB") head.ACCOUNTRMB = bank.GID;
if (head.CURR == "USD") head.ACCOUNTUSD = bank.GID;
}
}
head.CUSTOMERNAME = MsInfoClientDAL.GetData("[DESCRIPTION]='" + Bankdata.PAYEE_NAME.Trim() + "'").SHORTNAME;
if (string.IsNullOrEmpty(head.CUSTOMERNAME))
{
if (addinvlist != null && addinvlist.Count != 0)
{
head.CUSTOMERNAME = addinvlist[0].CUSTOMERNAME;
}
}
var modb = new ModelObjectDB();
var result2 = modb.Save(head);
if (result2.Success)
{
if (addinvlist != null && addinvlist.Count != 0)
{
var exrateList = ChsettlementDAL.GetAppCurrExrateData(addinvlist, head.CURR, "", true);
result = ChsettlementDAL.AddAppDCDetail(head.BILLNO, addinvlist, head.CURR, companyid, head.CURR, exrateList, true);
if (result.Success)
{
UpdateBankDataStl(Bankdata.GID, head.BILLNO, username, userid);
ChsettlementDAL.p_update_Amount(head.BILLNO, 2);
ChsettlementDAL.Lock(head.BILLNO, "");
}
}
}
}
}
}
}
result.Success = true;
result.Message = "结算成功";
return result;
}
public static DBResult UpdateBankDataStl(string GID, string billno, string username, string userid)
{
var result = new DBResult();
Database db = DatabaseFactory.CreateDatabase();
using (var conn = db.CreateConnection())
{
conn.Open();
var tran = conn.BeginTransaction();
try
{
var cmdupdate = db.GetSqlStringCommand("update ch_fee_bankdata set ISSTL=1,STLDATE=GETDATE(),STLBY=@FITUSER,STLBILLNO=@STLBILLNO where GID=@GID");
cmdupdate.Parameters.Clear();
db.AddInParameter(cmdupdate, "@FITUSER", DbType.String, username);
db.AddInParameter(cmdupdate, "@STLBILLNO", DbType.String, billno);
db.AddInParameter(cmdupdate, "@GID", DbType.String, GID);
db.ExecuteNonQuery(cmdupdate, tran);
result = new DBResult();
result.Success = true;
result.Message = "结算成功";
tran.Commit();
}
catch (Exception)
{
tran.Rollback();
result.Success = false;
result.Message = "结算出现错误,请重试或联系系统管理员";
return result;
}
}
result.Success = true;
result.Message = "结算成功";
return result;
}
@ -491,13 +940,13 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
var TRANSTYPE = Convert.ToString(row["交易类型[ Transaction Type ]"]).Replace("\"","").Replace("\t", "");
var DRAWEE_NAME=Convert.ToString(row["付款人名称[ Payer's Name ]"]).Replace("\"", "").Replace("\t", "");
if (!string.IsNullOrEmpty(TRANSTYPE) && TRANSTYPE== "来账"&& DRAWEE_NAME.IndexOf("经汉")<0)
if (!string.IsNullOrEmpty(TRANSTYPE) && TRANSTYPE== "来账")
{
num = num + 1;
var headData = new ChBankdata();
headData.GID = System.Guid.NewGuid().ToString();
headData.DbOperationType = DbOperationType.DbotIns;
headData.PCNO = Convert.ToInt32(pcno)+1;
headData.PCNO = (Convert.ToInt32(pcno)+1).ToString();
headData.SFNO = num;
headData.TRANSTYPE = TRANSTYPE;
headData.DRAWEE_BANK = Convert.ToString(row["付款人开户行名[ Payer account bank ]"]).Replace("\"", "").Replace("\t", "");
@ -568,11 +1017,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
var headData = new ChBankdata();
headData.GID = System.Guid.NewGuid().ToString();
headData.DbOperationType = DbOperationType.DbotIns;
headData.PCNO = Convert.ToInt32(pcno) + 1;
headData.PCNO = (Convert.ToInt32(pcno) + 1).ToString();
headData.SFNO = num;
if (!string.IsNullOrEmpty(DR))
{
headData.TRANSTYPE ="收入";
headData.TRANSTYPE ="来账";
headData.DRAWEE_BANK = BANK;
headData.DRAWEE_ACCOUNT = ACCOUNT;
headData.DRAWEE_NAME = DRAWEE_NAME;
@ -580,7 +1029,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
headData.PAYEE_ACCOUNT ="";
headData.PAYEE_NAME ="";
} else {
headData.TRANSTYPE = "支出";
headData.TRANSTYPE = "往账";
headData.DRAWEE_BANK ="";
headData.DRAWEE_ACCOUNT ="";
headData.DRAWEE_NAME ="";

@ -3426,7 +3426,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
if (boday != null)
{
var cmdupdate = db.GetSqlStringCommand("update ch_fee_payapplication set BILLSTATUS=6,AUDITUSER='',AUDITTIME=null,ISPRINT='0',REASON='" + reason + "' where BILLNO=@BILLNO");
var cmdupdate = db.GetSqlStringCommand("update ch_fee_payapplication set BILLSTATUS=6,AUDITUSER='"+USERID+"',AUDITTIME=GETDATE(),ISPRINT='0',REASON='" + reason + "' where BILLNO=@BILLNO");
foreach (var enumValue in boday)
{

@ -15,7 +15,7 @@ namespace DSWeb.Areas.Account.Models.Chfee_Bankdata
[ModelDB(MDBType = ModelDBOprationType.All, IsPrimary = true)]
public string GID { get; set; }
[ModelDB]
public Int32 PCNO { get; set; }
public string PCNO { get; set; }
[ModelDB]
public Int32 SFNO { get; set; }
[ModelDB]
@ -69,6 +69,21 @@ namespace DSWeb.Areas.Account.Models.Chfee_Bankdata
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public string CORPID { get; set; }
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public string ACCOUNT { get; set; }
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public string BANK { get; set; }
[ModelDB(MDBType = ModelDBOprationType.Insert)]
public string BANKGID { get; set; }
public bool ISSTL{ get; set; }
public string STLBILLNO { get; set; }
public decimal BALANCE { get; set; }
public ChBankdata()
{
TableName = "ch_fee_bankdata";
@ -76,5 +91,19 @@ namespace DSWeb.Areas.Account.Models.Chfee_Bankdata
}
[JsonObject]
public class ChBankdataSum : ModelObjectBillHead
{
public decimal RMBDR { get; set; }
public decimal USDDR { get; set; }
public decimal RMBCR { get; set; }
public decimal USDCR { get; set; }
public ChBankdataSum()
{
TableName = "ch_fee_bankdata";
}
}
}

@ -0,0 +1,20 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/MvcShipping/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" src="../../../../Areas/Account/Viewsjs/Chfee_bankdata/ChBankdataModel.js"></script>
<script type="text/javascript" src="../../../../Areas/Account/Viewsjs/Chfee_invoice/ChInvoiceModel.js"></script>
<script type="text/javascript" src="../../../../Areas/Account/Viewsjs/Chfee_bankdata/ChBankdataInvIndex.js"></script>
<script type="text/javascript" src="../../../../Areas/Account/Viewsjs/Chfee_bankdata/InvIndex.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/Comm/DsQuery.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
<div id="viewport" ></div>
</asp:Content>

@ -0,0 +1,21 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/MvcShipping/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" src="../../../../Areas/Account/Viewsjs/Chfee_bankdata/ChBankdataModel.js"></script>
<script type="text/javascript" src="../../../../Areas/Account/Viewsjs/Chfee_payapplication/ChPayapplicationModel.js"></script>
<script type="text/javascript" src="../../../../Areas/Account/Viewsjs/Chfee_bankdata/ChBankdataPayIndex.js"></script>
<script type="text/javascript" src="../../../../Areas/Account/Viewsjs/Chfee_bankdata/PayIndex.js"></script>
<script type="text/javascript" src="../../../../Areas/MvcShipping/Viewsjs/Comm/DsQuery.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
<div id="viewport" ></div>
</asp:Content>

@ -5,6 +5,8 @@
{ name: 'GID', type: 'string' },
{ name: 'PCNO', type: 'string' },
{ name: 'SFNO', type: 'string' },
{ name: 'ACCOUNT', type: 'string' },
{ name: 'BANK', type: 'string' },
{ name: 'TRANSTYPE', type: 'string' },
{ name: 'DRAWEE_BANK', type: 'string' },
{ name: 'DRAWEE_ACCOUNT', type: 'string' },
@ -15,6 +17,7 @@
{ name: 'TRANSDATE', type: 'string' },
{ name: 'CURRENCY', type: 'string' },
{ name: 'AMOUNT', type: 'number' },
{ name: 'BALANCE', type: 'number' },
{ name: 'TRANSNO', type: 'string' },
{ name: 'IMPORTDATE', type: 'string' },
{ name: 'IMPORTER', type: 'string' },
@ -31,6 +34,8 @@
{ name: 'REMARK', type: 'string' },
{ name: 'SUMMARY', type: 'string' },
{ name: 'FITUSER', type: 'string' },
{ name: 'ISSTL', type: 'string' },
{ name: 'STLBILLNO', type: 'string' },
{ name: 'CREATEUSER', type: 'string' },
{ name: 'CREATEUSERREF', type: 'string' },
{ name: 'CREATETIME', type: 'string' },

@ -237,6 +237,31 @@ Ext.extend(Shipping.MsChBankdataStlMateIndex, Ext.Panel, {
}
}
});
this.StoreTRANSTYPE = Ext.create('Ext.data.Store', {
fields: ['OpLb']
});
this.StoreTRANSTYPE.add({ "OpLb": "全部" });
this.StoreTRANSTYPE.add({ "OpLb": "来账" });
this.StoreTRANSTYPE.add({ "OpLb": "往账" });
this.comboxTRANSTYPE = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: '交易类型',
store: this.StoreTRANSTYPE,
forceSelection: true,
value: '',
name: 'TRANSTYPE',
valueField: 'OpLb',
displayField: 'OpLb',
enableKeyEvents: true,
listeners: {
keyup: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
});
_this = this;
this.formSearch = Ext.widget('form', {
frame: true,
@ -262,7 +287,18 @@ Ext.extend(Shipping.MsChBankdataStlMateIndex, Ext.Panel, {
xtype: 'container',
layout: 'hbox',
defaultType: 'textfield',
items: [ {
items: [this.comboxTRANSTYPE, {
fieldLabel: '银行账号',
name: 'ACCOUNT',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
},{
fieldLabel: '批次号',
name: 'PCNo',
enableKeyEvents: true,

@ -0,0 +1,31 @@
Ext.BLANK_IMAGE_URL = '../../TruckMng/Content/Images/s.gif';
var panelIndex = null;
Ext.onReady(function () {
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
panelIndex = new window.Shipping.MsChBankdataInvIndex({
layout: 'border'
});
var view = new Ext.Viewport({
layout: 'border',
renderTo: 'viewport',
border: false,
items: [{
region: 'center',
layout: 'fit',
items: [panelIndex]
}]
});
});
function OprationSwap() {
return panelIndex.OprationSwap();
}
function AddNewRecord(record) {
panelIndex.AddNewRecord(record);
}

@ -0,0 +1,31 @@
Ext.BLANK_IMAGE_URL = '../../TruckMng/Content/Images/s.gif';
var panelIndex = null;
Ext.onReady(function () {
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
panelIndex = new window.Shipping.MsChBankdataPayIndex({
layout: 'border'
});
var view = new Ext.Viewport({
layout: 'border',
renderTo: 'viewport',
border: false,
items: [{
region: 'center',
layout: 'fit',
items: [panelIndex]
}]
});
});
function OprationSwap() {
return panelIndex.OprationSwap();
}
function AddNewRecord(record) {
panelIndex.AddNewRecord(record);
}

@ -538,6 +538,42 @@ namespace DSWeb.Areas.CommMng.Controllers
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListTRADINGAGENCY(string CODENAME)
{
var condition = "";
string LAN = Convert.ToString(Session["LANGUAGES"]);
if (CODENAME == "")
{
condition = " ISTRADINGAGENCY=1 ";
}
else
{
if (LAN == "en-us")
{
condition = " ISSTOP=0 and ISTRADINGAGENCY=1 AND (CODENAME like '%" + CODENAME + "%' or ESHORTNAME like '%" + CODENAME + "%') ";
}
else condition = " ISSTOP=0 and ISTRADINGAGENCY=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
}
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid, "0", LAN);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListWAREHOUSE(string CODENAME)
{
var condition = "";
@ -562,6 +598,43 @@ namespace DSWeb.Areas.CommMng.Controllers
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid, "0", LAN);
if (evList.Count == 0)
{
var json = JsonConvert.Serialize(new { success = false });
return new ContentResult() { Content = json };
}
else
{
var json = JsonConvert.Serialize(new { success = true, data = evList.ToList() });
return new ContentResult() { Content = json };
}
}
public ContentResult GetCustomRefListOTHER(string CODENAME)
{
var condition = "";
string LAN = Convert.ToString(Session["LANGUAGES"]);
if (CODENAME == "")
{
condition = " ISOTHER=1 ";
}
else
{
if (LAN == "en-us")
{
condition = " ISSTOP=0 and ISOTHER=1 AND (CODENAME like '%" + CODENAME + "%' or ESHORTNAME like '%" + CODENAME + "%') ";
}
else
condition = " ISSTOP=0 and ISOTHER=1 AND (CODENAME like '%" + CODENAME + "%' or SHORTNAME like '%" + CODENAME + "%') ";
}
var userid = CookieConfig.GetCookie_UserId(Request);
var ISENABLECUSTRANGE = CookieConfig.GetCookie_ISENABLECUSTRANGE(Request);
var evList = BasicDataRefDAL.GetCustomRefList(condition, ISENABLECUSTRANGE, userid, "0", LAN);
if (evList.Count == 0)
@ -928,6 +1001,29 @@ namespace DSWeb.Areas.CommMng.Controllers
}
}
public JsonResult GetCountryRefListRm(string CODENAME)
{
var condition = "";
if (CODENAME == "")
{
condition = "";
}
else condition = " (COUNTRY like '" + CODENAME + "%') ";
var evList = BasicDataRefDAL.GetCountryRefList(condition);
if (evList.Count == 0)
{
return Json(new { success = false });
}
else
{
return Json(new { success = true, data = evList.ToList() });
}
}
// GET: /CommMng/BasicDataRef/GetCargoRefList
public JsonResult GetCargoRefList(string condition)
{

@ -201,13 +201,16 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//仓储出库货主
this.storeCustWmsCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListWAREHOUSE' }
});
this.storeCustWmsCode.load({ params: { condition: "ISWAREHOUSE='1'"} });
this.comboxCustWmsCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.CUSTOMERNAME_WMS, //'仓储货主',
store: this.storeCustWmsCode,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
id: 'CUSTOMERNAME_WMS',
name: 'CUSTOMERNAME_WMS',
valueField: 'CustName',
@ -326,13 +329,16 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//客户加载_贸易代理
this.storeTRADINGAGENCY = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListTRADINGAGENCY' }
});
this.storeTRADINGAGENCY.load({ params: { condition: "ISTRADINGAGENCY='1'"} });
this.comboxTRADINGAGENCY = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.TRADINGAGENCY, //'贸易代理',
store: this.storeTRADINGAGENCY,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
id: 'TRADINGAGENCY',
name: 'TRADINGAGENCY',
valueField: 'CustName',
@ -342,13 +348,16 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//客户加载_船公司
this.storeCARRIER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCARRIER' }
});
this.storeCARRIER.load({ params: { condition: "ISCARRIER='1'"} });
this.comboxCARRIER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.CARRIER, //'船公司',
store: this.storeCARRIER,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
id: 'CARRIER',
name: 'CARRIER',
valueField: 'CustName',
@ -359,13 +368,16 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//客户加载_船代
this.storeCARRIERAGENT = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListSHIPAGENCY' }
});
this.storeCARRIERAGENT.load({ params: { condition: "ISSHIPAGENCY='1'"} });//ISSHIPPINGAGENT//需求编码SR2017061700003
this.comboxCARRIERAGENT = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.CARRIERAGENT, //'船代',//需求编码SR2017061700003
store: this.storeCARRIERAGENT,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
id: 'SHIPAGENCY',
name: 'SHIPAGENCY',
valueField: 'CustName',
@ -376,13 +388,16 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//客户加载_车队
this.storeTRUCKER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListTRUCK' }
});
this.storeTRUCKER.load({ params: { condition: "ISTRUCK='1'"} });
this.comboxTRUCKER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.TRUCKER, //'车队',
store: this.storeTRUCKER,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
id: 'TRUCKER',
name: 'TRUCKER',
valueField: 'CustName',
@ -393,13 +408,16 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//客户加载_报关
this.storeCUSTOMSER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCUSTOM' }
});
this.storeCUSTOMSER.load({ params: { condition: "ISCUSTOM='1'"} });
this.comboxCUSTOMSER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.CUSTOMSER, //'报关行',
store: this.storeCUSTOMSER,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
id: 'CUSTOMSER',
name: 'CUSTOMSER',
valueField: 'CustName',
@ -428,13 +446,16 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//客户加载_报检
this.storeINSPECTION = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListCUSTOM' }
});
this.storeINSPECTION.load({ params: { condition: "ISCUSTOM='1'"} });
this.comboxINSPECTION = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.INSPECTION, //'报检',
store: this.storeINSPECTION,
forceSelection: true,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
id: 'INSPECTION',
name: 'INSPECTION',
valueField: 'CustName',
@ -445,12 +466,15 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//客户加载_其他码头
this.storeOTHER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListOTHER' }
});
this.storeOTHER.load({ params: { condition: "ISOTHER='1'"} });
this.comboxOTHER = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.MaTou, //其他(码头)
store: this.storeOTHER,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
// forceSelection: true,
id: 'MaTou',
name: 'MaTou',
@ -607,12 +631,15 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//品名
this.storeCodeGoodsList = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CodeGoodsModel',
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsList' }
proxy: { url: '/CommMng/BasicDataRef/GetCodeGoodsListRm' }
});
this.storeCodeGoodsList.load();
this.comboxGOODSNAME = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.GOODSNAME, //'品名',
store: this.storeCodeGoodsList,
queryMode: 'remote',
minChars: 0,
queryParam: 'CODENAME',
id: 'GOODSNAME',
name: 'GOODSNAME',
valueField: 'GOODNAME',
@ -795,7 +822,7 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//客户加载_场站
this.storeYARD = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListYARD' }
});
//船公司
@ -803,6 +830,9 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
fieldLabel: Zi.LAN.YARD, //'场站',
store: this.storeYARD,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'YARD',
valueField: 'CustName',
displayField: 'CodeAndName'
@ -810,7 +840,7 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//客户加载_订舱代理
this.storeFORWARDER = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListFORWARDER' }
});
//货代
@ -818,6 +848,9 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
fieldLabel: Zi.LAN.FORWARDER, //'货代',
store: this.storeFORWARDER,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'FORWARDER',
valueField: 'CustName',
displayField: 'CodeAndName'
@ -826,7 +859,7 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//客户加载_订舱代理
this.storeAGENT = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListAgent' }
});
//货代
@ -834,6 +867,9 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
fieldLabel: Zi.LAN.AGENTID, //'国外代理',
store: this.storeAGENT,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
name: 'AGENTID',
valueField: 'CustName',
displayField: 'CodeAndName'
@ -1291,13 +1327,16 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
//仓库
this.storeCustWmsCode = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CustomRefModel',
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCustomRefListWAREHOUSE' }
});
this.storeCustWmsCode.load({ params: { condition: "ISWAREHOUSE='1'" } });
this.comboxCustWmsCode = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.STORAGENAME,
store: this.storeCustWmsCode,
forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
id: 'STORAGENAME',
name: 'STORAGENAME',
valueField: 'CustName',
@ -1317,12 +1356,15 @@ Ext.extend(Shipping.MsOpSeaiEdit, Ext.Panel, {
});
this.storeCountry = Ext.create('DsExt.ux.RefTableStore', {
model: 'ConutryRef',
proxy: { url: '/CommMng/BasicDataRef/GetCountryRefList' }
proxy: { url: '/CommMng/BasicDataRef/GetCountryRefListRm' }
});
this.storeCountry.load({ params: { condition: "" } });
this.comboxCountry = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.COUNTRYOFORIGIN,
// forceSelection: true,
// forceSelection: true,
queryMode: 'remote',
minChars: 1,
queryParam: 'CODENAME',
store: this.storeCountry,
name: 'COUNTRYOFORIGIN',
valueField: 'country',

@ -13,6 +13,7 @@ Ext.extend(DsTruck.MsPcHYRDEdit, Ext.Panel, {
OpStatus: 'add',
StoreList: null,
editRecord: null,
stroplb: '陆运派车',
selectPGID: '',
initUIComponents: function () {

@ -421,12 +421,16 @@
<Content Include="Areas\Account\Viewsjs\Chfee_Audit\Zi_en-us.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_Audit\Zi_zh-cn.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\ChBankdataEdit.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\ChBankdataInvIndex.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\ChBankdataPayIndex.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\ChBankdataStlMateIndex.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\ChBankdataIndex.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\ChBankdataModel.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\ChBankdataStlIndex.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\Edit.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\Index.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\InvIndex.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\PayIndex.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\StlMateIndex.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_bankdata\StlIndex.js" />
<Content Include="Areas\Account\Viewsjs\Chfee_cheque\BookEdit.js" />
@ -624,6 +628,8 @@
<Content Include="Areas\Account\Views\Chfee_Audit\PiLiangSubmit.aspx" />
<Content Include="Areas\Account\Views\Chfee_bankdata\Edit.aspx" />
<Content Include="Areas\Account\Views\Chfee_bankdata\Index.aspx" />
<Content Include="Areas\Account\Views\Chfee_bankdata\InvIndex.aspx" />
<Content Include="Areas\Account\Views\Chfee_bankdata\PayIndex.aspx" />
<Content Include="Areas\Account\Views\Chfee_bankdata\StlMateIndex.aspx" />
<Content Include="Areas\Account\Views\Chfee_bankdata\StlIndex.aspx" />
<Content Include="Areas\Account\Views\Chfee_cheque\BookEdit.aspx" />

Loading…
Cancel
Save