X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FTopQuickSearch%2FGLTransaction.pm;h=53d05ea420e35adae8d4260580b21a38ceff5fff;hb=29675d6b7ae3bcfbde5bb21d55f6e3a189a2e7c9;hp=baa6da0ce02d1d52c014bdfe4145c0ff665c3bdb;hpb=25d67207329617a104fab716c301895cf0ae116d;p=kivitendo-erp.git diff --git a/SL/Controller/TopQuickSearch/GLTransaction.pm b/SL/Controller/TopQuickSearch/GLTransaction.pm index baa6da0ce..53d05ea42 100644 --- a/SL/Controller/TopQuickSearch/GLTransaction.pm +++ b/SL/Controller/TopQuickSearch/GLTransaction.pm @@ -45,17 +45,13 @@ sub query_autocomplete { my $ars = SL::DB::Manager::Invoice->get_all( query => [ @arfilter ], limit => $limit, sort_by => 'transdate DESC', with_objects => [ 'customer' ]); my $aps = SL::DB::Manager::PurchaseInvoice->get_all(query => [ @apfilter ], limit => $limit, sort_by => 'transdate DESC', with_objects => [ 'vendor' ]); - # use the sum of all credit amounts as the "amount" of the gl transaction - foreach my $gl ( @$gls ) { - $gl->{'amount'} = sum map { $_->amount if $_->amount > 0 } @{$gl->transactions}; - }; - my $gldata = [ map( { { - transdate => DateTime->from_object(object => $_->transdate)->ymd(), - label => $_->abbreviation. ": " . $_->description . " " . $_->reference . " " . $::form->format_amount(\%::myconfig, $_->{'amount'},2). " (" . $_->transdate->to_lxoffice . ")" , + transdate => $_->transdate->ymd(''), # only used for sorting + label => $_->oneline_summary, + value => '', id => 'gl.pl?action=edit&id=' . $_->id, } } @@ -67,8 +63,9 @@ sub query_autocomplete { map( { { - transdate => DateTime->from_object(object => $_->transdate)->ymd(), - label => $_->abbreviation . ": " . $_->invnumber . " " . $_->customer->name . " " . $::form->format_amount(\%::myconfig, $_->amount,2) . " (" . $_->transdate->to_lxoffice . ")" , + transdate => $_->transdate->ymd(''), + label => $_->oneline_summary, + value => "", id => ($_->invoice ? "is" : "ar" ) . '.pl?action=edit&id=' . $_->id, } } @@ -80,8 +77,8 @@ sub query_autocomplete { map( { { - transdate => DateTime->from_object(object => $_->transdate)->ymd(), - label => $_->abbreviation . ": " . $_->invnumber . " " . $_->vendor->name . " " . $::form->format_amount(\%::myconfig, $_->amount,2) . " (" . $_->transdate->to_lxoffice . ")" , + transdate => $_->transdate->ymd(''), + label => $_->oneline_summary, value => "", id => ($_->invoice ? "ir" : "ap" ) . '.pl?action=edit&id=' . $_->id, }