@ -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 ( " ,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(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 " ) ;
if ( BLISSUENOSHEN . PARAMVALUE = = "1" )
{
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_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_CUSTOMER_NODR CN ON (CN.CUSTOMERNAME=VB.CUSTOMERNAME)");
if ( ! string . IsNullOrEmpty ( BSNO ) )
{
@ -3054,6 +3050,8 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
var headList = new List < BLINFOmb > ( ) ;
//var _nomsg = "";
bool isfirst = true ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
using ( IDataReader reader = db . ExecuteReader ( CommandType . Text , strSql . ToString ( ) ) )
{
@ -3061,7 +3059,8 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
while ( reader . Read ( ) )
{
#region Set DB data to Object
if ( isfirst )
{
#region 结费类型
data . 结 费 类 型 = "" ;
if ( reader [ "ISSP" ] ! = DBNull . Value )
@ -3079,7 +3078,8 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
{
data . 结 费 类 型 = data . 结 费 类 型 + "客户结费类型为:" + Convert . ToString ( reader [ "ACCTYPE" ] ) ;
}
if ( 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" ] ) ;
@ -3092,7 +3092,8 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
data . 结 费 类 型 = data . 结 费 类 型 + ",应结日期为 " + Convert . ToString ( reader [ "stldate" ] ) + "" ;
data . STLDATE = Convert . ToString ( reader [ "stldate" ] ) ;
# endregion
isfirst = false ;
}
#region 该业务是否 欠费超期
//var TTLNODR=0M;
if ( reader [ "TTLNODR" ] ! = DBNull . Value )
@ -3165,13 +3166,6 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
# endregion
# endregion
//headList.Add(data);
}
reader . Close ( ) ;
#region Set DB data to Object
#region 该业务欠费是否超期
var Rate = 0 M ;
if ( data . TTLNODR > 0 & & data . USDNODR > 0 )
@ -3179,7 +3173,7 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
Rate = ( data . TTLNODR - data . RMBNODR ) / data . USDNODR ;
}
var _Rate = Rate . ToString ( "#0.0000" ) ;
data . 欠 费 超 期 = " 未结算费用:"
data . 欠 费 超 期 = data . 欠 费 超 期 + Environment . NewLine + Convert . ToString ( reader [ " CUSTNAME"] ) + " 未结算费用:"
+ "USD" + Convert . ToString ( data . USDNODR )
+ " RMB" + Convert . ToString ( data . RMBNODR )
+ ",合计" + Convert . ToString ( data . TTLNODR ) ;
@ -3188,13 +3182,23 @@ namespace DSWeb.Areas.MvcShipping.DAL.MsOp_BLISSUE
data . 欠 费 超 期 = data . 欠 费 超 期 + "(" + _Rate + ")" ;
}
data . 超 期 欠 费 = "" ;
if ( data . ZLTTLNODR_All ! = 0 ) {
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);
}
reader . Close ( ) ;
#region Set DB data to Object
#region 该业务欠费是否超期
//data.欠费超期 = data.欠费超期 + "\n";