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 ChargeA 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 InterestA 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 LineThe document line that originated the charge — captured both as a
DocumentLinereference and as an opaqueDocumentIdso the charge survives if the source line is removed.
Entities
Billable Charge (BillableCharge)
A line-shaped charge that has been booked but not yet invoiced.
| Field | Description |
|---|---|
| Business key — a generated transaction id. |
| The kind of source document the charge came from. |
| Owning department (final field). |
| The originating document line. |
| Opaque id of the source document (final). |
| Date of the charge. |
| The customer being charged. |
| Optional invoice (postal) address. |
| Terms applied when the charge is invoiced. |
| Charge currency and conversion rate. |
| The product item. |
| Line description shown on the invoice. |
| Optional external/internal references. |
| Quantity in the internal (item) UoM. |
| Quantity in the external (invoiced) UoM. |
| The external UoM. |
| Unit price in the external UoM. |
| The price UoM (price / |
| Amount in transaction currency and internal currency. |
| VAT code applied to the charge. |
| Optional inventory cost-unit. |
| Optional project cost-unit. |
| Optional free-form text appended to the invoice line. |
| Set when the charge is invoiced — the resulting sales-invoice line. |
| Set when invoiced — the batch the line was emitted in. |
| Optional interest contract that drives accruals. |
| Simple or compound interest. Default |
| Optional cumulative interest amount in the internal currency. |
| Derived status — see Billable Charge Statuses below. Default |
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)
| Code | Name | Meaning |
|---|---|---|
| Pending | Booked but not yet invoiced. |
| Invoiced | Picked up by an invoice batch and emitted as a sales-invoice line. |
| Cancelled | Cancelled before invoicing. |
Billable Charge Interest (BillableChargeInterest)
A per-period accrual of interest on a charge while it is outstanding.
| Field | Description |
|---|---|
| Owning charge. |
| The financial period (composite business key). |
| Interest rate in effect during the period. |
| Inclusive period boundaries. |
| Optional description. |
| Balance at the start of the period. |
| Cumulative interest at the end of the period. |
| Interest accrued in this period. |
| Net change in the balance during the period. |
| 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.
| Method | Description |
|---|---|
| Every charge currently in |
| 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.