|
|
|
|
@ -140,8 +140,11 @@ class InvoiceDetailView(APIView): |
|
|
|
|
price = request.JSON.get('price', None) |
|
|
|
|
comment = request.JSON.get('comment', None) |
|
|
|
|
real_price = request.JSON.get('real_price', None) |
|
|
|
|
key = request.JSON.get('key', None) |
|
|
|
|
pay_count = int(request.JSON.get('pay_count', '1')) |
|
|
|
|
|
|
|
|
|
print(key) |
|
|
|
|
|
|
|
|
|
if bill_id is None: |
|
|
|
|
return Response("Не передан id счёта", status=400) |
|
|
|
|
|
|
|
|
|
@ -189,8 +192,10 @@ class InvoiceDetailView(APIView): |
|
|
|
|
invoice.real_price = invoice.real_price if real_price is None else real_price |
|
|
|
|
return Response(InvoiceSerializer(invoice).data, status=200) |
|
|
|
|
|
|
|
|
|
invoice.real_price = real_price |
|
|
|
|
invoice.method = method |
|
|
|
|
invoice.status = status |
|
|
|
|
invoice.key = key |
|
|
|
|
|
|
|
|
|
if bill.check_pay() and (invoice.price < price): |
|
|
|
|
return Response("""Нельзя менять стоимость по счёту в большую сторону, |
|
|
|
|
|