we now support and recommend the stock sql-ledger
[openemr.git] / accounting / README.sql-ledger
blob8adbfdbbeb77cd9bf16c63dcdb72acd086c821c9
1                      Integrating SQL-Ledger with OpenEMR
2                               by Tekkno Genius
5 1. Install sql-ledger according to sql-ledger's instructions. Make sure it is
6 working before adding the support for openemr. Installation basically amounts
7 to untarring sql-ledger in a directory, creating an alias/virtual directory in
8 your web server, creating the sql-ledger user in the postgresql database, see
9 the sql-ledger README for the details:
11   http://www.sql-ledger.org/cgi-bin/nav.pl?page=source/readme.txt&title=README
13 OpenEMR configuration:
15 2. Create a sql-ledger user for openemr to post as. Bring up sql-ledger in
16 admin mode [http://localhost/sql-ledger/admin.pl]. Login as the sql-ledger
17 user. Create a dataset (database) for openemr to put its data (I called mine
18 openemr) and used the default set of books (accounting codes). Create a user
19 to use this dataset. I created a user called openemr. Note, this user is not a
20 postgresql user, it is a sql-ledger user. You see that you need to put a user
21 to log into postgresql as. Here I used the default sql-ledger user. Make sure
22 you select the Pg (postgresql) driver.
24 3.Edit the sql-ledger.conf file. Add the following to the default
25 sql-ledger.conf:
27   $oemr_ar_acc
28   $oemr_cash_acc
29   $oemr_due_days
30   $oemr_username
31   $oemr_services_partnumber
33 to the use vars section at the top 
35 Add the following also:
37 # Some constants relevant to OpenEMR import.
39 $oemr_username = 'openemr'; # sql-ledger user to post as
40 $oemr_ar_acc = '1200';      # account number for accounts receivable
41 $oemr_cash_acc = '1060';    # account number for checking (copay deposits)
43 # In SQL-Ledger you must create a services item for medical services
44 # before you do any OpenEMR billing. Specify its "part number" here:
46 $oemr_services_partnumber = 'MS';
48 # This is the number of days added to the OpenEMR transaction date to 
49 # produce the invoice due date when there is insurance. This affects the 
50 # patient portion of the outstanding balance shown in the OpenEMR patient 
51 # summary, and of course SQL-Ledger's aging reports and statements. 
53 $oemr_due_days = 40;
55 Note: $oemr_username is the same user you created in step 2.
57 Also note: A sample sql-ledger.conf including the above parameters is
58 included, however it may be incomplete from the standpoint of the current
59 SQL-Ledger release.
61 4. Either copy ws_server.pl to the sql-ledger directory or create a symbolic
62 link to the file in the sql-leder directory.
64 5. Edit the openemr/interface/globals.php and put the right data for the
65 following variables:
67 $sl_dbname = 'openemr';    // sql-ledger database name
68 $sl_dbuser = 'sql-ledger'; // sql-ledger database login name
69 $sl_dbpass = 'secret';     // sql-ledger database login password
71 Note: $sl_user is a postgresql user
72 $sl_dbname is the dataset you created in step 2.