Nachtragungen ohne Rechnung bezahlt setzen
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user