Fix in global invoice
This commit is contained in:
parent
5bbad9ef58
commit
7fc6264322
|
@ -5865,8 +5865,12 @@ class Facturas(BaseModel):
|
||||||
if is_global:
|
if is_global:
|
||||||
ticket = None
|
ticket = None
|
||||||
try:
|
try:
|
||||||
|
where = (
|
||||||
|
(fn.Concat(Tickets.serie, Tickets.folio)==row.clave) &
|
||||||
|
(Tickets.estatus=='Facturado')
|
||||||
|
)
|
||||||
ticket = (Tickets
|
ticket = (Tickets
|
||||||
.get(fn.Concat(Tickets.serie, Tickets.folio)==row.clave)
|
.get(where)
|
||||||
)
|
)
|
||||||
product_taxes = (TicketsImpuestos
|
product_taxes = (TicketsImpuestos
|
||||||
.select()
|
.select()
|
||||||
|
@ -8227,6 +8231,9 @@ class Tickets(BaseModel):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
order_by = ('fecha',)
|
order_by = ('fecha',)
|
||||||
|
indexes = (
|
||||||
|
(('serie', 'folio'), True),
|
||||||
|
)
|
||||||
|
|
||||||
def _get_folio(self, serie):
|
def _get_folio(self, serie):
|
||||||
inicio = (Tickets
|
inicio = (Tickets
|
||||||
|
@ -8564,7 +8571,6 @@ class Tickets(BaseModel):
|
||||||
tax_id = r.impuesto.id
|
tax_id = r.impuesto.id
|
||||||
tasa = r.impuesto.tasa
|
tasa = r.impuesto.tasa
|
||||||
tax_importe = round(tasa * r.base, DECIMALES)
|
tax_importe = round(tasa * r.base, DECIMALES)
|
||||||
|
|
||||||
if tax_id in tax_sum:
|
if tax_id in tax_sum:
|
||||||
tax_sum[tax_id]['base'] += r.base
|
tax_sum[tax_id]['base'] += r.base
|
||||||
tax_sum[tax_id]['importe'] += tax_importe
|
tax_sum[tax_id]['importe'] += tax_importe
|
||||||
|
@ -8574,7 +8580,6 @@ class Tickets(BaseModel):
|
||||||
'key': r.impuesto.key,
|
'key': r.impuesto.key,
|
||||||
'base': r.base,
|
'base': r.base,
|
||||||
'importe': tax_importe}
|
'importe': tax_importe}
|
||||||
print(values)
|
|
||||||
tax_sum[tax_id] = values
|
tax_sum[tax_id] = values
|
||||||
|
|
||||||
for i, tax in tax_sum.items():
|
for i, tax in tax_sum.items():
|
||||||
|
@ -11266,6 +11271,9 @@ def _migrate_tables(rfc=''):
|
||||||
regimen_fiscal = TextField(default='')
|
regimen_fiscal = TextField(default='')
|
||||||
migrations.append(migrator.add_column(table, field, regimen_fiscal))
|
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:
|
if migrations:
|
||||||
with database_proxy.atomic() as txn:
|
with database_proxy.atomic() as txn:
|
||||||
migrate(*migrations)
|
migrate(*migrations)
|
||||||
|
|
Loading…
Reference in New Issue