forked from hesabix/arc
209 lines
8.3 KiB
HTML
Executable file
209 lines
8.3 KiB
HTML
Executable file
{% extends "pdf/base.html" %}
|
|
{% block content %}
|
|
<style>
|
|
/* Small report-specific tweaks on top of base.html */
|
|
/* Force black/white print style for Kardex (override base theme) */
|
|
.report-kardex {
|
|
--primary: #000;
|
|
--primary-dark: #000;
|
|
--border: #000;
|
|
--text: #111;
|
|
--muted: #333;
|
|
--zebra: #f5f5f5;
|
|
}
|
|
.report-kardex .header {
|
|
margin-bottom: 10px;
|
|
padding: 10px 12px;
|
|
border: 1px solid #000;
|
|
border-radius: 6px;
|
|
background: #fff;
|
|
box-shadow: none;
|
|
}
|
|
.report-kardex .title { color: #000; }
|
|
.report-kardex .meta { color: #111; }
|
|
.report-kardex table { box-shadow: none; margin-left: auto; margin-right: auto; }
|
|
.report-kardex thead {
|
|
background: #eee !important;
|
|
color: #000 !important;
|
|
}
|
|
.report-kardex th, .report-kardex td {
|
|
border-color: #000 !important;
|
|
text-align: center;
|
|
}
|
|
.report-kardex th {
|
|
text-transform: none;
|
|
letter-spacing: 0;
|
|
font-weight: 700;
|
|
font-size: 10px;
|
|
padding: 8px 6px;
|
|
}
|
|
.report-kardex td { font-size: 10.5px; }
|
|
/* Applied filters: compact, line-oriented, printer friendly (B/W) */
|
|
.report-kardex .filters-line {
|
|
margin-bottom: 10px;
|
|
padding: 6px 8px;
|
|
border: 1px solid #9aa0a6;
|
|
border-radius: 6px;
|
|
background: #fff;
|
|
color: #111;
|
|
font-size: 10.5px;
|
|
line-height: 1.45;
|
|
page-break-inside: avoid;
|
|
}
|
|
.report-kardex .filters-line .label {
|
|
font-weight: 700;
|
|
margin-inline-end: 6px;
|
|
color: #111;
|
|
white-space: nowrap;
|
|
}
|
|
.report-kardex .filters-line .text {
|
|
color: #111;
|
|
}
|
|
.report-kardex .filters-line .more {
|
|
color: #444;
|
|
white-space: nowrap;
|
|
}
|
|
.report-kardex td.num, .report-kardex th.num {
|
|
text-align: {{ 'left' if is_fa else 'right' }};
|
|
font-variant-numeric: tabular-nums;
|
|
white-space: nowrap;
|
|
}
|
|
.report-kardex th.idx, .report-kardex td.idx {
|
|
width: 36px;
|
|
}
|
|
|
|
.report-kardex .totals {
|
|
display: flex;
|
|
gap: 10px;
|
|
flex-wrap: wrap;
|
|
margin-bottom: 10px;
|
|
page-break-inside: avoid;
|
|
}
|
|
.report-kardex .totals .box {
|
|
flex: 1;
|
|
min-width: 240px;
|
|
border: 1px solid #000;
|
|
border-radius: 6px;
|
|
padding: 8px 10px;
|
|
background: #fff;
|
|
}
|
|
.report-kardex .totals .box-title {
|
|
font-weight: 700;
|
|
font-size: 10.5px;
|
|
margin-bottom: 6px;
|
|
color: #000;
|
|
}
|
|
.report-kardex .totals .row {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
gap: 8px;
|
|
font-size: 10.5px;
|
|
padding: 2px 0;
|
|
border-bottom: 1px dashed #999;
|
|
}
|
|
.report-kardex .totals .row:last-child { border-bottom: none; }
|
|
.report-kardex .totals .k { color: #111; }
|
|
.report-kardex .totals .v { color: #000; font-weight: 700; }
|
|
</style>
|
|
|
|
<div class="report-kardex">
|
|
<div class="header">
|
|
<div>
|
|
<div class="title">{{ title_text or ('گزارش کاردکس' if is_fa else 'Kardex Report') }}</div>
|
|
<div class="meta">{{ business_name or '' }}</div>
|
|
</div>
|
|
<div class="meta">
|
|
{{ generated_at or '' }}
|
|
</div>
|
|
</div>
|
|
|
|
{% if filters_summary and filters_summary|length > 0 %}
|
|
{% set max_filters = 6 %}
|
|
{% set shown = filters_summary[:max_filters] %}
|
|
{% set remaining = (filters_summary|length) - (shown|length) %}
|
|
<div class="filters-line">
|
|
<span class="label">{{ 'فیلترها' if is_fa else 'Filters' }}:</span>
|
|
<span class="text">
|
|
{% for f in shown %}
|
|
{% if not loop.first %} | {% endif %}
|
|
{{ (f.label | default('', true)) }}: {{ (f.value | default('', true)) }}
|
|
{% endfor %}
|
|
</span>
|
|
{% if remaining > 0 %}
|
|
<span class="more"> | +{{ remaining }}</span>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if page_totals or all_totals %}
|
|
<div class="totals" data-kardex-totals="1">
|
|
<div class="box">
|
|
<div class="box-title">{{ 'جمع صفحه' if is_fa else 'Page totals' }}</div>
|
|
<div class="row"><span class="k">{{ 'تعداد سطر' if is_fa else 'Rows' }}</span><span class="v">{{ (page_totals.count or 0) | smart_number(0) | ltr | safe }}</span></div>
|
|
<div class="row"><span class="k">{{ 'جمع بدهکار' if is_fa else 'Total debit' }}</span><span class="v">{{ (page_totals.debit or 0) | smart_number(0) | ltr | safe }}</span></div>
|
|
<div class="row"><span class="k">{{ 'جمع بستانکار' if is_fa else 'Total credit' }}</span><span class="v">{{ (page_totals.credit or 0) | smart_number(0) | ltr | safe }}</span></div>
|
|
<div class="row"><span class="k">{{ 'جمع تعداد' if is_fa else 'Total qty' }}</span><span class="v">{% if page_totals.quantity is not none %}{{ (page_totals.quantity or 0) | smart_number(2) | ltr | safe }}{% else %}—{% endif %}</span></div>
|
|
</div>
|
|
<div class="box">
|
|
<div class="box-title">{{ 'جمع کل' if is_fa else 'Overall totals' }}</div>
|
|
<div class="row"><span class="k">{{ 'تعداد کل' if is_fa else 'Total rows' }}</span><span class="v">{% if all_count is not none %}{{ all_count | smart_number(0) | ltr | safe }}{% else %}—{% endif %}</span></div>
|
|
<div class="row"><span class="k">{{ 'جمع بدهکار' if is_fa else 'Total debit' }}</span><span class="v">{{ (all_totals.debit or 0) | smart_number(0) | ltr | safe }}</span></div>
|
|
<div class="row"><span class="k">{{ 'جمع بستانکار' if is_fa else 'Total credit' }}</span><span class="v">{{ (all_totals.credit or 0) | smart_number(0) | ltr | safe }}</span></div>
|
|
<div class="row"><span class="k">{{ 'جمع تعداد' if is_fa else 'Total qty' }}</span><span class="v">{% if all_totals.quantity is not none %}{{ (all_totals.quantity or 0) | smart_number(2) | ltr | safe }}{% else %}—{% endif %}</span></div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="table-wrapper">
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th class="idx num">#</th>
|
|
<th>{{ 'تاریخ سند' if is_fa else 'Date' }}</th>
|
|
<th>{{ 'کد سند' if is_fa else 'Code' }}</th>
|
|
<th>{{ 'نوع سند' if is_fa else 'Type' }}</th>
|
|
<th>{{ 'انبار' if is_fa else 'Warehouse' }}</th>
|
|
<th>{{ 'جهت' if is_fa else 'Movement' }}</th>
|
|
<th>{{ 'شرح' if is_fa else 'Description' }}</th>
|
|
<th class="num">{{ 'بدهکار' if is_fa else 'Debit' }}</th>
|
|
<th class="num">{{ 'بستانکار' if is_fa else 'Credit' }}</th>
|
|
<th class="num">{{ 'تعداد' if is_fa else 'Qty' }}</th>
|
|
{% if show_running %}
|
|
<th class="num">{{ 'مانده مبلغ' if is_fa else 'Balance Amt' }}</th>
|
|
<th class="num">{{ 'مانده تعداد' if is_fa else 'Balance Qty' }}</th>
|
|
{% endif %}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for it in items or [] %}
|
|
<tr>
|
|
<td class="idx num">{{ loop.index }}</td>
|
|
<td>{{ it.document_date | default('', true) }}</td>
|
|
<td>{{ it.document_code | default('', true) }}</td>
|
|
<td>{{ (it.document_type_name or it.document_type) | default('', true) }}</td>
|
|
<td>{{ (it.warehouse_name or it.warehouse_id) | default('', true) }}</td>
|
|
<td>
|
|
{% set mv = (it.movement | default('', true) | lower) %}
|
|
{% if is_fa %}
|
|
{{ 'ورود' if mv == 'in' else ('خروج' if mv == 'out' else mv) }}
|
|
{% else %}
|
|
{{ mv }}
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ it.description | default('', true) }}</td>
|
|
<td class="num">{{ it.debit | smart_number(0) | ltr | safe }}</td>
|
|
<td class="num">{{ it.credit | smart_number(0) | ltr | safe }}</td>
|
|
<td class="num">{{ it.quantity | smart_number(2) | ltr | safe }}</td>
|
|
{% if show_running %}
|
|
<td class="num">{{ it.running_amount | smart_number(0) | ltr | safe }}</td>
|
|
<td class="num">{{ it.running_quantity | smart_number(2) | ltr | safe }}</td>
|
|
{% endif %}
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="footer"></div>
|
|
</div>
|
|
{% endblock %}
|