summaryrefslogtreecommitdiff
path: root/LedgerSMB/Form.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-12-21 01:56:50 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-12-21 01:56:50 +0000
commit948648b269291eb95e85fe8c726689b5924738a0 (patch)
tree428f77375d40c4b47af63277f3094188c1c46e31 /LedgerSMB/Form.pm
parent27e466198957d4d5f6ed3b08bf8f8de191389e3f (diff)
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
Diffstat (limited to 'LedgerSMB/Form.pm')
-rw-r--r--LedgerSMB/Form.pm20
1 files changed, 20 insertions, 0 deletions
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