Massenerstellen von Rechnungen aus LS: Filtern nach Kundentyp
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 2 Dec 2019 15:35:39 +0000 (16:35 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Mon, 2 Dec 2019 15:35:39 +0000 (16:35 +0100)
SL/Controller/MassInvoiceCreatePrint.pm
templates/webpages/mass_invoice_create_print_from_do/_filter.html

index a3cf2a0..78e7859 100644 (file)
@@ -22,7 +22,7 @@ use SL::SessionFile;
 use SL::System::TaskServer;
 use Rose::Object::MakeMethods::Generic
 (
-  'scalar --get_set_init' => [ qw(invoice_models invoice_ids sales_delivery_order_models printers default_printer_id today) ],
+  'scalar --get_set_init' => [ qw(invoice_models invoice_ids sales_delivery_order_models printers default_printer_id today all_businesses) ],
 );
 
 __PACKAGE__->run_before('setup');
@@ -262,6 +262,10 @@ sub init_default_printer_id {
   return $pr ? $pr->id : undef;
 }
 
+sub init_all_businesses {
+  return SL::DB::Manager::Business->get_all_sorted;
+}
+
 sub setup {
   my ($self) = @_;
   $::auth->assert('invoice_edit');
index 4508ba4..08caf09 100644 (file)
      <th align="right">[% LxERP.t8('Customer') %]</th>
      <td>[% L.input_tag('filter.customer.name:substr::ilike', filter.customer.name_substr__ilike, size = 20) %]</td>
     </tr>
+    <tr>
+     <th align="right">[% LxERP.t8('Customer type') %]</th>
+     <td>
+      [% L.select_tag('filter.customer.business_id', SELF.all_businesses,
+                      default    => filter.customer.business_id
+                      title_key  => 'description',
+                      value_key  => 'id',
+                      with_empty => 1,
+                      style      => 'width: 200px') %]
+     </td>
+    </tr>
     <tr>
      <th align="right">[% LxERP.t8('Delivery Order Date') %] [% LxERP.t8('From Date') %]</th>
      <td>[% L.date_tag('filter.transdate:date::ge', filter.transdate_date__ge) %]</td>