{% extends "core/detail.html" %} {% load seizou_tags seizou_icons orders_detail %} {# 受注の詳細: 土台の詳細に、明細の表 (出荷済みと残つき) と「取消」のボタン (取消でなく、受注の権限がある人だけ) を足す。取消の受注は「編集」も出さない (取消の受注は直せない = R05)。頭の主のボタン (決め 11-06 22:1x と、本人の決め 11-12 19:0x): 緑のボタンは、その受注で次にする操作 1 つ。入荷が要るのにまだの明細があれば「入荷を記録する」、指示書が要る明細があれば「指示書を発行する」、ほかは「出荷登録」(orders_detail の order_next_action が、明細の進み具合とその人の権限で選ぶ。当たる明細が 1 行なら小窓を直に開き、2 行以上なら行を選ぶメニュー) を右端に置き、そのときの「編集」は白で「⋯」の左。 #} {# 明細の表の先頭の「操作」の列は、行ごとの ⋮ のメニュー (orders/_line_menu.html。右クリックでも同じメニュー。出荷する・指示書を発行する・入荷を記録する・発注する・部品の小窓・図面・請求しないを外す (印のある明細だけ)・完了にする (終わっていない明細)・完了を外す (完了の明細))。残の枡の後ろの「完了」「完了 (出さない n)」の印は完了の明細だけ (orders_detail の order_line_completed_label。N400b)。ボタンを並べる形は表が枠より広くなったのでやめた (決め 11-03 17:2x)。部品の枡の下の「請求しない」は印の付いた明細 (作者の決め。金額を見られない人にも出す)。最後の欄は「残」のまま (E2E が行の最後の td で残を読む)。「検収」の列 (検収の数の合計と最後の検収日) は「出荷済み」と「残」の間。 #} {# 「預かり」の列 (決め 11-06 18:3x。開発の記録 docs/nights/20261106/N184.md) は「検収」と「残」の間。値は「引当の合計 / 受注の数」で、引当の合計は orders_detail の order_line_allocations が 1 回の問い合わせで読む (読むだけ)。入荷の部品が無い会社 (receiving_url が空) では見出しも枡も出さない。 #} {# 2 列 (作者の決め。開発の記録 docs/nights/20261105/N150.md): 題の上にパンくず「受注 › 番号」(土台の block heading に crumb を渡す)。block content で段の帯の次に右の列のカード (orders_detail の order_aside) を置いてから土台を呼ぶ。明細は土台の全幅の口 block wide (lg 以上は 2 列の上に全幅。作者の決め)、流れ・メモは左の列の block main。基本情報は右の列のカードへ移り、タブは関係する物だけ。取消は小窓で開く (data-modal-form)。見出しの帯 (#order-heading) と中身 (#order-live) は、小窓で保存した後の seizou:refresh で取り直す (決め 11-05 11:4x。開発の記録 docs/nights/20261105/N158.md)。 #} {# タブの最後の「会話」は connect の会話の枠 (connect/_chat.html。元の受信した注文の相手の会社とのやり取り = 作者の決め。0 件でも書く欄と使えない訳を出すので block tab_empty にも置く)。受注の詳細は小窓の保存の後に #order-live をタブの箱ごと取り直すので、送った後に選んだタブが 1 つ目へ戻ることがある (タブを保つ js は別の依頼)。 #} {% block heading %}
{% order_head_chips object seizou.hide_money as head_chips %}{% can_write "shipping.Shipment" as can_ship %}{% can_write "workorders.WorkOrder" as can_issue_head %}{% can_write "receiving.Receiving" as can_receive_head %}{% url 'shipping:shipment_create' as ship_url %}{% url 'workorders:workorder_create' as issue_head_url %}{% url 'receiving:receiving_create' as receiving_head_url %}{% order_next_action object can_receive_head can_issue_head can_ship receiving_head_url issue_head_url ship_url as next_action %}{% with crumb="受注" %}{{ block.super }}{% endwith %}
{% endblock %} {% block actions %}{% if next_action and edit_url %}{% icon "pencil" "size-4" %}編集{% endif %}{% endblock %} {% block edit_button %}{% if next_action %}{% if next_action.lines|length == 1 %}{% with line=next_action.lines.0 %}{% icon next_action.icon "size-4" %}{{ next_action.label }}{% endwith %}{% else %}{% endif %}{% elif object.status != "cancelled" %}{{ block.super }}{% endif %}{% endblock %} {% block more %}{% can_write "orders.Order" as can_cancel %}{% if object.status != "cancelled" and can_cancel %}{% url 'orders:order_cancel' object.pk as cancel_url %}{% include "core/_detail_more.html" with more_url=cancel_url more_label="取消" more_modal=True %}{% endif %}{% endblock %} {% block content %}
{% order_revision_notice object as revision %}{% include "orders/_revision_notice.html" %} {% load orders_timeline %}{% order_stages object as band %}{% include "core/_stage_band.html" with stages_id="order-stages" %} {% order_aside object fields seizou.hide_money as aside %} {{ block.super }}
{% endblock %} {% block wide %}

明細

{% with lines=object.lines.all %} {% if lines %} {% can_write "workorders.WorkOrder" as can_issue %} {% can_write "shipping.Shipment" as can_ship %} {% can_write "purchasing.PurchaseOrder" as can_po %} {% can_write "receiving.Receiving" as can_receive %} {% url 'receiving:receiving_create' as receiving_url %}{% order_line_allocations object as line_rows %}

検収: 得意先が受け入れたと知らせてきた数 (括弧は最後の検収日)。受信した注文から作った受注にだけ届き、届いていない明細は「—」です。

{% if not seizou.hide_money %}{% endif %} {% if receiving_url %}{% endif %} {% for line, allocated in line_rows %} {% if not seizou.hide_money %}{% endif %} {% with acc=line.acceptance %}{% if acc.count %}{% else %}{% endif %}{% endwith %} {% if receiving_url %}{% endif %} {% endfor %}
操作 行番号 部品 数量 単位単価 金額納期 出荷済み 検収預かり残
{% include "orders/_line_menu.html" with line=line order=object can_issue=can_issue can_ship=can_ship can_po=can_po can_receive=can_receive %} {{ line.line_no }} {% master_link line.item line.item.part_no %} {{ line.item.name }}{% if line.customer_part_no %}得意先の品番 {{ line.customer_part_no }}{% endif %}{% if line.process_name %}工程 {{ line.process_name }}{% endif %}{% if line.quote_no %}見積の番号 {{ line.quote_no }}{% endif %}{% if line.no_bill %}請求しない{% endif %} {{ line.qty|comma }} {{ line.unit }}{{ line.unit_price|yen }} / {{ line.price_unit_text }} {{ line.amount|yen }}{% if line.due_date %}{{ line.due_date|date:"Y-m-d" }}{% else %}—{% endif %} {{ line.shipped_total|comma }}{{ acc.total|comma }} ({{ acc.last_on|date:"Y-m-d" }}){% if acc.old_revision %} 第 {{ acc.old_revision }} 版の注文への検収 (今は第 {{ acc.current_revision }} 版){% endif %}—{{ allocated|comma }} / {{ line.qty|comma }}{% if line.remaining_total < 0 %}{{ line.remaining_total|comma }}{% else %}{{ line.remaining_total|comma }}{% endif %}{% order_line_completed_label line as completed_label %}{% if completed_label %}{{ completed_label }}{% endif %}
{% else %}

明細はありません。「編集」から明細の行を足します。

{% endif %} {% endwith %}
{% endblock %} {% block main %} {% include "orders/_timeline.html" %} {% if "notes" in seizou.parts %}{% include "notes/_note.html" %}{% endif %} {% endblock %} {% block tab_rows %}{% if tab.related == "chat_messages" %}{% include "connect/_chat.html" with chat_target=object %}{% else %}{{ block.super }}{% endif %}{% endblock %} {% block tab_empty %}{% if tab.related == "chat_messages" %}{% include "connect/_chat.html" with chat_target=object %}{% else %}{{ block.super }}{% endif %}{% endblock %}