forked from elmau/empresa-libre
Fix in global invoice
This commit is contained in:
parent
5bbad9ef58
commit
7fc6264322
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue