Fix in global invoice

This commit is contained in:
Mauricio 2023-04-14 17:56:12 -06:00
commit 3b54ef0a36
3 changed files with 13 additions and 5 deletions

View File

@ -1 +1 @@
2.0.2
2.0.3

View File

@ -5865,8 +5865,12 @@ class Facturas(BaseModel):
if is_global:
ticket = None
try:
where = (
(fn.Concat(Tickets.serie, Tickets.folio)==row.clave) &
(Tickets.estatus=='Facturado')
)
ticket = (Tickets
.get(fn.Concat(Tickets.serie, Tickets.folio)==row.clave)
.get(where)
)
product_taxes = (TicketsImpuestos
.select()
@ -8227,6 +8231,9 @@ class Tickets(BaseModel):
class Meta:
order_by = ('fecha',)
indexes = (
(('serie', 'folio'), True),
)
def _get_folio(self, serie):
inicio = (Tickets
@ -8564,7 +8571,6 @@ class Tickets(BaseModel):
tax_id = r.impuesto.id
tasa = r.impuesto.tasa
tax_importe = round(tasa * r.base, DECIMALES)
if tax_id in tax_sum:
tax_sum[tax_id]['base'] += r.base
tax_sum[tax_id]['importe'] += tax_importe
@ -8574,7 +8580,6 @@ class Tickets(BaseModel):
'key': r.impuesto.key,
'base': r.base,
'importe': tax_importe}
print(values)
tax_sum[tax_id] = values
for i, tax in tax_sum.items():
@ -11266,6 +11271,9 @@ def _migrate_tables(rfc=''):
regimen_fiscal = TextField(default='')
migrations.append(migrator.add_column(table, field, regimen_fiscal))
# ~ migrations.append(migrator.add_index(table, ('serie', 'folio'), True))
# ~ migrator.drop_index('tickets', 'tickets_serie_folio')
if migrations:
with database_proxy.atomic() as txn:
migrate(*migrations)

View File

@ -42,7 +42,7 @@ except ImportError:
DEBUG = DEBUG
VERSION = '2.0.2'
VERSION = '2.0.3'
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)