Develop an Import Extensions

文件资料 •
在此文中

Most software or online banking can only export data in a proprietary format that Banana Accounting cannot understand.

For this cases it is possible to create an Import Extension that that converts data from a proprietary format to a format that is accepted by Banana.

Import Extensions read a custom format and convert in an import format suitable for using with the command "Import to accounting".

Create an Import Extensions for converting from other formats

The Import Extensions can be used within the Command Action->Import into Accounting.

Extension Attributes

An Import extension has the Extension attribute @task of type "import.":

exec() function

Banana load an extension and call the Exec(inText) function of an Import Extention:

  • The exec( inText) the argument receive the row data that is read from the file or clipboard.
  • The exec() function should return a value that contains the converted data that is to be imported. It can be of type:

Convert to a tab separated text

Imports Extensions are JavaScript program that import data to a specific table.
The import with tab separated text only allow to add rows to a table:

Import Extensions have:

  • the attribute @task defined as one of the import for example //@task = import.transactions (for more information, see Apps attributes documentation)
  • the attribute @outputformat defines the format of the imported data:
    • For a Double-entry accounting use the value //@outputformat = tablewithheaders.
    • For an Income/Expenses accounting use the value //@outputformat = transactions.simple.
  • The parameter in the function exec contains the import data (the content of the file specified in the input box)
  • You can specify that the data is read from the file specified on the input box or that the user can select the file with "// @inputdatasource = openfiledialog"  
  • The import text is returned as a String in the function exec with the return statement

 

Import with DocumentChange

You can directly import the data into accounting using the DocumentChange API. Parse the information, define the changes to be made to the document and return the JSON Object.

With the DocumentChange API you can add, modify or remove line from any tables. You can also add or modify columns.

 

 

请帮助我们完善必备文件

我们非常欢迎您发送宝贵的反馈意见

请告诉我们什么主题需要更好的解释或如何才能更好的对其诠释。

分享这篇文章: Twitter | Facebook | LinkedIn | Email