diff options
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); |