Commit 8833b95a by guanzhenshan

采购单详情接口增加采购单总金额、已付款额、快递费金额

parent 606457a0
......@@ -75,18 +75,18 @@ namespace Bailun.DC.DailyLogisticSupplierTransaction
cn.Execute($"delete from dc_daily_logistics_supplier_transaction where day='{day.ToString("yyyy-MM-dd")}'");
//发生额
var sql = $"select t1.company_name,sum(t1.merchant_shipment_cost_cny) as merchant_shipment_cost_cny from dc_base_logistics t1 where ((t1.reconciliation_type='跟踪号对账' and t1.diff_state_type!=0) or (t1.reconciliation_type='单独费用')) and t1.merchant_reconciliation_time='{day.ToString("yyyy-MM-dd")}' group by t1.company_name";
var sql = $"select t1.company_name,sum(t1.merchant_shipment_cost_cny) as merchant_shipment_cost_cny from dc_base_logistics t1 where ((t1.reconciliation_type='跟踪号对账' and t1.diff_state_type!=0) or (t1.reconciliation_type='单独费用')) and t1.merchant_reconciliation_time='{day.ToString("yyyy-MM-dd")}' and t1.company_name!='广州嘉和货运代理有限公司' group by t1.company_name";
listHappen = cn.Query<Models.dc_base_logistics>(sql).AsList();
//付款额
sql = $@"select t1.receive_unit as company_name,sum(t1.amount_rmb) as merchant_shipment_cost_cny from dc_base_finance_logistics t1
where t1.no in (select DISTINCT t2.fee_code from dc_base_logistics t2 where t2.fee_code in (select t1.`no` from dc_base_finance_logistics t1 where t1.pay_time>='{day.ToString("yyyy-MM-dd")}' and t1.pay_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and t1.amount_rmb>=0))
where t1.no in (select DISTINCT t2.fee_code from dc_base_logistics t2 where t2.fee_code in (select t1.`no` from dc_base_finance_logistics t1 where t1.pay_time>='{day.ToString("yyyy-MM-dd")}' and t1.pay_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and t1.amount_rmb>=0 and t1.receive_unit!='广州嘉和货运代理有限公司'))
group by t1.receive_unit";
listPay = cn.Query<dc_base_logistics>(sql).AsList();
//收款额
sql = $@"select t1.receive_unit as company_name,sum(t1.amount_rmb) as merchant_shipment_cost_cny from dc_base_finance_logistics t1
where t1.no in (select DISTINCT t2.fee_code from dc_base_logistics t2 where t2.fee_code in (select t1.`no` from dc_base_finance_logistics t1 where t1.pay_time>='{day.ToString("yyyy-MM-dd")}' and t1.pay_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and t1.amount_rmb<0))
where t1.no in (select DISTINCT t2.fee_code from dc_base_logistics t2 where t2.fee_code in (select t1.`no` from dc_base_finance_logistics t1 where t1.pay_time>='{day.ToString("yyyy-MM-dd")}' and t1.pay_time<'{day.AddDays(1).ToString("yyyy-MM-dd")}' and t1.amount_rmb<0 and t1.receive_unit!='广州嘉和货运代理有限公司'))
group by t1.receive_unit";
listRecevice = cn.Query<dc_base_logistics>(sql).AsList();
......
......@@ -9,30 +9,30 @@ namespace Bailun.DC.HappenAmount
{
class Program
{
static async Task Main(string[] args)
{
Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
{
services.AddHostedService<Services>();
});
await builder.RunConsoleAsync();
}
//static void Main(string[] args)
//static async Task Main(string[] args)
//{
// var start = DateTime.Parse("2020-04-19");
// while (start.AddDays(1) < DateTime.Now)
// Console.WriteLine("启动服务 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
// var builder = new HostBuilder().ConfigureServices((hostContext, services) =>
// {
// new Services().Init(start, start.AddDays(1));
// //new Bailun.DC.Services.FinanceReportServices().AddLogisticsWaitPay(start, 0);
// start = start.AddDays(1);
// services.AddHostedService<Services>();
// });
// await builder.RunConsoleAsync();
//}
static void Main(string[] args)
{
var start = DateTime.Parse("2020-05-19");
while (start.AddDays(1) < DateTime.Now)
{
new Services().Init(start, start.AddDays(1));
//new Bailun.DC.Services.FinanceReportServices().AddLogisticsWaitPay(start, 0);
start = start.AddDays(1);
// }
}
// new Bailun.DC.Services.FinanceReportServices().UpdateLogisticsWaitPay(start, 0, "admin", null);
new Bailun.DC.Services.FinanceReportServices().UpdateLogisticsWaitPay(start, 0, "admin", null);
//}
}
}
}
......@@ -236,5 +236,12 @@ namespace Bailun.DC.Models
/// 到货状态 0:未到货,1:部分到货,2:全部到货,3:部分到货不等待剩余
/// </summary>
public int arrival_status { get; set; }
public decimal amount_buy { get; set; }
public decimal amount_payed { get; set; }
public decimal amount_express { get; set; }
}
}
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