/*
insert into dy2021.dbo.govwin_batch (propertykey, i_u, bill_no, bill_year, transmit)
select propertykey, 'U', bill_no, bill_year, 0 from dy2021.dbo.bill where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES>0 

insert into dy2020.dbo.govwin_batch (propertykey, i_u, bill_no, bill_year, transmit)
select propertykey, 'U', bill_no, bill_year, 0 from dy2020.dbo.bill where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES>0 

insert into dy2019.dbo.govwin_batch (propertykey, i_u, bill_no, bill_year, transmit)
select propertykey, 'U', bill_no, bill_year, 0 from dy2019.dbo.bill where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES>0 

insert into dy2018.dbo.govwin_batch (propertykey, i_u, bill_no, bill_year, transmit)
select propertykey, 'U', bill_no, bill_year, 0 from dy2018.dbo.bill where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES>0 

insert into dy2017.dbo.govwin_batch (propertykey, i_u, bill_no, bill_year, transmit)
select propertykey, 'U', bill_no, bill_year, 0 from dy2017.dbo.bill where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES>0 

insert into dy2016.dbo.govwin_batch (propertykey, i_u, bill_no, bill_year, transmit)
select propertykey, 'U', bill_no, bill_year, 0 from dy2016.dbo.bill where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES>0 

insert into dy2015.dbo.govwin_batch (propertykey, i_u, bill_no, bill_year, transmit)
select propertykey, 'U', bill_no, bill_year, 0 from dy2015.dbo.bill where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES>0 

insert into dy2014.dbo.govwin_batch (propertykey, i_u, bill_no, bill_year, transmit)
select propertykey, 'U', bill_no, bill_year, 0 from dy2014.dbo.bill where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES>0



update dy2021.dbo.bill set 
	fifa=case when adv_tax < 100 then 10 else 20 end
	, ged=5
	, collect_fees=7
	, total=total+7+5+case when adv_tax < 100 then 10 else 20 end
	, balance_due=balance_due+7+5+case when adv_tax < 100 then 10 else 20 end
	, comments=comments+char(13)+char(10)+'FIFA, GED, COLLECT FEES add 4/27/2023'
	where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES0 


update dy2020.dbo.bill set 
	fifa=case when adv_tax < 100 then 10 else 20 end
	, ged=5
	, collect_fees=7
	, total=total+7+5+case when adv_tax < 100 then 10 else 20 end
	, balance_due=balance_due+7+5+case when adv_tax < 100 then 10 else 20 end
	, comments=comments+char(13)+char(10)+'FIFA, GED, COLLECT FEES add 4/27/2023'
	where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES=0 


update dy2019.dbo.bill set 
	fifa=case when adv_tax < 100 then 10 else 20 end
	, ged=5
	, collect_fees=7
	, total=total+7+5+case when adv_tax < 100 then 10 else 20 end
	, balance_due=balance_due+7+5+case when adv_tax < 100 then 10 else 20 end
	, comments=comments+char(13)+char(10)+'FIFA, GED, COLLECT FEES add 4/27/2023'
	where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES=0 


update dy2018.dbo.bill set 
	fifa=case when adv_tax < 100 then 10 else 20 end
	, ged=5
	, collect_fees=7
	, total=total+7+5+case when adv_tax < 100 then 10 else 20 end
	, balance_due=balance_due+7+5+case when adv_tax < 100 then 10 else 20 end
	, comments=comments+char(13)+char(10)+'FIFA, GED, COLLECT FEES add 4/27/2023'
	where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES=0 


update dy2017.dbo.bill set 
	fifa=case when adv_tax < 100 then 10 else 20 end
	, ged=5
	, collect_fees=7
	, total=total+7+5+case when adv_tax < 100 then 10 else 20 end
	, balance_due=balance_due+7+5+case when adv_tax < 100 then 10 else 20 end
	, comments=comments+char(13)+char(10)+'FIFA, GED, COLLECT FEES add 4/27/2023'
	where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES=0 


update dy2016.dbo.bill set 
	fifa=case when adv_tax < 100 then 10 else 20 end
	, ged=5
	, collect_fees=7
	, total=total+7+5+case when adv_tax < 100 then 10 else 20 end
	, balance_due=balance_due+7+5+case when adv_tax < 100 then 10 else 20 end
	, comments=comments+char(13)+char(10)+'FIFA, GED, COLLECT FEES add 4/27/2023'
	where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES=0 


update dy2015.dbo.bill set 
	fifa=case when adv_tax < 100 then 10 else 20 end
	, ged=5
	, collect_fees=7
	, total=total+7+5+case when adv_tax < 100 then 10 else 20 end
	, balance_due=balance_due+7+5+case when adv_tax < 100 then 10 else 20 end
	, comments=comments+char(13)+char(10)+'FIFA, GED, COLLECT FEES add 4/27/2023'
	where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES=0 


update dy2014.dbo.bill set 
	fifa=case when adv_tax < 100 then 10 else 20 end
	, ged=5
	, collect_fees=7
	, total=total+7+5+case when adv_tax < 100 then 10 else 20 end
	, balance_due=balance_due+7+5+case when adv_tax < 100 then 10 else 20 end
	, comments=comments+char(13)+char(10)+'FIFA, GED, COLLECT FEES add 4/27/2023'
	where bill_type='m' and balance_due > 0 and fifa+ged+COLLECT_FEES=0 


