Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
9.1 KiB

org_names = ["Optivo", "1625 Independent People Ltd.", "A2DOMINION HOMES", "A2DOMINION SOUTH HA Ltd", "Abri Group Ltd.", "Accent Housing Ltd.", "Access Community Trust", "Accomplish Group", "ACKEE HOUSING PROJECT", "ACTION HOMELESS - LEICESTER", "Action Housing and Support Limited", "ADDICTION RECOVERY AGENCY", "ADULLAM HOMES HA Ltd.", "AKSA HA LTD", "Alabare Christian Care and Support", "AMADUDU", "Amicus Trust Ltd.", "ANAH PROJECT", "ANCHOR HANOVER", "ARCHES HOUSING ASSOCIATION LTD.", "ASHA ASIAN WOMENS AID", "ASHIANA", "Association for Spinal Injury Research, Rehabilitation and Reintegration (ASPIRE)", "Aster Communities", "Back on Track Housing", "BANGLA HOUSING ASSOCIATION", "BARNARDOS", "Basildon District Council", "Bassetlaw District Council", "Bernicia", "BEYOND HOUSING", "Birmingham City Council", "Blackburn YMCA (T/A Y Housing)", "BOURNVILLE ALMSHOUSE TRUST", "BOURNVILLE VILLAGE TRUST", "BOURNVILLE WORKS HS Ltd", "BPHA Ltd", "Bradford Cyrenians", "BRENT, WANDSWORTH & WESTMINSTER MIND", "Bridge Mental Health", "Brighter Places", "Bushbury Hill Estate Management Board", "CALICO HOUSING ASSOCIATION", "CAMBRIDGE CYRENIANS", "Caring for Communities and People (CCP)", "Catalyst Housing Ltd.", "Causeway Irish Housing", "CAYSH", "CENTRAL & CECIL HT", "CENTREPOINT", "Certitude (Support for Living)", "Change, Grow, Live", "Changing Lives", "Chartford Housing Limited", "CHELMER HOUSING PARTNERSHIP", "CHERRYTREE SUPPORT SERVICES LTD.", "Cheshire West and Chester Council", "Chorley Community Housing", "Chorus Homes", "City of Bradford Metropolitan District Council", "Clarion Housing Group", "COASTLINE HOUSING", "COMMUNITY LINKS", "CONNECT HOUSING", "Connection Support", "COTMAN HA Ltd", "COVENTRY CYRENIANS", "COVENTRY MIND", "Coventry Refugee and Migrant Centre", "CRANSTOUN DRUG SERVICES", "CREATIVE SUPPORT", "CROSBY HA Ltd", "CROWN SIMMONS HOUSING", "CROYDON CHURCHES HA Ltd", "Curo Choice Ltd", "Curo Places", "DEPAUL UK", "DERWENT HA Ltd", "Dovecotes TMO Ltd", "East Riding of Yorkshire Council", "emh homes", "Evolve Housing and Support", "Expect Ltd.", "FAMILY HELP", "FAMILY MOSAIC HOUSING", "FLAGSHIP HOUSING GROUP LTD", "Forhousing", "FOUNDATION HOUSING (Leeds)", "FRAMEWORK HA", "Funding Affordable Homes Housing Association Ltd.", "FYLDE COAST WOMEN'S AID", "GATEWAY HOUSING ASSOCIATION", "Genesis HA", "GIPSIL", "Gloucester City Homes", "GLOUCESTERSHIRE RURAL HOUSING ASSOCIATION LTD. (GRHA)", "GRAND UNION HOUSING GROUP", "GRAVESEND CHURCHES HA Ltd", "Great Places Housing Association", "GreenSquare Accord", "GreenSquare Group", "Grimsby and Cleethorpes Area Doorstep", "HALTON YMCA", "Harbour Support Services", "HARROGATE FLOWER FUND HOMES", "Harrogate Housing Association Limited", "HAVEBURY HOUSING PARTNERSHIP", "Heart of Medway Housing Association Ltd", "HESTIA HOUSING AND SUPPORT", "HEXAGON HA", "Hightown Housing Association Limited", "HINCKLEY HOMELESS", "HITS HOMES TRUST", "HOME GROUP [1199]", "Homeless Link [software company]", "Homeless Oxfordshire Ltd.", "Honeycomb Charitable Services Ltd.", "Honeycomb Group Ltd.", "HORTON HOUSING ASSOCIATION", "Housing and Care 21", "HOUSING FOR WOMEN", "HUDDERSFIELD WOMEN'S AID", "HULL & EAST YORKSHIRE MIND", "Humankind", "HUNDRED HOUSES SOCIETY", "HYDE HA Group", "HYNDBURN HOMES", "I Choose Freedom", "Imagine Mental Health", "IMPACT HOUSING ASSOCIATION", "Impakt Housing and Support", "Incommunities", "IRWELL VALLEY HA Ltd", "ISLINGTON & SHOREDITCH HA Ltd", "Jigsaw Homes North", "Jigsaw Homes Tameside", "Karbon Homes", "KIRKLEES ASIAN AND BLACK WOMEN'S WELFARE ASSOCIATION (KABWWA)", "KURDISH HA", "Lancashire Mind", "Latin American Women's Aid Refuge (LAWA)", "LDN London", "LEEDS FEDERATED HOUSING ASSOCIATION", "LEEDS WOMEN'S AID", "Legal & General Affordable Homes", "LEICESTER HA Ltd", "Leicestershire Rural Housing Association", "Lewisham Homes", "LIFE CARE AND HOUSING TRUST", "LiveWest Homes Ltd.", "LONDON & QUADRANT", "LONDON AND QUADRANT (L&Q) HOUSING TRUST", "London Borough of Hounslow", "London Borough of Lewisham", "Longhurst & Havelok Homes Ltd", "LOOK AHEAD CARE, SUPPORT A
# fields = [:uprn, :uprn_known, :uprn_confirmed, :address_line1, :address_line2, :town_or_city, :county, :postcode_full, :la]
fields = [:referral, :tenancylength]
illness_fields = [:illness_type_1, :illness_type_2, :illness_type_3, :illness_type_4, :illness_type_5, :illness_type_6, :illness_type_7, :illness_type_8, :illness_type_9, :illness_type_10]
def print_org_data(org_names, fields, illness_fields)
i = 0
org_names.each do |org_name|
i += 1
org = Organisation.find_by(name: org_name)
if org.blank?
p "#{i} of #{org_names.count}: Org #{org_name} not found, skipping"
next
end
print ""
print org_name
print ">"
# fields.each do |field|
# print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.send(field).nil? }.count}>"
# end
print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.referral.nil? && l.renewal == 0 }.count}>"
print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.tenancylength.nil? && [4, 6].include?(l.tenancy) }.count}>"
print "#{org.lettings_logs.where(status: "in_progress").select{ |l| l.illness == 1 && illness_fields.all? { |illness_field| l.send(illness_field).zero?} }.count}>"
# fields.each do |field|
# print "#{org.sales_logs.where(status: "in_progress").select{ |l| l.send(field).nil? }.count}>"
# end
print "\n"
end
end
print_org_data(org_names, fields, illness_fields)