2 <p><li><h4>lineitems not printing</h4>
3 Templates designed on a *NIX platform don't work on a DOS platform.
4 To make them work load the template either with the builtin template editor
5 or a text editor and save. Templates designed on a Windows platform have the
6 same problem and won't work on a *NIX platform. Once you strip the ^M's
9 <p>Everybody now, "Who do we thank for this schlamassl".
11 <p><li><h4>UTF-8 character encoding</h4>
12 Most of the translations are in ISO format. To convert the translations
13 change directory to locale/cc and convert the files with iconv to UTF-8.
14 You should also convert the COAs too and make sure you select UTF-8
15 encoding when you setup a new dataset.
18 <p><li><h4>characterset problems</h4>
19 If you have problems displaying the correct characterset try adding
21 AddDefaultCharset On</pre>
22 in your httpd.conf file.
24 <p><li><h4>About installation</h4>
25 The easiest is to use the setup.pl script as root.
26 You don't need to know very much about your system, just login as root,
27 run 'perl setup.pl' and follow the prompts.
28 <p>setup.pl does not check for missing software packages and it is your
29 responsibilite to make sure you have the required software
30 installed either from source or from a package supplied with your distro.
32 <p>Requirements are clearly indicated in the README file and on the
36 <p><li><h4>cannot create function</h4>
38 <li>either run createlang and install the plpgsql language handler or
39 install yourself. For more information how to do that, visit
40 <a href=http://www.postgresql.org/docs/>PostgreSQL</a> and
41 read the interactive documentation for procedural languages.
49 <p><li><h4>The requested URL /sql-ledger/admin.pl was not found</h4>
50 Your webserver doesn't know where to find the script. Most commonly this
51 is from distributions hiding webserver configuration files in different
52 locations or files and setup.pl wasn't able to configure the location for
53 you. Find out which file (httpd.conf, httpdcommon.conf, ...)
54 controls your webserver configuration and add
57 Include /etc/httpd/sql-ledger-httpd.conf</pre>
59 Create a file 'sql-ledger-httpd.conf' in /etc/httpd and copy the next part
63 AddHandler cgi-script .pl
64 Alias /sql-ledger/ /var/www/sql-ledger/
65 <Directory /var/www/sql-ledger>
66 Options ExecCGI Includes FollowSymlinks
69 <Directory /var/www/sql-ledger/users>
72 </Directory></pre>
73 replace '/etc/httpd' and '/var/www' with the appropriate directories.
76 <p><li><h4>users/members : Permission denied</h4>
77 Your webserver must have write access to the users directory.
78 If your server runs as user/group 'apache:apache' then set the
79 users directory to owner/group apache:apache.
81 # chown -R apache:apache users</pre>
84 <p><li><h4>Dataset newer than version</h4>
85 You are trying to use an older version with a dataset which was
86 created with a newer version.
89 <p><li><h4>PDF option not working</h4>
90 Check if you have latex and pdflatex installed.
93 <p><li><h4>Apache 2.0 "error 500"</h4>
94 Some of the early versions of Apache 2.0 (< patchlevel 44) had a rewrite engine
95 which decoded escaped strings. This created a lot of problems and I worked
96 around it by escaping strings twice.
97 If you get a server 500 error 'filename too long' or if collapsed menus
98 don't expand you may have to adjusted the following code in
99 SL/Form.pm and change the number (44) on line 84.
101 # for Apache 2 we escape strings twice
102 if (($ENV{SERVER_SIGNATURE} =~ /Apache\/2\.(\d+)\.(\d+)/) && !$beenthere) {
103 $str = $self->escape($str, 1) if $2 < 44;
107 <p><li><h4>IDENT Authentication failed for user "sql-ledger"</h4>
108 Edit pg_hba.conf and change authentication to
111 local all trust</pre>
113 The file is in the 'data' directory of your postgresql installation.
114 This is different with every distribution so look for it.
116 # find / -name 'pg_hba.conf'</pre>
119 <p><li><h4>DBD-Pg for Mandrake 9.0</h4>
120 Mandrake did not package a compiled DBD-Pg package again, so install DBD-Pg
121 from the source package.
122 Install perl-DBD-Pg-1.01-4mdk.i586.rpm from the 'contrib' area.
123 (Mandrake / 9.0 / contrib / RPMS)
126 <p><li><h4>LaTeX error</h4>
127 If for some reason LaTeX produces an error message check for strange
128 characters in your account description and parts description
129 and use \usepackage[latin1]{inputenc} in the preamble.
132 <p><li><h4>LaTeX templates</h4>
133 If you don't want to edit tex code by hand,
134 you could use Lyx, Abiword, or any WYSIWYG editor capable of exporting
136 To do that you must change the tokens for the variables <% and %> to something
137 like << and >>. % is the comment character in tex. There is also a
138 pagebreak block which must be commented out.
139 When you are done with the changes
140 replace << and >> with <% and %> and uncomment the pagebreak block.
142 <p>LaTeX is difficult but it also offers a much superior environment
143 to produce professionally looking forms in postscript and PDF format.
144 Unfortunately with all that power there is also a steep learning curve.
148 pass terminal=mozilla when you start w3m
150 $ w3m -F http://localhost/sql-ledger/login.pl?terminal=mozilla</pre>
152 To use without frames
154 $ w3m http://localhost/sql-ledger/login.pl?terminal=lynx</pre>
156 <p><li><h4>PDF option disappeared</h4>
157 Edit sql-ledger.conf and set $latex = 1;
158 <br>sql-ledger.conf is perl code, check if it compiles, if it does not,
159 the internal defaults are used which turn off $latex, hence no PDF option.
161 <p><li><h4>SQL-Ledger installation Mac Os X 10.3 (Panther)</h4>
162 Paul J. Teeter put together
163 <a href="http://paulteeter.net/writing/technical/howto-sql-ledger-osx.htm">
164 installation instructions</a> to run SL on a Mac.
165 <br>The instructions are for SL 2.2 but the will work for any of the later
168 <p><li><h4>Installation on Windows (WIN32)</h4>
170 <li>install Apache, perl,
171 <a href=http://techdocs.postgresql.org/guides/InstallingOnWindows>Postgres</a>
172 or Oracle, DBI and the appropriate DBD
174 <br>if you can't compile DBD-Pg here is a precompiled
175 <a href=http://www.edmund-mergl.de/export/>DBD-Pg module</a>
176 <li>download the latest version of <a href=/cgi-bin/nav.pl?page=source/index.html&title=Download>SQL-Ledger</a>
177 <li>extract the files to c:\apache\sql-ledger
178 <li>run 'perl shebang' to change the first line of the scripts. If perl
179 is not in c:\perl\bin' change '#!c:\\perl\\bin\\perl' to the location where
181 <li>edit c:\apache\conf\httpd.conf and add
183 Alias /sql-ledger/ "c:/apache/sql-ledger/"
184 <Directory "c:/apache/sql-ledger">
186 AddHandler cgi-script .pl
192 <Directory "c:/apache/sql-ledger/users">
199 <li>start Postgres|Oracle|DB2
200 <li>connect to http://localhost/sql-ledger/admin.pl and setup users
202 <li>connect to http://localhost/sql-ledger/login.pl and login
206 <p><li><h4>Installation on Windows /w cygwin</h4>
208 <li>install <a href=http://sources.redhat.com/cygwin/>cygwin</a>
209 Apache, perl, postgres, gcc and lynx
210 <li>install <a href=http://search.cpan.org/search?module=DBI>DBI</a>
211 <li>tar zxvf DBI-1.30.tar.gz
215 <li>install <a href=http://search.cpan.org/search?dist=DBD-Pg>DBD-Pg</a>
216 <li>tar -zxvf DBD-Pg-1.13.tar.gz
217 <li>export POSTGRES_INCLUDE=/usr/include/postgresql
218 <li>export POSTGRES_LIB=/usr/lib/postgresql
222 <li>edit /etc/apache/httpd.conf and add
224 AddHandler cgi-script .pl
225 Alias /sql-ledger/ /var/www/sql-ledger/
226 <Directory /var/www/sql-ledger>
230 <Directory /var/www/sql-ledger/users>
235 <li>install SQL-Ledger
238 <li>download <a href=/cgi-bin/download.pl?setup.pl>setup.pl</a> and save the file
239 in /var/www/sql-ledger
240 <li>cd /var/www/sql-ledger
244 <p><li><h4>What do I enter for the language</h4>
245 If you use English, nothing, if you want to use a foreign language for
246 the login screen and admin stuff enter the language code, this is the
247 directory in the locale directory.
250 <p><li><h4>printing to a printer</h4>
251 Printers are defined in sql-ledger.conf
254 %printers = ( 'Default' => 'lpr', 'Color' => 'lpr -PEpson' );</pre>
256 Check in your /etc/printcap file for the names of available printers.
258 <p>If you have LaTeX installed set
260 $latex = 1</pre> in sql-ledger.conf
262 <p>To send the document to the printer check the "Postscript" or "PDF" format,
263 enter the number of copies and click on the "Print" button.
265 <p>The printer you enter in your preferences is the default printer.
266 You can choose any other available printer. This makes it possible
267 to print from anywhere on the network to any printer.
269 <p>Note: html format is for screen preview. Use the "Print" option from your
270 browser to print to a printer.
273 <p><li><h4>Using samba to send printjobs to a printer attached to a Windows XP workstation</h4>
274 The next part applies to roll your own printfilters only. If you use CUPS or
275 LPRng your milage may vary but you can still use this as a guide how it works.
276 I use the printer 'Epson' as an example which is
277 attached to a XP workstation called Raven, no password to log on.
280 /etc/printcap entry on the server which runs lpd
285 :sd=/var/spool/output/epson:\
286 :if=/usr/libexec/lpr/epson/prnfilter:\
288 # end of entry in /etc/printcap
291 # pnrfilter shell script
293 # Filter for Epson Stylus
295 PATH="$PATH:/usr/local/bin"
299 first_line=`echo $tmp | cut -b1-2 | sed -n '1p'`
301 first_chr=`expr "$first_line" : '\(.\)'`
302 first_two=`expr "$first_line" : '\(..\)'`
305 if [ "$first_two" = "%!" ]; then # Postscript file
306 gs @st640p.upp -dSAFER -dNOPAUSE -q -sOutputFile=/tmp/$$ -
310 echo -n "^L" >> /tmp/$$
311 smbclient '\\Raven\Epson' "" -c 'printmode text'
314 smbclient '\\Raven\Epson' "" -P -c "print /tmp/$$"
320 rewindstdin is a small program to rewind the filehandle for STDIN
321 save the next part up to EOF to a file rewindstdin.c and compile
323 #include <sys/types.h>
324 #include <unistd.h>
328 if( lseek(0,0,0) == 0 ){
336 compile to an executable
338 gcc -o /usr/local/bin/rewindstdin rewindstdin.c
342 <p><li><h4>beginning balances</h4>
343 Add a GL Journal entry and enter the beginning balance for your accounts.
344 Beginning balances are the balances from your last balance sheet. If you also
345 add open invoices to account for COGS for inventory, add the invoices
346 and make the appropriate adjustments.
349 <p><li><h4>establish a beginning inventory</h4>
350 add the parts with a vendor invoice. Use the <b>real cost</b> for the items,
351 not zero. If you use zero cost then the cost of goods will be zero when you
355 <p><li><h4>Assemblies</h4>
356 Assemblies are manufactured goods assembled from parts, services and
357 assemblies. Because you do not buy assemblies you 'stock assemblies' by
358 adding assembled units to your inventory. The quantity for individual parts
359 is reduced and the quantity for the assembly increased. To disassemble an
360 assembly you simply return the parts to inventory by entering a negative
361 quantity for the number of assemblies to stock.
364 <p><li><h4>customizing SQL-Ledger</h4>
365 The <a href=/cgi-bin/nav.pl?page=feature/api.html&title=Application%20Interface>application interface</a>
366 consists of a global and private interface.
369 <p><li><h4>DBD-Pg not installed</h4>
371 Most modern distributions now package DBD-Pg. If it is
372 not packaged follow this recipe to get it working.
375 <li>check if you have the header files for PostgreSQL
376 <br>$ find / -name 'libpq-fe.h'
377 <br>if nothing shows up install the development package for PostgreSQL
378 <li>download and untar DBD-Pg
379 <li>set the environment variables POSTGRES_LIB and POSTGRES_INCLUDE
380 <li>cd to DBD-Pg directory
382 <br>$ perl Makefile.PL
385 <br>if all went well su to root
391 <p><li><h4>login.pl has compilation error</h4>
393 This could be because of a missing configuration file in the users directory
395 <p>check the permission for the users directory. The directory must be
396 set writeable for the webserver. If your webserver runs ias user/group
397 nobody.nogroup set the directory to
399 drwx--x--x 2 nobody nogroup 1024 May 26 16:49 users
403 drwxrwx--x 2 johndoe nogroup 1024 May 26 16:49 users</pre>
406 <p><li><h4>script not executing, shows in browser instead</h4>
410 AddHandler cgi-script .pl</pre>
411 in your httpd.conf file.
414 <p><li><h4>unknown terminal!</h4>
415 the frontend script couldn't figure out which browser you are using
416 <p>include the terminal variable on the URL
418 http://localhost/sql-ledger/login.pl?terminal=lynx</pre>
419 Valid terminal variables are lynx and mozilla
422 <p><li><h4>permission denied</h4>
424 Check if your web server has write permission to write to the following
425 files and directories:
431 # chown nobody:nogroup users templates users/members
435 <p><li><h4>permission denied to access tables</h4>
436 The user you entered in the "Database section" must be a valid
437 database user who has rights to access the tables.
439 <p>If the tables are owned by 'joe' and you enter 'mary' as the dba
440 you might run into this problem if mary doesn't have the rights to
441 access tables owned by joe.
444 <p><li><h4>html and graphics files don't show up on screen</h4>
446 Enable Includes and FollowSymlinks Options in your httpd.conf file
448 <Directory /usr/local/sql-ledger>
449 Options ExecCGI Includes FollowSymlinks
454 <p><li><h4>Can I use mySQL</h4>
456 mySQL lacks certain features required by SQL-Ledger.
459 <p><li><h4>switch display to a foreign language</h4>
461 Load your preferences and select the language.
462 <br>Language selection is in accordance to
463 <a href=http://www.unece.org/cefact/locode/service/main.htm>
464 ISO 3166-1</a> standards.
467 <p><li><h4>Text shows in English when I use a foreign language</h4>
469 This is because the corresponding hash entry is missing.
470 Add the missing text in the locale/cc/all or locale/cc/missing
471 file and run 'perl locales.pl' from the command line to rebuild
472 the individual files.
474 <br>cc refers to the country code.
477 <p><li><h4>switch to a foreign language for the login and admin screen</h4>
479 Edit sql-ledger.conf and enter the code for the $language variable
481 $language = "de";</pre>
483 <p>This is a global change and applies to all logins, individual settings
484 may be changed by setting the language in your Preferences.
492 <h1>SQL-Ledger security</h1>
496 <li>The security features built into SQL-Ledger provide encrypted passwords
497 and access control which makes it fairly safe out of the box to run even in
499 Some precautions which are out of our control must be taken though.
500 It matters where you install SL and how you configure your web server and
506 /usr/local/vh/www <- DocumentRoot for virtual host
507 /usr/local/vh/sql-ledger <- Alias for sql-ledger
508 /usr/local/vh/users <- users directory out of reach
510 <hr width=60% align=left>
511 /usr/local/vh/www <- DocumentRoot for virtual host
512 /usr/local/vh/www/sql-ledger <- Alias for sql-ledger
513 /usr/local/vh/www/sql-ledger/users <- users configuration files and tmp space
515 <Directory /usr/local/vh/www/sql-ledger/users> <- disable webserver access
516 Order Deny,Allow for users directory
522 The location for the users directory can be specified in sql-ledger.conf
524 <p><li>Set permission for the users and templates directory to 711
526 <p><li>If you do not want anyone to change the templates with the built-in
527 editor set the files in templates/directory/ to read only or disable
528 the menu item to edit the templates.
530 <p><li>You may setup a read-only environment if you disable the menu items
531 to add data. i.e 'Add Transaction' if unchecked you will not be able to add
532 a transaction or repost a transaction. You may look at it but nothing else.
534 <p><li>There are various settings for audit control and you may disable
535 reposting entirely or up to a certain date.
537 <p><li>For PostgreSQL you may also set who has access to the server in the file
539 <br>Authentication crypt does not work because not all SQL servers
540 accept encrypted passwords.
542 <p><li>in addition you can secure the tables from unauthorized access by
543 setting up a different database user and GRANT rights. For instance,
544 users without DELETE rights will still be able to use the program, change
545 customers and vendors, add transactions but will not be able to delete or
547 <br>To lock all the tables to create a RO system GRANT SELECT rights only.
549 <p><li>Other security options include a secure shell, your webserver's
550 authentication system, SSL, encrypted tunnels, ...