@open-mercato/core 0.4.7-develop-7c7b3f9d84 → 0.4.7-develop-d6331ed114
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/dist/modules/sales/api/payments/route.js.map +2 -2
- package/dist/modules/sales/backend/sales/documents/[id]/page.js +6 -9
- package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +2 -2
- package/dist/modules/sales/commands/payments.js +16 -2
- package/dist/modules/sales/commands/payments.js.map +2 -2
- package/dist/modules/sales/components/documents/PaymentsSection.js +3 -8
- package/dist/modules/sales/components/documents/PaymentsSection.js.map +2 -2
- package/package.json +3 -3
- package/src/modules/sales/api/payments/route.ts +2 -2
- package/src/modules/sales/backend/sales/documents/[id]/page.tsx +8 -16
- package/src/modules/sales/commands/payments.ts +19 -3
- package/src/modules/sales/components/documents/PaymentsSection.tsx +4 -9
|
@@ -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?: (
|
|
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 (
|
|
202
|
-
|
|
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
|
-
|
|
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' })
|