{% extends 'base.html' %} {% block page_title %}{{ item.item_code }}{% endblock %} {% block page_title_guide %}Buku Besar & Riwayat Stok Consumable{% endblock %} {% block page_guide_content %}

Halaman ini menyajikan Buku Besar Persediaan (Stock Ledger) untuk item {{ item.name }}. Seluruh mutasi kuantitas dicatat secara permanen dan berurutan untuk keperluan audit.

Mekanisme Reversal (Pembalik Transaksi)

Jika terjadi kesalahan input transaksi yang telah diposting, sistem menyediakan tombol Reversal. Transaksi asal tidak akan dihapus melainkan ditandai dan dibuatkan entri transaksi pembalik secara atomik untuk menjaga keutuhan audit trail.

{% endblock %} {% block content %}
Consumable Item • {{ item.item_code }}

{{ item.name }}

{{ item.brand|default:"Tanpa Merek" }} {% if item.specification %} • {{ item.specification }} {% endif %}

{% if not is_read_only %}
{% endif %} Kembali

Stok Tersedia

{{ item.formatted_stock }}

Batas Minimum: {{ item.formatted_minimum_stock }}

Satuan & Konversi

UoM: {{ item.base_unit }}

{% if item.purchase_unit %}

Beli: {{ item.purchase_unit }} (1 {{ item.purchase_unit }} = {{ item.conversion_rate|floatformat:0 }} {{ item.base_unit }})

{% else %}

Hanya menggunakan satuan dasar.

{% endif %}

Lokasi Penyimpanan

{{ item.location }}

Harga Beli: {% if item.last_purchase_price > 0 %}Rp {{ item.last_purchase_price|floatformat:0 }}{% else %}Tidak diset{% endif %}

Perputaran Material

Total Masuk: +{{ total_in|floatformat:1 }} {{ item.base_unit }}
Total Keluar: -{{ total_out|floatformat:1 }} {{ item.base_unit }}

Buku Besar Persediaan (Stock Ledger)

{% if not is_read_only %}
{% else %} Audit Trail Mutasi Stok {% endif %}
{% for trx in page_obj %} {% empty %} {% endfor %}
Tanggal & Ref Tipe Transaksi Kuantitas Transaksi Efektif Dasar Saldo Sebelum Saldo Sesudah Penerima / Sumber / Area Ref Tiket / Unit Petugas Aksi
{{ trx.transaction_date|date:"d M Y" }}
{{ trx.transaction_code }}
{% if trx.transaction_type == 'in' %} Masuk {% elif trx.transaction_type == 'out' %} Keluar {% elif trx.transaction_type == 'adjustment' %} Opname {% elif trx.transaction_type == 'reversal' %} Reversal {% endif %} {% if trx.is_reversed %} DIBALIK {% endif %} {% if trx.transaction_type == 'in' %} +{{ trx.quantity }} {{ trx.unit }} {% elif trx.transaction_type == 'out' %} -{{ trx.quantity }} {{ trx.unit }} {% elif trx.transaction_type == 'reversal' %} {{ trx.quantity }} {{ trx.unit }} {% else %} {{ trx.quantity }} {{ trx.unit }} {% endif %} {{ trx.quantity_base }} {{ item.base_unit }} {{ trx.stock_before }} {{ trx.stock_after }} {% if trx.recipient_employee %}
{{ trx.recipient_employee.name }}
{% endif %}
{{ trx.source_destination|default:"-" }}
{% if trx.supplier %}
Supplier: {{ trx.supplier }}
{% endif %}
{% if trx.ticket_number %} {{ trx.ticket_number }} {% endif %} {% if trx.related_unit %}
Unit: {{ trx.related_unit.unit_code }}
{% endif %} {% if trx.reference_no %}
Ref: {{ trx.reference_no }}
{% endif %}
{{ trx.performed_by.username|default:"Sistem" }} {% if trx.notes %}
"{{ trx.notes }}"
{% endif %}
{% if not is_read_only and not trx.is_reversed and trx.transaction_type != 'reversal' %} {% else %} - {% endif %}
Belum ada mutasi transaksi untuk item ini.
{% include 'components/pagination.html' %}
{% endblock %}