summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-17 22:42:50 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-17 22:42:50 +0000
commit4794fc08ffb6465116f0df9ddc9bb05ddcd62724 (patch)
tree7583fa35b36a84dd174e2b292aad2ed95e08b9d8
parent44d035fe38dac0b91e1fdadb576459f5ec19739a (diff)
Tagging 1.2.5
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1206 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r--LedgerSMB/AA.pm17
1 files changed, 9 insertions, 8 deletions
diff --git a/LedgerSMB/AA.pm b/LedgerSMB/AA.pm
index 072e97d6..22f32474 100644
--- a/LedgerSMB/AA.pm
+++ b/LedgerSMB/AA.pm
@@ -1122,16 +1122,15 @@ sub get_name {
if ( !$form->{id} && $form->{type} !~ /_(order|quotation)/ ) {
$query = qq|
- SELECT c.accno, c.description, c.link, c.category,
- ac.project_id, p.projectnumber,
- a.department_id, d.description AS department
+ SELECT c.accno, c.description, c.link,
+ c.category,
+ ac.project_id
+ a.department_id
FROM chart c
JOIN acc_trans ac ON (ac.chart_id = c.id)
JOIN $arap a ON (a.id = ac.trans_id)
- LEFT JOIN project p ON (ac.project_id = p.id)
- LEFT JOIN department d ON (d.id = a.department_id)
WHERE a.$form->{vc}_id = ?
- AND a.id IN (SELECT max(id)
+ AND a.id = (SELECT max(id)
FROM $arap
WHERE $form->{vc}_id =
?)
@@ -1144,9 +1143,7 @@ sub get_name {
my $i = 0;
while ( $ref = $sth->fetchrow_hashref(NAME_lc) ) {
- $form->{department} = $ref->{department};
$form->{department_id} = $ref->{department_id};
-
if ( $ref->{link} =~ /_amount/ ) {
$i++;
$form->{"$form->{ARAP}_amount_$i"} =
@@ -1165,6 +1162,10 @@ sub get_name {
}
$sth->finish;
+ $query = "select description from department where id = ?";
+ $sth = $dbh->prepare($query);
+ $sth->execute($form->{department_id});
+ ($form->{department}) = $sth->fetchrow_array;
$form->{rowcount} = $i if ( $i && !$form->{type} );
}