[ic] 4.9.x and SQL-Ledger question

Mike Heins interchange-users@icdevgroup.org
Tue Aug 20 11:48:00 2002


Quoting Vlad Sedov (vlad@humbleguys.net):
> Hello - 
> 
> 
> Could someone point me to the right direction on setting up Interchange
> to work with SQL-ledger?
> 
> I have IC 4.9 cvs installed, and SQL-ledger, both on postgres.
> 
> I found the Vend module, but not sure what do to with it. 
> 

WARNING: It isn't ready for public installation yet. You can get
it done if you *really* know what you are doing. I somehow think this
will never be installable except by experts....

You will have to peruse the source code, notably Vend::Accounting::SQL_Ledger,
code/SystemTag/accounting.coretag, and CATROOT/etc/log_transaction.

The things it does:

    -- Enter sales order for any type of sale
    -- Enter invoice and payment if it is a realtime sale,
       i.e. payment was received via Vend::Payment::*.
    -- Create SQL-Ledger inventory table entries based
       on products and inventory tables

Basic steps:

1. Symlink the SQL-Ledger SL library directory to ICROOT/lib, i.e.:

    ln -s /usr/local/sql-ledger/SL  /usr/local/interchange/lib

2. Note your Postgres SQL-ledger database DSN, i.e. dbi:Pg:dbname=ledger or
   such.

3.  Place something like this in catalog.cfg:

Variable TRANSACTION_ACCOUNTING_SYSTEM   1
Accounting sql-ledger  Class           Vend::Accounting::SQL_Ledger
Accounting sql-ledger  link_table      customer
Accounting sql-ledger  base_url        http://bill.heins.net/sql-ledger
Accounting sql-ledger  assign_username 0
Accounting sql-ledger  inv_counter     products:invno
Accounting sql-ledger  username mike
Accounting sql-ledger  password XXXXXXXXXXX
Accounting sql-ledger  <<EOR
  countrycode  US
  company      Perusion
  currency     usd
  dateformat   mm-dd-yy
  dbconnect    dbi:Pg:dbname=ledger
  dbdriver     Pg
  dbname       ledger
  dboptions    "set DateStyle to \'POSTGRES, US\'"
  dbuser       apache
  email        mike@perusion.com
  name         "Mike Heins"
  numberformat "1,000.00"
  printer      lp
  signature    "Mike Heins\n+1.513.523.7621"
EOR

NoImport customer
Database customer customer.txt dbi:Pg:dbname=ledger

4. There are a multitude of possible defaults -- most notably the
ones that have to do with default account numbers when adding parts.

5. Update your UserDB setup to use customer numbers instead of
usernames for new accounts and logins:

UserDB    default    indirect_login  usernick
UserDB    default    assign_username 1
UserDB    default    sql_counter     userdb:custno

You will have to add a "usernick" field to the userdb table.

---------------

I have no doubt left some stuff out. If you have a production need, you might
consider engaging me or some other competent consultant to help you do this.

Good luck!

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

Nature, to be commanded, must be obeyed. -- Francis Bacon