Additional buttons in accounting
By default, these buttons are shown above the accounting table:
- add a new accounting line,
- choose an accounting template,
- distribute the remaining amount evenly across the existing lines,
- distribute the remaining amount in the existing ratio.
You set up further buttons through entries in the conf.IrMenuEntry table. Clicking one triggers an
action in the backend, which the validation manager (IrValidationManager or a customer-specific
derivation) executes based on its name.
Entry in conf.IrMenuEntry
Section titled “Entry in conf.IrMenuEntry”| Column | Content |
|---|---|
Type | AccountingMenu. This tells invoiceR that the entry belongs in the accounting toolbar. |
DisplayName | translation key for the label |
PermissionName | permission a user needs for the button |
Icon | name of a DevExtreme icon |
RoleId | optional: only for members of this role |
ActionName | name of the action by which the backend recognizes it |
ShowFileUpload | true if a window for uploading a file should appear before the action |
AllowedFileExtensions | allowed file types (MIME types, comma-separated) for the upload |
AskForConfirmation | true if a confirmation prompt should appear before the action. Has no effect together with ShowFileUpload. |
Example: importing accounting lines from Excel
Section titled “Example: importing accounting lines from Excel”With the UploadToAccountingLines action, a user uploads an Excel file and invoiceR creates accounting
lines from it.
Button
Section titled “Button”Create an entry in conf.IrMenuEntry with these values:
| Column | Value |
|---|---|
Type | AccountingMenu |
ActionName | UploadToAccountingLines |
DisplayName | AccountingToolbarButtonExcelUpload (“Add accounting from excel upload”) |
PermissionName | Actions.Accounting.AllowExcelUpload |
Icon | xlsxfile |
ShowFileUpload | true |
AskForConfirmation | false |
AllowedFileExtensions | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet |
Then give the accountants’ role the permission Allow Excel Bulk Upload for Accounting
(Actions.Accounting.AllowExcelUpload).
Column mapping
Section titled “Column mapping”How the Excel columns map to the accounting line is defined in an entry in conf.IrManagers:
| Column | Value |
|---|---|
Id | new GUID |
Enabled | true |
InterfaceIdentifier | web_manager.EnioService.IrCaseLineGenerator.IIrCaseLineGeneratorManager |
ClassIdentifier | enio.tool.Plugin.IrCaseLineGenerator.IrCaseLineGeneratorManager_fromXLSX |
ConfigurationIdentifier | web_manager.EnioService.IrCaseLineGenerator.IrCaseLineGeneratorArgument |
Configuration | the mapping as JSON, see below |
Description | for example “Accounting line from Excel” |
The configuration names the first data row (the first row of the file is 1) and the columns (the first column is 0):
{ "FirstLineOfMapping": 2, "AccountingFormId": "<Id of the accounting form from conf.AccountingForms>", "CostcenterColumn": 0, "AccountColumn": 1, "ProjectColumn": 2, "GrossAmountColumn": 3, "VatCodeColumn": 4, "PostingTextColumn": 5}| Entry | Meaning |
|---|---|
FirstLineOfMapping | first row with data |
AccountingFormId | form used to create the new lines |
CostcenterColumn, AccountColumn, ProjectColumn | columns with cost center, account and project number |
GrossAmountColumn, NetAmountColumn, VatCodeColumn, VatRateColumn | amounts and VAT. Two of gross, net and VAT code are enough. |
PostingTextColumn | column with the posting text |
AdditionalStr1Column to AdditionalStr5Column | optional additional fields |
