30 |
30 |
|
31 |
31 |
require "bin/mozilla/common.pl";
|
32 |
32 |
|
33 |
|
#use strict;
|
34 |
|
#no strict 'refs';
|
35 |
|
#use diagnostics;
|
36 |
|
#use warnings; # FATAL=> 'all';
|
37 |
|
#use vars qw($locale $form %myconfig);
|
38 |
|
#our ($myconfig);
|
39 |
|
#use CGI::Carp "fatalsToBrowser";
|
40 |
|
|
41 |
33 |
use List::Util qw(first);
|
42 |
34 |
|
43 |
35 |
use SL::DB::Default;
|
... | ... | |
245 |
237 |
}
|
246 |
238 |
|
247 |
239 |
|
248 |
|
|
249 |
|
sub help {
|
250 |
|
$::lxdebug->enter_sub();
|
251 |
|
|
252 |
|
$::auth->assert('advance_turnover_tax_return');
|
253 |
|
|
254 |
|
# parse help documents under doc
|
255 |
|
$::form->{templates} = 'doc';
|
256 |
|
$::form->{help} = 'ustva';
|
257 |
|
$::form->{type} = 'help';
|
258 |
|
$::form->{format} = 'html';
|
259 |
|
generate_ustva();
|
260 |
|
|
261 |
|
$::lxdebug->leave_sub();
|
262 |
|
}
|
263 |
|
|
264 |
|
sub show {
|
265 |
|
$::lxdebug->enter_sub();
|
266 |
|
|
267 |
|
$::auth->assert('advance_turnover_tax_return');
|
268 |
|
|
269 |
|
#generate_ustva();
|
270 |
|
$::lxdebug->leave_sub();
|
271 |
|
call_sub($::form->{"nextsub"});
|
272 |
|
}
|
273 |
|
|
274 |
240 |
sub ustva_vorauswahl {
|
275 |
241 |
$::lxdebug->enter_sub();
|
276 |
242 |
|
... | ... | |
501 |
467 |
return $select_vorauswahl;
|
502 |
468 |
}
|
503 |
469 |
|
504 |
|
#sub config {
|
505 |
|
# $::lxdebug->enter_sub();
|
506 |
|
# config_step1();
|
507 |
|
# $::lxdebug->leave_sub();
|
508 |
|
#}
|
509 |
|
|
510 |
470 |
sub show_options {
|
511 |
471 |
$::lxdebug->enter_sub();
|
512 |
472 |
|
... | ... | |
554 |
514 |
$::auth->assert('advance_turnover_tax_return');
|
555 |
515 |
|
556 |
516 |
my $defaults = SL::DB::Default->get;
|
557 |
|
$form->error($::locale->text('No print templates have been created for this client yet. Please do so in the client configuration.')) if !$defaults->templates;
|
558 |
|
$form->{templates} = $defaults->templates;
|
559 |
|
|
560 |
517 |
|
561 |
518 |
my $ustva = USTVA->new();
|
562 |
519 |
$ustva->get_config();
|
... | ... | |
636 |
593 |
$form->{co_city} =~ s/\\n//g;
|
637 |
594 |
}
|
638 |
595 |
|
639 |
|
################################
|
640 |
|
#
|
641 |
|
# Nation specific customisations
|
642 |
|
#
|
643 |
|
################################
|
644 |
|
|
645 |
|
# Germany
|
646 |
|
|
647 |
|
if ( $form->{coa} eq 'Germany-DATEV-SKR03EU' or $form->{coa} eq 'Germany-DATEV-SKR04EU') {
|
648 |
|
|
649 |
596 |
$form->{id} = [];
|
650 |
597 |
$form->{amount} = [];
|
651 |
598 |
|
652 |
|
if ( $form->{format} eq 'pdf' or $form->{format} eq 'postscript') {
|
653 |
|
|
654 |
|
$form->{IN} = "$form->{type}-$form->{year}.tex";
|
655 |
|
$form->{padding} = "~~";
|
656 |
|
$form->{bold} = "\textbf{";
|
657 |
|
$form->{endbold} = "}";
|
658 |
|
$form->{br} = '\\\\';
|
659 |
|
|
660 |
|
# Zahlenformatierung für Latex USTVA Formulare
|
661 |
|
|
662 |
|
foreach my $number (@{$::form->{category_euro}}) {
|
663 |
|
$form->{$number} = $form->format_amount(\%myconfig, $form->{$number}, '0', '');
|
664 |
|
}
|
665 |
|
|
666 |
|
my ${decimal_comma} = ( $myconfig{numberformat} eq '1.000,00'
|
667 |
|
or $myconfig{numberformat} eq '1000,00' ) ? ',':'.';
|
668 |
|
|
669 |
|
foreach my $number (@{$::form->{category_cent}}) {
|
670 |
|
$form->{$number} = $form->format_amount(\%myconfig, $form->{$number}, '2', '');
|
671 |
|
$form->{$number} =~ s/${decimal_comma}/~~/g;
|
672 |
|
}
|
673 |
|
|
674 |
|
} elsif ( $form->{format} eq 'html') { # Formatierungen für HTML Ausgabe
|
|
599 |
if ( $form->{format} eq 'html') { # Formatierungen für HTML Ausgabe
|
675 |
600 |
|
676 |
601 |
$form->{IN} = $form->{type} . '.html';
|
677 |
602 |
$form->{padding} = " ";
|
... | ... | |
687 |
612 |
foreach my $number (@{$::form->{category_euro}}) {
|
688 |
613 |
$form->{$number} = $form->format_amount(\%myconfig, $form->{$number}, '0', '0');
|
689 |
614 |
}
|
690 |
|
} elsif ( $form->{format} eq '' ){ # No format error.
|
691 |
|
|
692 |
|
$form->header;
|
693 |
|
USTVA::error( $locale->text('Application Error. No Format given' ) . "!");
|
694 |
|
$::dispatcher->end_request;
|
695 |
|
|
696 |
|
} else { # All other Formats are wrong
|
|
615 |
} else { # we have only html
|
697 |
616 |
$form->header;
|
698 |
617 |
USTVA::error( $locale->text('Application Error. Wrong Format') . ": " . $form->{format} );
|
699 |
618 |
$::dispatcher->end_request;
|
700 |
|
}
|
701 |
|
|
702 |
|
|
703 |
|
} else # Outputformat for generic output
|
704 |
|
{
|
705 |
|
die ("not used anymore");
|
706 |
|
$form->{USTVA} = [];
|
707 |
|
if ( $form->{format} eq 'generic') { # Formatierungen für HTML Ausgabe
|
708 |
|
|
709 |
|
my $rec_ref = {};
|
710 |
|
for my $kennziffer (@{$::form->{category_cent}}, @{$::form->{category_euro}}) {
|
711 |
|
$rec_ref = {};
|
712 |
|
$rec_ref->{id} = $kennziffer;
|
713 |
|
$rec_ref->{amount} = $form->format_amount(\%myconfig, $form->{$kennziffer}, 2, '0');
|
714 |
|
|
715 |
|
$::lxdebug->message($LXDebug::DEBUG, "Kennziffer $kennziffer: '$form->{$kennziffer}'" );
|
716 |
|
$::lxdebug->dump($LXDebug::DEBUG, $rec_ref );
|
717 |
|
push @ { $form->{USTVA} }, $rec_ref;
|
718 |
|
}
|
719 |
|
|
720 |
|
}
|
721 |
|
|
722 |
|
}
|
723 |
|
|
|
619 |
}
|
724 |
620 |
if ( $form->{period} eq '13' and $form->{format} ne 'html') {
|
725 |
621 |
$form->header;
|
726 |
622 |
USTVA::info(
|
... | ... | |
729 |
625 |
. '!');
|
730 |
626 |
}
|
731 |
627 |
|
732 |
|
$form->{templates} = "doc" if ( $form->{type} eq 'help' );
|
733 |
|
|
734 |
|
if ($form->{format} eq 'generic'){
|
735 |
|
die ("not used anymore");
|
736 |
|
$form->header();
|
|
628 |
# add a prefix for ustva pos numbers, i.e.: 81 -> post_ustva_81
|
|
629 |
$form->{"pos_ustva_$_"} = $form->{$_} for grep { m{^\d+} } keys %{ $form };
|
|
630 |
$form->{title} = $locale->text('Advance turnover tax return');
|
737 |
631 |
|
738 |
|
my $template_ref = {
|
739 |
|
taxnumber => $defaults->taxnumber,
|
740 |
|
};
|
741 |
|
|
742 |
|
print($form->parse_html_template('ustva/generic_taxreport', $template_ref));
|
743 |
|
|
744 |
|
} elsif ( $form->{format} eq 'elstertaxbird' ) {
|
745 |
|
die ("not used anymore");
|
746 |
|
$form->parse_template(\%myconfig);
|
747 |
|
} else
|
748 |
|
{
|
749 |
|
# add a prefix for ustva pos numbers, i.e.: 81 -> post_ustva_81
|
750 |
|
$form->{"pos_ustva_$_"} = $form->{$_} for grep { m{^\d+} } keys %{ $form };
|
751 |
|
$form->{title} = $locale->text('Advance turnover tax return');
|
752 |
|
|
753 |
|
$form->header;
|
754 |
|
print $form->parse_html_template('ustva/ustva');
|
755 |
|
|
756 |
|
|
757 |
|
}
|
|
632 |
$form->header;
|
|
633 |
print $form->parse_html_template('ustva/ustva');
|
758 |
634 |
|
759 |
635 |
$::lxdebug->leave_sub();
|
760 |
636 |
}
|
USTVA: Toter Code (ca. 2012 abwärts)
- Typo
- Kommentare
S.a. doc/CHANGELOG:
Die Druckvorlagen für USTVA vor 2012 wurden entfernt und das Ausdrucken von
USTVA als PDF ist deprecated. Da die Eingabe von Erklärungen als PDF nicht
mehr gestattet ist, sollten Archivkopien der USTVA direkt bei Elster bezogen
werden, oder auf anderem Wege erstellt werden. Der Prozess dazu wird sich in
einer kommenden Version ändern