{% extends "erp_base.html" %} {% macro rack_row(cell, items, entry=None, disabled=False) %}
합계 {{ "{:,}".format(entry.units_per_box * entry.box_count) if entry else 0 }} {% if not disabled %}{% endif %}
{% endmacro %} {% block head_extra %} {% endblock %} {% block content %}
{% include "malaysia/_i18n.html" %}
◀◀ 조사 목록 {% if stocktake.status=='finalized' %} 자동 비교 엑셀 다운로드 {% endif %}
{% if upload_ok is not none %}
엑셀 업로드 완료 — {{ upload_ok }}건 반영. {% if upload_skip %}
건너뜀(코드 미등록/수량오류): {{ upload_skip }}
{% endif %}
{% endif %} {% if is_draft %}

엑셀 업로드로 일괄 입력 (랙 대신)

열 A=상품명(참고용) · B=자체상품코드 · C=수량 형식의 xlsx. 등록 안 된 코드·숫자 아닌 수량은 자동 건너뜀. 업로드 후에는 위 랙 입력을 저장하지 말고 아래 "라인 기준 확정" 버튼으로 바로 확정하세요 (랙을 저장하면 랙 기준으로 라인이 재생성되어 업로드 값이 사라집니다).

{% if is_admin %}
{% endif %}
{% endif %}

재고조사 #{{ stocktake.id }}

날짜 {{ stocktake.stocktake_date }}
창고 {{ stocktake.warehouse_code }}
상태 {% if stocktake.status=='finalized' %}확정 {% elif stocktake.status=='cancelled' %}취소 {% else %}작성중{% endif %}
{% if stocktake.finalized_at %}
확정시각 {{ stocktake.finalized_at }}
{% endif %} {% if missing_bom %}⚠ BOM 누락: {{ missing_bom|join(', ') }}{% endif %} 랙 칸에 아이템·입수량(박스당 개수)·박스 수를 입력하면 낱개/콤보 수량이 자동 집계됩니다. 한 칸에 여러 아이템은 + 로 추가하세요. 저장 또는 확정 시 화면 입력이 함께 반영됩니다. {% if is_draft and has_prev_rack %} {% endif %} {% if is_draft %}{% endif %} {% if is_draft and is_admin %} {% endif %}

랙 입력 (박스 단위)

{% for side in rack_layout %}

{{ side.label }}

{% for row in side.rows %}
{% for col in row.cols %} {% for cell in col %}
{{ cell }} {% if is_draft %}{% endif %}
{% set entries = rack_by_cell.get(cell, []) %} {% for e in entries %} {{ rack_row(cell, rack_items, entry=e, disabled=(not is_draft)) }} {% endfor %} {% if is_draft and not entries %} {{ rack_row(cell, rack_items) }} {% endif %}
{% endfor %} {% endfor %}
{% endfor %}
{% endfor %}
{% if is_draft %}
{% endif %} {% if is_super %}
{% endif %}

최종 계산 (낱개 기준)

total_qty = direct_qty(낱개 직접) + from_set_qty(콤보 분해)
{% for r in result_rows %} {% endfor %} {% if not result_rows %} {% endif %}
Item CodeProduct NameDirectFrom SetTotal
{{ r.item_code }} {{ r.item_name }} {{ "{:,}".format(r.direct_qty) }} {{ "{:,}".format(r.from_set_qty) }} {{ "{:,}".format(r.total_qty) }}
입력된 수량이 없습니다.
{% endblock %}