Commit ebe5633f authored by Levy--Falk Hugo's avatar Levy--Falk Hugo

Fix le rechargement : la facture est sauvegardée avant la vente.

parent c9ec5b23
......@@ -826,14 +826,13 @@ def recharge(request):
invoice = Facture(user=request.user)
invoice.paiement = refill_form.cleaned_data['payment']
invoice.valid = False
purchase = Vente.objects.create(
invoice.save()
Vente.objects.create(
facture=invoice,
name='solde',
prix=refill_form.cleaned_data['value'],
number=1
)
purchase.save()
invoice.save()
return invoice.paiement.end_payment(invoice, request)
return form({
'rechargeform': refill_form,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment