Phase7: Void/Refund logic
All checks were successful
Build and Push / build (push) Successful in 1m43s

This commit is contained in:
2026-05-25 22:59:18 +02:00
parent 1c61111da3
commit 667617296b
2 changed files with 20 additions and 20 deletions

View File

@@ -462,34 +462,34 @@ export function InvoiceDetailView({ detail, creditNotes = [] }: Props) {
<table className="w-full text-sm"> <table className="w-full text-sm">
<thead className="text-xs text-text-muted text-left"> <thead className="text-xs text-text-muted text-left">
<tr> <tr>
<th className="pb-2">{t("creditNoteNumberHeader")}</th> <th className="pb-2 pr-4">{t("creditNoteNumberHeader")}</th>
<th className="pb-2">{t("creditNoteKindHeader")}</th> <th className="pb-2 pr-4">{t("creditNoteKindHeader")}</th>
<th className="pb-2 text-right"> <th className="pb-2 pr-4 text-right">
{t("creditNoteAmountHeader")} {t("creditNoteAmountHeader")}
</th> </th>
<th className="pb-2">{t("creditNoteReasonHeader")}</th> <th className="pb-2 pr-4">{t("creditNoteReasonHeader")}</th>
<th className="pb-2">{t("creditNoteIssuedHeader")}</th> <th className="pb-2 pr-4">{t("creditNoteIssuedHeader")}</th>
<th className="pb-2 text-right">{t("creditNotePdfHeader")}</th> <th className="pb-2 text-right">{t("creditNotePdfHeader")}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{creditNotes.map((cn) => ( {creditNotes.map((cn) => (
<tr key={cn.id} className="border-t border-border"> <tr key={cn.id} className="border-t border-border">
<td className="py-2 font-mono text-xs"> <td className="py-2 pr-4 font-mono text-xs">
{cn.creditNoteNumber} {cn.creditNoteNumber}
</td> </td>
<td className="py-2"> <td className="py-2 pr-4">
<span className="px-2 py-0.5 rounded text-xs text-error bg-error/10"> <span className="px-2 py-0.5 rounded text-xs text-error bg-error/10">
{t(`creditNoteKind_${cn.kind}` as any)} {t(`creditNoteKind_${cn.kind}` as any)}
</span> </span>
</td> </td>
<td className="py-2 text-right font-mono"> <td className="py-2 pr-4 text-right font-mono whitespace-nowrap">
CHF {cn.amountChf.toFixed(2)} CHF {cn.amountChf.toFixed(2)}
</td> </td>
<td className="py-2 text-text-secondary text-xs"> <td className="py-2 pr-4 text-text-secondary text-xs">
{cn.reason ?? "—"} {cn.reason ?? "—"}
</td> </td>
<td className="py-2 text-xs text-text-muted"> <td className="py-2 pr-4 text-xs text-text-muted whitespace-nowrap">
{cn.issuedAt.slice(0, 10)} {cn.issuedAt.slice(0, 10)}
</td> </td>
<td className="py-2 text-right"> <td className="py-2 text-right">

View File

@@ -39,11 +39,11 @@ export function CustomerCreditNoteList({ creditNotes }: Props) {
<table className="w-full text-sm"> <table className="w-full text-sm">
<thead className="text-xs text-text-muted text-left"> <thead className="text-xs text-text-muted text-left">
<tr> <tr>
<th className="pb-2">{t("creditNoteNumberCol")}</th> <th className="pb-2 pr-4">{t("creditNoteNumberCol")}</th>
<th className="pb-2">{t("creditNoteInvoiceCol")}</th> <th className="pb-2 pr-4">{t("creditNoteInvoiceCol")}</th>
<th className="pb-2">{t("creditNoteIssuedCol")}</th> <th className="pb-2 pr-4">{t("creditNoteIssuedCol")}</th>
<th className="pb-2 text-right">{t("creditNoteAmountCol")}</th> <th className="pb-2 pr-4 text-right">{t("creditNoteAmountCol")}</th>
<th className="pb-2 text-right">{t("creditNoteKindCol")}</th> <th className="pb-2 pr-4 text-right">{t("creditNoteKindCol")}</th>
<th className="pb-2 text-right">{t("creditNotePdfCol")}</th> <th className="pb-2 text-right">{t("creditNotePdfCol")}</th>
</tr> </tr>
</thead> </thead>
@@ -53,19 +53,19 @@ export function CustomerCreditNoteList({ creditNotes }: Props) {
key={cn.id} key={cn.id}
className="border-t border-border align-middle" className="border-t border-border align-middle"
> >
<td className="py-2 font-mono text-xs"> <td className="py-2 pr-4 font-mono text-xs">
{cn.creditNoteNumber} {cn.creditNoteNumber}
</td> </td>
<td className="py-2 font-mono text-xs text-text-secondary"> <td className="py-2 pr-4 font-mono text-xs text-text-secondary">
{cn.invoiceNumber} {cn.invoiceNumber}
</td> </td>
<td className="py-2 text-text-secondary"> <td className="py-2 pr-4 text-text-secondary whitespace-nowrap">
{fmt.dateTime(new Date(cn.issuedAt), { dateStyle: "medium" })} {fmt.dateTime(new Date(cn.issuedAt), { dateStyle: "medium" })}
</td> </td>
<td className="py-2 text-right font-mono"> <td className="py-2 pr-4 text-right font-mono whitespace-nowrap">
CHF {cn.amountChf.toFixed(2)} CHF {cn.amountChf.toFixed(2)}
</td> </td>
<td className="py-2 text-right"> <td className="py-2 pr-4 text-right">
<span <span
className={`px-2 py-0.5 rounded text-xs ${ className={`px-2 py-0.5 rounded text-xs ${
kindColors[cn.kind] ?? "" kindColors[cn.kind] ?? ""