102a8603-26df-462f-a56d-01cee292f6f6
This commit is contained in:
1 parent
40805e16cd
commit
85c4006803
19 files changed
+987
No files matched your search
@@ -264,6 +264,7 @@ model Invoice {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
lines InvoiceLine[]
|
||||
dunningRuns DunningRun[]
|
||||
}
|
||||
|
||||
model InvoiceLine {
|
||||
@@ -412,4 +413,65 @@ model EstimateLine {
|
||||
totalCents Int
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Accounting / Buchhaltung (adapted from Haben, German-law compliant)
|
||||
// VAT return (Umsatzsteuer-Voranmeldung), EÜR, bank reconciliation, dunning.
|
||||
// PRD §6.6: double-entry + ELSTER out of scope; this covers the agency-facing
|
||||
// compliance layer (compute, validate, mock-submit) + bank matching.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Bank transactions imported from CAMT.053 or PSD2 (FinTS).
|
||||
model BankTransaction {
|
||||
id String @id @default(cuid())
|
||||
amountCents Int // signed: + credit (incoming), - debit (outgoing)
|
||||
bookingDate DateTime
|
||||
valueDate DateTime
|
||||
partnerName String?
|
||||
partnerIban String?
|
||||
reference String?
|
||||
purpose String?
|
||||
matchedInvoiceId String?
|
||||
matchedStatus String @default("unmatched")
|
||||
matchReason String?
|
||||
importBatchId String?
|
||||
importedAt DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
// VAT pre-registration periods (Umsatzsteuer-Voranmeldung)
|
||||
model VatReturn {
|
||||
id String @id @default(cuid())
|
||||
periodYear Int
|
||||
periodMonth Int
|
||||
periodType String @default("monthly")
|
||||
status String @default("draft")
|
||||
k81StandardNetCents Int @default(0)
|
||||
k86ReducedNetCents Int @default(0)
|
||||
k66TaxFreeCents Int @default(0)
|
||||
k83TaxStandardCents Int @default(0)
|
||||
k65TaxReducedCents Int @default(0)
|
||||
k37InputTaxCents Int @default(0)
|
||||
outputTaxCents Int @default(0)
|
||||
inputTaxCents Int @default(0)
|
||||
payableCents Int @default(0)
|
||||
submittedAt DateTime?
|
||||
elsterRef String?
|
||||
acceptedAt DateTime?
|
||||
notes String?
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
// Dunning levels for overdue invoices (Mahnwesen)
|
||||
model DunningRun {
|
||||
id String @id @default(cuid())
|
||||
invoiceId String
|
||||
invoice Invoice @relation(fields: [invoiceId], references: [id])
|
||||
level Int
|
||||
status String @default("sent")
|
||||
feesCents Int @default(0)
|
||||
sentAt DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user