Accounting


title: "Accounting Basics (BAS)" ---

Accounting Basics (BAS)

The bas submodule of acc owns the cross-cutting accounting reference data used by every other accounting submodule: the finance company a company is registered as, the financial year/period structure that gates posting, currency contracts and their per-day buying/selling rates, interest contracts and their per-day rates, and the finance-item-group that pins ledger accounts to a product item group. It depends on com.org for the underlying company, on sys.loc for currencies, and on acc.gld and acc.jrn for the ledger accounts and journals it points at.

Concepts

Finance Company

The accounting projection of a Company. Carries the contracts and the default journals used by document posting.

Financial Year

A named accounting year. Owns a fixed set of FinancialPeriod rows and tracks an aggregate biClosed flag.

Financial Period

A posting interval within a year. Once closed, no new postings are accepted for dates inside the period.

Currency Contract

A grouping of currency-conversion definitions concluded with a particular bank, all sharing the same internal currency.

Currency Conversion

A pair of currencies (internal + external) under a CurrencyContract with optional default buying/selling margins.

Currency Conversion Rate

A dated middle/buying/selling rate for one CurrencyConversion. Buying and selling rates are stored explicitly so they can deviate from the middle rate by their margin.

Currency Rate Type

Whether the conversion is for a buying scenario (purchase process) or a selling scenario (sales process). Decides which side of the conversion’s rate is used.

Interest Contract

A grouping of interest-rate definitions agreed with a particular bank.

Interest Contract Rate

A dated interest rate within an InterestContract.

Finance Item Group

The accounting projection of a product ItemGroup. Pins the ledger accounts used when the group’s items hit inventory, cost-of-goods-sold, accounts-payable/receivable, currency differences, and so on.

Entities

BAS entities

Finance Company (FinanceCompany)

The accounting projection of a Company.

FieldDescription

company

Owning Company (one-to-one, final field).

currencyContract

The currency contract used to convert foreign-currency amounts.

interestContract

The interest contract used to compute interest amounts.

defaultBankJournal

Default bank journal used for postings.

defaultCashJournal

Default cash journal.

defaultPurchaseJournal

Default purchase journal.

defaultSalesJournal

Default sales journal.

defaultPaymentJournal

Default payment journal.

defaultGeneralJournal

Default general journal.

defaultTaxJournal

Default tax journal.

A validation rule enforces that the company’s internal currency matches the currency-contract’s internal currency.

Financial Year (FinancialYear)

A named accounting year.

FieldDescription

periodYear

Business key — the year identifier.

financialPeriods

The contained FinancialPeriod rows.

biClosed

Aggregate flag derived from the periods. Once closed, no postings are accepted.

Financial Period (FinancialPeriod)

A posting interval within a year.

FieldDescription

financialYear

Owning year (composite business key with periodNumber).

periodNumber

Period sequence within the year.

firstDate

Inclusive first posting date.

lastDate

Inclusive last posting date.

closed

Whether the period is closed for posting.

Currency Contract (CurrencyContract)

A grouping of currency conversions concluded with a particular bank.

FieldDescription

code

Business key (a ContractCode).

description

Human-readable name.

currencyInt

Internal currency for every conversion under this contract.

bank

The bank the contract is concluded with.

Currency Conversion (CurrencyConversion)

A pair of currencies (internal + external) within a contract.

FieldDescription

currencyContract

Owning contract (composite business key with currencyExt).

currencyExt

The external currency.

defaultBuyingMargin

Optional default buying margin (percentage) used as the seed when entering a new rate.

defaultSellingMargin

Optional default selling margin.

Currency Conversion Rate (CurrencyConversionRate)

A dated rate snapshot for a conversion.

FieldDescription

currencyConversion

Owning conversion (composite business key with validFrom).

validFrom

First date the rate is valid.

rate

The middle rate.

buyingMargin

Optional buying margin in effect on this snapshot.

buyingRate

The buying rate (used in purchase scenarios).

sellingMargin

Optional selling margin in effect on this snapshot.

sellingRate

The selling rate (used in sales scenarios).

Currency Rate Type (CurrencyRateType)

Internal enum used by callers of the conversion service to pick the buying or selling rate.

ValueUsed by

RATE_WHEN_BUYING_CURRENCY

Purchase processes (forPurchaseProcess()).

RATE_WHEN_SELLING_CURRENCY

Sales processes (forSalesProcess()).

Interest Contract (InterestContract)

A grouping of interest rates concluded with a bank.

FieldDescription

code

Business key (a ContractCode).

description

Human-readable name.

bank

The bank the contract is concluded with.

Interest Contract Rate (InterestContractRate)

A dated interest-rate snapshot under an interest contract.

FieldDescription

interestContract

Owning contract (composite business key with validFrom).

validFrom

First date the rate applies.

rate

The interest rate.

Interest Calculation Type (InterestCalculationType)
CodeNameMeaning

S

Simple

Simple interest.

C

Compound

Compound interest.

Finance Item Group (FinanceItemGroup)

The accounting projection of a product ItemGroup. Pins the ledger accounts used by every posting that touches items of the group.

FieldDescription

itemGroup

The product item group (one-to-one).

accountInvoicesToReceive

Account hit when an invoice is expected but not yet received.

accountCost

Cost account.

accountInventory

Inventory account.

accountInventorySuspense

Inventory suspense account (in-flight inventory adjustments).

accountWorkOrderResult

Work order result account.

accountMaterialCoverage

Material coverage account.

accountLabourCoverage

Labour coverage account.

accountAccountsReceivable

Accounts receivable account.

accountUninvoicedReceivables

Receivables that have not been invoiced yet.

accountRevenue

Revenue account.

accountDeferredRevenue

Deferred revenue account.

accountCostOfGoodsSold

Cost-of-goods-sold account.

accountAccountsPayable

Accounts payable account.

accountGoodsReceivedNotInvoiced

Goods received but not yet invoiced.

accountPrepaidInventory

Pre-paid inventory account.

accountCurrencyDifferenceRevenue

Currency difference (revenue side).

accountCurrencyDifferenceCost

Currency difference (cost side).

Functionality

Financial-period gating

FinancialPeriodReaderService.assertFinancialPeriodIsOpen raises a business exception when either the financial year is closed or the named period is closed; postings call this before persisting. getFinancialPeriod(postingDate) returns the (single) period that contains the date — multiple matches are an error. getOpenFinancialPeriod(postingDate) is the same, but additionally fails if the matching period is closed.

Period close / undo

The closePeriod and closePeriodUndo write actions on FinancialPeriod flip the period’s closed flag. FinancialPeriodActionWriter is the action handler that the framework dispatches to.

Currency conversion

CurrencyRateReaderService.convertAmountToCurrency converts an amount from one currency to another using the rate effective on a given RateDate under the supplied CurrencyContract, picking buying or selling rate based on the supplied CurrencyRateType. The service also exposes getCurrencyRate for callers that want the rate without applying it. (Several home-currency convenience methods are stubbed out — listed in the source but not active.)

Public API

ACC_BAS_QueryApi

Read-side facade.

MethodDescription

assertFinancialPeriodIsOpen(PeriodYear, PeriodNumber)

Raises if the year or period is closed.

getOpenFinancialPeriod(PostingDate)

The period containing the date; raises if closed.

getFinancialPeriod(PostingDate)

The period containing the date (open or closed).

ACC_BAS_CommandApi

This submodule does not provide a command API class. Period close/open is performed through the entity action handler, not a cross-module write seam.

ViewModel actions

ActionUser-visible effect

closePeriod (on Financial Period)

Closes the period so no further postings are accepted.

closePeriodUndo (on Financial Period)

Re-opens a closed period.


title: "Banks and Bank Statements (BNK)" ---

Banks and Bank Statements (BNK)

The bnk submodule of acc owns the bank-side reference data and the imported bank-statement records: banks, bank accounts, bank statements (MT940-shaped), and the lines that make up a statement. It depends on com.org for the company a bank account belongs to, on com.par for the customer/supplier extracted from a statement line, on acc.gld for the ledger account a bank account posts to, on acc.jrn for the journal entry a statement line is posted as, and on acc.pmt for the payments matched against a statement line.

Concepts

Bank

A financial institution. Holds the bank’s reference data (SWIFT/BIC, address, contact).

Bank Account

A specific account at a bank, in a specific currency, owned by a specific finance company.

Bank Statement

An imported statement file (typically MT940-shaped) for one bank account, with opening and closing balance.

Bank Statement Line

A single transaction inside a statement: a transaction type, debit/credit indicator, amount, currency, and counter-account references plus the customer/supplier extracted by reconciliation.

Reconciliation

The process of marking a statement line as matched against one or more Payment rows; the line tracks the reconciled amount and the journal entry it was posted as.

Entities

BNK entities

Bank (Bank)

A financial institution.

FieldDescription

code

Business key (a BankCode).

swiftCode

Optional SWIFT/BIC.

name

Bank name (a BankName, MT940 length).

street, zipcode, city, state, country

Bank address.

bankReference

Optional reference text.

telephone

Optional phone number.

Bank Account (BankAccount)

A specific account at a bank.

FieldDescription

bankAccountNumber

Business key — the IBAN.

currency

Account currency.

bank

Owning bank.

company

Owning finance company.

Bank Statement (BankStatement)

An imported statement (MT940-shaped) for one bank account.

FieldDescription

transactionReference

Business key — the MT940 transaction reference of the file.

bankAccount

The account this statement is for.

statementNumber

Optional MT940 statement number.

statementDate

Statement date.

openingBalanceExt / openingBalanceDate

Opening balance and the date it applies to.

closingBalanceExt / closingBalanceDate

Closing balance and the date it applies to.

currency / company

Defaulted from the bank account (operational fields).

statementLines

The contained BankStatementLine rows.

biMatched

Aggregate flag — whether every line of the statement has been reconciled.

Bank Statement Line (BankStatementLine)

A single transaction within a statement.

FieldDescription

bankStatement

Owning statement.

transactionType

Transaction type — see Bank Transaction Types below.

transactionDate

Transaction date.

debitCredit

Debit/credit indicator — see Debit/Credit Codes below.

transactionAmountExt

Transaction amount in the transaction currency.

transactionCurrency

Transaction currency.

transactionCurrencyRate

Conversion rate used for the line.

accountReference1 to accountReference6

The MT940 :86: free-text references attached to the transaction.

counterBankName

Optional name of the counter-party’s bank.

counterAccountNumber

Optional counter-party IBAN.

supplier / customer

Optional supplier or customer extracted by reconciliation.

reconciledAmountExt

Optional cumulative amount reconciled against payments.

matched

Match status (operational).

journalEntry

Optional journal entry the line was posted as.

postedToPeriodYear / postedToPeriodNumber

The financial period the posting was made in.

Bank Transaction Types (BankTransactionType)
CodeNameMeaning

PA

Payment Initiated

Outbound payment initiated by us.

RE

Payment Received

Inbound payment received from a counter-party.

LD

Load or Deposits

Cash load or deposit transactions.

FX

Foreign Exchange

Currency exchange transaction.

AC

Accounting

Internal accounting/booking transaction.

Debit/Credit Codes (BankDebitCredit)
CodeNameMeaning

D

Debit

A debit posting.

C

Credit

A credit posting.

RD

Reversal of Debit

Reversal of an earlier debit.

RC

Reversal of Credit

Reversal of an earlier credit.

Functionality

The submodule does not currently expose Spring services from this package. Banks, bank accounts, bank statements and their lines are maintained through the standard CRUD pages, and reconciliation/posting state is updated by the payment-side flows in acc.pmt.

Public API

ACC_BNK_QueryApi and ACC_BNK_CommandApi

This submodule does not provide query- or command-API classes from its hand-written package — the entities are read and written through the standard generated readers/writers, and cross-module access happens through the payment, journal, and ledger APIs that consume bank statements. If a future release introduces a dedicated facade, this section should be regenerated.

ViewModel actions

The submodule defines view models for Bank, BankAccount, BankStatement, and BankStatementLine but does not declare any custom UI actions.


title: "Billable Charges (CHG)" ---

Billable Charges (CHG)

The chg submodule of acc owns the billable-charge stream — individual sales-line-shaped charges that have been recorded in the system but not yet rolled up into a sales invoice. Charges flow in from any source document (sales order, work order, ad-hoc) and stay Pending until the next invoice batch picks them up. Per-period interest accrual on outstanding charges is captured as BillableChargeInterest. The submodule depends on acc.bas for the financial period and interest contract, on acc.doc for source-document references, on acc.sin for the sales-invoice link once a charge is invoiced, on acc.cst for cost-unit allocation, on acc.vat for the VAT code, and on com.par / com.org / com.fin / com.log / cat.itm for the line content (customer, address, terms, units, item).

Concepts

Billable Charge

A line-shaped charge that has been booked but not yet invoiced. Carries everything a sales-invoice line needs: customer, address, item, quantity (internal and external UoM), price, currency, VAT code, terms, and cost-unit allocation. The status moves from Pending to Invoiced (when picked up by an invoice batch) or Cancelled.

Billable Charge Interest

A per-period accrual of interest on a charge while it is outstanding. Captures the begin balance, the period interest, and the end balance under the interest rate effective in that period.

Source Document Line

The document line that originated the charge — captured both as a DocumentLine reference and as an opaque DocumentId so the charge survives if the source line is removed.

Entities

CHG entities

Billable Charge (BillableCharge)

A line-shaped charge that has been booked but not yet invoiced.

FieldDescription

transactionId

Business key — a generated transaction id.

documentOrigin

The kind of source document the charge came from.

department

Owning department (final field).

sourceDocumentLine

The originating document line.

sourceDocumentId

Opaque id of the source document (final).

chargeDate

Date of the charge.

customer

The customer being charged.

invoiceAddress

Optional invoice (postal) address.

termsOfInvoice / termsOfPayment / invoiceType

Terms applied when the charge is invoiced.

currency / currencyRate

Charge currency and conversion rate.

item

The product item.

description

Line description shown on the invoice.

referenceExt / referenceInt

Optional external/internal references.

chargeQuantityInt

Quantity in the internal (item) UoM.

chargeQuantityExt

Quantity in the external (invoiced) UoM.

chargeQuantityExtUom

The external UoM.

priceExt

Unit price in the external UoM.

priceUom

The price UoM (price / priceUom).

chargeAmountExt / chargeAmountInt

Amount in transaction currency and internal currency.

vatCode

VAT code applied to the charge.

inventoryUnit

Optional inventory cost-unit.

projectUnit

Optional project cost-unit.

invoiceLineText

Optional free-form text appended to the invoice line.

salesInvoiceLine

Set when the charge is invoiced — the resulting sales-invoice line.

salesInvoiceBatch

Set when invoiced — the batch the line was emitted in.

interestContract

Optional interest contract that drives accruals.

interestCalculationType

Simple or compound interest. Default S (Simple).

interestInt

Optional cumulative interest amount in the internal currency.

biBillableChargeStatus

Derived status — see Billable Charge Statuses below. Default P.

A validation rule enforces that any salesInvoiceLine set on the charge agrees with the charge on VAT code, currency, customer, invoice address, and terms.

Billable Charge Statuses (BillableChargeStatus)
CodeNameMeaning

P

Pending

Booked but not yet invoiced.

I

Invoiced

Picked up by an invoice batch and emitted as a sales-invoice line.

X

Cancelled

Cancelled before invoicing.

Billable Charge Interest (BillableChargeInterest)

A per-period accrual of interest on a charge while it is outstanding.

FieldDescription

billableCharge

Owning charge.

periodYear / periodNumber

The financial period (composite business key).

rate

Interest rate in effect during the period.

firstDate / lastDate

Inclusive period boundaries.

description

Optional description.

balanceBegin

Balance at the start of the period.

cumulativeInterest

Cumulative interest at the end of the period.

periodInterest

Interest accrued in this period.

periodAmount

Net change in the balance during the period.

balanceEnd

Balance at the end of the period.

Functionality

Pending-charge lookup

BillableChargeReaderService exposes the catalogue of charges still waiting for invoice: every pending charge, every pending charge for a given customer, and every pending charge dated in a given window. These are the seams an invoice-batch run consumes when picking up work.

Charge writing

BillableChargeWriterService is the seam used when other modules (sales delivery, work-order completion, manual charge entry) need to materialize a BillableCharge. The full create/cancel API is currently commented out — see Public API below — so callers cannot mint or cancel charges from outside the package without re-enabling those methods.

Public API

ACC_CHG_QueryApi

Read-side facade.

MethodDescription

findPendingCharges()

Every charge currently in Pending status.

findPendingChargesByCustomer(Customer)

Every pending charge for a customer.

ACC_CHG_CommandApi

Write-side facade. Currently a thin wrapper that holds a reference to BillableChargeWriterService; the documented createBillableCharge and cancelBillableCharge methods are commented out and not exposed at this time. Callers needing to create or cancel charges should re-enable those methods rather than reaching past the API.

ViewModel actions

The submodule defines a view model for BillableCharge but does not declare any custom UI actions.


title: "Cost Centers and Cost Units (CST)" ---

Cost Centers and Cost Units (CST)

The cst submodule of acc owns the analytical accounting dimensions: cost centers (one per Department) and cost units (a per-document-line dimension that lets postings be tagged to a project, an inventory lot, or any other tracked unit). It depends on com.org for the department a cost center is for, on acc.doc for the source document line a cost unit was created against, and on cat.itm for the item a cost unit relates to.

Concepts

Cost Center

The accounting projection of a Department. Postings tagged with a department are aggregated under its cost center for departmental P&L reporting.

Cost Unit

A finer-grained analytical dimension created from a specific document line. Used to attach posted amounts to a project, a customer order, an inventory lot, or any other "thing" that needs its own P&L. Each cost unit can be marked financially closed once all postings are settled.

Cost Allocation

An enum that says, in a given context, whether a cost-unit reference is optional, mandatory, or not allowed.

Entities

CST entities

Cost Center (CostCenter)

The accounting projection of a department.

FieldDescription

department

The department this cost center is for (one-to-one, business key).

Cost Unit (CostUnit)

A document-line-derived analytical dimension.

FieldDescription

code

Business key (up to 24 characters).

description

Human-readable name.

externalCode

Optional code from an external system.

sourceDocumentLine

The document line the cost unit was created from (final).

item

The item the cost unit relates to (final).

financiallyClosed

Whether the cost unit is closed for further postings.

biOwnerCompany

Derived owning company (business-information field).

biOwnerPartner

Derived owning partner (business-information field).

Cost Allocation (CostAllocation)
CodeNameMeaning

O

Optional

Cost-unit reference may be supplied.

M

Mandatory

Cost-unit reference is required.

N

Not allowed

Cost-unit reference must be absent.

Functionality

The submodule does not currently expose Spring services from this package. Cost centers and cost units are maintained through the standard CRUD pages, and downstream postings reference cost units directly through the standard generated readers/writers.

Public API

ACC_CST_QueryApi

The query API class exists as an empty placeholder — no methods are exposed at this time. Other modules read cost units and cost centers through the standard generated readers.

ACC_CST_CommandApi

This submodule does not provide a command API class. Cost centers and cost units are maintained through the default CRUD pages; downstream document-line writers create cost units when needed.

ViewModel actions

The submodule defines view models for CostCenter and CostUnit but does not declare any custom UI actions.


title: "Documents (DOC)" ---

Documents (DOC)

The doc submodule of acc owns the generic document/line tree that every document-shaped record in the ERP plugs into — purchase orders, sales orders, transport orders, work orders, invoices, deliveries, stock issues, partner statements, and so on. A Document is the header (with type, code, date, department, partner, optional external-system reference); a DocumentLine is one row of that document, with an optional source line pointing at the document line it was derived from. The submodule also defines the document-aspect interfaces that other modules implement to opt into shared document behaviour.

Concepts

Document

The header of a document tree, identified by the pair (documentType, documentCode). Carries the date, department, partner, and optional external-system reference. The documentId is a stable UUID that survives renames.

Document Type

An enum that names what kind of document this is — SINV, PORD, WORD, SDEL, etc. Drives how readers and writers in other submodules treat the row.

Document Origin

Whether the document was entered manually, generated by the system, or imported from an external system.

Document Line

A single row of a document, identified by (document, lineNumber). May reference a source document line (the line this one was derived from) and a derived root document line (the original line at the top of the source chain).

Document Aspect

A cross-cutting interface implemented by other modules' document/line entities and view models so they can share the document-aspect framework’s behaviours (number-series allocation on save, default date on create, …​).

Entities

DOC entities

Document (Document)

The header of a document tree.

FieldDescription

documentType

The kind of document — see Document Types below.

documentCode

Business code allocated for the document (composite business key with documentType).

documentId

A stable UUID for the document; final.

documentDate

Document date.

department

Issuing department.

company

Owning company (operational, internal — derived from the department).

partner

Optional counter-party.

externalDocument

Whether the document originated outside the ERP. Default false.

externalDocumentId

Optional UUID from the external system.

externalDocumentCode

Optional code from the external system.

documentLines

The contained DocumentLine rows.

Document Types (DocumentType)
CodeName

PINV

Purchase Invoice

SINV

Sales Invoice

PORD

Purchase Order

PQUO

Purchase Quotation

PREC

Purchase Receipt

SCNT

Sales Contact

SORD

Sales Order

SQUO

Sales Quotation

SDEL

Sales Delivery

TORD

Transport Order

WORD

Work Order

IISS

Stock Issue

IREC

Stock Receipt

TSHT

Timesheet

PSTA

Partner Statement

NONE

Sentinel: no document type

Document Origin (DocumentOrigin)
CodeNameMeaning

M

Manual

Created by hand from the UI.

G

Generated

Created by the system as part of a downstream flow.

I

Imported

Imported from an external system.

Document Line (DocumentLine)

A single row of a document.

FieldDescription

document

Owning document (composite business key with lineNumber).

lineNumber

The 1-based line number within the document.

sourceDocumentLine

Optional line this one was derived from (final).

externalLineNumber

Optional line number from the external system.

biRootDocumentLine

Derived root of the source-line chain — the original line all the way at the top (business-information field).

Functionality

Document creation and removal

DocumentWriterService.createDocument allocates a fresh Document for the supplied type / code / id / date / department. createDocumentLine adds a line under a document, optionally linking it to a source document line. removeDocumentLine deletes a line. These are the seams every document-issuing flow (sales order, purchase order, …​) calls into to mint headers and rows.

Document aspect

DocumentAspectService is a reusable behaviour that sibling document submodules opt into through the DocumentViewModelAspect, DocumentEntityAspect, and DocumentLineEntityAspect interfaces. It centralizes:

  • Default document date on createafterCreateRecord sets the documentDate to the current execution date if the form left it blank.

  • Number-series allocation on savegetNumberSeries resolves a configured view-model path to a NumberSeries so the framework can allocate the next free documentCode when the document is saved.

  • Document-aspect glue — additional before-save / after-save hooks that invoke COM_LOG_CommandApi.createFirstFreeCode when needed.

The pattern lets every document submodule (sales orders, purchase orders, invoices, …​) share the same lifecycle without duplicating the code.

Public API

ACC_DOC_QueryApi

Read-side facade.

MethodDescription

findByDocumentTypeAndDocumentCode(DocumentType, DocumentCode)

Document by type + code, or null.

findByDocumentAndLineNumber(Document, DocumentLineNumber)

Document line by document + line number, or null.

ACC_DOC_CommandApi

Write-side facade.

MethodDescription

createDocument(…​)

Allocates a new Document header for a type / code / id / date / department.

createDocumentLine(…​)

Adds a line to a document, optionally linked to a source line.

removeDocumentLine(…​)

Deletes a document line.

Document aspect extension

The submodule exposes a set of marker interfaces for other modules to implement so they can plug into the document-aspect framework:

HasDocumentLine

Implemented by entities that wrap a DocumentLine.

HasSourceDocumentLine

Implemented by entities that always have a non-null source document line.

HasOptionalSourceDocumentLine

Implemented by entities whose source document line is optional.

DocumentEntityAspect / DocumentLineEntityAspect / DocumentViewModelAspect

Aspect interfaces consumed by DocumentAspectService to drive default-date and number-series allocation.

ViewModel actions

The submodule defines view models for Document and DocumentLine but does not declare any custom UI actions.


title: "General Ledger (GLD)" ---

General Ledger (GLD)

The gld submodule of acc owns the chart of accounts: ledger accounts, their classification, and per-(account, company, financial-year) balance rows. It is the lookup point used by every other accounting submodule when posting amounts; the cross-module API also resolves the FinanceCompany and FinanceItemGroup rows that pin company- and item-group-specific defaults to the chart of accounts. It depends on acc.bas for the finance-company and finance-item-group rows it surfaces, on acc.bnk for the bank account a ledger account may match, on acc.cst for cost allocation, on acc.vat for the VAT code an account may default to, and on acc.jrn for journal references on accounts.

Concepts

Ledger Account

A general-ledger account in the chart of accounts. Each account has a base type (general/asset/equity/net-income/exceptional-income), a root type (B/S or P&L), a debit/credit nature, and optional ties to bank account, VAT code, and project cost-allocation rule.

Ledger Account Classification

A reference type that groups accounts under a higher-level classification.

Ledger Account Balance

A per-(account, company, financial year) running balance. Carries the cumulative debit and credit amount in the internal currency, derived from the journal entries posted in that year (business-information fields).

Cost vs. Revenue

A simple binary classifier (COST / REVENUE) used internally when posting against an account.

Entities

GLD entities

Ledger Account (LedgerAccount)

A general-ledger account.

FieldDescription

code

Business key (a LedgerAccountCode).

description

Human-readable name.

accountType

Detailed account type — see Ledger Account Types below.

accountRootType

Whether the account is on the balance sheet (BS) or P&L (PL).

debitCredit

Natural debit/credit side of the account.

blocked

Whether posting is blocked. Default false.

accountClassification

Optional higher-level classification.

matching

Whether the account allows invoice/payment matching. Default false.

vatCode

Optional default VAT code.

bankAccount

Optional bank account this ledger account mirrors.

projectCostAllocation

Whether project-unit allocation is optional, mandatory, or not allowed for postings. Default O (Optional).

Ledger Account Base Types (LedgerAccountBaseType)
CodeName

GE

General

AS

Asset

EL

Equity and Liability

NI

Net Income

EI

Exceptional Income

Ledger Account Root Types (LedgerAccountRootType)
CodeName

BS

Balance sheet

PL

P&L

Ledger Account Types (LedgerAccountType)
CodeName

GEGE

General (P&L or B/S)

ASFI

Fixed assets

ASOT

Other assets

ASAD

Accumulated depreciation

ASIN

Inventory

ASAR

Accounts receivable

ASPE

Prepaid expenses

ASVT

VAT

ASBK

Bank

ASCH

Cash

ASPS

Payment services

ELCS

Capital stock

ELAE

Accrued expenses

ELRE

Retained earnings

ELLD

Long term debt

ELAP

Accounts payable

ELIP

Income taxes payable

ELCD

Current portion of debt

ELEP

Employees payable

ELIC

Intercompany

NIRV

Revenue

NICG

Cost of goods

NIOC

Other costs

NISE

Sales / administrative expenses

NIDC

Depreciation costs

NIRD

Research and development

NIEC

Employee costs

NIEM

Employment costs

EIEI

Exceptional income

EIII

Interest income

EIIT

Income taxes

EIEC

Exceptional costs

Ledger Account Classification (LedgerAccountClassification)

A higher-level grouping of accounts.

FieldDescription

code

Business key (up to 4 characters).

description

Human-readable name.

Ledger Account Balance (LedgerAccountBalance)

A per-(account, company, year) running balance.

FieldDescription

ledgerAccount

The account (composite business key with company and financialYear).

company

Owning finance company.

financialYear

Owning financial year.

biDebitAmountInt

Cumulative debit amount in the internal currency (derived).

biCreditAmountInt

Cumulative credit amount in the internal currency (derived).

Functionality

Finance-company / item-group resolution

ACC_GLD_QueryApi exposes the optional and mandatory lookup of a FinanceCompany for a given Company, and of a FinanceItemGroup for a given ItemGroup. The mandatory variants raise a business exception when the row is missing — used by every posting flow that needs the finance-company defaults or the per-item-group ledger accounts before it can post.

Joint-venture pre-settle check

JointVentureAccountingUtil is a static helper used by posting flows to decide whether a transaction’s partner is a "presettle" partner inside a joint venture (which routes the posting through the JV pre-settle accounts instead of the regular accounts).

Public API

ACC_GLD_QueryApi

Read-side facade.

MethodDescription

findFinanceCompany(Company) / findFinanceCompanyMandatory(Company)

Finance-company row for a company; mandatory variant raises if absent.

findFinanceItemGroup(ItemGroup) / findFinanceItemGroupMandatory(ItemGroup)

Finance-item-group row for an item group; mandatory variant raises if absent.

ACC_GLD_CommandApi

This submodule does not provide a command API class. Ledger accounts and classifications are maintained through the standard CRUD pages, and balance rows are updated by journal-entry posting.

ViewModel actions

The submodule defines view models for LedgerAccount, LedgerAccountClassification, and LedgerAccountBalance but does not declare any custom UI actions.


title: "Journals and Journal Entries (JRN)" ---

Journals and Journal Entries (JRN)

The jrn submodule of acc is the heart of double-entry bookkeeping: it owns the journals (one per type — bank, cash, sales, purchase, memorandum), the immutable journal entries posted to those journals, and the lines (debit/credit postings against ledger accounts) that make up each entry. Every other accounting submodule routes its postings through this one. It depends on acc.bas for period gating, acc.gld for the ledger accounts, acc.bnk for bank-statement-line links, acc.doc for source-document links, acc.cst for cost-unit allocation, acc.vat for the VAT code on lines, cat.itm for the cost item, com.par / com.org for partner/company, and on the acc.inv extension interfaces (HasInvoice, HasInvoiceLine) for invoice posting.

Concepts

Journal

A named ledger book of a particular type (bank, cash, sales, purchase, memorandum, system memorandum). Each journal can have a default ledger account (used for balance lookups) and a default ledger account for currency differences.

Journal Entry

An immutable transaction posted to a journal. Carries the document the entry was created for, the financial period it posts to, and the lines that balance it. Goes through DraftConfirmedPosted to Ledger lifecycle.

Journal Entry Line

One debit or credit line of an entry, posting an amount in the transaction currency and the internal currency against a single ledger account, optionally tagged with partner, item, project unit, inventory unit, and VAT code.

Journal Entry IC

An intercompany journal-entry container that holds the matching ledger account on the receivable-creditor (RC) side; multiple JournalEntry rows in different companies can share one JournalEntryIc.

Journal Entry Type

What kind of transaction the entry represents — invoice sent/received, invoice payment initiated/received, money spent/received, purchase receipt, sales delivery, or memorandum.

Journal Entry Source

Whether the entry was entered manually or generated by the system from a downstream flow.

Entities

JRN entities

Journal (Journal)

A named ledger book.

FieldDescription

code

Business key (up to 4 characters).

journalType

Journal type — see Journal Types below (final).

description

Human-readable name.

ledgerAccount

Optional default account.

currency

Optional default currency.

ledgerAccountCurrencyDifferences

Optional ledger account used to book currency differences.

Journal Types (JournalType)
CodeNameUsed for

BNK

Bank

Bank statement and outbound payment postings.

CSH

Cash

Cash transactions.

SLS

Sales

Sales-invoice and sales-delivery postings.

PUR

Purchase

Purchase-invoice and purchase-receipt postings.

MEM

Manual Memorandum

Manually entered correction/adjustment entries.

MES

System Memorandum

System-generated correction/adjustment entries.

Journal Entry (JournalEntry)

An immutable transaction posted to a journal.

FieldDescription

journalEntryId

Business key — generated transaction id.

journalEntryIc

Optional intercompany container.

journalEntryType

The kind of transaction — see Journal Entry Types below (final).

journalEntrySource

Whether the entry was entered manually or generated (final).

documentLine

Optional document line the entry was created for (final).

documentDate

Optional document date (final).

documentId

Optional document id (final).

partner

Optional counter-party (final).

bankStatementLine

Optional originating bank-statement line (final).

journal

The journal the entry posts to (set while in draft).

journalCompany

The owning finance company (set while in draft).

journalDate

Posting date (set while in draft).

description

Free-form description (set while in draft).

postToYear / postToPeriod

The financial period the entry posts to (set while in draft).

reversalOfJournalEntry

Optional reverse-link to the entry this one reverses.

reversedByJournalEntry

Optional forward-link to the entry that reverses this one.

confirmed

Lifecycle flag.

postedToLedger

Lifecycle flag.

biJournalEntryStatus

Derived status — see Journal Entry Statuses below.

A validation rule enforces that any reversal/reversed-by entry shares the partner with this one, and that the bank-statement-line’s company equals the journal company.

Journal Entry Sources (JournalEntrySource)
CodeNameMeaning

M

Manual

Entered by a user.

S

System

Generated by a downstream flow.

Journal Entry Types (JournalEntryType / JournalEntryLineType)
CodeNameMeaning

IVSN

Invoice Sent

Sales invoice posting.

IVRC

Invoice Received

Purchase invoice posting.

IPIN

Invoice Payment Initiated

Outbound payment of an invoice.

IPRC

Invoice Payment Received

Inbound payment of an invoice.

MNSP

Money Spent

Outbound money movement (non-invoice).

MNRC

Money Received

Inbound money movement (non-invoice).

TRPR

Purchase Receipt

Inventory-side posting for a purchase receipt.

TRSD

Sales Delivery

Inventory-side posting for a sales delivery.

MEMO

Memorandum

Manual or system memorandum.

Journal Entry Statuses (JournalEntryStatus)
CodeNameMeaning

DR

Draft

Editable; not yet confirmed.

CF

Confirmed

Locked; ready to post to the ledger.

PS

Posted to Ledger

Archived; balances have been updated.

Journal Entry Line (JournalEntryLine)

One debit or credit line of an entry.

FieldDescription

journalEntry

Owning entry (composite business key with lineNumber).

lineNumber

Line number within the entry (a TransactionLineNumber).

referenceDocumentLine

Optional document line the posting is about (final).

ledgerAccount

The account being posted to.

currencyExt

Optional foreign currency.

currencyRate

Optional currency rate used for the conversion.

debitAmountInt / debitAmountExt

Optional debit amount in internal/foreign currency.

creditAmountInt / creditAmountExt

Optional credit amount in internal/foreign currency.

partner

Optional partner the line is for.

costItem

Optional product item.

costQuantityInt

Optional quantity in the item’s UoM.

projectUnit

Optional project cost-unit.

inventoryUnit

Optional inventory cost-unit.

inventoryQuantityInt

Optional inventory quantity.

vatCode

Optional VAT code (informative).

biPostingAmountInt

Derived posting amount in the internal currency.

A validation rule enforces that the line’s partner does not equal the entry’s partner (intercompany invariant) and that any inventory- or project-unit’s owning partner equals the line’s partner.

Journal Entry IC (JournalEntryIc)

An intercompany container.

FieldDescription

journalEntryIcId

Business key — generated transaction id.

ledgerAccountRc

The "RC" (receivable-creditor) ledger account used as the bridge between the participating entries (final).

journalEntries

The entries that share this container.

Functionality

Journal-entry creation

JournalEntryWriterService is the seam other modules call when they need to post. It builds a journal entry from an invoice abstraction (any type implementing acc.inv.extension.HasInvoice), populates the lines from the invoice’s lines (HasInvoiceLine), runs them through the line-completion pipeline (JournalEntryLineComplementor, JournalEntryLineBuilder), validates the resulting entry against JournalEntryValidator, and persists it. It can also remove an entry that was created for an invoice.

Validation

Three validators enforce the business invariants before an entry is allowed to confirm:

JournalEntryValidator

Cross-line and journal-level checks (line count, allowed entry types per journal type, period gating, total debit/credit balance).

JournalEntryLineValidator

Per-line checks (debit/credit XOR rule, exchange-rate bounds, maximum line amount, allowed account types for the journal type).

JournalEntryIcValidator

Cross-entry checks for intercompany containers.

The hard-coded bounds live in JournalConstant: exchange rate must be inside (1e-6, 999999.0), per-line amount must be ≤ 9 999 999.99, and an entry must have at most 999 lines. The same constant maps each journal type to its allowed entry types (e.g. a BNK journal accepts only IPIN, IPRC, MNSP, MNRC).

Confirm / unconfirm and post-to-ledger

The confirm and confirmUndo write actions on JournalEntryViewModel flip the entry between Draft and Confirmed. The postToLedger and postToLedgerUndo actions then move it between Confirmed and Posted-to-Ledger; posting updates the per-(account, company, year) LedgerAccountBalance rows and archives the entry. JournalEntryActionWriter is the action handler the framework dispatches to.

Public API

ACC_JRN_QueryApi and ACC_JRN_CommandApi

This submodule does not provide query- or command-API classes from its hand-written package. Other modules read journals and entries through the standard generated readers and post entries by calling JournalEntryWriterService (an internal service that other modules in the acc boundary inject).

ViewModel actions

ActionUser-visible effect

confirm (on Journal Entry)

Locks a draft entry after the validators pass.

confirmUndo (on Journal Entry)

Reverts a confirmed entry back to draft.

postToLedger (on Journal Entry)

Posts the confirmed entry to the ledger and archives it.

postToLedgerUndo (on Journal Entry)

Reverts a posted entry back to confirmed.


title: "Purchase Liabilities (LIA)" ---

Purchase Liabilities (LIA)

The lia submodule of acc owns the purchase-side counterpart of chg: each PurchaseLiability is a single line-shaped expectation that an invoice will arrive from a supplier, derived from a goods receipt or other source document. Liabilities stay Pending until matched against a PurchaseInvoiceLine, at which point any difference between expected and invoiced amount is captured as a variance. The submodule depends on acc.doc for the source document, acc.pin for the matched purchase-invoice line, acc.cst for cost-unit allocation, acc.vat for the VAT code, and com.par / com.org / com.fin / com.log / cat.itm for the line content.

Concepts

Purchase Liability

A line-shaped expectation that a purchase invoice will arrive. Captures everything a purchase-invoice line will need: supplier, terms, item, quantity (internal and external UoM), price, currency, VAT, cost-unit allocation. Goes from Pending → Matched (when a PurchaseInvoiceLine is linked) or Cancelled.

Variance

The difference between the expected liability amount and the actual purchase-invoice amount. Captured per liability in both transaction and internal currency.

Source Document Line

The document line that originated the liability (typically a purchase receipt) — captured both as a DocumentLine reference and as an opaque DocumentId.

Entities

LIA entities

Purchase Liability (PurchaseLiability)

A single line-shaped expectation that a purchase invoice will arrive.

FieldDescription

transactionId

Business key — generated transaction id.

documentOrigin

The kind of source document the liability came from.

department

Owning department (final).

sourceDocumentLine

The originating document line (final).

sourceDocumentId

Opaque id of the source document (final).

liabilityDate

Date of the liability.

supplier

The supplier we expect the invoice from.

termsOfInvoice / termsOfPayment / invoiceType

Terms expected on the invoice.

currency / currencyRate

Liability currency and conversion rate.

item

The product item.

description

Line description.

referenceExt / referenceInt

Optional external/internal references.

liabilityQuantityInt

Quantity in the internal (item) UoM.

liabilityQuantityExt

Quantity in the external UoM.

liabilityQuantityExtUom

The external UoM.

priceExt

Unit price in the external UoM.

priceUom

The price UoM.

liabilityAmountExt / liabilityAmountInt

Amount in transaction currency and internal currency.

vatCode

VAT code applied.

inventoryUnit / projectUnit

Optional cost-unit allocation.

invoiceLineText

Optional free-form text appended to the matched invoice line.

purchaseInvoiceLine

Set once the liability is matched against a PurchaseInvoiceLine.

biPurchaseLiabilityStatus

Derived status — see Purchase Liability Statuses below. Default P.

biVarianceAmountExt

Difference between expected and invoiced amount in foreign currency (optional).

biVarianceAmountInt

Difference between expected and invoiced amount in internal currency (optional).

A validation rule enforces that the matched purchaseInvoiceLine agrees with the liability on VAT code, currency, and supplier.

Purchase Liability Statuses (PurchaseLiabilityStatus)
CodeNameMeaning

P

Pending

Liability booked, no invoice received yet.

M

Matched

Linked to a purchase-invoice line.

X

Cancelled

Cancelled before matching.

Functionality

The submodule does not currently expose Spring services from this package — the entity is read through the standard generated PurchaseLiabilityReader and written by downstream flows (purchase receipt processing, invoice-matching) that consume the standard generated writer. Variance computation is performed by the matching flow in acc.pin.

Public API

ACC_LIA_QueryApi and ACC_LIA_CommandApi

This submodule does not provide query- or command-API classes. Other modules read liabilities through the standard generated reader and create/update them as part of the purchase-receipt or invoice-matching flow.

ViewModel actions

The submodule defines a view model for PurchaseLiability but does not declare any custom UI actions.


title: "Purchase Invoices (PIN)" ---

Purchase Invoices (PIN)

The pin submodule of acc owns the purchase invoice header (PurchaseInvoice), its lines, and the type reference data. Each PurchaseInvoiceLine rolls up the matched PurchaseLiability rows of acc.lia into a single line and links to the journal entry that posts it. The submodule depends on acc.doc for the document scaffolding, acc.lia for the matched liabilities, acc.gld for the line ledger account, acc.jrn for the journal entry, acc.vat for the VAT code, acc.pmt for payment allocations, acc.bas for terms and currency rate, and com.par/com.org/com.fin/com.log/cat.itm for the line content.

Concepts

Purchase Invoice

The header of an inbound supplier invoice, identified by its document code. Goes through DraftConfirmed lifecycle; once confirmed, no edits except payment allocation.

Purchase Invoice Line

One line of the invoice. Carries amounts excl./incl. VAT in foreign and internal currency, the VAT code and percentage, and the journal entry the line was posted as. A line aggregates the PurchaseLiability rows it covers.

Purchase Invoice Type

A reference type that names the invoice variant (e.g. "standard", "credit note") and pins the number series and default terms-of-invoice for it.

Invoice Base Type

Whether the invoice header is a debit invoice or a credit note.

Entities

PIN entities

Purchase Invoice Type (PurchaseInvoiceType)

A reference type for purchase invoice variants.

FieldDescription

code

Business key (up to 4 characters).

description

Human-readable name.

invoiceBaseType

Whether invoices of this type are debit invoices or credit notes — see Invoice Base Types below.

numberSeries

Number series used to allocate document codes.

termsOfInvoice

Default terms of invoice.

Invoice Base Types (InvoiceBaseType)
CodeNameMeaning

D

Debit Invoice

Standard invoice (we owe the supplier).

C

Credit Note

Credit note (the supplier owes us).

Purchase Invoice (PurchaseInvoice)

The invoice header.

FieldDescription

documentCode

Business key — the document code.

description

Human-readable description.

invoiceType

The invoice type (drives number series and terms defaults).

currency / currencyRate

Invoice currency and conversion rate.

documentDate

Invoice date.

department

Owning department.

supplier

The supplier.

termsOfPayment / termsOfInvoice

Terms applied to the invoice.

invoiceBaseType

Derived from invoiceType (operational, internal).

matched

Whether all lines have been matched to liabilities. Default false.

confirmed

Lifecycle flag.

biInvoiceStatus

Derived status — see Invoice Statuses below.

biDueDate

Derived due date.

biInvoiceAmountExt / biInvoiceAmountInt

Sum of the line amounts (excl. VAT) in foreign / internal currency.

biInvoiceVatAmountExt / biInvoiceVatAmountInt

Sum of line VAT amounts.

biPaidAmountInclVatExt / biPaidAmountInclVatInt

Cumulative paid amount (incl. VAT).

biToPayAmountInclVatExt / biToPayAmountInclVatInt

Outstanding amount.

invoiceLines / paymentAllocations

The contained lines and the payment-allocation rows that match this invoice.

A validation rule enforces that the supplier’s company equals the department’s company.

Invoice Statuses (InvoiceStatus)
CodeNameMeaning

DR

Draft

Editable; not yet confirmed.

CF

Confirmed

Locked; payable.

Purchase Invoice Line (PurchaseInvoiceLine)

One line of a purchase invoice.

FieldDescription

purchaseInvoice

Owning invoice (composite business key with documentLineNumber).

documentLineNumber

Line number.

item

The product item (final).

description

Line description (final).

vatCode

VAT code (final).

vatPercentage

Optional VAT percentage applied (final).

invoiceAmountExclVatExt / invoiceAmountExclVatInt

Amount excluding VAT in foreign / internal currency (final).

invoiceVatAmountExt / invoiceVatAmountInt

VAT amount in foreign / internal currency (final).

invoiceAmountInclVatExt / invoiceAmountInclVatInt

Amount including VAT in foreign / internal currency (final).

journalEntry

The journal entry that posts the line (operational).

ledgerAccount

The ledger account the line posts to (operational).

purchaseLiabilities

The liabilities the line covers.

biTotalLiabilityAmountExt / biTotalLiabilityAmountInt

Sum of the matched liability amounts; differences are tracked as variances on the liability rows.

Functionality

Confirm / unconfirm

The confirm and confirmUndo write actions on PurchaseInvoice flip the invoice between Draft and Confirmed. PurchaseInvoiceActionWriter is the action handler dispatched by the framework. Confirming triggers downstream posting (the matching journal entry is created via acc.jrn); unconfirming reverses that.

Public API

ACC_PIN_QueryApi and ACC_PIN_CommandApi

This submodule does not provide query- or command-API classes. Other modules read invoices through the standard generated readers and trigger confirm/unconfirm through the entity action handler (PurchaseInvoiceActionWriter).

ViewModel actions

ActionUser-visible effect

confirm (on Purchase Invoice)

Locks a draft invoice and posts the matching journal entry.

confirmUndo (on Purchase Invoice)

Reverts a confirmed invoice back to draft and rolls back the journal entry.


title: "Payments and Allocations (PMT)" ---

Payments and Allocations (PMT)

The pmt submodule of acc owns the payment stream — money in or money out — together with the per-invoice allocations that distribute a payment across one or more invoices. A Payment can be linked to a BankStatementLine for bank-reconciled flows or stand on its own (cash). A PaymentAllocation carries the amount allocated to a sales- or purchase-invoice line, plus any discount or write-off amount captured against a write-off ledger account. The submodule depends on acc.bnk for bank account / statement line, acc.jrn for the journal entry created on confirm, acc.sin and acc.pin for the invoices being paid, acc.gld for the write-off account, acc.doc for the matched document line, and com.par / com.org / com.fin / com.log for partner/department/currency.

Concepts

Payment

A single money movement (incoming or outgoing) entered against a partner. Goes through DraftConfirmed; on confirm a journal entry is created via acc.jrn and the allocations are settled against the invoices.

Payment Type

Whether the payment is incoming (we receive money) or outgoing (we pay).

Payment Method

Whether the payment moves through a bank account or cash.

Payment Allocation

A line of the payment that allocates an amount to a single invoice. Captures the allocated amount in foreign and internal currency, plus any discount taken or write-off booked.

Entities

PMT entities

Payment (Payment)

A single money movement.

FieldDescription

documentCode

Business key — the document code (final).

paymentType

Incoming or outgoing — see Payment Types below (final).

paymentMethod

Bank or cash — see Payment Methods below (final).

department

Owning department (final).

company

Owning company, derived from the department (operational, internal).

partner

The counter-party.

paymentDate

Payment date.

description

Free-form description.

currency / currencyRate

Payment currency and conversion rate.

referenceExt

Optional external reference.

bankAccount

Optional bank account (for bank payments).

journal

The journal the payment posts to.

bankStatementLine

Optional originating bank-statement line.

journalEntry

The journal entry created on confirm.

confirmed

Lifecycle flag.

biPaymentStatus

Derived status — see Payment Statuses below.

biTotalAmountExt / biTotalAmountInt

Sum of allocations in foreign / internal currency (operational).

allocations

The per-invoice allocations.

A validation rule enforces that the journal entry’s partner equals the payment’s partner.

Payment Types (PaymentType)
CodeNameMeaning

IN

Incoming

Money received from the partner.

OUT

Outgoing

Money paid to the partner.

Payment Methods (PaymentMethod)
CodeNameMeaning

BNK

Bank

Payment through a bank account.

CSH

Cash

Cash payment.

Payment Statuses (PaymentStatus)
CodeNameMeaning

DR

Draft

Editable; not yet confirmed.

CF

Confirmed

Locked; journal entry has been created.

Payment Allocation (PaymentAllocation)

A single allocation of part of a payment to one invoice.

FieldDescription

payment

Owning payment (composite business key with lineNumber).

lineNumber

Line ordinal within the payment (final).

documentLine

The matched document line (the invoice line).

salesInvoice

Optional convenience reference to the sales invoice (for queries).

purchaseInvoice

Optional convenience reference to the purchase invoice (for queries).

allocatedAmountExt

Amount allocated in the payment currency.

allocatedAmountInt

Amount allocated in the internal currency.

discountAmountExt

Optional discount taken on this invoice (foreign currency).

writeOffAmountExt

Optional write-off booked on this invoice (foreign currency).

writeOffLedgerAccount

Optional ledger account the write-off is booked to.

Functionality

Confirm / unconfirm

The confirm and confirmUndo write actions on Payment flip the payment between Draft and Confirmed. Confirming creates the matching JournalEntry through acc.jrn and settles the allocations against the linked invoices; unconfirming reverses both.

Public API

ACC_PMT_QueryApi and ACC_PMT_CommandApi

This submodule does not provide query- or command-API classes. Other modules read payments and allocations through the standard generated readers and trigger confirm/unconfirm through the entity action handler (PaymentActionWriter).

ViewModel actions

ActionUser-visible effect

confirm (on Payment)

Locks a draft payment, creates the journal entry, and settles the allocations.

confirmUndo (on Payment)

Reverts a confirmed payment back to draft and rolls back the journal entry.


title: "Sales Invoices (SIN)" ---

Sales Invoices (SIN)

The sin submodule of acc owns the sales-invoice header, its lines, the type reference data, and the periodic invoice batch that turns a stack of BillableCharge rows into one or more invoices. A SalesInvoiceLine rolls up the matched BillableCharge rows of acc.chg and links to the journal entry that posts it. The submodule depends on acc.doc for the document scaffolding, acc.chg for the matched billable charges, acc.gld for the line ledger account, acc.jrn for the journal entry, acc.vat for the VAT code, acc.pmt for payment allocations, and com.par/com.org/com.fin for the line content.

Concepts

Sales Invoice

The header of an outbound customer invoice, identified by its document code. Goes through DraftConfirmed lifecycle.

Sales Invoice Line

One line of the invoice. Carries amounts excl./incl. VAT in foreign and internal currency, the VAT code and percentage, and the journal entry the line was posted as. A line aggregates the BillableCharge rows it covers.

Sales Invoice Type

A reference type that names the invoice variant (e.g. "standard", "credit note") and pins the number series and default terms-of-invoice for it.

Sales Invoice Batch

A periodic run that consumes pending BillableCharge rows for a billing window and emits one or more sales invoices. Goes through PendingCompleted.

Entities

SIN entities

Sales Invoice Type (SalesInvoiceType)

A reference type for sales-invoice variants.

FieldDescription

code

Business key (up to 4 characters).

description

Human-readable name.

invoiceBaseType

Whether invoices of this type are debit invoices or credit notes.

numberSeries

Number series used to allocate document codes.

termsOfInvoice

Default terms of invoice.

Sales Invoice (SalesInvoice)

The invoice header.

FieldDescription

documentCode

Business key — the document code (final).

description

Human-readable description (final).

invoiceType

The invoice type (final).

currency / currencyRate

Invoice currency and conversion rate (final).

documentDate

Invoice date (final).

department

Owning department (final).

customer

The customer (final).

invoiceAddress

The postal/invoice address (final).

termsOfPayment / termsOfInvoice

Terms applied (final).

salesInvoiceBatch

The batch this invoice was emitted in (final).

invoiceBaseType

Derived from invoiceType (operational, internal).

matched

Whether all lines have been settled. Default false.

confirmed

Lifecycle flag.

biInvoiceStatus

Derived status (DR Draft / CF Confirmed).

biDueDate

Derived due date.

biInvoiceAmountExt / biInvoiceAmountInt

Sum of line amounts (excl. VAT) in foreign / internal currency.

biInvoiceVatAmountExt / biInvoiceVatAmountInt

Sum of line VAT amounts.

biPaidAmountInclVatExt / biPaidAmountInclVatInt

Cumulative paid amount.

biToPayAmountInclVatExt / biToPayAmountInclVatInt

Outstanding amount.

invoiceLines / paymentAllocations

The lines and the payment-allocation rows for this invoice.

A validation rule enforces that the customer’s company equals the department’s company.

Sales Invoice Line (SalesInvoiceLine)

One line of a sales invoice.

FieldDescription

salesInvoice

Owning invoice (composite business key with documentLineNumber).

documentLineNumber

Line number.

item

The product item (final).

description

Line description (final).

vatCode / vatPercentage

VAT code and percentage (final).

invoiceAmountExclVatExt / invoiceAmountExclVatInt

Amount excluding VAT (final).

invoiceVatAmountExt / invoiceVatAmountInt

VAT amount (final).

invoiceAmountInclVatExt / invoiceAmountInclVatInt

Amount including VAT (final).

journalEntry

The journal entry that posts the line (operational).

ledgerAccount

The ledger account the line posts to (operational).

billableCharges

The billable charges the line covers.

biTotalChargeAmountExt / biTotalChargeAmountInt

Sum of the matched charge amounts.

Sales Invoice Batch (SalesInvoiceBatch)

A periodic run that turns pending BillableCharge rows into invoices.

FieldDescription

documentCode

Business key (final).

department

Owning department (final).

company

Owning company derived from the department (operational, internal).

description

Free-form description (set while pending).

batchDate

Date the batch is run.

billingPeriodStart / billingPeriodEnd

Window of charge dates picked up.

invoiceFrequency

Daily / weekly / monthly grouping.

invoiceType

Invoice type used for emitted invoices.

completed

Lifecycle flag.

biSalesInvoiceBatchStatus

Derived status — see Batch Statuses below.

biChargeCount

Number of charges picked up by the run.

biInvoiceCount

Number of invoices emitted.

salesInvoices

The emitted invoices.

Batch Statuses (SalesInvoiceBatchStatus)
CodeNameMeaning

P

Pending

Configured but not yet run.

C

Completed

Run; salesInvoices populated.

U

Undone

Reverted (charges put back to Pending).

Functionality

Confirm / unconfirm of a sales invoice

The confirm and confirmUndo write actions on SalesInvoice flip the invoice between Draft and Confirmed. Confirming triggers downstream posting (the matching journal entry is created via acc.jrn); unconfirming reverses that.

Run a sales-invoice batch

The createSalesInvoices write action on SalesInvoiceBatch consumes the BillableCharge rows pending for the configured (department, billing period, invoice frequency) and emits one or more sales invoices. Each emitted invoice points back at this batch through salesInvoiceBatch. The batch’s status moves from Pending to Completed. The action handlers for both flows (SalesInvoiceActionWriter, SalesInvoiceBatchActionWriter) are the framework dispatch targets.

Public API

ACC_SIN_QueryApi and ACC_SIN_CommandApi

This submodule does not provide query- or command-API classes. Other modules read invoices, lines, and batches through the standard generated readers and trigger confirm/unconfirm or batch run through the entity action handlers.

ViewModel actions

ActionUser-visible effect

confirm (on Sales Invoice)

Locks a draft invoice and posts the matching journal entry.

confirmUndo (on Sales Invoice)

Reverts a confirmed invoice back to draft and rolls back the journal entry.

createSalesInvoices (on Sales Invoice Batch)

Picks up pending billable charges in the batch’s window and emits sales invoices for them.


title: "VAT (VAT)" ---

VAT (VAT)

The vat submodule of acc owns the VAT/tax codes used on invoice and journal-entry lines, plus the per-(item-type, item, country) lookup table that resolves the right VAT code for a given item-and-counterparty combination. It depends on acc.gld for the VAT-to-pay and VAT-to-claim ledger accounts, and on cat.itm for the item / item-type rows that VAT codes are scoped to.

Concepts

VAT Code

A tax code with an optional VAT percentage and the two ledger accounts the VAT side of a posting routes to (one for VAT to pay, one for VAT to claim).

Item VAT Code

A lookup row keyed by (item type, item, country) that says which VatCode applies. Resolution falls back from the most specific to the least specific row.

Entities

VAT entities

VAT Code (VatCode)

A tax code.

FieldDescription

code

Business key (up to 4 characters).

description

Human-readable name.

vatPercentage

Optional VAT percentage.

accountVatToPay

Ledger account hit when the VAT side is a payable.

accountVatToClaim

Ledger account hit when the VAT side is a receivable.

Item VAT Code (ItemVatCode)

A lookup row.

FieldDescription

itemType

The item type (composite business key with item and country).

item

Optional specific item — when set, the row applies only to that item.

country

Optional counter-party country — when set, the row applies only to that country.

vatCode

The VAT code that applies.

Functionality

VAT-code resolution

VatCodeReaderService.getVatCode resolves the VAT code that applies to a (partner, item) or (item, country) combination. It walks the lookup table from most specific to least specific:

  1. Match on (item, country).

  2. Match on (item-type, country).

  3. Match on (item-type) only.

If no row matches, the service shows a warning in the UI desktop and returns null so the caller can decide whether to proceed without a VAT code.

Public API

ACC_VAT_QueryApi and ACC_VAT_CommandApi

This submodule does not provide query- or command-API classes. Other modules read VAT codes through the standard generated readers and resolve the right code through VatCodeReaderService (an internal service).

ViewModel actions

The submodule defines view models for VatCode and ItemVatCode but does not declare any custom UI actions.


title: "Joint Ventures (VEN)" ---

Joint Ventures (VEN)

The ven submodule of acc owns the joint-venture configuration: a JointVenture is a named cooperation, and JointVenturePartner rows record each partner’s ownership percentage, interest contract, and pre-settle flag. The pre-settle flag is consulted by acc.gld’s `JointVentureAccountingUtil so a transaction’s partner can be routed through the JV pre-settle accounts. It depends on com.par for the partner / partner-address rows, and on acc.bas for the interest contract.

Concepts

Joint Venture

A named cooperation between two or more partners.

Joint Venture Partner

One partner’s stake in a joint venture: their ownership percentage, the interest contract they accrue under, the calculation type (simple or compound), and whether the partner is "pre-settle" — meaning postings against this partner inside the venture should be routed through the JV pre-settle accounts.

Entities

VEN entities

Joint Venture (JointVenture)

A named cooperation.

FieldDescription

code

Business key (a JointVentureCode).

description

Human-readable name.

partners

The contained JointVenturePartner rows.

Joint Venture Partner (JointVenturePartner)

One partner’s stake in a joint venture.

FieldDescription

jointVenture

Owning venture (composite business key with partner).

partner

The partner.

partnerAddress

Optional partner address; must belong to the partner (validated).

ownershipPercentage

The partner’s ownership percentage in the venture.

interestContract

Interest contract used to accrue interest on the partner’s balance.

interestCalculationType

Simple or compound interest. Default S.

presettle

Whether postings against this partner inside the venture should be routed through the JV pre-settle accounts. Default false.

Functionality

Pre-settle routing

The presettle flag is the only externally observable behaviour of a JV partner. It is consulted by JointVentureAccountingUtil in acc.gld: when a posting’s partner matches a JV partner that is pre-settle, the posting is routed through the JV pre-settle ledger accounts instead of the regular accounts. The lookup is exposed through JointVentureAccountingUtil.isPresettleJointVenturePartner (and a null-safe variant).

Public API

ACC_VEN_QueryApi and ACC_VEN_CommandApi

This submodule does not provide query- or command-API classes. The configuration is read by the standard generated readers and consumed by acc.gld’s `JointVentureAccountingUtil.

ViewModel actions

The submodule defines view models for JointVenture and JointVenturePartner but does not declare any custom UI actions.