X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fustva.pl;h=6466565b0e4e0c16ffba35c87a26c008cc278077;hb=1e0d413084100ccd892e8c5be95703be5d965de7;hp=f04c8ee05599fe57daca333477503b22590a228d;hpb=596cb5d6b26c139b7e6669546d76f4c3c0f6ee58;p=kivitendo-erp.git
diff --git a/bin/mozilla/ustva.pl b/bin/mozilla/ustva.pl
index f04c8ee05..6466565b0 100644
--- a/bin/mozilla/ustva.pl
+++ b/bin/mozilla/ustva.pl
@@ -116,8 +116,7 @@ sub report {
my $company_given = ($form->{company} ne '')
? qq|
$form->{company}
\n|
- : qq||
+ : qq||
. $locale->text('No Company Name given') . qq|!
|;
@@ -912,28 +911,44 @@ sub generate_ustva {
my $period = $form->{period};
$period * 1;
$period--;
- $form->{period} = $period;
+ $form->{taxbird_period} = $period;
} else {
$form->header;
USTVA::error( $locale->text('Wrong Period' ));
::end_of_request();
}
+ # heuristics for address splitting
+ # lx-office holds the entire address in a single field.
+ # taxbird expects it to be splitted into street, zipcode and city
+ if ($form->{co_street} =~ /\n/) {
+ my $new_co_street;
+ for (split /\n/, $form->{co_street}) {
+ if (/(\d{3,5})\s+(\w+)/) {
+ $form->{co_zip} = $1;
+ $form->{co_city} = $2;
+ } else {
+ $new_co_street .= $_;
+ }
+ }
+ $form->{co_street} = $new_co_street;
+ } else {
+ $form->{co_zip} = $form->{co_city};
+ $form->{co_zip} =~ s/\D//g;
+ $form->{co_city} =~ s/\d//g;
+ $form->{co_city} =~ s/^\s//g;
+ }
+
my $tax_office = first { $_->{name} eq $form->{elsterland} } @{ $ustva->{tax_office_information} };
$form->{taxbird_land_nr} = $tax_office->{taxbird_nr} if $tax_office;
- $form->{co_zip} = $form->{co_city};
- $form->{co_zip} =~ s/\D//g;
- $form->{co_city} =~ s/\d//g;
- $form->{co_city} =~ s/^\s//g;
-
($form->{co_phone_prefix}, $form->{co_phone}) = split("-", $form->{tel});
$form->{co_phone_prefix} =~ s/\s//g;
$form->{co_phone} =~ s/\s//g;
$form->{taxbird_steuernummer} = $form->{steuernummer};
# $form->{taxbird_steuernummer} =~ s/\D//g;
- $form->{taxbird_steuernummer} =~ s/\///; # ersten Querstrich ersetzen
+# $form->{taxbird_steuernummer} =~ s/\///; # ersten Querstrich ersetzen
# Numberformatting for Taxbird
my $temp_numberformat = $myconfig{numberformat};