Einkaufsrechnungen: Vorgangsbezeichnung speichern und danach suchen können
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Tue, 9 Mar 2021 15:55:19 +0000 (16:55 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Tue, 9 Mar 2021 15:55:19 +0000 (16:55 +0100)
SL/AP.pm
SL/IR.pm
templates/webpages/ap/search.html
templates/webpages/ir/form_header.html

index 9565283..e21eb13 100644 (file)
--- a/SL/AP.pm
+++ b/SL/AP.pm
@@ -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, | .
     qq|  pr.projectnumber AS globalprojectnumber, | .
     qq|  e.name AS employee, | .
     qq|  v.vendornumber, v.country, v.ustid, | .
@@ -533,6 +534,10 @@ 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 ?";
     push(@values, like($form->{notes}));
index 2663ad6..3d8ee36 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -737,7 +737,7 @@ SQL
                 invoice      = ?, taxzone_id  = ?, notes         = ?, taxincluded  = ?,
                 intnotes     = ?, storno_id   = ?, storno        = ?, tax_point    = ?,
                 cp_id        = ?, employee_id = ?, department_id = ?, delivery_term_id = ?,
-                payment_id   = ?,
+                payment_id   = ?, transaction_description        = ?,
                 currency_id = (SELECT id FROM currencies WHERE name = ?),
                 globalproject_id = ?, direct_debit = ?
               WHERE id = ?|;
@@ -748,7 +748,7 @@ SQL
             '1',                             $taxzone_id, $restricter->process($form->{notes}),               $form->{taxincluded} ? 't' : 'f',
                 $form->{intnotes},           conv_i($form->{storno_id}),     $form->{storno}      ? 't' : 'f', conv_date($form->{tax_point}),
          conv_i($form->{cp_id}),      conv_i($form->{employee_id}), conv_i($form->{department_id}), conv_i($form->{delivery_term_id}),
-         conv_i($form->{payment_id}),
+         conv_i($form->{payment_id}), $form->{transaction_description},
                 $form->{"currency"},
          conv_i($form->{globalproject_id}),
                 $form->{direct_debit} ? 't' : 'f',
@@ -1006,7 +1006,7 @@ sub retrieve_invoice {
                 ordnumber, quonumber, paid, taxincluded, notes, taxzone_id, storno, gldate,
                 mtime, itime,
                 intnotes, (SELECT cu.name FROM currencies cu WHERE cu.id=ap.currency_id) AS currency, direct_debit,
-                payment_id, delivery_term_id
+                payment_id, delivery_term_id, transaction_description
               FROM ap
               WHERE id = ?|;
   $ref = selectfirst_hashref_query($form, $dbh, $query, conv_i($form->{id}));
index 32ad40e..94d3468 100644 (file)
@@ -29,6 +29,9 @@
       <th align=right nowrap>[% 'Order Number' | $T8 %]</th>
       <td>[% L.input_tag("ordnumber", "", style=style) %]</td>
      </tr>
+     <tr>
+      <th align="right" nowrap>[% 'Transaction description' | $T8 %]</th>
+      <td>[% L.input_tag("transaction_description", "", style=style) %]</td>
      <tr>
       <th align=right nowrap>[% 'Notes' | $T8 %]</th>
       <td>[% L.input_tag("notes", "", style=style) %]</td>
            <td nowrap>[% 'Subtotal' | $T8 %]</td>
            <td align=right><input name="l_globalprojectnumber" class=checkbox type=checkbox value=Y></td>
            <td nowrap>[% 'Document Project Number' | $T8 %]</td>
+           <td align="right"><input name="l_transaction_description" id="l_transaction_description" class=checkbox type=checkbox value=Y[% IF INSTANCE_CONF.get_require_transaction_description_ps %] checked[% END %]></td>
+           <td nowrap>[% 'Transaction description' | $T8 %]</td>
          </tr>
           <tr>
            <td align=right><input name="l_taxzone" class=checkbox type=checkbox value=Y></td>
index fac160a..296c79b 100644 (file)
           </td>
         </tr>
 [%- END %]
+        <tr>
+          <th align="right">[% 'Transaction description' | $T8 %]</th>
+          <td colspan="3">[% L.input_tag("transaction_description", transaction_description, size=35, "data-validate"=INSTANCE_CONF.get_require_transaction_description_ps ? 'required' : '') %]</td>
+        </tr>
       </table>
     </td>
     <td align="right" valign="top">