@ticketboothapp/booking 1.2.138 → 1.2.139

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticketboothapp/booking",
3
- "version": "1.2.138",
3
+ "version": "1.2.139",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -163,21 +163,25 @@ export function AdminChangeReceiptComparison({
163
163
  );
164
164
  const changeSubtotal = roundMoney(amountDue - changeTax);
165
165
  const originalCurrency = originalReceipt.currency ?? currency;
166
- const originalReceiptLinesWithUnitAmounts = useMemo(
166
+ const originalReceiptLinesWithComparableBreakdowns = useMemo(
167
167
  () =>
168
168
  originalReceiptLines.map((line) =>
169
169
  line.kind === 'ticket' && line.qty > 0
170
170
  ? {
171
171
  ...line,
172
- unitAmountLabel: `${formatCurrencyAmount(
173
- roundMoney(line.itemTotal / line.qty),
174
- originalCurrency,
175
- displayLocale,
176
- )} each`,
172
+ breakdown: line.breakdown ?? {
173
+ lineItems: [],
174
+ subtotalAfterAdjustments: roundMoney(line.itemTotal / line.qty),
175
+ feeLines: [],
176
+ taxRate: 0,
177
+ taxAmount: 0,
178
+ isTaxIncluded: false,
179
+ finalPrice: roundMoney(line.itemTotal / line.qty),
180
+ },
177
181
  }
178
182
  : line,
179
183
  ),
180
- [displayLocale, originalCurrency, originalReceiptLines],
184
+ [originalReceiptLines],
181
185
  );
182
186
  const amountDueClass =
183
187
  amountDue < -0.005
@@ -197,7 +201,7 @@ export function AdminChangeReceiptComparison({
197
201
  </span>
198
202
  </div>
199
203
  <PriceSummary
200
- lines={originalReceiptLinesWithUnitAmounts}
204
+ lines={originalReceiptLinesWithComparableBreakdowns}
201
205
  total={originalReceipt.total}
202
206
  currency={originalCurrency}
203
207
  locale={displayLocale}
@@ -12,7 +12,6 @@ export interface PriceBreakdownProps {
12
12
  category: string;
13
13
  qty: number;
14
14
  itemTotal: number;
15
- unitAmountLabel?: string;
16
15
  breakdown: PriceBreakdownType | null;
17
16
  currency: Currency;
18
17
  locale: Locale;
@@ -60,7 +59,6 @@ export function PriceBreakdown({
60
59
  category,
61
60
  qty,
62
61
  itemTotal,
63
- unitAmountLabel,
64
62
  breakdown,
65
63
  currency,
66
64
  locale,
@@ -98,7 +96,6 @@ export function PriceBreakdown({
98
96
  ) : (
99
97
  <span className="text-sm text-stone-600">
100
98
  {category} {qty > 1 ? `× ${qty}` : ''}
101
- {unitAmountLabel ? <span className="ml-1 text-xs text-stone-400">· {unitAmountLabel}</span> : null}
102
99
  </span>
103
100
  )}
104
101
  {editable && onEditableChange ? (
@@ -160,7 +157,6 @@ export function PriceBreakdown({
160
157
  }
161
158
  >
162
159
  {category} {qty > 1 ? `× ${qty}` : ''}
163
- {unitAmountLabel ? <span className="ml-1 text-xs text-stone-400">· {unitAmountLabel}</span> : null}
164
160
  </span>
165
161
  )}
166
162
  <div className="relative flex-shrink-0 whitespace-nowrap">
@@ -18,7 +18,6 @@ export type PriceSummaryLine =
18
18
  category: string;
19
19
  qty: number;
20
20
  itemTotal: number;
21
- unitAmountLabel?: string;
22
21
  breakdown?: PriceBreakdownType | null;
23
22
  }
24
23
  | {
@@ -211,7 +210,6 @@ export function PriceSummary({
211
210
  category={row.category}
212
211
  qty={row.qty}
213
212
  itemTotal={row.itemTotal}
214
- unitAmountLabel={row.unitAmountLabel}
215
213
  breakdown={row.breakdown ?? null}
216
214
  currency={currency}
217
215
  locale={locale}