Commit eee0b886 by guanzhenshan

增加ebay销售统计报表

parent 6fa7e3f5
......@@ -178,6 +178,11 @@ namespace Bailun.DC.Models.Orders
public string other_currency { get; set; }
/// <summary>
/// 销售额
/// </summary>
public decimal amount_sales { get; set; }
/// <summary>
/// 收入总金额-原币种
/// </summary>
public decimal amount_total { get; set; }
......@@ -213,7 +218,7 @@ namespace Bailun.DC.Models.Orders
public decimal amount_refund { get; set; }
/// <summary>
/// 预付款-收钱没发货
/// 预付款-收钱没发货-人民币
/// </summary>
public decimal amount_prepaid { get; set; }
......@@ -393,5 +398,20 @@ namespace Bailun.DC.Models.Orders
/// </summary>
public decimal platform_fee_rate { get; set; }
/// <summary>
/// 订单里百伦SKU总数量
/// </summary>
public int quantity_bailun_sku { get; set; }
/// <summary>
/// 订单总数
/// </summary>
public int order_count { get; set; }
/// <summary>
/// 提现损耗
/// </summary>
public decimal loss_withdrawal { get; set; }
}
}
......@@ -134,6 +134,21 @@ namespace Bailun.DC.Models.Orders
/// </summary>
public decimal amount_refund { get; set; }
/// <summary>
/// fba费用
/// </summary>
public decimal cost_fba_fee { get; set; }
/// <summary>
/// paypal费用
/// </summary>
public decimal cost_paypal_fee { get; set; }
/// <summary>
/// 包装费用
/// </summary>
public decimal cost_package { get; set; }
}
......
......@@ -27,7 +27,7 @@ namespace Bailun.DC.Services
var sqlparam = new DynamicParameters();
var sql = @"select platform_type,seller_account,website,sum(amount_product*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total+cost_first) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',(sum(amount_product*seller_order_exchange_rate)-sum(cost_shipping)-sum(cost_total+cost_first)) 'profit_count',(sum(amount_product*seller_order_exchange_rate)-sum(cost_shipping)-sum(cost_total+cost_first))/sum(amount_product*seller_order_exchange_rate) 'profit_rate',sum(amount_prepaid*seller_order_exchange_rate) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund from dc_base_oms_order where paid_time>='" + start.ToString("yyyy-MM-dd") + "' and paid_time<'" + end.ToString("yyyy-MM-dd") + "' and platform_type='Amazon' and bailun_order_status!='Canceled' ";
var sql = @"select platform_type,seller_account,website,sum(amount_product*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_sales*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund from dc_base_oms_order where paid_time>='" + start.ToString("yyyy-MM-dd") + "' and paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and platform_type='Amazon' and bailun_order_status!='Canceled' ";
if (!string.IsNullOrWhiteSpace(account))
{
......@@ -76,7 +76,7 @@ namespace Bailun.DC.Services
{
var sqlparam = new DynamicParameters();
var sql = @"select sum(amount_product*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total+cost_first) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',(sum(amount_product*seller_order_exchange_rate)-sum(cost_shipping)-sum(cost_total+cost_first)) 'profit_count',(sum(amount_product*seller_order_exchange_rate)-sum(cost_shipping)-sum(cost_total+cost_first))/sum(amount_product*seller_order_exchange_rate) 'profit_rate',sum(amount_prepaid*seller_order_exchange_rate) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund from dc_base_oms_order where paid_time>='" + start.ToString("yyyy-MM-dd") + "' and paid_time<'" + end.ToString("yyyy-MM-dd") + "' and platform_type='Amazon' and bailun_order_status!='Canceled' ";
var sql = @"select sum(amount_product*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_sales*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund from dc_base_oms_order from dc_base_oms_order where paid_time>='" + start.ToString("yyyy-MM-dd") + "' and paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and platform_type='Amazon' and bailun_order_status!='Canceled' ";
if (!string.IsNullOrWhiteSpace(account))
{
......@@ -113,7 +113,7 @@ namespace Bailun.DC.Services
}
/// <summary>
/// 获取亚马逊的销售统计数据(非FBA)
/// 获取亚马逊的销售统计数据(FBA)
/// </summary>
/// <param name="parameter">分页信息</param>
/// <param name="account">销售帐号</param>
......@@ -127,7 +127,7 @@ namespace Bailun.DC.Services
var sqlparam = new DynamicParameters();
var sql = @"select platform_type,seller_account,website,sum(amount_product*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total+cost_first) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',(sum(amount_product*seller_order_exchange_rate)-sum(cost_shipping)-sum(cost_total+cost_first)) 'profit_count',(sum(amount_product*seller_order_exchange_rate)-sum(cost_shipping)-sum(cost_total+cost_first))/sum(amount_product*seller_order_exchange_rate) 'profit_rate', order_currency 'currency' from dc_base_oms_order where paid_time>='" + start.ToString("yyyy-MM-dd") + "' and paid_time<'" + end.ToString("yyyy-MM-dd") + "' and platform_type='FBA' and bailun_order_status!='Canceled' ";
var sql = @"select platform_type,seller_account,website,sum(amount_product*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_total*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_package) cost_package from dc_base_oms_order where paid_time>='" + start.ToString("yyyy-MM-dd") + "' and paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and platform_type='FBA' and bailun_order_status!='Canceled' ";
if (!string.IsNullOrWhiteSpace(account))
{
......@@ -163,7 +163,7 @@ namespace Bailun.DC.Services
}
/// <summary>
/// 获取亚马逊的销售统计数据(非FBA) 统计
/// 获取亚马逊的销售统计数据(FBA) 统计
/// </summary>
/// <param name="parameter">分页信息</param>
/// <param name="account">销售帐号</param>
......@@ -174,7 +174,7 @@ namespace Bailun.DC.Services
{
var sqlparam = new DynamicParameters();
var sql = @"select sum(amount_product*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total+cost_first) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',(sum(amount_product*seller_order_exchange_rate)-sum(cost_shipping)-sum(cost_total+cost_first)) 'profit_count',(sum(amount_product*seller_order_exchange_rate)-sum(cost_shipping)-sum(cost_total+cost_first))/sum(amount_product*seller_order_exchange_rate) 'profit_rate', order_currency 'currency' from dc_base_oms_order where paid_time>='" + start.ToString("yyyy-MM-dd") + "' and paid_time<'" + end.ToString("yyyy-MM-dd") + "' and platform_type='FBA' and bailun_order_status!='Canceled' ";
var sql = @"select sum(amount_product*seller_order_exchange_rate) 'amount_product',sum(cost_product) 'cost_product',sum(cost_platform_fee*seller_order_exchange_rate) 'platform_fee',sum(cost_first) 'head_fee',count(id) 'order_count',sum(cost_total) 'cost_count',sum(cost_shipping) 'nofba_logisticsfee',sum(profit_total) 'profit_count',(sum(profit_total)/sum(amount_product*seller_order_exchange_rate)) 'profit_rate',sum(amount_prepaid) amount_prepaid,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_package) cost_package from dc_base_oms_order where paid_time>='" + start.ToString("yyyy-MM-dd") + "' and paid_time<'" + end.AddDays(1).ToString("yyyy-MM-dd") + "' and platform_type='FBA' and bailun_order_status!='Canceled' ";
if (!string.IsNullOrWhiteSpace(account))
{
......@@ -775,7 +775,7 @@ namespace Bailun.DC.Services
public List<Models.Orders.mPlatformProfit> ListPlatformProfit(string platform, DateTime? start, DateTime? end)
{
var sqlparam = new DynamicParameters();
var sql = "select platform_type as platform, sum(amount_total*seller_order_exchange_rate) saleamount,count(id) ordercount,sum(cost_platform_fee*seller_order_exchange_rate) platformfee,(sum(amount_total*seller_order_exchange_rate)/count(id)) customerprice,(sum(amount_total*seller_order_exchange_rate)-sum(cost_total)-sum(cost_shipping)) profit,((sum(amount_total*seller_order_exchange_rate)-sum(cost_total)-sum(cost_shipping))/sum(amount_total*seller_order_exchange_rate)) profitrate,sum(amount_refund*seller_order_exchange_rate) returnamount,(sum(amount_refund*seller_order_exchange_rate)/sum(amount_total*seller_order_exchange_rate)) returnamountrate,sum(cost_first) cost_first,sum(cost_tail) cost_tail,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform,sum(amount_prepaid*seller_order_exchange_rate) amount_prepaid from dc_base_oms_order where bailun_order_status!='Canceled'";
var sql = "select platform_type as platform, sum(amount_total*seller_order_exchange_rate) saleamount,count(id) ordercount,sum(cost_platform_fee*seller_order_exchange_rate) platformfee,(sum(amount_total*seller_order_exchange_rate)/count(id)) customerprice,sum(profit_total) profit,(sum(profit_total)/sum(amount_total*seller_order_exchange_rate)) profitrate,sum(amount_refund*seller_order_exchange_rate) returnamount,(sum(amount_refund*seller_order_exchange_rate)/sum(amount_total*seller_order_exchange_rate)) returnamountrate,sum(cost_first) cost_first,sum(cost_tail) cost_tail,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform,sum(amount_prepaid*seller_order_exchange_rate) amount_prepaid from dc_base_oms_order where bailun_order_status!='Canceled'";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -820,7 +820,7 @@ namespace Bailun.DC.Services
public List<Models.Orders.mPlatformProfit> ListPlatformProfitByWebSite(string platform, DateTime? start, DateTime? end, BtTableParameter parameter, ref int total)
{
var sqlparam = new DynamicParameters();
var sql = "select platform_type as platform,website,sum(amount_total*seller_order_exchange_rate) saleamount,count(id) ordercount,sum(cost_platform_fee*seller_order_exchange_rate) platformfee,(sum(amount_total*seller_order_exchange_rate)/count(id)) customerprice,(sum(amount_total*seller_order_exchange_rate)-sum(cost_total)-sum(cost_shipping)) profit,((sum(amount_total*seller_order_exchange_rate)-sum(cost_total)-sum(cost_shipping))/sum(amount_total*seller_order_exchange_rate)) profitrate,sum(amount_refund*seller_order_exchange_rate) returnamount,(sum(amount_refund*seller_order_exchange_rate)/sum(amount_total*seller_order_exchange_rate)) returnamountrate,sum(cost_first) cost_first,sum(cost_tail) cost_tail,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform,sum(amount_prepaid*seller_order_exchange_rate) amount_prepaid from dc_base_oms_order where bailun_order_status!='Canceled'";
var sql = "select platform_type as platform,website,sum(amount_total*seller_order_exchange_rate) saleamount,count(id) ordercount,sum(cost_platform_fee*seller_order_exchange_rate) platformfee,(sum(amount_total*seller_order_exchange_rate)/count(id)) customerprice,sum(profit_total) profit,(sum(profit_total)/sum(amount_total*seller_order_exchange_rate)) profitrate,sum(amount_refund*seller_order_exchange_rate) returnamount,(sum(amount_refund*seller_order_exchange_rate)/sum(amount_total*seller_order_exchange_rate)) returnamountrate,sum(cost_first) cost_first,sum(cost_tail) cost_tail,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform,sum(amount_prepaid*seller_order_exchange_rate) amount_prepaid from dc_base_oms_order where bailun_order_status!='Canceled'";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -869,7 +869,7 @@ namespace Bailun.DC.Services
public Models.Orders.mPlatformProfit ListPlatformProfitByWebSiteCount(string platform, DateTime? start, DateTime? end, BtTableParameter parameter, ref int total)
{
var sqlparam = new DynamicParameters();
var sql = "select sum(amount_total*seller_order_exchange_rate) saleamount,count(id) ordercount,sum(cost_platform_fee*seller_order_exchange_rate) platformfee,(sum(amount_total*seller_order_exchange_rate)/count(id)) customerprice,(sum(amount_total*seller_order_exchange_rate)-sum(cost_total)-sum(cost_shipping)) profit,((sum(amount_total*seller_order_exchange_rate)-sum(cost_total)-sum(cost_shipping))/sum(amount_total*seller_order_exchange_rate)) profitrate,sum(amount_refund*seller_order_exchange_rate) returnamount,(sum(amount_refund*seller_order_exchange_rate)/sum(amount_total*seller_order_exchange_rate)) returnamountrate,sum(cost_first) cost_first,sum(cost_tail) cost_tail,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform from dc_base_oms_order where bailun_order_status!='Canceled'";
var sql = "select sum(amount_total*seller_order_exchange_rate) saleamount,count(id) ordercount,sum(cost_platform_fee*seller_order_exchange_rate) platformfee,(sum(amount_total*seller_order_exchange_rate)/count(id)) customerprice,sum(profit_total) profit,(sum(profit_total)/sum(amount_total*seller_order_exchange_rate)) profitrate,sum(amount_refund*seller_order_exchange_rate) returnamount,(sum(amount_refund*seller_order_exchange_rate)/sum(amount_total*seller_order_exchange_rate)) returnamountrate,sum(cost_first) cost_first,sum(cost_tail) cost_tail,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform from dc_base_oms_order where bailun_order_status!='Canceled'";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -905,15 +905,16 @@ namespace Bailun.DC.Services
/// <param name="parameter">分页信息</param>
/// <param name="platform">平台信息</param>
/// <param name="website">站点信息</param>
/// <param name="account">销售帐号</param>
/// <param name="start">付款开始时间</param>
/// <param name="end">付款结束时间</param>
/// <param name="orderno">百伦单号</param>
/// <param name="total">符合条件的记录数</param>
/// <returns></returns>
public List<Models.Orders.dc_base_oms_order> ListPlatformProfitOrders(BtTableParameter parameter, string platform, string website, DateTime? start, DateTime? end, string orderno, ref int total)
public List<Models.Orders.dc_base_oms_order> ListPlatformProfitOrders(BtTableParameter parameter, string platform, string website,string account, DateTime? start, DateTime? end, string orderno, ref int total)
{
var sqlparam = new DynamicParameters();
var sql = "select id,platform_type,website,origin_order_id,bailun_order_id,seller_account,order_currency,amount_total,amount_product,amount_shipping,amount_tax,amount_adjustment,amount_gift_wrap,amount_refund,cost_total,cost_promotion,cost_platform_fee,cost_product,cost_shipping,cost_package,cost_fba_fee,cost_paypal_fee,cost_refund_commisson,cost_handle_bailun,cost_handle_platform,cost_tail,cost_first,profit_total,profit_rate,create_time,paid_time,seller_order_exchange_rate,seller_other_exchange_rate from dc_base_oms_order where bailun_order_status!='Canceled' ";
var sql = "select id,platform_type,website,origin_order_id,bailun_order_id,seller_account,order_currency,amount_total,amount_product,amount_shipping,amount_tax,amount_adjustment,amount_gift_wrap,amount_refund,cost_total,cost_promotion,cost_platform_fee,cost_product,cost_shipping,cost_package,cost_fba_fee,cost_paypal_fee,cost_refund_commisson,cost_handle_bailun,cost_handle_platform,cost_tail,cost_first,profit_total,profit_rate,create_time,paid_time,seller_order_exchange_rate,seller_other_exchange_rate,(seller_order_exchange_rate*amount_prepaid) amount_prepaid from dc_base_oms_order where bailun_order_status!='Canceled' ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -940,6 +941,11 @@ namespace Bailun.DC.Services
sql += " and bailun_order_id=@bailun_order_id";
sqlparam.Add("bailun_order_id", orderno);
}
if (!string.IsNullOrEmpty(account))
{
sql += " and seller_account=@seller_account";
sqlparam.Add("seller_account", account);
}
if (!string.IsNullOrEmpty(parameter.sort))
{
......@@ -969,10 +975,10 @@ namespace Bailun.DC.Services
/// <param name="end"></param>
/// <param name="orderno"></param>
/// <returns></returns>
public Models.Orders.dc_base_oms_order ListPlatformProfitOrdersCount(string platform, string website, DateTime? start, DateTime? end, string orderno)
public Models.Orders.dc_base_oms_order ListPlatformProfitOrdersCount(string platform, string website,string account, DateTime? start, DateTime? end, string orderno)
{
var sqlparam = new DynamicParameters();
var sql = "select sum(amount_total*seller_order_exchange_rate) amount_total,sum(amount_product*seller_order_exchange_rate) amount_product,sum(amount_shipping*seller_order_exchange_rate) amount_shipping,sum(amount_tax*seller_order_exchange_rate) amount_tax,sum(amount_adjustment*seller_order_exchange_rate) amount_adjustment,sum(amount_gift_wrap*seller_order_exchange_rate) amount_gift_wrap,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_total) cost_total,sum(cost_promotion*seller_order_exchange_rate) cost_promotion,sum(cost_platform_fee*seller_order_exchange_rate) cost_platform_fee,sum(cost_product) cost_product,sum(cost_shipping) cost_shipping,sum(cost_package) cost_package,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_refund_commisson*seller_order_exchange_rate) cost_refund_commisson,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform,sum(cost_tail) cost_tail,sum(cost_first) cost_first,sum(profit_total) profit_total from dc_base_oms_order where bailun_order_status!='Canceled' ";
var sql = "select sum(amount_total*seller_order_exchange_rate) amount_total,sum(amount_product*seller_order_exchange_rate) amount_product,sum(amount_shipping*seller_order_exchange_rate) amount_shipping,sum(amount_tax*seller_order_exchange_rate) amount_tax,sum(amount_adjustment*seller_order_exchange_rate) amount_adjustment,sum(amount_gift_wrap*seller_order_exchange_rate) amount_gift_wrap,sum(amount_refund*seller_order_exchange_rate) amount_refund,sum(cost_total) cost_total,sum(cost_promotion*seller_order_exchange_rate) cost_promotion,sum(cost_platform_fee*seller_order_exchange_rate) cost_platform_fee,sum(cost_product) cost_product,sum(cost_shipping) cost_shipping,sum(cost_package) cost_package,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee,sum(cost_paypal_fee*seller_order_exchange_rate) cost_paypal_fee,sum(cost_refund_commisson*seller_order_exchange_rate) cost_refund_commisson,sum(cost_handle_bailun) cost_handle_bailun,sum(cost_handle_platform) cost_handle_platform,sum(cost_tail) cost_tail,sum(cost_first) cost_first,sum(profit_total) profit_total,sum(seller_order_exchange_rate*amount_prepaid) amount_prepaid from dc_base_oms_order where bailun_order_status!='Canceled' ";
if (!string.IsNullOrWhiteSpace(platform))
{
......@@ -999,7 +1005,11 @@ namespace Bailun.DC.Services
sql += " and bailun_order_id=@bailun_order_id";
sqlparam.Add("bailun_order_id", orderno);
}
if (!string.IsNullOrEmpty(account))
{
sql += " and seller_account=@seller_account";
sqlparam.Add("seller_account", account);
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
......@@ -1384,5 +1394,162 @@ namespace Bailun.DC.Services
}
#region Ebay
/// <summary>
/// Ebay 销售统计记录
/// </summary>
/// <param name="parameter">分页信息</param>
/// <param name="website">站点信息</param>
/// <param name="account">帐号信息</param>
/// <param name="start">付款开始时间</param>
/// <param name="end">付款结束时间</param>
/// <param name="warehousetype">发货仓库类型</param>
/// <param name="warehousecode">发货仓库编码</param>
/// <param name="total"></param>
/// <returns></returns>
public List<Models.Orders.dc_base_oms_order> ListEbayStatistics(BtTableParameter parameter, string website, string account, DateTime? start, DateTime? end, string warehousetype, string warehousecode, ref int total)
{
var sqlparam = new DynamicParameters();
var sql = @"select t1.platform_type,t1.seller_account,t1.website,sum(t1.amount_product*t1.seller_order_exchange_rate) 'amount_product',sum(t1.cost_product) 'cost_product',sum(t1.cost_platform_fee*t1.seller_other_exchange_rate) 'cost_platform_fee',sum(t1.cost_first) 'cost_first',count(t1.id) 'order_count',sum(t1.cost_total) 'cost_total',sum(t1.cost_shipping) 'cost_shipping',sum(t1.profit_total) 'profit_total',(sum(t1.profit_total)/sum(t1.amount_total*t1.seller_order_exchange_rate)) 'profit_rate',sum(t1.amount_prepaid) amount_prepaid,sum(t1.amount_refund*t1.seller_order_exchange_rate) amount_refund from dc_base_oms_order t1";
var sqlwhere = " where platform_type='Ebay' and bailun_order_status!='Canceled' ";
if (!string.IsNullOrEmpty(warehousetype) || (!string.IsNullOrEmpty(warehousetype) && !string.IsNullOrEmpty(warehousecode)))
{
sql += " join dc_base_oms_pick t2 on t1.origin_order_id=t2.origin_order_id " + (!string.IsNullOrEmpty(warehousecode) ? " and t2.warehouse_code=@warehousecode" : "");
sql += " join dc_base_warehouse t3 on t2.warehouse_code =t3.warehouse_code and hq_type=@warehousetype";
sqlparam.Add("warehousetype", warehousetype);
if (!string.IsNullOrEmpty(warehousecode))
{
sqlparam.Add("warehousecode", warehousecode);
}
}
else if (!string.IsNullOrEmpty(warehousecode))
{
sql += " join dc_base_oms_pick t2 on t1.origin_order_id=t2.origin_order_id and t2.warehouse_code=@warehousecode";
sqlparam.Add("warehousecode", warehousecode);
}
if (!string.IsNullOrWhiteSpace(account))
{
sqlwhere += " and t1.seller_account=@seller_account";
sqlparam.Add("seller_account", account);
}
if (!string.IsNullOrWhiteSpace(website))
{
sqlwhere += " and t1.website=@website";
sqlparam.Add("website", website);
}
if (start.HasValue)
{
sqlwhere += " and t1.paid_time>='" + start.Value.ToString("yyyy-MM-dd") + "'";
}
if (end.HasValue)
{
sqlwhere += " and t1.paid_time<'" + end.Value.AddDays(1).ToString("yyyy-MM-dd") + "'";
}
sqlwhere += " group by t1.seller_account,t1.website,t1.order_currency,t1.platform_type";
if (!string.IsNullOrWhiteSpace(parameter.sort))
{
sqlwhere += " order by " + parameter.sort + " " + parameter.order;
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
var obj = cn.Page<Models.Orders.dc_base_oms_order>(parameter.pageIndex, parameter.limit, sql+sqlwhere, ref total, sqlparam);
return obj.AsList();
}
}
/// <summary>
/// Ebay 销售统计记录 统计
/// </summary>
/// <param name="website"></param>
/// <param name="account"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <param name="warehousetype"></param>
/// <param name="warehousecode"></param>
/// <returns></returns>
public Models.Orders.dc_base_oms_order ListEbayStatisticsCount(string website, string account, DateTime? start, DateTime? end, string warehousetype, string warehousecode)
{
var sqlparam = new DynamicParameters();
var sql = @"select sum(t1.amount_product*t1.seller_order_exchange_rate) 'amount_product',sum(t1.cost_product) 'cost_product',sum(t1.cost_platform_fee*t1.seller_order_exchange_rate) 'cost_platform_fee',sum(t1.cost_first) 'cost_first',count(t1.id) 'order_count',sum(t1.cost_total) 'cost_total',sum(t1.cost_shipping) 'cost_shipping',sum(t1.profit_total) 'profit_total',(sum(t1.profit_total)/sum(t1.amount_total*t1.seller_order_exchange_rate)) 'profit_rate',sum(t1.amount_prepaid) amount_prepaid,sum(t1.amount_refund*t1.seller_order_exchange_rate) amount_refund from dc_base_oms_order t1";
var sqlwhere = " where platform_type='Ebay' and bailun_order_status!='Canceled' ";
if (!string.IsNullOrEmpty(warehousetype) || (!string.IsNullOrEmpty(warehousetype) && !string.IsNullOrEmpty(warehousecode)))
{
sql += " join dc_base_oms_pick t2 on t1.origin_order_id=t2.origin_order_id " + (!string.IsNullOrEmpty(warehousecode) ? " and t2.warehouse_code=@warehousecode" : "");
sql += " join dc_base_warehouse t3 on t2.warehouse_code =t3.warehouse_code and hq_type=@warehousetype";
sqlparam.Add("warehousetype", warehousetype);
if (!string.IsNullOrEmpty(warehousecode))
{
sqlparam.Add("warehousecode", warehousecode);
}
}
else if (!string.IsNullOrEmpty(warehousecode))
{
sql += " join dc_base_oms_pick t2 on t1.origin_order_id=t2.origin_order_id and t2.warehouse_code=@warehousecode";
sqlparam.Add("warehousecode", warehousecode);
}
if (!string.IsNullOrWhiteSpace(account))
{
sqlwhere += " and t1.seller_account=@seller_account";
sqlparam.Add("seller_account", account);
}
if (!string.IsNullOrWhiteSpace(website))
{
sqlwhere += " and t1.website=@website";
sqlparam.Add("website", website);
}
if (start.HasValue)
{
sqlwhere += " and t1.paid_time>='" + start.Value.ToString("yyyy-MM-dd") + "'";
}
if (end.HasValue)
{
sqlwhere += " and t1.paid_time<'" + end.Value.AddDays(1).ToString("yyyy-MM-dd") + "'";
}
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
var obj = cn.QueryFirstOrDefault<Models.Orders.dc_base_oms_order>(sql + sqlwhere, sqlparam);
return obj;
}
}
#endregion
}
}
......@@ -9,6 +9,27 @@ namespace Bailun.DC.Services
{
public class WareHouseServices
{
/// <summary>
/// 获取环球仓库类型
/// </summary>
/// <returns></returns>
public List<string> ListWareHouseType()
{
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
var sql = "select hq_type from dc_base_warehouse group by hq_type";
return cn.Query<string>(sql).AsList();
}
}
/// <summary>
/// 获取仓库列表
/// </summary>
......
......@@ -64,6 +64,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
countM.amount_prepaid = Math.Round(countM.amount_prepaid, 2, MidpointRounding.AwayFromZero);
countM.amount_refund = Math.Round(countM.amount_refund, 2, MidpointRounding.AwayFromZero);
countM.loss_withdrawal = countM.amount_product * (objwithdraw == null ? 0 : objwithdraw.Loss_withdrawal_percent ?? 0);
countM.profit_rate = Math.Round((countM.profit_count / countM.amount_product), 2, MidpointRounding.AwayFromZero);
var obj = list.Select(p => new
......@@ -133,6 +134,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
{
var total = 0;
var service = new Services.OrdersServices();
var objwithdraw = new Services.PlatformSiteServices().GetPlatformLossWithdraw().Where(a => a.english_name == "Amazon").FirstOrDefault();
var list = service.ListFBAStatistics(parameter, sellaccount, website, start, end, ref total);
var countM = service.ListFBAStatisticsCount(sellaccount, website, start, end);
......@@ -151,6 +154,14 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
countM.platform_fee = Math.Round(countM.platform_fee, 2, MidpointRounding.AwayFromZero);
countM.profit_count = Math.Round(countM.profit_count, 2, MidpointRounding.AwayFromZero);
countM.amount_prepaid = Math.Round(countM.amount_prepaid, 2, MidpointRounding.AwayFromZero);
countM.amount_refund = Math.Round(countM.amount_refund, 2, MidpointRounding.AwayFromZero);
countM.loss_withdrawal = countM.amount_product * (objwithdraw == null ? 0 : objwithdraw.Loss_withdrawal_percent ?? 0);
countM.cost_fba_fee = Math.Round(countM.cost_fba_fee, 2, MidpointRounding.AwayFromZero);
countM.cost_paypal_fee = Math.Round(countM.cost_paypal_fee, 2, MidpointRounding.AwayFromZero);
countM.cost_package = Math.Round(countM.cost_package, 2, MidpointRounding.AwayFromZero);
countM.profit_rate = Math.Round((countM.profit_count / countM.amount_product), 2, MidpointRounding.AwayFromZero);
var obj = list.Select(p => new
{
......@@ -162,18 +173,46 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
platform_fee = p.platform_fee.ToString("###,###.##"),
head_fee = p.head_fee.ToString("###,###.##"),
p.order_count,
loss_withdrawal = p.loss_withdrawal,
loss_withdrawal = (p.amount_product * (objwithdraw == null ? 0 : objwithdraw.Loss_withdrawal_percent ?? 0)) > 0 ? (p.amount_product * (objwithdraw == null ? 0 : objwithdraw.Loss_withdrawal_percent ?? 0)).ToString("###,###.##") : "0",
cost_count = p.cost_count.ToString("###,###.##"),
forecast_profit_count = p.forecast_profit_count.ToString("###,###.##"),
nofba_logisticsfee = p.nofba_logisticsfee.ToString("###,###.##"),
nofba_logisticsfee = p.nofba_logisticsfee > 0 ? p.nofba_logisticsfee.ToString("###,###.##") : "0",
nofba_forecast_logisticsfee = p.nofba_forecast_logisticsfee.ToString("###,###.##"),
forecast_profit_rate = (100 * p.forecast_profit_rate).ToString("###,###.##"),
profit_count = p.profit_count.ToString("###,###.##"),
profit_rate = (100 * p.profit_rate).ToString("###,###.##"),
p.currency
amount_prepaid = p.amount_prepaid.ToString("###,###.##"),
amount_refund = p.amount_refund > 0 ? p.amount_refund.ToString("###,###.##") : "0",
cost_fba_fee = p.cost_fba_fee>0?p.cost_fba_fee.ToString("###,###.##"):"0",
cost_paypal_fee = p.cost_paypal_fee>0?p.cost_paypal_fee.ToString("###,###.##"):"0",
cost_package = p.cost_package>0?p.cost_package.ToString("###,###.##"):"0",
});
return JsonConvert.SerializeObject(new { total = total, rows = obj, count_row = countM });
return JsonConvert.SerializeObject(new { total = total, rows = obj,
count_row = new
{
countM.website,
amount_product = countM.amount_product.ToString("###,###.##"),
cost_product = countM.cost_product.ToString("###,###.##"),
platform_fee = countM.platform_fee.ToString("###,###.##"),
head_fee = countM.head_fee.ToString("###,###.##"),
countM.order_count,
loss_withdrawal = countM.loss_withdrawal > 0 ? countM.loss_withdrawal.ToString("###,###.##") : "0",
cost_count = countM.cost_count.ToString("###,###.##"),
forecast_profit_count = countM.forecast_profit_count.ToString("###,###.##"),
nofba_logisticsfee = countM.nofba_logisticsfee.ToString("###,###.##"),
nofba_forecast_logisticsfee = countM.nofba_forecast_logisticsfee.ToString("###,###.##"),
forecast_profit_rate = (100 * countM.forecast_profit_rate).ToString("###,###.##"),
profit_count = countM.profit_count.ToString("###,###.##"),
profit_rate = (100 * countM.profit_rate).ToString("###,###.##"),
countM.currency,
amount_prepaid = countM.amount_prepaid.ToString("###,###.##"),
amount_refund = countM.amount_refund > 0 ? countM.amount_refund.ToString("###,###.##") : "0",
cost_fba_fee = countM.cost_fba_fee > 0 ? countM.cost_fba_fee.ToString("###,###.##") : "0",
cost_paypal_fee = countM.cost_paypal_fee > 0 ? countM.cost_paypal_fee.ToString("###,###.##") : "0",
cost_package = countM.cost_package > 0 ? countM.cost_package.ToString("###,###.##") : "0",
}
});
}
/// <summary>
......@@ -462,36 +501,37 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
customerprice = result.Sum(a => a.customerprice) / result.Count,
platformfee = result.Sum(a => a.platformfee),
profit = result.Sum(a => a.profit),
profitrate = 0,
profitrate = result.Sum(a => a.profit) / result.Sum(a => a.saleamount),
returnamount = result.Sum(a => a.returnamount),
returnamountrate = 0,
returnamountrate = result.Sum(a => a.returnamount)/ result.Sum(a => a.saleamount),
cost_first = result.Sum(a => a.cost_first),
cost_handle_bailun = result.Sum(a => a.cost_handle_bailun),
cost_handle_platform = result.Sum(a => a.cost_handle_platform),
cost_tail = result.Sum(a => a.cost_tail),
amount_prepaid = result.Sum(a=>a.amount_prepaid),
};
result.Add(m);
}
var list = result.Select(p => new {
p.platform,
customerprice = p.customerprice>0?p.customerprice.ToString("###,###.##"):"0",
customerprice = p.customerprice > 0 ? p.customerprice.ToString("###,###.##") : "0",
p.ordercount,
platformfee = p.platformfee>0? p.platformfee.ToString("###,###.##"):"0",
profit = p.profit>0? p.profit.ToString("###,###.##"):"0",
profitrate= p.profitrate>0?(p.profitrate*100).ToString("###,###.##"):"0",
returnamount= p.returnamount>0? p.returnamount.ToString("###,###.##"):"0",
returnamountrate = p.returnamountrate>0?(p.returnamountrate*100).ToString("###,###.##"):"0",
saleamount = p.saleamount>0? p.saleamount.ToString("###,###.##"):"0",
cost_first = p.cost_first>0?p.cost_first.ToString("###,###.##"):"0",
cost_handle_bailun = p.cost_handle_bailun>0?p.cost_handle_bailun.ToString("###,###.##"):"0",
cost_handle_platform = p.cost_handle_platform>0?p.cost_handle_platform.ToString("###,###.##"):"0",
cost_tail = p.cost_tail>0?p.cost_tail.ToString("###,###.##"):"0",
amount_prepaid = p.amount_prepaid>0?p.amount_prepaid.ToString("###,###.##"):"0"
platformfee = p.platformfee > 0 ? p.platformfee.ToString("###,###.##") : "0",
profit = p.profit > 0 ? p.profit.ToString("###,###.##") : "0",
profitrate = p.profitrate > 0 ? (p.profitrate * 100).ToString("###,###.##") : "0",
returnamount = p.returnamount > 0 ? p.returnamount.ToString("###,###.##") : "0",
returnamountrate = p.returnamountrate.ToString("N4"),
saleamount = p.saleamount > 0 ? p.saleamount.ToString("###,###.##") : "0",
cost_first = p.cost_first > 0 ? p.cost_first.ToString("###,###.##") : "0",
cost_handle_bailun = p.cost_handle_bailun > 0 ? p.cost_handle_bailun.ToString("###,###.##") : "0",
cost_handle_platform = p.cost_handle_platform > 0 ? p.cost_handle_platform.ToString("###,###.##") : "0",
cost_tail = p.cost_tail > 0 ? p.cost_tail.ToString("###,###.##") : "0",
amount_prepaid = p.amount_prepaid.ToString("N2"),
});
return Json(list);
......@@ -567,7 +607,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// 订单明细列表
/// </summary>
/// <returns></returns>
public ActionResult ListOrderDetail(string platform, string website, DateTime? start, DateTime? end, string orderno)
public ActionResult ListOrderDetail(string platform, string website,string account, DateTime? start, DateTime? end, string orderno,int? showsingle,string col,string coltitle)
{
ViewBag.platform = platform;
......@@ -575,6 +615,10 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
ViewBag.start = start.HasValue ? start.Value.ToString("yyyy-MM-dd") : "";
ViewBag.end = end.HasValue ? end.Value.ToString("yyyy-MM-dd") : "";
ViewBag.orderno = orderno;
ViewBag.account = account;
ViewBag.showsingle = (showsingle ?? 0);
ViewBag.col = col;
ViewBag.coltitle = coltitle;
return View();
}
......@@ -589,13 +633,13 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="end">付款结束时间</param>
/// <param name="orderno">百伦订单号</param>
/// <returns></returns>
public string ListOrderDetailJson(BtTableParameter parameter,string platform,string website,DateTime? start,DateTime? end,string orderno)
public string ListOrderDetailJson(BtTableParameter parameter,string platform,string website,string account,DateTime? start,DateTime? end,string orderno)
{
var total = 0;
var service = new Services.OrdersServices();
var obj = service.ListPlatformProfitOrders(parameter, platform, website, start, end, orderno, ref total);
var obj = service.ListPlatformProfitOrders(parameter, platform, website, account, start, end, orderno, ref total);
var countM = service.ListPlatformProfitOrdersCount(platform, website, start, end, orderno);
var countM = service.ListPlatformProfitOrdersCount(platform, website, account, start, end, orderno);
countM.bailun_order_id = "总计";
countM.amount_total = Math.Round((countM.amount_total), 2, MidpointRounding.AwayFromZero);
......@@ -620,6 +664,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
countM.cost_first = Math.Round(countM.cost_first, 2, MidpointRounding.AwayFromZero);
countM.cost_tail = Math.Round(countM.cost_tail, 2, MidpointRounding.AwayFromZero);
countM.profit_total = Math.Round(countM.profit_total, 2, MidpointRounding.AwayFromZero);
countM.amount_prepaid = Math.Round(countM.amount_prepaid, 2, MidpointRounding.AwayFromZero);
var list = obj.Select(p => new
{
......@@ -653,6 +698,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
cost_tail = Math.Round(p.cost_tail,2,MidpointRounding.AwayFromZero),
profit_total = Math.Round(p.profit_total,2,MidpointRounding.AwayFromZero),
profit_rate = Math.Round(p.profit_rate*100,2,MidpointRounding.AwayFromZero),
amount_prepaid = Math.Round(p.amount_prepaid,2,MidpointRounding.AwayFromZero),
create_time = p.create_time.ToString("yyyy-MM-dd HH:mm:ss"),
paid_time = p.paid_time.ToString("yyyy-MM-dd HH:mm:ss"),
......@@ -731,7 +777,103 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
return JsonConvert.SerializeObject(new { total = total, rows = obj,count_row = countM });
}
#region Ebay
/// <summary>
/// Ebay销售统计
/// </summary>
/// <returns></returns>
public ActionResult EbaySaleStatistics()
{
return View();
}
/// <summary>
/// Ebay销售统计 Json
/// </summary>
/// <param name="parameter"></param>
/// <param name="selleraccount"></param>
/// <param name="website"></param>
/// <param name="start"></param>
/// <param name="end"></param>
/// <param name="warehousetype"></param>
/// <param name="warehousecode"></param>
/// <returns></returns>
public string EbaySaleStatisticsJson(BtTableParameter parameter, string selleraccount, string website, DateTime start, DateTime end, string warehousetype, string warehousecode)
{
var total = 0;
var services = new Services.OrdersServices();
var objwithdraw = new Services.PlatformSiteServices().GetPlatformLossWithdraw().Where(a => a.english_name == "Ebay").FirstOrDefault();
var list = services.ListEbayStatistics(parameter, website, selleraccount, start, end, warehousetype, warehousecode, ref total);
var countM = services.ListEbayStatisticsCount(website, selleraccount, start, end, warehousetype, warehousecode);
countM.website = "总计:";
countM.amount_product = Math.Round(countM.amount_product, 2, MidpointRounding.AwayFromZero);
countM.cost_product = Math.Round(countM.cost_product, 2, MidpointRounding.AwayFromZero);
countM.cost_platform_fee = Math.Round(countM.cost_platform_fee, 2, MidpointRounding.AwayFromZero);
countM.cost_package = Math.Round(countM.cost_package, 2, MidpointRounding.AwayFromZero);
countM.cost_paypal_fee = Math.Round(countM.cost_paypal_fee, 2, MidpointRounding.AwayFromZero);
countM.cost_first = Math.Round(countM.cost_first, 2, MidpointRounding.AwayFromZero);
countM.loss_withdrawal = countM.amount_product * (objwithdraw == null ? 0 : objwithdraw.Loss_withdrawal_percent ?? 0);
countM.cost_total = Math.Round(countM.cost_total, 2, MidpointRounding.AwayFromZero);
countM.cost_shipping = Math.Round(countM.cost_shipping, 2, MidpointRounding.AwayFromZero);
countM.amount_refund = Math.Round(countM.amount_refund, 2, MidpointRounding.AwayFromZero);
countM.amount_prepaid = Math.Round(countM.amount_prepaid, 2, MidpointRounding.AwayFromZero);
countM.profit_total = Math.Round(countM.profit_total, 2, MidpointRounding.AwayFromZero);
countM.profit_rate = Math.Round((countM.profit_total / countM.amount_product), 2, MidpointRounding.AwayFromZero);
var obj = list.Select(p => new
{
p.platform_type,
p.seller_account,
p.website,
amount_product = p.amount_product.ToString("N2"),
cost_product = p.cost_product.ToString("N2"),
cost_platform_fee = p.cost_platform_fee.ToString("N2"),
cost_package = p.cost_package.ToString("N2"),
cost_paypal_fee = p.cost_paypal_fee.ToString("N2"),
cost_first = p.cost_first.ToString("N2"),
p.order_count,
loss_withdrawal = (p.amount_product * (objwithdraw == null ? 0 : objwithdraw.Loss_withdrawal_percent ?? 0)) > 0 ? (p.amount_product * (objwithdraw == null ? 0 : objwithdraw.Loss_withdrawal_percent ?? 0)).ToString("###,###.##") : "0",
cost_total = p.cost_total.ToString("N2"),
cost_shipping = p.cost_shipping.ToString("N2"),
amount_refund = p.amount_refund.ToString("N2"),
amount_prepaid = p.amount_prepaid.ToString("N2"),
profit_total = p.profit_total.ToString("N2"),
profit_rate = (100 * p.profit_rate).ToString("N2"),
});
return JsonConvert.SerializeObject(new
{
total = total,
rows = obj,
count_row = new
{
countM.website,
amount_product = countM.amount_product.ToString("N2"),
cost_product = countM.cost_product.ToString("N2"),
cost_platform_fee = countM.cost_platform_fee.ToString("N2"),
cost_package = countM.cost_package.ToString("N2"),
cost_paypal_fee = countM.cost_paypal_fee.ToString("N2"),
cost_first = countM.cost_first.ToString("N2"),
countM.order_count,
loss_withdrawal = countM.loss_withdrawal.ToString("N2"),
cost_total = countM.cost_total.ToString("N2"),
cost_shipping = countM.cost_shipping.ToString("N2"),
amount_refund = countM.amount_refund.ToString("N2"),
amount_prepaid = countM.amount_prepaid.ToString("N2"),
profit_total = countM.profit_total.ToString("N2"),
profit_rate = (100 * countM.profit_rate).ToString("N2"),
}
});
}
#endregion
#region Common
......
......@@ -10,13 +10,6 @@
<div class="ibox-content m-b-sm border-bottom">
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
@*<div class="form-group">
<label>统计维度:</label>
<select id="stype" name="stype" class="form-control">
<option value="1">按平台账号</option>
<option value="2">按销售员</option>
</select>
</div>*@
<div class="form-group">
<label>销售帐号:</label>
<select id="saleaccount" name="saleaccount" class="form-control" style="width:160px;">
......@@ -31,7 +24,7 @@
</div>
<div class="form-group">
<label>付款时间</label>
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd"))" />
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"))" />
<span>至</span>
<input id="end" name="end" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.ToString("yyyy-MM-dd"))" />
</div>
......@@ -55,6 +48,10 @@
overflow: hidden;
text-overflow: ellipsis;
}
.alink {
color: cornflowerblue;
cursor: pointer;
}
</style>
}
@section scripts{
......@@ -84,19 +81,59 @@
}
},
{ field: 'website', title: '站点', width: '80', sortable: false, iscount: true },
{ field: 'amount_product', title: '商品收入', width: '100', sortable: true, iscount: true },
{ field: 'cost_product', title: '产品成本', width: '100', sortable: true, iscount: true },
{ field: 'platform_fee', title: '平台佣金费', width: '110', sortable: true, iscount: true },
{ field: 'head_fee', title: '头程费', width: '100', sortable: true, iscount: true },
{ field: 'order_count', title: '销售数量', width: '100', sortable: true, iscount: true },
{
field: 'amount_product', title: '商品收入', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'商品收入\',\'amount_product\',1)">' + data.amount_product + '</span>';
}
},
{
field: 'cost_product', title: '产品成本', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'产品成本\',\'cost_product\',1)">' + data.cost_product + '</span>';
}
},
{
field: 'platform_fee', title: '平台佣金费', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'平台佣金费\',\'cost_platform_fee\',1)">' + data.platform_fee + '</span>';
}
},
{
field: 'head_fee', title: '头程费', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'头程费\',\'cost_first\',1)">' + data.head_fee + '</span>';
}
},
{
field: 'order_count', title: '销售数量', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'订单数\',\'\',0)">' + data.order_count + '</span>';
}
},
{ field: 'loss_withdrawal', title: '提现损耗', width: '100', sortable: false, iscount: true },
{ field: 'cost_count', title: '总支出', width: '110', sortable: true, iscount: true },
{ field: 'nofba_logisticsfee', title: '实际物流费', width: '110', sortable: true, iscount: true },
{ field: 'amount_refund', title: '退款金额', width: '110', sortable: true, iscount: true },
{ field: 'amount_prepaid', title: '预收金额', width: '120', sortable: true, iscount: true },
{
field: 'cost_count', title: '总支出', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'总支出\',\'cost_total\',1)">' + data.cost_count + '</span>';
}
},
{
field: 'nofba_logisticsfee', title: '实际物流费', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'实际物流费\',\'cost_shipping\',1)">' + data.nofba_logisticsfee + '</span>';
}
},
{
field: 'amount_refund', title: '退款金额', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'退款金额\',\'amount_refund\',1)">' + data.amount_refund + '</span>';
}
},
{
field: 'amount_prepaid', title: '预收金额', width: '120', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'预收金额\',\'amount_prepaid\',1)">' + data.amount_prepaid + '</span>';
}
},
//{ field: 'forecast_profit_rate', title: '预测利润率%', width: '120', sortable: true },
{ field: 'profit_count', title: '实际利润', width: '120', sortable: true, iscount: true },
{ field: 'profit_rate', title: '总实际利润率%', width: '130', sortable: true },
{
field: 'profit_count', title: '实际利润', width: '120', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'实际利润\',\'profit_total\',1)">' + data.profit_count + '</span>';
}
},
{ field: 'profit_rate', title: '总实际利润率%', width: '130', sortable: true, iscount: true },
];
var url = '@Url.Content("~/Reports/Orders/ListAmazonSaleStatisticsJson")' + '?' + $("#toolbar").serialize();
......@@ -141,6 +178,10 @@
})
}
function ShowDetail(platform, website, account, coltitle, colval, single) {
layer_show(platform + " " + website + " " + $('#start').val() + "至" + $('#end').val() + ' 订单明细', '@Url.Content("~/Reports/Orders/ListOrderDetail?platform=")' + platform + '&website=' + website + '&account=' + account + '&start=' + $('#start').val() + '&end=' + $('#end').val() + '&col=' + colval + '&coltitle=' + coltitle + '&showsingle=' + single, '90%', '90%');
}
</script>
}

@{
ViewData["Title"] = "EbaySaleStatistics";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
ViewBag.Nav = new string[] { "统计", "Ebay", "Ebay销售统计" };
}
<div class="row">
<div class="col-sm-12">
<div class="ibox-content m-b-sm border-bottom">
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<label>销售帐号:</label>
<select id="saleaccount" name="saleaccount" class="form-control" style="width:160px;">
<option value="">选择帐号</option>
</select>
</div>
<div class="form-group">
<label>站点:</label>
<select id="website" name="website" class="form-control">
<option value="">选择站点</option>
</select>
</div>
<div class="form-group">
<label>仓库类型:</label>
<select id="warehousetype" name="warehousetype" class="form-control">
<option value="">选择仓库类型</option>
</select>
</div>
<div class="form-group">
<label>&nbsp;</label>
<select id="warehousecode" name="warehousecode" class="form-control">
<option value="">选择仓库</option>
</select>
</div>
<div class="form-group">
<label>付款时间</label>
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"))" />
<span>至</span>
<input id="end" name="end" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.ToString("yyyy-MM-dd"))" />
</div>
<div class="form-group">
<label>&nbsp;</label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i>&nbsp;查询</button>
</div>
</div>
</form>
</div>
<div class="ibox-content m-b-sm border-bottom">
<table id="roletable" style="table-layout:fixed;"></table>
</div>
</div>
</div>
@section css{
<style>
.mules {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.alink {
color: cornflowerblue;
cursor: pointer;
}
</style>
}
@section scripts{
<script type="text/javascript">
var tb;
$(document).ready(function () {
laydate.render({ elem: '#start' });
laydate.render({ elem: '#end' });
var height = document.body.clientHeight;
$("#roletable").attr("data-height", (height - 160));
list();
listAccount();
listWebsite();
listwarehousetype();
listwarehouse();
$('#warehousetype').change(function () {
listwarehouse();
})
})
function list() {
var columns = [
{ field: 'platform_type', title: '平台', width: '100', sortable: false },
{
field: 'seller_account', title: '销售帐号', width: '130', sortable: false, formatter: function (idx, data) {
var str = '<p class="mules" title="' + data.seller_account + '">' + data.seller_account + '</p>';
return str;
}
},
{ field: 'website', title: '站点', width: '80', sortable: false, iscount: true },
{
field: 'amount_product', title: '商品收入', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'商品收入\',\'amount_product\',1)">' + data.amount_product + '</span>';
}
},
{
field: 'cost_product', title: '产品成本', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'产品成本\',\'cost_product\',1)">' + data.cost_product + '</span>';
}
},
{
field: 'cost_platform_fee', title: '平台佣金费', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'平台佣金费\',\'cost_platform_fee\',1)">' + data.cost_platform_fee + '</span>';
}
},
{
field: 'cost_package', title: '包装费用', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'包装费用\',\'cost_package\',1)">' + data.cost_package + '</span>';
}
},
{
field: 'cost_paypal_fee', title: 'paypal费用', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'paypal费用\',\'cost_paypal_fee\',1)">' + data.cost_paypal_fee + '</span>';
}
},
{
field: 'cost_first', title: '头程费', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'头程费\',\'cost_first\',1)">' + data.cost_first + '</span>';
}
},
{
field: 'order_count', title: '销售数量', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account+ '\',\'订单数\',\'\',0)">' + data.order_count + '</span>';
}
},
{ field: 'loss_withdrawal', title: '提现损耗', width: '100', sortable: false, iscount: true },
{
field: 'cost_total', title: '总支出', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'总支出\',\'cost_total\',1)">' + data.cost_total + '</span>';
}
},
{
field: 'cost_shipping', title: '实际物流费', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'实际物流费\',\'cost_shipping\',1)">' + data.cost_shipping + '</span>';
}
},
{
field: 'amount_refund', title: '退款金额', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'退款金额\',\'amount_refund\',1)">' + data.amount_refund + '</span>';
}
},
{
field: 'amount_prepaid', title: '预收金额', width: '120', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'预收金额\',\'amount_prepaid\',1)">' + data.amount_prepaid + '</span>';
}
},
//{ field: 'forecast_profit_rate', title: '预测利润率%', width: '120', sortable: true },
{
field: 'profit_total', title: '实际利润', width: '120', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'实际利润\',\'profit_total\',1)">' + data.profit_total + '</span>';
}
},
{ field: 'profit_rate', title: '总实际利润率%', width: '130', sortable: true, iscount: true },
];
var url = '@Url.Content("~/Reports/Orders/EbaySaleStatisticsJson")' + '?' + $("#toolbar").serialize();
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", { showfooter: true, showCount: true });
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
function listAccount() {
$.submit({
url: '@Url.Content("~/Reports/Orders/ListAccount")',
type:'POST',
paramData: 'platform=Ebay',
func: function (result) {
if (result != null && result != undefined) {
$('#saleaccount').html('<option value="">选择帐号</option>');
for (var i = 0; i < result.length; i++) {
$('#saleaccount').append('<option value="' + result[i] + '">' + result[i]+'</option>');
}
}
}
})
}
function listWebsite() {
$.submit({
url: '@Url.Content("~/Reports/Orders/ListWebSite")',
type:'POST',
paramData: 'platform=Ebay',
func: function (result) {
if (result != null && result != undefined) {
$('#website').html('<option value="">选择站点</option>');
for (var i = 0; i < result.length; i++) {
$('#website').append('<option value="' + result[i] + '">' + result[i]+'</option>');
}
}
}
})
}
function listwarehousetype() {
$.submit({
url: '@Url.Content("~/Home/ListWarehouseType")',
type: 'POST',
paramData: '',
func: function (result) {
if (result != null && result != undefined) {
$('#warehousetype').html('<option value="">选择仓库类型</option>');
for (var i in result) {
$('#warehousetype').append('<option value="' + result[i] + '">' + result[i] + '</option>');
}
}
}
})
}
function listwarehouse() {
var wtype = $('#warehousetype').val();
$.submit({
url: '@Url.Content("~/Home/ListWareHouse")',
paramData: 'warehousetype=' + wtype,
type:'POST',
func: function (result) {
if (result != null && result != undefined) {
$('#warehousecode').html('<option value="">仓库不限</option>');
for (var i = 0; i < result.length; i++) {
$('#warehousecode').append('<option value="' + result[i].warehouse_code + '">' + result[i].warehouse_name + '</option>');
}
}
}
})
}
function ShowDetail(platform, website, account, coltitle, colval, single) {
layer_show(platform + " " + website + " " + $('#start').val() + "至" + $('#end').val() + ' 订单明细', '@Url.Content("~/Reports/Orders/ListOrderDetail?platform=")' + platform + '&website=' + website + '&account=' + account + '&start=' + $('#start').val() + '&end=' + $('#end').val() + '&col=' + colval + '&coltitle=' + coltitle + '&showsingle=' + single, '90%', '90%');
}
</script>
}
......@@ -31,7 +31,7 @@
</div>
<div class="form-group">
<label>付款时间</label>
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd"))" />
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"))" />
<span>至</span>
<input id="end" name="end" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.ToString("yyyy-MM-dd"))" />
</div>
......@@ -55,6 +55,10 @@
overflow: hidden;
text-overflow: ellipsis;
}
.alink {
color: cornflowerblue;
cursor: pointer;
}
</style>
}
@section scripts{
......@@ -76,50 +80,88 @@
function list() {
var columns = [
{ field: 'platform_type', title: '平台',width:'100',sortable:true },
{ field: 'platform_type', title: '平台', width: '100', sortable: false },
{
field: 'seller_account', title: '销售帐号', width: '130', sortable: true, formatter: function (idx, data) {
field: 'seller_account', title: '销售帐号', width: '130', sortable: false, formatter: function (idx, data) {
var str = '<p class="mules" title="' + data.seller_account + '">' + data.seller_account + '</p>';
return str;
}
},
{ field: 'website', title: '站点', width: '80', sortable: true, iscount: true },
{ field: 'amount_product', title: '商品收入', width: '100', sortable: true, iscount: true },
{ field: 'cost_product', title: '产品成本', width: '100', sortable: true, iscount: true },
{ field: 'platform_fee', title: '平台佣金费', width: '110', sortable: true, iscount: true },
{ field: 'head_fee', title: '头程费', width: '100', sortable: true, iscount: true },
{ field: 'order_count', title: '销售数量', width: '100', sortable: true, iscount: true },
{ field: 'loss_withdrawal', title: '提现损耗', width: '100', sortable: true },
{ field: 'cost_count', title: '总支出', width: '110', sortable: true, iscount: true },
{ field: 'nofba_forecast_logisticsfee', title: '预测物流费', width: '110', sortable: true, iscount: true },
{ field: 'nofba_logisticsfee', title: '实际物流费', width: '110', sortable: true, iscount: true },
{ field: 'forecast_profit_count', title: '预测利润', width: '110', sortable: true, iscount: true },
{ field: 'forecast_profit_rate', title: '预测利润率%', width: '120', sortable: true },
{ field: 'profit_count', title: '实际利润', width: '120', sortable: true, iscount: true },
{ field: 'profit_rate', title: '总实际利润率%', width: '130', sortable: true },
{ field: 'currency', title: '币种', width: '80' },
{ field: 'website', title: '站点', width: '80', sortable: false, iscount: true },
{
field: 'amount_product', title: '商品收入', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'商品收入\',\'amount_product\',1)">' + data.amount_product + '</span>';
}
},
{
field: 'cost_product', title: '产品成本', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'产品成本\',\'cost_product\',1)">' + data.cost_product + '</span>';
}
},
{
field: 'platform_fee', title: '平台佣金费', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'平台佣金费\',\'cost_platform_fee\',1)">' + data.platform_fee + '</span>';
}
},
{
field: 'cost_fba_fee', title: 'fba费用', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'fba费用\',\'cost_fba_fee\',1)">' + data.cost_fba_fee + '</span>';
}
},
{
field: 'cost_package', title: '包装费用', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'包装费用\',\'cost_package\',1)">' + data.cost_package + '</span>';
}
},
{
field: 'cost_paypal_fee', title: 'paypal费用', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'paypal费用\',\'cost_paypal_fee\',1)">' + data.cost_paypal_fee + '</span>';
}
},
{
field: 'head_fee', title: '头程费', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'头程费\',\'cost_first\',1)">' + data.head_fee + '</span>';
}
},
{
field: 'order_count', title: '销售数量', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account+ '\',\'订单数\',\'\',0)">' + data.order_count + '</span>';
}
},
{ field: 'loss_withdrawal', title: '提现损耗', width: '100', sortable: false, iscount: true },
{
field: 'cost_count', title: '总支出', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'总支出\',\'cost_total\',1)">' + data.cost_count + '</span>';
}
},
{
field: 'nofba_logisticsfee', title: '实际物流费', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'实际物流费\',\'cost_shipping\',1)">' + data.nofba_logisticsfee + '</span>';
}
},
{
field: 'amount_refund', title: '退款金额', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'退款金额\',\'amount_refund\',1)">' + data.amount_refund + '</span>';
}
},
{
field: 'amount_prepaid', title: '预收金额', width: '120', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'预收金额\',\'amount_prepaid\',1)">' + data.amount_prepaid + '</span>';
}
},
//{ field: 'forecast_profit_rate', title: '预测利润率%', width: '120', sortable: true },
{
field: 'profit_count', title: '实际利润', width: '120', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.platform_type + '\',\'' + data.website + '\',\'' + data.seller_account + '\',\'实际利润\',\'profit_total\',1)">' + data.profit_count + '</span>';
}
},
{ field: 'profit_rate', title: '总实际利润率%', width: '130', sortable: true, iscount: true },
];
var url = '@Url.Content("~/Reports/Orders/ListFBASaleStatisticsJson")' + '?' + $("#toolbar").serialize();
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
showfooter: true, loadsuccess: function (d) {
//替换汇总行的相关列值
var tr = $('.fixed-table-footer').find('tr');
for (var c in columns) {
var key = columns[c].field;
if (columns[c].iscount) {
for (var v in d.count_row) {
if (key == v) {
tr.find('td').eq(c).children('div').first().html(d.count_row[v]);
break;
}
}
}
}
}
});
tb = OnlyTable("roletable", columns, url, "", { showfooter: true, showCount: true });
}
else {
tb.bootstrapTable('refresh', { url: url });
......@@ -158,6 +200,10 @@
})
}
function ShowDetail(platform, website, account, coltitle, colval, single) {
layer_show(platform + " " + website + " " + $('#start').val() + "至" + $('#end').val() + ' 订单明细', '@Url.Content("~/Reports/Orders/ListOrderDetail?platform=")' + platform + '&website=' + website + '&account=' + account + '&start=' + $('#start').val() + '&end=' + $('#end').val() + '&col=' + colval + '&coltitle=' + coltitle + '&showsingle=' + single, '90%', '90%');
}
</script>
}
......
......@@ -31,7 +31,7 @@
</div>
<div class="form-group">
<label>付款时间</label>
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd"))" />
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"))" />
<span>至</span>
<input id="end" name="end" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.ToString("yyyy-MM-dd"))" />
</div>
......
......@@ -23,6 +23,12 @@
</select>
</div>
<div class="form-group">
<label>销售帐号:</label>
<select id="account" name="account" class="form-control">
<option value="">选择销售帐号</option>
</select>
</div>
<div class="form-group">
<label>付款时间</label>
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(ViewBag.start)" />
<span>至</span>
......@@ -62,7 +68,8 @@
var height = document.body.clientHeight;
$("#roletable").attr("data-height", (height - 170));
listAccount();
listPlatform();
})
......@@ -112,25 +119,30 @@
{ field: 'paid_time', title: '付款时间', width: '150', sortable: true }
];
var columns_single = [
{
field: 'origin_order_id', title: '平台单号', width: '160', formatter: function (idx, data) {
return '<div class="mules" title="' + data.origin_order_id + '">' + data.origin_order_id + '</div>';
}
},
{
field: 'bailun_order_id', title: '订单号', width: '210', iscount: true, formatter: function (idx, data) {
return '<div class="mules" title="' + data.bailun_order_id + '">' + data.bailun_order_id + '</div>';
}
},
{ field: 'platform_type', title: '平台', width: '100' },
{ field: 'website', title: '站点', width: '90' },
{ field: 'seller_account', title: '销售帐号', width: '110', sortable: false },
{
field: '@(ViewBag.col)', title: '@(ViewBag.coltitle)', width: '150', sortable: true, iscount: true
}
];
var url = '@Url.Content("~/Reports/Orders/ListOrderDetailJson")' + '?' + $("#toolbar").serialize();
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
showfooter: true, loadsuccess: function (d) {
//替换汇总行的相关列值
var tr = $('.fixed-table-footer').find('tr');
for (var c in columns) {
var key = columns[c].field;
if (columns[c].iscount) {
for (var v in d.count_row) {
if (key == v) {
tr.find('td').eq(c).children('div').first().html(d.count_row[v]);
break;
}
}
}
}
}
tb = OnlyTable("roletable", (@ViewBag.showsingle== 1 ? columns_single : columns), url, "", {
showfooter: true, showCount: true
});
}
else {
......@@ -182,6 +194,24 @@
})
}
function listAccount() {
$.submit({
type: 'POST',
url: '@Url.Content("~/Reports/Orders/ListAccount")',
paramData: 'platform=@(ViewBag.platform)',
func: function (result) {
if (result != null && result != undefined) {
$('#account').html('<option value="">选择平台</option>');
for (var i = 0; i < result.length; i++) {
$('#account').append('<option value="' + result[i] + '">' + result[i]+'</option>');
}
$('#account').val('@ViewBag.account');
}
}
})
}
</script>
......
......@@ -38,7 +38,7 @@
</div>
<div class="form-group">
<label>付款时间</label>
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd"))" />
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"))" />
<span>至</span>
<input id="end" name="end" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.ToString("yyyy-MM-dd"))" />
</div>
......
......@@ -18,9 +18,9 @@
</div>
<div class="form-group">
<label>付款时间</label>
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.ToString("yyyy-MM-dd"))" />
<input id="start" name="start" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"))" />
<span>至</span>
<input id="end" name="end" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.ToString("yyyy-MM-dd"))" />
<input id="end" name="end" type="text" class="form-control" style="width:130px;" value="@(DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd"))" />
</div>
<div class="form-group">
<label>&nbsp;</label>
......@@ -63,6 +63,7 @@
overflow: hidden;
text-overflow: ellipsis;
}
.alink{color:cornflowerblue;cursor:pointer;}
</style>
}
@section scripts{
......@@ -92,23 +93,23 @@
$('#tb').html('');
for (var i = 0; i < result.length; i++) {
var s = '<tr><td class="platform"><a href="javascript:;" onclick="ShowWebsite(\'' + result[i].platform+'\');">' + result[i].platform + '</a></td>';
s += '<td title="' + result[i].platform+'">' + result[i].ordercount + '</td>';
s += '<td title="' + result[i].platform +'">' + result[i].saleamount + '</td>';
s += '<td title="' + result[i].platform +'">' + result[i].customerprice + '</td>';
s += '<td title="' + result[i].platform +'">' + result[i].platformfee + '</td>';
s += '<td title="' + result[i].platform +'">' + result[i].cost_first + '</td>';
s += '<td title="' + result[i].platform +'">' + result[i].cost_tail + '</td>';
s += '<td title="' + result[i].platform +'">' + result[i].cost_handle_bailun + '</td>';
s += '<td title="' + result[i].platform + '">' + result[i].cost_handle_platform + '</td>';
s += '<td title="' + result[i].platform + '">' + result[i].amount_prepaid + '</td>';
s += '<td title="' + result[i].platform +'">' + result[i].profit + '</td>';
s += '<td title="' + result[i].platform +'">' + result[i].profitrate + '</td>';
s += '<td title="' + result[i].platform +'">' + result[i].returnamount + '</td>';
s += '<td title="' + result[i].platform +'">' + result[i].returnamountrate + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform + '\',\'订单数\',\'\',0)">' + result[i].ordercount + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform + '\',\'销售额\',\'amount_total\',1)">' + result[i].saleamount + '</td>';
s += '<td>' + result[i].customerprice + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform + '\',\'平台费用\',\'cost_platform_fee\',1)">' + result[i].platformfee + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform + '\',\'头程费\',\'cost_first\',1)">' + result[i].cost_first + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform + '\',\'尾程费\',\'cost_tail\',1)">' + result[i].cost_tail + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform + '\',\'处理费(百伦)\',\'cost_handle_bailun\',1)">' + result[i].cost_handle_bailun + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform + '\',\'平台操作费\',\'cost_handle_platform\',1)">' + result[i].cost_handle_platform + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform + '\',\'预收款\',\'amount_prepaid\',1)">' + result[i].amount_prepaid + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform + '\',\'利润\',\'profit_total\',1)">' + result[i].profit + '</td>';
s += '<td>' + result[i].profitrate + '</td>';
s += '<td class="alink" onclick="ShowDetail(\'' + result[i].platform + '\',\'退款金额\',\'amount_refund\',1)">' + result[i].returnamount + '</td>';
s += '<td>' + result[i].returnamountrate + '</td>';
$('#tb').append(s);
}
$('#tb').find('td').each(function () {
@*$('#tb').find('td').each(function () {
$(this).css('cursor', 'pointer');
var platformcode = $(this).attr('title');
......@@ -119,7 +120,7 @@
})
}
})
})*@
}
else {
layer.alert('没有找到相应数据!');
......@@ -156,6 +157,10 @@
layer_show(platform + ' 按站点统计', '@Url.Content("~/Reports/Orders/PlatformProfitCountByWebSite?platform=")' + platform + '&start=' + start + '&end=' + end, '90%', '90%');
}
function ShowDetail(platform, coltitle, colval, single) {
layer_show(platform + " " + $('#start').val() + "至" + $('#end').val() + ' 订单明细', '@Url.Content("~/Reports/Orders/ListOrderDetail?platform=")' + platform + '&start=' + $('#start').val() + '&end=' + $('#end').val() + '&col=' + colval + '&coltitle=' + coltitle + '&showsingle=' + single, '90%', '90%');
}
</script>
......
......@@ -38,6 +38,10 @@
overflow: hidden;
text-overflow: ellipsis;
}
.alink {
color: cornflowerblue;
cursor: pointer;
}
</style>
}
@section scripts{
......@@ -61,68 +65,68 @@
{ field: 'website', title: '站点', width: '90', iscount: true },
{
field: 'ordercount', title: '订单数', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.ordercount + '</span>';
return '<span class="alink" onclick="ShowDetail(\'' + data.website + '\',\'订单数\',\'\',0)">' + data.ordercount + '</span>';
}
},
{
field: 'saleamount', title: '销售额', width: '90', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.saleamount + '</span>';
return '<span class="alink" onclick="ShowDetail(\'' + data.website + '\',\'销售额\',\'amount_total\',1)">' + data.saleamount + '</span>';
}
},
{
field: 'customerprice', title: '客单价', width: '90', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.customerprice + '</span>';
return '<span>' + data.customerprice + '</span>';
}
},
{
field: 'platformfee', title: '平台费', width: '90', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.platformfee + '</span>';
return '<span class="alink" onclick="ShowDetail(\'' + data.website + '\',\'平台费用\',\'cost_platform_fee\',1)">' + data.platformfee + '</span>';
}
},
{
field: 'cost_first', title: '头程费', width: '90', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.cost_first + '</span>';
return '<span class="alink" onclick="ShowDetail(\'' + data.website + '\',\'头程费\',\'cost_first\',1)">' + data.cost_first + '</span>';
}
},
{
field: 'cost_tail', title: '尾程费', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.cost_tail + '</span>';
return '<span class="alink" onclick="ShowDetail(\'' + data.website + '\',\'尾程费\',\'cost_tail\',1)">' + data.cost_tail + '</span>';
}
},
{
field: 'cost_handle_bailun', title: '处理费(百伦)', width: '120', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.cost_handle_bailun + '</span>';
field: 'cost_handle_bailun', title: '处理费', width: '120', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span class="alink" onclick="ShowDetail(\'' + data.website + '\',\'处理费\',\'cost_handle_bailun\',1)">' + data.cost_handle_bailun + '</span>';
}
},
{
field: 'cost_handle_platform', title: '平台操作费', width: '120', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.cost_handle_platform + '</span>';
return '<span class="alink" onclick="ShowDetail(\'' + data.website + '\',\'平台操作费\',\'cost_handle_platform\',1)">' + data.cost_handle_platform + '</span>';
}
},
{
field: 'amount_prepaid', title: '预收款', width: '100', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.amount_prepaid + '</span>';
return '<span class="alink" onclick="ShowDetail(\'' + data.website + '\',\'预收款\',\'amount_prepaid\',1)">' + data.amount_prepaid + '</span>';
}
},
{
field: 'profit', title: '利润', width: '90', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.profit + '</span>';
return '<span class="alink" onclick="ShowDetail(\'' + data.website + '\',\'利润\',\'profit_total\',1)">' + data.profit + '</span>';
}
},
{
field: 'profitrate', title: '利润率%', width: '110', sortable: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.profitrate + '</span>';
return '<span>' + data.profitrate + '</span>';
}
},
{
field: 'returnamount', title: '退款额', width: '110', sortable: true, iscount: true, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.returnamount + '</span>';
return '<span class="alink" onclick="ShowDetail(\'' + data.website + '\',\'退款金额\',\'amount_refund\',1)">' + data.returnamount + '</span>';
}
},
{
field: 'returnamountrate', title: '退款率%', width: '100', sortable: true
, formatter: function (idx, data) {
return '<span onclick="ShowDetail(\'' + data.website + '\')" style="cursor:pointer;">' + data.returnamountrate + '</span>';
return '<span>' + data.returnamountrate + '</span>';
}
}
];
......@@ -170,12 +174,16 @@
})
}
function ShowDetail(website) {
@*function ShowDetail(website) {
var start = $('#start').val();
var end = $('#end').val();
layer_show("@(ViewBag.platform) " + website + " " + $('#start').val() + "至" + $('#end').val() + ' 订单明细', '@Url.Content("~/Reports/Orders/ListOrderDetail?platform="+ViewBag.platform)' + '&start=' + $('#start').val() + '&end=' + $('#end').val() + '&website=' + website, '90%', '90%');
}*@
function ShowDetail(website, coltitle, colval, single) {
layer_show("@(ViewBag.platform) " + website + " " + $('#start').val() + "至" + $('#end').val() + ' 订单明细', '@Url.Content("~/Reports/Orders/ListOrderDetail?platform="+ ViewBag.platform)' + '&website=' + website + '&start=' + $('#start').val() + '&end=' + $('#end').val() + '&col=' + colval + '&coltitle=' + coltitle + '&showsingle=' + single, '90%', '90%');
}
......
......@@ -13,6 +13,13 @@ namespace Bailun.DC.Web.Controllers
return View();
}
[HttpPost]
public JsonResult ListWarehouseType()
{
var result = new Services.WareHouseServices().ListWareHouseType().Where(a=>!string.IsNullOrEmpty(a));
return Json(result);
}
/// <summary>
/// 获取仓库列表
/// </summary>
......
......@@ -180,6 +180,11 @@
</a>
<ul class="nav nav-third-level">
<li>
<a class="J_menuItem" href="@Url.Content("~/Reports/Orders/EbaySaleStatistics")" data-index="0" style="padding-left:74px;">
<span>Ebay销售统计</span>
</a>
</li>
<li>
<a class="J_menuItem" href="@Url.Content("~/Reports/Orders/ListOrder?platform=Ebay")" data-index="0" style="padding-left:74px;">
<span>订单流水</span>
</a>
......
......@@ -83,7 +83,7 @@
<!--下拉选择搜索控件-->
<script src="/css/bootstrap-select-1.12.4/js/bootstrap-select.js"></script>
<!--常用js方法-->
<script src="/js/common.js?=201902280912"></script>
<script src="/js/common.js?=201903011812"></script>
@RenderSection("scripts", required: false)
<script type="text/javascript">
......
......@@ -43,7 +43,7 @@ function OnlyTable(tableId, aoColumn, actionUrl, serverParams,tbParams) {
paginationNextText: "下一页",
paginationLastText: "最后页",
onLoadSuccess: function (data) {
if (tbParams.showCount) {
if (tbParams != undefined && tbParams.showCount) {
//替换汇总行的相关列值
var tr = $('.fixed-table-footer').find('tr');
for (var c in aoColumn) {
......
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