Revision 3f93bd6c
Von Johannes Grassler vor mehr als 1 Jahr hinzugefügt
SL/Controller/ZUGFeRD.pm | ||
---|---|---|
167 | 167 |
|
168 | 168 |
$vendor = find_vendor($metadata{'ustid'}, $metadata{'taxnumber'}); |
169 | 169 |
|
170 |
die t8("Please add a valid VAT ID or tax number for this vendor: #1", $metadata{'vendor_name'}) unless $vendor; |
|
170 |
die t8("Vendor with VAT ID (#1) and/or tax ID (#2) not found. Please check if the vendor " . |
|
171 |
"#3 exists and whether it has the correct tax ID/VAT ID." , |
|
172 |
$metadata{'ustid'}, |
|
173 |
$metadata{'taxnumber'}, |
|
174 |
$metadata{'vendor_name'}, |
|
175 |
) unless $vendor; |
|
171 | 176 |
|
172 | 177 |
|
173 | 178 |
# Create a record template for this imported invoice |
... | ... | |
216 | 221 |
); |
217 | 222 |
|
218 | 223 |
$template_ap->assign_attributes( |
219 |
template_name => "Faktur-X/ZUGFeRD/XRechnung Import $vendor->name, $invnumber",
|
|
224 |
template_name => t8("Faktur-X/ZUGFeRD/XRechnung import #1, #2", $vendor->name, $invnumber),
|
|
220 | 225 |
template_type => 'ap_transaction', |
221 | 226 |
direct_debit => $metadata{'direct_debit'}, |
222 | 227 |
notes => "Faktur-X/ZUGFeRD/XRechnung Import. Type: $metadata{'type'}\nIBAN: " . $ibanmessage, |
... | ... | |
248 | 253 |
# be sufficient for that to happen), grab the first tax fitting the default |
249 | 254 |
# category, just like the AP form would do it for manual entry. |
250 | 255 |
if ( scalar @{$taxes} == 0 ) { |
251 |
$taxes = SL::D::ManagerTax->get_all(
|
|
256 |
$taxes = SL::DB::Manager::Tax->get_all(
|
|
252 | 257 |
where => [ chart_categories => { like => '%' . $default_ap_amount_chart->category . '%' } ], |
253 | 258 |
); |
254 | 259 |
} |
SL/XMLInvoice.pm | ||
---|---|---|
5 | 5 |
|
6 | 6 |
use XML::LibXML; |
7 | 7 |
|
8 |
use SL::XMLInvoice::UBL;
|
|
9 |
use SL::XMLInvoice::CrossIndustryInvoice;
|
|
8 |
require SL::XMLInvoice::UBL;
|
|
9 |
require SL::XMLInvoice::CrossIndustryInvoice;
|
|
10 | 10 |
|
11 | 11 |
use constant RES_OK => 0; |
12 | 12 |
use constant RES_XML_PARSING_FAILED => 1; |
... | ... | |
92 | 92 |
|
93 | 93 |
=cut |
94 | 94 |
|
95 |
sub data_keys {
|
|
95 |
sub data_keys { |
|
96 | 96 |
my @keys = ( |
97 | 97 |
'currency', # The bill's currency, such as "EUR" |
98 | 98 |
'direct_debit', # Boolean: whether the bill will get paid by direct debit (1) or not (0) |
... | ... | |
267 | 267 |
$self->{dom} = eval { XML::LibXML->load_xml(string => $xml_data) }; |
268 | 268 |
|
269 | 269 |
if ( ! $self->{dom} ) { |
270 |
$self->{message} = $::locale->text("Parsing the XML data failed: $xml_data");
|
|
270 |
$self->{message} = t8("Parsing the XML data failed: #1", $xml_data);
|
|
271 | 271 |
$self->{result} = RES_XML_PARSING_FAILED; |
272 | 272 |
return $self; |
273 | 273 |
} |
... | ... | |
280 | 280 |
|
281 | 281 |
unless ( $type ) { |
282 | 282 |
$self->{result} = RES_UNKNOWN_ROOT_NODE_TYPE; |
283 |
my $node_types = keys %{ $self->_document_nodenames };
|
|
283 |
my $node_types = join(",", keys %{ $self->_document_nodenames });
|
|
284 | 284 |
$self->{message} = t8("Could not parse XML Invoice: unknown root node name (#1) (supported: (#2))", |
285 |
$document_nodename, |
|
285 | 286 |
$node_types, |
286 |
$document_nodename);
|
|
287 |
); |
|
287 | 288 |
return $self; |
288 | 289 |
} |
289 | 290 |
|
... | ... | |
291 | 292 |
|
292 | 293 |
# Implementation sanity check for child classes: make sure they are aware of |
293 | 294 |
# the keys the hash returned by their metadata() method must contain. |
294 |
my @missing_data_keys = grep { !${$self->_data_keys}{$data_key} } @{ $self->data_keys };
|
|
295 |
my @missing_data_keys = grep { !${$self->_data_keys}{$_} } @{ $self->data_keys };
|
|
295 | 296 |
if ( scalar(@missing_data_keys) > 0 ) { |
296 | 297 |
die "Incomplete implementation: the following metadata keys appear to be missing from $type: " . join(", ", @missing_data_keys); |
297 | 298 |
} |
locale/de/all | ||
---|---|---|
1692 | 1692 |
'Factur-X/ZUGFeRD invoice' => 'Factur-X-/ZUGFeRD-Rechnung', |
1693 | 1693 |
'Factur-X/ZUGFeRD notes for each invoice' => 'Factur-X-/ZUGFeRD-Notizen für jede Rechnung', |
1694 | 1694 |
'Factur-X/ZUGFeRD settings' => 'Factur-X-/ZUGFeRD-Einstellungen', |
1695 |
'Faktur-X/ZUGFeRD/XRechnung import #1, #2' => 'Faktur-X/ZUGFeRD/XRechnung-Import #1, #2', |
|
1695 | 1696 |
'Fax' => 'Fax', |
1696 | 1697 |
'Features' => 'Features', |
1697 | 1698 |
'Feb' => 'Feb', |
... | ... | |
2689 | 2690 |
'Paid' => 'bezahlt', |
2690 | 2691 |
'Paid amount' => 'Bezahlter Betrag', |
2691 | 2692 |
'Parameter module must be given.' => 'Der Parameter "module" miss angegeben werden.', |
2693 |
'Parsing the XML data failed: #1' => 'Parsen der XML-Daten fehlgeschlagen: #1', |
|
2692 | 2694 |
'Parsing the XMP metadata failed.' => 'Parsen der XMP-Metadaten schlug fehl.', |
2693 | 2695 |
'Part' => 'Ware', |
2694 | 2696 |
'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