SQL Ledger on Mac Os X 10.1.5
Jaume Teixi put together
installation instructions to run SL on a Mac.
Installation on Windows XP /w cygwin
Incorrect Dataset version
The dataset you are trying to use is not compatible with the version.
When you upgrade datasets use the same database user in the "Connect to"
field as the one listed in the Database section for the user.
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.
tex templates
If you don't want to dig into tex,
you could use Lyx, Abiword, or any WYSIWYG editor capable of exporting
tex code to edit the tex templates.
But first you must change the tokens for parameters <% 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.
Mandrake 8.2
Mandrake did not include the package "perl-DBD-Pg-1.01-1mdk.i586.rpm"
You can install the package from Mandrake 8.1
faxing invoices
You can fax invoices or orders with an email to fax gateway.
printing to printer
Setup a printer in the "Printer" field in the users preferences.
i.e lpr -Plaser
and set $latex = 1 in sql-ledger.conf
LaTeX must be installed for this to work.
To send the document to the printer check the "Postscript" format,
enter the number of copies and click on the "Print" button.
The printer can only be set via admin.pl (security reasons)
Note: html and PDF format is for screen preview only. Use your browser's
print function or the print command in your PDF viewer to print.
beginning balances
Add a GL entry to setup a beginning balance for your accounts. Use your
balance sheet. If you also want to add open invoices, add the invoices
and make the appropriate adjustments. Your balance sheet includes these
amounts!
cost for parts and service
the cost will be updated when you purchase goods and services.
To have an initial cost without having a purchase done use your monitor
or some other utulity and set the field lastcost.
establish a beginning inventory
add the parts with a vendor invoice
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
Redhat 7.0 Installation instructions
- Install apache1.3.12-25.i386.rpm
- Install perl5.6.0-9.i386.rpm
- Install postgresql-7.0.2-17.i386.rpm
- Install postgresql-server-7.0.2-17.i386.rpm
- Install postgresql-devel-7.0.2-17.i386.rpm (POSTGRES_INCLUDE)
- tar xvzf DBI-1.14.tar.gz
- cd DBI-1.14
- perl Makefile.PL
- make
- make install
- cd ..
- tar xvzf DBD-Pg-0.95
- cd DBD-Pg-0.95
- export POSTGRES_LIB=/usr/lib/pgsql
- export POSTGRES_INCLUDE=/usr/include/pgsql
- perl Makefile.PL
- make
- make install
- install SQL-Ledger
Some of the applications have newer versions however the installation
instructions remain the same. Just substitute the old version with a newer
version.
Debian Installation
The long version was provided by Gordon Haverland.
- You need to unpack the SQL-Ledger package (compressed tar archive)
someplace. Unpacking it in
/usr/local/www/sql-ledger.
Remember where you have unpacked it.
- SQL-Ledger requires that the PostgreSQL database be installed.
This is a very full-featured database, and has many associated
packages. SQL-Ledger requires version 7.0 or better. The name
of the basic package on Debian is postgresql. To find if you
already have postgresql installed, and if so what version, the
following command should work:
dpkg -l | grep -i 'ii postgresql '
A typical response would be:
ii postgresql 7.1.3-5 Object....[stuff deleted]
Indicating, that version 7.1.3 is installed (the -5 is a
Debian patch level). You can use dselect or apt-get to install
postgresql if you need to. You can visit the Debian maintainer's
page for much more information on related packages at
http://people.debian.org/~elphick/postgresql/
Older versions of Debian's PostgreSQL installation use a file
called postmaster.init, while newer versions use a file called
postmaster.conf, either residing in /etc/postgresql.
- SQL-Ledger requires a HTTP server (or daemon) which is capable of
handling CGI scripts. Apache is the one which is recommended,
version 1.3 or better. Debian calls the base package apache.
Debian has two alternative versions of Apache, one with mod-perl
(apache-perl) support compiled in, and the other with SSL
(secure sockets layer - apache-ssl) support. SQL-Ledger doesn't
require mod-perl or SSL support, but works with either if
you need it installed for other functions you have. Older versions
of Debian Apache installations, spread the configuration of the
server across 3 files (srm.conf, access.conf and httpd.conf).
Newer versions have consolidated all of this to httpd.conf.
- SQL-Ledger uses the Data Base Interface perl module for communication
with PostgreSQL. The CPAN (Comprehensive Perl Archive Network)
name for this module is DBI. Debian calls this module
libdbi-perl. You should probably deselect (or apt-get) the
Debian version of this module to minimize upgrading headaches in
the future.
- DBI requires the use of an implementation specific Data Base
Driver. In our case, we need the PostgreSQL specific one.
CPAN calls this module DBD::PG, Debian calls it libdbd-pg-perl.
You should use dselect (or apt-get) to install it.
- One more layer of Perl - PostgreSQL support is needed. Debian
calls this last package libpgperl. Use dselect or apt-get to
install it. (You should be able to install all 5 packages at
one time.)
- We need to allow your PostgreSQL database to accept queries
in a network manner. To do this, we need to change the value
of the TCPIP_SOCKET to 1. In newer
PostgreSQL installs, this variable will be someplace in
/etc/postgresql/postgreslq.conf (older installs will be
postmaster.init, same directory. Note: you shouldn't have
both files there.) Start up your favorite text editor, find
the line with that variable on it, change the "no" to a "yes",
and make sure the line isn't commented out (a "#" in front
of it on the same line).
- PostgreSQL has a set of users and passwords independent of
normal user logins. We need to set up a PostgreSQL user
to "own" the SQL-Ledger data (choose a name that makes sense
to you, it shouldn't be "root" or "postgres"). The (PostgreSQL)
program for doing this is called "createuser". To make this
SQL-Ledger owner user, we first need to "become" the PostgreSQL
superuser (on Debian, this is "postgres"), and then we will
run the createuser program. So, once we are logged in as root:
# su postgres
$ createuser -d SQL-Ledger_Owner
...
$ exit
#
As shown above, we then typed "exit" after createuser was done,
to stop being the "postgres" user. The "-d" switch (you called
also use "--createdb") specifies that this user can create
databases.
- We need to adjust the configuration of the HTTP server Apache
next. Older Apache installations (srm.conf, access.conf and
httpd.conf) need changes in srm.conf and httpd.conf. Newer
installations just need to edit /etc/apache/httpd.conf. First,
we need to instruct the server that files that end in ".pl"
are to be treated as "cgi-script"s (srm.conf if separate).
AddHandler cgi-script .pl
Second, we need to map our SQL-Ledger installation to be easy
for users to find it (in srm.conf if separate).
Alias /sql-ledger/ /usr/local/www/sql-ledger/
The "/" at the end of sql-ledger in both strings is important!
Next, we need to allow the server to execute files from those
directories, include things and follow links. This information
is in httpd.conf (old or new installations).
<Directory /usr/local/www/sql-ledger>
Options ExecCGI Includes FollowSymLinks
</Directory>
If we decided to put SQL-Ledger somewhere other than
/usr/local/www/sql-ledger, we would use different paths above.
- All the files in the "users" and "templates" subdirectories
of /usr/local/www/sql-ledger need to be owned by "www-data".
# cd /usr/local/www/sql-ledger
# chown www-data:www-data users templates users/members
You may get an "error" about users/members not existing. It
is safe to ignore this error.
- Restart the apache server.
/etc/init.d/apache restart
- From a browser, visit the URL
http://localhost/sql-ledger/admin.pl
- Login as the PostgreSQL user responsible for the SQL-Ledger
database you set up. Create a database and create
at least one user. (It's not a good idea to access your
SQL-Ledger data as the "owner" of the data on a regular basis.)
- Visit
http://localhost/sql-ledger/login.pl
and login as the user you created
SQL-Ledger and Windows
Thanks to Martin Lillepuu for a
writeup about how to prepare Windows for SQL-Ledger
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.
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 at filesystem level
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 the rights to access the tables.
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
No. mySQL does not support unions and sub-selects.
switch display to a foreign language
Load your preferences and select the language.
Language selection is in accordance to
ISO 3166 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 locales.pl to rebuild the individual files.
cc refers to the country code.
switch to a foreign language for the login and admin stuff
Edit sql-ledger.conf and enter the two letter code for the variable
$language