@bytebrand/fe-ui-core-autobahn 1.0.103 → 1.0.104

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vdp/VdpModules.tsx +17 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core-autobahn",
3
- "version": "1.0.103",
3
+ "version": "1.0.104",
4
4
  "description": "auto.de md3 (Autobahn) design system — UI primitives, cards, chrome, VDP modules, theme CSS and locales. Ships raw TypeScript source (like fe-ui-core before it); each consumer's bundler compiles it.",
5
5
  "main": "index.ts",
6
6
  "license": "UNLICENSED",
@@ -2074,17 +2074,20 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
2074
2074
  // already carried inside `monthly` instead), the real flat price when switched off.
2075
2075
  const addServicesRowValue = withAddServices ? 0 : addServicesCostRaw ?? 0;
2076
2076
  const hasAddServicesRow = addServicesCostRaw != null && addServicesCostRaw > 0;
2077
- // Grand total (Figma "Gesamtbelastung inkl. Anzahlung & Paket") — down payment + the config's
2078
- // real Gesamtbetrag + the package fee. The package is mandatory (see packageMandatoryNotice) —
2079
- // the toggle only decides HOW it's paid (bundled into the rate vs. a separate one-time charge),
2080
- // never WHETHER it's owed, so the total must include it either way: `addServicesCost` when
2081
- // bundled (toggle on), the raw one-time fee (`addServicesRowValue`, same as the breakdown row
2082
- // above it) when paid separately (toggle off) — previously dropped to 0 in the off case, so the
2083
- // grand total silently excluded a cost the breakdown row directly above it was still showing.
2084
- // Only shown when Gesamtbetrag is known (never fabricated).
2077
+ // Grand total (Figma "Gesamtbelastung inkl. Anzahlung & Paket") — down payment + the "Gesamtbetrag
2078
+ // Finanzierung" figure directly above it (totalFinancingAmount; falls back to grossAmount when
2079
+ // the page hasn't been updated to pass it yet — financing-only, mirrors totalRepaymentValue
2080
+ // below) + the package fee. The package is mandatory (see packageMandatoryNotice) — the toggle
2081
+ // only decides HOW it's paid (bundled into the rate vs. a separate one-time charge), never
2082
+ // WHETHER it's owed, so the total must include it either way: `addServicesCost` when bundled
2083
+ // (toggle on), the raw one-time fee (`addServicesRowValue`, same as the breakdown row above it)
2084
+ // when paid separately (toggle off) — previously dropped to 0 in the off case, so the grand
2085
+ // total silently excluded a cost the breakdown row directly above it was still showing.
2086
+ // Only shown when the total is known (never fabricated).
2087
+ const totalRepaymentBase = totalFinancingAmount ?? grossAmount;
2085
2088
  const totalCost =
2086
- grossAmount != null && grossAmount > 0
2087
- ? down + grossAmount + (hasAddServices ? (addServicesCost as number) : hasAddServicesRow ? addServicesRowValue : 0)
2089
+ totalRepaymentBase != null && totalRepaymentBase > 0
2090
+ ? down + totalRepaymentBase + (hasAddServices ? (addServicesCost as number) : hasAddServicesRow ? addServicesRowValue : 0)
2088
2091
  : undefined;
2089
2092
 
2090
2093
  let rows: Array<[string, string, boolean?]>;
@@ -2135,9 +2138,10 @@ export const FinanceDetailsModal: React.FunctionComponent<FinanceDetailsModalPro
2135
2138
  // `term` payments are regular — no adjustment.
2136
2139
  const hasBalloon = finalInstallment != null && finalInstallment > 0;
2137
2140
  const regularRateCount = hasBalloon ? term - 1 : term;
2138
- // Repräsentatives-Beispiel total for THIS line only — falls back to grossAmount when the
2139
- // page hasn't been updated to pass totalFinancingAmount yet.
2140
- const totalRepaymentValue = totalFinancingAmount ?? grossAmount;
2141
+ // Repräsentatives-Beispiel total for THIS line (and the grand total below it, via
2142
+ // totalRepaymentBase) — falls back to grossAmount when the page hasn't been updated to
2143
+ // pass totalFinancingAmount yet.
2144
+ const totalRepaymentValue = totalRepaymentBase;
2141
2145
  rows = [
2142
2146
  [t('autobahn:modal.vehiclePrice'), `${eurCents(basePrice ?? price)} €`],
2143
2147
  [t('autobahn:modal.term'), t('autobahn:modal.months', { months: term, count: term })],