Fix - Prefacturas con descuentos

This commit is contained in:
Mauricio Baeza 2018-03-01 13:50:27 -06:00
parent 3ef8807ee9
commit 175269cd3a
1 changed files with 4 additions and 4 deletions

View File

@ -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,