|
|
|
@ -109,8 +109,8 @@ class InvoiceDetailView(APIView): |
|
|
|
price = request.JSON.get('price', None) |
|
|
|
price = request.JSON.get('price', None) |
|
|
|
comment = request.JSON.get('comment', None) |
|
|
|
comment = request.JSON.get('comment', None) |
|
|
|
real_price = request.JSON.get('real_price', None) |
|
|
|
real_price = request.JSON.get('real_price', None) |
|
|
|
rebilling_on = request.JSON.get('is_rebilling', False) |
|
|
|
# rebilling_on = request.JSON.get('is_rebilling', False) |
|
|
|
pay_count = request.JSON.get('pay_count', None) |
|
|
|
pay_count = int(request.JSON.get('pay_count', 0)) + 1 |
|
|
|
|
|
|
|
|
|
|
|
if bill_id is None: |
|
|
|
if bill_id is None: |
|
|
|
return Response("Не передан id счёта", status=400) |
|
|
|
return Response("Не передан id счёта", status=400) |
|
|
|
@ -129,7 +129,7 @@ class InvoiceDetailView(APIView): |
|
|
|
if bill.check_validate(invoice_id) and is_open: |
|
|
|
if bill.check_validate(invoice_id) and is_open: |
|
|
|
return Response("Уже есть платёж открывающий курс", status=400) |
|
|
|
return Response("Уже есть платёж открывающий курс", status=400) |
|
|
|
|
|
|
|
|
|
|
|
if rebilling_on: |
|
|
|
if pay_count > 1: |
|
|
|
invoice = InvoiceRebilling.objects.create( |
|
|
|
invoice = InvoiceRebilling.objects.create( |
|
|
|
bill=bill, |
|
|
|
bill=bill, |
|
|
|
method=method, |
|
|
|
method=method, |
|
|
|
|