From 9962480601cef59d4637bb4360e3808be3c9f320 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 4 Jun 2007 21:29:12 +0000 Subject: Getting most of AR and AP to work with new contact management scheme git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1252 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/AA.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/LedgerSMB/AA.pm b/LedgerSMB/AA.pm index 1165b232..ed49c986 100644 --- a/LedgerSMB/AA.pm +++ b/LedgerSMB/AA.pm @@ -720,16 +720,19 @@ sub transactions { SELECT a.id, a.invnumber, a.ordnumber, a.transdate, a.duedate, a.netamount, a.amount, ($paid) AS paid, a.invoice, a.datepaid, a.terms, a.notes, - a.shipvia, a.shippingpoint, e.name AS employee, - vc.name, - a.$form->{vc}_id, a.till, m.name AS manager, a.curr, + a.shipvia, a.shippingpoint, ee.name AS employee, + vce.name, + a.entity_id, a.till, me.name AS manager, a.curr, ex.$buysell AS exchangerate, d.description AS department, a.ponumber $acc_trans_flds FROM $table a - JOIN $form->{vc} vc ON (a.$form->{vc}_id = vc.id) - LEFT JOIN employees e ON (a.employee_id = e.id) - LEFT JOIN employees m ON (e.managerid = m.id) + JOIN $form->{vc} vc USING (entity_id) + LEFT JOIN employee e ON (a.person_id = e.entity_id) + LEFT JOIN employee m ON (e.managerid = m.id) + JOIN entity ee ON (e.entity_id = ee.id) + 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) LEFT JOIN department d ON (a.department_id = d.id) -- cgit v1.2.3