lineitems not printing
Templates designed on a *NIX platform have linefeeds only and LaTeX
won't process the lineitems on a Windows or Mac platform which
require CRLF line endings. To adjust
the templates to your platform simply load the template in an editor
and save it. This only applies to the TeX templates.
UTF-8 character encoding
Most of the translations are in ISO format. To convert the translations
change directory to locale/cc and convert the files with iconv to UTF-8.
You should also convert the COAs too and make sure you select UTF-8
encoding when you setup a new dataset.
characterset problems
If you have problems displaying the correct characterset try adding
AddDefaultCharset On
in your httpd.conf file.
About installation
The easiest is to use the setup.pl script as root.
You don't need to know very much about your system, just login as root,
run 'perl setup.pl' and follow the prompts.
setup.pl does not check for missing software packages and it is your
responsibilite to make sure you have the required software
installed either from source or from a package supplied with your distro.
Requirements are clearly indicated in the README file and on the
download page.
cannot create function
- either run createlang and install the plpgsql language handler or
install yourself. For more information how to do that, visit
PostgreSQL and
read the interactive documentation for procedural languages.
- load admin.pl
- unlock the system
- login
The requested URL /sql-ledger/admin.pl was not found
Your webserver doesn't know where to find the script. Most commonly this
is from distributions hiding webserver configuration files in different
locations or files and setup.pl wasn't able to configure the location for
you. Find out which file (httpd.conf, httpdcommon.conf, ...)
controls your webserver configuration and add
# SQL-Ledger
Include /etc/httpd/sql-ledger-httpd.conf
Create a file 'sql-ledger-httpd.conf' in /etc/httpd and copy the next part
into the file.
AddHandler cgi-script .pl
Alias /sql-ledger/ /var/www/sql-ledger/
<Directory /var/www/sql-ledger>
Options ExecCGI Includes FollowSymlinks
</Directory>
<Directory /var/www/sql-ledger/users>
Order Deny,Allow
Deny from All
</Directory>
replace '/etc/httpd' and '/var/www' with the appropriate directories.
users/members : Permission denied
Your webserver must have write access to the users directory.
If your server runs as user/group 'apache:apache' then set the
users directory to owner/group apache:apache.
# chown -R apache:apache users
Dataset newer than version
You are trying to use an older version with a dataset which was
created with a newer version.
PDF option not working
Check if you have latex and pdflatex installed.
Apache 2.0 "error 500"
Some of the early versions of Apache 2.0 (< patchlevel 44) had a rewrite engine
which decoded escaped strings. This created a lot of problems and I worked
around it by escaping strings twice.
If you get a server 500 error 'filename too long' or if collapsed menus
don't expand you may have to adjusted the following code in
SL/Form.pm and change the number (44) on line 84.
# for Apache 2 we escape strings twice
if (($ENV{SERVER_SIGNATURE} =~ /Apache\/2\.(\d+)\.(\d+)/) && !$beenthere) {
$str = $self->escape($str, 1) if $2 < 44;
}
IDENT Authentication failed for user "sql-ledger"
Edit pg_hba.conf and change authentication to
local all trust
The file is in the 'data' directory of your postgresql installation.
This is different with every distribution so look for it.
# find / -name 'pg_hba.conf'
DBD-Pg for Mandrake 9.0
Mandrake did not package a compiled DBD-Pg package again, so install DBD-Pg
from the source package.
Install perl-DBD-Pg-1.01-4mdk.i586.rpm from the 'contrib' area.
(Mandrake / 9.0 / contrib / RPMS)
LaTeX error
If for some reason LaTeX produces an error message check for strange
characters in your account description and parts description
and use \usepackage[latin1]{inputenc} in the preamble.
LaTeX templates
If you don't want to edit tex code by hand,
you could use Lyx, Abiword, or any WYSIWYG editor capable of exporting
latex code.
To do that you must change the tokens for the variables <% and %> to something
like << and >>. % is the comment character in tex. There is also a
pagebreak block which must be commented out.
When you are done with the changes
replace << and >> with <% and %> and uncomment the pagebreak block.
LaTeX is difficult but it also offers a much superior environment
to produce professionally looking forms in postscript and PDF format.
Unfortunately with all that power there is also a steep learning curve.
W3M
pass terminal=mozilla when you start w3m
$ w3m -F http://localhost/sql-ledger/login.pl?terminal=mozilla
To use without frames
$ w3m http://localhost/sql-ledger/login.pl?terminal=lynx
PDF option disappeared
Edit sql-ledger.conf and set $latex = 1;
sql-ledger.conf is perl code, check if it compiles, if it does not,
the internal defaults are used which turn off $latex, hence no PDF option.
SQL-Ledger installation Mac Os X 10.3 (Panther)
Paul J. Teeter put together
installation instructions to run SL on a Mac.
The instructions are for SL 2.2 but the will work for any of the later
releases too.
Installation on Windows (WIN32)
- install Apache, perl,
Postgres
or Oracle, DBI and the appropriate DBD
module
if you can't compile DBD-Pg here is a precompiled
DBD-Pg module
- download the latest version of SQL-Ledger
- extract the files to c:\apache\sql-ledger
- run 'perl shebang' to change the first line of the scripts. If perl
is not in c:\perl\bin' change '#!c:\\perl\\bin\\perl' to the location where
your perl binary is.
- edit c:\apache\conf\httpd.conf and add
Alias /sql-ledger/ "c:/apache/sql-ledger/"
<Directory "c:/apache/sql-ledger">
AllowOverride All
AddHandler cgi-script .pl
Options +ExecCGI
Order Allow,Deny
Allow from All
</Directory>
<Directory "c:/apache/sql-ledger/users">
Order Deny,Allow
Deny from All
</Directory>
- start Apache
- start Postgres|Oracle|DB2
- connect to http://localhost/sql-ledger/admin.pl and setup users
and datasets
- connect to http://localhost/sql-ledger/login.pl and login
Installation on Windows /w cygwin
What do I enter for the language
If you use English, nothing, if you want to use a foreign language for
the login screen and admin stuff enter the language code, this is the
directory in the locale directory.
printing to a printer
Load admin.pl and edit the users. Enter the printer command in the 'Printer'
field. Check in your /etc/printcap file for the name of available printers.
lpr -P<printer>
Edit sql-ledger.conf and set
$latex = 1
LaTeX must be installed for this to work.
To send the document to the printer check the "Postscript" or "PDF" format,
enter the number of copies and click on the "Print" button.
The printer field is available only when you edit the user's
preferences with admin.pl.
Note: html format is for screen preview. Use the "Print" option from your
browser to print to a printer.
Using samba to send printjobs to a printer attached to a Windows XP workstation
The next part applies to roll your own printfilters only. If you use CUPS or
LPRng your milage may vary but you can still use this as a guide how it works.
I use the printer 'Epson' as an example which is
attached to a XP workstation called Raven, no password to log on.
/etc/printcap entry on the server which runs lpd
epson:Epson\
:sh:\
:lp=/dev/null:\
:sd=/var/spool/output/epson:\
:if=/usr/libexec/lpr/epson/prnfilter:\
# end of entry in /etc/printcap
# pnrfilter shell script
#!/bin/sh
# Filter for Epson Stylus
PATH="$PATH:/usr/local/bin"
#read first_line
read tmp
first_line=`echo $tmp | cut -b1-2 | sed -n '1p'`
first_chr=`expr "$first_line" : '\(.\)'`
first_two=`expr "$first_line" : '\(..\)'`
rewindstdin
if [ "$first_two" = "%!" ]; then # Postscript file
gs @st640p.upp -dSAFER -dNOPAUSE -q -sOutputFile=/tmp/$$ -
else
# text file
cat > /tmp/$$
echo -n "^L" >> /tmp/$$
smbclient '\\Raven\Epson' "" -c 'printmode text'
fi
smbclient '\\Raven\Epson' "" -P -c "print /tmp/$$"
rm /tmp/$$
# EOF
rewindstdin is a small program to rewind the filehandle for STDIN
save the next part up to EOF to a file rewindstdin.c and compile
#include <sys/types.h>
#include <unistd.h>
extern int errno;
main()
{
if( lseek(0,0,0) == 0 ){
errno = 0;
}
return( errno );
}
# EOF
compile to an executable
gcc -o /usr/local/bin/rewindstdin rewindstdin.c
beginning balances
Add a GL Journal entry and enter the beginning balance for your accounts.
Beginning balances are the balances from your last balance sheet. If you also
add open invoices to account for COGS for inventory, add the invoices
and make the appropriate adjustments.
establish a beginning inventory
add the parts with a vendor invoice. Use the real cost for the items,
not zero. If you use zero cost then the cost of goods will be zero when you
sell the item.
Assemblies
Assemblies are manufactured goods assembled from parts, services and
assemblies. Because you do not buy assemblies you 'stock assemblies' by
adding assembled units to your inventory. The quantity for individual parts
is reduced and the quantity for the assembly increased. To disassemble an
assembly you simply return the parts to inventory by entering a negative
quantity for the number of assemblies to stock.
customizing SQL-Ledger
The application interface
consists of a global and private interface.
DBD-Pg not installed
Most modern distributions now package DBD-Pg. If it is
not packaged follow this recipe to get it working.
- check if you have the header files for PostgreSQL
$ find / -name 'libpq-fe.h'
if nothing shows up install the development package for PostgreSQL
- download and untar DBD-Pg
- set the environment variables POSTGRES_LIB and POSTGRES_INCLUDE
- cd to DBD-Pg directory
as ordinary user
$ perl Makefile.PL
$ make
$ make test
if all went well su to root
# make install
- remove DBD-Pg
login.pl has compilation error
This could be because of a missing configuration file in the users directory
check the permission for the users directory. The directory must be
set writeable for the webserver. If your webserver runs ias user/group
nobody.nogroup set the directory to
drwx--x--x 2 nobody nogroup 1024 May 26 16:49 users
or
drwxrwx--x 2 johndoe nogroup 1024 May 26 16:49 users
script not executing, shows in browser instead
Add
AddHandler cgi-script .pl
in your httpd.conf file.
unknown terminal!
the frontend script couldn't figure out which browser you are using
include the terminal variable on the URL
http://localhost/sql-ledger/login.pl?terminal=lynx
Valid terminal variables are lynx and mozilla
permission denied
Check if your web server has write permission to write to the following
files and directories:
users/
templates/
users/members
# chown nobody:nogroup users templates users/members
permission denied to access tables
The user you entered in the "Database section" must be a valid
database user who has rights to access the tables.
If the tables are owned by 'joe' and you enter 'mary' as the dba
you might run into this problem if mary doesn't have the rights to
access tables owned by joe.
html and graphics files don't show up on screen
Enable Includes and FollowSymlinks Options in your httpd.conf file
<Directory /usr/local/sql-ledger>
Options ExecCGI Includes FollowSymlinks
</Directory>
Can I use mySQL
mySQL lacks certain features required by SQL-Ledger.
switch display to a foreign language
Load your preferences and select the language.
Language selection is in accordance to
ISO 3166-1 standards.
Text shows in English when I use a foreign language
This is because the corresponding hash entry is missing.
Add the missing text in the locale/cc/all or locale/cc/missing
file and run 'perl locales.pl' from the command line to rebuild
the individual files.
cc refers to the country code.
switch to a foreign language for the login and admin screen
Edit sql-ledger.conf and enter the code for the $language variable
$language = "de";
This is a global change and applies to all logins, individual settings
may be changed by setting the language in your Preferences.