Abrechnen nur über die Abrechnungsübersicht, solange das Modul aktiv ist

Direkter Übergang nach billed → invalid use_billing_overview (nach der Rechteprüfung),
Button im Auftragsdetail ausgeblendet, markBilled läuft über den Abrechnungseintrag.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 10:53:16 +02:00
co-authored by Claude Opus 5
parent 8324c48178
commit 6b8cdf543b
6 changed files with 106 additions and 4 deletions
+9 -1
View File
@@ -102,7 +102,15 @@ export default async function WorkOrderDetailPage({ params, searchParams }: { pa
showEdit ? listOrderTypes(ctx) : Promise.resolve([]),
]);
const billingTransitions = transitions.filter((to) => ["released_for_billing", "billed"].includes(to) || (wo.status === "in_review" && to === "in_progress") || (wo.status === "released_for_billing" && to === "in_review"));
// L14: with the billing overview active, "billed" is set only there (snapshot + position assignment) → no direct button
const billingModule = await ctx.db.tenantModule.findFirst({ where: { moduleKey: "billing" }, select: { enabled: true } });
const billingOverviewActive = !billingModule || billingModule.enabled;
const billingTransitions = transitions.filter(
(to) =>
(to === "released_for_billing" || (to === "billed" && !billingOverviewActive)) ||
(wo.status === "in_review" && to === "in_progress") ||
(wo.status === "released_for_billing" && to === "in_review"),
);
const tabProps = { ctx, wo, locale, tz, canEdit: canEditPlanning };