Commit 93d506ef by zhouminghui
parents 9c804350 eb265232
......@@ -37,7 +37,7 @@
</div>
<div class="form-group" style="margin-left:10px">
<label>账单月份</label>
<input id="month" name="month" class="form-control" style="width:110px" placeholder="账单归属月份" />
<input id="month" name="month" class="form-control" style="width:110px" placeholder="账单归属月份" value="@(DateTime.Now.AddMonths(-1).ToString("yyyy-MM"))" />
</div>
<div class="form-group" style="margin-left:10px">
<label>时间</label>
......
......@@ -2027,7 +2027,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
item.putawayfee = (ebayPutAway != null ? ebayPutAway.gross_amount_rmb : 0)+ (ebayPutAwayNew != null ? ebayPutAwayNew.value_rmb : 0);
item.profit_total = (item.profit_total - (item.adfee ?? 0) - (item.putawayfee ?? 0));
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / item.amount_sales), 2) : 0;
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / (item.amount_sales-item.amount_prepaid)), 2) : 0;
}
else if (item.platform_type.ToLower() == "fba") //亚马逊广告费
......@@ -2035,27 +2035,27 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
item.adfee = amazonAD != null ? amazonAD.cost_rmb : 0;
item.profit_total = (item.profit_total - item.adfee ?? 0);
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / item.amount_sales), 2) : 0;
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / (item.amount_sales - item.amount_prepaid)), 2) : 0;
}
else if (item.platform_type.ToLower() == "wish") //Wish广告费
{
item.adfee = wishAD != null ? wishAD.daily_total_campaign_spend : 0;
item.profit_total = (item.profit_total - item.adfee ?? 0);
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / item.amount_sales), 2) : 0;
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / (item.amount_sales - item.amount_prepaid)), 2) : 0;
}
else if (item.platform_type.ToLower() == "aliexpress") //速卖通广告费
{
item.adfee = aliexpressAD != null ? aliexpressAD.cost_fee : 0;
item.profit_total = (item.profit_total - item.adfee ?? 0);
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / item.amount_sales), 2) : 0;
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / (item.amount_sales - item.amount_prepaid)), 2) : 0;
}
}
else if (statistictype == 1)
{
item.profit_total = item.profit_total - (item.adfee ?? 0) - (item.putawayfee ?? 0);
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / item.amount_sales), 2) : 0;
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / (item.amount_sales - item.amount_prepaid)), 2) : 0;
}
else if (statistictype == 2) //sku来源
{
......@@ -2083,7 +2083,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
item.profit_total -= _objAmazonAD.cost_rmb;
}
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / item.amount_sales), 2) : 0;
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / (item.amount_sales - item.amount_prepaid)), 2) : 0;
}
if (statistictype != 1)
......@@ -2099,11 +2099,10 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
//利润减去退款
item.profit_total = (item.profit_total - item.amount_refund);
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / item.amount_sales), 2) : 0;
item.profit_rate = item.amount_sales != 0 ? Math.Round((item.profit_total / (item.amount_sales - item.amount_prepaid)), 2) : 0;
}
if (statistictype == 2)
{
item.platform_type = Enum.GetName(typeof(SkuSource), int.Parse(item.platform_type));
......@@ -2151,7 +2150,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
customerprice = result.Sum(a => a.customerprice) / result.Count,
cost_platform_fee = result.Sum(a => a.cost_platform_fee),
profit_total = result.Sum(a => a.profit_total),
profit_rate = result.Sum(a => a.amount_sales) > 0 ? result.Sum(a => a.amount_sales) / result.Sum(a => a.amount_sales) : 0,
profit_rate = result.Sum(a => a.amount_sales) > 0 ? result.Sum(a => a.profit_total) / result.Sum(a => a.amount_sales-a.amount_prepaid) : 0,
amount_refund = result.Sum(a => a.amount_refund),
amount_refund_rate = result.Sum(a => a.amount_sales) > 0 ? (result.Sum(a => a.amount_refund) / result.Sum(a => a.amount_sales) * 100) : 0,
cost_first = result.Sum(a => a.cost_first),
......@@ -2177,7 +2176,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
order_count = p.order_count.ToString("N0"),
cost_platform_fee = p.cost_platform_fee > 0 ? p.cost_platform_fee.ToString("N2") : "0",
profit_total = p.profit_total.ToString("N2"),
profit_rate = (p.amount_sales > 0 ? p.profit_total * 100 / p.amount_sales : 0).ToString("N2"),
profit_rate = (p.amount_sales > 0 ? p.profit_total * 100 / (p.amount_sales-p.amount_prepaid) : 0).ToString("N2"),
amount_refund = p.amount_refund.ToString("N2"),
amount_refund_rate = p.amount_sales > 0 ? (p.amount_refund * 100 / p.amount_sales).ToString("N4") : "0",
amount_sales = p.amount_sales.ToString("N2"),
......
......@@ -15,7 +15,7 @@
<div style="float:right;width:100%;">
<div id="rightcontain">
<div class="alert alert-warning">
说明:1、退款数据统计的是时间段内的退款发生额,并且排除已取消订单的退款;2、时间段内没有数据的平台不会显示出来;3、广告费、上架费和退款无法分摊到订单里面,但总利润有减去这三项费用;
说明:1、退款数据统计的是时间段内的退款发生额,并且排除已取消订单的退款;2、时间段内没有数据的平台不会显示出来;3、广告费、上架费和退款无法分摊到订单里面,但总利润有减去这三项费用;4、利润率=利润*100/(销售额-预收金额)
</div>
<div class="ibox-content m-b-sm border-bottom">
......@@ -302,7 +302,7 @@
s += '<td class="skuprofit" onclick="ShowSkuProfit(\'' + result[i].platform_type + '\',\'预收订单数\',\'noshippingcount\',1)" title="查看sku分类利润">' + result[i].noshippingcount + '</td>';
s += '<td class="skuprofit" onclick="ShowSkuProfit(\'' + result[i].platform_type + '\',\'利润\',\'profit_total\',1)" title="查看sku分类利润">' + result[i].profit_total + (result[i].rebate_4px == 0 ? '' : '<img style="width:16px;margin-left:3px" src="@Url.Content("~/img/icon-quetion.png")" title="4px物流返利:' + result[i].rebate_4px+'" />') + '</td>';
s += '<td><img style="width:16px;margin-left:3px" src="@Url.Content("~/img/chart-icon.png")" onclick="ShowChart(\'' + result[i].platform_type + '\',\'利润\',\'profit_total\');" title="点击查看利润曲线图"></td>';
s += '<td>' + result[i].profit_rate + '</td>';
s += '<td><span title="' + (result[i].profit_total + '*100/(' + result[i].amount_sales + '-' + result[i].amount_prepaid+')')+'">' + result[i].profit_rate + '</span></td>';
//s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform_type + '\',\'退款金额\',\'amount_refund\',1)" title="查看订单明细">' + result[i].amount_refund + '</td>';
s += '<td>' + result[i].amount_refund + '</td>';
s += '<td>' + result[i].amount_refund_rate + '</td>';
......
......@@ -204,6 +204,7 @@
$('#user-job').html(result.result.Account);
global_userid = result.result.OaUserId;
global_username = result.result.Account;
localStorage.setItem("uid", result.result.OaUserId)
if (result.result.Department != null) {
$('#user-name').html(result.result.Department.Name);
}
......@@ -217,7 +218,6 @@
}
}
});
}
function getmenu() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment