Пример #1
0
    def get_context_data(self, **kwargs):
        try:
            application = utils.get_session_application(self.request.session)
        except Exception as e:
            messages.error(self.request, e.message)
            return redirect("wl_applications:new_application")

        kwargs["is_payment_required"] = (
            not is_licence_free(generate_product_code(application))
            and not application.invoice_reference
            and is_customer(self.request.user)
        )

        if application.data:
            utils.convert_documents_to_url(application.data, application.documents.all(), "")

        if application.hard_copy is not None:
            application.licence_type.application_schema, application.data = utils.append_app_document_to_schema_data(
                application.licence_type.application_schema, application.data, application.hard_copy.file.url
            )
        else:
            kwargs["data"] = application.data

        kwargs["application"] = application

        return super(PreviewView, self).get_context_data(**kwargs)
Пример #2
0
    def get_context_data(self, **kwargs):
        application = utils.get_session_application(self.request.session)

        kwargs['is_payment_required'] = not is_licence_free(generate_product_title(application)) and \
            not application.invoice_reference and is_customer(self.request.user)

        if application.data:
            utils.convert_documents_to_url(application.data, application.documents.all(), '')

        if application.hard_copy is not None:
            application.licence_type.application_schema, application.data = utils.\
                append_app_document_to_schema_data(application.licence_type.application_schema, application.data,
                                                   application.hard_copy.file.url)
        else:
            kwargs['data'] = application.data

        kwargs['application'] = application

        return super(PreviewView, self).get_context_data(**kwargs)
Пример #3
0
    def get(self, request, *args, **kwargs):
        application = utils.get_session_application(self.request.session)

        application.lodgement_sequence += 1
        application.lodgement_date = datetime.now().date()

        if application.customer_status == 'amendment_required':
            # this is a 're-lodged' application after some amendment were required.
            # from this point we assume that all the amendments have been amended.
            AmendmentRequest.objects.filter(application=application).filter(
                status='requested').update(status='amended')
            application.review_status = 'amended'
            application.processing_status = 'ready_for_action'
        else:
            application.processing_status = 'new'

        application.customer_status = 'under_review'

        if not application.lodgement_number:
            application.lodgement_number = '%s-%s' % (
                str(application.licence_type.pk).zfill(LICENCE_TYPE_NUM_CHARS),
                str(application.pk).zfill(LODGEMENT_NUMBER_NUM_CHARS))

        application.log_user_action(
            ApplicationUserAction.ACTION_LODGE_APPLICATION.format(application),
            request)
        # update invoice reference if received, else keep the same
        application.invoice_reference = request.GET.get(
            'invoice', application.invoice_reference)

        application.save(version_user=application.applicant,
                         version_comment='Details Modified')

        context = {}

        context['application'] = application

        context['show_invoice'] = not is_licence_free(generate_product_title(application)) and \
            not application.application_type == 'amendment'

        delete_session_application(request.session)

        return render(request, self.template_name, context)
Пример #4
0
    def get(self, request, *args, **kwargs):
        application = utils.get_session_application(self.request.session)

        # update invoice reference if received, else keep the same
        application.invoice_reference = request.GET.get(
            'invoice', application.invoice_reference)

        application.save()

        context = {}

        context['application'] = application

        context['show_invoice'] = not is_licence_free(generate_product_title(application)) and \
            not application.application_type == 'amendment'

        delete_session_application(request.session)

        return render(request, self.template_name, context)
Пример #5
0
    def get_context_data(self, **kwargs):
        application = utils.get_session_application(self.request.session)

        kwargs['is_payment_required'] = not is_licence_free(generate_product_title(application)) and \
            not application.invoice_reference and is_customer(self.request.user)

        if application.data:
            utils.convert_documents_to_url(application.data,
                                           application.documents.all(), '')

        if application.hard_copy is not None:
            application.licence_type.application_schema, application.data = utils.\
                append_app_document_to_schema_data(application.licence_type.application_schema, application.data,
                                                   application.hard_copy.file.url)
        else:
            kwargs['data'] = application.data

        kwargs['application'] = application

        return super(PreviewView, self).get_context_data(**kwargs)
Пример #6
0
    def get(self, request, *args, **kwargs):
        application = utils.get_session_application(self.request.session)

        application.lodgement_sequence += 1
        application.lodgement_date = datetime.now().date()

        if application.customer_status == 'amendment_required':
            # this is a 're-lodged' application after some amendment were required.
            # from this point we assume that all the amendments have been amended.
            AmendmentRequest.objects.filter(application=application).filter(status='requested').update(status='amended')
            application.review_status = 'amended'
            application.processing_status = 'ready_for_action'
        else :
            application.processing_status = 'new'

        application.customer_status = 'under_review'

        if not application.lodgement_number:
            application.lodgement_number = '%s-%s' % (str(application.licence_type.pk).zfill(LICENCE_TYPE_NUM_CHARS),
                                                      str(application.pk).zfill(LODGEMENT_NUMBER_NUM_CHARS))

        application.log_user_action(
            ApplicationUserAction.ACTION_LODGE_APPLICATION.format(application),
            request
        )
        # update invoice reference if received, else keep the same
        application.invoice_reference = request.GET.get('invoice', application.invoice_reference)

        application.save(version_user=application.applicant, version_comment='Details Modified')

        context = {}

        context['application'] = application

        context['show_invoice'] = not is_licence_free(generate_product_title(application)) and \
            not application.application_type == 'amendment'

        delete_session_application(request.session)

        return render(request, self.template_name, context)
Пример #7
0
    def get(self, request, *args, **kwargs):
        try:
            application = utils.get_session_application(self.request.session)
        except Exception as e:
            messages.error(self.request, e.message)
            return redirect('wl_applications:new_application')

        # update invoice reference if received, else keep the same
        application.invoice_reference = request.GET.get('invoice', application.invoice_reference)

        application.save()

        context = {}

        context['application'] = application

        context['show_invoice'] = not is_licence_free(generate_product_code(application)) and \
            not application.is_licence_amendment

        delete_session_application(request.session)

        return render(request, self.template_name, context)
Пример #8
0
    def get(self, request, *args, **kwargs):
        try:
            application = utils.get_session_application(self.request.session)
        except Exception as e:
            messages.error(self.request, str(e))
            return redirect('wl_applications:new_application')

        # update invoice reference if received, else keep the same
        application.invoice_reference = request.GET.get(
            'invoice', application.invoice_reference)

        application.save()

        context = {}

        context['application'] = application

        context['show_invoice'] = not is_licence_free(generate_product_title(application)) and \
            not application.is_licence_amendment

        delete_session_application(request.session)

        return render(request, self.template_name, context)