From: Gael Le Mignot Date: Mon, 11 May 2020 12:46:04 +0000 (+0200) Subject: Added oral option on receipt X-Git-Tag: 1.4.2~1^2~1 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=bb2b7637d5e42c8226e94139a492ceb0324b06af;p=teleforma.git Added oral option on receipt --- diff --git a/teleforma/views/crfpa.py b/teleforma/views/crfpa.py index c83fc6aa..cf5cfcf7 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -50,6 +50,8 @@ from django.forms.formsets import all_valid from django.core.exceptions import ValidationError from django.contrib.sites.models import Site +ORAL_OPTION_PRICE = 250 + def get_course_code(obj): if obj: return unicode(obj.code) @@ -674,12 +676,19 @@ class ReceiptPDFView(PDFTemplateResponseMixin, TemplateView): label += u"%d heures de formation du %s au %s" % (training.duration, period.date_begin.strftime('%d/%m/%Y'), period.date_end.strftime('%d/%m/%Y'),) - - + + if student.oral_1: + substract += ORAL_OPTION_PRICE + items.append({ 'label': label, 'unit_price': student.total_fees - substract - student.total_discount, 'amount': 1, 'discount': student.total_discount, }, ) + if student.oral_1: + items.append({ 'label': "Option langue", + 'unit_price': ORAL_OPTION_PRICE, + 'amount': 1, + 'discount': 0, }, ) for item in items: item['total'] = item['unit_price'] * item['amount'] if item['discount']: