Commit aee22f18 by guanzhenshan

每日发生额物流付款金额增加减去收款金额

parent 08a6f114
......@@ -156,6 +156,10 @@ namespace Bailun.DC.HappenAmount
sqlpay = $"select sum(cashier_paymoneyrmb) cashier_paymoneyrmb from dc_base_finance_cashier where cashier_type=1 and cashier_status=1 and sourcecode in ('newCost','oldbuy') and type_name='销售费用/物流费' and cashier_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and cashier_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}'";
m.hl_amount_pay += cn.QueryFirstOrDefault<decimal?>(sqlpay, null, null, 2 * 60)??0;
//Add by Allan at 20200220,已付款要减去收款金额
var sqlrecevice = $@"select sum(cashier_paymoneyrmb) cashier_paymoneyrmb from dc_base_finance_cashier where cashier_type=2 and cashier_status=1 and sourcecode in ('newCost','oldbuy') and type_name='销售费用/物流费' and cashier_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and cashier_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}'";
m.hl_amount_pay -= cn.QueryFirstOrDefault<decimal?>(sqlrecevice, null, null, 2 * 60) ?? 0;
//发生额
sqlhappen = $@"select sum(tb.cost_first) from (select DISTINCT channel_id,box_id,cost_first from dc_base_cost_first where operation_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and operation_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' order by channel_id,box_id) tb";
......
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