Nachtragungen ohne Rechnung bezahlt setzen
All checks were successful
CI / Build (push) Successful in 1m59s
CI / Deploy (push) Successful in 1m48s

This commit is contained in:
jan
2026-05-01 18:19:30 +02:00
parent 3cb48eeb78
commit f7b8750e52
2 changed files with 21 additions and 16 deletions

View File

@@ -35,10 +35,6 @@ export async function POST(_: Request, { params }: Context) {
return NextResponse.json({ error: "Bezahlt ist erst nach Freigabe moeglich." }, { status: 400 });
}
if (!expense.proofUrl || !expense.invoiceDate || !expense.documentedAt) {
return NextResponse.json({ error: "Bitte zuerst Rechnung mit Rechnungsdatum abgeben." }, { status: 400 });
}
const updatedExpense = await prisma.expense.update({
where: { id },
data: {

View File

@@ -819,17 +819,24 @@ export function BudgetColumn({
{!expense.paidAt &&
expense.approvalStatus === "APPROVED" &&
expense.proofUrl &&
expense.invoiceDate &&
expense.documentedAt &&
canMarkPaid(viewer.role) ? (
<Button
size="small"
variant="outlined"
disabled={busy}
onClick={() => onMarkPaid(expense.id)}
onClick={() => {
if (
!window.confirm(
`Ausgabe "${expense.title}" ohne Rechnung als bezahlt markieren?\n\nNutze das nur fuer Nachtragungen.`
)
) {
return;
}
onMarkPaid(expense.id);
}}
>
Bezahlt setzen
Ohne Rechnung bezahlt setzen
</Button>
) : null}
@@ -880,13 +887,6 @@ export function BudgetColumn({
required
fullWidth
/>
<TextField
label="Rechnungsdokument"
value={proofFileDrafts[expense.id]?.name ?? expense.proofUrl ?? ""}
InputProps={{ readOnly: true }}
size="small"
fullWidth
/>
<Stack direction="row" spacing={1}>
<Button
component="label"
@@ -934,6 +934,15 @@ export function BudgetColumn({
/>
</Button>
</Stack>
{proofFileDrafts[expense.id]?.name ? (
<Typography
variant="caption"
color="text.secondary"
sx={{ display: "block", overflowWrap: "anywhere" }}
>
{proofFileDrafts[expense.id]?.name}
</Typography>
) : null}
<Button
size="medium"
variant="contained"