{% extends "core/base.html" %} {% load seizou_guide seizou_icons seizou_tags %} {% load seizou_outcome %} {% block content %} {# 最初の画面: 本物の集計だけの数字のカード、最近の受注、入口のカード。部品が無い物は出さない (偽の数字を置かない)。 #} {# 並びは、数字のカード (会社の KPI) → 今日やること (左。個人のタスク。core の dashboard.today_tasks) と納期アラート (右) → 出荷の図と生産の図 → 最近の受注 (左) と注文の入口の図 (右) → よく使う画面 (本人の決め 11-03 11:0x。今日やることは UX の案 2-A 11-05 で足し、本人の決め 11-05 09:4x で数字のカードの直下へ。本人の決め 11-05 11:0x で今日やることを半分の幅にして納期アラートと並べ、注文の入口を最近の受注の右へ)。 #} {# 出荷と生産の図と納期アラート (core の dashboard が読む。部品が無ければ None で、節ごと出さない。金額を見られない人には金額の図を出さない)。受注の行はどこを押しても受注の詳細へ移る (行の中の link はそのまま動く)。 #} {# 数字のカードは dashboard_stats() の並び (6 枚目 = 今月の支払の見込み。受入の部品があるとき。7 枚目 = 今月の入金。入金の表があるとき)。6 枚のときは xl で 3 列 × 2 段、2xl で 1 段。7 枚のときは xl 以上で 4 列 × 2 段 (2xl で 7 列に並べると 1 枚が狭い)。金額を見られない人には 6 枚目と 7 枚目が出ない (HomeView が並びから外す)。 #} {# 8 枚目 = 手入力せずに取り込んだ明細 (受注の部品があるとき。N83)。8 枚のときも xl 以上で 4 列 × 2 段。detail のあるカードは数の下に 1 行 (4 枚目は受注の件数、8 枚目は入力を省けた時間 ≒ m 分)。 #} {# compare のあるカード (「今月の◯◯」= 今月の受注・今月の支払の見込み・今月の入金。dashboard_stats が core.dashboard の *_month_compare で付ける) は、数の横に「▲ +n 先月より」の札 (core/_stat_delta.html。増えた = 緑、減った = 赤、同じ = 灰) と、数の下に今月の日ごとの数の細い線 (inline SVG。JS を使わない。座標は dashboard.sparkline)。線は箱の幅に伸び縮みし (preserveAspectRatio="none")、太さは伸びない (vector-effect)。本人の決め 11-07 18:2x〜18:4x「2もいい」。受け渡しの seizou-部品の6案-20261107/指示書.md の 3。 #} {# help のあるカードは題の横に (i) のボタンを置き、押すと数え方の 1 文を小窓 (base.html の #seizou-modal) に出す。中身は格子の後ろの template を写し、字は textContent で入れる (初見ユーザーテスト R4 の 5-3。決め 11-06 22:2x の C30-1 の a。吹き出しは窓の端と左のメニューの下で切れ、閉じていても頁を横に広げ、読み上げで説明が 2 回入ったため = R5 の r5-a-03・V181)。 #} {# 今日やること: 手を動かす物のある段だけを、件数の字と移る先の画面の名前のボタンで 1 行ずつ (UX の案 2-A)。行が 1 つも無い会社は、同じ枠に「はじめての方へ」の題で流れの段の並びを出す。枠は 1 つ (aria-labelledby を 2 つにしない)。部品も取引先も 0 の会社には、流れの段の上に「最初にすること」(取引先 → 部品 → 受注の入口。ONB-02 の会期中の小さい版) を出す。 #} {# 行き先 (url) のあるカードは、外側を div にし、点線の下の右に行き先の画面の名前の link (「部品マスターを見る」など。名前は HomeView が url から引いた stat.screen) を置く。外側の押下も同じ url へ移る (受注の行と同じ onclick。中の link と (i) のボタンの押下は除く)。初見ユーザーテスト R5 の V38 (カードを入口と見なかった) と V181 (link の中に (i) のボタンが入れ子) の直し。 #} {# phone (640px 未満) もカードを 2 列に並べ、カードの中の余白は p-4 (sm から p-6)、phone の数のカードの大きい数だけ text-2xl (sm から text-3xl)。決め 11-06 22:2x の C30-3 の a (R5 の a-flagged-25 で、phone では 8 枚が 1 列に並び、今日やることが 3 画面目から始まったため)。base.html の見た目の約束 (カードの余白 p-6・字の大きさの 4 段) の外の例外。 #} {% if stats %}
{% for stat in stats %} {% if stat.url %}
{% else %}
{% endif %}

{{ stat.label }}

{% if stat.help %}{% endif %}
{% icon stat.icon "size-5" %}
{% if stat.money %}

{{ stat.value|yen:0 }}{% if stat.compare %} {% include "core/_stat_delta.html" with compare=stat.compare money=True %}{% endif %}

{% else %}

{{ stat.value|comma }} {{ stat.unit }}{% if stat.compare %} {% include "core/_stat_delta.html" with compare=stat.compare money=False %}{% endif %}

{% endif %} {% if stat.compare %}{{ stat.label }}: 今月の 1 日から今日までの日ごとの数{% endif %} {% if stat.detail %}

{{ stat.detail }}

{% endif %} {# mt-auto: 横に並ぶカードで、補助の 1 行の点線の高さをそろえる (見出しや補助が折り返しても)。 #}
{% endfor %}
{# (i) の小窓の中身の元 (core/_rule_help.html と同じ作り)。下の script が写し、題 (「<カードの題>の数え方」) と本文 (help の 1 文) を textContent で入れる。題は折り返す (truncate を付けない。8 枚目の題は phone の小窓で 1 行に収まらない)。 #} {# (i) の押下で小窓を開く。document に委譲し、戻る (htmx の履歴の復元) で script が入り直しても登録は 1 回だけ (_sidebar.html と同じ形)。class を触らず、HTML を差し込まない (seizou-modal.js の約束)。 #} {% endif %} {% today_tasks as today %} {# 今日やること (左) と納期アラート (右) の 1 段。lg から 2 列で、片方だけなら 1 列。幅が狭いときは縦に積む (今日やることが上)。本人の決め 11-05 11:0x「今日やることは col-md-6 的な大きさの方がいい」「余白が多すぎて折角の一等地が勿体無い」。 #} {% if today and alerts is not None %}
{% elif today or alerts is not None %}
{% endif %} {% if today %}
{% if today.rows %}

{{ today.title }}

手を動かす物のある段だけが並びます。

{% else %}

はじめての方へ

今は手を動かす物がありません。業務の流れの段を押すと、その画面が開きます。

{# 最初にすること (ONB-02 の会期中の小さい版): 部品も取引先も 0 の会社にだけ、取引先 → 部品 → 受注の順の入口を枠だけのボタンで並べる (流れの段の上)。 #} {# 数は数字のカードの先頭の 2 枚 (dashboard_stats が部品・取引先の順に先頭へ置き、HomeView は並びを変えずに url だけ外す)。並びが違うときと数が読めない (None) ときは出さない (偽の案内を置かない)。 #} {# 入口のボタンは書ける人にだけ (決め 11-04 12:5x。can_write は部署で開けない人にも偽)。1 つも出せない人には題ごと出さない。矢印は前の段の li に入れる (流れの段と同じ形)。済んだ印は次の版で (ONB-07)。 #} {% with items=stats.0 partners=stats.1 %} {% if items.url_name == "masters:item_list" and items.value == 0 and partners.url_name == "masters:partner_list" and partners.value == 0 %} {% url 'masters:partner_create' as partner_create_url %}{% url 'masters:partner_import' as partner_import_url %}{% url 'masters:item_create' as item_create_url %}{% url 'masters:item_import' as item_import_url %}{% url 'orders:order_create' as order_create_url %} {% can_write "masters.Partner" as can_add_partner %}{% can_write "masters.Item" as can_add_item %}{% can_write "orders.Order" as can_add_order %} {% if can_add_partner and partner_create_url or can_add_item and item_create_url or can_add_order and order_create_url %}

最初にすること

取引先と部品を登録してから、受注を入れます。

    {% if can_add_partner and partner_create_url %}
  1. 取引先を登録する{% if partner_import_url %}CSV 取り込み{% endif %}{% if can_add_item and item_create_url or can_add_order and order_create_url %}{% icon "chevron-right" "size-4 text-base-content/60" %}{% endif %}
  2. {% endif %} {% if can_add_item and item_create_url %}
  3. 部品を登録する{% if item_import_url %}CSV 取り込み{% endif %}{% if can_add_order and order_create_url %}{% icon "chevron-right" "size-4 text-base-content/60" %}{% endif %}
  4. {% endif %} {% if can_add_order and order_create_url %}
  5. 受注を入れる
  6. {% endif %}
{% endif %} {% endif %} {% endwith %}
{% for f in today.guide.flows %}

{{ f.title }}

{# 矢印は前の段の li に入れる (段と矢印が 1 組で折り返すので、折り返した行が矢印で始まらない。本人 11-04 14:3x)。段の字は折らない。 #}
    {% for step in f.steps %}
  1. {{ step.label }}{% if not forloop.last %}{% icon "chevron-right" "size-4 text-base-content/60" %}{% endif %}
  2. {% endfor %}
{% endfor %}
{% endif %}
{% endif %} {% if alerts is not None %}

納期アラート

{% include "core/_screen_help.html" with part="due-alerts" label="納期アラートの説明" %} 遅れ {{ alerts.overdue.count|comma }} 件 {{ alerts.days }} 日以内 {{ alerts.soon.count|comma }} 件
{% if alerts.list_url %}生産管理ボードを見る{% icon "chevron-right" "size-4" %}{% endif %}
{% if not alerts.overdue.count %}

遅れている納期はありません。

{% endif %} {% if alerts.overdue.count or alerts.soon.count %}
{% for row in alerts.overdue.rows %} {% if row.order_url %}{% else %}{% endif %} {% endfor %} {% for row in alerts.soon.rows %} {% if row.order_url %}{% else %}{% endif %} {% endfor %}
受注番号状況納期得意先品番品名残
{% if row.order_url %}{{ row.order_no }}{% else %}{{ row.order_no }}{% endif %} {{ row.days }} 日遅れ {{ row.due_date|date:"Y-m-d" }}{% with day=row.due_date|weekday_ja %}{% if day %} ({{ day }}){% endif %}{% endwith %} {% master_link row.customer %} {% master_link row.item row.item.part_no %} {{ row.item.name }} {{ row.remaining|comma }}
{% if row.order_url %}{{ row.order_no }}{% else %}{{ row.order_no }}{% endif %} {% if row.days == 0 %}今日{% else %}あと {{ row.days }} 日{% endif %} {{ row.due_date|date:"Y-m-d" }}{% with day=row.due_date|weekday_ja %}{% if day %} ({{ day }}){% endif %}{% endwith %} {% master_link row.customer %} {% master_link row.item row.item.part_no %} {{ row.item.name }} {{ row.remaining|comma }}
{% endif %}
{% endif %} {% if today or alerts is not None %}
{% endif %} {% if shipping is not None and production is not None %}
{% elif shipping is not None or production is not None %}
{% endif %} {% if shipping is not None %}

出荷 (直近 6 か月)

{% include "core/_screen_help.html" with part="shipping" label="出荷の説明" %}
{% if shipping.is_empty %}
{% icon "truck" "size-6" %}

直近 6 か月の出荷はまだありません。

{% else %}
  • 数量
{% include "core/_chart_bars.html" with chart=shipping.qty_chart chart_id="shipping-qty-chart" chart_title="出荷の数量 (直近 6 か月)" chart_label="出荷の数量の図。月ごとの出荷の数量" first=shipping.qty_chart.qty_bars first_label="出荷の数量" money=False %} {% if shipping.amount_chart is not None %}
  • 金額 (円)
{% include "core/_chart_bars.html" with chart=shipping.amount_chart chart_id="shipping-amount-chart" chart_title="出荷の金額 (直近 6 か月)" chart_label="出荷の金額の図。月ごとの出荷の金額 (円)" first=shipping.amount_chart.amount_bars first_label="出荷の金額" money=True %} {% endif %}
{% if not seizou.hide_money %}{% endif %} {% for month in shipping.months %} {% if not seizou.hide_money %}{% endif %} {% endfor %}
月出荷件数数量金額
{{ month.key }} {{ month.shipment_count|comma }} {{ month.shipment_qty|floatformat:"-2g" }}{% if month.shipment_amount is not None %}{{ month.shipment_amount|yen:0 }}{% else %}—{% endif %}
{% endif %}
{% endif %} {% if production is not None %}

生産 (直近 6 か月)

{% include "core/_screen_help.html" with part="production" label="生産の説明" %}
{% if production.is_empty %}
{% icon "factory" "size-6" %}

直近 6 か月の指示書と実績はまだありません。

{% else %}
  • 発行
  • {% if production.has_progress %}
  • 完成
  • {% endif %}
{% include "core/_chart_bars.html" with chart=production.chart chart_id="production-chart" chart_title="生産 (直近 6 か月): 指示書の発行の数量と完成の数" chart_label="生産の図。月ごとの指示書の発行の数量と完成の数" first=production.chart.issued_bars first_label="発行" second=production.chart.completed_bars second_label="完成" money=False %}
{% for month in production.months %} {% endfor %}
月発行件数発行の数量完成の数
{{ month.key }} {{ month.issued_count|comma }} {{ month.issued_qty|floatformat:"-2g" }} {% if month.completed_qty is not None %}{{ month.completed_qty|floatformat:"-2g" }}{% else %}—{% endif %}
{% endif %}
{% endif %} {% if shipping is not None or production is not None %}
{% endif %} {# 最近の受注 (左) と注文の入口の図 (右。core の dashboard.order_inlets。得意先が無ければ節ごと出さない) の 1 段。lg から 2 列で、片方だけなら 1 列 (本人の決め 11-05 11:0x)。 #} {% order_inlets as inlets %} {% if recent_orders is not None and inlets %}
{% elif recent_orders is not None or inlets %}
{% endif %} {% if recent_orders is not None %}

最近の受注

{% include "core/_screen_help.html" with part="recent-orders" label="最近の受注の説明" %}
{% if orders_url %}受注の一覧を見る{% icon "chevron-right" "size-4" %}{% endif %}
{% if recent_orders %}
{% if not seizou.hide_money %}{% endif %} {% for order in recent_orders %} {% if order.url %}{% else %}{% endif %} {% if not seizou.hide_money %}{% endif %} {% endfor %}
受注番号得意先金額状態
{% if order.url %}{{ order.obj.order_no }}{% else %}{{ order.obj.order_no }}{% endif %} {% master_link order.obj.customer %}{% if order.total is not None %}{{ order.total|yen:0 }}{% else %}—{% endif %}{% status_badge order.obj small=True %}
{% else %}
{% icon "clipboard" "size-6" %}

受注はまだありません。

受注を入れると、新しい順に 5 件ここに並びます。

{% endif %}
{% endif %} {% if inlets %}

注文の入口 (今月)

{% include "core/_screen_help.html" with part="inlets" label="注文の入口の説明" %}

得意先ごとの注文の入口と、今月の明細の数です。入口が違っても、明細は 1 か所の受注に集まります。

  • seizou で直接
  • 注文書の読み取り
  • 手入力
{# 図 (C50-1 = a): 得意先の行 (名前・行の数・丸) と受注の箱は HTML の字 (凡例と同じ 12px) で、svg は丸と箱の間の線だけ。どの幅でも箱は行の横に収まる。 #} {# 1 行の高さ (row_height)・svg の高さ (height)・箱の最小の高さ (box.height) は dashboard の px の数を style に置き、3 つを縦の中央で揃える (線の端が行の中央と箱の中央に合う)。 #} {# 幅が足りなければ名前を末尾で切る (全文は名前と丸の title)。svg は幅 2rem から伸び、16rem で止まる。 #} {# 線と受注の箱の枠は字と同じ系統の濃さ (base-content の 50%)。白の地との対比が図の部品の目安 3:1 に届くため (C50 の 3。前の base-300 は 1.16:1)。 #}
    {% for row in inlets.rows %}
  • {{ row.name }} {{ row.lines|comma }} 行 {% if row.inlet == "direct" %}{{ row.name }}: {{ row.inlet_label }}・今月 {{ row.lines|comma }} 行{% elif row.inlet == "intake" %}{{ row.name }}: {{ row.inlet_label }}・今月 {{ row.lines|comma }} 行{% else %}{{ row.name }}: {{ row.inlet_label }}・今月 {{ row.lines|comma }} 行{% endif %}
  • {% endfor %} {% if inlets.others %}
  • ほか {{ inlets.others.count|comma }} 社 ({{ inlets.others.lines|comma }} 行)
  • {% endif %}
注文の入口 (今月) {% for row in inlets.rows %} {% endfor %}
受注 今月 {{ inlets.total_lines|comma }} 行
{% endif %} {% if recent_orders is not None or inlets %}
{% endif %} {# よく使う画面: 下の段の外の全幅の 1 段。ブックマークの部品 (bookmarks) が入っていればその節 (登録した画面。0 件なら 1 行の案内)、無ければ入口の一覧。 #} {% if "bookmarks" in seizou.parts %}{% include "bookmarks/_home.html" %}{% else %}{% include "core/_entrances.html" %}{% endif %} {% endblock %}