SQL-Ledger templates offered a powerful way to develop all kinds of financial documentation, from invoicing to receipts. The templates for each dataset is found at: /usr/local/sql-ledger/templates/[dataset]. If one has created a 'language', its directory with templates and image files are also found here.
One attractive feature of the templates offered within SQL-ledger are those under the Latex templates as these can render invoices and other documents by the ledger into PDF files.
Two files that are not available within the drop-down selection: preamble.tex/.html and letterhead.tex/.html To access them, it is recommended to use the FTP application such as FileZilla by which one can easily edit these files.
Preamble.tex: For those who wish to have a4 size and not letter size, replace \usepackage[paper=letterpaper,... with \usepackage[paper=a4paper,...
letterhead.tex: To fine-tune the size of the company logo, adjust up or down the number in: \includegraphics[scale=0.3]
Note: Latex is a programming where even a missed placed ',' can rendered a file non-functional. It is recommended to either keep a backup copy of any original .tex or to rename a copy of it - like credit_invoice.tex to a copy as credit_invoice2.tex.
Login and within the SQL-Ledger menu:
1. Via the menu: System -> Latex Templates, select and open the specific template to be edited (eg. Invoice.tex)
2. Click the “Edit” button at the bottom of the template page)
3. For a temporary backup, Mouse-click on the template and press Ctl-a to highlight all text and Ctl-c to copy with the purpose to save the original in case things go wrong.
a) One then proceed making changes to the .tex file. In most browser, the key-combo Ctl-f can find key words, such as customerphone or to put them it such as customertaxnumber (set in customer profile where there is the dialogue box: Tax Number). Keywords are those that draw information from the dataset.
b) It is worthwhile to:
Have some familiarity with basic LaTeX terminology (via the Internet))
to look over the template for its structure and experiment with little blocks of code. After all, one can always cut and paste the original code back to the template.)
Viewing other templates (.eg by producing their respective .pdf file) can be helpful in finding the suitable block of code to implement a change.)
5. Edit the template to suit your needs.)
a) Certain keywords as mentioned eg. businessnumber will automatically place one's business TIN number as entered in System->Defaults-Business Number box. Moreover, similarly <%company%> will place the company name.
b) \textbf{some text now in bold} gives: some text now in bold
6. Save modified template for easy restore if the restore is on a fresh setup.
Other Customizations
7. Replacing SQL-Ledger logo with company logo in the templates, following these steps:)
8. Use a graphic application such as GIMP (Open-source and free graphics application) to create a logo (of a size ~100 x100pixels) and then saved it as logo.eps and logo.png )
9. Delete the same-name files in your dataset directory found at: /usr/local/sql-ledger/templates/[dataset] and upload one's customized replacements, via FileZilla(FTP). If one has created a 'language', its directory with similar templates and image files to be edited and/or replaced. For the SQL-ledger application itself, put these in the directory (of the server): /usr/local/sql-ledger/images, replacing the sql-ledger.png/.eps with one's image but named sql-ledger.png.