|
|
|
@ -22,8 +22,17 @@ class BulkUploadController < ApplicationController
|
|
|
|
|
data_range.map do |row_num| |
|
|
|
|
row = sheet.row(row_num) |
|
|
|
|
CaseLog.create!( |
|
|
|
|
lettype: row[1], |
|
|
|
|
landlord: row[2], |
|
|
|
|
# reg_num_la_core_code: row[3], |
|
|
|
|
# managementgroup: row[4], |
|
|
|
|
# schemecode: row[5], |
|
|
|
|
# firstletting: row[6], |
|
|
|
|
tenant_code: row[7], |
|
|
|
|
startertenancy: row[8], |
|
|
|
|
tenancy: row[9], |
|
|
|
|
tenancyother: row[10], |
|
|
|
|
# tenancyduration: row[11], |
|
|
|
|
age1: row[12], |
|
|
|
|
age2: row[13], |
|
|
|
|
age3: row[14], |
|
|
|
@ -58,96 +67,106 @@ class BulkUploadController < ApplicationController
|
|
|
|
|
ethnic: row[43], |
|
|
|
|
national: row[44], |
|
|
|
|
armed_forces: row[45], |
|
|
|
|
armed_forces_partner: "", |
|
|
|
|
prevten: "", |
|
|
|
|
hhmemb: "", |
|
|
|
|
homeless: "", |
|
|
|
|
reason_for_leaving_last_settled_home: "", |
|
|
|
|
underoccupation_benefitcap: "", |
|
|
|
|
leftreg: "", |
|
|
|
|
reservist: "", |
|
|
|
|
illness: "", |
|
|
|
|
preg_occ: "", |
|
|
|
|
accessibility_requirements: "", |
|
|
|
|
condition_effects: "", |
|
|
|
|
tenancy_code: "", |
|
|
|
|
startdate: "", |
|
|
|
|
tenancylength: "", |
|
|
|
|
tenancy: "", |
|
|
|
|
lettype: "", |
|
|
|
|
landlord: "", |
|
|
|
|
property_location: "", |
|
|
|
|
previous_postcode: "", |
|
|
|
|
property_relet: "", |
|
|
|
|
rsnvac: "", |
|
|
|
|
property_reference: "", |
|
|
|
|
unittype_gn: "", |
|
|
|
|
property_building_type: "", |
|
|
|
|
beds: "", |
|
|
|
|
property_void_date: "", |
|
|
|
|
property_major_repairs: "", |
|
|
|
|
property_major_repairs_date: "", |
|
|
|
|
offered: "", |
|
|
|
|
wchair: "", |
|
|
|
|
earnings: "", |
|
|
|
|
incfreq: "", |
|
|
|
|
benefits: "", |
|
|
|
|
housing_benefit: "", |
|
|
|
|
period: "", |
|
|
|
|
brent: "", |
|
|
|
|
scharge: "", |
|
|
|
|
pscharge: "", |
|
|
|
|
supcharg: "", |
|
|
|
|
tcharge: "", |
|
|
|
|
outstanding_amount: "", |
|
|
|
|
layear: "", |
|
|
|
|
lawaitlist: "", |
|
|
|
|
previous_la: "", |
|
|
|
|
property_postcode: "", |
|
|
|
|
reasonpref: "", |
|
|
|
|
reasonable_preference_reason: "", |
|
|
|
|
cbl: "", |
|
|
|
|
chr: "", |
|
|
|
|
cap: "", |
|
|
|
|
outstanding_rent_or_charges: "", |
|
|
|
|
other_reason_for_leaving_last_settled_home: "", |
|
|
|
|
housingneeds_a: "", |
|
|
|
|
housingneeds_b: "", |
|
|
|
|
housingneeds_c: "", |
|
|
|
|
housingneeds_f: "", |
|
|
|
|
housingneeds_g: "", |
|
|
|
|
housingneeds_h: "", |
|
|
|
|
accessibility_requirements_prefer_not_to_say: "", |
|
|
|
|
illness_type_1: "", |
|
|
|
|
illness_type_2: "", |
|
|
|
|
illness_type_3: "", |
|
|
|
|
illness_type_4: "", |
|
|
|
|
illness_type_8: "", |
|
|
|
|
illness_type_5: "", |
|
|
|
|
illness_type_6: "", |
|
|
|
|
illness_type_7: "", |
|
|
|
|
illness_type_9: "", |
|
|
|
|
illness_type_10: "", |
|
|
|
|
condition_effects_prefer_not_to_say: "", |
|
|
|
|
rp_homeless: "", |
|
|
|
|
rp_insan_unsat: "", |
|
|
|
|
rp_medwel: "", |
|
|
|
|
rp_hardship: "", |
|
|
|
|
rp_dontknow: "", |
|
|
|
|
tenancyother: "", |
|
|
|
|
override_net_income_validation: "", |
|
|
|
|
net_income_known: "", |
|
|
|
|
gdpr_acceptance: "", |
|
|
|
|
gdpr_declined: "", |
|
|
|
|
property_owner_organisation: "", |
|
|
|
|
property_manager_organisation: "", |
|
|
|
|
sale_or_letting: "", |
|
|
|
|
tenant_same_property_renewal: "", |
|
|
|
|
rent_type: "", |
|
|
|
|
intermediate_rent_product_name: "", |
|
|
|
|
needs_type: "", |
|
|
|
|
sale_completion_date: "", |
|
|
|
|
purchaser_code: "", |
|
|
|
|
reservist: row[46], |
|
|
|
|
preg_occ: row[47], |
|
|
|
|
housing_benefit: row[48], |
|
|
|
|
benefits: row[49], |
|
|
|
|
net_income_known: row[50].present? ? 1 : nil, |
|
|
|
|
earnings: row[50], |
|
|
|
|
# increfused: row[51], |
|
|
|
|
reason_for_leaving_last_settled_home: row[52], |
|
|
|
|
other_reason_for_leaving_last_settled_home: row[53], |
|
|
|
|
underoccupation_benefitcap: row[54], |
|
|
|
|
housingneeds_a: row[55], |
|
|
|
|
housingneeds_b: row[56], |
|
|
|
|
housingneeds_c: row[57], |
|
|
|
|
housingneeds_f: row[58], |
|
|
|
|
housingneeds_g: row[59], |
|
|
|
|
housingneeds_h: row[60], |
|
|
|
|
prevten: row[61], |
|
|
|
|
previous_la: row[62], |
|
|
|
|
# ppostc1: row[63], |
|
|
|
|
# ppostc2: row[64], |
|
|
|
|
# prevpco_unknown: row[65], |
|
|
|
|
layear: row[66], |
|
|
|
|
lawaitlist: row[67], |
|
|
|
|
homeless: row[68], |
|
|
|
|
reasonpref: row[69], |
|
|
|
|
rp_homeless: row[70], |
|
|
|
|
rp_insan_unsat: row[71], |
|
|
|
|
rp_medwel: row[72], |
|
|
|
|
rp_hardship: row[73], |
|
|
|
|
rp_dontknow: row[74], |
|
|
|
|
cbl: row[75], |
|
|
|
|
chr: row[76], |
|
|
|
|
cap: row[77], |
|
|
|
|
# referral_source: row[78], |
|
|
|
|
period: row[79], |
|
|
|
|
brent: row[80], |
|
|
|
|
scharge: row[81], |
|
|
|
|
pscharge: row[82], |
|
|
|
|
supcharg: row[83], |
|
|
|
|
tcharge: row[84], |
|
|
|
|
# tcharge_care_homes: row[85], |
|
|
|
|
# no_rent_or_charge: row[86], |
|
|
|
|
outstanding_rent_or_charges: row[87], |
|
|
|
|
outstanding_amount: row[88], |
|
|
|
|
property_void_date: row[89].to_s + row[90].to_s + row[91].to_s, |
|
|
|
|
# property_void_date_day: row[89], |
|
|
|
|
# property_void_date_month: row[90], |
|
|
|
|
# property_void_date_year: row[91], |
|
|
|
|
property_major_repairs: row[92].present? ? "1" : nil, |
|
|
|
|
property_major_repairs_date: row[92].to_s + row[93].to_s + row[94].to_s, |
|
|
|
|
# property_major_repairs_date_day: row[92], |
|
|
|
|
# property_major_repairs_date_month: row[93], |
|
|
|
|
# property_major_repairs_date_year: row[94], |
|
|
|
|
# supported_scheme: row[95], |
|
|
|
|
startdate: row[96].to_s + row[97].to_s + row[98].to_s, |
|
|
|
|
# startdate_day: row[96], |
|
|
|
|
# startdate_month: row[97], |
|
|
|
|
# startdate_year: row[98], |
|
|
|
|
offered: row[99], |
|
|
|
|
property_reference: row[100], |
|
|
|
|
beds: row[101], |
|
|
|
|
unittype_gn: row[102], |
|
|
|
|
property_building_type: row[103], |
|
|
|
|
wchair: row[104], |
|
|
|
|
property_relet: row[105], |
|
|
|
|
rsnvac: row[106], |
|
|
|
|
property_location: row[107], |
|
|
|
|
# postcode: row[108], |
|
|
|
|
# postcod2: row[109], |
|
|
|
|
# row[110] removed |
|
|
|
|
property_owner_organisation: row[111], |
|
|
|
|
# username: row[112], |
|
|
|
|
property_manager_organisation: row[113], |
|
|
|
|
leftreg: row[114], |
|
|
|
|
# uprn: row[115], |
|
|
|
|
incfreq: row[116], |
|
|
|
|
# sheltered_accom: row[117], |
|
|
|
|
illness: row[118], |
|
|
|
|
illness_type_1: row[119], |
|
|
|
|
illness_type_2: row[120], |
|
|
|
|
illness_type_3: row[121], |
|
|
|
|
illness_type_4: row[122], |
|
|
|
|
illness_type_8: row[123], |
|
|
|
|
illness_type_5: row[124], |
|
|
|
|
illness_type_6: row[125], |
|
|
|
|
illness_type_7: row[126], |
|
|
|
|
illness_type_9: row[127], |
|
|
|
|
illness_type_10: row[128], |
|
|
|
|
# london_affordable: row[129], |
|
|
|
|
rent_type: row[130], |
|
|
|
|
intermediate_rent_product_name: row[131], |
|
|
|
|
# data_protection: row[132], |
|
|
|
|
gdpr_acceptance: 1, |
|
|
|
|
gdpr_declined: 0 |
|
|
|
|
# armed_forces_partner: "", |
|
|
|
|
# sale_or_letting: "", |
|
|
|
|
# tenant_same_property_renewal: "", |
|
|
|
|
# needs_type: "", |
|
|
|
|
# sale_completion_date: "", |
|
|
|
|
# purchaser_code: "", |
|
|
|
|
) |
|
|
|
|
end |
|
|
|
|
redirect_to(case_logs_path) |
|
|
|
|