X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAP.pm;h=a77906c96ecfd5595fec4e3ff4ce8b6df629f6da;hb=844a541e0d8f59644540413f675e8f07cd154cf6;hp=69a2a0a0c0a1d9815af7a277f0edf4ae2fcdce5a;hpb=ea13b69d6d3a70c5432ae6b6d29a0a0531e51da9;p=kivitendo-erp.git diff --git a/SL/AP.pm b/SL/AP.pm index 69a2a0a0c..a77906c96 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -152,7 +152,7 @@ sub _post_transaction { conv_i($form->{department_id}), $form->{storno}, $form->{storno_id}, conv_i($form->{globalproject_id}), $form->{direct_debit} ? 't' : 'f', - $form->{payment_id}, + conv_i($form->{payment_id}), $form->{id}); do_query($form, $dbh, $query, @values); @@ -450,6 +450,7 @@ sub ap_transactions { 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, a.storno, a.storno_id, a.direct_debit, | . + qq| a.transaction_description, a.itime::DATE AS insertdate, | . qq| pr.projectnumber AS globalprojectnumber, | . qq| e.name AS employee, | . qq| v.vendornumber, v.country, v.ustid, | . @@ -462,7 +463,14 @@ sub ap_transactions { WHERE ch.link ~ 'AP[[:>:]]' AND at.trans_id = a.id LIMIT 1 - ) AS charts } . + ) AS charts, } . + qq{ ( SELECT ch.accno || ' -- ' || ch.description + FROM acc_trans at + LEFT JOIN chart ch ON ch.id = at.chart_id + WHERE ch.link ~ 'AP_amount' + AND at.trans_id = a.id + LIMIT 1 + ) AS debit_chart } . qq|FROM ap a | . qq|JOIN vendor v ON (a.vendor_id = v.id) | . qq|LEFT JOIN contacts cp ON (a.cp_id = cp.cp_id) | . @@ -533,8 +541,12 @@ sub ap_transactions { $where .= " AND a.ordnumber ILIKE ?"; push(@values, like($form->{ordnumber})); } + if ($form->{transaction_description}) { + $where .= " AND a.transaction_description ILIKE ?"; + push(@values, like($form->{transaction_description})); + } if ($form->{notes}) { - $where .= " AND lower(a.notes) LIKE ?"; + $where .= " AND a.notes ILIKE ?"; push(@values, like($form->{notes})); } if ($form->{project_id}) {