@ -1370,7 +1370,8 @@ namespace DSWeb.MvcShipping.DAL.MsRptSaleBalProfitShareDAL
if ( i . PROFITUP > BaseComp )
if ( i . PROFITUP > BaseComp )
BaseComp = i . PROFITUP ;
BaseComp = i . PROFITUP ;
sale = data . SALE ;
sale = data . SALE ;
if ( data . COMPR > i . PROFITDOWN & & data . COMPR < = i . PROFITUP ) {
if ( data . COMPR > i . PROFITDOWN & & data . COMPR < = i . PROFITUP )
{
isnottc = true ;
isnottc = true ;
}
}
}
}
@ -1382,16 +1383,14 @@ namespace DSWeb.MvcShipping.DAL.MsRptSaleBalProfitShareDAL
TTLCOMPR = data . THTTLPROFIT ;
TTLCOMPR = data . THTTLPROFIT ;
}
}
else {
else
if ( data . THTTLPROFIT < BaseComp ) {
{
if ( data . THTTLPROFIT < BaseComp )
{
TTLCOMPR = TTLCOMPR - BaseComp + data . THTTLPROFIT ;
TTLCOMPR = TTLCOMPR - BaseComp + data . THTTLPROFIT ;
}
}
}
}
var mblno = data . MBLNO ;
if ( mblno = = "QDSR061873" ) {
mblno = "111" ;
}
if ( ! isnottc & & data . COMPR > BaseComp )
if ( ! isnottc & & data . COMPR > BaseComp )
{
{
@ -1429,11 +1428,8 @@ namespace DSWeb.MvcShipping.DAL.MsRptSaleBalProfitShareDAL
if ( TTLCOMPR < = i . PROFITUP )
if ( TTLCOMPR < = i . PROFITUP )
{
{
var TMPTTLPROFIT = data . TTLPROFIT ;
var TMPTTLPROFIT = data . TTLPROFIT ;
if ( ( TTLCOMPR - data . TTLPROFIT ) < = i . PROFITDOWN ) TMPTTLPROFIT = ( TTLCOMPR - i . PROFITDOWN ) ;
decimal basecompr = TTLCOMPR ;
if ( ( data . COMPR - data . TTLPROFIT ) < BaseComp ) TMPTTLPROFIT = data . COMPR - BaseComp ;
if ( ( data . COMPR - data . TTLPROFIT ) < BaseComp ) basecompr = data . COMPR - BaseComp ;
if ( ( TTLCOMPR - data . TTLPROFIT ) < = i . PROFITDOWN ) TMPTTLPROFIT = ( data . COMPR - i . PROFITDOWN ) ;
data . TiCheng = data . TiCheng + TMPTTLPROFIT * data . TiChengBiLi / 100 ;
data . TiCheng = data . TiCheng + TMPTTLPROFIT * data . TiChengBiLi / 100 ;
data . KouXi = data . KouXi + ( TMPTTLPROFIT * i . SHAREPR / 100 - TMPTTLPROFIT * data . TiChengBiLi / 100 ) ;
data . KouXi = data . KouXi + ( TMPTTLPROFIT * i . SHAREPR / 100 - TMPTTLPROFIT * data . TiChengBiLi / 100 ) ;
@ -1442,13 +1438,10 @@ namespace DSWeb.MvcShipping.DAL.MsRptSaleBalProfitShareDAL
else
else
data . TiChengBiLiStr = Convert . ToString ( data . TiChengQuJian / 100 ) + "*(" + TMPTTLPROFIT . ToString ( ) + "*" + Convert . ToString ( SHAREPR / 100 ) + ")" ;
data . TiChengBiLiStr = Convert . ToString ( data . TiChengQuJian / 100 ) + "*(" + TMPTTLPROFIT . ToString ( ) + "*" + Convert . ToString ( SHAREPR / 100 ) + ")" ;
}
}
else {
else
decimal basecompr = TTLCOMPR ;
{
if ( ( data . COMPR - data . TTLPROFIT ) < BaseComp ) basecompr = data . COMPR - BaseComp ;
var TMPTTLPROFIT = data . TTLPROFIT - ( TTLCOMPR - i . PROFITUP ) ;
var TMPTTLPROFIT = data . TTLPROFIT - ( basecompr - i . PROFITUP ) ;
if ( ( data . COMPR - data . TTLPROFIT ) < BaseComp ) TMPTTLPROFIT = data . COMPR - BaseComp ;
if ( ( TTLCOMPR - data . TTLPROFIT ) < i . PROFITDOWN & & ( TMPTTLPROFIT > ( i . PROFITUP - i . PROFITDOWN ) ) ) TMPTTLPROFIT = i . PROFITUP - i . PROFITDOWN ;
//if ((data.COMPR - data.TTLPROFIT) < BaseComp) TMPTTLPROFIT = data.COMPR - BaseComp;
data . TiCheng = data . TiCheng + TMPTTLPROFIT * data . TiChengBiLi / 100 ;
data . TiCheng = data . TiCheng + TMPTTLPROFIT * data . TiChengBiLi / 100 ;
data . KouXi = data . KouXi + ( TMPTTLPROFIT * i . SHAREPR / 100 - TMPTTLPROFIT * data . TiChengBiLi / 100 ) ;
data . KouXi = data . KouXi + ( TMPTTLPROFIT * i . SHAREPR / 100 - TMPTTLPROFIT * data . TiChengBiLi / 100 ) ;
if ( ! string . IsNullOrEmpty ( data . TiChengBiLiStr ) )
if ( ! string . IsNullOrEmpty ( data . TiChengBiLiStr ) )
@ -1462,56 +1455,139 @@ namespace DSWeb.MvcShipping.DAL.MsRptSaleBalProfitShareDAL
}
}
} ) ;
} ) ;
}
//decimal lasttc = 0;
//decimal lastpr = 0;
//decimal lasttcxs = 0;
//var TTLPROFIT = data.TTLPROFIT;
//if ((data.COMPR - TTLPROFIT) >= (data.MONTHTTLPR - data.MONTHTRAVEFEE) && data.COMPR > 0)
// TTLPROFIT = 0;
//else if ((data.COMPR) >= (data.MONTHTTLPR - data.MONTHTRAVEFEE) && (data.COMPR > 0))
// TTLPROFIT = (data.MONTHTTLPR - data.MONTHTRAVEFEE) - (data.COMPR - TTLPROFIT);
//data.TiChengBiLiStr = Convert.ToString(data.TiChengQuJian / 100) + "*(" + TTLPROFIT.ToString() + "*" + Convert.ToString(SHAREPR / 100) + ")";
//if (data.TiChengBiLi != 0)
// var salemonthprofit = new MsSaleMonthProfit();
// salemonthprofit.SALE = data.SALE;
// salemonthprofit.ETDMONTH = data.ETDMONTH;
// salemonthprofit.TTLPROFIT = data.TTLPROFIT;
// data.COMPR = data.TTLPROFIT;
// if (data.BSSOURCE == "直客")
// {
// {
// if (beginplan > (TTLCOMPR - TTLPROFIT))
// salemonthprofit.ZKTTLPROFIT = salemonthprofit.ZKTTLPROFIT + data.TTLPROFIT;
// data.ZKTTLPROFIT = salemonthprofit.ZKTTLPROFIT;
// }
// else
// {
// {
// var bpr = (TTLCOMPR - beginplan);
// salemonthprofit.THTTLPROFIT = salemonthprofit.THTTLPROFIT + data.TTLPROFIT;
// data.TiCheng = Math.Round(data.TiChengBiLi * bpr / 100, 2);
// data.THTTLPROFIT = salemonthprofit.THTTLPROFIT;
// data.TiChengBiLiStr = Convert.ToString(data.TiChengQuJian / 100) + "*(" + bpr.ToString() + "*" + Convert.ToString(SHAREPR / 100) + ")";
// }
// MsSaleMonthProfitList.Add(salemonthprofit);
//}
// lastpr = TTLCOMPR - TTLPROFIT;
//decimal beginplan = 0;
//decimal endplan = 0;
//decimal SHAREPR = 0;
//if (data.TTLPROFIT <= 0)
//{
// data.NODAY = 0;
//}
//data.TiChengQuJian = 100;
//var isnottc = false;
//if (BaseComp==0||sale!=data.SALE)
//saleprofitlist.ForEach(i =>
//saleprofitlist.ForEach(i =>
//{
//{
// if (i.SALE == data.SALE && i.BSSOURCE == data.BSSOURCE && lastpr > i.PROFITDOWN && lastpr <= i.PROFITUP)
// if (i.SALE == data.SALE && i.BSSOURCE =="" )
// {
// {
// lasttcxs = i.SHAREPR * data.TiChengQuJian / 100;
// data.TiChengBiLi =0;
// SHAREPR = i.SHAREPR;
// if (i.PROFITUP> BaseComp)
// beginplan = i.PROFITDOWN;
// BaseComp = i.PROFITUP;
// endplan = i.PROFITUP;
// sale = data.SALE;
// if (data.COMPR > i.PROFITDOWN && data.COMPR <= i.PROFITUP) {
// isnottc = true;
// }
// }
// }
//});
//});
// if (TTLPROFIT - bpr > 0)
//var TTLCOMPR = data.ZKTTLPROFIT;
//if (data.BSSOURCE != "直客")
//{
//{
// lasttc = Math.Round(lasttcxs * (TTLPROFIT - bpr) / 100, 2);
// TTLCOMPR = data.THTTLPROFIT;
// if (lasttc != 0)
// data.TiChengBiLiStr = data.TiChengBiLiStr + "+" + Convert.ToString(data.TiChengQuJian / 100) + "*(" + (TTLPROFIT - bpr).ToString() + "*" + Convert.ToString(SHAREPR / 100) + ")";
//}
//}
// if (lasttc != 0)
//else {
// if (data.THTTLPROFIT < BaseComp) {
// TTLCOMPR = TTLCOMPR - BaseComp +data.THTTLPROFIT;
// }
//}
//var mblno = data.MBLNO;
//if (mblno == "QDSR061873") {
// mblno = "111";
//}
//if (!isnottc&&data.COMPR>BaseComp)
//{
//{
// data.TiCheng = data.TiCheng + lasttc;
// saleprofitlist.ForEach(i =>
// data.PRREMARK = "系数:" + lasttcxs.ToString() + "提成:" + lasttc.ToString();
// {
// if (i.SALE == data.SALE && i.BSSOURCE == data.BSSOURCE && ((TTLCOMPR-data.TTLPROFIT)> i.PROFITDOWN ||TTLCOMPR>i.PROFITDOWN) && ((data.MONTHTTLPR >= i.PROFITPLAN && i.PROFITPLAN > 0) || (i.PROFITPLAN <= 0)))
// {
// if (((TTLCOMPR - data.TTLPROFIT) <= i.PROFITUP || TTLCOMPR <= i.PROFITUP))
// {
// POORDAY = i.POORDAY;
// MONTHPOORDAY = i.MONTHPOORDAY;
// if (data.NODAY <= 0)
// {
// data.TiChengQuJian = 100;
// }
// else
// {
// saleprofitcqlist.ForEach(j =>
// {
// if (j.SALE == data.SALE && data.NODAY >= j.BDAY && data.NODAY <= j.EDAY)
// {
// data.TiChengQuJian = j.DEDUCTIN;
// }
// });
// }
// }
// data.TiChengBiLi = i.SHAREPR * data.TiChengQuJian / 100;
// data.ShiJiTiChengBiLi= i.SHAREPR / 100;
// SHAREPR = i.SHAREPR;
// beginplan = i.PROFITDOWN;
// endplan = i.PROFITUP;
// if (TTLCOMPR <= i.PROFITUP)
// {
// var TMPTTLPROFIT = data.TTLPROFIT;
// decimal basecompr = TTLCOMPR;
// if ((data.COMPR - data.TTLPROFIT) < BaseComp) basecompr = data.COMPR - BaseComp;
// if ((TTLCOMPR - data.TTLPROFIT) <= i.PROFITDOWN) TMPTTLPROFIT = (data.COMPR - i.PROFITDOWN);
// data.TiCheng = data.TiCheng + TMPTTLPROFIT * data.TiChengBiLi / 100;
// data.KouXi=data.KouXi+ (TMPTTLPROFIT * i.SHAREPR / 100- TMPTTLPROFIT * data.TiChengBiLi / 100);
// if (!string.IsNullOrEmpty(data.TiChengBiLiStr))
// data.TiChengBiLiStr = data.TiChengBiLiStr+"+"+ Convert.ToString(data.TiChengQuJian / 100) + "*(" + TMPTTLPROFIT.ToString() + "*" + Convert.ToString(SHAREPR / 100) + ")";
// else
// data.TiChengBiLiStr = Convert.ToString(data.TiChengQuJian / 100) + "*(" + TMPTTLPROFIT.ToString() + "*" + Convert.ToString(SHAREPR / 100) + ")";
// }
// }
// else {
// decimal basecompr = TTLCOMPR;
// if ((data.COMPR - data.TTLPROFIT) < BaseComp) basecompr = data.COMPR - BaseComp;
// var TMPTTLPROFIT = data.TTLPROFIT - (basecompr - i.PROFITUP);
// if ((TTLCOMPR - data.TTLPROFIT) < i.PROFITDOWN && (TMPTTLPROFIT > (i.PROFITUP - i.PROFITDOWN))) TMPTTLPROFIT = i.PROFITUP - i.PROFITDOWN;
// //if ((data.COMPR - data.TTLPROFIT) < BaseComp) TMPTTLPROFIT = data.COMPR - BaseComp;
// data.TiCheng = data.TiCheng + TMPTTLPROFIT * data.TiChengBiLi/100;
// data.KouXi = data.KouXi + (TMPTTLPROFIT * i.SHAREPR / 100 - TMPTTLPROFIT * data.TiChengBiLi / 100);
// if (!string.IsNullOrEmpty(data.TiChengBiLiStr))
// data.TiChengBiLiStr = data.TiChengBiLiStr + "+" + Convert.ToString(data.TiChengQuJian / 100) + "*(" + TMPTTLPROFIT.ToString() + "*" + Convert.ToString(SHAREPR / 100) + ")";
// else
// else
// data.TiCheng = Math.Round(data.TiChengBiLi * TTLPROFIT / 100, 2);
// data.TiChengBiLiStr = Convert.ToString(data.TiChengQuJian / 100) + "*(" + TMPTTLPROFIT.ToString() + "*" + Convert.ToString(SHAREPR / 100) + ")";
// }
// }
// }
//else data.TiCheng = 0;
// }
// });
}
if ( reader [ "SETTLETIME" ] ! = DBNull . Value )
if ( reader [ "SETTLETIME" ] ! = DBNull . Value )