complete first version of main proccess
This commit is contained in:
		
							parent
							
								
									6ff4740d04
								
							
						
					
					
						commit
						f2fc2362a7
					
				
					 61 changed files with 3280 additions and 28 deletions
				
			
		
							
								
								
									
										29
									
								
								contracts/templates/contracts/contract_missing.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								contracts/templates/contracts/contract_missing.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,29 @@
 | 
			
		|||
{% extends '_base.html' %}
 | 
			
		||||
{% load static %}
 | 
			
		||||
 | 
			
		||||
{% block sidebar %}
 | 
			
		||||
  {% include 'sidebars/admin.html' %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block navbar %}
 | 
			
		||||
  {% include 'navbars/admin.html' %}
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block title %}قالب قرارداد یافت نشد{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<div class="container-xxl flex-grow-1 container-p-y">
 | 
			
		||||
  <div class="alert alert-warning">
 | 
			
		||||
    <h5 class="alert-heading mb-2">قالب قرارداد تعریف نشده است</h5>
 | 
			
		||||
    <p class="mb-2">برای نمایش این مرحله، ابتدا یک «قالب قرارداد» ایجاد کنید.</p>
 | 
			
		||||
    <ul class="mb-2">
 | 
			
		||||
      <li>از منوی ادمین یک قالب با متن قرارداد ایجاد کنید.</li>
 | 
			
		||||
      <li>در متن میتوانید از جاینگهدارهایی مثل {{customer_full_name}} ، {{national_code}} ، {{water_subscription_number}} استفاده کنید.</li>
 | 
			
		||||
    </ul>
 | 
			
		||||
    <a class="btn btn-primary" href="/admin/contracts/contracttemplate/add/">ایجاد قالب قرارداد</a>
 | 
			
		||||
    <a class="btn btn-outline-secondary" href="{% url 'processes:request_list' %}">بازگشت</a>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										52
									
								
								contracts/templates/contracts/contract_print.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								contracts/templates/contracts/contract_print.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,52 @@
 | 
			
		|||
<!DOCTYPE html>
 | 
			
		||||
<html lang="fa" dir="rtl">
 | 
			
		||||
<head>
 | 
			
		||||
  <meta charset="utf-8">
 | 
			
		||||
  <meta name="viewport" content="width=device-width, initial-scale=1">
 | 
			
		||||
  <title>چاپ قرارداد {{ instance.code }}</title>
 | 
			
		||||
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
 | 
			
		||||
  <style>
 | 
			
		||||
    @page { size: A4; margin: 1.2cm; }
 | 
			
		||||
    body { font-family: 'Vazirmatn', sans-serif; }
 | 
			
		||||
    .logo { max-height: 80px; }
 | 
			
		||||
    .signature { height: 90px; border: 1px dashed #ccc; }
 | 
			
		||||
  </style>
 | 
			
		||||
  <script>
 | 
			
		||||
    window.addEventListener('load', function(){ setTimeout(function(){ window.print(); }, 300); });
 | 
			
		||||
  </script>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
  <div class="container-fluid">
 | 
			
		||||
    <div class="d-flex justify-content-between align-items-center mb-3">
 | 
			
		||||
      <div>
 | 
			
		||||
        <h5>{{ contract.template.company.name }}</h5>
 | 
			
		||||
        <h5 class="mb-1">{{ contract.template.name }}</h5>
 | 
			
		||||
        <div class="text-muted small">کد درخواست: {{ instance.code }} | تاریخ: {{ contract.jcreated }}</div>
 | 
			
		||||
      </div>
 | 
			
		||||
      {% if contract.template.company.logo %}
 | 
			
		||||
        <img class="logo" src="{{ contract.template.company.logo.url }}" alt="لوگو" />
 | 
			
		||||
      {% endif %}
 | 
			
		||||
      
 | 
			
		||||
    </div>
 | 
			
		||||
    <hr>
 | 
			
		||||
    <div style="white-space: pre-line; line-height: 1.9;">{{ contract.rendered_body|safe }}</div>
 | 
			
		||||
    <hr>
 | 
			
		||||
    <div class="row mt-4">
 | 
			
		||||
      <div class="col-6 text-center">
 | 
			
		||||
        <div>امضای مشترک</div>
 | 
			
		||||
        <div class="signature mt-2"></div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="col-6 text-center">
 | 
			
		||||
        <div>امضای شرکت</div>
 | 
			
		||||
        <div class="signature mt-2">
 | 
			
		||||
          {% if contract.template.company.signature %}
 | 
			
		||||
            <img src="{{ contract.template.company.signature.url }}" alt="امضای شرکت" style="max-height: 80px;" />
 | 
			
		||||
          {% endif %}
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</body>
 | 
			
		||||
</html>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										92
									
								
								contracts/templates/contracts/contract_step.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										92
									
								
								contracts/templates/contracts/contract_step.html
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,92 @@
 | 
			
		|||
{% 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' %}">
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
{% include '_toasts.html' %}
 | 
			
		||||
<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">
 | 
			
		||||
        <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 href="{% url 'processes:request_list' %}" class="btn btn-outline-secondary">بازگشت</a>
 | 
			
		||||
          <a href="{% url 'contracts:contract_print' instance.id %}" target="_blank" class="btn btn-outline-secondary">پرینت</a>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <div class="bs-stepper wizard-vertical vertical mt-2">
 | 
			
		||||
        {% stepper_header instance step %}
 | 
			
		||||
        <div class="bs-stepper-content">
 | 
			
		||||
          <div class="card border">
 | 
			
		||||
            <div class="card-body">
 | 
			
		||||
              {% if template.company.logo %}
 | 
			
		||||
                <div class="text-center mb-3">
 | 
			
		||||
                  <img src="{{ template.company.logo.url }}" alt="لوگوی شرکت" style="max-height:80px;">
 | 
			
		||||
                  <h4 class="text-muted">{{ contract.template.company.name }}</h4>
 | 
			
		||||
                  <h5 class="text-muted">{{ contract.template.name }}</h5>
 | 
			
		||||
                </div>
 | 
			
		||||
              {% endif %}
 | 
			
		||||
 | 
			
		||||
              <div class="small text-muted mb-2">تاریخ: {{ contract.jcreated }}</div>
 | 
			
		||||
              <hr>
 | 
			
		||||
              <div class="contract-body" style="white-space: pre-line; line-height:1.9;">{{ contract.rendered_body|safe }}</div>
 | 
			
		||||
              <hr>
 | 
			
		||||
              <div class="row mt-4">
 | 
			
		||||
                <div class="col-6 text-center">
 | 
			
		||||
                  <div>امضای مشترک</div>
 | 
			
		||||
                  <div style="height:90px;border:1px dashed #ccc; margin-top:10px;"></div>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="col-6 text-center">
 | 
			
		||||
                  <div>امضای شرکت</div>
 | 
			
		||||
                  <div style="height:90px;border:1px dashed #ccc; margin-top:10px;">
 | 
			
		||||
                    {% if template.company.signature %}
 | 
			
		||||
                      <img src="{{ template.company.signature.url }}" alt="امضای شرکت" style="max-height:80px;">
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <form method="post" class="d-flex justify-content-between mt-3">
 | 
			
		||||
            {% csrf_token %}
 | 
			
		||||
            {% if previous_step %}
 | 
			
		||||
              <a href="{% url 'processes:step_detail' instance.id previous_step.id %}" class="btn btn-label-secondary">قبلی</a>
 | 
			
		||||
            {% else %}
 | 
			
		||||
              <span></span>
 | 
			
		||||
            {% endif %}
 | 
			
		||||
            {% if next_step %}
 | 
			
		||||
              <button type="submit" class="btn btn-primary">بعدی</button>
 | 
			
		||||
            {% else %}
 | 
			
		||||
              <button class="btn btn-success" type="button">اتمام</button>
 | 
			
		||||
            {% endif %}
 | 
			
		||||
          </form>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue