X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FMassInvoiceCreatePrint.pm;h=aab63731aa319ef6739ce2d31bef30a4a027399a;hb=8298c2ea8ba03bb3d1eb85a3ce0a049a505433ae;hp=bccd4a2c47a829994672f8b9f0ce2518432c757a;hpb=f372dca8af799141b0bc19e4ede7951ae579a967;p=kivitendo-erp.git diff --git a/SL/Controller/MassInvoiceCreatePrint.pm b/SL/Controller/MassInvoiceCreatePrint.pm index bccd4a2c4..aab63731a 100644 --- a/SL/Controller/MassInvoiceCreatePrint.pm +++ b/SL/Controller/MassInvoiceCreatePrint.pm @@ -15,13 +15,14 @@ use SL::DB::Order; use SL::DB::Printer; use SL::Helper::MassPrintCreatePDF qw(:all); use SL::Helper::CreatePDF qw(:all); +use SL::Helper::File qw(store_pdf append_general_pdf_attachments doc_storage_enabled); use SL::Helper::Flash; use SL::Locale::String; 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'); @@ -112,7 +113,7 @@ sub action_print { return $self->redirect_to(action => 'list_invoices'); } - $self->download_or_print_documents(printer_id => $::form->{printer_id}, invoices => \@invoices); + $self->download_or_print_documents(printer_id => $::form->{printer_id}, invoices => \@invoices, bothsided => $::form->{bothsided}); } sub action_create_print_all_start { @@ -213,7 +214,7 @@ sub _init_sales_delivery_order_models { }, customer => t8('Customer'), employee => t8('Employee'), - transdate => t8('Date'), + transdate => t8('Delivery Order Date'), donumber => t8('Delivery Order Number'), ordnumber => t8('Order Number'), }, @@ -261,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'); @@ -290,7 +295,7 @@ sub download_or_print_documents { }); @pdf_file_names = $self->create_pdfs(%pdf_params); - my $merged_pdf = $self->merge_pdfs(file_names => \@pdf_file_names); + my $merged_pdf = $self->merge_pdfs(file_names => \@pdf_file_names, bothsided => $params{bothsided}); unlink @pdf_file_names; if (!$params{printer_id}) { @@ -324,8 +329,8 @@ sub make_filter_summary { my @filters = ( [ $filter->{customer}{"name:substr::ilike"}, t8('Customer') ], - [ $filter->{"transdate:date::ge"}, t8('Transdate') . " " . t8('From Date') ], - [ $filter->{"transdate:date::le"}, t8('Transdate') . " " . t8('To Date') ], + [ $filter->{"transdate:date::ge"}, t8('Delivery Order Date') . " " . t8('From Date') ], + [ $filter->{"transdate:date::le"}, t8('Delivery Order Date') . " " . t8('To Date') ], ); for (@filters) { @@ -371,17 +376,15 @@ sub setup_list_sales_delivery_orders_action_bar { tooltip => t8("Create and print invoices") ], action => [ - t8('for selected entries'), + t8("Create and print invoices for all selected delivery orders"), call => [ 'kivi.MassInvoiceCreatePrint.submitMassCreationForm' ], - tooltip => t8("Create and print invoices for all selected delivery orders"), disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef, only_if => $params{show_creation_buttons}, ], action => [ - t8('for all entries'), + t8("Create and print invoices for all delivery orders matching the filter"), call => [ 'kivi.MassInvoiceCreatePrint.createPrintAllInitialize' ], - tooltip => t8("Create and print invoices for all delivery orders matching the filter"), disabled => !$params{num_rows} ? $::locale->text('The report doesn\'t contain entries.') : undef, only_if => $params{show_creation_buttons}, ],