Revision ba8675f5
Von Tamino Steinert vor 9 Monaten hinzugefügt
SL/DB/Helper/ZUGFeRD.pm | ||
---|---|---|
34 | 34 |
use List::Util qw(first sum); |
35 | 35 |
use Template; |
36 | 36 |
use XML::Writer; |
37 |
use Params::Validate qw(:all); |
|
37 | 38 |
|
38 | 39 |
my @line_names = qw(LineOne LineTwo LineThree); |
39 | 40 |
|
... | ... | |
713 | 714 |
} |
714 | 715 |
|
715 | 716 |
sub import_zugferd_data { |
716 |
my ($self, $zugferd_data) = @_; |
|
717 |
|
|
718 |
my $parser = $zugferd_data->{'invoice_xml'}; |
|
717 |
my ($self, $zugferd_parser) = @_; |
|
718 |
validate_pos(@_, |
|
719 |
{ |
|
720 |
isa => 'SL::DB::PurchaseInvoice', |
|
721 |
}, |
|
722 |
{ |
|
723 |
# document class of SL::XMLInvoice |
|
724 |
can => qw(metadata items) |
|
725 |
} |
|
726 |
); |
|
719 | 727 |
|
720 |
my %metadata = %{$parser->metadata}; |
|
721 |
my @items = @{$parser->items}; |
|
728 |
my %metadata = %{$zugferd_parser->metadata};
|
|
729 |
my @items = @{$zugferd_parser->items};
|
|
722 | 730 |
|
723 | 731 |
my $intnotes = t8("ZUGFeRD Import. Type: #1", $metadata{'type'})->translated; |
724 | 732 |
my $iban = $metadata{'iban'}; |
SL/Helper/EmailProcessing.pm | ||
---|---|---|
77 | 77 |
|
78 | 78 |
my $purchase_invoice; |
79 | 79 |
eval { |
80 |
$purchase_invoice = SL::DB::PurchaseInvoice->create_from_zugferd_data(\%res)->save();
|
|
80 |
$purchase_invoice = SL::DB::PurchaseInvoice->create_from_zugferd_data($res{invoice_xml})->save();
|
|
81 | 81 |
1; |
82 | 82 |
} or do { |
83 | 83 |
my $error = $@; |
Auch abrufbar als: Unified diff
S:D:H:ZUGFeRD::import_zugferd_data: validiere Parameter