@open-mercato/core 0.4.7-develop-e301da2f94 → 0.4.7-develop-21e4edc28c

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.
@@ -39,7 +39,7 @@ type SalesDocumentPaymentsSectionProps = {
39
39
  organizationId?: string | null
40
40
  tenantId?: string | null
41
41
  onActionChange?: (action: SectionAction | null) => void
42
- onTotalsChange?: (totals: PaymentTotals) => void
42
+ onTotalsChange?: () => void
43
43
  onPaymentsChange?: (payments: PaymentRow[]) => void
44
44
  }
45
45
 
@@ -198,10 +198,8 @@ export function SalesDocumentPaymentsSection({
198
198
  )
199
199
 
200
200
  const handlePaymentSaved = React.useCallback(
201
- async (totals?: PaymentTotals | null) => {
202
- if (totals && onTotalsChange) {
203
- onTotalsChange(totals)
204
- }
201
+ async (_totals?: PaymentTotals | null) => {
202
+ onTotalsChange?.()
205
203
  await loadPayments()
206
204
  emitSalesDocumentTotalsRefresh({ documentId: orderId, kind: 'order' })
207
205
  handleDialogChange(false)
@@ -222,10 +220,7 @@ export function SalesDocumentPaymentsSection({
222
220
  errorMessage: t('sales.documents.payments.errorDelete', 'Failed to delete payment.'),
223
221
  })
224
222
  if (result.ok) {
225
- const totals = result.result?.orderTotals ?? null
226
- if (totals && onTotalsChange) {
227
- onTotalsChange(totals)
228
- }
223
+ onTotalsChange?.()
229
224
  flash(t('sales.documents.payments.deleted', 'Payment deleted.'), 'success')
230
225
  await loadPayments()
231
226
  emitSalesDocumentTotalsRefresh({ documentId: orderId, kind: 'order' })