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 CompanyThe accounting projection of a
Company. Carries the contracts and the default journals used by document posting.Financial YearA named accounting year. Owns a fixed set of
FinancialPeriodrows and tracks an aggregatebiClosedflag.Financial PeriodA posting interval within a year. Once closed, no new postings are accepted for dates inside the period.
Currency ContractA grouping of currency-conversion definitions concluded with a particular bank, all sharing the same internal currency.
Currency ConversionA pair of currencies (internal + external) under a
CurrencyContractwith optional default buying/selling margins.Currency Conversion RateA 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 TypeWhether 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 ContractA grouping of interest-rate definitions agreed with a particular bank.
Interest Contract RateA dated interest rate within an
InterestContract.Finance Item GroupThe 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
Finance Company (FinanceCompany)
The accounting projection of a Company.
| Field | Description |
|---|---|
| Owning |
| The currency contract used to convert foreign-currency amounts. |
| The interest contract used to compute interest amounts. |
| Default bank journal used for postings. |
| Default cash journal. |
| Default purchase journal. |
| Default sales journal. |
| Default payment journal. |
| Default general journal. |
| 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.
| Field | Description |
|---|---|
| Business key — the year identifier. |
| The contained |
| Aggregate flag derived from the periods. Once closed, no postings are accepted. |
Financial Period (FinancialPeriod)
A posting interval within a year.
| Field | Description |
|---|---|
| Owning year (composite business key with |
| Period sequence within the year. |
| Inclusive first posting date. |
| Inclusive last posting date. |
| Whether the period is closed for posting. |
Currency Contract (CurrencyContract)
A grouping of currency conversions concluded with a particular bank.
| Field | Description |
|---|---|
| Business key (a |
| Human-readable name. |
| Internal currency for every conversion under this contract. |
| The bank the contract is concluded with. |
Currency Conversion (CurrencyConversion)
A pair of currencies (internal + external) within a contract.
| Field | Description |
|---|---|
| Owning contract (composite business key with |
| The external currency. |
| Optional default buying margin (percentage) used as the seed when entering a new rate. |
| Optional default selling margin. |
Currency Conversion Rate (CurrencyConversionRate)
A dated rate snapshot for a conversion.
| Field | Description |
|---|---|
| Owning conversion (composite business key with |
| First date the rate is valid. |
| The middle rate. |
| Optional buying margin in effect on this snapshot. |
| The buying rate (used in purchase scenarios). |
| Optional selling margin in effect on this snapshot. |
| 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.
| Value | Used by |
|---|---|
| Purchase processes ( |
| Sales processes ( |
Interest Contract (InterestContract)
A grouping of interest rates concluded with a bank.
| Field | Description |
|---|---|
| Business key (a |
| Human-readable name. |
| The bank the contract is concluded with. |
Interest Contract Rate (InterestContractRate)
A dated interest-rate snapshot under an interest contract.
| Field | Description |
|---|---|
| Owning contract (composite business key with |
| First date the rate applies. |
| The interest rate. |
Interest Calculation Type (InterestCalculationType)
| Code | Name | Meaning |
|---|---|---|
| Simple | Simple interest. |
| 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.
| Field | Description |
|---|---|
| The product item group (one-to-one). |
| Account hit when an invoice is expected but not yet received. |
| Cost account. |
| Inventory account. |
| Inventory suspense account (in-flight inventory adjustments). |
| Work order result account. |
| Material coverage account. |
| Labour coverage account. |
| Accounts receivable account. |
| Receivables that have not been invoiced yet. |
| Revenue account. |
| Deferred revenue account. |
| Cost-of-goods-sold account. |
| Accounts payable account. |
| Goods received but not yet invoiced. |
| Pre-paid inventory account. |
| Currency difference (revenue side). |
| 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.
| Method | Description |
|---|---|
| Raises if the year or period is closed. |
| The period containing the date; raises if closed. |
| 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
| Action | User-visible effect |
|---|---|
| Closes the period so no further postings are accepted. |
| Re-opens a closed period. |