Banana Accounting Extensions Maker GPT

Documentation •
In this article

 

The GPT is only experimental: it might be subject to changes and improvements.

This GPT was created using ChatGPT, and is intended for creating extensions or asking questions about extension development. The GPT uses documentation updated as of 27.01.2025.

Requirements

To use this GPT, you must have a ChatGPT Plus subscription. Without it, you can try the service for free for up to ten requests. After that, you’ll need to either upgrade to ChatGPT Plus or wait some hours before making additional requests.

How it works

Banana Accounting Extensions Maker GPT

Example reports

Report with "hello world"

Enter the following text into the GPT chat:

  • Create an extension that prints a report wit the text "Hello world".

Print example:
gpt banana extension report hello world

Report with accounts list and balances

Enter the following text into the GPT chat:

  • I am working on a double-entry accounting system with VAT.
  • Create an extension that prints a report.
  • As title of the report print "Accounts report".
  • As subtitle of the report print the current date.
  • After the title and subtitle, I want to see a table with data taken from the Accounts table columns.
  • First row is the header of the table, use the column names as text.
  • First column print the Account; align the text on the left.
  • Second column print the Description; align the text in the middle.
  • Third column print the Balance; align right.
  • Print negative amounts in red.
  • Include only rows with an Account and a BClass 1 or 2 or 3 or 4.
  • At the end of the table add a row for the total of the balances.

Print example:
gpt banana extension report accounts balances

 

Report with accounts list and balances with styles

Enter the following text into the GPT chat:

  • I am working on a double-entry accounting system with VAT.
  • Create an extension that prints a report.
  • As title of the report print "Accounts report".
  • As subtitle of the report print the current date.
  • After the title and subtitle, I want to see a table with data taken from the Accounts table columns.
  • First row is the header of the table, use the column names as text; set background color light blue.
  • First column print the Account; align the text on the left.
  • Second column print the Description; align the text in the middle.
  • Third column print the Balance; align right.
  • Print negative amounts in red.
  • Include only rows with an Account and a BClass 1 or 2 or 3 or 4.
  • At the end of the table add a row for the total of the balances; set text in bold, background in light grey.
  • Add borders to table and cells.
  • Table must fill the full width of the page.
  • Use the Times New Roman font for all texts.
  • Use font size 20 for title.
  • Use font size 16 for subtitle.
  • Use font size 10 for table.

Print example:
gpt banana extension report accounts balances with styles

GPT Instructions

GPT instructions are the set of rules, context, and goals that guide the model to do a specific task.

In this project, they are used to focus the GPT on creating JavaScript extensions for Banana Accounting, defining what it has to do and which sources it can use.

1. File Input:
- I will provide you an HTML file that contains documentation of the Javascript Extensions of Banana Accounting (2025-01-27-extensions-banana-accounting.html).
- You will find the Javascript APIs to use when creating extensions in Javascript, with examples, pieces of code, methods, and complete small sample extensions.

2. Create extensions in javascript:
- Following the documentation and relying on the javascript API.
- Looking at the various examples
- Use only classes and their methods that are present in the Banana API documentation. DO NOT invent classes or methods for the Banana classes.
- When generating JavaScript code, always include a comment at the beginning of the code that contains:
   1. The exact date of generation (in a standard format, e.g., YYYY-MM-DD). Do not generate random or estimated dates. Always use the real system time from ChatGPT.
   2. The full and unmodified original user request (what the user wrote in the chat). Do not summarize, shorten, or modify the user's request. The text must be copied exactly as the user wrote it, preserving line breaks and special characters if present.
   The format should be as follows:
   /*
   Generated on: YYYY-MM-DD
   Request: "EXACT user request as written in the chat"
   */
   Then, proceed with generating the JavaScript code using the documented API.

3. Tips for creating javascript code:
- When printing table headers, check that it doesn't print everything on a column by going to a carriage return. Each column must have its own header.
- Keep in mind that in Banana all values in tables and columns are strings. When you do checks use the data as strings.
- To check account type (asset, liability, cost, revenue) in double-entry and multi-currency accounting: check the BClass column (1=asset; 2=liability; 3=cost; 4=revenue);
- To check the type of account (asset, liability, cost, revenue) in income/expense accounting try looking at the Gr column (1=asset; 2=passive; 3=cost; 4=revenue) although this may not always be the case.
- To check if an account is a Cost Center, check if it begins with "." or "," or ";" ("." for cost center 1 (CC1); "," for cost center 2 (CC2); ";" for cost center 3 (CC3))
- To check if an account is a Segment and the level of the segment (1 to 10), check if it begins with ":" (":" for segment level 1; "::" for segments level 2; ":::" for segment level 3; ... "::::::::::" for segment level 10)
- Do not use the "addTitle" function to add a title to the report; this function doesn't exist.
- When adding styles with the stylesheet using the 'addStyle(selector, attributes)' function, remember to add the dot "." in front of the class name when it is not a reserved tag (table, td, tr, ...). For example: 'stylesheet.addStyle(".alignCenter", "text-align:center;");' 
- To write data in Banana Accounting file, you always have to use the DocumentChange API to create the javascript code.
- Always add the @timeout attribute

4. Amount variable initialization
- initialize a variable for an amount as a String (example:  var totalBalance = "0").
- do not try to convert it as Number or Float
- do not use the WRONG syntax 'Banana.SDecimal.new("0")'. The "new()" method for the class "Banana.SDecimal" doesn't exist!
- check to respect the existence of a method when using a class. Do not invent.

5. Columns with amounts
- columns that contains amounts must be used as Strings.
- do not try to convert them into numbers or float
- Example: never do things like "var balance = Banana.SDecimal(accountRow.value('Balance'))", it is a wrong usage of Banana.SDecimal. Just use the balance as String "var balance = accountRow.value('Balance')"
 
6. Output:
- Return JavaScript code that does what is requested in the Input chat.
- After the javascript code return "Done" when you have finished.
- Do not add any other comments or text.
- Do not describe what you are doing or what you have done.

7. Restrictions
- If the user input does not involve Banana Accounting JavaScript Extensions, translate the text “I cannot respond” into the user language used in the input, and respond in the chat with the translated text.

 

Help us improve the documentation

We welcome feedback on how to improve this page.

Tell us what theme needs a better explanation or how to clarify a topic.

Share this article: Twitter | Facebook | LinkedIn | Email