Dateimodal überarbeiten und Dateitypen pflegen
This commit is contained in:
@@ -45,36 +45,42 @@ export default async function adminRoutes(server: FastifyInstance) {
|
||||
name: "Rechnungen",
|
||||
color: "#16a34a",
|
||||
createdDocumentType: "invoices",
|
||||
isSystemUsed: true,
|
||||
},
|
||||
{
|
||||
tenant: tenantId,
|
||||
name: "Angebote",
|
||||
color: "#2563eb",
|
||||
createdDocumentType: "quotes",
|
||||
isSystemUsed: true,
|
||||
},
|
||||
{
|
||||
tenant: tenantId,
|
||||
name: "Auftragsbestätigungen",
|
||||
color: "#7c3aed",
|
||||
createdDocumentType: "confirmationOrders",
|
||||
isSystemUsed: true,
|
||||
},
|
||||
{
|
||||
tenant: tenantId,
|
||||
name: "Lieferscheine",
|
||||
color: "#ea580c",
|
||||
createdDocumentType: "deliveryNotes",
|
||||
isSystemUsed: true,
|
||||
},
|
||||
{
|
||||
tenant: tenantId,
|
||||
name: "Eingangsrechnungen",
|
||||
color: "#dc2626",
|
||||
incomingDocumentType: "invoices",
|
||||
isSystemUsed: true,
|
||||
},
|
||||
{
|
||||
tenant: tenantId,
|
||||
name: "Mahnungen",
|
||||
color: "#b91c1c",
|
||||
incomingDocumentType: "reminders",
|
||||
isSystemUsed: true,
|
||||
},
|
||||
])
|
||||
.returning({
|
||||
|
||||
@@ -968,6 +968,14 @@ export default async function resourceRoutes(server: FastifyInstance) {
|
||||
//@ts-ignore
|
||||
delete data.updatedBy; delete data.updatedAt;
|
||||
|
||||
if (resource === "filetags") {
|
||||
delete data.isSystemUsed
|
||||
|
||||
if (oldRecord.isSystemUsed && data.archived === true) {
|
||||
return reply.code(400).send({ error: "System-Dateitypen können nicht archiviert werden" })
|
||||
}
|
||||
}
|
||||
|
||||
if (portalCustomerId) {
|
||||
data = {
|
||||
...sanitizePortalCustomerUpdate(data),
|
||||
|
||||
Reference in New Issue
Block a user