Add orders tab for recent SystemGroup delivery notes

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-11 13:47:25 +03:30
parent 570b084cc1
commit c1c870e911
18 changed files with 684 additions and 4 deletions

View File

@@ -31,6 +31,7 @@
</a>
<div class="nav-links">
<a href="{% url 'entry' %}" class="nav-link {% block nav_entry_active %}{% endblock %}" data-i18n="data_entry">ثبت اطلاعات</a>
<a href="{% url 'crm_orders' %}" class="nav-link {% block nav_crm_active %}{% endblock %}" data-i18n="crm_orders">حواله‌ها</a>
<a href="{% url 'print_queue' %}" class="nav-link {% block nav_print_active %}{% endblock %}" data-i18n="print_queue">صف چاپ</a>
</div>
<div class="nav-actions">
@@ -55,7 +56,7 @@
{% block content %}{% endblock %}
</main>
<script src="{% static 'slips/js/i18n.js' %}"></script>
<script src="{% static 'slips/js/i18n.js' %}?v=3"></script>
{% block extra_scripts %}{% endblock %}
</body>
</html>

View File

@@ -0,0 +1,46 @@
{% extends 'slips/base.html' %}
{% load static %}
{% block title %}Orders — Label Printer{% endblock %}
{% block nav_crm_active %}active{% endblock %}
{% block content %}
<div class="page-grid print-queue-layout">
<section class="card glass-card">
<div class="card-header card-header-wrap">
<div>
<h2 class="card-title" data-i18n="crm_orders_title">حواله‌ها</h2>
<p class="card-subtitle" id="crm-since" hidden>
<span data-i18n="orders_after">حواله‌های بعد از</span>
<span id="crm-since-date" class="mono" dir="ltr"></span>
</p>
</div>
<div class="card-actions">
<button type="button" class="btn btn-ghost btn-sm" id="crm-refresh" data-i18n="refresh">به‌روزرسانی</button>
<span class="card-badge badge-muted" id="crm-count">0</span>
</div>
</div>
<p class="empty-state" id="crm-orders-status" hidden></p>
<div class="table-wrap">
<table class="data-table" id="crm-orders-table">
<thead>
<tr>
<th data-i18n="date">تاریخ</th>
<th data-i18n="product_code">کد محصول</th>
<th data-i18n="product_title">عنوان</th>
<th data-i18n="note_qty">مقدار حواله</th>
<th data-i18n="delivered_qty">تحویل‌شده</th>
<th data-i18n="remaining_qty">مانده</th>
</tr>
</thead>
<tbody id="crm-orders-body"></tbody>
</table>
</div>
</section>
</div>
<div id="toast" class="toast"></div>
{% endblock %}
{% block extra_scripts %}
<script src="{% static 'slips/js/crm_orders.js' %}?v=6"></script>
{% endblock %}

View File

@@ -18,7 +18,7 @@
<select id="product" required>
<option value="">— Select —</option>
{% for p in products %}
<option value="{{ p.id }}" data-weight="{{ p.default_net_weight }}" data-requires-dates="{{ p.requires_dates|yesno:'true,false' }}">
<option value="{{ p.id }}" data-code="{{ p.code }}" data-weight="{{ p.default_net_weight }}" data-requires-dates="{{ p.requires_dates|yesno:'true,false' }}">
{{ p.code }} — {{ p.description }}
</option>
{% endfor %}
@@ -169,5 +169,5 @@
{% endblock %}
{% block extra_scripts %}
<script src="{% static 'slips/js/entry.js' %}"></script>
<script src="{% static 'slips/js/entry.js' %}?v=4"></script>
{% endblock %}