Skip to content

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.

ColumnContent
TypeAccountingMenu. This tells invoiceR that the entry belongs in the accounting toolbar.
DisplayNametranslation key for the label
PermissionNamepermission a user needs for the button
Iconname of a DevExtreme icon
RoleIdoptional: only for members of this role
ActionNamename of the action by which the backend recognizes it
ShowFileUploadtrue if a window for uploading a file should appear before the action
AllowedFileExtensionsallowed file types (MIME types, comma-separated) for the upload
AskForConfirmationtrue 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.

Create an entry in conf.IrMenuEntry with these values:

ColumnValue
TypeAccountingMenu
ActionNameUploadToAccountingLines
DisplayNameAccountingToolbarButtonExcelUpload (“Add accounting from excel upload”)
PermissionNameActions.Accounting.AllowExcelUpload
Iconxlsxfile
ShowFileUploadtrue
AskForConfirmationfalse
AllowedFileExtensionsapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheet

Then give the accountants’ role the permission Allow Excel Bulk Upload for Accounting (Actions.Accounting.AllowExcelUpload).

How the Excel columns map to the accounting line is defined in an entry in conf.IrManagers:

ColumnValue
Idnew GUID
Enabledtrue
InterfaceIdentifierweb_manager.EnioService.IrCaseLineGenerator.IIrCaseLineGeneratorManager
ClassIdentifierenio.tool.Plugin.IrCaseLineGenerator.IrCaseLineGeneratorManager_fromXLSX
ConfigurationIdentifierweb_manager.EnioService.IrCaseLineGenerator.IrCaseLineGeneratorArgument
Configurationthe mapping as JSON, see below
Descriptionfor 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
}
EntryMeaning
FirstLineOfMappingfirst row with data
AccountingFormIdform used to create the new lines
CostcenterColumn, AccountColumn, ProjectColumncolumns with cost center, account and project number
GrossAmountColumn, NetAmountColumn, VatCodeColumn, VatRateColumnamounts and VAT. Two of gross, net and VAT code are enough.
PostingTextColumncolumn with the posting text
AdditionalStr1Column to AdditionalStr5Columnoptional additional fields