Bereits an AG übergeben läuft jetzt so, wie du es beschrieben hast:
Bezahlt setzen zählt in der Budgetanzeige automatisch mit. Zusätzlich gibt es unter Neue Ausgabe eine eigene Insel für zusätzlich bereits übergebenes Geld, falls das nicht über einzelne Ausgaben läuft. In den Budgetkarten wird das als gestrichelte Querlinie plus eigenem Chip dargestellt
This commit is contained in:
@@ -0,0 +1 @@
|
||||
ALTER TABLE "budgets" ADD COLUMN "released_amount" DECIMAL(10, 2) NOT NULL DEFAULT 0;
|
||||
@@ -88,6 +88,7 @@ model Budget {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
totalBudget Decimal @db.Decimal(10, 2) @map("total_budget")
|
||||
releasedAmount Decimal @default(0) @db.Decimal(10, 2) @map("released_amount")
|
||||
colorCode String @map("color_code")
|
||||
workingGroupId String @map("working_group_id")
|
||||
periodId String @map("period_id")
|
||||
|
||||
@@ -60,7 +60,8 @@ async function upsertBudget(
|
||||
periodId: string,
|
||||
name: string,
|
||||
totalBudget: number,
|
||||
colorCode: string
|
||||
colorCode: string,
|
||||
releasedAmount = 0
|
||||
) {
|
||||
return prisma.budget.upsert({
|
||||
where: {
|
||||
@@ -72,11 +73,13 @@ async function upsertBudget(
|
||||
},
|
||||
update: {
|
||||
totalBudget,
|
||||
releasedAmount,
|
||||
colorCode
|
||||
},
|
||||
create: {
|
||||
name,
|
||||
totalBudget,
|
||||
releasedAmount,
|
||||
colorCode,
|
||||
workingGroupId,
|
||||
periodId
|
||||
@@ -128,9 +131,9 @@ async function main() {
|
||||
const awareness = await upsertWorkingGroup("AG Awareness");
|
||||
const technik = await upsertWorkingGroup("AG Technik");
|
||||
|
||||
await upsertBudget(deko.id, currentPeriod.id, "Deko Hauptbudget", 0, "#FFB94A");
|
||||
await upsertBudget(awareness.id, currentPeriod.id, "Awareness Hauptbudget", 800, "#68A35D");
|
||||
const technikBudget = await upsertBudget(technik.id, currentPeriod.id, "Technik Infrastruktur", 1500, "#5677F6");
|
||||
await upsertBudget(deko.id, currentPeriod.id, "Deko Hauptbudget", 0, "#FFB94A", 0);
|
||||
await upsertBudget(awareness.id, currentPeriod.id, "Awareness Hauptbudget", 800, "#68A35D", 250);
|
||||
const technikBudget = await upsertBudget(technik.id, currentPeriod.id, "Technik Infrastruktur", 1500, "#5677F6", 500);
|
||||
|
||||
await upsertUser({
|
||||
username: "vorstand-a",
|
||||
|
||||
Reference in New Issue
Block a user