X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/575f3ac727df48ba0ae5624e4de0ff0a7fd9f37f..f217d072d76183bc07723dcc29503b732bd2022d:/SL/Helper/PrintOptions.pm diff --git a/SL/Helper/PrintOptions.pm b/SL/Helper/PrintOptions.pm index a4e1f0ef5..eab17294b 100644 --- a/SL/Helper/PrintOptions.pm +++ b/SL/Helper/PrintOptions.pm @@ -18,11 +18,15 @@ sub opthash { +{ value => shift, selected => shift, oname => shift } } sub get_print_options { my ($class, %params) = @_; + no warnings 'once'; + my $form = $params{form} || $::form; my $myconfig = $params{myconfig} || \%::myconfig; my $locale = $params{locale} || $::locale; my $options = $params{options}; + use warnings 'once'; + my $prefix = $options->{dialog_name_prefix} || ''; # names 3 parameters and returns a hashref, for use in templates @@ -46,8 +50,14 @@ sub get_print_options { opthash("purchase_order", $form->{PD}{purchase_order}, $locale->text('Purchase Order')), opthash("bin_list", $form->{PD}{bin_list}, $locale->text('Bin List')) ) : undef, + ($form->{type} eq 'purchase_order_confirmation') ? ( + opthash("purchase_order_confirmation", $form->{PD}{purchase_order}, $locale->text('Purchase Order Confirmation')), + ) : undef, ($form->{type} eq 'credit_note') ? opthash("credit_note", $form->{PD}{credit_note}, $locale->text('Credit Note')) : undef, + ($form->{type} eq 'sales_order_intake') ? ( + opthash("sales_order_intake", $form->{PD}{sales_order_intake}, $locale->text('Sales Order Intake')), + ) : undef, ($form->{type} eq 'sales_order') ? ( opthash("sales_order", $form->{PD}{sales_order}, $locale->text('Confirmation')), opthash("proforma", $form->{PD}{proforma}, $locale->text('Proforma Invoice')), @@ -57,17 +67,36 @@ sub get_print_options { opthash('sales_quotation', $form->{PD}{sales_quotation}, $locale->text('Quotation')) : undef, ($form->{type} =~ /request_quotation$/) ? opthash('request_quotation', $form->{PD}{request_quotation}, $locale->text('Request for Quotation')) : undef, - ($form->{type} eq 'invoice') ? ( + ($form->{type} eq 'purchase_quotation_intake') ? ( + opthash("purchase_quotation_intake", $form->{PD}{purchase_quotation_intake}, $locale->text('Purchase Quotation Intake')), + ) : undef, + ($form->{type} eq 'invoice' && $form->{storno} && $form->{storno_id}) ? ( + opthash("storno_invoice", $form->{PD}{storno_invoice}, $locale->text('Storno Invoice')), + ) : undef, + ($form->{type} eq 'invoice' && !($form->{storno} && $form->{storno_id})) ? ( opthash("invoice", $form->{PD}{invoice}, $locale->text('Invoice')), opthash("proforma", $form->{PD}{proforma}, $locale->text('Proforma Invoice')), + opthash("invoice_copy", $form->{PD}{invoice_copy}, $locale->text('Invoice Copy')), ) : undef, - ($form->{type} eq 'invoice' && $form->{storno}) ? ( - opthash("storno_invoice", $form->{PD}{storno_invoice}, $locale->text('Storno Invoice')), + ($form->{type} eq 'invoice_for_advance_payment') ? ( + opthash("invoice_for_advance_payment", $form->{PD}{invoice_for_advance_payment}, $locale->text('Invoice for Advance Payment')), + ) : undef, + ($form->{type} eq 'final_invoice') ? ( + opthash("final_invoice", $form->{PD}{final_invoice}, $locale->text('Final Invoice')), ) : undef, - ($form->{type} =~ /_delivery_order$/) ? ( + ($form->{type} =~ /^supplier_delivery_order$/) ? ( + opthash('supplier_delivery_order', $form->{PD}{supplier_delivery_order}, $locale->text('Supplier Delivery Order')), + ) : undef, + ($form->{type} =~ /^rma_delivery_order$/) ? ( + opthash('rma_delivery_order', $form->{PD}{rma_delivery_order}, $locale->text('RMA Delivery Order')), + ) : undef, + ($form->{type} =~ /(sales|purchase)_delivery_order$/) ? ( opthash($form->{type}, $form->{PD}{$form->{type}}, $locale->text('Delivery Order')), opthash('pick_list', $form->{PD}{pick_list}, $locale->text('Pick List')), ) : undef, + ($form->{type} =~ /_reclamation$/) ? ( + opthash($form->{type}, $form->{PD}{$form->{type}}, $locale->text('Reclamation')), + ) : undef, ($form->{type} =~ /^letter$/) ? ( opthash('letter', $form->{PD}{letter}, $locale->text('Letter')), ) : undef; @@ -87,9 +116,9 @@ sub get_print_options { if ($form->{media} ne 'email'); push @FORMAT, grep $_, - ($::lx_office_conf{print_templates}->{opendocument} && $::lx_office_conf{applications}->{openofficeorg_writer} && $::lx_office_conf{applications}->{xvfb} - && (-x $::lx_office_conf{applications}->{openofficeorg_writer}) && (-x $::lx_office_conf{applications}->{xvfb}) - && !$options->{no_opendocument_pdf}) ? + ($::lx_office_conf{print_templates}->{opendocument} && $::lx_office_conf{applications}->{openofficeorg_writer} + && (-x $::lx_office_conf{applications}->{openofficeorg_writer}) + && !$options->{no_opendocument_pdf}) ? opthash("opendocument_pdf", $form->{DF}{"opendocument_pdf"}, $locale->text("PDF (OpenDocument/OASIS)")) : undef, ($::lx_office_conf{print_templates}->{latex}) ? opthash("pdf", $form->{DF}{pdf}, $locale->text('PDF')) : undef, @@ -133,7 +162,9 @@ sub get_print_options { display_copies => scalar @{ $form->{printers} || [] } && $::lx_office_conf{print_templates}->{latex} && $form->{media} ne 'email', display_remove_draft => (!$form->{id} && $form->{draft_id}), display_groupitems => !$dont_display_groupitems{$form->{type}}, + display_bothsided => $options->{show_bothsided}, groupitems_checked => $form->{groupitems} ? "checked" : '', + bothsided_checked => $form->{bothsided} ? "checked" : '', remove_draft_checked => $form->{remove_draft} ? "checked" : '' );