Version 4 > User Guides > Accounting and GL Codes

Accounting and GL Codes

Every purchased item (every line item on an invoice, technically) is categorized using 3 accounting codes:

  1. primary sales code (acctcode_id)
  2. first sales subcode (acctcode2)
  3. second sales subcode (acctcode3)

The parenthesized name is how the sales (sub)code is named internally.

Primary Sales Code

The primary sales code is a simple and broad categorization of the purchase. The primary sales codes that are recognized by the system are listed in the acctcode table, and can be viewed and added to using the Billing Adjustments module.

sales_codes

Sales codes are automatically used to group purchases for aggregate financial reports.

Sales Subcodes

Sales subcodes are additional, more specific ways to categorize purchases. They are usually (but not necessarily) set to the ID of some purchased object in the system. For example, if you register for an event, then the first sales subcode will usually be the event ID, and the second sales subcode will be the fee ID that you purchased. The particular meanings of subcodes will vary depending on the primary sales code, but for any given primary sales code, the rule for interpreting the subcodes should be consistent.

For instance, here are the meanings of subcodes for some common types of purchase:

Primary sales codeFirst sales subcodeSecond sales subcode
Course Curriculum ID Course ID
Event Registration  Event ID Fee ID
Membership Membership Type ID 1=application, 2=renewal
Merchandise Catalog ID Product ID
Quiz Quiz ID n/a

Billing Adjustments

Surcharges and billing adjustments (eg. taxes, shipping charges) are automatically calculated and added to invoices based on rules in your surcharges table. You can set these rules up using the Billing Adjustments module.

Surcharges can be restricted to particular primary sales codes - just set the "Applies to" field in the surcharge configuration to the appropriate sales code.

To restrict surcharges to particular sales subcodes, you can use either of the following 2 methods:

  1. set the Applies to GL code field, and enter a GL code formatted according the rules described below
  2. set the Applies to Object Type to "content", and the Applies to Object ID field to one of the subcode IDs shown in the table above (for example, an event ID or a fee ID). It does not matter whether you use the ID of the first or second sales subcode.

Generally speaking, taxes and shipping rules are set up for primary sales codes only, although there are often a variety of geographic conditions as well.

Discounts and coupon codes, however, are often set up for particular items only. For example, a coupon code might apply to one particular event only. In those cases, you will want to be more specific in your surcharge sales code setup.

GL Codes

These accounting codes are converted into an internal GL code as follows:

  • internal GL codes have the format “AXX.YYY.ZZZ”
  • A = 1 for sales, 2 for payments received, 3 for refunds, and 4 for payments issued
  • XX = primary sales code
  • YYY = first sales subcode
  • ZZZ = second sales subcode

For example, the internal GL code 102.556.562 is a sale (1xx) of primary sales code 2, relating to subcodes 556 and 562. If primary sales code 2 is Event Registrations, then the subcodes would refer to event 556 and fee 562.

This GL code structure allows for some generalization, grouping, and categorization, for instance 102.* would give you all event-registration sales, whereas 102.556.* is all sales for one particular event, and 102.556.562 is all sales of one fee. Sorting by GL code will automatically group related sales together.

GL Code Conversion

These internal GL codes will not necessarily match the GL codes used by an organization's accounting department. If you want to report your accounting department's sales codes, you need to map the internal codes to the external ones. This is done using the glcode table. This table defines simple rules for converting internal GL codes to external GL codes for some other accounting system. A mapping rule consists of an internal GL code, which is compared to the GL code of an actual item, and an external GL code that is used if the two match. Mapping rules can define one, two, or all three fields of the internal GL code, for example:

102 - matches any internal GL code starting with 102

102.556 - matches any internal GL code starting with 102.556

102.556.563 - matches that GL code exactly.

Example mapping rule: If event 556 is a conference with multiple different fees, but you want all conference fees to be grouped by the same external GL code, the following map rule will use “CONF2021” as the GL code for all registrations in all fees for that event.

102.556 --> CONF2021

If there are multiple mapping rules that all match, it will choose the most specific one that matches.

You can also use GL code maps to equivalence different items. For example, if you run two sessions of a course, they will end up with different internal GL codes because they are different events. If one is event 600 and the other is event 601, you can equivalence them with a simple mapping rule like:

102.601 --> 102.600

or, alternatively

102.600 --> COURSE101

102.601 --> COURSE101

Payment GL codes

Payments also use GL codes in the format "AXX.YYY.ZZZ". A is 2 for revenues, and 4 for refunds. XX is set based on the payment method. YYY is the account ID that the payment was made against, and ZZZ is the invoice that was being paid, if that information is available.

GL Code Reporting

GL codes are automatically shown in the following Financial Reports:

  • itemized sales
  • itemized revenues
  • journal
  • GL code summaries

If you sort by GL code in these reports, it will automatically group similar sales together.