|
|
|
|
@ -12,6 +12,7 @@ from rest_framework.views import APIView |
|
|
|
|
from yandex_money.models import Payment |
|
|
|
|
from django.conf import settings |
|
|
|
|
|
|
|
|
|
from courses.api import CourseParamsApi |
|
|
|
|
from finance.models import Bill, Invoice |
|
|
|
|
from finance.serializers import BillSerializer, InvoiceSerializer |
|
|
|
|
from lms.global_decorators import transaction_decorator |
|
|
|
|
@ -178,11 +179,12 @@ def get_invoices(request): |
|
|
|
|
writer.writerow(['date', 'student_email', 'full_name', 'course', 'price', 'real_price', 'key']) |
|
|
|
|
|
|
|
|
|
for i in invoices.order_by('-date'): |
|
|
|
|
course_api = CourseParamsApi(i.bill.course_token) |
|
|
|
|
writer.writerow([ |
|
|
|
|
i.date, |
|
|
|
|
i.bill.user.email, |
|
|
|
|
i.bill.user.get_full_name(), |
|
|
|
|
i.bill.course.title, |
|
|
|
|
course_api.get_slug_and_title()['title'], |
|
|
|
|
i.price, |
|
|
|
|
i.real_price, |
|
|
|
|
i.key, |
|
|
|
|
|