Problems with sql-ledger balance

stevegreen2008 wrote on Saturday, July 19, 2008:

I am working on an installation of OpenEMR for my wife’s pediatrics practice.  I have worked through many of the issues (XMLRPC errors, not printing HCFA forms, PostgreSQL authentication issues, etc.), but there is one that I can not seem to figure out.   When invoices are posted to sql-ledger, they are sent as positive numbers.  When payments are sent to sql-ledger, they are sent as negative numbers.  This makes sense to me, since the negative payments would subtract from the positive charges, resulting in a zero balance.  However, when I look in sql-ledger (and when the balance appears in the patient summary), the balance is double the charges.  It looks like sql-ledger is subtracting the negative payments, which adds them to the charges, resulting in double the balance.  Does anyone have any ideas on why this is happening or how to fix it?   Thanks, and sorry if this is a repeat question, but I couldn’t find any mention of it in past posts.   My setup is:

Ubuntu Server 8.04
Apache2 (2.28)
MySQL5 (5.051a-3ubuntu5.1)
PHP5 (5.2.4-2ubuntu5.2)
Perl5 (5.8.8)
OpenEMR 2.8.3
Sql-ledger 2.8.16
PostgreSQL 8.3 (8.3.3 on x86-64-pc-Linux-gnu)
freeB 0.13

Thanks,
Steve

stevegreen2008 wrote on Tuesday, July 29, 2008:

Well, I finally figured it out.   I dug out my Accounting 101 book, and realized that it was the charges (invoiced items), not the payments that were being charged(debited and credited) incorrectly.  I finally traced these back to the ws_server.pl.   I had already changed this file several times because I was using sql-ledger 2.8 rather than 2.6, but I had not realized I needed to change it for adding an invoice to sql-ledger as well.  Finally I looked in CVS and realized that all of this work had already been done!  There was already a version of ws_server.pl for 2.8.  I replaced mine with this file and now I have no problem with the balances in sql_ledger or OpenEMR.  On to customization!

Thanks,
Steve