Revision 377e8efa
Von Johannes Grassler vor mehr als 1 Jahr hinzugefügt
SL/Controller/ZUGFeRD.pm | ||
---|---|---|
163 | 163 |
|
164 | 164 |
$vendor = find_vendor($metadata{'ustid'}, $metadata{'taxnumber'}); |
165 | 165 |
|
166 |
die t8("Please add a valid VAT ID or tax number for this vendor: #1", $metadata{'vendor_name'}) unless $vendor; |
|
166 |
die t8("Vendor with VAT ID (#1) and/or tax ID (#2) not found. Please check if the vendor " . |
|
167 |
"#3 exists and whether it has the correct tax ID/VAT ID." , |
|
168 |
$metadata{'ustid'}, |
|
169 |
$metadata{'taxnumber'}, |
|
170 |
$metadata{'vendor_name'}, |
|
171 |
) unless $vendor; |
|
167 | 172 |
|
168 | 173 |
|
169 | 174 |
# Create a record template for this imported invoice |
... | ... | |
207 | 212 |
); |
208 | 213 |
|
209 | 214 |
$template_ap->assign_attributes( |
210 |
template_name => "Faktur-X/ZUGFeRD/XRechnung Import $vendor->name, $invnumber",
|
|
215 |
template_name => t8("Faktur-X/ZUGFeRD/XRechnung import #1, #2", $vendor->name, $invnumber),
|
|
211 | 216 |
template_type => 'ap_transaction', |
212 | 217 |
direct_debit => $metadata{'direct_debit'}, |
213 | 218 |
notes => "Faktur-X/ZUGFeRD/XRechnung Import. Type: $metadata{'type'}\nIBAN: " . $ibanmessage, |
... | ... | |
239 | 244 |
# be sufficient for that to happen), grab the first tax fitting the default |
240 | 245 |
# category, just like the AP form would do it for manual entry. |
241 | 246 |
if ( scalar @{$taxes} == 0 ) { |
242 |
$taxes = SL::D::ManagerTax->get_all(
|
|
247 |
$taxes = SL::DB::Manager::Tax->get_all(
|
|
243 | 248 |
where => [ chart_categories => { like => '%' . $default_ap_amount_chart->category . '%' } ], |
244 | 249 |
); |
245 | 250 |
} |
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 | ||
---|---|---|
1680 | 1680 |
'Factur-X/ZUGFeRD invoice' => 'Factur-X-/ZUGFeRD-Rechnung', |
1681 | 1681 |
'Factur-X/ZUGFeRD notes for each invoice' => 'Factur-X-/ZUGFeRD-Notizen für jede Rechnung', |
1682 | 1682 |
'Factur-X/ZUGFeRD settings' => 'Factur-X-/ZUGFeRD-Einstellungen', |
1683 |
'Faktur-X/ZUGFeRD/XRechnung import #1, #2' => 'Faktur-X/ZUGFeRD/XRechnung-Import #1, #2', |
|
1683 | 1684 |
'Fax' => 'Fax', |
1684 | 1685 |
'Features' => 'Features', |
1685 | 1686 |
'Feb' => 'Feb', |
... | ... | |
2670 | 2671 |
'Paid' => 'bezahlt', |
2671 | 2672 |
'Paid amount' => 'Bezahlter Betrag', |
2672 | 2673 |
'Parameter module must be given.' => 'Der Parameter "module" miss angegeben werden.', |
2674 |
'Parsing the XML data failed: #1' => 'Parsen der XML-Daten fehlgeschlagen: #1', |
|
2673 | 2675 |
'Parsing the XMP metadata failed.' => 'Parsen der XMP-Metadaten schlug fehl.', |
2674 | 2676 |
'Part' => 'Ware', |
2675 | 2677 |
'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