Browse Source

check if tshortfall is overridden

pull/550/head
Kat 3 years ago
parent
commit
28c320f9f5
  1. 2
      app/services/imports/case_logs_import_service.rb
  2. 4
      app/services/imports/import_service.rb

2
app/services/imports/case_logs_import_service.rb

@ -516,7 +516,7 @@ module Imports
def tshortfall(xml_doc, attributes)
shortfall = safe_string_as_decimal(xml_doc, "Q18dyes")
return 0 if shortfall.blank? && attributes["hbrentshortfall"] == 1
return 0 if shortfall.blank? && attributes["hbrentshortfall"] == 1 && overridden?(xml_doc, "xmlns", "Q18dyes")
shortfall
end

4
app/services/imports/import_service.rb

@ -22,6 +22,10 @@ module Imports
xml_document.at_xpath("//#{namespace}:#{field}")&.text
end
def overridden?(xml_document, namespace, field)
xml_document.at_xpath("//#{namespace}:#{field}").attributes["override-field"].value
end
def to_boolean(input_string)
input_string == "true"
end

Loading…
Cancel
Save