X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAP.pm;h=1b7c1d84adcb619b73d5a21bfdb06d83fa46b29d;hb=7c8ba0e3428528a57d6ac5feae91582560602028;hp=24054c8cb5b978945b4dd222a5a329f3870bcd63;hpb=c654c46b8b5f9475d2515750aa4bbb3fdddc63fc;p=kivitendo-erp.git diff --git a/SL/AP.pm b/SL/AP.pm index 24054c8cb..1b7c1d84a 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -399,7 +399,7 @@ sub ap_transactions { my $query = qq|SELECT a.id, a.invnumber, a.transdate, a.duedate, a.amount, a.paid, | . qq| a.ordnumber, v.name, a.invoice, a.netamount, a.datepaid, a.notes, | . - qq| a.globalproject_id, | . + qq| a.globalproject_id, a.storno, a.storno_id, | . qq| pr.projectnumber AS globalprojectnumber, | . qq| e.name AS employee | . qq|FROM ap a | . @@ -407,7 +407,7 @@ sub ap_transactions { qq|LEFT JOIN employee e ON (a.employee_id = e.id) | . qq|LEFT JOIN project pr ON (a.globalproject_id = pr.id) |; - my $where = qq| WHERE COALESCE(storno, false) != true |; + my $where = ''; my @values; if ($form->{vendor_id}) { @@ -458,7 +458,7 @@ sub ap_transactions { } if ($where) { -# substr($where, 0, 4) = "WHERE"; + substr($where, 0, 4, " WHERE "); $query .= $where; } @@ -467,9 +467,7 @@ sub ap_transactions { my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; my $sortorder = join(', ', map { "$_ $sortdir" } @a); - if (grep({ $_ eq $form->{sort} } - qw(transdate id invnumber ordnumber name netamount tax amount - paid datepaid due duedate notes employee))) { + if (grep({ $_ eq $form->{sort} } qw(transdate id invnumber ordnumber name netamount tax amount paid datepaid due duedate notes employee transaction_description))) { $sortorder = $form->{sort} . " $sortdir"; }