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