UI cancelar

This commit is contained in:
Mauricio Baeza 2017-10-17 12:45:49 -05:00
parent f38d194e4a
commit e0532b7cb0
1 changed files with 13 additions and 0 deletions

View File

@ -1037,6 +1037,8 @@ class ImportFacturaLibre(object):
)
data = []
sql1 = "SELECT correo FROM correos WHERE id_cliente=?"
sql2 = "SELECT telefono FROM telefonos WHERE id_cliente=?"
for row in rows:
new = {t: row[s] for s, t in fields}
new['slug'] = to_slug(new['nombre'])
@ -1046,5 +1048,16 @@ class ImportFacturaLibre(object):
new['tipo_persona'] = 3
elif len(new['rfc']) == 12:
new['tipo_persona'] = 2
self._cursor.execute(sql1, (new['id'],))
tmp = self._cursor.fetchall()
if tmp:
new['correo_facturas'] = ', '.join([r[0] for r in tmp])
self._cursor.execute(sql2, (new['id'],))
tmp = self._cursor.fetchall()
if tmp:
new['telefonos'] = ', '.join([r[0] for r in tmp])
data.append(new)
return data