Borrar RFC
This commit is contained in:
parent
7a2ea36b12
commit
ac9e066f8b
|
@ -1703,6 +1703,24 @@ def _add_emisor(rfc, args):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def _delete_emisor(rfc):
|
||||||
|
con = sqlite3.connect(COMPANIES)
|
||||||
|
cursor = con.cursor()
|
||||||
|
sql = """
|
||||||
|
DELETE FROM names
|
||||||
|
WHERE rfc = '?'"""
|
||||||
|
try:
|
||||||
|
cursor.execute(sql, (rfc,))
|
||||||
|
except Exception as e:
|
||||||
|
log.error(e)
|
||||||
|
return False
|
||||||
|
|
||||||
|
con.commit()
|
||||||
|
cursor.close()
|
||||||
|
con.close()
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def _iniciar_bd():
|
def _iniciar_bd():
|
||||||
rfc = input('Introduce el RFC: ').strip().upper()
|
rfc = input('Introduce el RFC: ').strip().upper()
|
||||||
if not rfc:
|
if not rfc:
|
||||||
|
@ -1750,6 +1768,23 @@ def _agregar_rfc():
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def _borrar_rfc():
|
||||||
|
rfc = input('Introduce el RFC a borrar: ').strip().upper()
|
||||||
|
if not rfc:
|
||||||
|
msg = 'El RFC es requerido'
|
||||||
|
log.error(msg)
|
||||||
|
return
|
||||||
|
|
||||||
|
confirm = input('¿Estás seguro de borrar el RFC?')
|
||||||
|
|
||||||
|
if _delete_emisor(rfc):
|
||||||
|
log.info('RFC borrado correctamente...')
|
||||||
|
return
|
||||||
|
|
||||||
|
log.error('No se pudo borrar el RFC')
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def _listar_rfc():
|
def _listar_rfc():
|
||||||
data = util.get_rfcs()
|
data = util.get_rfcs()
|
||||||
for row in data:
|
for row in data:
|
||||||
|
|
Loading…
Reference in New Issue