|
|
@ -126,6 +126,7 @@ module Imports |
|
|
|
attributes["cbl"] = allocation_system(unsafe_string_as_integer(xml_doc, "Q15CBL")) |
|
|
|
attributes["cbl"] = allocation_system(unsafe_string_as_integer(xml_doc, "Q15CBL")) |
|
|
|
attributes["chr"] = allocation_system(unsafe_string_as_integer(xml_doc, "Q15CHR")) |
|
|
|
attributes["chr"] = allocation_system(unsafe_string_as_integer(xml_doc, "Q15CHR")) |
|
|
|
attributes["cap"] = allocation_system(unsafe_string_as_integer(xml_doc, "Q15CAP")) |
|
|
|
attributes["cap"] = allocation_system(unsafe_string_as_integer(xml_doc, "Q15CAP")) |
|
|
|
|
|
|
|
attributes["letting_allocation_unknown"] = allocation_system_unknown(attributes["cbl"], attributes["chr"], attributes["cap"]) |
|
|
|
|
|
|
|
|
|
|
|
attributes["referral"] = unsafe_string_as_integer(xml_doc, "Q16") |
|
|
|
attributes["referral"] = unsafe_string_as_integer(xml_doc, "Q16") |
|
|
|
attributes["period"] = unsafe_string_as_integer(xml_doc, "Q17") |
|
|
|
attributes["period"] = unsafe_string_as_integer(xml_doc, "Q17") |
|
|
@ -562,6 +563,17 @@ module Imports |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def allocation_system_unknown(cbl, chr, cap) |
|
|
|
|
|
|
|
allocation_values = [cbl, chr, cap] |
|
|
|
|
|
|
|
if allocation_values.all? { |att| att.nil? } |
|
|
|
|
|
|
|
nil |
|
|
|
|
|
|
|
elsif allocation_values.all? { |att| att&.zero? } |
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def apply_date_consistency!(attributes) |
|
|
|
def apply_date_consistency!(attributes) |
|
|
|
return if attributes["voiddate"].nil? || attributes["startdate"].nil? |
|
|
|
return if attributes["voiddate"].nil? || attributes["startdate"].nil? |
|
|
|
|
|
|
|
|
|
|
|