AlayaCare Residential — Billing Domain · 18 journal types · 23 transaction types (DB) · Source: ProcuraGroup.Services.Billings.Core
| ID | Journal Type | Transaction Codes (Dr → Cr) | Enum Constant |
|---|---|---|---|
| 1 | New Deposit | PM Dr ←→ DP Cr | SystemJournalType.NewDeposit |
| 2 | Deposit Refund | DP Dr ←→ PM Cr | SystemJournalType.DepositRefund |
| 3 | Transaction Reversal | Mirrors all items from original journal (signs negated) | SystemJournalType.TransactionReversal |
| 4 | Over Payment Settlement | DP Dr ←→ AR Cr (ID:15) | SystemJournalType.OverPaymentSettlement |
| 5 | Reviewed Invoice | AR Dr ←→ RV/TX Cr ± contra AR/RV/TX adj | SystemJournalType.ReviewedInvoice |
| 6 | Deposit Settlement | DP Dr ←→ AR Cr (ID:15) | SystemJournalType.DepositSettlement |
| 7 | Separation Interest | EX Dr (IDs 11/14/19/20) ←→ DP Cr | SystemJournalType.SeparationInterest |
| 8 | Accommodation Drawdown | DP Dr ←→ AR Cr (ID:15) | SystemJournalType.AccommodationDrawdown |
| 9 | Fee Drawdown | DP Dr ←→ AR Cr (ID:15) | SystemJournalType.FeeDrawdown |
| 10 | Finance Adjustments | DP/PM adj · AR/RV/TX/WO/CR write-off · DP/PL DMF | SystemJournalType.FinanceAdjustments |
| 11 | Reviewed Invoice – Fee Statement | AR Dr ←→ RV/TX Cr ± contra adj | SystemJournalType.ReviewedInvoiceFeeStatement |
| 12 | Direct Debit Payments | PM Dr ←→ AR Cr · ±SA/WO | SystemJournalType.DirectDebitPayments |
| 13 | Subsidy Reconciliation | Funder-programme transaction types (derived from funder rules) | SystemJournalType.SubsidyReconciliation |
| 14 | Automatic Settlement | DP Dr ←→ AR Cr (ID:15) | SystemJournalType.AutomaticSettlement |
| 15 | Credit Settlement | CR Dr ←→ AR Cr (ID:15) | SystemJournalType.CreditSettlement |
| 16 | Manual Deposit Interest | EX Dr (ID:11) ←→ DP Cr | SystemJournalType.ManualDepositInterest |
| 17 | Deposit Transfer | DP/TR ×2 pairs (4 items total) | SystemJournalType.Transfer |
| RET | Accommodation Deposit Retentions | DP Dr ←→ RV Cr (reversed on reversal path) | JournalTypeName.AccommodationDepositRetentions (no SystemJournalType enum value) |
Trigger: PostDepositAndGenerateJournals — when a resident deposit (accommodation or fee-side) is received and posted.
SystemJournalType.NewDeposit
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 4 or 15 | DP | Deposit (or OverpaymentAR) | Cr | DepositTransactionTypeID from the deposit record. ID:4 for accommodation deposits; ID:15 (OverpaymentAR) for fee-side overpayment deposits. Negative ItemAmount — increases deposit liability. |
| 2 | 5 or 6 | PM | Payment Made (or Refund) | Dr | PaymentTransactionTypeID from the deposit. Typically PM=5; RF=6 on some imported deposits. Positive ItemAmount. Carries ReceiptNumber. |
Trigger: Refund / RefundOnDischarge — when a deposit is refunded to a resident on discharge or manually.
SystemJournalType.DepositRefund
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 4 | DP | Deposit | Dr | DepositTransactionTypeID from the deposit. Comment: "Deposit Refund". Positive ItemAmount — reduces deposit liability. |
| 2 | 5 | PM | Payment Made | Cr | Uses SystemTransactionType.Payment (ID:5) regardless of the deposit's PaymentTransactionTypeID. Comment: "Deposit Refund". Negative — cash out to resident. |
Trigger: Reverse / ReverseTransaction — reverses any previously posted journal; each original item gets a sign-flipped mirror item.
SystemJournalType.TransactionReversal
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | — | (orig.) | Same codes as original — positive side | Dr | Original Dr items become Cr. Comment: "Reversed {original comment} for {amount} on {date}". |
| 2 | — | (orig.) | Same codes as original — negative side | Cr | Original Cr items become Dr. Cross-referenced to originals via JournalItemDetails (SettlementReversal relationship type). |
Trigger: SettlePaymentsToInvoice — settles a PM-type (overpayment) deposit against an outstanding invoice.
SystemJournalType.OverPaymentSettlement
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 15 | AR | Overpayment AR (ID:15 — not ID:1) | Cr | Uses OverpaymentAR (SystemTransactionType=15, code AR). Clears invoice outstanding; linked to InvoiceItem and DepositID. JournalItemSettlementState = SettledToInvoice. |
| 2 | 4 | DP | Deposit | Dr | DepositTransactionTypeID from the deposit. Reduces the deposit balance. JournalItemSettlementState = SettledToClientOrder. Linked via ReferenceJournalItemID. |
Trigger: FinalizeInvoices — Accommodations / Funding order invoices reviewed and finalised (non-fee-statement path).
SystemJournalType.ReviewedInvoice
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 1 | AR | Accounts Receivable (ID:1) | Dr | TotalAmountAccountReceivable — creates the receivable for invoice TotalAmount. |
| 2a | 7 | RV | Revenue (ID:7) | Cr | TotalAmountOffset when billing rate is non-tax. Revenue recognition. |
| 2b | 10 | TX | Sales Tax (ID:10) | Cr | TotalAmountOffset when invoice item has a tax billing rate. Used instead of RV. |
| 3* | 16 | AR | Invoice Adjustment AR (ID:16) | Cr | Optional — only when TotalAmount > ExpectedAmount (discount). ContraAccountReceivable. Not in SystemTransactionType enum; found by description lookup. |
| 4* | 17 | RV | Invoice Adjustment RV (ID:17) | Dr | Optional. ContraOffset (RV) — offset for discount when non-tax item. |
| 5* | 18 | TX | Invoice Tax Adjustment (ID:18) | Dr | Optional. ContraOffset (TX) — when discount applies to a tax item. |
* Rows 3–5 are contra items created only when a discount exists. IDs 16, 17, 18 are not in the SystemTransactionType enum.
Trigger: MatchDeposit fallback — settles a Funding-funder deposit to an invoice when Accommodation/Fee Drawdown do not apply.
SystemJournalType.DepositSettlement
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 15 | AR | Overpayment AR (ID:15) | Cr | AR credit side (OverpaymentAR ID:15). Clears the invoice outstanding. |
| 2 | 4 | DP | Deposit (ID:4) | Dr | Reduces the deposit balance. |
Trigger: AddSeparationInterest / GenerateSeparationInterest — calculates and posts interest on a resident's refundable deposit. V2 also handles monthly accruals and reversals.
SystemJournalType.SeparationInterest
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 4 | DP | Deposit (ID:4) | Cr | Standard path: creates / increases the sep. interest deposit. V2 accrual path: same DP type. |
| 2 | 11 | EX | Sep. Interest Expense (ID:11) | Dr | Standard path: records the interest expense. Paired with DP via ReferenceJournalItemID. |
| 3† | 14 | EX | Sep. Interest Adjustment (ID:14) | Dr/Cr | V2 path only. Manual adjustment to interest. Direction depends on adjustment amount. |
| 4† | 19 | EX | Sep. Interest Accrual (ID:19) | Dr | V2 path only. Monthly accrual entry (SeparationInterestAccrual). |
| 5† | 20 | EX | Sep. Interest Accrual Reversal (ID:20) | Cr | V2 path only. Reverses the prior accrual (SeparationInterestAccrualReversal). |
† Rows 3–5 are V2-only paths.
Trigger: Drawdown (DailyAccommodation invoice) or SettlePaymentsToInvoice when a refundable accommodation deposit is settled against an accommodation invoice.
SystemJournalType.AccommodationDrawdown
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 15 | AR | Overpayment AR (ID:15) | Cr | Comment: "Drawdown Payment of {item description}". AR credit via OverpaymentAR (ID:15). Clears accommodation invoice outstanding. |
| 2 | 4 | DP | Deposit (ID:4) | Dr | Reduces the accommodation deposit balance. FunderID taken from the invoice item, not the deposit itself. |
Trigger: Drawdown (Fee invoice) or SettlePaymentsToInvoice when a refundable accommodation deposit is settled against a fees invoice.
SystemJournalType.FeeDrawdown
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 15 | AR | Overpayment AR (ID:15) | Cr | Comment: "Drawdown Payment of {item description}". Clears fees invoice outstanding. |
| 2 | 4 | DP | Deposit (ID:4) | Dr | Reduces the accommodation deposit balance. |
Trigger: Three distinct paths all share this journal type: (a) PostAdjustment for deposit adjustments, (b) WriteOffInvoices for invoice write-offs, (c) DMF Capital Gain deposit creation.
SystemJournalType.FinanceAdjustments
| # | DB ID | Code | Description | Dr/Cr | Path | Comment / Purpose |
|---|---|---|---|---|---|---|
| 1 | 12 | DP | Deposit Adjustment DP (ID:12) | Dr/Cr | Deposit Adj. | "Deposit Adjustment". Dr for increase, Cr for decrease of deposit balance. |
| 2 | 13 | PM | Deposit Adjustment PM (ID:13) | Dr/Cr | Deposit Adj. | Offset pair — always opposite sign to the DP Adjustment item. |
| 3 | 1 | AR | Accounts Receivable (ID:1) | Cr | Write-off | Eliminates remaining AR on the invoice. Comment: "WRITE OFF". |
| 4 | 21 | CR | AR Credits (ID:21) | Dr | Write-off | Overpayment/credit clearing offset for the write-off. |
| 5 | 4 | DP | Deposit (ID:4) | Dr/Cr | Write-off | Reduces/removes deposit if one exists on the invoice being written off. |
| 6 | 7 | RV | Revenue (ID:7) | Dr/Cr | Write-off | RV offset for the written-off revenue amount. |
| 7 | 10 | TX | Sales Tax (ID:10) | Dr/Cr | Write-off | TX offset for the written-off tax amount. |
| 8 | 9 | WO | Write Off (ID:9) | Dr/Cr | Write-off | WO transaction for the write-off debit entry. |
| 9 | 4 | DP | Deposit — DMF Capital Gain (ID:4) | Dr/Cr | DMF | DeferredManagementFeeExtensionService — Capital Gain deposit DepositTransactionTypeID. |
| 10 | 23 | PL | P&L Account (ID:23) | Dr/Cr | DMF | DeferredManagementFeeExtensionService — Capital Gain deposit PaymentTransactionTypeID (ProfitLossAccount). |
Trigger: FinalizeInvoices — fee-statement invoices (Fees COBRa type) reviewed and finalised. Same item structure as Reviewed Invoice (ID:5) but different journal type name.
SystemJournalType.ReviewedInvoiceFeeStatement
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 1 | AR | Accounts Receivable (ID:1) | Dr | TotalAmountAccountReceivable — creates the receivable for the fee invoice amount. |
| 2a | 7 | RV | Revenue (ID:7) | Cr | TotalAmountOffset — fee revenue recognition (non-tax items). |
| 2b | 10 | TX | Sales Tax (ID:10) | Cr | TotalAmountOffset (TX) for tax-rated items. |
| 3* | 16 | AR | Invoice Adjustment AR (ID:16) | Cr | Optional. Contra AR discount. |
| 4* | 17 | RV | Invoice Adjustment RV (ID:17) | Dr | Optional. Contra RV discount offset. |
| 5* | 18 | TX | Invoice Tax Adjustment (ID:18) | Dr | Optional. Contra TX discount offset. |
Trigger: PostTransactionForDirectDebitPayment — posts a direct debit batch; one journal per business unit, one PM per resident, one AR per settled invoice item.
SystemJournalType.DirectDebitPayments
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 5 | PM | Payment Made (ID:5) | Dr | "Direct Debit Payment" — one PM per resident per BU. Carries ReceiptNumber. |
| 2 | 1 | AR | Accounts Receivable (ID:1) | Cr | One AR per invoice item settled. SettlementState = SettledToInvoice. |
| 3† | 8 | SA | Sales Adjustment (ID:8) | Dr/Cr | Via InvoiceService.SaveSettledInvoices. Adjustment items (confirmed in unit tests alongside PM and WO). |
| 4† | 9 | WO | Write Off (ID:9) | Dr/Cr | Via InvoiceService.SaveSettledInvoices. Write-off items (confirmed in unit tests alongside PM and SA). |
† Rows 3–4 confirmed via TestSaveSettledInvoicesCreatesJournalItemsWithCorrectTransactionTypes; exact code path from PostTransactionForDirectDebitPayment needs full trace.
Trigger: CreateJournalItemsSubsidyBatch — when a government subsidy batch is posted and reconciled.
SystemJournalType.SubsidyReconciliation
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | — | various | Funding-programme transaction types | Dr/Cr | Transaction types are derived from funder rules and reconcilable items. JournalDescription = batch description. Not statically defined. |
Trigger: ProcessAutomaticSettlements — nightly or manual run settling eligible deposits against outstanding fee/accommodation invoices.
SystemJournalType.AutomaticSettlement
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 15 | AR | Overpayment AR (ID:15) | Cr | Clears the invoice outstanding via InvoiceSettlementService.AutoSettlePaymentsToInvoice. |
| 2 | 4 | DP | Deposit (ID:4) | Dr | Reduces the deposit balance. Paired with AR via ReferenceJournalItemID. |
Trigger: SettleCreditDeposits — auto-settles AR-type credit deposits (billing-rate credits) against outstanding invoices.
SystemJournalType.CreditSettlement
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 15 | AR | Overpayment AR (ID:15) | Cr | AR credit side. Clears invoice outstanding. SettlementState = SettledToInvoice. |
| 2 | 21 | CR | AR Credits (ID:21) | Dr | DP side — used when deposit PaymentTransactionTypeID = AccountReceivable (i.e., credit deposits). Reduces the credit deposit. |
Trigger: AddManualInterestDeposit — manually adds an interest amount on an existing deposit (creates a child deposit for the interest).
SystemJournalType.ManualDepositInterest
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 4 | DP | Deposit (ID:4) | Cr | Creates a child deposit for the interest amount. ItemAmount = −InterestAmount. |
| 2 | 11 | EX | Sep. Interest Expense (ID:11) | Dr | Records the expense. ItemAmount = +InterestAmount. Cross-referenced to DP item via ReferenceJournalItemID. |
Trigger: TransferDeposit — moves a deposit between facilities or client orders. Produces 4 journal items (2 balanced Dr/Cr pairs).
SystemJournalType.Transfer
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 4 | DP | Deposit — source facility | Dr | "Deposit Transfer to {facility}". Removes from source deposit. ItemAmount = +transferAmount. |
| 2 | 22 | TR | Transfer — source offset | Cr | "Deposit Transfer to {facility}". Balancing offset. ItemAmount = −transferAmount. Cross-references DP(from) via ReferenceJournalItemID. |
| 3 | 4 | DP | Deposit — target facility | Cr | "Deposit Transfer from {facility}". Adds to target deposit. ItemAmount = −transferAmount. |
| 4 | 22 | TR | Transfer — target offset | Dr | "Deposit Transfer from {facility}". Balancing offset. ItemAmount = +transferAmount. Cross-references DP(to) via ReferenceJournalItemID. |
Trigger: PostRetentions — posts daily retention deductions against accommodation deposits. Reversal flag flips Dr/Cr sides.
JournalTypeName.AccommodationDepositRetentions (no SystemJournalType enum value)
| # | DB ID | Code | Description | Dr/Cr | Comment / Purpose |
|---|---|---|---|---|---|
| 1 | 4 | DP | Deposit (ID:4) | Dr/Cr | "Accommodation Deposit Retentions for {date}". Normal: Dr (reduces deposit). Reversal: Cr. |
| 2 | 7 | RV | Revenue (ID:7) | Dr/Cr | "Accommodation Deposit Retentions for {date}". Normal: Cr (recognises retention revenue). Reversal: Dr. |
SystemTransactionType enum — found only by description lookup.
All other AR-coded settlement items use ID:15 (OverpaymentAR), not ID:1.
| DB ID | Code | Description | Custom Description | Journal Type(s) | Coverage | Notes |
|---|---|---|---|---|---|---|
| 1 | AR | Accounts Receivable | Resident Debtors Control | Reviewed Invoice, Reviewed Invoice–Fee Statement, Direct Debit Payments, Deposit Settlement, Credit Settlement, Automatic Settlement, Accommodation/Fee Drawdown | Mapped | Primary AR for invoice creation. Settlement credit side uses ID:15 instead. |
| 2 | CA | Contractual Allowance | Contractual Allowance | — | Legacy | Not in SystemTransactionType enum; no usage found in current service layer. |
| 3 | OP | Overpayment | Overpayment | — | Legacy | Not in SystemTransactionType enum. Code uses OverpaymentAR (ID:15, code AR) instead. This entry appears unused. |
| 4 | DP | Deposit | Deposit Liability | New Deposit, Deposit Refund, Sep. Interest, Manual Deposit Interest, Dep. Settlement, Acc./Fee Drawdown, Acc. Dep. Retentions, Deposit Transfer, Finance Adj (DMF) | Mapped | DepositTransactionTypeID for accommodation / refundable deposits. Most widely used transaction type. |
| 5 | PM | Payment Made | Bank/Deposit Clearing | New Deposit, Deposit Refund, Direct Debit Payments | Mapped | Cash receipt or payout item. Carries ReceiptNumber. GenerateRefundJournalItems uses PM (not RF) for refund payout. |
| 6 | RF | Refund | Bank/Refund Clearing | Possibly New Deposit (as PaymentTransactionTypeID) | Partial | In SystemTransactionType.Refund=6 but GenerateRefundJournalItems uses PM (ID:5). RF may appear as PaymentTransactionTypeID on some imported deposits, triggering its use in New Deposit journals. |
| 7 | RV | Revenue | Revenue | Reviewed Invoice, Reviewed Invoice–Fee Statement, Finance Adj (write-off), Acc. Dep. Retentions | Mapped | Revenue recognition; also used as offset in write-off journals. |
| 8 | SA | Sales Adjustment | Sales Adjustment | Reviewed Invoice / Direct Debit Payments (settlement adjustment path) | Partial | Confirmed in InvoiceService.SaveSettledInvoices unit tests alongside PM and WO. Exact journal type code path needs further trace. |
| 9 | WO | Write Off | Write Off | Finance Adjustments (WriteOffInvoices) | Partial | Used in WriteOffInvoices; offsets the remaining AR when writing off an invoice. Also confirmed in SaveSettledInvoices tests. |
| 10 | TX | Sales Tax | Tax | Reviewed Invoice, Reviewed Invoice–Fee Statement (tax items) | Mapped | Used when InvoiceItem has a tax billing rate (TotalAmountOffset for tax line). |
| 11 | EX | Separation Interest Expense | Expense | Separation Interest, Manual Deposit Interest | Mapped | Expense side of the standard separation interest journal item. |
| 12 | DP | Deposit Adjustment | Deposit Liability | Finance Adjustments (PostAdjustment) | Mapped | DepositAdjustmentDP — first journal item of a deposit adjustment pair. |
| 13 | PM | Deposit Adjustment | Bank/Deposit Clearing | Finance Adjustments (PostAdjustment) | Mapped | DepositAdjustmentPM — offset journal item of the deposit adjustment pair. |
| 14 | EX | Separation Interest Adjustment | Expense | Separation Interest (V2 adjustments) | Partial | Used in SeparationInterestService.V2 for manual adjustments to accrued interest. |
| 15 | AR | Overpayment | Resident Debtors Control | Over Payment Settlement, Credit Settlement, Accommodation Drawdown, Fee Drawdown, Deposit Settlement, Automatic Settlement, New Deposit (fee-side DepositTransactionTypeID) | Mapped | OverpaymentAR — the AR credit side in ALL settlement/drawdown journals. Code AR (same as ID:1) but distinct DB record. |
| 16 | AR | Invoice Adjustment | Resident Debtors Control | Reviewed Invoice, Reviewed Invoice–Fee Statement (contra AR) | Partial | Not in SystemTransactionType enum. Contra AR item when TotalAmount > ExpectedAmount (discount). Found by description lookup in InvoiceService. |
| 17 | RV | Invoice Adjustment | Revenue | Reviewed Invoice, Reviewed Invoice–Fee Statement (contra RV) | Partial | Not in SystemTransactionType enum. Contra RV offset for Invoice Adjustment AR (ID:16). |
| 18 | TX | Invoice Tax Adjustment | Tax | Reviewed Invoice, Reviewed Invoice–Fee Statement (contra TX) | Partial | Not in SystemTransactionType enum. Contra TX for tax items when TotalAmount > ExpectedAmount. |
| 19 | EX | Separation Interest Accrual | Expense Accrual | Separation Interest (V2 accrual path) | Partial | Used in SeparationInterestService.V2 for monthly accruals (SeparationInterestAccrual). |
| 20 | EX | Separation Interest Accrual Reversal | Expense Accrual | Separation Interest (V2 accrual reversal) | Partial | Used in SeparationInterestService.V2 to reverse prior accruals (SeparationInterestAccrualReversal). |
| 21 | CR | Account Receivable Credits | Deposit Liability | Credit Settlement, Finance Adjustments (write-off overpayment clearance) | Mapped | Used when deposit PaymentTransactionTypeID = AccountReceivable (credit deposits). |
| 22 | TR | Transfer | Transfer Clearing Account | Deposit Transfer | Mapped | Transfer clearing — offset pair for each DP item in a deposit transfer (4 journal items total). |
| 23 | PL | P&L Account | RV Capital gain/loss account | Finance Adjustments (DMF Capital Gain deposit) | Partial | Used in DeferredManagementFeeExtensionService as PaymentTransactionTypeID on Capital Gain deposits. |