@ -3034,14 +3034,10 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
strSql . Append ( " select vb.CUSTOMERNAME,(select ISSP from info_client where shortname=vb.CUSTOMERNAME) ISSP " ) ;
strSql . Append ( " select vb.CUSTOMERNAME,(select ISSP from info_client where shortname=vb.CUSTOMERNAME) ISSP " ) ;
strSql . Append ( " ,C.ACCTYPE ,(g.RMBDR-g.STLRMBDR) RMBNODR,(g.USDDR-g.STLUSDDR) USDNODR,(g.TTLDR-g.STLTTLDR)TTLNODR , " ) ;
strSql . Append ( " ,C.ACCTYPE ,(g.RMBDR-g.STLRMBDR) RMBNODR,(g.USDDR-g.STLUSDDR) USDNODR,(g.TTLDR-g.STLTTLDR)TTLNODR , " ) ;
strSql . Append ( " isnull(dbo.trimdate(vb.stldate),'') stldate " ) ;
strSql . Append ( " isnull(dbo.trimdate(vb.stldate),'') stldate " ) ;
strSql . Append ( " ,ISNULL(C.ALLOWAMOUNT,0) ALLOWAMOUNT,'' WFDHT,vb.SALE,vb.OPLBNAME,vb.ETD ") ;
strSql . Append ( " ,ISNULL(C.ALLOWAMOUNT,0) ALLOWAMOUNT,'' WFDHT,vb.SALE,vb.OPLBNAME,vb.ETD ,g.CUSTOMERNAME CUSTNAME ") ;
strSql . Append ( " from v_OP_bs VB " ) ;
strSql . Append ( " from v_OP_bs VB " ) ;
if ( BLISSUENOSHEN . PARAMVALUE = = "1" )
strSql . Append ( " left join v_op_gain_cust_sum_shen g on g.BSNO=vb.bsno left join V_Client_ACCDATE C ON (C.SHORTNAME=VB.CUSTOMERNAME and vb.ETD between c.BGNDATE and c.ENDDATE) " ) ;
{
strSql . Append ( " left join v_op_gain_sum_shen g on g.BSNO=vb.bsno left join V_Client_ACCDATE C ON (C.SHORTNAME=VB.CUSTOMERNAME and vb.ETD between c.BGNDATE and c.ENDDATE) " ) ;
}
else strSql . Append ( " left join v_op_gain_sum_ttl g on g.BSNO=vb.bsno left join V_Client_ACCDATE C ON (C.SHORTNAME=VB.CUSTOMERNAME and vb.ETD between c.BGNDATE and c.ENDDATE) " ) ;
// strSql.Append(" left join V_CUSTOMER_NODR CN ON (CN.CUSTOMERNAME=VB.CUSTOMERNAME)");
// strSql.Append(" left join V_CUSTOMER_NODR CN ON (CN.CUSTOMERNAME=VB.CUSTOMERNAME)");
if ( ! string . IsNullOrEmpty ( BSNO ) )
if ( ! string . IsNullOrEmpty ( BSNO ) )
{
{
@ -3054,45 +3050,50 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
var headList = new List < BLINFOmb > ( ) ;
var headList = new List < BLINFOmb > ( ) ;
//var _nomsg = "";
//var _nomsg = "";
bool isfirst = true ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
using ( IDataReader reader = db . ExecuteReader ( CommandType . Text , strSql . ToString ( ) ) )
using ( IDataReader reader = db . ExecuteReader ( CommandType . Text , strSql . ToString ( ) ) )
{
{
BLINFOmb data = new BLINFOmb ( ) ;
BLINFOmb data = new BLINFOmb ( ) ;
while ( reader . Read ( ) )
while ( reader . Read ( ) )
{
{
#region Set DB data to Object
#region Set DB data to Object
if ( isfirst )
#region 结费类型
data . 结 费 类 型 = "" ;
if ( reader [ "ISSP" ] ! = DBNull . Value )
{
{
if ( Convert . ToBoolean ( reader [ "ISSP" ] ) )
#region 结费类型
data . 结 费 类 型 = "" ;
if ( reader [ "ISSP" ] ! = DBNull . Value )
{
{
data . 结 费 类 型 = "注意:该客户是特批放单客户!" + "\n" ;
if ( Convert . ToBoolean ( reader [ "ISSP" ] ) )
{
data . 结 费 类 型 = "注意:该客户是特批放单客户!" + "\n" ;
}
}
}
if ( Convert . ToString ( reader [ "ACCTYPE" ] ) . Trim ( ) = = "" )
{
data . 结 费 类 型 = data . 结 费 类 型 + "客户结费类型为:现结买单" ;
}
else
{
data . 结 费 类 型 = data . 结 费 类 型 + "客户结费类型为:" + Convert . ToString ( reader [ "ACCTYPE" ] ) ;
}
if ( Convert . ToString ( reader [ "ACCTYPE" ] ) = = "约定天数" )
{
//data.结费类型 = data.结费类型 + Convert.ToString(reader["stldays"]) + "天 ";
//string CUSTOMERNAME, string OPLBNAME, string BUSDATE, string SALE
var CUSTOMERNAME = Convert . ToString ( reader [ "CUSTOMERNAME" ] ) ;
var OPLBNAME = Convert . ToString ( reader [ "OPLBNAME" ] ) ;
var BUSDATE = Convert . ToString ( reader [ "ETD" ] ) ;
var SALE = Convert . ToString ( reader [ "SALE" ] ) ;
data . 结 费 类 型 = data . 结 费 类 型 + MsInfoClientDAL . GetSTLDAYS ( CUSTOMERNAME , OPLBNAME , BUSDATE , SALE ) . STLDAYS + "天 " ;
}
data . 结 费 类 型 = data . 结 费 类 型 + ",应结日期为 " + Convert . ToString ( reader [ "stldate" ] ) + "" ;
data . STLDATE = Convert . ToString ( reader [ "stldate" ] ) ;
# endregion
isfirst = false ;
}
}
if ( Convert . ToString ( reader [ "ACCTYPE" ] ) . Trim ( ) = = "" )
{
data . 结 费 类 型 = data . 结 费 类 型 + "客户结费类型为:现结买单" ;
}
else
{
data . 结 费 类 型 = data . 结 费 类 型 + "客户结费类型为:" + Convert . ToString ( reader [ "ACCTYPE" ] ) ;
}
if ( Convert . ToString ( reader [ "ACCTYPE" ] ) = = "约定天数" ) {
//data.结费类型 = data.结费类型 + Convert.ToString(reader["stldays"]) + "天 ";
//string CUSTOMERNAME, string OPLBNAME, string BUSDATE, string SALE
var CUSTOMERNAME = Convert . ToString ( reader [ "CUSTOMERNAME" ] ) ;
var OPLBNAME = Convert . ToString ( reader [ "OPLBNAME" ] ) ;
var BUSDATE = Convert . ToString ( reader [ "ETD" ] ) ;
var SALE = Convert . ToString ( reader [ "SALE" ] ) ;
data . 结 费 类 型 = data . 结 费 类 型 + MsInfoClientDAL . GetSTLDAYS ( CUSTOMERNAME , OPLBNAME , BUSDATE , SALE ) . STLDAYS + "天 " ;
}
data . 结 费 类 型 = data . 结 费 类 型 + ",应结日期为 " + Convert . ToString ( reader [ "stldate" ] ) + "" ;
data . STLDATE = Convert . ToString ( reader [ "stldate" ] ) ;
# endregion
#region 该业务是否 欠费超期
#region 该业务是否 欠费超期
//var TTLNODR=0M;
//var TTLNODR=0M;
if ( reader [ "TTLNODR" ] ! = DBNull . Value )
if ( reader [ "TTLNODR" ] ! = DBNull . Value )
@ -3165,6 +3166,30 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
# endregion
# endregion
# endregion
# endregion
var Rate = 0 M ;
if ( data . TTLNODR > 0 & & data . USDNODR > 0 )
{
Rate = ( data . TTLNODR - data . RMBNODR ) / data . USDNODR ;
}
var _Rate = Rate . ToString ( "#0.0000" ) ;
data . 欠 费 超 期 = data . 欠 费 超 期 + Environment . NewLine + Convert . ToString ( reader [ "CUSTNAME" ] ) + " 未结算费用:"
+ "USD" + Convert . ToString ( data . USDNODR )
+ " RMB" + Convert . ToString ( data . RMBNODR )
+ ",合计" + Convert . ToString ( data . TTLNODR ) ;
if ( Rate ! = 0 M )
{
data . 欠 费 超 期 = data . 欠 费 超 期 + "(" + _Rate + ")" ;
}
data . 超 期 欠 费 = "" ;
if ( data . ZLTTLNODR_All ! = 0 )
{
data . 超 期 欠 费 = Convert . ToString ( reader [ "CUSTNAME" ] ) + " 超期欠费:"
+ "USD" + Convert . ToString ( data . ZLUSDNODR_All )
+ " RMB" + Convert . ToString ( data . ZLRMBNODR_All )
+ ",合计" + Convert . ToString ( data . ZLTTLNODR_All ) ;
}
//headList.Add(data);
//headList.Add(data);
}
}
reader . Close ( ) ;
reader . Close ( ) ;
@ -3173,28 +3198,7 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
#region Set DB data to Object
#region Set DB data to Object
#region 该业务欠费是否超期
#region 该业务欠费是否超期
var Rate = 0 M ;
if ( data . TTLNODR > 0 & & data . USDNODR > 0 )
{
Rate = ( data . TTLNODR - data . RMBNODR ) / data . USDNODR ;
}
var _Rate = Rate . ToString ( "#0.0000" ) ;
data . 欠 费 超 期 = "未结算费用:"
+ "USD" + Convert . ToString ( data . USDNODR )
+ " RMB" + Convert . ToString ( data . RMBNODR )
+ ",合计" + Convert . ToString ( data . TTLNODR ) ;
if ( Rate ! = 0 M )
{
data . 欠 费 超 期 = data . 欠 费 超 期 + "(" + _Rate + ")" ;
}
data . 超 期 欠 费 = "" ;
if ( data . ZLTTLNODR_All ! = 0 ) {
data . 超 期 欠 费 = "超期欠费:"
+ "USD" + Convert . ToString ( data . ZLUSDNODR_All )
+ " RMB" + Convert . ToString ( data . ZLRMBNODR_All )
+ ",合计" + Convert . ToString ( data . ZLTTLNODR_All ) ;
}
//data.欠费超期 = data.欠费超期 + "\n";
//data.欠费超期 = data.欠费超期 + "\n";