LEFT JOIN tax tx ON (tk.tax_id = tx.id)
WHERE 1=1
$where
- GROUP BY c.accno, c.id, c.description, c.charttype, c.gifi_accno,
+ GROUP BY c.accno, c.id, c.description, c.charttype,
c.category, c.link, c.pos_bwa, c.pos_bilanz, c.pos_eur, c.valid_from,
c.datevautomatik
ORDER BY c.accno
$main::lxdebug->leave_sub();
}
-sub ustva {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form) = @_;
-
- # connect to database
- my $dbh = $form->dbconnect($myconfig);
-
- my $last_period = 0;
- my @categories_cent = qw(51r 511 86r 861 97r 971 93r 931
- 96 66 43 45 53 62 65 67);
- my @categories_euro = qw(48 51 86 91 97 93 94);
- $form->{decimalplaces} *= 1;
-
- foreach my $item (@categories_cent) {
- $form->{"$item"} = 0;
- }
- foreach my $item (@categories_euro) {
- $form->{"$item"} = 0;
- }
-
- &get_accounts_g($dbh, $last_period, $form->{fromdate}, $form->{todate}, $form, "pos_ustva");
-
- # foreach $item (@categories_cent) {
- # if ($form->{$item}{"jetzt"} > 0) {
- # $form->{$item} = $form->{$item}{"jetzt"};
- # delete $form->{$item}{"jetzt"};
- # }
- # }
- # foreach $item (@categories_euro) {
- # if ($form->{$item}{"jetzt"} > 0) {
- # $form->{$item} = $form->{$item}{"jetzt"};
- # delete $form->{$item}{"jetzt"};
- # } foreach $item (@categories_cent) {
- # if ($form->{$item}{"jetzt"} > 0) {
- # $form->{$item} = $form->{$item}{"jetzt"};
- # delete $form->{$item}{"jetzt"};
- # }
- # }
- # foreach $item (@categories_euro) {
- # if ($form->{$item}{"jetzt"} > 0) {
- # $form->{$item} = $form->{$item}{"jetzt"};
- # delete $form->{$item}{"jetzt"};
- # }
- # }
- #
- # }
-
- #
- # Berechnung der USTVA Formularfelder
- #
- $form->{"51r"} = $form->{"511"};
- $form->{"86r"} = $form->{"861"};
- $form->{"97r"} = $form->{"971"};
- $form->{"93r"} = $form->{"931"};
-
- #$form->{"96"} = $form->{"94"} * 0.16;
- $form->{"43"} =
- $form->{"51r"} + $form->{"86r"} + $form->{"97r"} + $form->{"93r"} +
- $form->{"96"};
- $form->{"45"} = $form->{"43"};
- $form->{"53"} = $form->{"43"};
- $form->{"62"} = $form->{"43"} - $form->{"66"};
- $form->{"65"} = $form->{"43"} - $form->{"66"};
- $form->{"67"} = $form->{"43"} - $form->{"66"};
-
- foreach my $item (@categories_cent) {
- $form->{$item} =
- $form->format_amount($myconfig, $form->round_amount($form->{$item}, 2),
- 2, '0');
- }
-
- foreach my $item (@categories_euro) {
- $form->{$item} =
- $form->format_amount($myconfig, $form->round_amount($form->{$item}, 0),
- 0, '0');
- }
-
- $dbh->disconnect;
-
- $main::lxdebug->leave_sub();
-}
-
sub income_statement {
$main::lxdebug->enter_sub();