summaryrefslogtreecommitdiff
path: root/LedgerSMB.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-09 23:15:56 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-03-09 23:15:56 +0000
commit8327a4959a98ad10eb38974aaaddaa1ff7624bda (patch)
tree28239b730ae8ccac3c79451a6496d6f82371c1cc /LedgerSMB.pm
parent2994f499bc287114d6ad004e5335c4c5c9d337d9 (diff)
Fixing numerous issues with new orm code
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@871 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB.pm')
-rwxr-xr-xLedgerSMB.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm
index 9a4910a1..eb7cca38 100755
--- a/LedgerSMB.pm
+++ b/LedgerSMB.pm
@@ -525,16 +525,18 @@ sub round_amount {
}
sub callproc {
+ my $self = shift @_;
my $procname = shift @_;
my $argstr = "";
my @results;
- for (1 .. $#_){
+ for (1 .. scalar @_){
$argstr .= "?, ";
}
$argstr =~ s/\, $//;
- $query = "SELECT * FROM $procname";
- $query =~ s/\(\)/$argstr/;
+ $query = "SELECT * FROM $procname()";
+ $query =~ s/\(\)/($argstr)/;
my $sth = $self->{dbh}->prepare($query);
+ $sth->execute(@_);
while (my $ref = $sth->fetchrow_hashref(NAME_lc)){
push @results, $ref;
}