Regresar productos en orden al refacturar

This commit is contained in:
El Mau 2022-04-01 09:50:10 -06:00
commit 3a5fbc609b
1 changed files with 4 additions and 4 deletions

View File

@ -6809,7 +6809,7 @@ class FacturasDetalle(BaseModel):
def reinvoice(cls, id):
data = []
products = FacturasDetalle.select().where(FacturasDetalle.factura==id)
for p in reversed(products):
for p in products:
row = {'delete': '-', 'id_product': p.producto.id}
row['clave'] = p.clave
row['clave_sat'] = p.clave_sat
@ -6830,7 +6830,7 @@ class FacturasDetalle(BaseModel):
def get_detalle(cls, id):
data = []
products = FacturasDetalle.select().where(FacturasDetalle.factura==id)
for p in reversed(products):
for p in products:
row = {'id_product': p.producto.id}
row['clave'] = p.clave
row['clave_sat'] = p.clave_sat
@ -6899,7 +6899,7 @@ class PreFacturasDetalle(BaseModel):
productos = PreFacturasDetalle.select().where(
PreFacturasDetalle.factura==id)
for p in reversed(productos):
for p in productos:
row = {'id_product': p.producto.id}
row['clave'] = p.producto.clave
row['descripcion'] = p.descripcion
@ -6935,7 +6935,7 @@ class PreFacturasDetalle(BaseModel):
productos = PreFacturasDetalle.select().where(
PreFacturasDetalle.factura==id)
for p in reversed(productos):
for p in productos:
producto = {}
producto['noidentificacion'] = '{}\n(SAT {})'.format(
p.producto.clave, p.producto.clave_sat)