Customization

SQL-Ledger can be customized in three ways:

1. custom_xx.pl files

You can create your own functions or override any existing function by creating custom scripts in custom_xx.pl files and putting them in bin/mozilla folder.

For example, to add new functions to gl.pl file, add these functions to custom_gl.pl file and put this file into bin/mozilla/ folder. This file will be automatically loaded by sql-ledger before running any functions in gl.pl files.

Once your new functions are there, you can call them using your own custom menu. Custom menu entries are put in custom_menu.ini and follow the same syntax as that of menu.ini.

This method of extending the sql-ledger is upgrade-safe and is the recommended way.

2. Custom Modules

You can build your own modules. To write a module, you need to create at least three files:

  • Module back-end code which will reside in ./sql-ledger/SL/MyModule.pm
  • Module front-end code which will reside in ./sql-ledger/bin/mozilla/mymodule.pl
  • Gateway script in ./sql-ledger. (You just need to make a copy of an existing one. For example cp gl.pl mymodule.pl in ./sql-ledger/ folder.

This method is also upgrade safe.

3. Modify the source code

Sometimes there is a need to directly alter the sql-ledger source code for particular needs. We have, for example, modified few reports (GL Transactions, All Items) in this way. Your changes, however, will be overwritten when you upgrade to new version and you will need to port these changes again to the new version.

A bit discipline and an SCM software like GIT can help manage such changes or patches with easy. We, at ledger123.com, use GIT to track and manage such changes across newer versions of sql-ledger.

 
customization.txt · Last modified: 2010/05/06 12:05 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki