X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FRP.pm;h=c01a442534cde6bcc9ffc0950ed0dc72e4e810b1;hb=e01d7de0936bc43c0c7b60cb5ef604ba3755ecff;hp=7bd324bce7efb6e00b6e17561b0da23e9bd00768;hpb=0576299f2aa98125991c4ffcd2f75073ea583d7d;p=kivitendo-erp.git diff --git a/SL/RP.pm b/SL/RP.pm index 7bd324bce..c01a44253 100644 --- a/SL/RP.pm +++ b/SL/RP.pm @@ -1336,7 +1336,7 @@ sub get_accounts_g { my @accno; my $accno; my $ref; - + #print $query; my $sth = $dbh->prepare($query); $sth->execute || $form->dberror($query); @@ -2088,7 +2088,7 @@ sub tax_report { my $ml = ($form->{db} eq 'ar') ? 1 : -1; my $sortorder = join ', ', $form->sort_columns(qw(transdate invnumber name)); - $sortorder = $form->{sort} unless $sortorder; + $sortorder = $form->{sort} if $form->{sort}; $query = qq|SELECT a.id, '0' AS invoice, $transdate AS transdate, a.invnumber, n.name, a.netamount, @@ -2247,7 +2247,8 @@ sub payments { my $sortorder = join ', ', $form->sort_columns(qw(name invnumber ordnumber transdate source)); - + $sortorder = $form->{sort} if $form->{sort}; + # cycle through each id foreach my $accno (split(/ /, $form->{paymentaccounts})) { @@ -2344,13 +2345,14 @@ sub bwa { $form->{ "$key" . "gesamtleistung" } = 0; $form->{ "$key" . "gesamtkosten" } = 0; + foreach $category (@categories) { if (defined($form->{$category}{$key})) { $form->{"$key$category"} = $form->format_amount($myconfig, $form->round_amount($form->{$category}{$key}, 2 - )); + ), $form->{decimalplaces}, '0'); } } foreach $item (@gesamtleistung) { @@ -2372,8 +2374,8 @@ sub bwa { $form->{32}{$key} + $form->{33}{$key} + $form->{34}{$key}; $form->{ "$key" . "ergebnisvorsteuern" } = $form->{ "$key" . "betriebsergebnis" } - - ($form->{ "$key" . "neutraleraufwand" } + - $form->{ "$key" . "neutralertrag" }); + $form->{ "$key" . "neutraleraufwand" } + + $form->{ "$key" . "neutralertrag" }; $form->{ "$key" . "ergebnis" } = $form->{ "$key" . "ergebnisvorsteuern" } + $form->{35}{$key}; @@ -2387,8 +2389,8 @@ sub bwa { ($form->{$category}{$key} / $form->{ "$key" . "gesamtleistung" } * 100 ), - 2 - )); + $form->{decimalplaces} + ), $form->{decimalplaces}, '0'); } } foreach $item (@ergebnisse) { @@ -2398,8 +2400,8 @@ sub bwa { ( $form->{ "$key" . "$item" } / $form->{ "$key" . "gesamtleistung" } * 100 ), - 2 - )); + $form->{decimalplaces} + ), $form->{decimalplaces}, '0'); } } @@ -2412,8 +2414,8 @@ sub bwa { ($form->{$category}{$key} / $form->{ "$key" . "gesamtkosten" } * 100 ), - 2 - )); + $form->{decimalplaces} + ), $form->{decimalplaces}, '0'); } } foreach $item (@ergebnisse) { @@ -2423,8 +2425,8 @@ sub bwa { ($form->{ "$key" . "$item" } / $form->{ "$key" . "gesamtkosten" } * 100 ), - 2 - )); + $form->{decimalplaces} + ), $form->{decimalplaces}, '0'); } } @@ -2435,8 +2437,9 @@ sub bwa { $form->format_amount( $myconfig, $form->round_amount( - ($form->{$category}{$key} / $form->{10}{$key} * 100), 2 - )); + ($form->{$category}{$key} / $form->{10}{$key} * 100), + $form->{decimalplaces} + ), $form->{decimalplaces}, '0'); } } foreach $item (@ergebnisse) { @@ -2446,8 +2449,8 @@ sub bwa { ($form->{ "$key" . "$item" } / $form->{10}{$key} * 100 ), - 2 - )); + $form->{decimalplaces} + ), $form->{decimalplaces}, '0'); } } @@ -2458,8 +2461,9 @@ sub bwa { $form->format_amount( $myconfig, $form->round_amount( - ($form->{$category}{$key} / $form->{4}{$key} * 100), 2 - )); + ($form->{$category}{$key} / $form->{4}{$key} * 100), + $form->{decimalplaces} + ), $form->{decimalplaces}, '0'); } } foreach $item (@ergebnisse) { @@ -2469,16 +2473,17 @@ sub bwa { ($form->{ "$key" . "$item" } / $form->{4}{$key} * 100 ), - 2 - )); + $form->{decimalplaces} + ), $form->{decimalplaces}, '0'); } } foreach $item (@ergebnisse) { $form->{ "$key" . "$item" } = $form->format_amount($myconfig, - $form->round_amount($form->{ "$key" . "$item" }, 2 - )); + $form->round_amount($form->{ "$key" . "$item" }, + $form->{decimalplaces} + ), $form->{decimalplaces}, '0'); } } @@ -2497,7 +2502,8 @@ sub ustva { my $last_period = 0; my $category = "pos_ustva"; - my @categories_cent = qw(51r 86r 97r 93r 96 66 43 45 53 62 65 67); + 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; @@ -2535,12 +2541,15 @@ sub ustva { # } # # } - - $form->{"51r"} = $form->{"51"} * 0.16; - $form->{"86r"} = $form->{"86"} * 0.07; - $form->{"97r"} = $form->{"97"} * 0.16; - $form->{"93r"} = $form->{"93"} * 0.07; - $form->{"96"} = $form->{"94"} * 0.16; + + # + # 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"}; @@ -2552,12 +2561,12 @@ sub ustva { foreach $item (@categories_cent) { $form->{$item} = - $form->format_amount($myconfig, $form->round_amount($form->{$item}, 2)); + $form->format_amount($myconfig, $form->round_amount($form->{$item}, 2), 2, '0'); } foreach $item (@categories_euro) { $form->{$item} = - $form->format_amount($myconfig, $form->round_amount($form->{$item}, 0)); + $form->format_amount($myconfig, $form->round_amount($form->{$item}, 0), 0, '0'); } $dbh->disconnect;