Configuring expenses
With the expense process, employees record business expenses, either directly in invoiceR or with the mobile app. In addition to the photo or scan of the receipt, an expense form asks for further details about the expense. This form can be customized extensively and designed differently per role.
Structure
Section titled “Structure”| Table | Content |
|---|---|
conf.ExpenseForms | the forms, for example “Standard” and “Management”. Each form belongs to a role. |
conf.ExpenseCategories | the categories of an expense, for example lunch, car journey, train journey |
conf.ExpenseFields | the form fields, for example cost center or number of people |
conf.ExpenseFormFields | links forms, categories and fields |
This is how recording works:
- The user gets the form they have access to through their roles.
conf.ExpenseFormFieldsdetermines which categories the form offers.- The user chooses a category.
- invoiceR shows the fields stored for this category.
Expense options on the organization unit
Section titled “Expense options on the organization unit”You maintain the categories of an organization unit in the user interface:
- Open
Administration > Organization Units. - Click the purple credit card icon next to the organization unit (Spesen-Optionen bearbeiten, edit expense options). If there are no expense options yet, right-click and create them under Expense options.
For each category you define, among other things, the title, AI description, default account, cost center and project, and the related fields.
Expense forms
Section titled “Expense forms”There can be one or more forms, for example a standard form and one for external staff. Which role may
use a form is stored in conf.ExpenseForms.VisibleFilterRoleId.
Further columns in conf.ExpenseForms:
| Column | Meaning |
|---|---|
Name, Description | name of the form |
BackendUrl | address to which the mobile app sends the recorded data. Each form can have its own recipient, for example a gateway in the DMZ. |
CustomerToken | GUID the recipient uses to recognize which customer the data belongs to |
IrVersion | version of the data format (currently 0.1.0) |
Form fields
Section titled “Form fields”The field type is stored in conf.ExpenseFields.Type. Depending on the type, different parameters can
be set as JSON in conf.ExpenseFields.Options.
| Type | Field | Options |
|---|---|---|
1 Input | single-line text, for example “Lunch with customer” | minLength, maxLength, default |
2 Date | date, for example “Valid from” | allowPast, allowToday, allowFuture (each true/false) |
3 Radio | choice from fixed values, for example a cost center | the choices as key and text |
4 Number | number, for example number of people | minValue, maxValue, default |
5 Km | kilometres, with help for calculating the distance | minValue, maxValue, default |
6 Text | multi-line text, for example a note | minLength, maxLength |
7 Hidden | hidden field that is not displayed | depending on use |
Examples for Options:
{ "minLength": 5, "maxLength": 30, "default": "Meal" }{ "allowPast": true, "allowToday": true, "allowFuture": false }{ "1000": "Cash", "1010": "Bank", "1020": "Third-party account" }{ "minValue": 0, "maxValue": 500, "default": 20 }Loading choices dynamically
Section titled “Loading choices dynamically”Sometimes the choices should not be fixed in the form, for example because each user sees different
cost centers. Instead of creating a separate form for each user, fill in
conf.ExpenseFields.OptionsSource. invoiceR then loads further values in addition to Options.
OptionsSource has the form method://parameter. Currently there is the SQL method: the part after
:// is a query on the invoiceR database. The first column becomes the key, the second the displayed
text.
SQL://SELECT [Id], [EmailAddress] FROM [dbo].[AbpUsers] WHERE Id = @UserIdinvoiceR replaces these placeholders before running the query:
| Placeholder | Value |
|---|---|
@UserId | Id of the current user |
@UserName | user name of the current user |
@ExpenseCategoryAdditionalStr1 to @ExpenseCategoryAdditionalStr5 | additional fields 1 to 5 of the selected category |
