|
|
|
|
@ -76,7 +76,7 @@ module Imports
|
|
|
|
|
attributes["inc2mort"] = unsafe_string_as_integer(xml_doc, "Q2Person2MortApplication") |
|
|
|
|
attributes["hb"] = unsafe_string_as_integer(xml_doc, "Q2a") |
|
|
|
|
attributes["frombeds"] = safe_string_as_integer(xml_doc, "Q20Bedrooms") |
|
|
|
|
attributes["staircase"] = unsafe_string_as_integer(xml_doc, "Q17aStaircase") |
|
|
|
|
attributes["staircase"] = unsafe_string_as_integer(xml_doc, "Q17aStaircase") if attributes["ownershipsch"] == 1 |
|
|
|
|
attributes["stairbought"] = safe_string_as_integer(xml_doc, "PercentBought") |
|
|
|
|
attributes["stairowned"] = safe_string_as_integer(xml_doc, "PercentOwns") if attributes["staircase"] == 1 |
|
|
|
|
attributes["mrent"] = safe_string_as_decimal(xml_doc, "Q28MonthlyRent") |
|
|
|
|
@ -102,7 +102,6 @@ module Imports
|
|
|
|
|
attributes["ppcodenk"] = previous_postcode_known(xml_doc, attributes["ppostcode_full"], attributes["prevloc"]) # Q7UNKNOWNPOSTCODE check mapping |
|
|
|
|
attributes["ppostc1"] = string_or_nil(xml_doc, "PPOSTC1") |
|
|
|
|
attributes["ppostc2"] = string_or_nil(xml_doc, "PPOSTC2") |
|
|
|
|
attributes["previous_la_known"] = nil |
|
|
|
|
attributes["hhregres"] = unsafe_string_as_integer(xml_doc, "ArmedF") |
|
|
|
|
attributes["hhregresstill"] = still_serving(xml_doc) |
|
|
|
|
attributes["proplen"] = safe_string_as_integer(xml_doc, "Q16aProplen2") || safe_string_as_integer(xml_doc, "Q16aProplensec2") |
|
|
|
|
@ -130,9 +129,8 @@ module Imports
|
|
|
|
|
attributes["prevshared"] = nil # 23/24 variable |
|
|
|
|
attributes["staircasesale"] = nil # 23/24 variable |
|
|
|
|
|
|
|
|
|
# Required for our form invalidated questions (not present in import) |
|
|
|
|
attributes["previous_la_known"] = 1 if attributes["prevloc"].present? && attributes["ppostcode_full"].blank? |
|
|
|
|
if attributes["la"].present? && attributes["postcode_full"].blank? |
|
|
|
|
attributes["previous_la_known"] = 1 if attributes["prevloc"].present? |
|
|
|
|
if attributes["la"].present? |
|
|
|
|
attributes["la_known"] = 1 |
|
|
|
|
attributes["is_la_inferred"] = false |
|
|
|
|
end |
|
|
|
|
|