diff --git a/app/services/imports/sales_logs_import_service.rb b/app/services/imports/sales_logs_import_service.rb index 2c8dc2817..21df82297 100644 --- a/app/services/imports/sales_logs_import_service.rb +++ b/app/services/imports/sales_logs_import_service.rb @@ -52,15 +52,15 @@ module Imports attributes["othernational"] = nil attributes["ethnic"] = unsafe_string_as_integer(xml_doc, "P1ETH") attributes["ethnic_group"] = ethnic_group(attributes["ethnic"]) # check numbers - attributes["buy1livein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER1") # liveinbuyer1? - attributes["buylivein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER") # liveinbuyer? liveinbuyerother? + attributes["buy1livein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER1") + attributes["buylivein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER") attributes["builtype"] = unsafe_string_as_integer(xml_doc, "Q13BUILDINGTYPE") attributes["proptype"] = unsafe_string_as_integer(xml_doc, "Q12PROPERTYTYPE") attributes["noint"] = safe_string_as_integer(xml_doc, "NOINT") - attributes["buy2livein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER2") # liveinbuyer2? - attributes["privacynotice"] = 1 if string_or_nil(xml_doc, "QDP") == "Yes" # always yes? + attributes["buy2livein"] = unsafe_string_as_integer(xml_doc, "LIVEINBUYER2") + attributes["privacynotice"] = 1 if string_or_nil(xml_doc, "QDP") == "Yes" attributes["wheel"] = unsafe_string_as_integer(xml_doc, "Q10WHEELCHAIR") - attributes["hholdcount"] = attributes["hhmemb"] - (attributes["jointpur"] == 1 ? 2 : 1) + attributes["hholdcount"] = safe_string_as_integer(xml_doc, "LIVEINOTHER") attributes["la"] = string_or_nil(xml_doc, "Q14ONSLACODE") attributes["income1"] = safe_string_as_integer(xml_doc, "Q2PERSON1INCOME") # should this be decimal? attributes["income1nk"] = 0 if attributes["income1"].present? # known if given? there's P1IncKnown in the form should use that instead? diff --git a/spec/fixtures/imports/sales_logs/00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml b/spec/fixtures/imports/sales_logs/00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml index 4f9d709d2..c609271df 100644 --- a/spec/fixtures/imports/sales_logs/00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml +++ b/spec/fixtures/imports/sales_logs/00d2343e-d5fa-4c89-8400-ec3854b0f2b4.xml @@ -83,6 +83,7 @@ Yes 1 Yes 6 + 4 9 = other diff --git a/spec/fixtures/imports/sales_logs/0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml b/spec/fixtures/imports/sales_logs/0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml index d06ce878a..491b102eb 100644 --- a/spec/fixtures/imports/sales_logs/0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml +++ b/spec/fixtures/imports/sales_logs/0b4a68df-30cc-474a-93c0-a56ce8fdad3b.xml @@ -28,7 +28,7 @@ 2 1 Yes 1 - + 30 Non-binary 17 Republic of Ireland @@ -77,6 +77,7 @@ Yes 1 Yes 6 + 4 9 = other diff --git a/spec/fixtures/imports/sales_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml b/spec/fixtures/imports/sales_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml index 3682d3569..df187d967 100644 --- a/spec/fixtures/imports/sales_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml +++ b/spec/fixtures/imports/sales_logs/0ead17cb-1668-442d-898c-0d52879ff592.xml @@ -99,6 +99,7 @@ Yes 1 Yes 6 + 4 9 = other diff --git a/spec/fixtures/imports/sales_logs/166fc004-392e-47a8-acb8-1c018734882b.xml b/spec/fixtures/imports/sales_logs/166fc004-392e-47a8-acb8-1c018734882b.xml index a4e2280db..3ac30a749 100644 --- a/spec/fixtures/imports/sales_logs/166fc004-392e-47a8-acb8-1c018734882b.xml +++ b/spec/fixtures/imports/sales_logs/166fc004-392e-47a8-acb8-1c018734882b.xml @@ -77,6 +77,7 @@ Yes 1 Yes 6 + 4 9 = other diff --git a/spec/fixtures/imports/sales_logs/5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml b/spec/fixtures/imports/sales_logs/5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml index 1ece8859a..748367a77 100644 --- a/spec/fixtures/imports/sales_logs/5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml +++ b/spec/fixtures/imports/sales_logs/5ybz29dj-l33t-k1l0-hj86-n4k4ma77xkcd.xml @@ -77,6 +77,7 @@ Yes 1 Yes 6 + 4 9 = other diff --git a/spec/fixtures/imports/sales_logs/893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml b/spec/fixtures/imports/sales_logs/893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml index a3f00d470..1cfb14b76 100644 --- a/spec/fixtures/imports/sales_logs/893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml +++ b/spec/fixtures/imports/sales_logs/893ufj2s-lq77-42m4-rty6-ej09gh585uy1.xml @@ -77,6 +77,7 @@ Yes 1 Yes 6 + 4 9 = other