Commit 4f7edc89 by guanzhenshan

1、解决速卖通广告费导出不了的问题,2、平台利润统计报表增加速卖通广告费

parent 16eab188
......@@ -237,7 +237,7 @@ namespace Bailun.DC.SkuDailyPurchaseAndSales
//卖出
sql = $@"select ";
//入库
......
......@@ -1402,6 +1402,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
var wishAD = _service.ListWishADCount(companyid, null, dtstart, dtend, currency.ToUpper() == "USD");
var aliexpressAD = _service.ListAliexpressADCount(companyid, "", dtstart, dtend, currency.ToUpper() == "USD");
foreach (var item in result)
{
item.adfee = 0;
......@@ -1410,14 +1412,14 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
//利润减去广告费和刊登费
if (item.platform_type.ToLower() == "ebay")
{
item.adfee = ebayADFee != null ? ebayADFee.gross_amount_rmb:0;
item.adfee = ebayADFee != null ? ebayADFee.gross_amount_rmb : 0;
item.putawayfee = ebayPutAway != null ? ebayPutAway.gross_amount_rmb : 0;
item.profit_total = (item.profit_total - item.adfee??0 - item.putawayfee??0);
item.profit_total = (item.profit_total - item.adfee ?? 0 - item.putawayfee ?? 0);
item.profit_rate = Math.Round((item.profit_total / item.amount_sales), 2);
}
else if (item.platform_type.ToLower() == "fba")
else if (item.platform_type.ToLower() == "fba") //亚马逊广告费
{
item.adfee = amazonAD != null ? amazonAD.cost_rmb : 0;
......@@ -1425,13 +1427,20 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
item.profit_rate = Math.Round((item.profit_total / item.amount_sales), 2);
}
else if (item.platform_type.ToLower() == "wish")
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 = Math.Round((item.profit_total / item.amount_sales), 2);
}
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 = Math.Round((item.profit_total / item.amount_sales), 2);
}
item.amount_refund = 0;
item.amount_refund_rate = 0;
var objRefund = listRefund.Where(a => a.platform_type.ToLower() == item.platform_type.ToLower()).FirstOrDefault();
......@@ -2408,8 +2417,9 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="currency">币种</param>
/// <param name="companyid">公司id</param>
/// <returns></returns>
public ActionResult ExportAliexpressAD(DateTime? start, DateTime? end, string account, string currency, int? companyid)
public ActionResult ExportAliexpressAD(DateTime? start, DateTime? end, string account, int? companyid, string currency = "CNY")
{
var _service = new Services.OrdersServices();
var obj = _service.ListAliexpressAD(companyid, account, start, end, currency.ToUpper() == "USD");
var list = obj.Select(a => new
......
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