273 |
273 |
return $self->js->flash('error', t8('Media \'#1\' is not supported yet/anymore.', $media))->render;
|
274 |
274 |
}
|
275 |
275 |
|
276 |
|
my $language;
|
277 |
|
$language = SL::DB::Language->new(id => $::form->{print_options}->{language_id})->load if $::form->{print_options}->{language_id};
|
278 |
|
|
279 |
276 |
# create a form for generate_attachment_filename
|
280 |
277 |
my $form = Form->new;
|
281 |
278 |
$form->{$self->nr_key()} = $self->order->number;
|
282 |
279 |
$form->{type} = $self->type;
|
283 |
280 |
$form->{format} = $format;
|
284 |
281 |
$form->{formname} = $formname;
|
285 |
|
$form->{language} = '_' . $language->template_code if $language;
|
|
282 |
$form->{language} = '_' . $self->order->language->template_code if $self->order->language;
|
286 |
283 |
my $pdf_filename = $form->generate_attachment_filename();
|
287 |
284 |
|
288 |
285 |
my $pdf;
|
289 |
286 |
my @errors = generate_pdf($self->order, \$pdf, { format => $format,
|
290 |
287 |
formname => $formname,
|
291 |
|
language => $language,
|
|
288 |
language => $self->order->language,
|
292 |
289 |
groupitems => $groupitems });
|
293 |
290 |
if (scalar @errors) {
|
294 |
291 |
return $self->js->flash('error', t8('Conversion to PDF failed: #1', $errors[0]))->render;
|
... | ... | |
431 |
428 |
$::form->{media} = 'email';
|
432 |
429 |
|
433 |
430 |
if (($::form->{attachment_policy} // '') !~ m{^(?:old_file|no_file)$}) {
|
434 |
|
my $language;
|
435 |
|
$language = SL::DB::Language->new(id => $::form->{print_options}->{language_id})->load if $::form->{print_options}->{language_id};
|
436 |
|
|
437 |
431 |
my $pdf;
|
438 |
432 |
my @errors = generate_pdf($self->order, \$pdf, {media => $::form->{media},
|
439 |
433 |
format => $::form->{print_options}->{format},
|
440 |
434 |
formname => $::form->{print_options}->{formname},
|
441 |
|
language => $language,
|
|
435 |
language => $self->order->language,
|
442 |
436 |
groupitems => $::form->{print_options}->{groupitems}});
|
443 |
437 |
if (scalar @errors) {
|
444 |
438 |
return $self->js->flash('error', t8('Conversion to PDF failed: #1', $errors[0]))->render($self);
|
... | ... | |
708 |
702 |
->val( '#order_payment_id', $self->order->payment_id)
|
709 |
703 |
->val( '#order_delivery_term_id', $self->order->delivery_term_id)
|
710 |
704 |
->val( '#order_intnotes', $self->order->intnotes)
|
711 |
|
->val( '#language_id', $self->order->$cv_method->language_id)
|
|
705 |
->val( '#order_language_id', $self->order->$cv_method->language_id)
|
712 |
706 |
->focus( '#order_' . $self->cv . '_id')
|
713 |
707 |
->run('kivi.Order.update_exchangerate');
|
714 |
708 |
|
... | ... | |
1760 |
1754 |
$self->{all_taxzones} = SL::DB::Manager::TaxZone->get_all_sorted();
|
1761 |
1755 |
$self->{all_currencies} = SL::DB::Manager::Currency->get_all_sorted();
|
1762 |
1756 |
$self->{all_departments} = SL::DB::Manager::Department->get_all_sorted();
|
|
1757 |
$self->{all_languages} = SL::DB::Manager::Language->get_all_sorted();
|
1763 |
1758 |
$self->{all_employees} = SL::DB::Manager::Employee->get_all(where => [ or => [ id => $self->order->employee_id,
|
1764 |
1759 |
deleted => 0 ] ],
|
1765 |
1760 |
sort_by => 'name');
|
... | ... | |
1777 |
1772 |
my $print_form = Form->new('');
|
1778 |
1773 |
$print_form->{type} = $self->type;
|
1779 |
1774 |
$print_form->{printers} = SL::DB::Manager::Printer->get_all_sorted;
|
1780 |
|
$print_form->{languages} = SL::DB::Manager::Language->get_all_sorted;
|
1781 |
|
$print_form->{language_id} = $self->order->language_id;
|
1782 |
1775 |
$self->{print_options} = SL::Helper::PrintOptions->get_print_options(
|
1783 |
1776 |
form => $print_form,
|
1784 |
1777 |
options => {dialog_name_prefix => 'print_options.',
|
Neuer Angebots-/Auftragscontroller: Sprach-Drop-Down aus Print-Optionen in Hauptbeleg verschoben