@kernhq/module-billing 0.5.10 → 0.5.11
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": "@kernhq/module-billing",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.11",
|
|
4
4
|
"description": "Kern billing module: plans, entitlements, subscriptions and Stripe — the mechanism that lets any Kern instance sell seats on itself",
|
|
5
5
|
"homepage": "https://github.com/KernAIO/module-billing#readme",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -231,7 +231,8 @@ const planOptions = $derived([
|
|
|
231
231
|
<div class="flex items-center gap-1.5">
|
|
232
232
|
<span class="truncate">{row.planName ?? t('no_plan')}</span>
|
|
233
233
|
{#if row.overridden}
|
|
234
|
-
|
|
234
|
+
<!-- shrink-0: the badge was the thing that gave way, and "Overrid" is not a word -->
|
|
235
|
+
<Badge tone="purple" class="shrink-0" title={t('admin_overridden_hint')}>
|
|
235
236
|
{t('admin_overridden')}
|
|
236
237
|
</Badge>
|
|
237
238
|
{/if}
|
package/src/client/i18n.ts
CHANGED
|
@@ -129,6 +129,12 @@ export const en: Record<string, Message> = {
|
|
|
129
129
|
'billing.invoice_number': 'Invoice',
|
|
130
130
|
'billing.invoice_view': 'View',
|
|
131
131
|
'billing.invoice_pdf': 'PDF',
|
|
132
|
+
'billing.invoice_status': 'Status',
|
|
133
|
+
'billing.invoice_status_paid': 'Paid',
|
|
134
|
+
'billing.invoice_status_open': 'Awaiting payment',
|
|
135
|
+
'billing.invoice_status_uncollectible': 'Unpaid',
|
|
136
|
+
'billing.invoice_status_void': 'Void',
|
|
137
|
+
'billing.invoice_status_draft': 'Draft',
|
|
132
138
|
'billing.invoices_empty': 'No invoices yet',
|
|
133
139
|
'billing.invoices_empty_hint': 'An invoice appears here after the first payment.',
|
|
134
140
|
'billing.invoices_section': 'Invoices',
|
|
@@ -289,6 +295,12 @@ const ar: Record<string, Message> = {
|
|
|
289
295
|
'billing.invoice_number': 'الفاتورة',
|
|
290
296
|
'billing.invoice_view': 'عرض',
|
|
291
297
|
'billing.invoice_pdf': 'PDF',
|
|
298
|
+
'billing.invoice_status': 'الحالة',
|
|
299
|
+
'billing.invoice_status_paid': 'مدفوعة',
|
|
300
|
+
'billing.invoice_status_open': 'بانتظار الدفع',
|
|
301
|
+
'billing.invoice_status_uncollectible': 'غير مدفوعة',
|
|
302
|
+
'billing.invoice_status_void': 'ملغاة',
|
|
303
|
+
'billing.invoice_status_draft': 'مسودة',
|
|
292
304
|
'billing.invoices_empty': 'لا فواتير بعد',
|
|
293
305
|
'billing.invoices_empty_hint': 'تظهر الفاتورة هنا بعد أول عملية دفع.',
|
|
294
306
|
'billing.invoices_section': 'الفواتير',
|
|
@@ -456,6 +468,12 @@ const de: Record<string, Message> = {
|
|
|
456
468
|
'billing.invoice_number': 'Rechnung',
|
|
457
469
|
'billing.invoice_view': 'Ansehen',
|
|
458
470
|
'billing.invoice_pdf': 'PDF',
|
|
471
|
+
'billing.invoice_status': 'Status',
|
|
472
|
+
'billing.invoice_status_paid': 'Bezahlt',
|
|
473
|
+
'billing.invoice_status_open': 'Zahlung ausstehend',
|
|
474
|
+
'billing.invoice_status_uncollectible': 'Unbezahlt',
|
|
475
|
+
'billing.invoice_status_void': 'Storniert',
|
|
476
|
+
'billing.invoice_status_draft': 'Entwurf',
|
|
459
477
|
'billing.invoices_empty': 'Noch keine Rechnungen',
|
|
460
478
|
'billing.invoices_empty_hint': 'Nach der ersten Zahlung erscheint hier eine Rechnung.',
|
|
461
479
|
'billing.invoices_section': 'Rechnungen',
|
|
@@ -616,6 +634,12 @@ const fa: Record<string, Message> = {
|
|
|
616
634
|
'billing.invoice_number': 'صورتحساب',
|
|
617
635
|
'billing.invoice_view': 'نمایش',
|
|
618
636
|
'billing.invoice_pdf': 'PDF',
|
|
637
|
+
'billing.invoice_status': 'وضعیت',
|
|
638
|
+
'billing.invoice_status_paid': 'پرداختشده',
|
|
639
|
+
'billing.invoice_status_open': 'در انتظار پرداخت',
|
|
640
|
+
'billing.invoice_status_uncollectible': 'پرداختنشده',
|
|
641
|
+
'billing.invoice_status_void': 'باطلشده',
|
|
642
|
+
'billing.invoice_status_draft': 'پیشنویس',
|
|
619
643
|
'billing.invoices_empty': 'هنوز صورتحسابی نیست',
|
|
620
644
|
'billing.invoices_empty_hint': 'پس از نخستین پرداخت، صورتحساب اینجا میآید.',
|
|
621
645
|
'billing.invoices_section': 'صورتحسابها',
|
|
@@ -775,6 +799,12 @@ const tr: Record<string, Message> = {
|
|
|
775
799
|
'billing.invoice_number': 'Fatura',
|
|
776
800
|
'billing.invoice_view': 'Görüntüle',
|
|
777
801
|
'billing.invoice_pdf': 'PDF',
|
|
802
|
+
'billing.invoice_status': 'Durum',
|
|
803
|
+
'billing.invoice_status_paid': 'Ödendi',
|
|
804
|
+
'billing.invoice_status_open': 'Ödeme bekleniyor',
|
|
805
|
+
'billing.invoice_status_uncollectible': 'Ödenmedi',
|
|
806
|
+
'billing.invoice_status_void': 'İptal edildi',
|
|
807
|
+
'billing.invoice_status_draft': 'Taslak',
|
|
778
808
|
'billing.invoices_empty': 'Henüz fatura yok',
|
|
779
809
|
'billing.invoices_empty_hint': 'İlk ödemeden sonra burada bir fatura görünür.',
|
|
780
810
|
'billing.invoices_section': 'Faturalar',
|
|
@@ -57,6 +57,35 @@ const locale = $derived(messageLocale())
|
|
|
57
57
|
/** Where Stripe sends the person back to, and where the portal returns them. */
|
|
58
58
|
const returnPath = $derived(`/${slug}/settings/billing/plan`)
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Stripe's invoice statuses, said in words. An accountant reading the list needs to know which
|
|
62
|
+
* rows are still owed before they need the links; the list used to show number, date and amount
|
|
63
|
+
* and nothing about whether any of it had been paid.
|
|
64
|
+
*/
|
|
65
|
+
const INVOICE_TONE: Record<string, 'success' | 'warning' | 'danger' | 'grey'> = {
|
|
66
|
+
paid: 'success',
|
|
67
|
+
open: 'warning',
|
|
68
|
+
uncollectible: 'danger',
|
|
69
|
+
void: 'grey',
|
|
70
|
+
draft: 'grey',
|
|
71
|
+
}
|
|
72
|
+
function invoiceStatus(status: string): string {
|
|
73
|
+
switch (status) {
|
|
74
|
+
case 'paid':
|
|
75
|
+
return t('invoice_status_paid')
|
|
76
|
+
case 'open':
|
|
77
|
+
return t('invoice_status_open')
|
|
78
|
+
case 'uncollectible':
|
|
79
|
+
return t('invoice_status_uncollectible')
|
|
80
|
+
case 'void':
|
|
81
|
+
return t('invoice_status_void')
|
|
82
|
+
case 'draft':
|
|
83
|
+
return t('invoice_status_draft')
|
|
84
|
+
default:
|
|
85
|
+
return status
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
60
89
|
/**
|
|
61
90
|
* What Stripe said on the way back, from `?checkout=`.
|
|
62
91
|
*
|
|
@@ -501,10 +530,13 @@ function once(run: () => void) {
|
|
|
501
530
|
/>
|
|
502
531
|
{:else}
|
|
503
532
|
<div class="overflow-x-auto">
|
|
504
|
-
<Table
|
|
533
|
+
<Table
|
|
534
|
+
columns="minmax(120px,1fr) minmax(120px,1fr) minmax(96px,auto) minmax(100px,auto) minmax(80px,auto)"
|
|
535
|
+
>
|
|
505
536
|
<TableHeader>
|
|
506
537
|
<TableCell header>{t('invoice_number')}</TableCell>
|
|
507
538
|
<TableCell header>{t('invoice_date')}</TableCell>
|
|
539
|
+
<TableCell header>{t('invoice_status')}</TableCell>
|
|
508
540
|
<TableCell header end>{t('invoice_amount')}</TableCell>
|
|
509
541
|
<TableCell header end></TableCell>
|
|
510
542
|
</TableHeader>
|
|
@@ -512,6 +544,9 @@ function once(run: () => void) {
|
|
|
512
544
|
<TableRow>
|
|
513
545
|
<TableCell>{inv.number ?? '—'}</TableCell>
|
|
514
546
|
<TableCell>{day(inv.createdAt)}</TableCell>
|
|
547
|
+
<TableCell>
|
|
548
|
+
<Badge tone={INVOICE_TONE[inv.status] ?? 'grey'}>{invoiceStatus(inv.status)}</Badge>
|
|
549
|
+
</TableCell>
|
|
515
550
|
<TableCell end>{formatMoney(inv.totalMinor, inv.currency, locale)}</TableCell>
|
|
516
551
|
<TableCell end>
|
|
517
552
|
<!-- Both links Stripe gives us: the hosted page (pay, see the receipt) and the PDF
|