Files
FEDEO/backend/tests/datevExport.test.ts
flfeders a71ea577b2
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 1m3s
Build and Push Docker Images / build-frontend (push) Successful in 35s
Build and Push Docker Images / build-website (push) Successful in 35s
Build and Push Docker Images / build-central-services-api (push) Successful in 34s
Build and Push Docker Images / build-docs (push) Successful in 34s
Build and Push Docker Images / build-central-services-admin (push) Successful in 35s
DATEV-Automatikkonten mit Bruttobeträgen exportieren
2026-08-11 13:41:01 +02:00

30 lines
1.1 KiB
TypeScript

import assert from "node:assert/strict";
import test from "node:test";
import { getCreatedDocumentRevenueLines } from "../src/utils/export/datev";
test("exports gross amounts for DATEV automatic revenue accounts", () => {
const revenueLines = getCreatedDocumentRevenueLines({
rows: [
{ mode: "position", quantity: 1, price: 100, discountPercent: 0, taxPercent: 19 },
{ mode: "position", quantity: 2, price: 50, discountPercent: 0, taxPercent: 7 },
{ mode: "position", quantity: 1, price: 50, discountPercent: 0, taxPercent: 0 },
],
});
assert.deepEqual(revenueLines, [
{ account: "8400", amount: 119 },
{ account: "8334", amount: 107 },
{ account: "8290", amount: 50 },
]);
});
test("preserves negative gross amounts for cancellations", () => {
const revenueLines = getCreatedDocumentRevenueLines({
rows: [
{ mode: "position", quantity: -1, price: 100, discountPercent: 0, taxPercent: 19 },
],
});
assert.deepEqual(revenueLines, [{ account: "8400", amount: -119 }]);
});