Add requested SKR03 accounts
This commit is contained in:
40
backend/db/migrations/0061_additional_skr03_accounts.sql
Normal file
40
backend/db/migrations/0061_additional_skr03_accounts.sql
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
WITH requested_accounts ("number", "label") AS (
|
||||||
|
VALUES
|
||||||
|
('1576', 'Abziehbare Vorsteuer 19 %'),
|
||||||
|
('4110', 'Löhne'),
|
||||||
|
('4115', 'Löhne (Konto 4115)'),
|
||||||
|
('4120', 'Gehälter'),
|
||||||
|
('4130', 'Gesetzliche soziale Aufwendungen'),
|
||||||
|
('4140', 'Freiwillige soziale Aufwendungen (lohnsteuerfrei)')
|
||||||
|
)
|
||||||
|
UPDATE "accounts" AS account
|
||||||
|
SET "label" = requested."label",
|
||||||
|
"description" = NULL
|
||||||
|
FROM requested_accounts AS requested
|
||||||
|
WHERE account."accountChart" = 'skr03'
|
||||||
|
AND account."number" = requested."number";
|
||||||
|
--> statement-breakpoint
|
||||||
|
WITH requested_accounts ("number", "label") AS (
|
||||||
|
VALUES
|
||||||
|
('1576', 'Abziehbare Vorsteuer 19 %'),
|
||||||
|
('4110', 'Löhne'),
|
||||||
|
('4115', 'Löhne (Konto 4115)'),
|
||||||
|
('4120', 'Gehälter'),
|
||||||
|
('4130', 'Gesetzliche soziale Aufwendungen'),
|
||||||
|
('4140', 'Freiwillige soziale Aufwendungen (lohnsteuerfrei)')
|
||||||
|
)
|
||||||
|
INSERT INTO "accounts" ("number", "label", "description", "accountChart")
|
||||||
|
SELECT requested."number", requested."label", NULL, 'skr03'
|
||||||
|
FROM requested_accounts AS requested
|
||||||
|
WHERE NOT EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM "accounts" AS account
|
||||||
|
WHERE account."accountChart" = 'skr03'
|
||||||
|
AND account."number" = requested."number"
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
SELECT setval(
|
||||||
|
pg_get_serial_sequence('accounts', 'id'),
|
||||||
|
GREATEST(COALESCE((SELECT MAX("id") FROM "accounts"), 1), 1),
|
||||||
|
true
|
||||||
|
);
|
||||||
@@ -407,6 +407,13 @@
|
|||||||
"when": 1786086000000,
|
"when": 1786086000000,
|
||||||
"tag": "0060_document_import_sources",
|
"tag": "0060_document_import_sources",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 58,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1786280400000,
|
||||||
|
"tag": "0061_additional_skr03_accounts",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user