From 948648b269291eb95e85fe8c726689b5924738a0 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Fri, 21 Dec 2007 01:56:50 +0000 Subject: Adding chart of account filter to GL reports git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1988 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Form.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'LedgerSMB/Form.pm') diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 496cfcbf..ff0166a1 100644 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -1816,6 +1816,26 @@ sub all_vc { $self->all_taxaccounts( $myconfig, $dbh, $transdate ); } +=item $form->all_accounts() + +Sets $form->{accounts} to all accounts. Returns the list as well. +Example: my @account_list = $form->all_accounts(); + +=cut + +sub all_accounts { + my ($self) = @_; + my $ref; + $self->{all_accounts} = []; + my $sth = $self->{dbh}->prepare('SELECT * FROM chart_list_all()'); + $sth->execute || $self->dberror('SELECT * FROM chart_list_all()'); + while ($ref = $sth->fetchrow_hashref('NAME_lc')){ + push(@{$self->{all_accounts}}, $ref); + } + $sth->finish; + return @{$self->{all_accounts}}; +} + =item $form->all_taxaccounts($myconfig, $dbh2[, $transdate]); Get the tax rates and numbers for all the taxes in $form->{taxaccounts}. Does -- cgit v1.2.3