diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-01 22:49:54 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-01 22:49:54 +0000 |
commit | b1d3c56e3824b123e09bf807ee1cd9a71ca43efc (patch) | |
tree | b08d91c62c87b60085d55c2c3b3557ad654765b9 /LedgerSMB | |
parent | 0ca18bdebd500c752b7ae1dcc8f54c65fd2c25af (diff) |
Fixing bind errors when transdate is omitted in Form::all_vc and also ensuring that invoices show up in transaction report.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1493 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/AA.pm | 4 | ||||
-rw-r--r-- | LedgerSMB/Form.pm | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/LedgerSMB/AA.pm b/LedgerSMB/AA.pm index dfcb0cc4..449819d5 100644 --- a/LedgerSMB/AA.pm +++ b/LedgerSMB/AA.pm @@ -784,11 +784,11 @@ sub transactions { d.description AS department, a.ponumber $acc_trans_flds FROM $table a - JOIN $form->{vc} vc USING (entity_id) + JOIN entity_credit_account vc USING (entity_id) LEFT JOIN employee e ON (a.person_id = e.entity_id) LEFT JOIN employee m ON (e.managerid = m.entity_id) JOIN entity ee ON (e.entity_id = ee.id) - JOIN entity me ON (m.entity_id = me.id) + LEFT JOIN entity me ON (m.entity_id = me.id) JOIN entity vce ON (vc.entity_id = vce.id) LEFT JOIN exchangerate ex ON (ex.curr = a.curr AND ex.transdate = a.transdate) diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index cb20e03f..f1c873d0 100644 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -1702,7 +1702,9 @@ sub all_vc { $where = qq| (startdate IS NULL OR startdate <= ?) AND (enddate IS NULL OR enddate >= ?) AND entity_class = ?|; - push (@queryargs, $transdate, $transdate ); + push (@queryargs, $transdate, $transdate, $self->{vc_class}); + } else { + $where = " true"; } $sth = $dbh->prepare($query); @@ -1734,7 +1736,7 @@ sub all_vc { ORDER BY name|; shift @queryargs; - push( @queryargs, $self->{vc_class}, $self->{"${vc}_id"} ); + push( @queryargs, $self->{"${vc}_id"} ); $sth = $dbh->prepare($query); $sth->execute(@queryargs) || $self->dberror($query); |