{% load seizou_tags billing_tags %} {# 請求書の一覧の 1 行 (billing/_rows.html が core/_rows.html の row_template で include する)。context: row (土台の row_for の 1 行。obj は Invoice)・columns。 #} {% comment %}欄の描き方は core/_rows.html と同じ。「入金」の列は入金の状態の印 (取消の請求書は「—」の字)、「状態」の列は「発行」を印の無い字にし、取消だけを状態の印 (赤の線) にする (決め 11-05 16:2x。開発の記録 docs/nights/20261105/N164.md)。 「残」の列は、取消の請求書では「—」(同じ行の「入金」と同じ。残の金額が出ると入金待ちに見えるため = T03 の直し 11-07。列の値と CSV の残は、取消の請求書では空 = Invoice.get_balance_display。N377)。{% endcomment %} {# 右端の欄は「要点を見る」の目の印 (土台の目の印の部品を include する。押すと請求書の小窓。受注と指示書の一覧の行と同じ形)。 #} {% for cell in row.cells %} {% for col in columns %}{% if forloop.counter0 == forloop.parentloop.counter0 %} {% if col.name == "payment_status_label" %}{% if row.obj.status == "cancelled" %}{{ cell.value|default_if_none:"" }}{% else %}{% payment_badge row.obj %}{% endif %} {% elif col.name == "status" %}{% if row.obj.status == "cancelled" %}{% status_badge row.obj %}{% else %}{{ cell.value|default_if_none:"" }}{% endif %} {% elif col.name == "balance" and row.obj.status == "cancelled" %}— {% elif forloop.parentloop.first and row.url and not cell.numeric and not cell.master %}{% if cell.datetime %}{{ cell.value|date:"Y-m-d H:i" }}{% elif cell.date %}{{ cell.value|date:"Y-m-d" }}{% else %}{{ cell.value|default_if_none:"" }}{% endif %} {% elif cell.numeric %}{% if cell.master %}{% master_link cell.master cell.value %}{% elif cell.negative %}{{ cell.value|yen_if:cell.money }}{% else %}{{ cell.value|yen_if:cell.money }}{% endif %} {% elif cell.date or cell.datetime %}{% if cell.datetime %}{{ cell.value|date:"Y-m-d H:i" }}{% else %}{{ cell.value|date:"Y-m-d" }}{% with day=cell.value|weekday_ja %}{% if day %} ({{ day }}){% endif %}{% endwith %}{% endif %} {% elif cell.master %}{% master_link cell.master cell.value %} {% elif cell.boolean %}{% bool_mark cell.value %} {% else %}{{ cell.value|default_if_none:"" }} {% endif %} {% endif %}{% endfor %} {% endfor %} {# 右端の「要点」の列 (billing/_rows.html が土台に actions_label を渡して見出しを出す)。目の印を押すと請求書の小窓 (InvoiceModalView) を開く。 #} {% url 'billing:invoice_modal' row.pk as modal_url %}{% include "core/_row_summary_link.html" with modal_url=modal_url detail_url=row.url %}