Revision 11e6f144
Von Udo Spallek vor fast 18 Jahren hinzugefügt
bin/mozilla/ustva.pl | ||
---|---|---|
852 | 852 |
#$form->{"iconv"} = Text::Iconv->new($myconfig{dbcharset}, "UTF-8"); |
853 | 853 |
#my $iconv = $self->{"iconv"}; |
854 | 854 |
#$iconv->convert($variable); |
855 |
|
|
856 | 855 |
if ($form->{period} =~ /^[4]\d$/ ){ |
857 | 856 |
my %periods = ( # Lx => taxbird |
858 | 857 |
'41' => '12', |
... | ... | |
864 | 863 |
foreach my $quarter ( keys %periods ) { |
865 | 864 |
$form->{taxbird_period} = $periods{$quarter} if ( $form->{period} eq $quarter); |
866 | 865 |
} |
867 |
|
|
868 |
my %lands = ( # Lx => taxbird # TODO: besser als array... |
|
869 |
'Baden W?rtemberg' => '0', |
|
870 |
'Bayern' => '1', |
|
871 |
'Berlin' => '2', |
|
872 |
'Brandenburg' => '3', |
|
873 |
'Bremen' => '4', |
|
874 |
'Hamburg' => '5', |
|
875 |
'Hessen' => '6', |
|
876 |
'Mecklenburg Vorpommern' => '7', |
|
877 |
'Niedersachsen' => '8', |
|
878 |
'Nordrhein Westfalen' => '9', |
|
879 |
'Rheinland Pfalz' => '10', |
|
880 |
'Saarland' => '11', |
|
881 |
'Sachsen' => '12', |
|
882 |
'Sachsen Anhalt' => '13', |
|
883 |
'Schleswig Holstein' => '14', |
|
884 |
'Th?ringen' => '15', |
|
885 |
); |
|
886 |
|
|
887 |
foreach my $land ( keys %lands ){ |
|
888 |
$form->{taxbird_land_nr} = $lands{$land} if ($form->{elsterland} eq $land ); |
|
889 |
} |
|
890 |
|
|
891 |
$form->{co_zip} = $form->{co_city}; |
|
892 |
$form->{co_zip} =~ s/\D//g; |
|
893 |
$form->{co_city} =~ s/\d//g; |
|
894 |
$form->{co_city} =~ s/^\s//g; |
|
895 |
|
|
896 |
($form->{co_phone_prefix}, $form->{co_phone}) = split("-", $form->{tel}); |
|
897 |
$form->{co_phone_prefix} =~ s/\s//g; |
|
898 |
$form->{co_phone} =~ s/\s//g; |
|
899 |
|
|
900 |
$form->{taxbird_steuernummer} = $form->{steuernummer}; |
|
901 |
# $form->{taxbird_steuernummer} =~ s/\D//g; |
|
902 |
$form->{taxbird_steuernummer} =~ s/\///; # ersten Querstrich ersetzen |
|
903 |
|
|
904 |
# Numberformatting for Taxbird |
|
905 |
my $temp_numberformat = $myconfig{numberformat}; |
|
906 |
|
|
907 |
# Numberformat must be '1000,00' for Taxbird ?! |
|
908 |
$myconfig{numberformat} = '1000,00'; |
|
909 |
|
|
910 |
foreach my $number (@category_cent) { |
|
911 |
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '2', '') : ''; |
|
912 |
} |
|
913 |
|
|
914 |
foreach my $number (@category_euro) { |
|
915 |
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '0', '') : ''; |
|
916 |
} |
|
917 |
# Re-set Numberformat |
|
918 |
$myconfig{numberformat} = $temp_numberformat; |
|
919 |
|
|
920 | 866 |
} elsif ($form->{period} =~ /^\d+$/ ) { |
921 | 867 |
$form->{period} =~ s/^0//g; |
922 | 868 |
my $period = $form->{period}; |
... | ... | |
929 | 875 |
exit(0); |
930 | 876 |
} |
931 | 877 |
|
878 |
my %lands = ( # Lx => taxbird # TODO: besser als array... |
|
879 |
'Baden W?rtemberg' => '0', |
|
880 |
'Bayern' => '1', |
|
881 |
'Berlin' => '2', |
|
882 |
'Brandenburg' => '3', |
|
883 |
'Bremen' => '4', |
|
884 |
'Hamburg' => '5', |
|
885 |
'Hessen' => '6', |
|
886 |
'Mecklenburg Vorpommern' => '7', |
|
887 |
'Niedersachsen' => '8', |
|
888 |
'Nordrhein Westfalen' => '9', |
|
889 |
'Rheinland Pfalz' => '10', |
|
890 |
'Saarland' => '11', |
|
891 |
'Sachsen' => '12', |
|
892 |
'Sachsen Anhalt' => '13', |
|
893 |
'Schleswig Holstein' => '14', |
|
894 |
'Th?ringen' => '15', |
|
895 |
); |
|
896 |
foreach my $land ( keys %lands ){ |
|
897 |
$form->{taxbird_land_nr} = $lands{$land} if ($form->{elsterland} eq $land ); |
|
898 |
} |
|
899 |
|
|
900 |
$form->{co_zip} = $form->{co_city}; |
|
901 |
$form->{co_zip} =~ s/\D//g; |
|
902 |
$form->{co_city} =~ s/\d//g; |
|
903 |
$form->{co_city} =~ s/^\s//g; |
|
904 |
|
|
905 |
($form->{co_phone_prefix}, $form->{co_phone}) = split("-", $form->{tel}); |
|
906 |
$form->{co_phone_prefix} =~ s/\s//g; |
|
907 |
$form->{co_phone} =~ s/\s//g; |
|
908 |
|
|
909 |
$form->{taxbird_steuernummer} = $form->{steuernummer}; |
|
910 |
# $form->{taxbird_steuernummer} =~ s/\D//g; |
|
911 |
$form->{taxbird_steuernummer} =~ s/\///; # ersten Querstrich ersetzen |
|
912 |
|
|
913 |
# Numberformatting for Taxbird |
|
914 |
my $temp_numberformat = $myconfig{numberformat}; |
|
915 |
# Numberformat must be '1000,00' for Taxbird ?! |
|
916 |
$myconfig{numberformat} = '1000,00'; |
|
917 |
foreach my $number (@category_cent) { |
|
918 |
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '2', '') : ''; |
|
919 |
} |
|
920 |
|
|
921 |
foreach my $number (@category_euro) { |
|
922 |
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '0', '') : ''; |
|
923 |
} |
|
924 |
# Re-set Numberformat |
|
925 |
$myconfig{numberformat} = $temp_numberformat; |
|
926 |
|
|
927 |
# push Kennziffern to <%foreach Array fo easyer |
|
928 |
# output in xml format. Thx to Moritz. |
|
929 |
my %taxbird_id_for = ( |
|
930 |
|
|
931 |
'511' => 'Kz51-calc', |
|
932 |
'861' => 'Kz86-calc', |
|
933 |
'971' => 'Kz97-calc', |
|
934 |
'931' => 'Kz93-calc', |
|
935 |
'811' => 'Kz81-calc', |
|
936 |
'891' => 'Kz89-calc', |
|
937 |
'Z45' => 'uebertrag', |
|
938 |
'Z53' => 'ust-sum', |
|
939 |
'Z62' => 'ust-minus-vost', |
|
940 |
'Z65' => 'ust-sum+69', |
|
941 |
'Z67' => 'ust-vz', |
|
942 |
); |
|
943 |
|
|
944 |
|
|
945 |
for my $kennziffer (@category_cent, @category_euro) { |
|
946 |
|
|
947 |
next if ($kennziffer eq 'Z43'); |
|
948 |
|
|
949 |
if ($form->{$kennziffer} != 0){ |
|
950 |
if (defined $taxbird_id_for{$kennziffer}) { |
|
951 |
push(@{ $form->{id}}, $taxbird_id_for{$kennziffer}); |
|
952 |
} else { |
|
953 |
push(@{ $form->{id}}, "Kz$kennziffer"); |
|
954 |
} |
|
955 |
push(@{ $form->{amount}}, $form->{$kennziffer}); |
|
956 |
} |
|
957 |
} |
|
958 |
|
|
932 | 959 |
} elsif ( $form->{format} eq '' ){ # No format error. |
933 | 960 |
$form->header; |
934 | 961 |
USTVA::error( $locale->text('Application Error. No Format given' ) . "!"); |
... | ... | |
940 | 967 |
exit(0); |
941 | 968 |
} |
942 | 969 |
|
970 |
|
|
943 | 971 |
if ( $form->{period} eq '13' and $form->{format} ne 'html') { |
944 | 972 |
$form->header; |
945 | 973 |
USTVA::info( |
Auch abrufbar als: Unified diff
Bug 528 solved. Better Taxbird export for USTVA.