]> git.parisson.com Git - teleforma.git/commitdiff
Add fascicle on receipt
authorGael Le Mignot <gael@pilotsystems.net>
Thu, 3 Oct 2024 08:28:54 +0000 (10:28 +0200)
committerGael Le Mignot <gael@pilotsystems.net>
Thu, 3 Oct 2024 08:28:54 +0000 (10:28 +0200)
app/settings.py
teleforma/views/crfpa.py

index 4e6991c3a6f3ad2bf46613407be6f591d8f6713d..69b1aa8cf17856fd5a10f54d5850c4a29c15c116 100644 (file)
@@ -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
 
index bb507b67a6c21796c3fc624cc1e8d5bab7e165b5..f28fe8e7ab11b500ba9e8921388b9a70a8b196a3 100644 (file)
@@ -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': "<b>Envoi des fascicules</b>",
+                           'unit_price': settings.FASICLE_OPTION_PRICE,
+                           'amount': 1,
+                           'discount': 0, }, )
         for item in items:
             item['total'] = item['unit_price'] * item['amount']
             if item['discount']: