Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 3f93bd6c

Von Johannes Grassler vor mehr als 1 Jahr hinzugefügt

  • ID 3f93bd6c3c7050de01ee6d312dc32380053e7676
  • Vorgänger 70affac4
  • Nachfolger cfc1ced6

ZUGFeRD-Import: verschiedene behoben

  • Fehlermeldung bei nicht gefundener UStID/Steuernummer verbessert.
  • Interpolation von Lieferantenname in Buchungsvorlagenname repariert.
  • Tippfehler bei SL::DB::ManagerTax->get_all behoben.
  • Fehlermeldung bei unbekanntem XML-Wurzelelement repariert.
  • Suche nach fehlenden Elementen in $self->_data_keys mit grep
  • Fehlermeldung "Parsing the XML data failed" repariert

Unterschiede anzeigen:

SL/XMLInvoice.pm
use XML::LibXML;
use SL::XMLInvoice::UBL;
use SL::XMLInvoice::CrossIndustryInvoice;
require SL::XMLInvoice::UBL;
require SL::XMLInvoice::CrossIndustryInvoice;
use constant RES_OK => 0;
use constant RES_XML_PARSING_FAILED => 1;
......
=cut
sub data_keys {
sub data_keys {
my @keys = (
'currency', # The bill's currency, such as "EUR"
'direct_debit', # Boolean: whether the bill will get paid by direct debit (1) or not (0)
......
$self->{dom} = eval { XML::LibXML->load_xml(string => $xml_data) };
if ( ! $self->{dom} ) {
$self->{message} = $::locale->text("Parsing the XML data failed: $xml_data");
$self->{message} = t8("Parsing the XML data failed: #1", $xml_data);
$self->{result} = RES_XML_PARSING_FAILED;
return $self;
}
......
unless ( $type ) {
$self->{result} = RES_UNKNOWN_ROOT_NODE_TYPE;
my $node_types = keys %{ $self->_document_nodenames };
my $node_types = join(",", keys %{ $self->_document_nodenames });
$self->{message} = t8("Could not parse XML Invoice: unknown root node name (#1) (supported: (#2))",
$document_nodename,
$node_types,
$document_nodename);
);
return $self;
}
......
# Implementation sanity check for child classes: make sure they are aware of
# the keys the hash returned by their metadata() method must contain.
my @missing_data_keys = grep { !${$self->_data_keys}{$data_key} } @{ $self->data_keys };
my @missing_data_keys = grep { !${$self->_data_keys}{$_} } @{ $self->data_keys };
if ( scalar(@missing_data_keys) > 0 ) {
die "Incomplete implementation: the following metadata keys appear to be missing from $type: " . join(", ", @missing_data_keys);
}

Auch abrufbar als: Unified diff