|
|
|
@ -104,7 +104,7 @@ module Imports |
|
|
|
attributes["hhregresstill"] = still_serving(xml_doc) |
|
|
|
attributes["hhregresstill"] = still_serving(xml_doc) |
|
|
|
attributes["proplen"] = safe_string_as_integer(xml_doc, "Q16aProplen2") |
|
|
|
attributes["proplen"] = safe_string_as_integer(xml_doc, "Q16aProplen2") |
|
|
|
attributes["mscharge"] = monthly_charges(xml_doc, attributes) |
|
|
|
attributes["mscharge"] = monthly_charges(xml_doc, attributes) |
|
|
|
attributes["mscharge_known"] = mscharge_known(attributes) |
|
|
|
attributes["mscharge_known"] = 1 if attributes["mscharge"].present? |
|
|
|
attributes["prevten"] = unsafe_string_as_integer(xml_doc, "Q6PrevTenure") |
|
|
|
attributes["prevten"] = unsafe_string_as_integer(xml_doc, "Q6PrevTenure") |
|
|
|
attributes["mortgageused"] = unsafe_string_as_integer(xml_doc, "MORTGAGEUSED") |
|
|
|
attributes["mortgageused"] = unsafe_string_as_integer(xml_doc, "MORTGAGEUSED") |
|
|
|
attributes["wchair"] = unsafe_string_as_integer(xml_doc, "Q15Wheelchair") |
|
|
|
attributes["wchair"] = unsafe_string_as_integer(xml_doc, "Q15Wheelchair") |
|
|
|
@ -145,6 +145,7 @@ module Imports |
|
|
|
attributes["created_by"] = user |
|
|
|
attributes["created_by"] = user |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_default_values(attributes) if previous_status.include?("submitted") |
|
|
|
sales_log = save_sales_log(attributes, previous_status) |
|
|
|
sales_log = save_sales_log(attributes, previous_status) |
|
|
|
compute_differences(sales_log, attributes) |
|
|
|
compute_differences(sales_log, attributes) |
|
|
|
check_status_completed(sales_log, previous_status) unless @logs_overridden.include?(sales_log.old_id) |
|
|
|
check_status_completed(sales_log, previous_status) unless @logs_overridden.include?(sales_log.old_id) |
|
|
|
@ -395,10 +396,12 @@ module Imports |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def mscharge_known(attributes) |
|
|
|
def default_mscharge_known(attributes) |
|
|
|
return 1 if attributes["mscharge"].present? |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 if attributes["ownershipsch"] == 3 |
|
|
|
0 if attributes["ownershipsch"] == 3 |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def set_default_values(attributes) |
|
|
|
|
|
|
|
attributes["mscharge_known"] ||= default_mscharge_known(attributes) |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|