{% extends "base.html" %} {% block title %}Voucher Diskon - FinansialApp{% endblock %} {% block page_title %}Voucher Diskon POS{% endblock %} {% block content %} {% from '_pagination.html' import pagination with context %} {% macro scope_fields(pfx, kategori_produk) %}
Basis diskon (nota / kategori / item), minimal qty, & batasan customer. Boleh dilewati — voucher tetap jalan.
Jumlah unit minimal pada basis di atas (0 = tanpa syarat qty). Syarat berdasarkan NILAI pakai "Min. Belanja".
{% endmacro %} {% for c in customer_names %}
Voucher Baru
Rupiah potongan
0 = tak terbatas
{{ scope_fields('vb', kategori_produk) }}
Voucher dipakai kasir dengan mengetik kodenya di POS. Diskon dari voucher otomatis terotorisasi (tidak perlu PIN supervisor).
Daftar Voucher {{ pg.total if pg else voucher_rows|length }} Master POS
{% if voucher_rows %}
{% for v in voucher_rows %} {% set expired = v.berlaku_sampai and v.berlaku_sampai < today %} {% set habis = v.kuota and v.kuota > 0 and (v.terpakai or 0) >= v.kuota %} {% endfor %}
Kode Potongan Min. Belanja Kuota Berlaku Status Aksi
{{ v.kode }} {% if v.catatan %}
{{ v.catatan }}
{% endif %} {% set _sc = v.scope or 'NOTA' %} {% if _sc != 'NOTA' or (v.min_qty and v.min_qty > 0) %}
{% if _sc == 'KATEGORI' %}Kategori: {{ v.syarat_kategori }} {% elif _sc == 'PRODUK' %}Item tertentu{% endif %} {% if _sc in ('KATEGORI','PRODUK') and v.potongan_mode == 'PER_PRODUK' %}per produk{% endif %} {% if v.min_qty and v.min_qty > 0 %}min {{ v.min_qty|qty }} qty{% endif %}
{% endif %}
{% if v.tipe == 'PERSEN' %}{{ '%g'|format(v.nilai) }}% {% if v.maks_potongan and v.maks_potongan > 0 %}
maks {{ v.maks_potongan|rp }}
{% endif %} {% else %}{{ v.nilai|rp }}{% endif %}
{{ v.min_belanja|rp }} {% if v.kuota and v.kuota > 0 %}{{ v.terpakai or 0 }}/{{ v.kuota }}{% else %} ({{ v.terpakai or 0 }}){% endif %} {{ v.berlaku_dari|tgl if v.berlaku_dari else '—' }}
s/d {{ v.berlaku_sampai|tgl if v.berlaku_sampai else '—' }}
{% if not v.aktif %}Nonaktif {% elif expired %}Kedaluwarsa {% elif habis %}Kuota Habis {% else %}Aktif{% endif %}
{% else %}
Belum ada voucher. Buat lewat form di samping.
{% endif %}
{{ pagination(pg) }} {% endblock %}