Revision cf0455f5
Von Moritz Bunkus vor fast 5 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
1288 | 1288 |
$form->{TEMPLATE_DRIVER_OPTIONS}->{variable_content_types} = $form->get_variable_content_types(); |
1289 | 1289 |
} |
1290 | 1290 |
|
1291 |
if ($form->{format} =~ m{pdf}) { |
|
1292 |
_maybe_attach_zugferd_data($form); |
|
1293 |
} |
|
1294 |
|
|
1291 | 1295 |
$form->isblank("email", $locale->text('E-mail address missing!')) |
1292 | 1296 |
if ($form->{media} eq 'email'); |
1293 | 1297 |
$form->isblank("${inv}date", |
... | ... | |
2110 | 2114 |
|
2111 | 2115 |
print $::form->redirect_header($script . '?action=edit&id=' . $::form->escape($id) . '&type=' . $::form->escape($type)); |
2112 | 2116 |
} |
2117 |
|
|
2118 |
sub _maybe_attach_zugferd_data { |
|
2119 |
my ($form) = @_; |
|
2120 |
|
|
2121 |
my $record = _make_record(); |
|
2122 |
|
|
2123 |
return if !$record || !$record->can('create_pdf_a_print_options') || !$record->can('create_zugferd_data'); |
|
2124 |
|
|
2125 |
my $xmlfile = File::Temp->new; |
|
2126 |
$xmlfile->print($record->create_zugferd_data); |
|
2127 |
$xmlfile->close; |
|
2128 |
|
|
2129 |
$form->{TEMPLATE_DRIVER_OPTIONS}->{pdf_a} = $record->create_pdf_a_print_options(zugferd_xmp_data => $record->create_zugferd_xmp_data); |
|
2130 |
$form->{TEMPLATE_DRIVER_OPTIONS}->{pdf_attachments} = [ |
|
2131 |
{ source => $xmlfile, |
|
2132 |
name => 'ZUGFeRD-invoice.xml', |
|
2133 |
description => $::locale->text('ZUGFeRD invoice'), |
|
2134 |
relationship => '/Alternative', |
|
2135 |
mime_type => 'text/xml', |
|
2136 |
} |
|
2137 |
]; |
|
2138 |
} |
Auch abrufbar als: Unified diff
ZUGFeRD: Rechnungen mit ZUGFeRD-Daten erzeugen