Skip to content

Commit

Permalink
Merge pull request #238 from gisce/fix_a629_manytomany_and_defs_gas
Browse files Browse the repository at this point in the history
Fix taula provincia gas + many to many a629
  • Loading branch information
eberloso authored Sep 28, 2023
2 parents 7ef06c4 + 556d00b commit d372a29
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 56 deletions.
104 changes: 52 additions & 52 deletions gestionatr/defs_gas.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,58 +331,58 @@
('04', 'ÚNICA'),
]
TAULA_PROVINCIA = [
('01', 'ALAVA', '34'),
('02', 'ALBACETE', '34'),
('03', 'ALICANTE', '34'),
('04', 'ALMERIA', '34'),
('05', 'AVILA', '34'),
('06', 'BADAJOZ', '34'),
('07', 'BALEARES', '34'),
('08', 'BARCELONA', '34'),
('09', 'BURGOS', '34'),
('10', 'CACERES', '34'),
('11', 'CADIZ', '34'),
('12', 'CASTELLON', '34'),
('13', 'CIUDAD REAL', '34'),
('14', 'CORDOBA', '34'),
('15', 'LA CORUÑA', '34'),
('16', 'CUENCA', '34'),
('17', 'GERONA', '34'),
('18', 'GRANADA', '34'),
('19', 'GUADALAJARA', '34'),
('20', 'GUIPUZCOA', '34'),
('21', 'HUELVA', '34'),
('22', 'HUESCA', '34'),
('23', 'JAEN', '34'),
('24', 'LEON', '34'),
('25', 'LERIDA', '34'),
('26', 'LA RIOJA', '34'),
('27', 'LUGO', '34'),
('28', 'MADRID', '34'),
('29', 'MALAGA', '34'),
('30', 'MURCIA', '34'),
('31', 'NAVARRA', '34'),
('32', 'ORENSE', '34'),
('33', 'ASTURIAS', '34'),
('34', 'PALENCIA', '34'),
('35', 'LAS PALMAS', '34'),
('36', 'PONTEVEDRA', '34'),
('37', 'SALAMANCA', '34'),
('38', 'SANTA CRUZ DE TENERIFE', '34'),
('39', 'CANTABRIA', '34'),
('40', 'SEGOVIA', '34'),
('41', 'SEVILLA', '34'),
('42', 'SORIA', '34'),
('43', 'TARRAGONA', '34'),
('44', 'TERUEL', '34'),
('45', 'TOLEDO', '34'),
('46', 'VALENCIA', '34'),
('47', 'VALLADOLID', '34'),
('48', 'VIZCAYA', '34'),
('49', 'ZAMORA', '34'),
('50', 'ZARAGOZA', '34'),
('51', 'CEUTA', '34'),
('52', 'MELILLA', '34'),
('01', 'ALAVA'),
('02', 'ALBACETE'),
('03', 'ALICANTE'),
('04', 'ALMERIA'),
('05', 'AVILA'),
('06', 'BADAJOZ'),
('07', 'BALEARES'),
('08', 'BARCELONA'),
('09', 'BURGOS'),
('10', 'CACERES'),
('11', 'CADIZ'),
('12', 'CASTELLON'),
('13', 'CIUDAD REAL'),
('14', 'CORDOBA'),
('15', 'LA CORUÑA'),
('16', 'CUENCA'),
('17', 'GERONA'),
('18', 'GRANADA'),
('19', 'GUADALAJARA'),
('20', 'GUIPUZCOA'),
('21', 'HUELVA'),
('22', 'HUESCA'),
('23', 'JAEN'),
('24', 'LEON'),
('25', 'LERIDA'),
('26', 'LA RIOJA'),
('27', 'LUGO'),
('28', 'MADRID'),
('29', 'MALAGA'),
('30', 'MURCIA'),
('31', 'NAVARRA'),
('32', 'ORENSE'),
('33', 'ASTURIAS'),
('34', 'PALENCIA'),
('35', 'LAS PALMAS'),
('36', 'PONTEVEDRA'),
('37', 'SALAMANCA'),
('38', 'SANTA CRUZ DE TENERIFE'),
('39', 'CANTABRIA'),
('40', 'SEGOVIA'),
('41', 'SEVILLA'),
('42', 'SORIA'),
('43', 'TARRAGONA'),
('44', 'TERUEL'),
('45', 'TOLEDO'),
('46', 'VALENCIA'),
('47', 'VALLADOLID'),
('48', 'VIZCAYA'),
('49', 'ZAMORA'),
('50', 'ZARAGOZA'),
('51', 'CEUTA'),
('52', 'MELILLA'),
]
TAULA_NACIONALIDAD = [
('SB', 'ISLAS SALOMON'),
Expand Down
9 changes: 5 additions & 4 deletions gestionatr/input/messages/A5_29.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ def resultimarevision(self):
@property
def historicoConsumo(self):
data = []
if self.datosdis.historicoConsumo not in [None, False]:
obj = get_rec_attr(self.obj, self._header, False)
if hasattr(obj, 'historicoConsumo'):
for i in self.datosdis.historicoConsumo:
data.append(HistoricoConsumo(i))
return data
Expand Down Expand Up @@ -461,13 +462,13 @@ def fecactdist(self):
@property
def listaproductos(self):
data = []
if self.datosdis.listaproductos not in [None, False]:
obj = get_rec_attr(self.obj, self._header, False)
if (hasattr(obj, 'listaproductos') and
hasattr(obj.listaproductos, 'producto')):
for i in self.datosdis.listaproductos:
data.append(Producto(i))
return data
return data


class HistoricoConsumo(object):
def __init__(self, data):
self.historicoConsumo = data
Expand Down

0 comments on commit d372a29

Please sign in to comment.