diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-10-28 18:52:18 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-10-28 18:52:18 +0000 |
commit | 28cade6ec8c1eef99f5734bdf8c0bfb1c364ac36 (patch) | |
tree | 1c44cdfc85ff42a8510a98e8e2367a36e23ad515 /LedgerSMB | |
parent | 680751df05bcf5102084f465b8e781cac7337928 (diff) |
Get the transaction search working well enough to not blow up on a simple search
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1823 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/OE.pm | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/LedgerSMB/OE.pm b/LedgerSMB/OE.pm index c296ef30..d129ba7c 100644 --- a/LedgerSMB/OE.pm +++ b/LedgerSMB/OE.pm @@ -77,14 +77,19 @@ sub transactions { } my $query = qq| SELECT o.id, o.ordnumber, o.transdate, o.reqdate, - o.amount, ct.name, o.netamount, o.$form->{vc}_id, + o.amount, c.legal_name AS name, o.netamount, o.entity_id AS $form->{vc}_id, ex.$rate AS exchangerate, o.closed, o.quonumber, - o.shippingpoint, o.shipvia, e.name AS employee, - m.name AS manager, o.curr, o.ponumber + o.shippingpoint, o.shipvia, + pe.first_name \|\| ' ' \|\| pe.last_name AS employee, + pm.first_name \|\| ' ' \|\| pm.last_name AS manager, + o.curr, o.ponumber FROM oe o - JOIN $form->{vc} ct ON (o.$form->{vc}_id = ct.id) - LEFT JOIN employee e ON (o.employee_id = e.id) - LEFT JOIN employee m ON (e.managerid = m.id) + JOIN $form->{vc} ct ON (o.entity_id = ct.id) + JOIN company c ON (c.entity_id = ct.entity_id) + LEFT JOIN person pe ON (o.person_id = pe.id) + LEFT JOIN employee e ON (pe.entity_id = e.entity_id) + LEFT JOIN person pm ON (e.managerid = pm.id) + LEFT JOIN employee m ON (pm.entity_id = m.entity_id) LEFT JOIN exchangerate ex ON (ex.curr = o.curr AND ex.transdate = o.transdate) WHERE o.quotation = ? @@ -355,7 +360,7 @@ sub save { ($form->{id}, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, - ?, ?, ?, ?, ?)|; + ?, ?, ?, ?)|; @queryargs = ( $form->{ordnumber}, $form->{quonumber}, $form->{transdate}, $form->{entity_id}, $form->{reqdate}, |