Revision 127b0df3
Von Jan Büren vor fast 11 Jahren hinzugefügt
SL/Template/XML.pm | ||
---|---|---|
30 | 30 |
sub get_mime_type() { |
31 | 31 |
my ($self) = @_; |
32 | 32 |
|
33 |
if ($self->{"form"}->{"format"} =~ /elsterwinston/i) { |
|
34 |
return "application/xml "; |
|
35 |
} elsif ($self->{"form"}->{"format"} =~ /elstertaxbird/i) { |
|
36 |
return "application/x-taxbird"; |
|
37 |
} else { |
|
38 |
return "text"; |
|
39 |
} |
|
33 |
return "text"; |
|
34 |
|
|
40 | 35 |
} |
41 | 36 |
|
42 | 37 |
sub uses_temp_file { |
bin/mozilla/ustva.pl | ||
---|---|---|
21 | 21 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
22 | 22 |
#====================================================================== |
23 | 23 |
# German Tax authority Module and later ELSTER Interface |
24 |
# 08.01.14 ELSTER Interface software (taxbird/winston) removed |
|
24 | 25 |
#====================================================================== |
25 | 26 |
|
26 | 27 |
use strict; |
... | ... | |
502 | 503 |
my $media = qq| <input type=hidden name="media" value="screen">|; |
503 | 504 |
my $format = |
504 | 505 |
qq| <option value=html selected>| |
505 |
. $::locale->text('Preview')
|
|
506 |
. $::locale->text('HTML')
|
|
506 | 507 |
. qq|</option>|; |
507 |
if ($::lx_office_conf{print_templates}{latex}) { |
|
508 |
$format .= |
|
509 |
qq| <option value=pdf>| |
|
510 |
. $::locale->text('UStVA (PDF-Dokument)') |
|
511 |
. qq|</option>|; |
|
512 |
} |
|
513 |
|
|
514 |
#my $disabled= qq|disabled="disabled"|; |
|
515 |
#$disabled='' if ($form->{elster} eq '1' ); |
|
516 |
if ($::form->{elster} eq '1') { |
|
517 |
$format .= |
|
518 |
qq|<option value=elsterwinston>| |
|
519 |
. $::locale->text('ELSTER Export (Winston)') |
|
520 |
. qq|</option>| |
|
521 |
. qq|<option value=elstertaxbird>| |
|
522 |
. $::locale->text('ELSTER Export (Taxbird)') |
|
523 |
. qq|</option>|; |
|
524 |
} |
|
525 | 508 |
|
526 |
#$format .= qq|<option value=elster>|.$locale->text('ELSTER Export nach Winston').qq|</option>|; |
|
527 | 509 |
my $show_options = qq| |
528 | 510 |
$type |
529 | 511 |
$media |
... | ... | |
833 | 815 |
foreach my $number (@category_euro) { |
834 | 816 |
$form->{$number} = $form->format_amount(\%myconfig, $form->{$number}, '0', '0'); |
835 | 817 |
} |
836 |
|
|
837 |
} elsif ( $form->{format} eq 'elsterwinston' ) { |
|
838 |
|
|
839 |
$form->{IN} = 'winston.xml'; |
|
840 |
|
|
841 |
# |
|
842 |
# Build Winston filename |
|
843 |
# |
|
844 |
|
|
845 |
my $file = 'U'; # 1. char 'U' = USTVA |
|
846 |
$file .= $form->{period}; |
|
847 |
#4. and 5. char = year modulo 100 |
|
848 |
$file .= sprintf("%02d", $form->{year} % 100); |
|
849 |
#6. to 18. char = Elstersteuernummer |
|
850 |
#Beispiel: Steuernummer in Bayern |
|
851 |
#111/222/33334 ergibt für UStVA Jan 2004: U01049111022233334 |
|
852 |
$file .= $form->{elsterFFFF}; |
|
853 |
$file .= $form->{elstersteuernummer}; |
|
854 |
#file suffix |
|
855 |
$file .= '.xml'; |
|
856 |
$file =~ s|.*/||; |
|
857 |
|
|
858 |
$form->{attachment_filename} = $file; |
|
859 |
|
|
860 |
# Zahlenformatierung für Winston |
|
861 |
|
|
862 |
my $temp_numberformat = $myconfig{numberformat}; |
|
863 |
|
|
864 |
# Numberformat must be '1000,00' for Winston |
|
865 |
|
|
866 |
$myconfig{numberformat} = '1000,00'; |
|
867 |
|
|
868 |
foreach my $number (@category_cent) { |
|
869 |
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '2', '') : ''; |
|
870 |
} |
|
871 |
|
|
872 |
foreach my $number (@category_euro) { |
|
873 |
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '0', '') : ''; |
|
874 |
} |
|
875 |
# Re-set Numberformat |
|
876 |
$myconfig{numberformat} = $temp_numberformat; |
|
877 |
|
|
878 |
# push Kennziffern to <%foreach Array fo easyer |
|
879 |
# output in xml format. Thx to Moritz. |
|
880 |
my %winston_id_for = ( |
|
881 |
# No Winston remap?! |
|
882 |
); |
|
883 |
|
|
884 |
foreach my $kennziffer (@category_cent, @category_euro) { |
|
885 |
|
|
886 |
next if ( $kennziffer =~ m/Z\d\d/); |
|
887 |
next if ( $form->{$kennziffer} == 0 ); |
|
888 |
|
|
889 |
if (defined $winston_id_for{$kennziffer} ) { |
|
890 |
push(@{ $form->{id}}, $winston_id_for{$kennziffer}); |
|
891 |
} else { |
|
892 |
push(@{ $form->{id}}, "Kz$kennziffer"); |
|
893 |
} |
|
894 |
push(@{ $form->{amount}}, $form->{$kennziffer}); |
|
895 |
} |
|
896 |
|
|
897 |
} elsif ( $form->{format} eq 'elstertaxbird' ) { |
|
898 |
|
|
899 |
# Define serveral filenames |
|
900 |
$form->{IN} = 'taxbird.txb'; |
|
901 |
|
|
902 |
$form->{attachment_filename} = "USTVA-" . ($form->{period} * 1) . sprintf("%02d", $form->{year} % 100) . ".txb"; |
|
903 |
|
|
904 |
$form->{attachment_filename} =~ s|.*/||; |
|
905 |
|
|
906 |
if ($form->{period} =~ /^[4]\d$/ ){ |
|
907 |
my %periods = ( # Lx => taxbird |
|
908 |
'41' => '12', |
|
909 |
'42' => '13', |
|
910 |
'43' => '14', |
|
911 |
'44' => '15', |
|
912 |
); |
|
913 |
|
|
914 |
foreach my $quarter ( keys %periods ) { |
|
915 |
$form->{taxbird_period} = $periods{$quarter} if ( $form->{period} eq $quarter); |
|
916 |
} |
|
917 |
} elsif ($form->{period} =~ /^\d+$/ ) { |
|
918 |
$form->{period} =~ s/^0//g; |
|
919 |
my $period = $form->{period}; |
|
920 |
$period *= 1; |
|
921 |
$period--; |
|
922 |
$form->{taxbird_period} = $period; |
|
923 |
} else { |
|
924 |
$form->header; |
|
925 |
USTVA::error( $locale->text('Wrong Period' )); |
|
926 |
::end_of_request(); |
|
927 |
} |
|
928 |
|
|
929 |
# heuristics for address splitting |
|
930 |
# lx-office holds the entire address in a single field. |
|
931 |
# taxbird expects it to be splitted into street, zipcode and city |
|
932 |
if ($form->{co_street} =~ /\n/) { |
|
933 |
my $new_co_street; |
|
934 |
for (split /\n/, $form->{co_street}) { |
|
935 |
if (/(\d{3,5})\s+(\w+)/) { |
|
936 |
$form->{co_zip} = $1; |
|
937 |
$form->{co_city} = $2; |
|
938 |
} else { |
|
939 |
$new_co_street .= $_; |
|
940 |
} |
|
941 |
} |
|
942 |
$form->{co_street} = $new_co_street; |
|
943 |
} else { |
|
944 |
$form->{co_zip} = $form->{co_city}; |
|
945 |
$form->{co_zip} =~ s/\D//g; |
|
946 |
$form->{co_city} =~ s/\d//g; |
|
947 |
$form->{co_city} =~ s/^\s//g; |
|
948 |
} |
|
949 |
|
|
950 |
my $tax_office = first { $_->{name} eq $form->{elsterland} } @{ $ustva->{tax_office_information} }; |
|
951 |
$form->{taxbird_land_nr} = $tax_office->{taxbird_nr} if $tax_office; |
|
952 |
|
|
953 |
($form->{co_phone_prefix}, $form->{co_phone}) = split("-", $form->{tel}); |
|
954 |
$form->{co_phone_prefix} =~ s/\s//g; |
|
955 |
$form->{co_phone} =~ s/\s//g; |
|
956 |
|
|
957 |
$form->{taxbird_steuernummer} = $form->{steuernummer}; |
|
958 |
# $form->{taxbird_steuernummer} =~ s/\D//g; |
|
959 |
# $form->{taxbird_steuernummer} =~ s/\///; # ersten Querstrich ersetzen |
|
960 |
|
|
961 |
# Numberformatting for Taxbird |
|
962 |
my $temp_numberformat = $myconfig{numberformat}; |
|
963 |
# Numberformat must be '1000,00' for Taxbird ?! |
|
964 |
$myconfig{numberformat} = '1000,00'; |
|
965 |
foreach my $number (@category_cent) { |
|
966 |
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '2', '') : ''; |
|
967 |
} |
|
968 |
|
|
969 |
foreach my $number (@category_euro) { |
|
970 |
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '0', '') : ''; |
|
971 |
} |
|
972 |
# Re-set Numberformat |
|
973 |
$myconfig{numberformat} = $temp_numberformat; |
|
974 |
|
|
975 |
# push Kennziffern to <%foreach Array fo easyer |
|
976 |
# output in xml format. Thx to Moritz. |
|
977 |
my %taxbird_id_for = ( |
|
978 |
|
|
979 |
'511' => 'Kz51-calc', |
|
980 |
'861' => 'Kz86-calc', |
|
981 |
'971' => 'Kz97-calc', |
|
982 |
'931' => 'Kz93-calc', |
|
983 |
'811' => 'Kz81-calc', |
|
984 |
'891' => 'Kz89-calc', |
|
985 |
'Z45' => 'uebertrag', |
|
986 |
'Z53' => 'ust-sum', |
|
987 |
'Z62' => 'ust-minus-vost', |
|
988 |
'Z65' => 'ust-sum+69', |
|
989 |
'Z67' => 'ust-vz', |
|
990 |
); |
|
991 |
|
|
992 |
|
|
993 |
for my $kennziffer (@category_cent, @category_euro) { |
|
994 |
|
|
995 |
next if ($kennziffer eq 'Z43'); |
|
996 |
|
|
997 |
if ($form->{$kennziffer} != 0){ |
|
998 |
if (defined $taxbird_id_for{$kennziffer}) { |
|
999 |
push(@{ $form->{id}}, $taxbird_id_for{$kennziffer}); |
|
1000 |
} else { |
|
1001 |
push(@{ $form->{id}}, "Kz$kennziffer"); |
|
1002 |
} |
|
1003 |
push(@{ $form->{amount}}, $form->{$kennziffer}); |
|
1004 |
} |
|
1005 |
} |
|
1006 |
|
|
1007 | 818 |
} elsif ( $form->{format} eq '' ){ # No format error. |
1008 | 819 |
$form->header; |
1009 | 820 |
USTVA::error( $locale->text('Application Error. No Format given' ) . "!"); |
doc/changelog | ||
---|---|---|
39 | 39 |
|
40 | 40 |
Kleinere neue Features und Detailverbesserungen: |
41 | 41 |
|
42 |
- Die bwa.html und ustva.html werden jetzt zentral gepflegt und nicht mehr als benutzerdefinierte |
|
43 |
Druckvorlage. Falls hier jmd. Anpassungen gemacht hat, müssten diese in templates/rp/$VORLAGE.html |
|
44 |
nachgepflegt werden |
|
45 |
- Für UstVa: Winston, Taxbird und Pdf-Export werden nicht mehr unterstützt. Die UstVa muss sowieso mittlerweile |
|
46 |
per Elster erfolgen |
|
42 | 47 |
- Lieferbedingungen analog zu Zahlungsbedingungen eingeführt. |
43 | 48 |
Sie können angelegt, beim Benutzer voreingestellt und in allen Ein- und Ver- |
44 | 49 |
kaufsmasken gesetzt werden. |
templates/print/RB/taxbird.txb | ||
---|---|---|
1 |
;; This file was produced by lx-office |
|
2 |
;; for using in taxbird. |
|
3 |
;; You probably don't want to touch this |
|
4 |
;; file. In case you do want it anyway, |
|
5 |
;; be warned: BE CAREFUL!! |
|
6 |
;; |
|
7 |
'("Umsatzsteuervoranmeldung <%year%>" ( |
|
8 |
("vend-id" . "74931") |
|
9 |
("land-lieferant" . "<%elsterland%>") |
|
10 |
("name-lieferant" . "<%company%>") |
|
11 |
("berufsbez" . "") |
|
12 |
("strasse-lieferant" . "<%co_street%>") |
|
13 |
("plz-lieferant" . "<%co_zip%> ") |
|
14 |
("ort-lieferant" . "<%co_city%>") |
|
15 |
("vorwahl" . "<%co_phone_prefix%>") |
|
16 |
("anschluss" . "<%co_phone%>") |
|
17 |
("land" . "<%taxbird_land_nr%>") |
|
18 |
("zeitraum" . "<%taxbird_period%>") |
|
19 |
("stnr" . "<%taxbird_steuernummer%>") |
|
20 |
|
|
21 |
<%foreach id%> |
|
22 |
("<%id%>" . "<%amount%>")<%end%> |
|
23 |
)) |
templates/print/RB/winston.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!-- Diese Datei ist mit kivitendo <%version%> generiert --> |
|
3 |
<WinstonAusgang> |
|
4 |
<Formular Typ="UST"></Formular> |
|
5 |
<Ordnungsnummer><%elsterFFFF%><%elstersteuernummer%></Ordnungsnummer> |
|
6 |
<AnmeldeJahr><%year%></AnmeldeJahr> |
|
7 |
<AnmeldeZeitraum><%period%></AnmeldeZeitraum> |
|
8 |
|
|
9 |
<%foreach id%> |
|
10 |
<Kennzahl nr="<%id%>"><%amount%></Kennzahl> |
|
11 |
<%end%> |
|
12 |
|
|
13 |
</WinstonAusgang> |
|
14 |
|
templates/print/Standard/taxbird.txb | ||
---|---|---|
1 |
;; This file was produced by lx-office |
|
2 |
;; for using in taxbird. |
|
3 |
;; You probably don't want to touch this |
|
4 |
;; file. In case you do want it anyway, |
|
5 |
;; be warned: BE CAREFUL!! |
|
6 |
;; |
|
7 |
'("Umsatzsteuervoranmeldung <%year%>" ( |
|
8 |
("vend-id" . "74931") |
|
9 |
("land-lieferant" . "<%elsterland%>") |
|
10 |
("name-lieferant" . "<%company%>") |
|
11 |
("berufsbez" . "") |
|
12 |
("strasse-lieferant" . "<%co_street%>") |
|
13 |
("plz-lieferant" . "<%co_zip%> ") |
|
14 |
("ort-lieferant" . "<%co_city%>") |
|
15 |
("vorwahl" . "<%co_phone_prefix%>") |
|
16 |
("anschluss" . "<%co_phone%>") |
|
17 |
("land" . "<%taxbird_land_nr%>") |
|
18 |
("zeitraum" . "<%taxbird_period%>") |
|
19 |
("stnr" . "<%taxbird_steuernummer%>") |
|
20 |
|
|
21 |
<%foreach id%> |
|
22 |
("<%id%>" . "<%amount%>")<%end%> |
|
23 |
)) |
templates/print/Standard/winston.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!-- Diese Datei ist mit kivitendo <%version%> generiert --> |
|
3 |
<WinstonAusgang> |
|
4 |
<Formular Typ="UST"></Formular> |
|
5 |
<Ordnungsnummer><%elsterFFFF%><%elstersteuernummer%></Ordnungsnummer> |
|
6 |
<AnmeldeJahr><%year%></AnmeldeJahr> |
|
7 |
<AnmeldeZeitraum><%period%></AnmeldeZeitraum> |
|
8 |
|
|
9 |
<%foreach id%> |
|
10 |
<Kennzahl nr="<%id%>"><%amount%></Kennzahl> |
|
11 |
<%end%> |
|
12 |
|
|
13 |
</WinstonAusgang> |
|
14 |
|
templates/print/f-tex/taxbird.txb | ||
---|---|---|
1 |
;; This file was produced by lx-office |
|
2 |
;; for using in taxbird. |
|
3 |
;; You probably don't want to touch this |
|
4 |
;; file. In case you do want it anyway, |
|
5 |
;; be warned: BE CAREFUL!! |
|
6 |
;; |
|
7 |
'("Umsatzsteuervoranmeldung <%year%>" ( |
|
8 |
("vend-id" . "74931") |
|
9 |
("land-lieferant" . "<%elsterland%>") |
|
10 |
("name-lieferant" . "<%company%>") |
|
11 |
("berufsbez" . "") |
|
12 |
("strasse-lieferant" . "<%co_street%>") |
|
13 |
("plz-lieferant" . "<%co_zip%> ") |
|
14 |
("ort-lieferant" . "<%co_city%>") |
|
15 |
("vorwahl" . "<%co_phone_prefix%>") |
|
16 |
("anschluss" . "<%co_phone%>") |
|
17 |
("land" . "<%taxbird_land_nr%>") |
|
18 |
("zeitraum" . "<%taxbird_period%>") |
|
19 |
("stnr" . "<%taxbird_steuernummer%>") |
|
20 |
|
|
21 |
<%foreach id%> |
|
22 |
("<%id%>" . "<%amount%>")<%end%> |
|
23 |
)) |
templates/print/f-tex/winston.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!-- Diese Datei ist mit kivitendo <%version%> generiert --> |
|
3 |
<WinstonAusgang> |
|
4 |
<Formular Typ="UST"></Formular> |
|
5 |
<Ordnungsnummer><%elsterFFFF%><%elstersteuernummer%></Ordnungsnummer> |
|
6 |
<AnmeldeJahr><%year%></AnmeldeJahr> |
|
7 |
<AnmeldeZeitraum><%period%></AnmeldeZeitraum> |
|
8 |
|
|
9 |
<%foreach id%> |
|
10 |
<Kennzahl nr="<%id%>"><%amount%></Kennzahl> |
|
11 |
<%end%> |
|
12 |
|
|
13 |
</WinstonAusgang> |
|
14 |
|
Auch abrufbar als: Unified diff
2. Teil zu: Winston-Export, Taxbird-Export und Latex-Export für UstVA entfernt