mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-26 14:42:25 +00:00
Fix le rechargement : la facture est sauvegardée avant la vente.
This commit is contained in:
parent
068a78a5ae
commit
a0c696edce
1 changed files with 2 additions and 3 deletions
|
@ -826,14 +826,13 @@ def recharge(request):
|
||||||
invoice = Facture(user=request.user)
|
invoice = Facture(user=request.user)
|
||||||
invoice.paiement = refill_form.cleaned_data['payment']
|
invoice.paiement = refill_form.cleaned_data['payment']
|
||||||
invoice.valid = False
|
invoice.valid = False
|
||||||
purchase = Vente.objects.create(
|
invoice.save()
|
||||||
|
Vente.objects.create(
|
||||||
facture=invoice,
|
facture=invoice,
|
||||||
name='solde',
|
name='solde',
|
||||||
prix=refill_form.cleaned_data['value'],
|
prix=refill_form.cleaned_data['value'],
|
||||||
number=1
|
number=1
|
||||||
)
|
)
|
||||||
purchase.save()
|
|
||||||
invoice.save()
|
|
||||||
return invoice.paiement.end_payment(invoice, request)
|
return invoice.paiement.end_payment(invoice, request)
|
||||||
return form({
|
return form({
|
||||||
'rechargeform': refill_form,
|
'rechargeform': refill_form,
|
||||||
|
|
Loading…
Reference in a new issue