sql=$@"select sum(amount_sales*quantity_shipped*seller_order_exchange_rate) as amount_sales,sum(cost_product*quantity_shipped) as cost_product,sum(cost_platform_fee*(if(platform_type='Ebay',seller_other_exchange_rate,seller_order_exchange_rate))*quantity_shipped) as cost_platform_fee,sum(cost_paypal_fee*seller_order_exchange_rate*quantity_shipped) as cost_paypal_fee,sum(cost_first*quantity_shipped) as cost_first,sum(cost_logistics*quantity_shipped) as cost_logistics,sum(cost_handle_platform*quantity_shipped) as cost_handle_platform,if(financecategoryname is null,'',financecategoryname) as financecategoryname,((total_fee-shipping)*wms_to_cny_exchange_rate*quantity_shipped) as total_fee from dc_month_sales_profit_orderdetail where month='{day.ToString("yyyy-MM")}' and platform_type='FBA' group by financecategoryname";
sql=$@"select sum(amount_sales*quantity_shipped*seller_order_exchange_rate) as amount_sales,sum(cost_product*quantity_shipped) as cost_product,sum(cost_platform_fee*(if(platform_type='Ebay',seller_other_exchange_rate,seller_order_exchange_rate))*quantity_shipped) as cost_platform_fee,sum(cost_paypal_fee*seller_order_exchange_rate*quantity_shipped) as cost_paypal_fee,sum(cost_first*quantity_shipped) as cost_first,sum(cost_logistics*quantity_shipped) as cost_logistics,sum(cost_handle_platform*quantity_shipped) as cost_handle_platform,if(financecategoryname is null,'',financecategoryname) as financecategoryname,sum((total_fee-shipping)*wms_to_cny_exchange_rate*quantity_shipped) as total_fee,sum(cost_fba_fee*quantity_shipped*seller_order_exchange_rate) as cost_fba_fee from dc_month_sales_profit_orderdetail where month='{day.ToString("yyyy-MM")}' and platform_type='FBA' group by financecategoryname";
varobjFirst=cn.QueryFirstOrDefault<decimal>($"select sum(estimatedcost) from dc_base_transfer_info where isdeleted=0 and stateid>1 and deliverytime >='{day.ToString("yyyy-MM-dd")}' and deliverytime<'{day.AddMonths(1).ToString("yyyy-MM-dd")}'");
//var objFirst = cn.QueryFirstOrDefault<decimal>($"select sum(estimatedcost) from dc_base_transfer_info where isdeleted=0 and stateid>1 and deliverytime >='{day.ToString("yyyy-MM-dd")}' and deliverytime<'{day.AddMonths(1).ToString("yyyy-MM-dd")}'");
m.fee_paycash_sales=list.Where(a=>(a.fee_super_type=="推广费"||a.fee_super_type=="物流费用")&&!a.company_name.Contains("香港百伦")&&!a.company_name.Contains("四千里")&&!a.company_name.Contains("YOUNGTOP INTERNATIONAL LIMITED")&&!a.company_name.Contains("miles")&&!a.company_name.Contains("拉古娜")&&!a.company_name.Contains("哈倪蔓"))?.Sum(a=>a.amount_rmb)??0;