From 0e3ade106f4bfeb7c340b4c4c7d406028363a466 Mon Sep 17 00:00:00 2001 From: Gael Le Mignot Date: Thu, 3 Oct 2024 10:28:54 +0200 Subject: [PATCH] Add fascicle on receipt --- app/settings.py | 1 + teleforma/views/crfpa.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/app/settings.py b/app/settings.py index 4e6991c3..69b1aa8c 100644 --- a/app/settings.py +++ b/app/settings.py @@ -598,6 +598,7 @@ TELEFORMA_PRIVATE_MEDIA_USE_S3 = True TELFORMA_MEDIA_DOWNLOAD = False ORAL_OPTION_PRICE = 250 +FASICLE_OPTION_PRICE = 110 # use to share correction doc / media accross different training CORRECTIONS_COURSE_TYPE_ID = 2 diff --git a/teleforma/views/crfpa.py b/teleforma/views/crfpa.py index bb507b67..f28fe8e7 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -901,6 +901,8 @@ class ReceiptPDFView(PDFTemplateResponseMixin, TemplateView): if oral_1: substract += settings.ORAL_OPTION_PRICE + if student.fascicule: + substract += settings.FASICLE_OPTION_PRICE items.append({ 'label': label, 'unit_price': student.total_fees - substract - student.total_discount, @@ -911,6 +913,12 @@ class ReceiptPDFView(PDFTemplateResponseMixin, TemplateView): 'unit_price': settings.ORAL_OPTION_PRICE, 'amount': 1, 'discount': 0, }, ) + + if student.fascicule: + items.append({ 'label': "Envoi des fascicules", + 'unit_price': settings.FASICLE_OPTION_PRICE, + 'amount': 1, + 'discount': 0, }, ) for item in items: item['total'] = item['unit_price'] * item['amount'] if item['discount']: -- 2.39.5