Fix - Prefacturas con descuentos
This commit is contained in:
parent
3ef8807ee9
commit
175269cd3a
|
@ -4676,12 +4676,12 @@ class PreFacturas(BaseModel):
|
|||
|
||||
product['cantidad'] = cantidad
|
||||
product['valor_unitario'] = valor_unitario
|
||||
product['descuento'] = descuento
|
||||
product['descuento'] = round(descuento * cantidad, DECIMALES)
|
||||
product['precio_final'] = precio_final
|
||||
product['importe'] = round(cantidad * valor_unitario, DECIMALES)
|
||||
|
||||
descuento_cfdi += descuento
|
||||
subtotal += importe
|
||||
descuento_cfdi += product['descuento']
|
||||
subtotal += product['importe']
|
||||
|
||||
PreFacturasDetalle.create(**product)
|
||||
|
||||
|
@ -4736,7 +4736,7 @@ class PreFacturas(BaseModel):
|
|||
+ locales_traslados - locales_retenciones
|
||||
total_mn = round(total * invoice.tipo_cambio, DECIMALES)
|
||||
data = {
|
||||
'subtotal': subtotal + descuento,
|
||||
'subtotal': subtotal,
|
||||
'descuento': descuento_cfdi,
|
||||
'total': total,
|
||||
'total_mn': total_mn,
|
||||
|
|
Loading…
Reference in New Issue