Commit 08a4cf3d by guanzhenshan

1、调整应收账款服务,2、采购单明细接口增加字段

parent e4a1056b
......@@ -71,7 +71,7 @@ namespace Bailun.DC.DailyPlatformReceivable
var sql = $"select * from dc_daily_receivable where day='{day.AddDays(-1).ToString("yyyy-MM-dd")}' and platform='Ebay'";
var objBefore = cn.QueryFirstOrDefault<dc_daily_receivable>(sql);
//本期收款
sql = $"select sum(amount_sales*seller_order_exchange_rate) amount from dc_base_oms_order where platform_type='Ebay' and paid_time>='{day.ToString("yyyy-MM-dd")}' and paid_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and company_id=1 and bailun_order_status!='Canceled' and has_scalp=0 and has_innersale=0";
sql = $"select sum(amount_sales*seller_order_exchange_rate) amount from dc_base_oms_order where platform_type='Ebay' and paid_time>='{day.ToString("yyyy-MM-dd")}' and paid_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and company_id=1 and bailun_order_status!='Canceled' and has_scalp=0 and has_innersale=0 and bailun_interception_status in ('None','Failed')";
var EbaySales = cn.QueryFirstOrDefault<decimal?>(sql)??0;
//发货金额
sql = $@"select sum(t1.amount_sales*t2.quantity_shipped*t1.seller_order_exchange_rate) amount
......@@ -138,10 +138,10 @@ namespace Bailun.DC.DailyPlatformReceivable
//非Ebay 平台费,按付款时间
sql = $@"select * from (
select t1.platform_type,sum(t1.cost_platform_fee*t1.seller_order_exchange_rate*t1.bailun_sku_quantity_ordered) cost_platform_fee,0 as cost_fba_fee
from dc_base_oms_sku t1 where t1.has_scalp=0 and t1.has_delete=0 and t1.has_innersale=0 and t1.bailun_order_status!='Canceled' and t1.has_innersale=0 and t1.company_id=1 and t1.platform_type!='Ebay' and t1.platform_type!='FBA' and t1.paid_time>='{day.ToString("yyyy-MM-dd")}' and t1.paid_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}'
from dc_base_oms_sku t1 where t1.has_scalp=0 and t1.has_delete=0 and t1.has_innersale=0 and t1.bailun_order_status!='Canceled' and t1.has_innersale=0 and t1.company_id=1 and t1.platform_type!='Ebay' and t1.platform_type!='FBA' and t1.paid_time>='{day.ToString("yyyy-MM-dd")}' and t1.paid_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and t1.bailun_interception_status in ('None','Failed') and (t1.platform_type!='FBA' and t1.bailun_order_status!='CantHandle')
group by platform_type
union all
select platform_type,sum((cost_platform_fee+cost_fba_fee)*seller_order_exchange_rate) cost_platform_fee,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee from dc_base_oms_order where platform_type='FBA' and create_time>='{day.ToString("yyyy-MM-dd")}' and create_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and company_id=1 and bailun_order_status!='Canceled' and has_scalp=0 and has_innersale=0
select platform_type,sum((cost_platform_fee+cost_fba_fee)*seller_order_exchange_rate) cost_platform_fee,sum(cost_fba_fee*seller_order_exchange_rate) cost_fba_fee from dc_base_oms_order where platform_type='FBA' and create_time>='{day.ToString("yyyy-MM-dd")}' and create_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and company_id=1 and bailun_order_status!='Canceled' and has_scalp=0 and has_innersale=0 and bailun_interception_status in ('None','Failed')
) tb";
var listPlatformFee = cn.Query<platformamount>(sql);
......@@ -164,7 +164,7 @@ namespace Bailun.DC.DailyPlatformReceivable
sql = $"select * from dc_daily_receivable where day='{day.AddDays(-1).ToString("yyyy-MM-dd")}' and platform='{item}'";
objBefore = cn.QueryFirstOrDefault<dc_daily_receivable>(sql);
var obj = listAmount.Where(a => a.platform_type == item).FirstOrDefault();
var obj = listAmount.Where(a => a.platform_type.ToLower() == item.ToLower()).FirstOrDefault();
var objPlatformFee = listPlatformFee.Where(a => a.platform_type.ToLower() == item.ToLower()).FirstOrDefault();
......@@ -237,7 +237,7 @@ namespace Bailun.DC.DailyPlatformReceivable
//放款金额
var objIncome = listIncome.Where(a => a.platform_type == item).FirstOrDefault();
var objIncome = listIncome.Where(a => a.platform_type.ToLower() == item.ToLower()).FirstOrDefault();
if (item.ToLower() == "amazon")
{
var objAmazonIncome = listIncome.Where(a => a.platform_type.ToLower() == "fba" || a.platform_type.ToLower() == "amazon");
......@@ -255,7 +255,7 @@ namespace Bailun.DC.DailyPlatformReceivable
//退款金额
var objRefund = listRefund.Where(a => a.platform_type == item).FirstOrDefault();
var objRefund = listRefund.Where(a => a.platform_type.ToLower() == item.ToLower()).FirstOrDefault();
if (item.ToLower() == "amazon")
{
var objAmazonRefund = listRefund.Where(a => a.platform_type.ToLower() == "fba" || a.platform_type.ToLower() == "amazon");
......
......@@ -215,5 +215,26 @@ namespace Bailun.DC.Models
public int isallot { get; set; }
public decimal amount { get; set; }
/// <summary>
/// 付款方式 1先款后货,2先货后款,3无需付款
/// </summary>
public int pay_type { get; set; }
/// <summary>
/// 付款状态 0:未付款,1:部分付款,2:已付款,3无需付款
/// </summary>
public int pay_status { get; set; }
/// <summary>
/// 最后签收时间
/// </summary>
public DateTime? last_signtime { get; set; }
/// <summary>
/// 到货状态 0:未到货,1:部分到货,2:全部到货,3:部分到货不等待剩余
/// </summary>
public int arrival_status { get; set; }
}
}
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
......
......@@ -29,8 +29,8 @@
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
<script type="text/javascript">
//login_localhost();
login();
login_localhost();
//login();
window.location = "@Url.Content("~/Home/Main")";
</script>
</body>
......
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