- #### Printing to a Printer from a Windows Server

  There are several obstacles to printing from a web appliction that was written for Linux or UNIX in Windows. These include:

  - Lack of Postscript support in the printing subsystem. To resolve this, you must install Ghostscript and Gsview. The latter package provides a utility called gsprint that will allow you to print Postscript on your Windows printer.
  - The fact that most Windows software, including gsprint, tends to print output that will cause the web server to crash. The winprint.bat included with this distribution corrects this problem. To use the winprint.bat solution, configure your printers in your ledger-smb.conf as "winprint.bat printer-name." If you omit the printer name, the default printer will be used.
  - Windows does not allow you to set up system printers that all users can access. Thus the web server often doesn't have access to the printers you have set up. To correct this issue, follow the steps at http://support.microsoft.com/kb/q184291/.

- #### Error on converting from SQL-Ledger: ERROR: column "chart_id" contains null values

  SQL-Ledger does not enforce a NOT NULL constraint on the chart_id field in the acc_trans table. Consequently, it is possible in cirtain circumstances to insert transactions into the database with invalid information including NULL chart_id's. When this occurs, normally the Chart of Accounts and Trial Balance will fail to balance. So this is a serious problem with data integrity. LedgerSMB prevents this by adding the NOT NULL constraing but this can cause prevent people from migrating when they have invalid data in their databases.
  If you encounter an error like this, the first thing to do is seek technical support, regardless of whether or not you wish to continue the migration. In general the providers of support for LedgerSMB and SQL-Ledger should all be able to be of some assistance. Unfortunately, since this problem involves information loss, no solution can be automated without invalidating your accounting information.

- #### SELinux

  http://fedora.redhat.com/docs/selinux-faq-fc3/index.html

  modify `/etc/selinux/conf` and set `SELINUX=permissive`

  use `audit2allow`, add the following to `policy.conf`, then run `make reload`

  #line 83
  allow httpd_sys_script_t port_type:{ tcp_socket udp_socket } { send_msg recv_msg };
  allow httpd_sys_script_t sysctl_kernel_t:dir search;
  allow httpd_sys_script_t sysctl_t:dir search;
  allow httpd_sys_script_t tmp_t:sock_file write;
  allow httpd_sys_script_t httpd_sys_content_t:lnk_file read;
  allow httpd_sys_script_t sysctl_kernel_t:file read;
  allow httpd_sys_script_t unconfined_t:unix_stream_socket connectto;

- #### lineitems not printing

  Templates designed on a UNIX platform don't work on a DOS platform. To make them work load the template either with the builtin template editor or a text editor and save. Templates designed on a Windows platform have the same problem and won't work on a UNIX platform. Once you strip the ^M's the'll work just fine.

  Note too that most Linux and UNIX installations come with two utilities for making these conversions: unix2dos and dos2unix. Windows users can obtain these utilities as part of Cygwin.

- #### characterset problems

  If you have problems displaying the correct characterset try adding

      AddDefaultCharset On

  in your `httpd.conf` file.

- #### cannot create function

  1. Run: `createlang -U postgres plpgsql ledgersmb` to install the plpgsql language handler into the "ledgersmb" database. More information on this utility can be found at the interactive documentation at the PostgreSQL site.

- #### IDENT Authentication failed for user "ledger-smb"

  Edit pg_hba.conf and change authentication to

        local           all        all                         md5
        host            all        all       127.0.0.1/32      md5

  The file is often in the 'data' directory of your postgresql installation. In some distributions it may be in /etc/pgsql or a similar directory. A file search can be helpful when all else fails.

        # find / -name 'pg_hba.conf'

  WARNING! DO NOT just put a 'host all all trust' in pg_hba.conf unless you know what you are doing; that can introduce a pretty huge security hole.

- #### 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.

  LaTeX is somewhat complex to learn, initially, but offers a much superior environment to produce professional-looking forms in postscript and PDF format.

- #### Use without Frames

  To use without frames, add ?path=/bin/lynx to the login URL:

      http://localhost/ledger-smb/login.pl?path=/bin/lynx

- #### PDF option disappeared

  Edit ledgersmb.conf and set: latex = 1

- #### printing to a printer

  Printers are defined in ledgersmb.conf

      [printers]
      Default = lpr
      Color = lpr -PEpson

  Check in your /etc/printcap file for the names of available printers.

  If you have LaTeX installed set

        latex = 1

  in ledger-smb.conf

  Note: html data entry format is for screen preview. Use the "Print" option from your browser to print to a printer.

- #### 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.

- #### 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 the DBD-Pg directory

- #### script not executing, shows in browser instead

  Add

        AddHandler cgi-script .pl

  in your httpd.conf file.

- #### 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 entry in the .po file. Add the missing text the appropriate .po

- #### switch to a foreign language for the login and admin screen

  Edit ledger-smb.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.

# LedgerSMB security

      Typical setups:

      /usr/local/vh/www                   <- DocumentRoot for virtual host
      /usr/local/vh/ledger-smb            <- Alias for ledger-smb
      /usr/local/vh/users                 <- users directory out of reach

      /usr/local/vh/www                   <- DocumentRoot for virtual host
      /usr/local/vh/www/ledger-smb        <- Alias for ledger-smb
      /usr/local/vh/www/ledger-smb/users  <- users configuration files and tmp space

      <Directory /usr/local/vh/www/ledger-smb/users>  <- disable webserver access
        Order Deny,Allow                                 for users directory
        Deny from All
      </Directory>

The location for the users directory can be specified in ledger-smb.conf

- Set permission for the users and templates directory to 711

- If you do not want anyone to change the templates with the built-in editor set the files in templates/directory/ to read only or disable the menu item to edit the templates.

- You can set up a read-only environment if you disable the menu items to add data. i.e 'Add Transaction' if unchecked you will not be able to add a transaction or repost a transaction. You may look at it but nothing else.

- There are various settings for audit control and you may disable reposting entirely or up to a certain date. And with the audit trail enabled you can keep tab of who is doing what.

- For PostgreSQL you may also set who has access to the server in the file pg_hba.conf

- in addition you can secure the tables from unauthorized access by setting up a different database user and GRANT rights. For instance, users without DELETE rights will still be able to use the program, change customers and vendors, add transactions but will not be able to delete or repost transactions.
  To lock all the tables to create a RO system GRANT SELECT rights only.

- Other security options include a secure shell, your webserver's authentication system, SSL, encrypted tunnels, ...