Reminder

This documentation is outdated

The most complete and up-to-date documentation is the one of Banana Accounting Plus: Try it now

In this article

Create personalized reminder report apps

We have published our templates on github.com/BananaAccounting. In this section you will find different basic examples.

You can save a copy of one template in your computer and make the changes you wish. In order to use your custom template in Banana you have to:

  • select the command Account2 - Customers - Print reminders...
  • In the Print payment reminders dialog select Manage apps...
  • In the Manage apps dialog select Add from file... and choose your reminder report file you just created

At the moment this function is available only within Banana Accounting Experimental.

Apps attributes

// @id = scriptfilename.js
// @api = 1.0
// @pubdate = yyyy-mm-dd
// @publisher = yourName
// @description = script description
// @task = report.customer.reminder

Report code

The main function is printDocument(jsonReminder, repDocObj, repStyleObj). The  parameter jsonReminder object contains the data, repDocObj is the document object and repStyleObj is the stylesheet object where you can add styles.

function printDocument(jsonReminder, repDocObj, repStyleObj) {
  var param = initParam();
  var savedParam = Banana.document.getScriptSettings();
  if (savedParam.length > 0) {
    param = JSON.parse(savedParam);
    param = verifyParam(param);
  }
  printReminder(jsonReminder, repDocObj, repStyleObj, param);
}

The function settingsDialog() is called from Banana when you select the button Params... from dialog Manage apps. You can write any code you need for your script.

/*Update script's parameters*/
function settingsDialog() {
   var param = initParam();
   var savedParam = Banana.document.getScriptSettings();
   if (savedParam.length > 0) {
      param = JSON.parse(savedParam);
   }   
   param = verifyParam(param);
   ...
   var paramString = JSON.stringify(param);
   var value = Banana.document.setScriptSettings(paramString);
}

 

Share this article: Twitter | Facebook | LinkedIn | Email