In this article
In Banana Accounting javascript extensions, when referring to tables and columns, you must always use the correct nameXml.
Each table and each column has a proper nameXml. With the nameXml, tables and columns can be accessed to read the data they contain.
All columns of FileInfo table are shown below with their nameXml.
FileInfo table
The FileInfo table is used by the program to store all the information about the currently open file.
All nameXml of the table columns are listed below:
- SysCod
- Links
- Section
This column is used to indicate the Group name of the values. - SectionText
- Id
This column is used to indicate the specific and explicit identification of the value. - Description
This column is used to indicate explanation of the value. - Value
This column is used to indicate the formatted value. - SectionXml
This column is used to indicate the name of the section in English. - IdXml
This column is used to indicate the identification in English. - ValueXml
This column is used to indicate the field contents in Xml format.
The SectionXml and the IdXml identify the value unambiguously.
With Javascript extensions you can retrieve the ValueXml using the "Banana.document.info(SectionXml,IdXml)" API function.
FileInfo columns structure
The list of columns is shown below in JSON format, with also additional information for each column.
{
"nameXml": "FileInfo",
"columns": [
{
"nameXml": "SysCod",
"alignment": "left",
"dataType": "text",
"decimal": "",
"description": "",
"excludeFromPrinting": "",
"header": "SysCod",
"header2": "",
"style": {
"objectName": "",
"backgroundColor": "",
"color": "",
"fontSize": 10,
"bold": false,
"italic": false
},
"visible": "",
"editable": "",
"width": 100
},
{
"nameXml": "Links",
"alignment": "left",
"dataType": "links",
"decimal": "",
"description": "Links to external documents",
"excludeFromPrinting": "",
"header": "Links",
"header2": "",
"style": {
"objectName": "",
"backgroundColor": "",
"color": "",
"fontSize": 10,
"bold": false,
"italic": false
},
"visible": "",
"editable": true,
"width": 600
},
{
"nameXml": "Section",
"alignment": "left",
"dataType": "text",
"decimal": "",
"description": "",
"excludeFromPrinting": "",
"header": "Section",
"header2": "",
"style": {
"objectName": "",
"backgroundColor": "",
"color": "",
"fontSize": 10,
"bold": false,
"italic": false
},
"visible": "",
"editable": true,
"width": 120
},
{
"nameXml": "SectionText",
"alignment": "left",
"dataType": "text",
"decimal": "",
"description": "",
"excludeFromPrinting": "",
"header": "Section",
"header2": "",
"style": {
"objectName": "",
"backgroundColor": "",
"color": "",
"fontSize": 10,
"bold": false,
"italic": false
},
"visible": "",
"editable": "",
"width": 400
},
{
"nameXml": "Id",
"alignment": "left",
"dataType": "text",
"decimal": "",
"description": "",
"excludeFromPrinting": "",
"header": "Id",
"header2": "",
"style": {
"objectName": "",
"backgroundColor": "",
"color": "",
"fontSize": 10,
"bold": false,
"italic": false
},
"visible": "",
"editable": "",
"width": 400
},
{
"nameXml": "Description",
"alignment": "left",
"dataType": "text",
"decimal": "",
"description": "",
"excludeFromPrinting": "",
"header": "Description",
"header2": "",
"style": {
"objectName": "",
"backgroundColor": "",
"color": "",
"fontSize": 10,
"bold": false,
"italic": false
},
"visible": true,
"editable": "",
"width": 800
},
{
"nameXml": "Value",
"alignment": "left",
"dataType": "text",
"decimal": "",
"description": "",
"excludeFromPrinting": "",
"header": "Value",
"header2": "",
"style": {
"objectName": "",
"backgroundColor": "",
"color": "",
"fontSize": 10,
"bold": false,
"italic": false
},
"visible": true,
"editable": "",
"width": 900
},
{
"nameXml": "SectionXml",
"alignment": "left",
"dataType": "text",
"decimal": "",
"description": "",
"excludeFromPrinting": "",
"header": "Section Xml",
"header2": "",
"style": {
"objectName": "",
"backgroundColor": "",
"color": "",
"fontSize": 10,
"bold": false,
"italic": false
},
"visible": "",
"editable": "",
"width": 400
},
{
"nameXml": "IdXml",
"alignment": "left",
"dataType": "text",
"decimal": "",
"description": "",
"excludeFromPrinting": "",
"header": "ID Xml",
"header2": "",
"style": {
"objectName": "",
"backgroundColor": "",
"color": "",
"fontSize": 10,
"bold": false,
"italic": false
},
"visible": "",
"editable": "",
"width": 400
},
{
"nameXml": "ValueXml",
"alignment": "left",
"dataType": "text",
"decimal": "",
"description": "",
"excludeFromPrinting": "",
"header": "Value Xml",
"header2": "",
"style": {
"objectName": "",
"backgroundColor": "",
"color": "",
"fontSize": 10,
"bold": false,
"italic": false
},
"visible": "",
"editable": "",
"width": 400
}
]
}
FileInfo table for a double-entry accounting
The following is an example of the FileInfo table for a double-entry accounting data with some values in it.
- In the first row there are the names Xml of the columns.
- In the next rows there are all the data saved in the table.
SectionXml | IdXml | Description | ValueXml | Value |
Base | Date | Date | 2024-11-15 | 15.11.2024 |
Base | Time | Time | 15:17:51.537 | 15:17:51 |
Base | ProgramVersion | Program version | 10.1.24.24275 | 10.1.24.24275 |
Base | HashAlgorithm | Hash algorithm | Sha2-256 | Sha2-256 |
Base | HashTotal | Total Hash | a77a16e6eae92a9db0d4109d2040a6f6 | a77a16e6eae92a9db0d4109d2040a6f6 |
Base | FileName | File Name | /Users/username/Desktop/Double-entry with VAT-Sales tax.ac2 | /Users/username/Desktop/Double-entry with VAT-Sales tax.ac2 |
Base | WorkingCopyFileName | Working copy file name | /Users/username/Library/Application Support/Banana.ch/BananaPlus/10.0/WorkingCopies/Double-entry with VAT-Sales tax.ac2 | /Users/username/Library/Application Support/Banana.ch/BananaPlus/10.0/WorkingCopies/Double-entry with VAT-Sales tax.ac2 |
Base | DateLastSaved | Date last saved | 2024-11-08 | 08.11.2024 |
Base | TimeLastSaved | Time last saved | 16:10:31.000 | 16:10:31 |
Base | FileSize | File size | 782728 | 782728 |
Base | FilePwdProtected | File password protected | No | No |
Base | HeaderLeft | Header Left | Company XX | Company XX |
Base | HeaderRight | Header Right | Accounting 2024 | Accounting 2024 |
Base | DecimalsAmounts | Decimal points for amounts | 2 | 2 |
Base | RoundingType | Rounding Type | 3:Commercial/Arithmetic (Half up) | 3:Commercial/Arithmetic (Half up) |
Base | Language | Language in use | enu | English |
Base | LanguageCreation | Language used to create | enu | English |
Base | Extension1 | Extension 1 | https://www.banana.ch/portal/repodata/ghba/Universal/report/accounting/… | https://www.banana.ch/portal/repodata/ghba/Universal/report/accounting/… |
Base | Extension2 | Extension 2 | ||
Base | Extension3 | Extension 3 | ||
Base | CreateProgramVersion | Version Creation | 10.1.24.24275 | 10.1.24.24275 |
Base | LastSavedProgramVersion | Version Last saved | 10.1.24.24275 | 10.1.24.24275 |
Base | MaxSavedProgramVersion | Version Max saved | 10.1.24.24275 | 10.1.24.24275 |
Base | SavedProgramVersionCompatibility | Version compatibility | 9.0.1 | 9.0.1 |
Base | FileType | Type | Double-entry with VAT/Sales tax | Double-entry with VAT/Sales tax |
Base | FileTypeGroup | Group type | 100 | 100 |
Base | FileTypeNumber | Number type | 110 | 110 |
Base | FileTypeVersion | Version type | 100 | 100 |
AccountingDataBase | Company | Company | Company XX | Company XX |
AccountingDataBase | Courtesy | Courtesy | ||
AccountingDataBase | Name | Name | Pinco | Pinco |
AccountingDataBase | FamilyName | Family Name | Pallino | Pallino |
AccountingDataBase | Address1 | Address 1 | Via del Sole 54 | Via del Sole 54 |
AccountingDataBase | Address2 | Address 2 | ||
AccountingDataBase | Zip | Zip | 6900 | 6900 |
AccountingDataBase | City | City | Lugano | Lugano |
AccountingDataBase | State | State | ||
AccountingDataBase | Country | Country | Switzerland | Switzerland |
AccountingDataBase | CountryCode | CountryCode | CH | CH |
AccountingDataBase | Web | Web | www.companyxx.com | www.companyxx.com |
AccountingDataBase | companyxx@info.com | companyxx@info.com | ||
AccountingDataBase | Phone | Phone | 1234567890 | 1234567890 |
AccountingDataBase | Mobile | Mobile | 0987654321 | 0987654321 |
AccountingDataBase | IBAN | IBAN | CHXX 0900 0XXX XXXX XXXX X | CHXX 0900 0XXX XXXX XXXX X |
AccountingDataBase | FiscalNumber | Fiscal number | ||
AccountingDataBase | VatNumber | VAT Number | CHE-123.456.789 VAT | CHE-123.456.789 VAT |
AccountingDataBase | Recalculate | Entire recalculation | No | No |
AccountingDataBase | BasicCurrency | Basic Currency | CHF | CHF |
AccountingDataBase | BasicCurrencyHeader | Basic Currency Header | ||
AccountingDataBase | DecimalsAmountsCurrency | Decimal points for amounts in foreign currency | 2 | 2 |
AccountingDataBase | OpeningDate | Opening date | 2024-01-01 | 01.01.2024 |
AccountingDataBase | ClosureDate | Closure date | 2024-12-31 | 31.12.2024 |
AccountingDataBase | ObligatoryDate | Obligatory transaction date | Yes | Yes |
AccountingDataBase | MinusSignSegmentSeparator | Minus sign as segments separator | No | No |
AccountingDataBase | CostCenterSign | Cost center sign relative to amount | No | No |
AccountingDataBase | FileNamePreviousYear | File from previous year | ||
AccountingDataBase | SmartFillFromPreviousYear | Smart fill from previous year | No | No |
AccountingDataBase | VatAccount | VAT Account | ||
AccountingDataBase | VatAccountRecoverable | Recoverable VAT Account | ||
AccountingDataBase | VatRounding | VAT rounding | ||
AccountingDataBase | Cc1VatAmount | CC1 VAT amount | 0 | 0 |
AccountingDataBase | Cc2VatAmount | CC2 VAT amount | 0 | 0 |
AccountingDataBase | Cc3VatAmount | CC3 VAT amount | 0 | 0 |
AccountingDataBase | CustomersGroup | Customers group | DEB1 | DEB1 |
AccountingDataBase | SuppliersGroup | Suppliers group | CRE1 | CRE1 |
AccountingDataBase | AccountingDifference | There are accounting imbalances | Yes | Yes |
AccountingDataBase | InitialBalanceDifference | Difference on initial balance | ||
AccountingDataBase | DebitCreditDifference | Debit/credit difference | 147.50 | 147.50 |
Accounts | TableNameXml | Xml Table name | Accounts | Accounts |
Accounts | TableHeader | Table header | Accounts | Accounts |
Accounts | CountRows | Number of rows | 46 | 46 |
Accounts | CountRowsError | Rows with errors | 0 | 0 |
Accounts | CountRowsWarning | Rows with messages | 0 | 0 |
Accounts | CountRowsProtected | Protected rows | 0 | 0 |
Accounts | CountRowsLocked | Locked rows | 0 | 0 |
Accounts | CountGroups | Number of groups | 9 | 9 |
Accounts | CountAccounts | Number of accounts | 23 | 23 |
Accounts | CountAccountsBalance | Number of accounts with a balance | 10 | 10 |
Accounts | CountTransactions | Number of accounts with transactions | 10 | 10 |
Accounts | HashAccountsBalance | Hash of the balance | bcySJq3b9DHGdeyzP/CZzkgmcCfeBpLm | bcySJq3b9DHGdeyzP/CZzkgmcCfeBpLm |
Accounts | CountAccountsOpening | Number of accounts with opening balance | ||
Accounts | HashAccountsOpening | Hash of the opening balance | ||
Transactions | TableNameXml | Xml Table name | Transactions | Transactions |
Transactions | TableHeader | Table header | Transactions | Transactions |
Transactions | CountRows | Number of rows | 46 | 46 |
Transactions | HashComplete | Hash complete | x1iqL10LDNjc9DqkXvu9xsj8olbM2CGr | x1iqL10LDNjc9DqkXvu9xsj8olbM2CGr |
Transactions | CountRowsError | Rows with errors | 0 | 0 |
Transactions | CountRowsWarning | Rows with messages | 0 | 0 |
Transactions | CountRowsProtected | Protected rows | 0 | 0 |
Transactions | CountRowsLocked | Locked rows | 0 | 0 |
Transactions | DateEarliestTransaction | Earliest transaction date | ||
Transactions | DateLatestTransaction | Latest transaction date | 2024-10-31 | 31.10.2024 |
Transactions | TransactionLockUsed | Transaction lock is used | No | No |
VatCodes | TableNameXml | Xml Table name | VatCodes | VatCodes |
VatCodes | TableHeader | Table header | VAT codes | VAT codes |
VatCodes | CountRows | Number of rows | 90 | 90 |
VatCodes | HashComplete | Hash complete | pwLdoomYeFIdnw1T2dfpxO2B6ks8a3tK | pwLdoomYeFIdnw1T2dfpxO2B6ks8a3tK |
VatCodes | CountRowsError | Rows with errors | 0 | 0 |
VatCodes | CountRowsWarning | Rows with messages | 0 | 0 |
VatCodes | CountRowsProtected | Protected rows | 0 | 0 |
VatCodes | CountRowsLocked | Locked rows | 0 | 0 |
Budget | TableNameXml | Xml Table name | Budget | Budget |
Budget | TableHeader | Table header | Budget | Budget |
Budget | CountRows | Number of rows | 1 | 1 |
Budget | CountRowsError | Rows with errors | 0 | 0 |
Budget | CountRowsWarning | Rows with messages | 0 | 0 |
Budget | CountRowsProtected | Protected rows | 0 | 0 |
Budget | CountRowsLocked | Locked rows | 0 | 0 |
Documents | TableNameXml | Xml Table name | Documents | Documents |
Documents | TableHeader | Table header | Documents | Documents |
Documents | CountRows | Number of rows | 1 | 1 |
Documents | CountRowsError | Rows with errors | 0 | 0 |
Documents | CountRowsWarning | Rows with messages | 0 | 0 |
Documents | CountRowsProtected | Protected rows | 0 | 0 |
Documents | CountRowsLocked | Locked rows | 0 | 0 |
LockTransactions | TransactionLockUsed | Transaction lock is used | No | No |
The same table exists for all the accounting file types. What changes from one type of accounting to another is the data the table contains.
The SectionXml and the IdXml columns identify the value unambiguously.
With Javascript extensions you can retrieve the value of ValueXml column using the JavaScript API function "Banana.document.info(SectionXml,IdXml)". The function returns the info value of the document referenced by SectionXml and IdXml.
Some examples:
// Get some value of the accounting file
var FileName = Banana.document.info("Base","FileName");
var DecimalsAmounts = Banana.document.info("Base","DecimalsAmounts");
var HeaderLeft = Banana.document.info("Base","HeaderLeft");
var HeaderRight = Banana.document.info("Base","HeaderRight");
var BasicCurrency = Banana.document.info("AccountingDataBase","BasicCurrency");
// For openingDate and closureDate use instead startDate and endDate
var openingDate = Banana.document.info("AccountingDataBase","OpeningDate");
var closureDate = Banana.document.info("AccountingDataBase","ClosureDate");
// For file accounting type
var FileType = Banana.document.info("Base","FileType");
var FileGroup = Banana.document.info("Base","FileTypeGroup");
var FileNumber = Banana.document.info("Base","FileTypeNumber");
// For customer settings
var customersGroup = Banana.document.info("AccountingDataBase","CustomersGroup");
var suppliersGroup = Banana.document.info("AccountingDataBase","SuppliersGroup");