Commit 68133b63 by guanzhenshan

调整应收帐号页面和统计服务

parent 04096dde
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Bailun.DC.Common\Bailun.DC.Common.csproj" /> <ProjectReference Include="..\Bailun.DC.Common\Bailun.DC.Common.csproj" />
<ProjectReference Include="..\Bailun.DC.Models\Bailun.DC.Models.csproj" /> <ProjectReference Include="..\Bailun.DC.Models\Bailun.DC.Models.csproj" />
<ProjectReference Include="..\Bailun.DC.Services\Bailun.DC.Services.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>
...@@ -23,7 +23,7 @@ namespace Bailun.DC.DailyPlatformReceivable ...@@ -23,7 +23,7 @@ namespace Bailun.DC.DailyPlatformReceivable
// var _services = new Services(); // var _services = new Services();
// var start = DateTime.Parse("2020-01-01"); // var start = DateTime.Parse("2020-02-01");
// while (start.AddDays(1) < DateTime.Now) // while (start.AddDays(1) < DateTime.Now)
// { // {
// Console.WriteLine(start); // Console.WriteLine(start);
......
...@@ -1879,7 +1879,7 @@ namespace Bailun.DC.Services ...@@ -1879,7 +1879,7 @@ namespace Bailun.DC.Services
cn.Open(); cn.Open();
} }
var sql = $"select sum(case when platform != 'Ebay' then amount_end else 0 end) - sum(case when platform = 'Ebay' then amount_end else 0 end) as amount from dc_daily_receivable where day = '{date.ToString("yyyy-MM-dd")}'"; var sql = $"select sum(case when (platform != 'Ebay' and platform != 'shopify') then amount_end else -amount_end end) as amount from dc_daily_receivable where day = '{date.ToString("yyyy-MM-dd")}'";
var objRec = cn.QueryFirstOrDefault<decimal?>(sql); var objRec = cn.QueryFirstOrDefault<decimal?>(sql);
//sql = $"select sum((amount - ifnull(had_pay, 0) + ifnull(compensate, 0)) * to_rmb_rate) from dc_daily_fee where recoed_time = '{date.ToString("yyyy-MM-dd")}' and company_value in (53,3,5,60,66,59,50,8,1,61,2,70)"; //sql = $"select sum((amount - ifnull(had_pay, 0) + ifnull(compensate, 0)) * to_rmb_rate) from dc_daily_fee where recoed_time = '{date.ToString("yyyy-MM-dd")}' and company_value in (53,3,5,60,66,59,50,8,1,61,2,70)";
...@@ -1907,7 +1907,7 @@ namespace Bailun.DC.Services ...@@ -1907,7 +1907,7 @@ namespace Bailun.DC.Services
cn.Open(); cn.Open();
} }
var sql = $"select (case when platform != 'Ebay' then amount_end else -amount_end end) as amount_end,day,platform from dc_daily_receivable where day = '{date.ToString("yyyy-MM-dd")}'"; var sql = $"select (case when (platform != 'Ebay' and platform != 'shopify') then amount_end else -amount_end end) as amount_end,day,platform from dc_daily_receivable where day = '{date.ToString("yyyy-MM-dd")}'";
var obj = cn.Page<dc_daily_receivable>(request.pageIndex, request.limit, sql, ref total, null, null, 2 * 60).ToList(); var obj = cn.Page<dc_daily_receivable>(request.pageIndex, request.limit, sql, ref total, null, null, 2 * 60).ToList();
...@@ -5230,15 +5230,15 @@ group by currency"; ...@@ -5230,15 +5230,15 @@ group by currency";
if (type == 1) //Ebay if (type == 1) //Ebay
{ {
sql += " and platform='Ebay'"; sql += " and platform in ('Ebay','shopify') ";
sql_start += " and platform='Ebay'"; sql_start += " and platform in ('Ebay','shopify') ";
sql_end += " and platform='Ebay'"; sql_end += " and platform in ('Ebay','shopify') ";
} }
else if (type == 2) //非Ebay else if (type == 2) //非Ebay
{ {
sql += " and platform!='Ebay'"; sql += " and platform!='Ebay' and platform!='shopify' ";
sql_start += " and platform!='Ebay'"; sql_start += " and platform!='Ebay' and platform!='shopify' ";
sql_end += " and platform!='Ebay'"; sql_end += " and platform!='Ebay' and platform!='shopify' ";
} }
sql += " group by platform"; sql += " group by platform";
...@@ -5302,11 +5302,11 @@ group by currency"; ...@@ -5302,11 +5302,11 @@ group by currency";
if (type == 1) //Ebay if (type == 1) //Ebay
{ {
sql += " and platform='Ebay'"; sql += " and platform in('Ebay','shopify') ";
} }
else if (type == 2) //非Ebay else if (type == 2) //非Ebay
{ {
sql += " and platform!='Ebay'"; sql += " and platform!='Ebay' and platform!='shopify' "; ;
} }
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
...@@ -5343,11 +5343,11 @@ group by currency"; ...@@ -5343,11 +5343,11 @@ group by currency";
if (type == 1) //Ebay if (type == 1) //Ebay
{ {
sql += " and platform='Ebay'"; sql += " and platform in ('Ebay','shopify') ";
} }
else if (type == 2) //非Ebay else if (type == 2) //非Ebay
{ {
sql += " and platform!='Ebay'"; sql += " and platform!='Ebay' and platform!='shopify' ";
} }
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString)) using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
...@@ -5403,7 +5403,7 @@ group by currency"; ...@@ -5403,7 +5403,7 @@ group by currency";
} }
if (obj.platform.ToLower() == "ebay") if (obj.platform.ToLower() == "ebay" || obj.platform.ToLower() == "shopify")
{ {
//期初预收余额+本期收款(订单付款金额)-发货金额-退款(未发货的)+其他 //期初预收余额+本期收款(订单付款金额)-发货金额-退款(未发货的)+其他
obj.amount_end = obj.amount_start + obj.amount_sale_pay - obj.amount_shipping - obj.amount_refund + obj.amount_other; obj.amount_end = obj.amount_start + obj.amount_sale_pay - obj.amount_shipping - obj.amount_refund + obj.amount_other;
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
<div class="form-inline" style="line-height:40px;"> <div class="form-inline" style="line-height:40px;">
<div class="form-group"> <div class="form-group">
<label>类型</label> <label>类型</label>
<select id="type" name="type" class="form-control" style="width:100px;"> <select id="type" name="type" class="form-control" style="width:160px;">
<option value="1">Ebay</option> <option value="1">Ebay和shopify</option>
<option value="2">非Ebay</option> <option value="2">非Ebay</option>
</select> </select>
</div> </div>
......
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