Browse Source

Reorder import

pull/558/head
baarkerlounger 4 years ago
parent
commit
095fa7c1ab
  1. 7
      app/services/imports/case_logs_import_service.rb

7
app/services/imports/case_logs_import_service.rb

@ -125,8 +125,8 @@ module Imports
attributes["supcharg"] = safe_string_as_decimal(xml_doc, "Q18aiv") attributes["supcharg"] = safe_string_as_decimal(xml_doc, "Q18aiv")
attributes["tcharge"] = safe_string_as_decimal(xml_doc, "Q18av") attributes["tcharge"] = safe_string_as_decimal(xml_doc, "Q18av")
attributes["hbrentshortfall"] = hbshortfall(xml_doc)
attributes["tshortfall"] = safe_string_as_decimal(xml_doc, "Q18dyes") attributes["tshortfall"] = safe_string_as_decimal(xml_doc, "Q18dyes")
attributes["hbrentshortfall"] = hbshortfall(xml_doc, attributes)
attributes["voiddate"] = compose_date(xml_doc, "VDAY", "VMONTH", "VYEAR") attributes["voiddate"] = compose_date(xml_doc, "VDAY", "VMONTH", "VYEAR")
attributes["mrcdate"] = compose_date(xml_doc, "MRCDAY", "MRCMONTH", "MRCYEAR") attributes["mrcdate"] = compose_date(xml_doc, "MRCDAY", "MRCMONTH", "MRCYEAR")
@ -520,10 +520,9 @@ module Imports
((2..8).map { |x| string_or_nil(xml_doc, "P#{x}Rel") } + [string_or_nil(xml_doc, "P1Sex")]).compact ((2..8).map { |x| string_or_nil(xml_doc, "P#{x}Rel") } + [string_or_nil(xml_doc, "P1Sex")]).compact
end end
def hbshortfall(xml_doc) def hbshortfall(xml_doc, attributes)
shortfall = unsafe_string_as_integer(xml_doc, "Q18d") shortfall = unsafe_string_as_integer(xml_doc, "Q18d")
tshortfall = safe_string_as_decimal(xml_doc, "Q18dyes") if attributes["tshortfall"].blank? && shortfall == 1 && overridden?(xml_doc, "xmlns", "Q18dyes")
if tshortfall.blank? && shortfall == 1 && overridden?(xml_doc, "xmlns", "Q18dyes")
# If they have said there is a shortfall but then not entered one, and that has been # If they have said there is a shortfall but then not entered one, and that has been
# manually overridden we instead infer that they actually didn't know whether there is a shortfall. # manually overridden we instead infer that they actually didn't know whether there is a shortfall.
3 3

Loading…
Cancel
Save