From: Bernd Bleßmann <bernd@kivitendo-premium.de>
Date: Mon, 23 Sep 2019 11:53:57 +0000 (+0200)
Subject: Bericht Angebote/Aufträge: Abteilungen anzeigen können
X-Git-Tag: release-3.5.6.1~486
X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=bead93d9bf4fefcecb262c0af667b43b77f5dc9c;p=kivitendo-erp.git

Bericht Angebote/Aufträge: Abteilungen anzeigen können
---

diff --git a/SL/OE.pm b/SL/OE.pm
index 40b29f4a1..49681bd8e 100644
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -116,6 +116,7 @@ sub transactions {
     qq|  o.transaction_description, | .
     qq|  o.marge_total, o.marge_percent, | .
     qq|  o.itime::DATE AS insertdate, | .
+    qq|  department.description as department, | .
     qq|  ex.$rate AS exchangerate, | .
     qq|  pt.description AS payment_terms, | .
     qq|  pr.projectnumber AS globalprojectnumber, | .
@@ -134,6 +135,7 @@ sub transactions {
     qq|LEFT JOIN project pr ON (o.globalproject_id = pr.id) | .
     qq|LEFT JOIN payment_terms pt ON (pt.id = o.payment_id)| .
     qq|LEFT JOIN tax_zones tz ON (o.taxzone_id = tz.id) | .
+    qq|LEFT JOIN department   ON (o.department_id = department.id) | .
     qq|$periodic_invoices_joins | .
     qq|WHERE (o.quotation = ?) |;
   push(@values, $quotation);
@@ -353,6 +355,7 @@ SQL
     "insertdate"              => "o.itime",
     "taxzone"                 => "tz.description",
     "payment_terms"           => "pt.description",
+    "department"              => "department.description",
   );
   if ($form->{sort} && grep($form->{sort}, keys(%allowed_sort_columns))) {
     $sortorder = $allowed_sort_columns{$form->{sort}} . " ${sortdir}"  . ", o.itime ${sortdir}";
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index c62e694a3..8c88f5337 100644
--- a/bin/mozilla/oe.pl
+++ b/bin/mozilla/oe.pl
@@ -1026,7 +1026,7 @@ sub orders {
     "curr",                    "employee",
     "salesman",
     "shipvia",                 "globalprojectnumber",
-    "transaction_description", "open",
+    "transaction_description", "department",            "open",
     "delivered",               "periodic_invoices",
     "marge_total",             "marge_percent",
     "vcnumber",                "ustid",
@@ -1111,6 +1111,7 @@ sub orders {
     'shipvia'                 => { 'text' => $locale->text('Ship via'), },
     'globalprojectnumber'     => { 'text' => $locale->text('Project Number'), },
     'transaction_description' => { 'text' => $locale->text('Transaction description'), },
+    'department'              => { 'text' => $locale->text('Department'), },
     'open'                    => { 'text' => $locale->text('Open'), },
     'delivered'               => { 'text' => $locale->text('Delivery Order created'), },
     'marge_total'             => { 'text' => $locale->text('Ertrag'), },
@@ -1129,7 +1130,7 @@ sub orders {
     %column_defs_cvars,
   );
 
-  foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone insertdate payment_terms)) {
+  foreach my $name (qw(id transdate reqdate quonumber ordnumber cusordnumber name employee salesman shipvia transaction_description shippingpoint taxzone insertdate payment_terms department)) {
     my $sortdir                 = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
     $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
   }
diff --git a/templates/webpages/oe/search.html b/templates/webpages/oe/search.html
index 9362920b2..45a6f0aa0 100644
--- a/templates/webpages/oe/search.html
+++ b/templates/webpages/oe/search.html
@@ -257,6 +257,10 @@
          <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 %]>
          <label for="l_transaction_description">[% 'Transaction description' | $T8 %]</label>
         </td>
+        <td>
+         [%- L.checkbox_tag('l_department', label => LxERP.t8('Department')) %]</td>
+        </td>
+
        </tr>
        <tr>
         <td>