@ticketboothapp/booking 1.2.94 → 1.2.95

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.94",
3
+ "version": "1.2.95",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -4153,9 +4153,47 @@ export function AdminChangeBookingFlow({
4153
4153
  });
4154
4154
  }, [adminCustomReceiptLines]);
4155
4155
 
4156
+ /**
4157
+ * Provider `/change` applies from booking item billable rows plus `pricingAdjustment`.
4158
+ * For admin FE-authoritative receipts, the quote/receipt total can include an explicit tax row while the provider
4159
+ * billable-row builder does not add that row on a date-only change. Send it as an automatic adjustment so
4160
+ * `newTotalAmount` and the billable line sum stay in lockstep.
4161
+ */
4162
+ const providerReceiptTaxAdjustment = useMemo((): Array<{ label: string; amount: number }> => {
4163
+ if (!isProviderDashboardChange || !useAdminFeAuthoritativeQuote) return [];
4164
+ const tax = roundMoney(adminFeAuthoritativeReceipt.tax);
4165
+ if (Math.abs(tax) < 0.005) return [];
4166
+ const providerAlreadyHasTaxLine = providerQuotedLines.some((line) => {
4167
+ const type = String(line.type ?? '').trim().toUpperCase();
4168
+ const label = String(line.label ?? '').trim().toLowerCase();
4169
+ return type === 'TAX' || label.includes('tax');
4170
+ });
4171
+ if (providerAlreadyHasTaxLine) return [];
4172
+ const taxLine = adminFeAuthoritativeReceipt.lineItems.find(
4173
+ (line) => String(line.type ?? '').trim().toUpperCase() === 'TAX'
4174
+ );
4175
+ return [
4176
+ {
4177
+ label: taxLine?.label?.trim() || (t('booking.tax') !== 'booking.tax' ? t('booking.tax') : 'Taxes and fees'),
4178
+ amount: tax,
4179
+ },
4180
+ ];
4181
+ }, [
4182
+ isProviderDashboardChange,
4183
+ useAdminFeAuthoritativeQuote,
4184
+ adminFeAuthoritativeReceipt.tax,
4185
+ adminFeAuthoritativeReceipt.lineItems,
4186
+ providerQuotedLines,
4187
+ t,
4188
+ ]);
4189
+
4156
4190
  const mergedProviderAdditionalAdjustments = useMemo(
4157
- () => [...providerAdditionalAdjustments, ...adminCustomLinesAsAdditionalAdjustments],
4158
- [providerAdditionalAdjustments, adminCustomLinesAsAdditionalAdjustments]
4191
+ () => [
4192
+ ...providerAdditionalAdjustments,
4193
+ ...adminCustomLinesAsAdditionalAdjustments,
4194
+ ...providerReceiptTaxAdjustment,
4195
+ ],
4196
+ [providerAdditionalAdjustments, adminCustomLinesAsAdditionalAdjustments, providerReceiptTaxAdjustment]
4159
4197
  );
4160
4198
 
4161
4199
  const changeFlowSelectionPreview = useMemo((): ChangeFlowSelectionPreview | null => {
@@ -143,6 +143,7 @@
143
143
  "orgPayoutMethodPlaceholder": "Select payout method",
144
144
  "orgPayoutMethodCheque": "Cheque",
145
145
  "orgPayoutMethodETransfer": "E-transfer",
146
+ "orgPayoutMethodCash": "Cash",
146
147
  "orgPayoutPayee": "Payee",
147
148
  "orgPayoutRecipientMode": "Recipient mode",
148
149
  "orgPayoutNotes": "Notes",