Merge branch 'develop'
Fix - Plantilla ODS predeterminada
This commit is contained in:
commit
b9dde26062
|
@ -13,7 +13,6 @@ source/media
|
|||
|
||||
# Sphinx documentation
|
||||
docs/
|
||||
*.ods
|
||||
*.xlsx
|
||||
|
||||
credenciales.conf
|
||||
|
|
|
@ -1460,11 +1460,12 @@ class ImportFacturaLibre(object):
|
|||
return data
|
||||
|
||||
def _categorias(self):
|
||||
sql = "SELECT * FROM categorias"
|
||||
sql = "SELECT * FROM categorias ORDER BY id_padre"
|
||||
self._cursor.execute(sql)
|
||||
rows = self._cursor.fetchall()
|
||||
|
||||
fields = (
|
||||
('id', 'id'),
|
||||
('categoria', 'categoria'),
|
||||
('id_padre', 'padre'),
|
||||
)
|
||||
|
@ -1561,9 +1562,11 @@ class ImportFacturaLibre(object):
|
|||
|
||||
tasas = {
|
||||
'16': 0.16,
|
||||
'11': 0.11,
|
||||
'-10': 0.10,
|
||||
'0': 0.0,
|
||||
'-2/3': 0.666667,
|
||||
'-0.5': 0.005,
|
||||
}
|
||||
|
||||
data = []
|
||||
|
|
|
@ -3222,7 +3222,6 @@ class FacturasPagos(BaseModel):
|
|||
auto_round=True)
|
||||
saldo = DecimalField(default=0.0, max_digits=18, decimal_places=6,
|
||||
auto_round=True)
|
||||
# ~ cancelado = BooleanField(default=False)
|
||||
|
||||
class Meta:
|
||||
order_by = ('factura',)
|
||||
|
@ -3351,16 +3350,16 @@ def authenticate(args):
|
|||
respuesta = {'login': False, 'msg': 'No Autorizado', 'user': ''}
|
||||
values = util.get_con(args['rfc'])
|
||||
if not values:
|
||||
return respuesta
|
||||
return respuesta, None
|
||||
|
||||
conectar(values)
|
||||
try:
|
||||
obj = Usuarios.get(usuario=args['usuario'], es_activo=True)
|
||||
except Usuarios.DoesNotExist:
|
||||
return respuesta
|
||||
return respuesta, None
|
||||
|
||||
if not obj.contraseña.check_password(args['contra']):
|
||||
return respuesta
|
||||
return respuesta, None
|
||||
|
||||
obj.ultimo_ingreso = util.now()
|
||||
obj.save()
|
||||
|
@ -3756,6 +3755,7 @@ def _importar_facturas(rows):
|
|||
except IntegrityError as e:
|
||||
msg = '\tFactura: id: {}'.format(row['serie'] + str(row['folio']))
|
||||
log.error(msg)
|
||||
|
||||
log.info('\tFacturas importadas...')
|
||||
return
|
||||
|
||||
|
@ -3763,25 +3763,24 @@ def _importar_facturas(rows):
|
|||
def _importar_categorias(rows):
|
||||
log.info('\tImportando Categorías...')
|
||||
for row in rows:
|
||||
if row['padre'] is None:
|
||||
filters = (
|
||||
(Categorias.categoria==row['categoria']) &
|
||||
(Categorias.padre.is_null(True))
|
||||
)
|
||||
else:
|
||||
filters = (
|
||||
(Categorias.categoria==row['categoria']) &
|
||||
(Categorias.padre==row['padre'])
|
||||
)
|
||||
|
||||
if Categorias.exists(filters):
|
||||
continue
|
||||
|
||||
try:
|
||||
Categorias.create(**row)
|
||||
except IntegrityError:
|
||||
msg = '\tCategoria: ({}) {}'.format(row['padre'], row['categoria'])
|
||||
log.error(msg)
|
||||
# ~ if row['padre'] is None:
|
||||
# ~ filters = (
|
||||
# ~ (Categorias.categoria==row['categoria']) &
|
||||
# ~ (Categorias.padre.is_null(True))
|
||||
# ~ )
|
||||
# ~ else:
|
||||
# ~ filters = (
|
||||
# ~ (Categorias.categoria==row['categoria']) &
|
||||
# ~ (Categorias.padre==row['padre'])
|
||||
# ~ )
|
||||
with database_proxy.atomic() as txn:
|
||||
# ~ if Categorias.exists(filters):
|
||||
# ~ continue
|
||||
try:
|
||||
Categorias.create(**row)
|
||||
except IntegrityError:
|
||||
msg = '\tCategoria: ({}) {}'.format(row['padre'], row['categoria'])
|
||||
log.error(msg)
|
||||
|
||||
log.info('\tCategorías importadas...')
|
||||
return
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue