Unit Types
Configuration - Unit Types
The “unit_type” element is a specialist piece of configuration which controls the rendering of supplementary per-unit (e.g. “Cash”, “SMS”) expenditure summaries below the per unit-type totals.
Example Configuration
An example configuration is as follows:
<!-- Extra configuration for various unit types. E.g. showing expenditure in top box. -->
<!-- Note: Highlight entries need to be in ASCENDING total order. Unit for highlight total is "smalls". -->
<unit_type unit_name="cash">
<expenditure balance_name="Wallet Exp" label="Expenditure" combined="no"/>
<expenditure balance_name="Wallet Exp" label="Total Value" combined="yes">
<highlight total="5000" class="green"/>
<highlight total="10000" class="orange"/>
<highlight total="100000" class="yellow"/>
</expenditure>
</unit_type>
The “unit_type” element has one attribute.
- unit_name = “cash” : This must be the lower-case unit type, e.g. “cash”, “smss”, “data” as per the OCNCC CCS column CCS_BALANCE_UNIT.NAME.
Each “expenditure” element has the following attributes.
- balance_name = “Wallet Exp” : This must be the name of the balance type in which CCS is maintaining the tracked expenditure total. I.e. this must match the CCS column CCS_BALANCE_TYPE.NAME. This balance type must have CCS_BALANCE_TYPE.TYPE = ‘E’ for Expenditure.
- name = “Total Value” : Human-readable label to show next to this field.
- combined = “yes” : Should the total be combined? Specify “no” to show only the named expenditure balance value. Specify yes to show the combined expenditure balance plus the sum of current total held balances.
- <highlight> : Specify rules for colour highlights.
The highlight rules are elements with the following attributes:
- total = “{littles}” : The number of “littles” required to qualify for this highlighting.
- class = “{class-name}” : The class name that will be added to the element. This must refer to a matching CSS rule in the per-site CSS file “site.css”.
Sample Screenshot
The following image shows the effect of this configuration:
Note: Two expenditure values are shown in this sample:
- Expenditure : This shows the value of the CCS balance type named “Wallet Exp”. This must be an existing CCS balance with balance category (“E” = Expenditure) which is created and incremented by CCS.
- Total Value : This shows the sum of the CCS balance type named “Wallet Exp” plus the sum of all “Cash” balances.
Note: The mechanism for tracking total expenditure must be implemented in OCNCC CCS. The N2C5 product will only display data which already exists in OCNCC CCS.
Note: The “unit_type” element is a custom parameter for N2C5. It is not part of the base Jarvis framework.