Level | MGCEarmarkBalanceLevel | No | The grain this balance row is kept at. A Deal row is the whole deal and carries no counterparty and no funding rule; a Counterparty row is one customer or vendor within the deal and carries no funding rule; a Funding rule row is one funding rule and is written by the vendor-shape package. The three levels are also the second, third and fourth steps of the product's global lock order, in that sequence, which is why the balance key leads on this column: each lock step is every row of one deal at one level, and a level-leading key makes that a seek rather than a scan. |
DealId | MGCEarmarkDealId | Yes | The identifier of the deal this balance belongs to, stored beside the record reference so that the row stays readable in an export and meaningful after a migration. It is supplied by the balance service, which already holds the deal under the first lock of the order; the table deliberately does not read the deal to verify it, because that read would reach backwards to a lock this row sits below. |
CounterpartyAccount | MGCEarmarkAccountRelation | No | The customer or vendor account this balance row is kept for. It is blank at Deal level, required at Counterparty level, and optional at Funding rule level. A deal that accrues for many counterparties carries one Deal-level row and one Counterparty-level row per account, and the cap is evaluated against whichever grain the deal's criteria type names. |
FundingRule | RefRecId | No | The record reference of the funding rule this balance row is kept for. It is populated only at Funding rule level and only by the vendor-shape package, which owns funding rules; it is blank at the other two levels. The level exists in this package even though nothing here writes it, because the lock protocol switches over the balance level and that switch has to be exhaustive - a level added later would be a level the lock order had never heard of. |
AccruedPosted | MGCEarmarkBalanceAmount | No | Money accrued against this deal whose general journal has been posted, in the deal currency. This is the figure a general ledger reader can tie to: every amount in it has a voucher behind it. Money moves into this bucket either at accrual time, when auto-posting is on and the journal posts inside the movement transaction, or later, when the journal is posted by hand and the post-commit journal sync moves it out of the pending bucket. |
AccruedPending | MGCEarmarkBalanceAmount | No | Money accrued against this deal whose general journal exists but has not been posted, in the deal currency. It is NOT the same thing as accrued and posted, and the two are deliberately separate columns: this bucket has no voucher behind it yet and cannot be tied to the general ledger. It arises when auto-posting is off, and it drains when the journal is posted and the post-commit journal sync moves the amount into the posted bucket. A balance that is heavy in this column is a signal that journals are being created and not posted, which is what the reconciliation explains as pending journals rather than as a variance. |
Reversed | MGCEarmarkBalanceAmount | No | Money that was accrued against this deal and then reversed, in the deal currency. A reversal takes its amount from the parent movement rather than recalculating it, so an accrual and its reversal net to exactly zero rather than to a rounding residue. |
Returned | MGCEarmarkBalanceAmount | No | Money reversed against this deal because the goods came back, in the deal currency. It is kept apart from an ordinary reversal because the two answer different questions: a reversal says somebody undid an accrual, a return says the trade itself was undone. A return against an accrual that has already been claimed does not rewrite the chain - it posts a negative accumulation as a new root and flags the claim. |
Claimed | MGCEarmarkBalanceAmount | No | Money against this deal that has been drawn into a claim but not yet approved, in the deal currency. It is written by the movement engine when the claims package generates a claim, in the same transaction as the movement itself. |
ClaimApproved | MGCEarmarkBalanceAmount | No | Money against this deal on claims that have been approved, in the deal currency. Approval is where a claim becomes a customer credit; settlement of that credit is ordinary accounts receivable and is deliberately NOT tracked here. The settled figure is derived on read from the open claim lines, because a stored copy would go stale the moment accounts receivable settled an invoice. |
QuantityToDate | MGCEarmarkDealQty | No | The quantity accumulated against this deal so far, expressed in the deal unit. It INCLUDES movements whose origin is Migrated: an opening position loaded during cut-over is real quantity that really moved, so it counts toward a qualifying minimum. That is deliberately asymmetric with the catch-up base, which excludes migrated movements, because migrated quantity was never eligible for the money the minimum unlocks and must not size a catch-up. |
QuantityBelowThreshold | MGCEarmarkDealQty | No | The quantity accumulated against this deal while it was still below the deal's qualifying minimum, in the deal unit. It is what the deal control workspace shows before the minimum is crossed, and it is what sizes the catch-up run at the moment it is crossed. It is not a second copy of quantity to date: it stops growing once the minimum is reached. |
PendingCatchUpValue | MGCEarmarkCatchUpValue | No | The money computed for this deal but not accrued, because the deal's qualifying quantity had not been reached, in the deal currency. It is the running sum of the amounts behind the Below qualifying quantity verdicts, and it is what the catch-up run pays out once the minimum is crossed. Movements whose origin is Migrated are excluded from it while still counting into quantity to date. |
HeadroomAmount | MGCEarmarkHeadroomAmount | No | How much of a deal's lifetime cap is still available to accrue against, in the deal currency. It extends the standard transaction-currency amount type so that it inherits currency formatting and rounding. Headroom is recomputed on every balance apply and again whenever an approved amendment changes the cap, because the control evaluator reads the live control set through the locked balance row rather than the instance's display-only snapshot. On a negative deal, headroom is displayed on magnitude. |
HeadroomPercent | MGCEarmarkHeadroomPercent | No | The share of a deal's lifetime cap still available, expressed as a percentage. It extends the standard percentage type so that it inherits precision and formatting. The deal control workspace sorts on this column, and the headroom warning verdict fires when it falls below the deal's alert threshold. Like the headroom amount it is recomputed on every apply and on amendment, never cached across a parameter change. |
LastAccrualDate | TransDate | No | The posting date of the most recent accrual that moved this balance. It is a monitoring column: a deal that is live and inside its validity window but has not accrued for a long time is the signal the unaccrued-transaction sweep exists to chase. |
RebuiltDateTime | TransDateTime | No | When this balance row was last recomputed from the accrual transactions by the balance rebuild. A blank value means the row has never been rebuilt, which is the ordinary state: rebuild is a check, not the maintenance path. |
RebuildVariance | MGCEarmarkBalanceAmount | No | The difference the last rebuild found between the maintained balance and the balance recomputed from the accrual transactions, in the deal currency. Zero is the expected answer and anything else is a finding: the rebuild writes a Balance variance verdict alongside it. The rebuild deliberately excludes the settled figure, which is derived on read and has no stored counterpart to compare against. |