Revision 51c76e20
Von Johannes Grassler vor mehr als 1 Jahr hinzugefügt
SL/Controller/ZUGFeRD.pm | ||
---|---|---|
|
||
$vendor = find_vendor($metadata{'ustid'}, $metadata{'taxnumber'});
|
||
|
||
die t8("Please add a valid VAT ID or tax number for this vendor: #1", $metadata{'vendor_name'}) unless $vendor;
|
||
die t8("Vendor with VAT ID (#1) and/or tax ID (#2) not found. Please check if the vendor " .
|
||
"#3 exists and whether it has the correct tax ID/VAT ID." ,
|
||
$metadata{'ustid'},
|
||
$metadata{'taxnumber'},
|
||
$metadata{'vendor_name'},
|
||
) unless $vendor;
|
||
|
||
|
||
# Create a record template for this imported invoice
|
||
... | ... | |
);
|
||
|
||
$template_ap->assign_attributes(
|
||
template_name => "Faktur-X/ZUGFeRD/XRechnung Import $vendor->name, $invnumber",
|
||
template_name => t8("Faktur-X/ZUGFeRD/XRechnung import #1, #2", $vendor->name, $invnumber),
|
||
template_type => 'ap_transaction',
|
||
direct_debit => $metadata{'direct_debit'},
|
||
notes => "Faktur-X/ZUGFeRD/XRechnung Import. Type: $metadata{'type'}\nIBAN: " . $ibanmessage,
|
||
... | ... | |
# be sufficient for that to happen), grab the first tax fitting the default
|
||
# category, just like the AP form would do it for manual entry.
|
||
if ( scalar @{$taxes} == 0 ) {
|
||
$taxes = SL::D::ManagerTax->get_all(
|
||
$taxes = SL::DB::Manager::Tax->get_all(
|
||
where => [ chart_categories => { like => '%' . $default_ap_amount_chart->category . '%' } ],
|
||
);
|
||
}
|
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);
|
||
}
|
locale/de/all | ||
---|---|---|
'Factur-X/ZUGFeRD invoice' => 'Factur-X-/ZUGFeRD-Rechnung',
|
||
'Factur-X/ZUGFeRD notes for each invoice' => 'Factur-X-/ZUGFeRD-Notizen für jede Rechnung',
|
||
'Factur-X/ZUGFeRD settings' => 'Factur-X-/ZUGFeRD-Einstellungen',
|
||
'Faktur-X/ZUGFeRD/XRechnung import #1, #2' => 'Faktur-X/ZUGFeRD/XRechnung-Import #1, #2',
|
||
'Fax' => 'Fax',
|
||
'Features' => 'Features',
|
||
'Feb' => 'Feb',
|
||
... | ... | |
'Paid' => 'bezahlt',
|
||
'Paid amount' => 'Bezahlter Betrag',
|
||
'Parameter module must be given.' => 'Der Parameter "module" miss angegeben werden.',
|
||
'Parsing the XML data failed: #1' => 'Parsen der XML-Daten fehlgeschlagen: #1',
|
||
'Parsing the XMP metadata failed.' => 'Parsen der XMP-Metadaten schlug fehl.',
|
||
'Part' => 'Ware',
|
||
'Part "#1" has chargenumber or best before date set. So it cannot be transfered automatically.' => 'Bei Artikel "#1" ist eine Chargenummer oder ein Mindesthaltbarkeitsdatum vergeben. Deshalb kann dieser Artikel nicht automatisch ausgelagert werden.',
|
Auch abrufbar als: Unified diff
ZUGFeRD-Import: verschiedene behoben