Archive for February, 2008

PBooks Progress

PBooks has come a long way in the past 6 months. The biggest developments have been in the business processes area, where we’ve included invoices, deposits, and transfer capabilities. More recently, I’ve personally been working on the overall code quality of PBooks, trying to make sure that the naming conventions are consistent (so that if one file is named invoice_view.xsl, there is no view_deposit.xsl file), good code documentation, and a solid data model.

Installation issues!

The community has spoken, and I’m listening. PBooks is too hard to install, no doubt about it. Although I haven’t done any explicit work on fixing this yet, I have been doing a lot of thinking about it. My concern was that if beginner developers started using PBooks, they would run into more serious problems with the unstable nature of PBooks, at least more serious than being unable to uninstall the software, and supporting the various installations would become a great burden. Inasmuch, it was “OK” in my mind that PBooks was difficult to install. Besides, there is still plenty of work to do on the application besides the installation process. What good is a crappy program even if it is easy to install?

Anyway, I’ve come to the conclusion that there are two main issues with the installation: the database and the folder layout. To remedy these issues, I’m planning to create a new database installation script and allow PBooks to be dropped into a web accessible directory and run. While that’s not the way I would do install a web application these days, that’s how a lot of web applications, like Wordpress, are installed. Along those lines, while I like everything to be modular, not all users have the liberty to install system-wide libraries (like from PEAR, for instance), so having a monolithic (everything incuded) distribution is needed. I’d like to keep everything modular on the development side and use a script to package it all up for distribution.

Oh yes, one more part to installation - an installation checker to inspect the server’s capabilities is needed to make sure that PBooks can actually run if it is installed.

The forums have been picking up in activity and I’m hoping that I’m able to help PHP-CODER to get PBooks installed so that there can be more dialogue about the software.

Big Changes

One major change occurred recently with PBooks - it now relies on nexista version 0.2.0 rather than the nexista 0.1.x stable branch. The good news is that version 0.2.0 is more compatible with PEAR coding standards, and will be easily installable via PEAR. For shared hosting folks, I’ll include it with the PBooks download.

I have good feelings about the new version of nexista, and as I’ve been working to improve the quality of PBooks code, I’ve been working on plugins. While this feature doesn’t change how PBooks will work out of the box, it will allow developers to alter the behaviour of PBooks drastically while maintaining compatibility with the mainline codebase. At first I was trying to use XSL for plugins, and while that works, I’m now thinking that plugins into Nexista are the better route. The final result will likely be a combination of both, depending on how complex the plugin is.

The Future

The future looks good for PBooks. Development on the installation process and plugin API will occur in tandem, and after that I’m going to work on a stable release. I don’t think the stable release will include all that I’d hoped and I’m sure will lack some functionality that people will require, but a stable release is needed to frame the next major steps for the future.

Thanks to everyone who provided feedback on our demo and the code. Please keep it coming! :-)

Gettext?

I’m planning to stop doing i18n like I have been, and instead use gettext, the GNU toolkit for localization. However, I don’t think that it will be very easy. To start planning, I found these articles:

http://www.onlamp.com/pub/a/php/2002/06/13/php.html
http://www.ibm.com/developerworks/library/os-php-intl/
http://www.appliedlanguage.com/articles/internationalization_using_php_and_get_text.shtml

They talk about the use of gettext and php, but perhaps I should be looking for information about gettext and XML / XSL?

Aha, I think I figured it out, and I think we’re in good shape. Since the XSL templates always reference XML nodes in the flow document for string values, I’ll just have to figure out a different way of getting those values into the flow document. Most likely it will be done using a php script to set the locale and language, reference the gettext documents, and then add the translated strings to the flow document.

I had a hard time testing this out because if an initial problem with my test case, but thanks to this comment at php.net about locales under /usr/lib/locale and linux, I was able to figure it out.

Still a little more work to do, and I’ll have to figure out which open source accounting program to share languages with, probably gnucash. I just examined their .po files, and they are actually way more specific to GnuCash than I thought. I then examined SMB Ledger’s po files and they look nice, and SQL Ledger doesn’t use gettext, so it looks like SMB Ledger is the way to go.

In thinking about this further, I feel like building XML files from .po files is the right way to go, but that seems a little bit excessive.

Good news! There is hope. I found this page helpful:

http://wiki.openbravo.com/wiki/index.php/Translating_Openbravo

Specifically since it referred me to a tool called xml2po, which does what I need!

http://svn.gnome.org/viewvc/gnome-doc-utils/trunk/xml2po/

WOW! This is exactly what PBooks needs. This pleases me immensely.

Invoices and Deposits




I’m working more on invoices and deposits, focusing on the ability to connect the two. When making a deposit, it would be very useful to attribute a payment to an invoice. Similarly, since business processes are fairly unique to each business and business type, I’ve been working on account transfers, and the creation of a check object if the transfer method is a check, as opposed to an electronic transfer.

I’m quite pleased with how the business processes / objects are coming along - they need a lot more refinement, but I’m comfortable enough with the progress made so far that I’m willing to do the refinement. (See ticket #124 for more information. )

An obvious refinement will be the offloading of complex Xpath queries to SQL JOINs. This will improve the application performance, but will also make the SQL less flexible. As I said, now that I’m comforable with the business objects, that shouldn’t be problem.

Connecting the Dots

I have some questions about the income statement report.

First of all, how do the cash flow transactions (i.e. deposit or withdrawal to a cash / bank account) get connected back to their corresponding journal entries? For example, when a bill is received, it may get entered into the accounts payable account. Later on, a check gets issued, and accounts payable is credited.

The report query will find outgoing transactions, but in this example there is not corresponding expense account. The credit to the accounts payable must somehow be linked with the “journal of origin” to find out which expense it should be matched with.

While this seems a bit obscure, its actually a very important factor to retain in PBooks. At the moment, I’m thinking that there should be a method for linking several journal entries together. Because this is a fairly simple relationship, it might make sense to have a simple, two-column table that can string journal entries together.

Cash Flow




The Cash Flow Report is in dire need of creation, and while I’m at it I’m planning to create some basic “snapshot reports” to gear up. These will allow the user to view all deposits, to all cash accounts, as well as withdrawals. The reports themselves won’t be too complicated, but they will be useful. Stay tuned…

UPDATE: The “Simple Cash Flow Report” is working well. You can choose to see cash flow changes by month, which is a very clear explanation of an important part of financial operations.

GnuCash with MySQL / SQLite

I’m trying to build GnuCash with GDA support to connect with MySQL or SQLite. I’ll start with SQLite since its simpler. I tried earlier today but was stumped because I’m using XFCE4. Not sure if that’s a big problem or not. I’m installing the binary from the debian resources just to get started.

Seems to work with XFCE4 fine, I guess I was confused by the need for libgnomeprint.

I started out by checking out the gda-dev2 sources from their subversion repository, then running ./autoconf.sh. I had to install libglib2.0-dev, intltool,


Running automake --add-missing --gnu  ...
src/business/business-gnome/schemas/Makefile.am:13: GCONF_SCHEMAS_INSTALL does not appear in AM_CONDITIONAL
src/business/business-gnome/schemas/Makefile.am:19: GCONF_SCHEMAS_INSTALL does not appear in AM_CONDITIONAL
src/gnome-utils/schemas/Makefile.am:13: GCONF_SCHEMAS_INSTALL does not appear in AM_CONDITIONAL
src/gnome-utils/schemas/Makefile.am:19: GCONF_SCHEMAS_INSTALL does not appear in AM_CONDITIONAL
src/gnome/schemas/Makefile.am:23: GCONF_SCHEMAS_INSTALL does not appear in AM_CONDITIONAL
src/gnome/schemas/Makefile.am:29: GCONF_SCHEMAS_INSTALL does not appear in AM_CONDITIONAL
src/import-export/hbci/schemas/Makefile.am:13: GCONF_SCHEMAS_INSTALL does not appear in AM_CONDITIONAL
src/import-export/hbci/schemas/Makefile.am:19: GCONF_SCHEMAS_INSTALL does not appear in AM_CONDITIONAL
src/import-export/schemas/Makefile.am:13: GCONF_SCHEMAS_INSTALL does not appear in AM_CONDITIONAL
src/import-export/schemas/Makefile.am:19: GCONF_SCHEMAS_INSTALL does not appear in AM_CONDITIONAL
**Error**: automake failed.

I’m giving up on trying to install on my XFCE4 machine and am now trying to do so on a stock Ubuntu Gutsy machine. I was able to install libgnome-dev which was giving me a hard time on the xubuntu machine, probably because that machine was a mix of etch, lenny, sid, feisty, and gutsy. I know, I know….

Strarting off with:


sudo apt-get install libgnome-dev subversion
mkdir src
cd src
svn co http://svn.gnucash.org/repo/gnucash/branches/gda-dev2/ ./
sudo apt-get install libtool intltool automake autoconf
sudo apt-get install libglib2.0-dev libgtkhtml3.8-dev swig automake1.9 guile-gnome0-dev guile-1.6-dev

Then came this:


NOTE: Just run configure.  Even if something told you to run
      aclocal, automake, or anything else above, IGNORE IT.
      Everything has been run properly.  Just run configure...

Nice!

Then…


cc1: warnings being treated as errors
gnc-schedxaction-gda.c: In function 'gnc_gda_save_schedxaction':
gnc-schedxaction-gda.c:261: warning: 'guid' is used uninitialized in this function

So now I’m trying “./configure –disable-error-on-warning”. That worked, I was able to “sudo make install” but now I’m getting this:


Implementation missing: database_constraints_update_list() in gda-dict-database.c line 1214
Implementation missing: database_constraints_update_list() in gda-dict-database.c line 1214
Segmentation fault (core dumped)