DS7Zhanhao
ddlucky 2 years ago
commit b30e0cd01e

@ -31,6 +31,7 @@ using DSWeb.MvcShipping.DAL.MsInfoClient;
using DSWeb.CW;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using System.Data.SqlClient;
using System.Linq;
namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
{
@ -7186,6 +7187,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
string sSQL = "";
int iResult = 0;
string zt = "";
var Billlist = strGids.Split(',');
string sGids = "'" + strGids.Trim().Replace(",", "','") + "'";
string sError = "操作完成!";
string strCwSTARTGID = BasicDataRefDAL.GetCwSTARTGID(strUserID);
@ -7419,7 +7421,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
//else
//{
if (dsCwDesign.Tables[0].Rows[0]["ISSTLEGOL"].ToString().Trim() == "True")
iResult = getSCNEW(dsCwDesign, dsCwDesignItem, "", sGids.Trim(), headData, bodyList, strCwACCDATE, strUserID, companyid,strCwSTARTGID,dsAR,dsARFC,dsAP,dsAPFC,dsARMBSPENDING,dsARTMSFC,dsAPMBSPENDING,dsAPTMSFC,dsDR,dsDRFC,dsCR,dsCRFC,dsFC,dsCASH,dsEGOL,dsExchangeLoss, SaleCorpStartDS, accitemslist, VOUAUTOCHECK);
iResult = getSCNEW(dsCwDesign, dsCwDesignItem, "", sGids.Trim(), headData, bodyList, strCwACCDATE, strUserID, companyid,strCwSTARTGID,dsAR,dsARFC,dsAP,dsAPFC,dsARMBSPENDING,dsARTMSFC,dsAPMBSPENDING,dsAPTMSFC,dsDR,dsDRFC,dsCR,dsCRFC,dsFC,dsCASH,dsEGOL,dsExchangeLoss, SaleCorpStartDS, accitemslist, VOUAUTOCHECK, Billlist);
else
iResult = getSC(dsCwDesign, dsCwDesignItem, "", sGids.Trim(), headData, bodyList, strCwACCDATE, strUserID, companyid, strCwSTARTGID, dsAR, dsARFC, dsAP, dsAPFC, dsARMBSPENDING, dsARTMSFC, dsAPMBSPENDING, dsAPTMSFC, dsDR, dsDRFC, dsCR, dsCRFC, dsFC, dsCASH, dsEGOL, dsExchangeLoss, SaleCorpStartDS, accitemslist, VOUAUTOCHECK);
@ -7445,7 +7447,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
string strISMGSC = "";//
if (dsCwDesign.Tables[0].Rows[0]["ISSTLEGOL"].ToString().Trim() == "True")
iResult = getSCNEW(dsCwDesign, dsCwDesignItem, strISMGSC, "'" + enumValue.GID.ToString().Trim()+"'", headData, bodyList, strCwACCDATE, strUserID, companyid, strCwSTARTGID, dsAR, dsARFC, dsAP, dsAPFC, dsARMBSPENDING, dsARTMSFC, dsAPMBSPENDING, dsAPTMSFC, dsDR, dsDRFC, dsCR, dsCRFC, dsFC, dsCASH, dsEGOL, dsExchangeLoss, SaleCorpStartDS, accitemslist, VOUAUTOCHECK);
iResult = getSCNEW(dsCwDesign, dsCwDesignItem, strISMGSC, "'" + enumValue.GID.ToString().Trim()+"'", headData, bodyList, strCwACCDATE, strUserID, companyid, strCwSTARTGID, dsAR, dsARFC, dsAP, dsAPFC, dsARMBSPENDING, dsARTMSFC, dsAPMBSPENDING, dsAPTMSFC, dsDR, dsDRFC, dsCR, dsCRFC, dsFC, dsCASH, dsEGOL, dsExchangeLoss, SaleCorpStartDS, accitemslist, VOUAUTOCHECK, Billlist);
else
{
strISMGSC = ",BILLNO,SETTLETYPE";
@ -19851,7 +19853,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
protected static int getSCNEW(DataSet dsCwDesign, DataSet dsCwDesignItem, string strISMGSC, string sGids, MsCwVouchersGl3 headData, List<MsCwVouchersGl4> bodyList, string strACCDATE, string strUserID, string strCompanyID, string strCwSTARTGID, CwAccitemsGlModel dsAR, CwAccitemsGlModel dsARFC, CwAccitemsGlModel dsAP, CwAccitemsGlModel dsAPFC, CwAccitemsGlModel dsARMBSPENDING, CwAccitemsGlModel dsARTMSFC, CwAccitemsGlModel dsAPMBSPENDING, CwAccitemsGlModel dsAPTMSFC, CwAccitemsGlModel dsDR, CwAccitemsGlModel dsDRFC, CwAccitemsGlModel dsCR, CwAccitemsGlModel dsCRFC, CwAccitemsGlModel dsFC, CwAccitemsGlModel dsCASH, CwAccitemsGlModel dsEGOL, CwAccitemsGlModel dsExchangeLoss, DataSet SaleCorpStartDS, List<CwAccitemsGlModel> accitemslist,string VOUAUTOCHECK)
protected static int getSCNEW(DataSet dsCwDesign, DataSet dsCwDesignItem, string strISMGSC, string sGids, MsCwVouchersGl3 headData, List<MsCwVouchersGl4> bodyList, string strACCDATE, string strUserID, string strCompanyID, string strCwSTARTGID, CwAccitemsGlModel dsAR, CwAccitemsGlModel dsARFC, CwAccitemsGlModel dsAP, CwAccitemsGlModel dsAPFC, CwAccitemsGlModel dsARMBSPENDING, CwAccitemsGlModel dsARTMSFC, CwAccitemsGlModel dsAPMBSPENDING, CwAccitemsGlModel dsAPTMSFC, CwAccitemsGlModel dsDR, CwAccitemsGlModel dsDRFC, CwAccitemsGlModel dsCR, CwAccitemsGlModel dsCRFC, CwAccitemsGlModel dsFC, CwAccitemsGlModel dsCASH, CwAccitemsGlModel dsEGOL, CwAccitemsGlModel dsExchangeLoss, DataSet SaleCorpStartDS, List<CwAccitemsGlModel> accitemslist,string VOUAUTOCHECK, string[] invlist)
{
var result = new DBResult();
#region 基本变量
@ -19965,7 +19967,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
ArrayList alBankCE = new ArrayList();
ArrayList alBankDsCE = new ArrayList();
IList<MsCwVouitemsGl> CwVouitemsEntities = new List<MsCwVouitemsGl>();
List<MsCwVouitemsGl> CwVouitemsEntities = new List<MsCwVouitemsGl>();
#endregion
var SETTLETIME = "";
@ -20296,7 +20298,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
for (int i = 0; i < dsBank.Tables[0].Rows.Count; i++)
{
sqlBank = "select BILLNO,SETTLENO,Billtype,SETTLETIME,FEETYPE,SETTLETYPE,CURRENCY,CUSTOMERNAME,ACCOUNTRMB,ACCOUNTUSD,AHSR_CURRENCY,BILLNO_ACAD"//,EXCHANGERATE
sqlBank = "select GID,BILLNO,SETTLENO,Billtype,SETTLETIME,FEETYPE,SETTLETYPE,CURRENCY,CUSTOMERNAME,ACCOUNTRMB,ACCOUNTUSD,AHSR_CURRENCY,BILLNO_ACAD"//,EXCHANGERATE
+ ",sum(AHSR_MONEY_JE) as AHSR_MONEY_JE"
+ ",(select STLNAME from [code_stlmode] where STLCODE=a.SETTLETYPE) as SETTLETYPEREF"
+ ",convert(decimal(18,2),round(sum(AHSR_MONEY_JE)*" + tbRATE_CASHYF + ",2)) AS AHSR_MONEY_HJ"
@ -20304,7 +20306,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
+ ",sum(SXF) as SXF"
+ " from ("
+ "SELECT BILLNO,SETTLENO,SETTLETIME,Billtype,"
+ "SELECT GID,BILLNO,SETTLENO,SETTLETIME,Billtype,"
+ "(CASE WHEN Billtype=1 THEN '应收账款' WHEN Billtype=2 THEN '应付账款' ELSE '' END) as FEETYPE"
+ ",FARCODE=(select top 1 FARCODE from info_client where SHORTNAME=b.CUSTOMERNAME)"
+ ",FAPCODE=(select top 1 FAPCODE from info_client where SHORTNAME=b.CUSTOMERNAME)"
@ -20324,9 +20326,9 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
sqlBank = sqlBank + ",SXF=ISNULL((SELECT (SXF+DHF) FROM ch_fee_settlement_PAYRMB WHERE BILLNO=b.BILLNO),0)";
sqlBank = sqlBank + " from ch_fee_settlement as b WHERE 1=1 and (ACCOUNTRMB='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "' or ACCOUNTUSD='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "')";
sqlBank = sqlBank + " and GID in (" + sGids.Trim() + ") ";
sqlBank = sqlBank + " GROUP BY billno,SETTLENO,SETTLETIME,CUSTOMERNAME,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,AHSR_CURRENCY,AHSR_RATE,AHSR_MONEY,Billtype,CURR";//,FEETYPE,CURRENCY,EXCHANGERATE
sqlBank = sqlBank + " GROUP BY GID,billno,SETTLENO,SETTLETIME,CUSTOMERNAME,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,AHSR_CURRENCY,AHSR_RATE,AHSR_MONEY,Billtype,CURR";//,FEETYPE,CURRENCY,EXCHANGERATE
sqlBank = sqlBank + " ) as a ";
sqlBank = sqlBank + " GROUP BY BILLNO,SETTLENO,Billtype,SETTLETIME,FEETYPE,SETTLETYPE,CURRENCY,CUSTOMERNAME,AHSR_CURRENCY,AHSR_RATE,ACCOUNTRMB,ACCOUNTUSD,BILLNO_ACAD";//,EXCHANGERATE
sqlBank = sqlBank + " GROUP BY GID,BILLNO,SETTLENO,Billtype,SETTLETIME,FEETYPE,SETTLETYPE,CURRENCY,CUSTOMERNAME,AHSR_CURRENCY,AHSR_RATE,ACCOUNTRMB,ACCOUNTUSD,BILLNO_ACAD";//,EXCHANGERATE
sqlBank = sqlBank + " ORDER BY FEETYPE desc,CURRENCY";//
alBank.Add(sqlBank);
}
@ -20384,12 +20386,12 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
if (headData.ISRATE)
{
sqlBank = "SELECT BILLNO,SETTLENO,BILLTYPE,SETTLETYPE SETTLETYPEREF,FEETYPE,CURRENCY,rate"
sqlBank = "SELECT GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE SETTLETYPEREF,FEETYPE,CURRENCY,rate"
//+ ",(case when CURRENCY='RMB' then 1 else convert(numeric(8,5),round(SUM(hj)/SUM(je),5)) END) as EXCHANGERATE"
+ ",(case when CURRENCY='RMB' then 1 else (case when rate<>1 and rate<>0 then rate else convert(numeric(8,5),round(SUM(hj)/SUM(je),5)) end) END) as EXCHANGERATE"
+ ",ACCOUNTRMB,ACCOUNTUSD,SUM(je) AS je,SUM(hj) AS hj" + sISEXPLAN//,SETTLETYPE+ strISEXPLAN
+ " from ("
+ "SELECT BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,(CASE WHEN FEETYPE = 1 THEN '应收账款' WHEN FEETYPE=2 THEN '应付账款' ELSE '' END) as FEETYPE"
+ "SELECT gid_s GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,(CASE WHEN FEETYPE = 1 THEN '应收账款' WHEN FEETYPE=2 THEN '应付账款' ELSE '' END) as FEETYPE"
+ ",CURRENCY,1 as EXCHANGERATE,rate,ACCOUNTRMB,ACCOUNTUSD"
+ ",SUM(AMOUNT) AS je"
+ ",SUM(convert(decimal(18,2),round(ORIGAMOUNT*rate,2))) AS hj"
@ -20397,19 +20399,19 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
+ sISEXPLAN//,SETTLETYPE+ strISEXPLAN
+ " From VW_ch_fee_settlement_do WHERE 1=1" + strCondition + " and (ACCOUNTRMB='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "' or ACCOUNTUSD='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "')"
+ " and gid_s in (" + sGids.Trim() + ") "
+ " GROUP BY BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,EXCHANGERATE,CURRENCY,ACCOUNTRMB,ACCOUNTUSD,FEETYPE,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ " GROUP BY gid_s,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,EXCHANGERATE,CURRENCY,ACCOUNTRMB,ACCOUNTUSD,FEETYPE,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ ") as a"
+ " GROUP BY BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,EXCHANGERATE,CURRENCY,ACCOUNTRMB,ACCOUNTUSD,FEETYPE,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ " GROUP BY GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,EXCHANGERATE,CURRENCY,ACCOUNTRMB,ACCOUNTUSD,FEETYPE,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ " ORDER BY CURRENCY,FEETYPE" + sISEXPLAN;// + strISEXPLAN
}
else
{
sqlBank = "SELECT BILLNO,SETTLENO,BILLTYPE,SETTLETYPE SETTLETYPEREF,FEETYPE,CURRENCY,rate"
sqlBank = "SELECT GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE SETTLETYPEREF,FEETYPE,CURRENCY,rate"
//+ ",(case when CURRENCY='RMB' then 1 else convert(numeric(8,5),round(SUM(hj)/SUM(je),5)) END) as EXCHANGERATE"
+ ",(case when CURRENCY='RMB' then 1 else (case when rate<>1 and rate<>0 then rate else convert(numeric(8,5),round(SUM(hj)/SUM(je),5)) end) END) as EXCHANGERATE"
+ ",ACCOUNTRMB,ACCOUNTUSD,SUM(je) AS je,SUM(hj) AS hj" + sISEXPLAN//,SETTLETYPE+ strISEXPLAN
+ " from ("
+ "SELECT BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,(CASE WHEN FEETYPE = 1 THEN '应收账款' WHEN FEETYPE=2 THEN '应付账款' ELSE '' END) as FEETYPE"
+ "SELECT gid_s GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,(CASE WHEN FEETYPE = 1 THEN '应收账款' WHEN FEETYPE=2 THEN '应付账款' ELSE '' END) as FEETYPE"
+ ",CURRENCY,1 as EXCHANGERATE,rate,ACCOUNTRMB,ACCOUNTUSD"
+ ",SUM(AMOUNT) AS je"
+ ",SUM(convert(decimal(18,2),round(ORIGAMOUNT*" + tbRATE_CASH + ",2))) AS hj"
@ -20417,21 +20419,21 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
+ sISEXPLAN//,SETTLETYPE+ strISEXPLAN
+ " From VW_ch_fee_settlement_do WHERE 1=1" + strCondition + " and (ACCOUNTRMB='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "' or ACCOUNTUSD='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "')"
+ " and gid_s in (" + sGids.Trim() + ") "
+ " GROUP BY BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,EXCHANGERATE,CURRENCY,ACCOUNTRMB,ACCOUNTUSD,FEETYPE,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ " GROUP BY gid_s,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,EXCHANGERATE,CURRENCY,ACCOUNTRMB,ACCOUNTUSD,FEETYPE,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ ") as a"
+ " GROUP BY BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,EXCHANGERATE,CURRENCY,ACCOUNTRMB,ACCOUNTUSD,FEETYPE,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ " GROUP BY GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,EXCHANGERATE,CURRENCY,ACCOUNTRMB,ACCOUNTUSD,FEETYPE,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ " ORDER BY CURRENCY,FEETYPE" + sISEXPLAN;// + strISEXPLAN
}
}
else
{
sqlBank = "SELECT BILLNO,SETTLENO,BILLTYPE,SETTLETYPE SETTLETYPEREF,(CASE WHEN FEETYPE = 1 THEN '应收账款' WHEN FEETYPE=2 THEN '应付账款' ELSE '' END) as FEETYPE,'RMB' as CURRENCY,1 as EXCHANGERATE,ACCOUNTRMB,ACCOUNTUSD"
sqlBank = "SELECT gid_s GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE SETTLETYPEREF,(CASE WHEN FEETYPE = 1 THEN '应收账款' WHEN FEETYPE=2 THEN '应付账款' ELSE '' END) as FEETYPE,'RMB' as CURRENCY,1 as EXCHANGERATE,ACCOUNTRMB,ACCOUNTUSD"
+ ",SUM(ORIGAMOUNT) AS je"
+ ",SUM(convert(decimal(18,2),round(ORIGAMOUNT*" + tbRATE_CASH + ",2))) AS hj"
+ sISEXPLAN//,SETTLETYPE+ strISEXPLAN
+ " From VW_ch_fee_settlement_do WHERE 1=1" + strCondition + " and (ACCOUNTRMB='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "' or ACCOUNTUSD='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "')"
+ " and gid_s in (" + sGids.Trim() + ") "
+ " GROUP BY BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,FEETYPE,ACCOUNTRMB,ACCOUNTUSD,RATE" + sISEXPLAN//BILLNO,SETTLETYPE, + strISEXPLAN
+ " GROUP BY gid_s,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,FEETYPE,ACCOUNTRMB,ACCOUNTUSD,RATE" + sISEXPLAN//BILLNO,SETTLETYPE, + strISEXPLAN
+ " ORDER BY FEETYPE,ACCOUNTRMB,ACCOUNTUSD,RATE" + sISEXPLAN;// + strISEXPLAN
}
alBank.Add(sqlBank);
@ -20485,31 +20487,31 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
//ISFCY 是否核算外币
if (dsBank.Tables[0].Rows[i]["ISFCY"].ToString().Trim() == "True")
{
sqlBankCE = "SELECT BILLNO,SETTLENO,BILLTYPE,SETTLETYPE SETTLETYPEREF,ACCOUNTRMB,ACCOUNTUSD,CURRENCY,rate"
sqlBankCE = "SELECT GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE SETTLETYPEREF,ACCOUNTRMB,ACCOUNTUSD,CURRENCY,rate"
//+ ",(case when CURRENCY='RMB' then 1 else convert(numeric(8,5),round(SUM(hj)/SUM(je),5)) END) as EXCHANGERATE"
+ ",(case when CURRENCY='RMB' then 1 else (case when rate<>1 and rate<>0 then rate else convert(numeric(8,5),round(SUM(hj)/SUM(je),5)) end) END) as EXCHANGERATE"
+ ",SUM(je) AS je,SUM(hj) AS hj" + sISEXPLAN//,SETTLETYPE+ strISEXPLAN
+ " from ("
+ "SELECT BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,CURRENCY,1 as EXCHANGERATE,rate"
+ "SELECT gid_s GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,CURRENCY,1 as EXCHANGERATE,rate"
+ ",SUM((case when FEETYPE=1 then AMOUNT else (-AMOUNT) end)) AS je"
+ ",SUM(convert(decimal(18,2),round((case when FEETYPE=1 then ORIGAMOUNT else (-ORIGAMOUNT) end)*" + tbRATE_CASH + ",2))) AS hj"
+ sISEXPLAN//,SETTLETYPE+ strISEXPLAN
+ " From VW_ch_fee_settlement_do WHERE 1=1" + strCondition + " and (ACCOUNTRMB='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "' or ACCOUNTUSD='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "')"
+ " and gid_s in (" + sGids.Trim() + ") "
+ " GROUP BY BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,EXCHANGERATE,CURRENCY,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ " GROUP BY gid_s,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,EXCHANGERATE,CURRENCY,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ ") as a"
+ " GROUP BY BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,EXCHANGERATE,CURRENCY,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ " GROUP BY GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,EXCHANGERATE,CURRENCY,RATE" + sISEXPLAN//,BILLNO,SETTLETYPE + strISEXPLAN
+ " ORDER BY CURRENCY" + sISEXPLAN;// + strISEXPLAN
}
else
{
sqlBankCE = "SELECT BILLNO,SETTLENO,BILLTYPE,SETTLETYPE SETTLETYPEREF,ACCOUNTRMB,ACCOUNTUSD,'RMB' as CURRENCY,1 as EXCHANGERATE"
sqlBankCE = "SELECT gid_s GID,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE SETTLETYPEREF,ACCOUNTRMB,ACCOUNTUSD,'RMB' as CURRENCY,1 as EXCHANGERATE"
+ ",SUM((case when FEETYPE=1 then AMOUNT else (-AMOUNT) end)) AS je"
+ ",SUM(convert(decimal(18,2),round((case when FEETYPE=1 then ORIGAMOUNT else (-ORIGAMOUNT) end)*" + tbRATE_CASH + ",2))) AS hj"
+ sISEXPLAN//,SETTLETYPE+ strISEXPLAN
+ " From VW_ch_fee_settlement_do WHERE 1=1" + strCondition + " and (ACCOUNTRMB='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "' or ACCOUNTUSD='" + dsBank.Tables[0].Rows[i]["BankGid"].ToString().Trim() + "')"
+ " and gid_s in (" + sGids.Trim() + ") ";
sqlBankCE += " GROUP BY BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,RATE" + sISEXPLAN.Trim();//strISEXPLAN.Trim() +
sqlBankCE += " GROUP BY gid_s,BILLNO,SETTLENO,BILLTYPE,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,RATE" + sISEXPLAN.Trim();//strISEXPLAN.Trim() +
sqlBankCE += " ORDER BY ACCOUNTRMB,ACCOUNTUSD,RATE" + sISEXPLAN.Trim();//strISEXPLAN.Trim() +
}
alBankCE.Add(sqlBankCE);
@ -20527,7 +20529,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
{
sqlDR = "SELECT S.BILLNO,s.SETTLENO,s.SETTLETIME,(CASE WHEN Billtype=1 THEN '应收账款' WHEN Billtype=2 THEN '应付账款' ELSE '' END) as FEETYPE,"
sqlDR = "SELECT s.GID,S.BILLNO,s.SETTLENO,s.SETTLETIME,(CASE WHEN Billtype=1 THEN '应收账款' WHEN Billtype=2 THEN '应付账款' ELSE '' END) as FEETYPE,"
+ "SETTLETYPE,CUSTOMERNAME,CURR CURRENCY,ISNULL(EXCHANGERATE,1) EXCHANGERATE,(ACCOUNTS_MONEY) AS ACCOUNTS_MONEY_JE,"
+ "(select STLNAME from [code_stlmode] where STLCODE=s.SETTLETYPE) as SETTLETYPEREF,"
+ "convert(decimal(18,2),round((ACCOUNTS_MONEY*(case when ISNULL(ACCOUNTS_CURRENCY,CURR)<>'RMB' AND ACCOUNTS_RATE=1 "
@ -20550,7 +20552,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
+ "left join (select top 1 ISNULL(f.EXCHANGERATE,1) EXCHANGERATE,d.BILLNO from ch_fee f left join ch_fee_do d on (d.FEEID=f.GID) "
+ "WHERE F.CURRENCY<>'RMB' ) as f on (f.BILLNO=s.BILLNO)"
+ " WHERE 1=1 and s.GID in (" + sGids.Trim() + ") "// + strISEXPLAN//,FEETYPE
+ " GROUP BY s.billno,s.SETTLENO,s.SETTLETIME,CUSTOMERNAME,EXCHANGERATE,CURR,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,ACCOUNTS_CURRENCY,PREPAY_CURRENCY,AHSR_CURRENCY,FINANCIAL_CURRENCY,ADVANCE_CURRENCY,ACCOUNTS_RATE,PREPAY_RATE,AHSR_RATE,FINANCIAL_RATE,ADVANCE_RATE,ACCOUNTS_MONEY,PREPAY_MONEY,AHSR_MONEY,FINANCIAL_MONEY,ADVANCE_MONEY,Billtype,CURR"// + strISEXPLAN//,FEETYPE
+ " GROUP BY s.GID,s.billno,s.SETTLENO,s.SETTLETIME,CUSTOMERNAME,EXCHANGERATE,CURR,SETTLETYPE,ACCOUNTRMB,ACCOUNTUSD,ACCOUNTS_CURRENCY,PREPAY_CURRENCY,AHSR_CURRENCY,FINANCIAL_CURRENCY,ADVANCE_CURRENCY,ACCOUNTS_RATE,PREPAY_RATE,AHSR_RATE,FINANCIAL_RATE,ADVANCE_RATE,ACCOUNTS_MONEY,PREPAY_MONEY,AHSR_MONEY,FINANCIAL_MONEY,ADVANCE_MONEY,Billtype,CURR"// + strISEXPLAN//,FEETYPE
+ " ORDER BY FEETYPE desc,CURR,CUSTOMERNAME";// +strISEXPLAN;
}
@ -20630,7 +20632,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
#region 应收应付
sqlARFC = "SELECT BILLNO,SETTLENO,BILLTYPE,DRACCID,CRACCID,FEETYPE,SETTLETYPE"
sqlARFC = "SELECT gid_s GID,BILLNO,SETTLENO,BILLTYPE,DRACCID,CRACCID,FEETYPE,SETTLETYPE"
+ ",ORIGCURRENCY as CURRENCY," + tbRATE + " as EXCHANGERATE"
+ ",SUM(ORIGAMOUNT) AS je"
// + ",convert(decimal(18,2),round(SUM(ORIGAMOUNT)*" + tbRATE + ",2)) AS hj"
@ -20639,7 +20641,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
+ ",ACCOUNTRMB,ACCOUNTUSD" + strISEXPLAN + sISEXPLAN
+ " From VW_ch_fee_settlement_do WHERE 1=1" + strCondition
+ " and gid_s in (" + sGids.Trim() + ") "
+ " GROUP BY BILLNO,SETTLENO,BILLTYPE,DRACCID,CRACCID,FEETYPE,SETTLETYPE,EXCHANGERATE,CURRENCY,ORIGCURRENCY,ORIGEXCHANGERATE,ACCOUNTRMB,ACCOUNTUSD,RATE" + strISEXPLAN + sISEXPLAN
+ " GROUP BY gid_s,BILLNO,SETTLENO,BILLTYPE,DRACCID,CRACCID,FEETYPE,SETTLETYPE,EXCHANGERATE,CURRENCY,ORIGCURRENCY,ORIGEXCHANGERATE,ACCOUNTRMB,ACCOUNTUSD,RATE" + strISEXPLAN + sISEXPLAN
+ " ORDER BY DRACCID,CRACCID,FEETYPE desc,ORIGCURRENCY" + strISEXPLAN + sISEXPLAN;
DataSet dsVWChFeeAR = T_ALL_DA.GetAllSQL(sqlARFC);
@ -20743,6 +20745,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
((dsARMBSPENDING.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !dsARMBSPENDING.ISCORPACC)
&& ((dsARMBSPENDING.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !dsARMBSPENDING.ISDEPTACC)
&& (dsCwDesign.Tables[0].Rows[0]["ISSTLDRCRISGROUP"].ToString().Trim() == "True" || items.EXPLAN == strEXPLAN)
&& ((dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True"&& dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim()==items.TMPGID) || dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() != "True")
&& ((dsARMBSPENDING.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !dsARMBSPENDING.ISEMPLACC)
&& ((dsARMBSPENDING.ISITEMACC && items.ITEMGID == dsVWChFeeAR.Tables[0].Rows[i]["ITEMGID"].ToString().Trim()) || !dsARMBSPENDING.ISITEMACC)
&&((dsCwDesign.Tables[0].Rows[0]["PiaoHaoRP"].ToString().Trim() == "")||(dsCwDesign.Tables[0].Rows[0]["PiaoHaoRP"].ToString().Trim()!=""
@ -20777,6 +20780,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.FCYDR = 0;//外币借方金额
MsCwVouitemsGl.FCYCR = 0;//外币贷方金额
MsCwVouitemsGl.TMPBILLNO = dsVWChFeeAR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();
MsCwVouitemsGl.TMPGID = dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim();
dRMBS += Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["hj"].ToString().Trim());//本位币借方金额(互斥)
//
MsCwVouitemsGl.ACCNAME = dsARMBSPENDING.ACCLNAME;//科目名称
@ -20890,6 +20895,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
&& dsARTMSFC.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !dsARTMSFC.ISCORPACC)
&& ((dsARTMSFC.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !dsARTMSFC.ISDEPTACC)
&& (dsCwDesign.Tables[0].Rows[0]["ISSTLDRCRISGROUP"].ToString().Trim() == "True" || items.EXPLAN == strEXPLAN)
&& ((dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True" && dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim() == items.TMPGID) || dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() != "True")
&& ((dsARTMSFC.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !dsARTMSFC.ISEMPLACC)
&& ((dsARTMSFC.ISITEMACC && items.ITEMGID == dsVWChFeeAR.Tables[0].Rows[i]["ITEMGID"].ToString().Trim()) || !dsARTMSFC.ISITEMACC)
@ -20930,6 +20936,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.FCYCR = Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["je"].ToString().Trim());//外币贷方金额
dRMBS += Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["hj"].ToString().Trim());//本位币借方金额(互斥)
MsCwVouitemsGl.TMPBILLNO = dsVWChFeeAR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();
MsCwVouitemsGl.TMPGID = dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim();
//
MsCwVouitemsGl.ACCNAME = dsARTMSFC.ACCLNAME;//科目名称
MsCwVouitemsGl.ISDEPTACC = dsARTMSFC.ISDEPTACC;//核算部门,按规则设置生成
@ -21051,7 +21058,9 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
if (items.ACCID == dsAR.ACCID && items.FCYNO == "RMB" && items.DC == "D" &&
((dsAR.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !dsAR.ISCORPACC)
&& ((dsAR.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !dsAR.ISDEPTACC)
&& (dsCwDesign.Tables[0].Rows[0]["ISSTLDRCRISGROUP"].ToString().Trim() == "True"||items.EXPLAN == strEXPLAN)
&& (dsCwDesign.Tables[0].Rows[0]["ISSTLDRCRISGROUP"].ToString().Trim() == "True"||items.EXPLAN == strEXPLAN)
&& ((dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True" && dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim() == items.TMPGID) || dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() != "True")
&& ((dsAR.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !dsAR.ISEMPLACC)
&& ((dsAR.ISITEMACC && items.ITEMGID == dsVWChFeeAR.Tables[0].Rows[i]["ITEMGID"].ToString().Trim()) || !dsAR.ISITEMACC)
&& ((dsCwDesign.Tables[0].Rows[0]["PiaoHaoRP"].ToString().Trim() == "") || (dsCwDesign.Tables[0].Rows[0]["PiaoHaoRP"].ToString().Trim() != ""
@ -21087,6 +21096,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.FCYCR = 0;//外币贷方金额
dRMBS += Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["hj"].ToString().Trim());//本位币借方金额(互斥)
MsCwVouitemsGl.TMPBILLNO = dsVWChFeeAR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();
MsCwVouitemsGl.TMPGID = dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim();
//
MsCwVouitemsGl.ACCNAME = dsAR.ACCLNAME;//科目名称
MsCwVouitemsGl.ISDEPTACC = dsAR.ISDEPTACC;//核算部门,按规则设置生成
@ -21206,7 +21217,9 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
if (items.ACCID == dsARFC.ACCID && items.FCYNO == dsVWChFeeAR.Tables[0].Rows[i]["CURRENCY"].ToString().Trim() && items.DC == "D"
&& items.FCYEXRATE == Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["EXCHANGERATE"].ToString().Trim())
&& (dsCwDesign.Tables[0].Rows[0]["ISSTLDRCRISGROUP"].ToString().Trim() == "True" || items.EXPLAN == strEXPLAN)
&&((dsARFC.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !dsARFC.ISCORPACC)
&& ((dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True" && dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim() == items.TMPGID) || dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() != "True")
&& ((dsARFC.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !dsARFC.ISCORPACC)
&& ((dsARFC.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !dsARFC.ISDEPTACC)
&& ((dsARFC.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !dsARFC.ISEMPLACC)
&& ((dsARFC.ISITEMACC && items.ITEMGID == dsVWChFeeAR.Tables[0].Rows[i]["ITEMGID"].ToString().Trim()) || !dsARFC.ISITEMACC)
@ -21248,6 +21261,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.FCYDR = 0;//外币贷方金额
dRMBS += Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["hj"].ToString().Trim());//本位币借方金额(互斥)
MsCwVouitemsGl.TMPBILLNO = dsVWChFeeAR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();
MsCwVouitemsGl.TMPGID = dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim();
//
MsCwVouitemsGl.ACCNAME = dsARFC.ACCLNAME;//科目名称
MsCwVouitemsGl.ISDEPTACC = dsARFC.ISDEPTACC;//核算部门,按规则设置生成
@ -21372,6 +21387,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
if (items.ACCID == dsAPMBSPENDING.ACCID && items.FCYNO == "RMB" && items.DC == "C" &&
((dsAPMBSPENDING.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !dsAPMBSPENDING.ISCORPACC)
&& (dsCwDesign.Tables[0].Rows[0]["ISSTLDRCRISGROUP"].ToString().Trim() == "True" || items.EXPLAN == strEXPLAN)
&& ((dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True" && dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim() == items.TMPGID) || dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() != "True")
&& ((dsAPMBSPENDING.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !dsAPMBSPENDING.ISDEPTACC)
&& ((dsAPMBSPENDING.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !dsAPMBSPENDING.ISEMPLACC)
&& ((dsAPMBSPENDING.ISITEMACC && items.ITEMGID == dsVWChFeeAR.Tables[0].Rows[i]["ITEMGID"].ToString().Trim()) || !dsAPMBSPENDING.ISITEMACC)
@ -21408,6 +21425,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.FCYCR = 0;//外币贷方金额
dRMBS += Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["hj"].ToString().Trim());//本位币借方金额(互斥)
MsCwVouitemsGl.TMPBILLNO = dsVWChFeeAR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();
MsCwVouitemsGl.TMPGID = dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim();
//
MsCwVouitemsGl.ACCNAME = dsAPMBSPENDING.ACCLNAME;//科目名称
MsCwVouitemsGl.ISDEPTACC = dsAPMBSPENDING.ISDEPTACC;//核算部门,按规则设置生成
@ -21529,6 +21548,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
((dsAPTMSFC.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !dsAPTMSFC.ISCORPACC)
&& ((dsAPTMSFC.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !dsAPTMSFC.ISDEPTACC)
&& (dsCwDesign.Tables[0].Rows[0]["ISSTLDRCRISGROUP"].ToString().Trim() == "True" || items.EXPLAN == strEXPLAN)
&& ((dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True" && dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim() == items.TMPGID) || dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() != "True")
&& ((dsAPTMSFC.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !dsAPTMSFC.ISEMPLACC)
&& ((dsAPTMSFC.ISITEMACC && items.ITEMGID == dsVWChFeeAR.Tables[0].Rows[i]["ITEMGID"].ToString().Trim()) || !dsAPTMSFC.ISITEMACC)
&& ((dsCwDesign.Tables[0].Rows[0]["PiaoHaoRP"].ToString().Trim() == "") || (dsCwDesign.Tables[0].Rows[0]["PiaoHaoRP"].ToString().Trim() != ""
@ -21564,6 +21585,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.AMTDR = Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["hj"].ToString().Trim());//本位币贷方金额(互斥)
MsCwVouitemsGl.ISFCY = false;//是否外币
MsCwVouitemsGl.FCYNO = dsVWChFeeAR.Tables[0].Rows[i]["CURRENCY"].ToString().Trim();//外币
MsCwVouitemsGl.TMPBILLNO = dsVWChFeeAR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();
MsCwVouitemsGl.TMPGID = dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim();
strFCY = MsCwVouitemsGl.FCYNO;
MsCwVouitemsGl.FCYCR = 0;//外币借方金额
MsCwVouitemsGl.FCYDR = Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["je"].ToString().Trim());//外币贷方金额
@ -21691,6 +21714,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
((dsAP.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !dsAP.ISCORPACC)
&& ((dsAP.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !dsAP.ISDEPTACC)
&& (dsCwDesign.Tables[0].Rows[0]["ISSTLDRCRISGROUP"].ToString().Trim() == "True" || items.EXPLAN == strEXPLAN)
&& ((dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True" && dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim() == items.TMPGID) || dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() != "True")
&& ((dsAP.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !dsAP.ISEMPLACC)
&& ((dsAP.ISITEMACC && items.ITEMGID == dsVWChFeeAR.Tables[0].Rows[i]["ITEMGID"].ToString().Trim()) || !dsAP.ISITEMACC)
&& ((dsCwDesign.Tables[0].Rows[0]["PiaoHaoRP"].ToString().Trim() == "") || (dsCwDesign.Tables[0].Rows[0]["PiaoHaoRP"].ToString().Trim() != ""
@ -21726,6 +21751,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.FCYCR = 0;//外币贷方金额
dRMBS += Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["hj"].ToString().Trim());//本位币借方金额(互斥)
MsCwVouitemsGl.TMPBILLNO = dsVWChFeeAR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();
MsCwVouitemsGl.TMPGID = dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim();
//
MsCwVouitemsGl.ACCNAME = dsAP.ACCLNAME;//科目名称
MsCwVouitemsGl.ISDEPTACC = dsAP.ISDEPTACC;//核算部门,按规则设置生成
@ -21847,6 +21873,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
((dsAPFC.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !dsAPFC.ISCORPACC)
&& ((dsAPFC.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !dsAPFC.ISDEPTACC)
&& (dsCwDesign.Tables[0].Rows[0]["ISSTLDRCRISGROUP"].ToString().Trim() == "True" || items.EXPLAN == strEXPLAN)
&& ((dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True" && dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim() == items.TMPGID) || dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() != "True")
&& ((dsAPFC.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !dsAPFC.ISEMPLACC)
&& ((dsAPFC.ISITEMACC && items.ITEMGID == dsVWChFeeAR.Tables[0].Rows[i]["ITEMGID"].ToString().Trim()) || !dsAPFC.ISITEMACC)
&& ((dsCwDesign.Tables[0].Rows[0]["PiaoHaoRP"].ToString().Trim() == "") || (dsCwDesign.Tables[0].Rows[0]["PiaoHaoRP"].ToString().Trim() != ""
@ -21887,6 +21915,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.FCYCR = 0;//外币贷方金额
dRMBS += Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["hj"].ToString().Trim());//本位币借方金额(互斥)
MsCwVouitemsGl.TMPBILLNO = dsVWChFeeAR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();
MsCwVouitemsGl.TMPGID = dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim();
//
MsCwVouitemsGl.ACCNAME = dsAPFC.ACCLNAME;//科目名称
MsCwVouitemsGl.ISDEPTACC = dsAPFC.ISDEPTACC;//核算部门,按规则设置生成
@ -22015,6 +22044,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
((DRACCID.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !DRACCID.ISCORPACC)
&& ((DRACCID.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !DRACCID.ISDEPTACC)
&& items.EXPLAN == strEXPLAN
&& ((dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True" && dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim() == items.TMPGID) || dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() != "True")
&& ((DRACCID.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !DRACCID.ISEMPLACC)
&& ((DRACCID.ISITEMACC && items.ITEMGID == dsVWChFeeAR.Tables[0].Rows[i]["ITEMGID"].ToString().Trim()) || !DRACCID.ISITEMACC))
@ -22106,6 +22137,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
}
MsCwVouitemsGl.TMPBILLNO = dsVWChFeeAR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();
MsCwVouitemsGl.TMPGID = dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim();
MsCwVouitemsGl.ACCNAME = DRACCID.ACCLNAME;//科目名称
@ -22228,6 +22260,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
((CRACCID.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !CRACCID.ISCORPACC)
&& ((CRACCID.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !CRACCID.ISDEPTACC)
&& items.EXPLAN == strEXPLAN
&& ((dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True" && dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim() == items.TMPGID) || dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() != "True")
&& ((CRACCID.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !CRACCID.ISEMPLACC)
&& ((CRACCID.ISITEMACC && items.ITEMGID == dsVWChFeeAR.Tables[0].Rows[i]["ITEMGID"].ToString().Trim()) || !CRACCID.ISITEMACC))
@ -22320,6 +22354,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.TMPBILLNO = dsVWChFeeAR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();
MsCwVouitemsGl.TMPGID = dsVWChFeeAR.Tables[0].Rows[i]["GID"].ToString().Trim();
MsCwVouitemsGl.ACCNAME = CRACCID.ACCLNAME;//科目名称
MsCwVouitemsGl.ISDEPTACC = CRACCID.ISDEPTACC;//核算部门,按规则设置生成
@ -22572,7 +22607,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.ISCORPACC = dsDRFC.ISCORPACC;//核算客户,按规则设置生成
MsCwVouitemsGl.ISITEMACC = dsDRFC.ISITEMACC;//核算项目,按规则设置生成
MsCwVouitemsGl.TMPBILLNO = dsVwcfsdDR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = dsVwcfsdDR.Tables[0].Rows[i]["GID"].ToString().Trim();
if (dsDRFC.DC == "借")
{
MsCwVouitemsGl.DC = "D";//借方向
@ -22701,6 +22736,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
dEXCHANGERATE = 1;//汇率
MsCwVouitemsGl.BLNO = "";
MsCwVouitemsGl.TMPBILLNO = dsVwcfsdDR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = dsVwcfsdDR.Tables[0].Rows[i]["GID"].ToString().Trim();
}
else
@ -22747,6 +22783,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
dEXCHANGERATE = Decimal.Parse(dsVwcfsdDR.Tables[0].Rows[i]["PREPAY_RATE"].ToString().Trim());//汇率
MsCwVouitemsGl.BLNO = "";
MsCwVouitemsGl.TMPBILLNO = dsVwcfsdDR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = dsVwcfsdDR.Tables[0].Rows[i]["GID"].ToString().Trim();
}
@ -22918,6 +22955,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.ISCORPACC = dsCASH.ISCORPACC;//核算客户,按规则设置生成
MsCwVouitemsGl.ISITEMACC = dsCASH.ISITEMACC;//核算项目,按规则设置生成
MsCwVouitemsGl.TMPBILLNO = dsVwcfsdCASH.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = dsVwcfsdCASH.Tables[0].Rows[i]["GID"].ToString().Trim();
//
string strACCALL = "";
@ -23076,7 +23114,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.ISCORPACC = dsCASH.ISCORPACC;//核算客户
MsCwVouitemsGl.ISITEMACC = dsCASH.ISITEMACC;//核算项目
MsCwVouitemsGl.TMPBILLNO = dsVwcfsdCASHCE.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = dsVwcfsdCASH.Tables[0].Rows[i]["GID"].ToString().Trim();
//
string strACCALL = "";
//是否核算客户
@ -23349,7 +23387,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.ISCORPACC = BANKACC.ISCORPACC;//核算客户,按规则设置生成
MsCwVouitemsGl.ISITEMACC = BANKACC.ISITEMACC;//核算项目,按规则设置生成
MsCwVouitemsGl.TMPBILLNO = ds.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = ds.Tables[0].Rows[i]["GID"].ToString().Trim();
//
string strACCALL = "";
//是否核算客户
@ -23498,7 +23536,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.ISCORPACC = BANKACC.ISCORPACC;//核算客户,按规则设置生成
MsCwVouitemsGl.ISITEMACC = BANKACC.ISITEMACC;//核算项目,按规则设置生成
MsCwVouitemsGl.TMPBILLNO = ds.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
//
MsCwVouitemsGl.TMPGID = ds.Tables[0].Rows[i]["GID"].ToString().Trim(); //
strACCALL = "";
//是否核算客户
MsCwVouitemsGl.CORPID = "";//客户(系统)
@ -23739,7 +23777,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.ISCORPACC = BANKACC.ISCORPACC;//核算客户,按规则设置生成
MsCwVouitemsGl.ISITEMACC = BANKACC.ISITEMACC;//核算项目,按规则设置生成
MsCwVouitemsGl.TMPBILLNO = ds.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = ds.Tables[0].Rows[i]["GID"].ToString().Trim();
//
string strACCALL = "";
//是否核算客户
@ -24021,7 +24059,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.ISCORPACC = BANKACC.ISCORPACC;//核算客户
MsCwVouitemsGl.ISITEMACC = BANKACC.ISITEMACC;//核算项目
MsCwVouitemsGl.TMPBILLNO = ds.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = ds.Tables[0].Rows[i]["GID"].ToString().Trim();
//
string strACCALL = "";
//是否核算客户
@ -24239,7 +24277,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl.ISCORPACC = dsFC.ISCORPACC;//核算客户,按规则设置生成
MsCwVouitemsGl.ISITEMACC = dsFC.ISITEMACC;//核算项目,按规则设置生成
MsCwVouitemsGl.TMPBILLNO = dsVwcfsdDR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = dsVwcfsdDR.Tables[0].Rows[i]["GID"].ToString().Trim();
if (dsFC.DC == "借")
{
MsCwVouitemsGl.DC = "D";//借方向
@ -24363,7 +24401,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
}
MsCwVouitemsGl.TMPBILLNO = dsVwcfsdDR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = dsVwcfsdDR.Tables[0].Rows[i]["GID"].ToString().Trim();
MsCwVouitemsGl.ISDEPTACC = dsFC.ISDEPTACC;//核算部门,按规则设置生成
MsCwVouitemsGl.ISEMPLACC = dsFC.ISEMPLACC;//核算人员,按规则设置生成
MsCwVouitemsGl.ISCORPACC = dsFC.ISCORPACC;//核算客户,按规则设置生成
@ -24636,7 +24674,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
}
#endregion
MsCwVouitemsGl.TMPBILLNO = dsVwcfsdDR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = dsVwcfsdDR.Tables[0].Rows[i]["GID"].ToString().Trim();
MsCwVouitemsGl.QTYUNIT = "";//数量包装单位
MsCwVouitemsGl.QTYDR = 0;//借方数量
MsCwVouitemsGl.QTYCR = 0;//贷方数量
@ -24782,7 +24820,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
}
#endregion
MsCwVouitemsGl.TMPBILLNO = dsVwcfsdDR.Tables[0].Rows[i]["BILLNO"].ToString().Trim();//客户(系统)
MsCwVouitemsGl.TMPGID = dsVwcfsdDR.Tables[0].Rows[i]["GID"].ToString().Trim();
MsCwVouitemsGl.QTYUNIT = "";//数量包装单位
MsCwVouitemsGl.QTYDR = 0;//借方数量
MsCwVouitemsGl.QTYCR = 0;//贷方数量
@ -24830,8 +24868,38 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
decimal TTLDR = 0;
decimal TTLCR = 0;
var tmpCwVouitemsEntities = CwVouitemsEntities;
var tmpCwVouitemsEntities =new List<MsCwVouitemsGl>();
var sortint = 1;
if (dsCwDesign.Tables[0].Rows[0]["ISSTLVOUBILLGROUP"].ToString().Trim() == "True")
{
foreach (var invgid in invlist)
{
foreach (var vouitem in CwVouitemsEntities)
{
if (invgid == vouitem.TMPGID)
{
vouitem.TMPGID = sortint.ToString();
tmpCwVouitemsEntities.Add(vouitem);
}
}
sortint = sortint + 1;
}
CwVouitemsEntities = tmpCwVouitemsEntities.OrderBy(x => x.TMPGID).ThenBy(p => p.ITEMNO).ToList();
}
else {
foreach (var vouitem in CwVouitemsEntities)
{
vouitem.TMPGID = sortint.ToString();
tmpCwVouitemsEntities.Add(vouitem);
sortint = sortint + 1;
}
}
var item = 1;
foreach (var enumValue in CwVouitemsEntities)
{
TTLDR = TTLDR + enumValue.AMTDR;
@ -24857,6 +24925,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
enumValue.FCYDR = 0;
enumValue.FCYCR = 0;
}
enumValue.ITEMNO = item;
item = item + 1;
}
if (TTLDR != TTLCR)
@ -24865,7 +24935,8 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
MsCwVouitemsGl MsCwVouitemsGl = new MsCwVouitemsGl();
//MsCwVouitemsGl.GID 唯一编码 newid()
MsCwVouitemsGl.ORDNO = strORDNO.Trim();
MsCwVouitemsGl.ITEMNO = 10;// 行号
MsCwVouitemsGl.ITEMNO = item;
item = item + 1; // 行号
MsCwVouitemsGl.PACCID = "";//父级科目贷码
MsCwVouitemsGl.PROPERTY = 0;//科目属性
MsCwVouitemsGl.GRADE = 0;//科目级别
@ -24950,7 +25021,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Settlement
if (headData.ISSTBANKGROUP)
{
IList<MsCwVouitemsGl> CwVouitemsEntities2 = new List<MsCwVouitemsGl>();
List<MsCwVouitemsGl> CwVouitemsEntities2 = new List<MsCwVouitemsGl>();
foreach (var enumValue in CwVouitemsEntities)
{

@ -2672,7 +2672,12 @@ Ext.extend(Shipping.MsChInvoiceAppEdit, Ext.Panel, {
dataIndex: 'SALE',
header: '揽货人',
width: 80
}
}, {
sortable: true,
dataIndex: 'COMPANYNAME',
header: '所属分部',
width: 80
}
]
});

@ -900,30 +900,30 @@ namespace DSWeb.Areas.Dispatch.Controllers
name="关于我们",
sub_button=new object[]
{
new
{
type="view",
name ="组织框架",
url ="https://v.xiumi.us/stage/v5/3EOyB/146935898"
},
new
{
type="view",
name ="部门职责",
url ="https://v.xiumi.us/stage/v5/44tOy/147193130"
},
//new
//{
// type="view",
// name ="组织框架",
// url ="https://v.xiumi.us/stage/v5/3EOyB/146935898"
//},
//new
//{
// type="view",
// name ="部门职责",
// url ="https://v.xiumi.us/stage/v5/44tOy/147193130"
//},
new
{
type="view",
name ="公司介绍",
url ="https://v.xiumi.us/stage/v5/44tOy/147738490"
},
new
{
type="view",
name ="仓库收费标准",
url ="https://v.xiumi.us/board/v5/3EOyB/176410025"
url ="https://v.xiumi.us/stage/v5/5ITnD/409265436"
},
//new
//{
// type="view",
// name ="仓库收费标准",
// url ="https://v.xiumi.us/board/v5/3EOyB/176410025"
//},
new
{
type="view",

@ -43,7 +43,7 @@ namespace DSWeb.MvcShipping.Controllers
public ContentResult GetDataList(int start, int limit, string sort, string condition)
{
var dataList = BaoxiaoDAL.GetDataList(condition, Convert.ToString(Session["USERID"]));
var dataList = BaoxiaoDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var list = dataList.Skip(start).Take(limit);
@ -57,7 +57,7 @@ namespace DSWeb.MvcShipping.Controllers
if (handle == "edit")
{
var list = BaoxiaoDAL.GetDataList(condition, Convert.ToString(Session["USERID"]));
var list = BaoxiaoDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
if (list.Count > 0)
head = list[0];
}

@ -632,7 +632,7 @@ namespace DSWeb.MvcShipping.Controllers
else
headData.CUSTNO = MsOpSeaeDAL.getCodeRule("委托编号", "CUSTNO", headData.BSDATE.ToString().Trim(), accdate, Convert.ToString(Session["USERID"]), Convert.ToString(Session["COMPANYID"]));
T_ALL_DA T_ALL_DA = new T_ALL_DA();
if (!string.IsNullOrEmpty(headData.SALECORPID))
if (!string.IsNullOrEmpty(OrderData.SALECORPID))
{
headData.SALECORPID = OrderData.SALECORPID;
}

@ -159,6 +159,8 @@ namespace DSWeb.MvcShipping.DAL.MsCwDesignGlDAL
data.ISSTLDRCRISGROUP = (reader["ISSTLDRCRISGROUP"] == null ? false : Convert.ToBoolean(reader["ISSTLDRCRISGROUP"]));//结算凭证应收应付账款合并
if (reader["ISINVAMOUNTASSUM"] != DBNull.Value)
data.ISINVAMOUNTASSUM = (reader["ISINVAMOUNTASSUM"] == null ? false : Convert.ToBoolean(reader["ISINVAMOUNTASSUM"]));//销项发票根据开票金额生成凭证
if (reader["ISSTLVOUBILLGROUP"] != DBNull.Value)
data.ISSTLVOUBILLGROUP = (reader["ISSTLVOUBILLGROUP"] == null ? false : Convert.ToBoolean(reader["ISSTLVOUBILLGROUP"]));//销项发票根据开票金额生成凭证
data.AR = (reader["AR"] == null ? "" : Convert.ToString(reader["AR"]));//应收账款
data.ARFC = (reader["ARFC"] == null ? "" : Convert.ToString(reader["ARFC"]));//应收账款外币
data.AP = (reader["AP"] == null ? "" : Convert.ToString(reader["AP"]));//应付账款

@ -1951,6 +1951,11 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeDAL
headData.NOTIFYPARTY = DelEndSpace(headData.NOTIFYPARTY);
headData.VESSEL = FullWidthToHalfWidth(ToDBC(DelEndSpace(headData.VESSEL)));
headData.VOYNO = FullWidthToHalfWidth(ToDBC(DelEndSpace(headData.VOYNO)));
headData.PORTLOAD = FullWidthToHalfWidth(ToDBC(DelEndSpace(headData.PORTLOAD)));
headData.PLACERECEIPT = FullWidthToHalfWidth(ToDBC(DelEndSpace(headData.PLACERECEIPT)));
headData.PORTDISCHARGE = FullWidthToHalfWidth(ToDBC(DelEndSpace(headData.PORTDISCHARGE)));
headData.DESTINATION = FullWidthToHalfWidth(ToDBC(DelEndSpace(headData.DESTINATION)));
headData.PLACEDELIVERY = FullWidthToHalfWidth(ToDBC(DelEndSpace(headData.PLACEDELIVERY)));
//headData.MSHIPPER = ToDBC(headData.MSHIPPER);
//headData.MSHIPPER = DelEndSpace(headData.MSHIPPER);
//headData.MCONSIGNEE = ToDBC(headData.MCONSIGNEE);

@ -4274,7 +4274,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO) + "'");
if (bill.BLFRT.IndexOf("PREPAID") >= 0)
r.WriteLine("CPI+4++P'");
@ -5051,7 +5051,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt",bill.CONTRACTNO) + "'");
icount = icount + 2;
@ -6700,7 +6700,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO) + "'");
icount++;
@ -9640,7 +9640,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
//客户参考号
r.WriteLine("RFF+CR:'");
//合同号
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO) + "'");
icount = icount + 4;
#endregion
@ -13227,7 +13227,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
else
r.WriteLine("RFF+BM:" + OpBill.MBLNO + "'");
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO )+ "'");
icount = icount + 2;
@ -16122,7 +16122,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO) + "'");
icount++;
@ -18044,7 +18044,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("RFF+BM:" + OpBill.MBLNO + "'");
icount++;
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO) + "'");
icount++;
#endregion
@ -25388,8 +25388,8 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
//if (bill.VOYNO == null || bill.VOYNO == "")
//{ error = error + "<br />提单号:" + bill.MBLNO + "航次不能为空"; }
if (bill.VESSELID == null || bill.VESSELID == "")
{ error = error + "<br />提单号:" + bill.MBLNO + "船舶呼号不能为空"; }
//if (bill.VESSELID == null || bill.VESSELID == "")
//{ error = error + "<br />提单号:" + bill.MBLNO + "船舶呼号不能为空"; }
if (bill.DESCRIPTION == null || bill.DESCRIPTION == "")
@ -25644,7 +25644,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
tempstr = "12";//1 //RECORD-ID//M//9(2)//1 //2 //12
if (filetype == "E")
{
tempstr += GetSpaceStr(bill.MBLNO, 20);//2 //webCSM Booking Reference//M//X(20)//3 //22 //webCSM System Job Reference如果需要填写原field 3的custom ref//bill.ORDERNO
tempstr += GetSpaceStr(bill.ORDERNO, 20);//2 //webCSM Booking Reference//M//X(20)//3 //22 //webCSM System Job Reference如果需要填写原field 3的custom ref//bill.ORDERNO
}
else
{
@ -25695,7 +25695,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
}
else
{
tempstr += GetSpaceStr(bill.MBLNO, 20);//16 //Original_reference//C//X(20)//98 //117 //webCSM Alternate Booking Reference, only if alt booking ref is used
tempstr += GetSpaceStr(bill.ORDERNO, 20);//16 //Original_reference//C//X(20)//98 //117 //webCSM Alternate Booking Reference, only if alt booking ref is used
}
tempstr += GetSpaceStr("", 20);//17 //Bkg Pty Reference//O//X(20)//118 //137 //webCSM Bkg Party Reference
tempstr += "F";//18 //Booking_Party_indicator//M//X(1)//138 //138 //D-Deciding Pty, N-Notify Pty, C-Consignee, S-Shipper, F-Forwarder
@ -35391,7 +35391,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
if (!string.IsNullOrEmpty(bill.CONTRACTNO))
{
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO )+ "'");
icount = icount + 1;
}
@ -36382,7 +36382,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
if (!string.IsNullOrEmpty(bill.CONTRACTNO))
{
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO) + "'");
icount = icount + 1;
}
@ -41487,7 +41487,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO) + "'");
if (bill.BLFRT.IndexOf("PREPAID") >= 0)
r.WriteLine("CPI+4++P'");
@ -42250,7 +42250,7 @@ namespace DSWeb.MvcShipping.DAL.MsOpSeaeEdiPortDAL
r.WriteLine("RFF+CT:" + bill.CONTRACTNO + "'");
r.WriteLine("RFF+CT:" + formatEdiStr("txt", bill.CONTRACTNO) + "'");
icount = icount + 2;

@ -1114,7 +1114,7 @@ namespace DSWeb.MvcShipping.DAL.MsSeaeOrderDAL
if (billnoset.BILLTYPE != "")
headData.CUSTNO = MsSysBillNoSetDAL.GetBillNo(billnoset, headData.ETD.ToString().Trim(), headData.ACCDATE.ToString().Trim(), "", headData.OP);
T_ALL_DA T_ALL_DA = new T_ALL_DA();
if (!string.IsNullOrEmpty(headData.SALECORPID))
if (!string.IsNullOrEmpty(OrderData.SALECORPID))
{
headData.SALECORPID = OrderData.SALECORPID;
}

@ -437,7 +437,16 @@ namespace DSWeb.MvcShipping.Models.MsCwDesignGl
get { return _ISINVAMOUNTASSUM; }
set { _ISINVAMOUNTASSUM = value; }
}
private bool _ISSTLVOUBILLGROUP = false;
/// <summary>
/// JI结算凭证按结算单分组排序
/// </summary>
[ModelDB]
public bool ISSTLVOUBILLGROUP
{
get { return _ISSTLVOUBILLGROUP; }
set { _ISSTLVOUBILLGROUP = value; }
}
private bool _ISADVANCE = false;
/// <summary>
@ -1152,6 +1161,8 @@ namespace DSWeb.MvcShipping.Models.MsCwDesignGl
set { _INVMBSPENDINGEXPLAN = value; }
}
#endregion
public MsCwDesignGl()

@ -619,6 +619,7 @@ namespace DSWeb.MvcShipping.Models.MsCwVouitemsGl
}
public string TMPBILLNO { get; set; }
public string TMPGID { get; set; }
#endregion

@ -753,6 +753,16 @@ Ext.extend(Shipping.MsCwDesignGlIndex, Ext.Panel, {
inputValue: "true", //选中的值
uncheckedValue: "false", //未选中的值
checked: true //绘制时的选中状态
}, {
//fieldLabel: "",
xtype: "checkbox", //checkbox控件
id: "ISSTLVOUBILLGROUP",
name: "ISSTLVOUBILLGROUP",
boxLabel: "结算凭证按照结算单号排序",
width: 210,
inputValue: "true", //选中的值
uncheckedValue: "false", //未选中的值
checked: true //绘制时的选中状态
}]
}, { xtype: 'hiddenfield', height: 10}]//end items(fieldset 1)
});

@ -89,6 +89,7 @@
{ name: 'ISSTLEXCHANGERATEISVAR', type: 'bool' }, //是否在结算自动生成凭证时自动弹出结算凭证
{ name: 'ISSTLDRCRISGROUP', type: 'bool' }, //结算凭证应收应付账款合并
{ name: 'ISINVAMOUNTASSUM', type: 'bool' }, //销项发票根据开票金额生成凭证
{ name: 'ISSTLVOUBILLGROUP', type: 'bool' }, //结算凭证按照结算单号分组排序
{name: 'STARTGID', type: 'string' }, //总账已启用已登录账套GID
{name: 'PiaoHao', type: 'string'},

@ -260,7 +260,18 @@ Ext.extend(Shipping.MsCwVouchersGlSettlementIndex, Ext.Panel, {
}
}
}
}, this.comboxSubComp, this.comboxSALECORP] //所属公司需求编号SR2017062800002
}, this.comboxSubComp, this.comboxSALECORP,{
fieldLabel: '结算金额',
name: 'StlAmount',
enableKeyEvents: true,
listeners: {
specialkey: function (field, e) {
if (e.getKey() == e.ENTER) {
_this.onRefreshClick();
}
}
}
}] //所属公司需求编号SR2017062800002
}, {
xtype: 'container',
layout: 'hbox',
@ -302,7 +313,7 @@ Ext.extend(Shipping.MsCwVouchersGlSettlementIndex, Ext.Panel, {
}
}
}
}, this.comboxISADVANCEDPAY, this.comboxISINVOICE, this.comboxBANK]//, { xtype: 'hiddenfield', flex: 1}
}, this.comboxISADVANCEDPAY, this.comboxISINVOICE, this.comboxBANK, { xtype: 'hiddenfield', flex: 1 }]
}]//end items(fieldset 1)
}]//end root items
});
@ -966,8 +977,9 @@ Ext.extend(Shipping.MsCwVouchersGlSettlementIndex, Ext.Panel, {
var ACCOUNT = form.findField('ACCOUNT').getValue();
sql = sql + getAndConSql(sql, ACCOUNT, " (ACCOUNTRMB='" + ACCOUNT + "' OR ACCOUNTUSD='" + ACCOUNT+"') ");
var StlAmount = form.findField('StlAmount').getValue();
sql = sql + getAndConSql(sql, StlAmount, " (AMOUNTRMB=" + StlAmount + " OR AMOUNTUSD=" + StlAmount + ") ");
return sql;
},

@ -67,7 +67,7 @@ namespace DSWeb.Areas.OA.Controllers
// GET/Import/XXH/GetDataList
public ContentResult GetDataList(int start, int limit, string sort, string condition)
{
var dataList = BaoxiaoDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), sort);
var dataList = BaoxiaoDAL.GetDataList(condition,Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]), sort);
var list = dataList.Skip(start).Take(limit);
@ -76,7 +76,7 @@ namespace DSWeb.Areas.OA.Controllers
}
public ContentResult GetDataListStr(string condition)
{
var dataListStr = BaoxiaoDAL.GetDataListStr(condition, Convert.ToString(Session["USERID"]));
var dataListStr = BaoxiaoDAL.GetDataListStr(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
var json = JsonConvert.Serialize(new { Success = true, Message = "查询成功", data = dataListStr });
return new ContentResult() { Content = json };
@ -97,7 +97,7 @@ namespace DSWeb.Areas.OA.Controllers
if (handle == "edit")
{
var list = BaoxiaoDAL.GetDataList(condition, Convert.ToString(Session["USERID"]));
var list = BaoxiaoDAL.GetDataList(condition, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
if (list.Count > 0)
head = list[0];
}
@ -253,7 +253,7 @@ namespace DSWeb.Areas.OA.Controllers
{
Success = result.Success,
Message = result.Message,
Data = BaoxiaoDAL.GetData("BX.BXGID='" + head.BXGID + "'", Convert.ToString(Session["USERID"]))
Data = BaoxiaoDAL.GetData("BX.BXGID='" + head.BXGID + "'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]))
};
//20151116 取消对中物储的挂帐逻辑
@ -330,7 +330,7 @@ namespace DSWeb.Areas.OA.Controllers
{
Success = result.Success,
Message = result.Message,
Data = BaoxiaoDAL.GetData("BX.BXGID='" + head.BXGID + "'", Convert.ToString(Session["USERID"]))
Data = BaoxiaoDAL.GetData("BX.BXGID='" + head.BXGID + "'", Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]))
};
//20151116 取消对中物储的挂帐逻辑

@ -68,7 +68,7 @@ namespace DSWeb.Areas.OA.Controllers
if (handle == "edit")
{
var list = BaoxiaoDAL.GetDataList(condition);
var list = BaoxiaoDAL.GetDataList(condition, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]));
if (list.Count > 0)
head = list[0];
}

@ -51,7 +51,7 @@ namespace DSWeb.Areas.OA.Controllers
// GET/Import/XXH/GetDataList
public ContentResult GetDataList(int start, int limit, string sort, string condition)
{
var dataList = BaoxiaoDAL.GetDataList(condition,sort);
var dataList = BaoxiaoDAL.GetDataList(condition, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), sort);
var list = dataList.Skip(start).Take(limit);
@ -66,7 +66,7 @@ namespace DSWeb.Areas.OA.Controllers
if (handle == "edit")
{
var list = BaoxiaoDAL.GetDataList(condition);
var list = BaoxiaoDAL.GetDataList(condition, Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]));
if (list.Count > 0)
head = list[0];
}
@ -218,7 +218,7 @@ namespace DSWeb.Areas.OA.Controllers
{
Success = result.Success,
Message = result.Message,
Data = BaoxiaoDAL.GetData("BX.BXGID='" + head.BXGID + "'")
Data = BaoxiaoDAL.GetData("BX.BXGID='" + head.BXGID + "'", Convert.ToString(Session["COMPANYID"]), Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]))
};
//20151116 取消对中物储的挂帐逻辑

@ -24,9 +24,24 @@ namespace DSWeb.Areas.OA.DAL.Baoxiao2
{
#region 报销单列表
//报销单列表
static public List<Baoxiao2mb> GetDataList(string strCondition, string USERID, string sort = null)
static public List<Baoxiao2mb> GetDataList(string strCondition, string userid, string username, string corpid, string sort = null)
{
string strCwSTARTGID = BasicDataRefDAL.GetCwSTARTGID(USERID);
var rangstr = GetListRangDAStr("BXLIST", userid, username, corpid);
if (!string.IsNullOrEmpty(rangstr))
{
if (!string.IsNullOrEmpty(strCondition))
{
strCondition = strCondition + " and " + rangstr;
}
else
{
strCondition = rangstr;
}
}
string strCwSTARTGID = BasicDataRefDAL.GetCwSTARTGID(userid);
var strSql = new StringBuilder();
strSql.Append(" select BXGID,bx.BSNO,COMPANY,DEPTNAME,CREATEUSER,BXNO,BX.JKTYPE,BX.JKREASON,BX.JJNO,BX.JJDATE ");
strSql.Append(" ,dbo.trimdate(CREATEDATE) CREATEDATE ");
@ -64,9 +79,23 @@ namespace DSWeb.Areas.OA.DAL.Baoxiao2
return SetData(strSql);
}
static public string GetDataListStr(string strCondition, string USERID, string sort = null)
static public string GetDataListStr(string strCondition, string userid, string username, string corpid, string sort = null)
{
string strCwSTARTGID = BasicDataRefDAL.GetCwSTARTGID(USERID);
var rangstr = GetListRangDAStr("BXLIST", userid, username, corpid);
if (!string.IsNullOrEmpty(rangstr))
{
if (!string.IsNullOrEmpty(strCondition))
{
strCondition = strCondition + " and " + rangstr;
}
else
{
strCondition = rangstr;
}
}
string strCwSTARTGID = BasicDataRefDAL.GetCwSTARTGID(userid);
var strSql = new StringBuilder();
strSql.Append(" select BXGID,bx.BSNO,COMPANY,DEPTNAME,CREATEUSER,BXNO,BX.JKTYPE,BX.JKREASON,BX.JJNO,BX.JJDATE ");
strSql.Append(" ,dbo.trimdate(CREATEDATE) CREATEDATE ");
@ -145,9 +174,9 @@ namespace DSWeb.Areas.OA.DAL.Baoxiao2
}
static public Baoxiao2mb GetData (string condition, string USERID)
static public Baoxiao2mb GetData (string condition, string userid, string username, string corpid)
{
var list = GetDataList(condition, USERID);
var list = GetDataList(condition, userid, username, corpid);
if (list.Count > 0)
return list[0];
@ -210,7 +239,112 @@ namespace DSWeb.Areas.OA.DAL.Baoxiao2
}
return headList;
}
public static string GetListRangDAStr(string modustr, string userid, string username, string companyid)
{
string str = "";
//string modustr = "";
var strSql = new StringBuilder();
strSql.Append(" SELECT ");
strSql.Append(" VISIBLERANGE,OPERATERANGE,AUTHORITYID,VSSQL ");
strSql.Append(" from VW_User_Authority ");
strSql.Append(" where [NAME]='" + modustr + "' and USERID='" + userid + "' and ISDELETE=0");
string visiblerange = "4";
string operaterange = "4";
string AUTHORITYID = "";
string VSSQL = "";
Database db = DatabaseFactory.CreateDatabase();
using (IDataReader reader = db.ExecuteReader(CommandType.Text, strSql.ToString()))
{
while (reader.Read())
{
visiblerange = Convert.ToString(reader["VISIBLERANGE"]);
operaterange = Convert.ToString(reader["OPERATERANGE"]);
AUTHORITYID = Convert.ToString(reader["AUTHORITYID"]);
VSSQL = Convert.ToString(reader["VSSQL"]);
break;
}
reader.Close();
}
if (visiblerange == "4")
{
str = " BX.CREATEUSER='" + username + "'";
}
else if (visiblerange == "3")
{
str = " BX.CREATEUSER='" + username + "'";
}
else if (visiblerange == "2")
{
var rangeDa = new RangeDA();
var deptname = rangeDa.GetDEPTNAME(userid);
str = " BX.CREATEUSER in (select showname from vw_user where COMPANYID='" + companyid + "') ";
}
else if (visiblerange == "1")
{
str = " BX.CREATEUSER in (select showname from vw_user where COMPANYID='" + companyid + "') ";
}
else if (visiblerange == "5")
{
str = " BX.CREATEUSER in (select showname from vw_user where COMPANYID in (select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1)) ";
//var userstr = new StringBuilder();
//userstr.Append(" select COMPANYID from user_authority_range_company where userid='" + userid + "' and AUTHORITYID='" + AUTHORITYID + "' and VISIBLERANGE=1");
//Database userdb = DatabaseFactory.CreateDatabase();
//using (IDataReader reader = userdb.ExecuteReader(CommandType.Text, userstr.ToString()))
//{
// str = "";
// while (reader.Read())
// {
// if (str == "")
// {
// str = " COMPANYID='" + companyid + "' ";
// }
// else
// {
// str = str + " or COMPANYID='" + companyid + "' ";
// };
// }
// str = str + ")";
// reader.Close();
//}
}
else if (visiblerange == "6")
{
str = " EXISTS (select 1 from user_authority_range_op P left join [user] u on (u.GID=P.OPID) where (BX.CREATEUSER=U.SHOWNAME ) AND P.userid='" + userid + "' and P.AUTHORITYID='" + AUTHORITYID + "' and P.VISIBLERANGE=1) ";
}
else if (visiblerange == "0")
{
str = " 1=1 ";
}
VSSQL = VSSQL.Trim();
if (!string.IsNullOrEmpty(VSSQL))
{
if (!string.IsNullOrEmpty(str))
{
str = str + " and (" + VSSQL + ") ";
}
else
{
str = " (" + VSSQL + ") ";
}
}
return str;
}
#endregion
@ -338,14 +472,14 @@ namespace DSWeb.Areas.OA.DAL.Baoxiao2
}
static public Baoxiaomb GetAuditData(string condition, string USERID)
{
var list = GetDataList(condition, USERID);
if (list.Count > 0)
return list[0];
//static public Baoxiaomb GetAuditData(string condition, string USERID)
//{
// var list = GetDataList(condition, USERID);
// if (list.Count > 0)
// return list[0];
return new Baoxiaomb();
}
// return new Baoxiaomb();
//}
private static List<BaoxiaoAuditmb> SetAuditData(StringBuilder strSql)
{

@ -18,8 +18,22 @@ namespace DSWeb.Areas.OA.DAL.Baoxiao
{
#region 报销单列表
//报销单列表
static public List<Baoxiaomb> GetDataList(string strCondition, string sort = null)
{
static public List<Baoxiaomb> GetDataList(string strCondition, string corpid, string userid, string username, string sort = null)
{
var rangstr = GetListRangDAStr("BXLIST", userid, username, corpid);
if (!string.IsNullOrEmpty(rangstr))
{
if (!string.IsNullOrEmpty(strCondition))
{
strCondition = strCondition + " and " + rangstr;
}
else
{
strCondition = rangstr;
}
}
var strSql = new StringBuilder();
strSql.Append(" select BXGID,bx.BSNO,COMPANY,DEPTNAME,CREATEUSER,BXNO,");
strSql.Append(" case CREATEDATE when '1900-1-1' then '' else CONVERT(varchar, CREATEDATE, 23 ) end CREATEDATE ");
@ -50,9 +64,9 @@ namespace DSWeb.Areas.OA.DAL.Baoxiao
return SetData(strSql);
}
static public Baoxiaomb GetData(string condition)
static public Baoxiaomb GetData(string condition,string companyid,string userid,string username)
{
var list = GetDataList(condition);
var list = GetDataList(condition, companyid,userid,username);
if (list.Count > 0)
return list[0];
@ -146,9 +160,9 @@ namespace DSWeb.Areas.OA.DAL.Baoxiao
}
static public Baoxiaomb GetAuditData(string condition)
static public Baoxiaomb GetAuditData(string condition, string corpid, string userid, string username)
{
var list = GetDataList(condition);
var list = GetDataList(condition, userid, username, corpid);
if (list.Count > 0)
return list[0];

Loading…
Cancel
Save