add db to repo
This commit is contained in:
parent
f2fc2362a7
commit
9b3973805e
7 changed files with 97 additions and 55 deletions
|
@ -1,53 +1,93 @@
|
|||
{% extends '_base.html' %}
|
||||
{% load static %}
|
||||
{% extends '_base.html' %}
|
||||
{% load static %}
|
||||
{% load processes_tags %}
|
||||
{% load humanize %}
|
||||
|
||||
{% block sidebar %}
|
||||
{% include 'sidebars/admin.html' %}
|
||||
{% endblock sidebar %}
|
||||
|
||||
{% block navbar %}
|
||||
{% include 'navbars/admin.html' %}
|
||||
{% endblock navbar %}
|
||||
|
||||
{% block title %}{{ step.name }} - درخواست {{ instance.code }}{% endblock %}
|
||||
|
||||
{% block style %}
|
||||
<link rel="stylesheet" href="{% static 'assets/vendor/libs/bs-stepper/bs-stepper.css' %}">
|
||||
<!-- Persian Date Picker CSS -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/persian-datepicker@latest/dist/css/persian-datepicker.min.css">
|
||||
<style>
|
||||
@media print {
|
||||
.no-print { display: none !important; }
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include '_toasts.html' %}
|
||||
{% csrf_token %}
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="row">
|
||||
<div class="col-12 mb-4">
|
||||
<div class="d-flex align-items-center justify-content-between mb-3 no-print">
|
||||
<div>
|
||||
<h4 class="mb-1">{{ step.name }}: {{ instance.process.name }}</h4>
|
||||
<small class="text-muted d-block">
|
||||
اشتراک آب: {{ instance.well.water_subscription_number|default:"-" }}
|
||||
| نماینده: {{ instance.representative.profile.national_code|default:"-" }}
|
||||
</small>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<a class="btn btn-outline-secondary" target="_blank" href="{% url 'certificates:certificate_print' instance.id %}"><i class="bx bx-printer"></i> پرینت</a>
|
||||
|
||||
{% block content %}
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
<div class="d-flex align-items-center justify-content-between mb-3">
|
||||
<div>
|
||||
<h4 class="mb-1">گواهی نهایی</h4>
|
||||
<small class="text-muted d-block">کد درخواست: {{ instance.code }}</small>
|
||||
</div>
|
||||
<div class="d-flex gap-2">
|
||||
<a class="btn btn-outline-secondary" target="_blank" href="{% url 'certificates:certificate_print' instance.id %}"><i class="bx bx-printer"></i> پرینت</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="text-center mb-3">
|
||||
{% if template.company and template.company.logo %}
|
||||
<img src="{{ template.company.logo.url }}" alt="logo" style="max-height:80px">
|
||||
{% endif %}
|
||||
<h5 class="mt-2">{{ cert.rendered_title }}</h5>
|
||||
{% if template.company %}<div class="text-muted">{{ template.company.name }}</div>{% endif %}
|
||||
</div>
|
||||
<div class="mt-3" style="white-space:pre-line; line-height:1.9;">
|
||||
{{ cert.rendered_body|safe }}
|
||||
</div>
|
||||
<div class="mt-4 d-flex justify-content-between align-items-end">
|
||||
<div>
|
||||
<div>تاریخ صدور: {{ cert.issued_at }}</div>
|
||||
<a href="{% url 'processes:request_list' %}" class="btn btn-outline-secondary">بازگشت</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
{% if template.company and template.company.signature %}
|
||||
<img src="{{ template.company.signature.url }}" alt="seal" style="max-height:100px">
|
||||
{% endif %}
|
||||
<div>مهر و امضای شرکت</div>
|
||||
|
||||
<div class="bs-stepper wizard-vertical vertical mt-2 no-print">
|
||||
{% stepper_header instance step %}
|
||||
<div class="bs-stepper-content">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="text-center mb-3">
|
||||
{% if template.company and template.company.logo %}
|
||||
<img src="{{ template.company.logo.url }}" alt="logo" style="max-height:80px">
|
||||
{% endif %}
|
||||
<h5 class="mt-2">{{ cert.rendered_title }}</h5>
|
||||
{% if template.company %}<div class="text-muted">{{ template.company.name }}</div>{% endif %}
|
||||
</div>
|
||||
<div class="mt-3" style="white-space:pre-line; line-height:1.9;">
|
||||
{{ cert.rendered_body|safe }}
|
||||
</div>
|
||||
<div class="mt-4 d-flex justify-content-between align-items-end">
|
||||
<div>
|
||||
<div>تاریخ صدور: {{ cert.issued_at }}</div>
|
||||
</div>
|
||||
<div class="text-center">
|
||||
{% if template.company and template.company.signature %}
|
||||
<img src="{{ template.company.signature.url }}" alt="seal" style="max-height:100px">
|
||||
{% endif %}
|
||||
<div>مهر و امضای شرکت</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer d-flex justify-content-between">
|
||||
{% if previous_step %}
|
||||
<a href="{% url 'processes:step_detail' instance.id previous_step.id %}" class="btn btn-label-secondary">قبلی</a>
|
||||
{% else %}<span></span>{% endif %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-primary" type="submit">تایید و پایان</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer d-flex justify-content-between">
|
||||
{% if previous_step %}
|
||||
<a href="{% url 'processes:step_detail' instance.id previous_step.id %}" class="btn btn-label-secondary">قبلی</a>
|
||||
{% else %}<span></span>{% endif %}
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<button class="btn btn-primary" type="submit">تایید و پایان</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ def _render_template(template: CertificateTemplate, instance: ProcessInstance):
|
|||
@login_required
|
||||
def certificate_step(request, instance_id, step_id):
|
||||
instance = get_object_or_404(ProcessInstance, id=instance_id)
|
||||
|
||||
step = get_object_or_404(instance.process.steps, id=step_id)
|
||||
# Ensure all previous steps are completed and invoice settled
|
||||
prior_steps = instance.process.steps.filter(order__lt=instance.current_step.order if instance.current_step else 9999)
|
||||
incomplete = StepInstance.objects.filter(process_instance=instance, step__in=prior_steps).exclude(status='completed').exists()
|
||||
|
@ -97,6 +97,7 @@ def certificate_step(request, instance_id, step_id):
|
|||
'cert': cert,
|
||||
'previous_step': previous_step,
|
||||
'next_step': next_step,
|
||||
'step': step,
|
||||
})
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue