varsql=$@"select sum(cashier_paymoneyrmb) as amount from dc_base_finance_cashier where cashier_status=1 and cashier_type=1 and cashier_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and cashier_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and (sourcecode in ('Buy','SemiFinishedProduct') or (tradeb_bjectname in ('广州哈倪蔓生物科技有限公司','广州拉古娜生物科技有限公司') and companymain_value_from in (1,2)))";
varsql=$@"select sum(cashier_paymoneyrmb) as amount from dc_base_finance_cashier where cashier_status=1 and cashier_type=1 and cashier_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and cashier_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and (sourcecode in ('Buy','SemiFinishedProduct') or (tradeb_bjectname in ('广州哈倪蔓生物科技有限公司','广州拉古娜生物科技有限公司','广州美甲生产仓') and companymain_value_from in (1,2,5,7,8)))";
varsql=$"select sum(amount_paid) amount from dc_base_purchase_details where create_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and create_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and `status`>=0";
varsql=$"select sum(amount_paid) amount from dc_base_purchase_details where create_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and create_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and `status`>=0";
sql=$@"select sum(cashier_paymoneyrmb) as amount from dc_base_finance_cashier where cashier_status=1 and cashier_type=1 and cashier_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and cashier_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and (sourcecode in ('Buy','SemiFinishedProduct') or (tradeb_bjectname in ('广州哈倪蔓生物科技有限公司','广州拉古娜生物科技有限公司') and companymain_value_from in (1,2)))";
sql=$@"select sum(cashier_paymoneyrmb) as amount from dc_base_finance_cashier where cashier_status=1 and cashier_type=1 and cashier_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and cashier_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}' and (sourcecode in ('Buy','SemiFinishedProduct') or (tradeb_bjectname in ('广州哈倪蔓生物科技有限公司','广州拉古娜生物科技有限公司','广州美甲生产仓') and companymain_value_from in (1,2,5,7,8)))";
sql=$"select sum(other_to_cny_money) amount from dc_base_finance_cashierdetail where daozhang_time>='{start.ToString("yyyy-MM-dd HH:mm:ss")}' and daozhang_time<'{end.ToString("yyyy-MM-dd HH:mm:ss")}'";
sql=$"select sum(balance_rmb) amount from dc_bank_account_balance where company_value in (2,1,39,32,26,12,42,34,38,22,29,8,27,5,40,33,7) and bank_name != 'payoneer' and bank_name!='PayPal' and bank_name!='Beepay' and bank_name!='P卡' and statistical_time='{start.ToString("yyyy-MM-dd")}'";
varsql=$@"select t1.bailun_sku,t1.warehouse_code,t2.warehouse_name,sum(t1.usable_stock+t1.occupy_stock) count,sum((t1.usable_stock+t1.occupy_stock)*t1.unit_price) as amount from dc_daily_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code
where t1.record_time='{day.AddDays(-1).ToString("yyyy-MM-dd")}' group by t1.bailun_sku,t1.warehouse_code";
sql=$@"select t1.bailun_sku,t1.warehouse_code,t2.warehouse_name,sum(t1.usable_stock+t1.occupy_stock) count,sum((t1.usable_stock+t1.occupy_stock)*t3.unit_price) as amount from dc_base_stock t1
left join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code
left join dc_base_sku t3 on t1.bailun_sku=t3.bailun_sku
where t1.usable_stock>0 or t1.occupy_stock>0 group by t1.bailun_sku,t1.warehouse_code";
sql=$@"select t1.bailun_sku,t1.warehouse_code,t2.warehouse_name,sum(t1.quantity_purchase+t1.quantity_transfer) count,sum((t1.quantity_purchase+t1.quantity_transfer)*t1.unit_price) as amount from dc_daily_transit t1
left join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code
where t1.record_time='{day.AddDays(-1).ToString("yyyy-MM-dd")}' and (t1.quantity_purchase>0 or t1.quantity_transfer>0) group by t1.bailun_sku,t1.warehouse_code";
sql=$@"select t1.bailun_sku,t1.warehouse_code,t2.warehouse_name,sum(t1.quantity_purchase+t1.quantity_transfer) count,sum((t1.quantity_purchase+t1.quantity_transfer)*t3.unit_price) as amount from dc_mid_transit t1
left join dc_base_warehouse t2 on t1.warehouse_code=t2.warehouse_code
left join dc_base_sku t3 on t1.bailun_sku=t3.bailun_sku
where (t1.quantity_purchase>0 or t1.quantity_transfer>0)