From 8f20a81aeb9e25a80ff07a35be240b5b97fea9b3 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Sat, 8 Sep 2007 05:25:46 +0000 Subject: Correcting more breakage on entity stuff git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1545 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/CP.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LedgerSMB/CP.pm b/LedgerSMB/CP.pm index 4419beac..6d31c5aa 100644 --- a/LedgerSMB/CP.pm +++ b/LedgerSMB/CP.pm @@ -215,7 +215,7 @@ sub get_openinvoices { my $dbh = $form->{dbh}; $vc_id = $dbh->quote( $form->{"entity_id"} ); - my $where = qq|WHERE a.entity__id = $vc_id + my $where = qq|WHERE a.entity_id = $vc_id AND a.amount != a.paid|; $curr = $dbh->quote( $form->{currency} ); @@ -257,9 +257,10 @@ sub get_openinvoices { } my $query = qq|SELECT a.id, a.invnumber, a.transdate, a.amount, a.paid, - a.curr, c.name, a.entity_id, c.language_code + a.curr, e.name, a.entity_id, c.language_code FROM $form->{arap} a JOIN $form->{vc} c ON (c.entity_id = a.entity_id) + JOIN entity e ON (a.entity_id = e.id) $where ORDER BY $sortorder|; -- cgit v1.2.3