From be202efe11662887e84434b9ad405cff9f355c51 Mon Sep 17 00:00:00 2001 From: Vilaboa Date: Wed, 8 May 2024 12:24:51 +0200 Subject: [PATCH] FIX comparar fecha de obra con fecha aps inexistente --- libcnmc/cir_8_2021/FB1.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcnmc/cir_8_2021/FB1.py b/libcnmc/cir_8_2021/FB1.py index 01024828..28664104 100644 --- a/libcnmc/cir_8_2021/FB1.py +++ b/libcnmc/cir_8_2021/FB1.py @@ -320,7 +320,9 @@ def get_inst_name(element_id): # CAMPS OBRA if tram_obra != '': obra_year = data_finalitzacio.split('-')[0] - data_pm_year = fecha_aps.split('/')[2] + data_pm_year = ( + fecha_aps and fecha_aps.split('/')[2] or '' + ) if tram_obra['tipo_inversion'] != '0' and obra_year != data_pm_year: data_ip = convert_spanish_date(data_finalitzacio) else: