forked from elmau/empresa-libre
UI cancelar
This commit is contained in:
parent
f38d194e4a
commit
e0532b7cb0
|
@ -1037,6 +1037,8 @@ class ImportFacturaLibre(object):
|
||||||
)
|
)
|
||||||
data = []
|
data = []
|
||||||
|
|
||||||
|
sql1 = "SELECT correo FROM correos WHERE id_cliente=?"
|
||||||
|
sql2 = "SELECT telefono FROM telefonos WHERE id_cliente=?"
|
||||||
for row in rows:
|
for row in rows:
|
||||||
new = {t: row[s] for s, t in fields}
|
new = {t: row[s] for s, t in fields}
|
||||||
new['slug'] = to_slug(new['nombre'])
|
new['slug'] = to_slug(new['nombre'])
|
||||||
|
@ -1046,5 +1048,16 @@ class ImportFacturaLibre(object):
|
||||||
new['tipo_persona'] = 3
|
new['tipo_persona'] = 3
|
||||||
elif len(new['rfc']) == 12:
|
elif len(new['rfc']) == 12:
|
||||||
new['tipo_persona'] = 2
|
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)
|
data.append(new)
|
||||||
return data
|
return data
|
||||||
|
|
Loading…
Reference in New Issue