金額内訳AmountBreakdownExperimental

The read-only money-derivation ledger: labeled line items, signed deductions, optional per-section subtotals, and an emphasized derived total, with an optional formula caption. The 'labeled lines → ± adjustments → total' block every 請求 / 見積 / 査定 / 支払 / 精算 / 控除 / 給与明細 screen needs (認定損害額 − 過失相殺 − 免責 − 既払金 = 今回支払額 / 基本保険料 + 特約 − 各割引 = 年間保険料). Deductions render as a −|amount| glyph (sign never colour-only) with an sr-only 控除 label. Read-only by design — for an editable line-item grid with column totals use EditableDataTable; for a single signed delta use Statistic/Delta; for the back-office KPI strip use StatGroup. RSC-safe by default (formatValue defaults to formatCurrency); pass a custom formatValue only from a client boundary.

プレビュー

過失割合
認定損害額
修理費
¥480,000
レッカー費用
¥22,000
代車費用
¥38,000
認定損害額 計
¥540,000
過失相殺
認定額 × 過失割合 30%
控除 −¥162,000
免責金額
控除 −¥50,000
既払金(内払)
控除 −¥100,000
今回支払額
¥228,000

今回支払額 = 認定損害額 − 過失相殺 − 免責 − 既払金

Props

表は横にスクロールできます
プロパティ初期値説明
linesAmountLine[]-行(順番どおり)。各行は line(既定)/ subtotal(点線の小計)/ heading(セクション見出し)。
AmountLine.labelReactNode-行ラベル。
AmountLine.amountnumber-金額。正の値を渡し、減算は kind で表す(heading は省略)。
AmountLine.kind"add" | "subtract""add"subtract は −|amount| を控除トーンで表示(符号は色だけに依存しない)。
AmountLine.noteReactNode-ラベル下の補足(過失割合 30% / 特約名 / 等級 など)。
total{ label, amount, tone? }-強調表示する導出合計。tone は neutral(既定)/ positive / negative。
formulaReactNode-合計の下に出す数式キャプション(例: 今回支払額 = 認定損害額 − 過失相殺 − 免責 − 既払金)。
formatValue(value: number) => stringformatCurrency値の整形。既定は formatCurrency(JPY / ja-JP)=RSC安全。独自の関数を渡すのはクライアント境界からのみ。

Usage

import { AmountBreakdown } from "@gunjo/ui"

<AmountBreakdown
  lines={[
    { type: "heading", label: "認定損害額" },
    { label: "修理費", amount: 480000 },
    { label: "レッカー費用", amount: 22000 },
    { type: "subtotal", label: "認定損害額 計", amount: 502000 },
    { label: "過失相殺", kind: "subtract", amount: 150600, note: "認定額 × 過失割合 30%" },
    { label: "免責金額", kind: "subtract", amount: 50000 },
    { label: "既払金(内払)", kind: "subtract", amount: 100000 },
  ]}
  total={{ label: "今回支払額", amount: 201400 }}
  formula="今回支払額 = 認定損害額 − 過失相殺 − 免責 − 既払金"
/>

使用コンポーネント