Commit 04916595 by guanzhenshan

解决平台费不对的问题

parent 9c02058b
...@@ -23,7 +23,7 @@ namespace Bailun.DC.MonthSaleProfit ...@@ -23,7 +23,7 @@ namespace Bailun.DC.MonthSaleProfit
// var _services = new Services(); // var _services = new Services();
// var start = DateTime.Parse("2019-11-01"); // var start = DateTime.Parse("2019-11-01");
// _services.Init(start); // _services.Update(start);
//} //}
} }
} }
...@@ -281,7 +281,7 @@ namespace Bailun.DC.MonthSaleProfit ...@@ -281,7 +281,7 @@ namespace Bailun.DC.MonthSaleProfit
//平台费 //平台费
m.pt_platformfee = objOrder.cost_platform_fee; m.pt_platformfee = objOrder.cost_platform_fee;
//FBA //FBA
m.pt_platformfee += (objOrder.cost_platform_fee); m.pt_platformfee += (objFBA.cost_platform_fee);
//ebay刊登费 //ebay刊登费
sql = $@"select sum(t1.exchange_rate*t1.gross_amount) sql = $@"select sum(t1.exchange_rate*t1.gross_amount)
...@@ -302,21 +302,21 @@ namespace Bailun.DC.MonthSaleProfit ...@@ -302,21 +302,21 @@ namespace Bailun.DC.MonthSaleProfit
//ebay //ebay
sql = $@"select sum(t1.exchange_rate*t1.gross_amount) from dc_base_finance_ebay t1 sql = $@"select sum(t1.exchange_rate*t1.gross_amount) from dc_base_finance_ebay t1
join dc_base_company_account t2 on t1.company_id=t2.company_id and t1.account_id=t2.account_id join dc_base_company_account t2 on t1.company_id=t2.company_id and t1.account_id=t2.account_id
where t1.account_entry_type in ('FeeAd') and t1.bj_date>='{day.ToString("yyyy-MM-dd")}' and t1.bj_date<'{day.AddMonths(1).ToString("yyyy-MM-dd")}' and t1.company_id=1"; where t1.account_entry_type in ('FeeAd') and t1.bj_date>='{start.ToString("yyyy-MM-dd")}' and t1.bj_date<'{start.AddMonths(1).ToString("yyyy-MM-dd")}' and t1.company_id=1";
obj = cn.QueryFirstOrDefault<decimal?>(sql, null, null, 2 * 60); obj = cn.QueryFirstOrDefault<decimal?>(sql, null, null, 2 * 60);
m.pt_platform_ad_subscribe_fee = obj ?? 0; m.pt_platform_ad_subscribe_fee = obj ?? 0;
//amazon //amazon
sql = $@"select sum(t1.cost*t1.exchange_rate) from dc_base_finance_amazon_ad_product t1 sql = $@"select sum(t1.cost*t1.exchange_rate) from dc_base_finance_amazon_ad_product t1
join dc_base_company_account t2 on t1.account_id=t2.account_id join dc_base_company_account t2 on t1.account_id=t2.account_id
where t1.report_date>='{day.ToString("yyyy-MM-dd")}' and t1.report_date<'{day.AddMonths(1).ToString("yyyy-MM-dd")}' and t1.company_id=1"; where t1.report_date>='{start.ToString("yyyy-MM-dd")}' and t1.report_date<'{start.AddMonths(1).ToString("yyyy-MM-dd")}' and t1.company_id=1";
obj = cn.QueryFirstOrDefault<decimal?>(sql, null, null, 2 * 60); obj = cn.QueryFirstOrDefault<decimal?>(sql, null, null, 2 * 60);
m.pt_platform_ad_subscribe_fee += (obj ?? 0); m.pt_platform_ad_subscribe_fee += (obj ?? 0);
m.pt_platform_ad_subscribe_fee += m.pt_platform_ad_subscribe_fee_; m.pt_platform_ad_subscribe_fee += m.pt_platform_ad_subscribe_fee_;
//退款 //退款
sql = $@"select sum(t1.amount_refund_rmb) from dc_base_crm_refund t1 where t1.shipping_status='TotalShipping' and t1.is_deleted=0 and is_freeze=0 and t1.company_id=1 and t1.refund_time>='{day.ToString("yyyy-MM-dd")}' and t1.refund_time<'{day.AddMonths(1).ToString("yyyy-MM-dd")}' and t1.shipping_status!='UnShipping'"; sql = $@"select sum(t1.amount_refund_rmb) from dc_base_crm_refund t1 where t1.shipping_status='TotalShipping' and t1.is_deleted=0 and is_freeze=0 and t1.company_id=1 and t1.refund_time>='{start.ToString("yyyy-MM-dd")}' and t1.refund_time<'{start.AddMonths(1).ToString("yyyy-MM-dd")}' and t1.shipping_status!='UnShipping'";
obj = cn.QueryFirstOrDefault<decimal?>(sql, null, null, 2 * 60); obj = cn.QueryFirstOrDefault<decimal?>(sql, null, null, 2 * 60);
m.pt_refund_amount = obj ?? 0; m.pt_refund_amount = obj ?? 0;
......
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