Filterkriterium Kundentyp (business_id) für Rechnungsübersicht hinzugefügt.
authorJan Büren <jan@lx-office-hosting.de>
Tue, 7 Dec 2010 11:01:15 +0000 (12:01 +0100)
committerJan Büren <jan@lx-office-hosting.de>
Tue, 7 Dec 2010 11:01:15 +0000 (12:01 +0100)
SL/AR.pm
bin/mozilla/ar.pl
templates/webpages/ar/search.html

index fe3e443..11333ce 100644 (file)
--- a/SL/AR.pm
+++ b/SL/AR.pm
@@ -446,6 +446,11 @@ sub ar_transactions {
     $where .= " AND c.name ILIKE ?";
     push(@values, $form->like($form->{customer}));
   }
+  if ($form->{business_id}) {
+    my $business_id = $form->{business_id};
+    $where .= " AND c.business_id = ?";
+    push(@values, $business_id);
+  }
   if ($form->{department_id}) {
     my $department_id = $form->{department_id};
     $where .= " AND a.department_id = ?";
index 8efd498..6f0b738 100644 (file)
@@ -1275,9 +1275,12 @@ sub search {
   $form->{title}    = $locale->text('AR Transactions');
   $form->{jsscript} = 1;
 
-  $form->get_lists("projects"     => { "key" => "ALL_PROJECTS", "all" => 1 },
-                   "departments"  => "ALL_DEPARTMENTS",
-                   "customers"    => "ALL_VC");
+  # Auch in Rechnungsübersicht nach Kundentyp filtern - jan
+  $form->get_lists("projects"       => { "key" => "ALL_PROJECTS", "all" => 1 },
+                   "departments"    => "ALL_DEPARTMENTS",
+                   "customers"      => "ALL_VC",
+                   "business_types" => "ALL_BUSINESS_TYPES");
+  $form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0;
 
   # constants and subs for template
   $form->{jsscript}  = 1;
index 9245d6b..76a1993 100644 (file)
@@ -3,7 +3,7 @@
 
  <form method=post name="search" action=[% script %]>
 
-  <table width=100%>
+  <table width=100% border="0">
   <tr><th class=listtop>[% title %]</th></tr>
   <tr height="5"></tr>
   <tr>
             -%]
       </td>
      </tr>
+    [% IF SHOW_BUSINESS_TYPES %]
+     <tr>
+      <th align="right" nowrap>[% 'Customer type' | $T8 %]</th>
+      <td colspan="3">
+          [%- INCLUDE 'generic/multibox.html'
+                 name          =  'business_id',
+                 style         = "width: 250px",
+                 DATA          =  ALL_BUSINESS_TYPES,
+                 id_key        = 'id',
+                 label_key     = 'description',
+                 limit         = vclimit,
+                 show_empty    = 1,
+                 allow_textbox = 0,
+            -%]
+
+        </select>
+      </td>
+     </tr>
+    [% END %]
      <tr>
       <th align=right nowrap>[% 'From' | $T8 %]</th>
       <td>