      LEAK TEST
{{~ for tank in data.tanks ~}}
Tank       {{ tank.tank_number }}-{{ tank.tank_description | f.strip_accents }}
{{~ end ~}}
{{~ if data.auto_leak_test_type != 2 ~}}
Test       {{ if data.leak_threshold == 0 }}{{ 0.37854118 | f.format_rate unit: data.settings.system.volume_unit }}{{ else if data.leak_threshold == 1 }}{{ 0.75708236 | f.format_rate unit: data.settings.system.volume_unit }}{{ else }}custom {{ end }} {{ data.settings.system.leak_unit_label | f.unit_label }}

      Initial
Time              {{ data.initial_time | f.unixtime format: data.settings.system.date_format }}
Product Level     {{ data.initial_product_level | f.format_level unit: data.settings.system.level_unit }} {{ data.settings.system.level_unit_label | f.unit_label }}
Product Volume    {{ data.initial_product_volume | f.format_volume unit: data.settings.system.volume_unit }} {{ data.settings.system.volume_unit_label | f.unit_label }}
Prod.Vol.Comp.    {{ data.initial_product_volume_comp | f.format_volume unit: data.settings.system.volume_unit }} {{ data.settings.system.volume_unit_label | f.unit_label }}
Water Level       {{ data.initial_water_level | f.format_level unit: data.settings.system.level_unit }} {{ data.settings.system.level_unit_label | f.unit_label }}
Water Volume      {{ data.initial_water_volume | f.format_volume unit: data.settings.system.volume_unit }} {{ data.settings.system.volume_unit_label | f.unit_label }}
Temperature       {{ data.initial_temperature | f.format_temperature unit: data.settings.system.temperature_unit }} {{ data.settings.system.temperature_unit_label | f.temperature_ascii_unit_label }}
      Final
{{~ if data.final_time <= data.initial_time ~}}
      IN PROGRESS
{{~ else ~}}
Time              {{ data.final_time | f.unixtime format: data.settings.system.date_format }}
Product Level     {{ data.final_product_level | f.format_level unit: data.settings.system.level_unit }} {{ data.settings.system.level_unit_label | f.unit_label }}
Product Volume    {{ data.final_product_volume | f.format_volume unit: data.settings.system.volume_unit }} {{ data.settings.system.volume_unit_label | f.unit_label }}
Prod.Vol.Comp.    {{ data.final_product_volume_comp | f.format_volume unit: data.settings.system.volume_unit }} {{ data.settings.system.volume_unit_label | f.unit_label }}
Water Level       {{ data.final_water_level | f.format_level unit: data.settings.system.level_unit }} {{ data.settings.system.level_unit_label | f.unit_label }}
Water Volume      {{ data.final_water_volume | f.format_volume unit: data.settings.system.volume_unit }} {{ data.settings.system.volume_unit_label | f.unit_label }}
Temperature       {{ data.final_temperature | f.format_temperature unit: data.settings.system.temperature_unit }} {{ data.settings.system.temperature_unit_label | f.temperature_ascii_unit_label }}

Rate              {{ data.hourly_leakage | f.format_rate unit: data.settings.system.volume_unit }} {{ data.settings.system.leak_unit_label | f.unit_label }}
Result            {{ if data.reason == 0 }}TEST PASSED   {{ else if data.reason == 1 }}LEAK DETECTED      {{ else }}INCONCLUSIVE     {{ end }}
{{~ end ~}}
{{~ else ~}}
Test       CSLD {{ if data.leak_threshold == 0 }}{{ 0.37854118 | f.format_rate unit: data.settings.system.volume_unit }}{{ else if data.leak_threshold == 1 }}{{ 0.75708236 | f.format_rate unit: data.settings.system.volume_unit }}{{ else }}custom {{ end }} {{ data.settings.system.leak_unit_label | f.unit_label }}

Initial Time      {{ data.initial_time | f.unixtime format: data.settings.system.date_format }}
{{~ if data.final_time <= data.initial_time ~}}
      IN PROGRESS
{{~ else ~}}
Final Time        {{ data.final_time | f.unixtime format: data.settings.system.date_format }}
Duration          {{ f.timedifference final: data.final_time initial: data.initial_time format: "dd'd 'hh'h 'mm'm 'ss's'" }}
{{~ end ~}}
Min Product Level {{ data.min_height | f.format_level unit: data.settings.system.level_unit }} {{ data.settings.system.level_unit_label | f.unit_label }}
Max Product Level {{ data.max_height | f.format_level unit: data.settings.system.level_unit }} {{ data.settings.system.level_unit_label | f.unit_label }}
Avg Product Level {{ data.avr_height | f.format_level unit: data.settings.system.level_unit }} {{ data.settings.system.level_unit_label | f.unit_label }}
Min Temperature   {{ data.min_temp | f.format_temperature unit: data.settings.system.temperature_unit }} {{ data.settings.system.temperature_unit_label | f.temperature_ascii_unit_label }}
Max Temperature   {{ data.max_temp | f.format_temperature unit: data.settings.system.temperature_unit }} {{ data.settings.system.temperature_unit_label | f.temperature_ascii_unit_label }}
Avg Temperature   {{ data.avr_temp | f.format_temperature unit: data.settings.system.temperature_unit }} {{ data.settings.system.temperature_unit_label | f.temperature_ascii_unit_label }}

{{~ if data.final_time > data.initial_time ~}}
Rate              {{ data.hourly_leakage | f.format_rate unit: data.settings.system.volume_unit }} {{ data.settings.system.leak_unit_label | f.unit_label }}
Result            {{ if data.reason == 0 }}NO LEAK   {{ else if data.reason == 1 }}LEAK DETECTED      {{ else }}INCONCLUSIVE     {{ end }}
{{~ end ~}}
{{~ end ~}}
