diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-08-27 05:47:43 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-08-27 05:47:43 +0000 |
commit | 987f6961fd24dee8d03eaf4a3942ecfeb6a9b0d3 (patch) | |
tree | 4763fc9013ac4d358c4db01f0359138d828cc7a7 /LedgerSMB | |
parent | 1a741102291ad962c47a97ce377c8aa6b96ccbbf (diff) |
Correcting Form::all_vc() for new entity management
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1469 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/Form.pm | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 0b96e62e..cb20e03f 100644 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -1700,8 +1700,8 @@ sub all_vc { $query .= qq| AND (startdate IS NULL OR startdate <= ?) AND (enddate IS NULL OR enddate >= ?)|; $where = qq| (startdate IS NULL OR startdate <= ?) - AND (enddate IS NULL OR enddate >= ?)|; - + AND (enddate IS NULL OR enddate >= ?) + AND entity_class = ?|; push (@queryargs, $transdate, $transdate ); } @@ -1717,13 +1717,14 @@ sub all_vc { if ( $count < $myconfig->{vclimit} ) { $self->{"${vc}_id"} *= 1; - $where = "AND $where" if $where; $query = qq|SELECT id, name FROM entity WHERE id IN (select entity_id - FROM $vc) - $where + FROM + entity_credit_account + WHERE + $where) UNION @@ -1733,7 +1734,7 @@ sub all_vc { ORDER BY name|; shift @queryargs; - push( @queryargs, $self->{"${vc}_id"} ); + push( @queryargs, $self->{vc_class}, $self->{"${vc}_id"} ); $sth = $dbh->prepare($query); $sth->execute(@queryargs) || $self->dberror($query); |