Bericht Angebote/Aufträge: internen Bemerkungen filtern und anzeigen können
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 21 Dec 2020 16:42:33 +0000 (17:42 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 21 Dec 2020 16:42:33 +0000 (17:42 +0100)
SL/OE.pm
bin/mozilla/oe.pl
templates/webpages/oe/search.html

index 759f962..a517e05 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -123,6 +123,7 @@ sub transactions {
     qq|  o.marge_total, o.marge_percent, | .
     qq|  o.exchangerate, | .
     qq|  o.itime::DATE AS insertdate, | .
+    qq|  o.intnotes, | .
     qq|  department.description as department, | .
     qq|  ex.$rate AS daily_exchangerate, | .
     qq|  pt.description AS payment_terms, | .
@@ -296,6 +297,11 @@ SQL
     push @values, conv_date($form->{expected_billing_date_to});
   }
 
+  if ($form->{intnotes}) {
+    $query .= qq| AND o.intnotes ILIKE ?|;
+    push(@values, like($form->{intnotes}));
+  }
+
   if ($form->{parts_partnumber}) {
     $query .= <<SQL;
       AND EXISTS (
@@ -363,6 +369,7 @@ SQL
     "taxzone"                 => "tz.description",
     "payment_terms"           => "pt.description",
     "department"              => "department.description",
+    "intnotes"                => "o.intnotes",
   );
   if ($form->{sort} && grep($form->{sort}, keys(%allowed_sort_columns))) {
     $sortorder = $allowed_sort_columns{$form->{sort}} . " ${sortdir}"  . ", o.itime ${sortdir}";
index d2cceea..0fe1ffb 100644 (file)
@@ -1035,7 +1035,7 @@ sub orders {
     "country",                 "shippingpoint",
     "taxzone",                 "insertdate",
     "order_probability",       "expected_billing_date", "expected_netamount",
-    "payment_terms",
+    "payment_terms",           "intnotes",
   );
 
   # only show checkboxes if gotten here via sales_order form.
@@ -1084,7 +1084,7 @@ sub orders {
                                                         reqdatefrom reqdateto projectnumber project_id periodic_invoices_active periodic_invoices_inactive
                                                         business_id shippingpoint taxzone_id reqdate_unset_or_old insertdatefrom insertdateto
                                                         order_probability_op order_probability_value expected_billing_date_from expected_billing_date_to
-                                                        parts_partnumber parts_description all department_id);
+                                                        parts_partnumber parts_description all department_id intnotes);
   push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables;
 
   my   @keys_for_url = grep { $form->{$_} } @hidden_variables;
@@ -1129,10 +1129,11 @@ sub orders {
     'expected_billing_date'   => { 'text' => $locale->text('Exp. bill. date'), },
     'expected_netamount'      => { 'text' => $locale->text('Exp. netamount'), },
     'payment_terms'           => { 'text' => $locale->text('Payment Terms'), },
+    'intnotes'                => { 'text' => $locale->text('Internal Notes'), },
     %column_defs_cvars,
   );
 
-  foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone insertdate payment_terms department)) {
+  foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone insertdate payment_terms department intnotes)) {
     my $sortdir                 = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
     $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
   }
@@ -1163,6 +1164,7 @@ sub orders {
   push @options, $locale->text('Order Number')            . " : $form->{ordnumber}"                       if $form->{ordnumber};
   push @options, $locale->text('Customer Order Number')   . " : $form->{cusordnumber}"                    if $form->{cusordnumber};
   push @options, $locale->text('Notes')                   . " : $form->{notes}"                           if $form->{notes};
+  push @options, $locale->text('Internal Notes')          . " : $form->{intnotes}"                        if $form->{intnotes};
   push @options, $locale->text('Transaction description') . " : $form->{transaction_description}"         if $form->{transaction_description};
   push @options, $locale->text('Quick Search')            . " : $form->{all}"                             if $form->{all};
   push @options, $locale->text('Shipping Point')          . " : $form->{shippingpoint}"                   if $form->{shippingpoint};
index 3cc9d59..3f47442 100644 (file)
      </td>
     </tr>
     [%- END %]
+    <tr>
+     <th align="right">[% 'Internal Notes' | $T8 %]</th>
+     <td>[% L.input_tag('intnotes', '', style=style) %]</td>
+    </tr>
     <tr>
      <th align="right">[% IF is_order %][% 'Order Date' | $T8 %][% ELSE %][% 'Quotation Date' | $T8 %][% END %] [% 'From' | $T8 %]</th>
      <td>
          <input name="l_salesman" id="l_salesman" class="checkbox" type="checkbox" value="Y">
          <label for="l_salesman">[% 'Salesman' | $T8 %]</label>
         </td>
+        <td>
+         <input name="l_intnotes" id="l_intnotes" class="checkbox" type="checkbox" value="Y">
+         <label for="l_intnotes">[% 'Internal Notes' | $T8 %]</label>
+        </td>
        </tr>
 [% IF type == 'sales_quotation' %]
        <tr>