X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAP.pm;h=a77906c96ecfd5595fec4e3ff4ce8b6df629f6da;hb=7b5a9b16107225417dd1b8451a5ed9bfa607aef2;hp=71c2b4b004ce53a28d79879b56caae21a20b642c;hpb=142ea3bff784ba29bd87de5615bb4f2aec8c977f;p=kivitendo-erp.git diff --git a/SL/AP.pm b/SL/AP.pm index 71c2b4b00..a77906c96 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -141,7 +141,7 @@ sub _post_transaction { transdate = ?, ordnumber = ?, vendor_id = ?, taxincluded = ?, amount = ?, duedate = ?, deliverydate = ?, tax_point = ?, paid = ?, netamount = ?, currency_id = (SELECT id FROM currencies WHERE name = ?), notes = ?, department_id = ?, storno = ?, storno_id = ?, - globalproject_id = ?, direct_debit = ? + globalproject_id = ?, direct_debit = ?, payment_id = ? WHERE id = ?|; @values = ($form->{invnumber}, conv_date($form->{transdate}), $form->{ordnumber}, conv_i($form->{vendor_id}), @@ -152,6 +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', + conv_i($form->{payment_id}), $form->{id}); do_query($form, $dbh, $query, @values); @@ -449,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, | . @@ -461,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) | . @@ -532,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}) {