Accounting rules
Accounting rules tell General Ledger which account to post each amount to. You set them with Customer Controlled Configuration (CCC), either for the whole tenant or for a single business unit.
The six kinds of rule
There is one configuration kind per kind of amount. Each rule in a kind has a type that says what it matches
on. The types are tried in the order listed, and the first rule that matches decides the account. DEFAULT
catches everything that nothing more specific matched.
Sales and returns
gle.sales-and-returns-rules.v1: the account for the goods on each item line, excluding VAT. Returns use the
same rule as sales, on the debit side. See Posting to accounts.
| Type | Matches when value equals |
|---|---|
ITEM_ID | the item's ID |
CATEGORY_ID | the item's merchandise category |
TAX_GROUP_ID | the tax group the line is taxed under |
DEFAULT | anything not matched above (value is null) |
Tax
gle.tax-rules.v1: the account for the VAT on each line.
| Type | Matches when value equals |
|---|---|
TAX_GROUP_ID | the tax group |
DEFAULT | anything not matched above |
Tender
gle.tender-rules.v1: the account for each payment or refund, plus cash rounding.
| Type | Matches when value equals |
|---|---|
PAYMENT_METHOD_NAME | the payment method the till recorded, for example AMEX. Use this to separate card schemes that share a provider. |
PROVIDER_ID | the payment provider that authorised the card payment |
INTERNAL_TENDER_ID | the tender ID configured in Hii Retail, for example cash or a store card |
DEFAULT | any payment not matched above |
ROUNDING | used for cash rounding only (value is null) |
Income and expense
gle.income-rules.v1 (paid-in) and gle.expense-rules.v1 (paid-out): the account for money put into or taken out
of the till that is not a sale, for example buying milk for the staff room from the till.
| Type | Matches when value equals |
|---|---|
REASON_CODE_ID | the reason code the cashier chose |
DEFAULT | any other reason |
A paid-in or paid-out also moves money in the till, so it needs a tender rule as well. It is matched on
INTERNAL_TENDER_ID, then DEFAULT.
These two kinds take two extra fields for VAT on the income or expense:
| Field | Meaning |
|---|---|
taxRate | the VAT rate in percent, for example 25. The amount is split into net and VAT at this rate. |
taxAccountId | the account the VAT part goes to |
⚠ Set both or neither. With a taxRate but no taxAccountId, the VAT part has nowhere to go and the
transaction cannot be balanced.
Gift card
gle.gift-card-rules.v1: the account for the value loaded when a gift card is sold. Paying with a gift card
is a tender.
| Type | Matches when value equals |
|---|---|
PROVIDER_ID | the gift-card provider |
DEFAULT | any other gift card |
How matching works
valuemust match exactly, including case and leading zeros.AMEXdoes not matchAmex.- Configure exactly one
DEFAULTper kind. If there are several, which one is used is not defined. - A rule's
idonly identifies the rule within the list. It has no effect on matching or on the order.
The minimum set of rules
For a store's transactions to be posted in full, it needs:
- a
DEFAULTrule in each of the six kinds its transactions use (in practice: sales and returns, tax and tender always; income, expense and gift card if the store does paid-ins, paid-outs or sells gift cards) - a
ROUNDINGrule in the tender kind, if the store rounds cash
With those in place every amount has an account, and you can add more specific rules on top.
What happens without them:
| Situation | Result |
|---|---|
| The business unit has no rules at all | 🛑 Its transactions are not recorded. Recalculating later cannot bring them back, so configure the rules before the store trades. |
| Some amounts in a transaction have no matching rule | The transaction cannot be balanced, so the store's whole business day is blocked and not exported. See Blocked days. |
Tenant or business unit
A rule list set on the tenant applies to every business unit. A list set on a business unit is used for that business unit instead. CCC resolves the list for each business unit, and General Ledger uses the resolved list.
PUTon a business unit replaces the tenant's list for that business unit, so the list you send must be complete,DEFAULTrules included.PATCHon a business unit adds or changes individual rules, matched byid, on top of the list it inherits.
Read more about inheritance in CCC.
Setting a rule
Example: post everything in tax group Standard to SR_Standard, and everything else to SR190, for one
business unit:
curl --request PUT "https://ccc-api.retailsvc.com/api/v1/config/gle.sales-and-returns-rules.v1/values/business-units/${BUSINESS_UNIT_ID}" \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer ${API_TOKEN}" \
--data '{
"value": [
{ "id": "rule001", "config": { "type": "TAX_GROUP_ID", "value": "Standard", "accountId": "SR_Standard" } },
{ "id": "rule002", "config": { "type": "DEFAULT", "value": null, "accountId": "SR190" } }
]
}'
Replace the kind in the URL for the other kinds. Every rule has type and accountId. value is required for every
type except DEFAULT and ROUNDING.
When a change takes effect
- New transactions use the new rules within about ten minutes of the change.
- Transactions already posted keep the account they were posted to. A rule change never rewrites a day on its own. To apply the new rules to days that have already been posted or exported, recompute those days. Wait ten minutes after the change first, or the recompute may still use the old rules. See Correcting and resending.
Troubleshooting
| Symptom | Check |
|---|---|
| A store's day never arrives in the accounting system | Is the day blocked? Recompute or re-export it and look at blockedBusinessDates in the response. Then check that every kind has a DEFAULT rule. |
Amounts land on the DEFAULT account instead of a specific one | Does value match exactly, including case and leading zeros? Is the rule on the right business unit, or overridden by a business-unit list? |
| A new rule has no effect on yesterday's figures | Rules only apply to new transactions. Recompute the days. |
| Paid-ins or paid-outs block the day | Is there a tender rule for them? Is taxRate set without taxAccountId? |
| Amex ends up on the general card account | Add a PAYMENT_METHOD_NAME tender rule with the exact value the till records. |