Revision 333003d3
Von Moritz Bunkus vor fast 5 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
2122 | 2122 |
|
2123 | 2123 |
return if !$record || !$record->can('create_pdf_a_print_options') || !$record->can('create_zugferd_data'); |
2124 | 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 |
]; |
|
2125 |
eval { |
|
2126 |
my $xmlfile = File::Temp->new; |
|
2127 |
$xmlfile->print($record->create_zugferd_data); |
|
2128 |
$xmlfile->close; |
|
2129 |
|
|
2130 |
$form->{TEMPLATE_DRIVER_OPTIONS}->{pdf_a} = $record->create_pdf_a_print_options(zugferd_xmp_data => $record->create_zugferd_xmp_data); |
|
2131 |
$form->{TEMPLATE_DRIVER_OPTIONS}->{pdf_attachments} = [ |
|
2132 |
{ source => $xmlfile, |
|
2133 |
name => 'ZUGFeRD-invoice.xml', |
|
2134 |
description => $::locale->text('ZUGFeRD invoice'), |
|
2135 |
relationship => '/Alternative', |
|
2136 |
mime_type => 'text/xml', |
|
2137 |
} |
|
2138 |
]; |
|
2139 |
}; |
|
2140 |
|
|
2141 |
if (my $e = SL::X::ZUGFeRDValidation->caught) { |
|
2142 |
$::form->error($e->message); |
|
2143 |
} |
|
2138 | 2144 |
} |
Auch abrufbar als: Unified diff
ZUGFeRD: Validierung diverser nötiger Parameter