Re: [Openledger-developer] Random jottings
Brought to you by:
klavs
From: Tony F. <to...@sy...> - 2005-03-20 21:14:23
|
On Sat, 2005-03-19 at 13:27, Tony Fraser wrote: > hmm... I guess this is the place where I get off my butt and get around > to contributing the UML I said I would ages ago. > > I finally uploaded it. You can have quick look here: > > http://openledger.sf.net/Business-Ledger/class_diagram.png > > Or you can download the Dia source here: > > http://openledger.sf.net/Business-Ledger/class_diagram.dia As has been brought up on this list before, sometimes code is the best description. Here is an example script that posts a GL transaction using my fictional Business::Ledger API. #!/usr/bin/perl use strict; our $acct = Businss::Ledger->new( BACKEND => Business::Ledger::SQL_Ledger, OPTIONS => { PATH => /usr/local/sql-ledger } ); our $chart = $acct->get_coa(); # Open a GL Transaction my $gl_trans = $acct->start_transaction('Business::Ledger::Transaction::GL'); $gl_trans->reference('test'); $gl_trans->date('1-1-2005'); $gl_trans->description('This is a test GL entry'); # Add some amounts $gl_trans->post_debit($chart->find_account( number => '1820' ), '55.00'); $gl_trans->post_debit($chart->find_account( number => '5700' ), '40.00'); $gl_trans->post_credit($chart->find_account( number => '1060' ), '95.00'); # Now all that's left is to post it. $gl_trans->post; -- Tony Fraser to...@sy... Sybaspace Internet Solutions System Administrator phone: (250) 246-5368 fax: (250) 246-5398 |