Posts Tagged ledgersmb
Creating Ledgersmb Database Live & Test Environments
Warning: This setup can be dangerous if you forget which environment you are in you can cause damage to your LIVE environment.
Login to postgres as a superuser and use \l to list your databases
me@lsmbbox:~$ psql -U ledgersmb -h localhost Password for user ledgersmb: Welcome to psql 8.3.8, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit ledgersmb=> \l List of databases Name | Owner | Encoding ------------------+-----------+---------- jmits-5zero-live | ledgersmb | UTF8 ledgersmb | ledgersmb | UTF8 postgres | postgres | UTF8 template0 | postgres | UTF8 template1 | postgres | UTF8 (5 rows) \q
Identify your ledgersmb database. Mine is jmits-5zero-live
backup your live DB using pg_dump
me@lsmbbox:~$ pg_dump -U ledgersmb -h localhost jmits-5zero-live > jmits-5zero-live.sql
Create a new test database
createdb -T ledgersmb jmits-5zero-test
Restore you live backup into the test db
psql -U ledgersmb -h localhost jmits-5zero-test < jmits-5zero-live.sql
Goto the ledgersmb admin page and login
http://
Configure your user account to use the test db
Always check your environment when logging in to LedgerSMB and clicking the Version Link in the left hand side to display your DB environment:
Enabling Stylesheet & Template Editing of LedgerSMB on Ubuntu 9.04
Posted by james in Open Source Apps, Small Business Accounting on May 3, 2009
You have several places that templates exist in LedgerSMB
/var/lib/ledgersmb/css/ for the LedgerSMB user interface templates
and
/usr/share/ledgersmb/templates/demo for the Latex / HTML report output templates.
Run the following commands as root (or sudo command):
chown www-data:www-data /var/lib/ledgersmb/css/ -Rv
chown www-data:www-data /usr/share/ledgersmb/templates/demo -Rv
Installing LedgerSMB 1.2.18-1 on Ubuntu 9.04
Posted by james in Small Business Accounting on May 2, 2009
This post is a step by step guide to installing LedgerSMB 1.2.18-1 on Ubuntu 9.04.
Download ledgersmb_1.2.18-1_all.deb
# Install postgresql sudo apt-get install postgresql # Install the PDF / PS utilities sudo apt-get install texlive # Install Perl Dependencies sudo apt-get install libconfig-std-perl libmime-lite-perl \ liblocale-maketext-lexicon-perl libdbd-pg-perl \ libclass-std-perl libemail-date-format-perl \ libmime-types-perl # Install ledgersmb sudo dpkg -i ledgersmb_1.2.18-1_all.deb
Following is a copy and paste of the installation instructions from the install. I have made the successful steps formatted as code in blockquotes with my comments in bold
Click here for a step by step analysis of the install based on the official Debian.README
LedgerSMB – Changing Invoice to “Tax Invoice”
Posted by james in Open Source Apps, Small Business Accounting on January 1, 2009
This is done on Fedora 10. File paths may change depending on what install package or location you install to.
On Fedora 10 the path is LSMB_ROOT=/usr/share/ledgersmb
To maintain an orginal untouched set of templates you should always copy the demo templates away to a new folder and select this new folder as your default templates in the LedgerSMB admin control panel(see picture below).
Copy Demo Templates
cp -rv $LSMB_ROOT/templates/demo $LSMB_ROOT/templates/custom
if you do this as root you need to change the ownership to the apache user.
Enable Web Server Write Permissions to Custom Templates
On Fedora / Redhat
chown -Rv apache.apache $LSMB_ROOT/templates/custom
On Ubuntu / Debian
chown -Rv www-data.www-data $LSMB_ROOT/templates/custom
Configure Custom Templates

Changing Invoice to Tax Invoice
vi $LSMB_ROOT/templates/custom/invoice.tex
find \textbf{I N V O I C E}
and change it to
\textbf{TAX I N V O I C E}
vi $LSMB_ROOT/templates/custom/invoice.html
Find this
<th colspan=3>
<h4>I N V O I C E</h4>
</th>
and change it to
<th colspan=3>
<h4>TAX I N V O I C E</h4>
</th>
Note:
You can make these changes from the LedgerSMB Application Login at “System ==> Latex Templates ==> Invoice” and “System ==> HTML Templates ==> Invoice” respectively. However you would have to do the steps of copying the demo templates to a new directory and then setting the new templates as the “Use Templates” option in the Admin control panel.
Changing the LedgerSMB Letter Head Graphic
Posted by james in Open Source Apps, Small Business Accounting on December 31, 2008
Make a backup of the original demo templates
cp -rv /var/lib/ledgersmb/templates/demo /var/lib/ledgersmb/templates/template1 # on Ubuntu this was sudo cp -rv /etc/ledgersmb/templates/demo /etc/ledgersmb/templates/template1
Go into the LedgerSMB admin control panel and change the template from demo to whatever you named the new directory.
cd /var/lib/ledgersmb/templates/template1 # on ubuntu it's in /etc/ledgersmb/templates # backup your original files just in case cp logo.png logo.png.orig cp logo.eps logo.eps.orig
edit your new logo.png in Gimp to be something that you want e.g.

Save as logo.png
Also save as logo.eps
# copy new logo's into your custom templates directory cp logo.png logo.eps /etc/ledgersmb/templates/template1/
Done
LedgerSMB Installation on Fedora 10 Notes
Posted by james in Fedora, GNU/Linux, Open Source Apps, Small Business Accounting on December 31, 2008
Overview
Starting from Fedora 10 Live Installed to Harddisk.
This is a a record of the chronological steps with all the errors I encountered along the way. As such it is a kind of messy and in a as it happened style.
I will flesh these notes out as I have time. Email me if you have a question.
Install postgres
yum install postgresql-server
Install Latex
yum install texlive
Download and Install LedgerSMB
download the latest version of ledgersmb in noarch.rpm format
Install it.
rpm -Uvh ledgersmb-1.2.17-1.noarch.rpm
LedgerSMB Installation Errors
warning: ledgersmb-1.2.17-1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 8da0af10
error: Failed dependencies:
tetex-latex is needed by ledgersmb-1.2.17-1.noarch
perl-DBD-Pg is needed by ledgersmb-1.2.17-1.noarch
perl-Smart-Comments is needed by ledgersmb-1.2.17-1.noarch
perl-MIME-Lite is needed by ledgersmb-1.2.17-1.noarch
perl-Class-Std >= 0.0.8 is needed by ledgersmb-1.2.17-1.noarch
perl-Config-Std >= 0.0.4 is needed by ledgersmb-1.2.17-1.noarch
perl-Locale-Maketext-Lexicon >= 0.62 is needed by ledgersmb-1.2.17-1.noarch
Install dependencies
yum install tetex-latex perl-DBD-Pg perl-Smart-Comments \
perl-MIME-Lite perl-Class-Std \
perl-Config-Std yum install perl-Locale-Maketext-Lexicon
Install Dummy perl-Config-Std
Download and install the perl-Config-Std from http://dag.wieers.com/rpm/packages/perl-Config-Std/
(This is only so rpm -Uvh doesn’t complain about deps – see errors below).
Turn Postgres On
chkconfig postgresql on
service postgresql initdb
service postgresql start
Read and Follow the LedgerSMB Installation Instructions
vi /usr/share/doc/ledgersmb-1.2.17/INSTALL
Create the LedgerSMB user and DB
1st Attempt
[root@f10 jmcd]# createuser –no-superuser –createdb –no-createrole -U postgres –pwprompt –encrypted ledgersmb
Enter password for new role: LSMB_PASSWORD
Enter it again: LSMB_PASSWORD
createuser: could not connect to database postgres: FATAL: Ident authentication failed for user “postgres”
2nd Attempt
[root@f10 jmcd]# su – postgres
-bash-3.2$ createuser –no-superuser –createdb –no-createrole -U postgres –pwprompt –encrypted ledgersmb
Enter password for new role: LSMB_PASSWORD
Enter it again: LSMB_PASSWORD
-bash-3.2$ createdb -U ledgersmb -O ledgersmb ledgersmb
createdb: could not connect to database postgres: FATAL: Ident authentication failed for user “ledgersmb”
Change Authentication Method for Postgres
Backup pg_hba.conf before you begin.
cp /var/lib/pgsql/data/pg_hba.conf /root
vi /var/lib/pgsql/data/pg_hba.conf
Change ident sameuser to md5 in all options.
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
service postgresql restart
[root@f10 jmcd]# su - postgres
-bash-3.2$ createdb -U ledgersmb -O ledgersmb ledgersmb
Password: LSMB_PASSWORD
exit to root
Apply the LedgerSMB Postgres SQL Script
find the Pg-central script
rpm -q ledgersmb --list | grep Pg-central
/usr/share/ledgersmb/sql/Pg-central.sql
[root@f10 jmcd]# psql -U ledgersmb -d ledgersmb -f /usr/share/ledgersmb/sql/Pg-central.sql
Password for user ledgersmb: LSMB_PASSWORD
Should see the following:
BEGIN
psql:/usr/share/ledgersmb/sql/Pg-central.sql:8: NOTICE: CREATE TABLE will create implicit sequence "users_id_seq" for serial column "users.id"
psql:/usr/share/ledgersmb/sql/Pg-central.sql:8: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "users_pkey" for table "users"
psql:/usr/share/ledgersmb/sql/Pg-central.sql:8: NOTICE: CREATE TABLE / UNIQUE will create implicit index "users_id_key" for table "users"
CREATE TABLE
COMMENT
psql:/usr/share/ledgersmb/sql/Pg-central.sql:41: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "users_conf_pkey" for table "users_conf"
CREATE TABLE
COMMENT
COMMENT
COMMENT
INSERT 0 1
INSERT 0 1
CREATE FUNCTION
COMMENT
CREATE FUNCTION
COMMENT
psql:/usr/share/ledgersmb/sql/Pg-central.sql:76: NOTICE: CREATE TABLE will create implicit sequence "session_session_id_seq" for serial column "session.session_id"
psql:/usr/share/ledgersmb/sql/Pg-central.sql:76: NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "session_pkey" for table "session"
CREATE TABLE
COMMIT
Change Password for the LedgerSMB User
[root@f10 jmcd]# psql -U ledgersmb -d ledgersmb
Password for user ledgersmb: PASSWORD
Welcome to psql 8.3.5, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
ledgersmb=> UPDATE users_conf SET password = md5('LSMB_PASSWORD') WHERE id = 1;
UPDATE 1
ledgersmb=>\q
Edit the Apache Configuration to point to the correct location
open /etc/httpd/conf.d/ledgersmb.conf in vi
and find and replace WORKING_DIR with /usr/share/ledgersmb
service httpd reload
First Login to LedgerSMB Webpage
Open a browser and enter:
http://192.168.0.1:8888/ledgersmb/admin.pl
Browser Errors
Get a browser Server 500 error
Look in /var/log/httpd/error_log for cause
[Tue Dec 30 19:59:40 2008] [error] [client 192.168.0.2] Math::BigInt: couldn't load specified math lib(s), fallback to Math::BigInt::FastCalc at LedgerSMB/Form.pm line 36
[Tue Dec 30 19:59:43 2008] [error] [client 192.168.0.2] Can't locate Config/Std.pm in @INC (@INC contains: /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/local/lib/perl5/site_perl .) at LedgerSMB/Sysconfig.pm line 8.
[Tue Dec 30 19:59:43 2008] [error] [client 192.168.0.2] BEGIN failed--compilation aborted at LedgerSMB/Sysconfig.pm line 8.
[Tue Dec 30 19:59:43 2008] [error] [client 192.168.0.2] Compilation failed in require at /usr/share/ledgersmb/login.pl line 52.
[Tue Dec 30 19:59:43 2008] [error] [client 192.168.0.2] BEGIN failed--compilation aborted at /usr/share/ledgersmb/login.pl line 52.
[Tue Dec 30 19:59:43 2008] [error] [client 192.168.0.2] Premature end of script headers: login.pl
[Tue Dec 30 19:59:51 2008] [error] [client 192.168.0.2] Math::BigInt: couldn't load specified math lib(s), fallback to Math::BigInt::FastCalc at LedgerSMB/Form.pm line 36
Install Math::BigInt
yum install perl-Math-BigInt-GMP.i386
Try again
http://192.168.0.1:8888/ledgersmb/admin.pl
Get a browser Server 500 error
And again look in error_log
[Tue Dec 30 23:58:52 2008] [error] [client 192.168.0.2] Can't locate Config/Std.pm in @INC (@INC contains: /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/local/lib/perl5/site_perl .) at LedgerSMB/Sysconfig.pm line 8.
[Tue Dec 30 23:58:52 2008] [error] [client 192.168.0.2] BEGIN failed--compilation aborted at LedgerSMB/Sysconfig.pm line 8.
[Tue Dec 30 23:58:52 2008] [error] [client 192.168.0.2] Compilation failed in require at /usr/share/ledgersmb/login.pl line 52.
[Tue Dec 30 23:58:52 2008] [error] [client 192.168.0.2] BEGIN failed--compilation aborted at /usr/share/ledgersmb/login.pl line 52.
[Tue Dec 30 23:58:52 2008] [error] [client 192.168.0.2] Premature end of script headers: login.pl
Cause of above error is: can’t find Config/Std because the one above we installed was for perl 5.8.*
Install Perl Module Config::Std
Install CPAN
yum install perl-CPAN
Run CPAN and install Config::Std
perl -MCPAN -e shell
at cpan shell prompt
install Config::Std
http://192.168.0.1:8888/ledgersmb/admin.pl
It’s Working!
OK now it works (I get the admin login panel)
Configure a password for the postgres user
Now problem with admin.pl and me not knowing the postgres password so restore original auth settings for postgres and log in as postgres user and set a password.
I saved a copy of the original pg_hba.conf… so restore this and restart postgres
[root@f10 ledgersmb]# cp /var/lib/pgsql/data/pg_hba.conf /root/pg_hba.conf.smbl
[root@f10 ledgersmb]# cp /root/pg_hba.conf /var/lib/pgsql/data/
cp: overwrite `/var/lib/pgsql/data/pg_hba.conf'? y
[root@f10 ledgersmb]# service postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
Give postgres a password
[root@f10 ledgersmb]# su postgres
bash-3.2$ psql -d template1
Welcome to psql 8.3.5, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
template1=# ALTER USER postgres WITH PASSWORD 'POSTGRES_USER_PASSWORD';
ALTER ROLE
template1=#
Restore the ledgersmb conf file (with md5 password auth)
[root@f10 ledgersmb]# cp /root/pg_hba.conf.smbl /var/lib/pgsql/data/pg_hba.conf
cp: overwrite `/var/lib/pgsql/data/pg_hba.conf'? yes
[root@f10 ledgersmb]# service postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
Login to admin.pl and configure dataset and user
Now again go to admin.pl and create the dataset with the correct postgres user and password.
Normal user is ledgersmb and password is LSMB_PASSWORD
superuser is postgres password is POSTGRES_USER_PASSWORD
Next add a user specifying the dataset you created.
Open /etc/ledgersmb/ledgersmb.conf
and change
sendmail = /usr/bin/sendmail -t
to
sendmail = /usr/sbin/sendmail -t
Done
Current Reading or “Let’s get down to business”
Posted by james in GNU/Linux, IT Tips, Open Source Apps, Small Business Accounting on March 26, 2008
Hi Mum :)
These are the current titles I am ingesting.
The E-Myth Revisited – Michael Gerber
How to Grow Your Business by taking 3 Months Off – Louise Woodbury & William De Ora
How to Organize and Operate a Small Business in Australia – John English
As the economic landscape changes in Australia I feel it would be wise to be ready if, or when, a corporate restructure or downsize happens. One way that many who have been made redundant or suffered the loss of a job have continued is by starting their own businesses. Sometimes with great success. I kind of want to be ready so I’m trying to school myself. There is a lot involved, but hey, learning is fun.
Of particular interest to me is Systems and how they are applied in a business. Employees shouldn’t need to be rocket scientists… unless you make rockets. Systems help consistent quality standards to be achieved that can allow the business to service customers more effectively.
Also of note is all the open source applications that make the buy-in for running your own business very achievable. The downside is you need to know more about accounting etc so you can configure them to run correctly for Australian conditions.
I’m currently looking at LedgerSMB which has a very good invoice generating subsystem based on Latex. I had a look at GNUCash but the invoicing is still tied to GtkHTML and some very esoteric scheme programming which my mind can’t unravel enough to make it format reports correctly.
Anyway I have reading to do…
Change LedgerSMB Latex (PDF / PS) Paper size from Letter to A4
Posted by james in GNU/Linux, Open Source Apps, Small Business Accounting on March 12, 2008
Letter paper is 215.9 x 279.4
A4 paper is 210 x 297
So when you go to print you may have slight problems with page layout when printing A4 or exporting to PDF. The fix is as follows:
In each Latex template find the line near the top that has the letterpaper keyword
\usepackage[letterpaper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry}
Change it to be a4paper
\usepackage[a4paper,top=2cm,bottom=1.5cm,left=1.1cm,right=1.5cm]{geometry}
LedgerSMB Error! No GlobalDBH Configured or Could not Connect
Posted by james in GNU/Linux, Open Source Apps, Small Business Accounting on March 12, 2008
Error!
No GlobalDBH Configured or Could not Connect
Just had this error attempting to install LedgerSMB. In my case this was caused by having postgres-8.3 installed and then installing postgres-8.2 the second installation moved the tcp port to a non-standard port 5433.
Postgres-8.3 is the default version for Ubuntu 8.04, but LedgerSMB at the moment requires postgres-8.2
The solution:
apt-get remove –purge postgres-8.3
edit /etc/postgres/8.2/main/postgresql.conf and set the option “port = 5432″
Restart postgres *note don’t do a restart do a start and stop
/etc/init.d/postgres-8.2 stop
/etc/init.d/postgres-8.2 start
Of course you could simply edit ledgersmb.conf and change the [globaldb] section DBport value to be the port which Postgres 8.2 is running on.