Revision 081a4f97
Von Moritz Bunkus vor mehr als 18 Jahren hinzugefügt
SL/RP.pm | ||
---|---|---|
34 | 34 |
|
35 | 35 |
package RP; |
36 | 36 |
|
37 |
|
|
38 | 37 |
sub balance_sheet { |
39 | 38 |
$main::lxdebug->enter_sub(); |
40 | 39 |
|
... | ... | |
1134 | 1133 |
my @accno; |
1135 | 1134 |
my $accno; |
1136 | 1135 |
my $ref; |
1136 |
|
|
1137 | 1137 |
#print $query; |
1138 | 1138 |
my $sth = $dbh->prepare($query); |
1139 | 1139 |
$sth->execute || $form->dberror($query); |
... | ... | |
2045 | 2045 |
|
2046 | 2046 |
my $sortorder = join ', ', |
2047 | 2047 |
$form->sort_columns(qw(name invnumber ordnumber transdate source)); |
2048 |
$sortorder = $form->{sort} if $form->{sort};
|
|
2049 |
|
|
2048 |
$sortorder = $form->{sort} if $form->{sort}; |
|
2049 |
|
|
2050 | 2050 |
# cycle through each id |
2051 | 2051 |
foreach my $accno (split(/ /, $form->{paymentaccounts})) { |
2052 | 2052 |
|
... | ... | |
2143 | 2143 |
$form->{ "$key" . "gesamtleistung" } = 0; |
2144 | 2144 |
$form->{ "$key" . "gesamtkosten" } = 0; |
2145 | 2145 |
|
2146 |
|
|
2147 | 2146 |
foreach $category (@categories) { |
2148 | 2147 |
|
2149 | 2148 |
if (defined($form->{$category}{$key})) { |
2150 | 2149 |
$form->{"$key$category"} = |
2151 | 2150 |
$form->format_amount($myconfig, |
2152 | 2151 |
$form->round_amount($form->{$category}{$key}, 2 |
2153 |
), $form->{decimalplaces}, '0'); |
|
2152 |
), |
|
2153 |
$form->{decimalplaces}, |
|
2154 |
'0'); |
|
2154 | 2155 |
} |
2155 | 2156 |
} |
2156 | 2157 |
foreach $item (@gesamtleistung) { |
... | ... | |
2173 | 2174 |
$form->{ "$key" . "ergebnisvorsteuern" } = |
2174 | 2175 |
$form->{ "$key" . "betriebsergebnis" } - |
2175 | 2176 |
$form->{ "$key" . "neutraleraufwand" } + |
2176 |
$form->{ "$key" . "neutralertrag" };
|
|
2177 |
$form->{ "$key" . "neutralertrag" }; |
|
2177 | 2178 |
$form->{ "$key" . "ergebnis" } = |
2178 | 2179 |
$form->{ "$key" . "ergebnisvorsteuern" } + $form->{35}{$key}; |
2179 | 2180 |
|
... | ... | |
2188 | 2189 |
$form->{ "$key" . "gesamtleistung" } * 100 |
2189 | 2190 |
), |
2190 | 2191 |
$form->{decimalplaces} |
2191 |
), $form->{decimalplaces}, '0'); |
|
2192 |
), |
|
2193 |
$form->{decimalplaces}, |
|
2194 |
'0'); |
|
2192 | 2195 |
} |
2193 | 2196 |
} |
2194 | 2197 |
foreach $item (@ergebnisse) { |
... | ... | |
2199 | 2202 |
$form->{ "$key" . "gesamtleistung" } * 100 |
2200 | 2203 |
), |
2201 | 2204 |
$form->{decimalplaces} |
2202 |
), $form->{decimalplaces}, '0'); |
|
2205 |
), |
|
2206 |
$form->{decimalplaces}, |
|
2207 |
'0'); |
|
2203 | 2208 |
} |
2204 | 2209 |
} |
2205 | 2210 |
|
... | ... | |
2213 | 2218 |
$form->{ "$key" . "gesamtkosten" } * 100 |
2214 | 2219 |
), |
2215 | 2220 |
$form->{decimalplaces} |
2216 |
), $form->{decimalplaces}, '0'); |
|
2221 |
), |
|
2222 |
$form->{decimalplaces}, |
|
2223 |
'0'); |
|
2217 | 2224 |
} |
2218 | 2225 |
} |
2219 | 2226 |
foreach $item (@ergebnisse) { |
... | ... | |
2224 | 2231 |
$form->{ "$key" . "gesamtkosten" } * 100 |
2225 | 2232 |
), |
2226 | 2233 |
$form->{decimalplaces} |
2227 |
), $form->{decimalplaces}, '0'); |
|
2234 |
), |
|
2235 |
$form->{decimalplaces}, |
|
2236 |
'0'); |
|
2228 | 2237 |
} |
2229 | 2238 |
} |
2230 | 2239 |
|
... | ... | |
2233 | 2242 |
if (defined($form->{$category}{$key})) { |
2234 | 2243 |
$form->{ "$key" . "pk" . "$category" } = |
2235 | 2244 |
$form->format_amount( |
2236 |
$myconfig, |
|
2237 |
$form->round_amount( |
|
2238 |
($form->{$category}{$key} / $form->{10}{$key} * 100), |
|
2239 |
$form->{decimalplaces} |
|
2240 |
), $form->{decimalplaces}, '0'); |
|
2245 |
$myconfig, |
|
2246 |
$form->round_amount( |
|
2247 |
($form->{$category}{$key} / $form->{10}{$key} * 100), |
|
2248 |
$form->{decimalplaces} |
|
2249 |
), |
|
2250 |
$form->{decimalplaces}, |
|
2251 |
'0'); |
|
2241 | 2252 |
} |
2242 | 2253 |
} |
2243 | 2254 |
foreach $item (@ergebnisse) { |
... | ... | |
2248 | 2259 |
$form->{10}{$key} * 100 |
2249 | 2260 |
), |
2250 | 2261 |
$form->{decimalplaces} |
2251 |
), $form->{decimalplaces}, '0'); |
|
2262 |
), |
|
2263 |
$form->{decimalplaces}, |
|
2264 |
'0'); |
|
2252 | 2265 |
} |
2253 | 2266 |
} |
2254 | 2267 |
|
... | ... | |
2257 | 2270 |
if (defined($form->{$category}{$key})) { |
2258 | 2271 |
$form->{ "$key" . "auf" . "$category" } = |
2259 | 2272 |
$form->format_amount( |
2260 |
$myconfig, |
|
2261 |
$form->round_amount( |
|
2262 |
($form->{$category}{$key} / $form->{4}{$key} * 100), |
|
2263 |
$form->{decimalplaces} |
|
2264 |
), $form->{decimalplaces}, '0'); |
|
2273 |
$myconfig, |
|
2274 |
$form->round_amount( |
|
2275 |
($form->{$category}{$key} / $form->{4}{$key} * 100), |
|
2276 |
$form->{decimalplaces} |
|
2277 |
), |
|
2278 |
$form->{decimalplaces}, |
|
2279 |
'0'); |
|
2265 | 2280 |
} |
2266 | 2281 |
} |
2267 | 2282 |
foreach $item (@ergebnisse) { |
... | ... | |
2272 | 2287 |
$form->{4}{$key} * 100 |
2273 | 2288 |
), |
2274 | 2289 |
$form->{decimalplaces} |
2275 |
), $form->{decimalplaces}, '0'); |
|
2290 |
), |
|
2291 |
$form->{decimalplaces}, |
|
2292 |
'0'); |
|
2276 | 2293 |
} |
2277 | 2294 |
} |
2278 | 2295 |
|
2279 | 2296 |
foreach $item (@ergebnisse) { |
2280 | 2297 |
$form->{ "$key" . "$item" } = |
2281 | 2298 |
$form->format_amount($myconfig, |
2282 |
$form->round_amount($form->{ "$key" . "$item" }, |
|
2283 |
$form->{decimalplaces} |
|
2284 |
), $form->{decimalplaces}, '0'); |
|
2299 |
$form->round_amount($form->{ "$key" . "$item" }, |
|
2300 |
$form->{decimalplaces} |
|
2301 |
), |
|
2302 |
$form->{decimalplaces}, |
|
2303 |
'0'); |
|
2285 | 2304 |
} |
2286 | 2305 |
|
2287 | 2306 |
} |
... | ... | |
2301 | 2320 |
my $last_period = 0; |
2302 | 2321 |
my $category = "pos_ustva"; |
2303 | 2322 |
my @categories_cent = qw(51r 511 86r 861 97r 971 93r 931 |
2304 |
96 66 43 45 53 62 65 67);
|
|
2323 |
96 66 43 45 53 62 65 67); |
|
2305 | 2324 |
my @categories_euro = qw(48 51 86 91 97 93 94); |
2306 | 2325 |
$form->{decimalplaces} *= 1; |
2307 | 2326 |
|
... | ... | |
2339 | 2358 |
# } |
2340 | 2359 |
# |
2341 | 2360 |
# } |
2342 |
|
|
2361 |
|
|
2343 | 2362 |
# |
2344 | 2363 |
# Berechnung der USTVA Formularfelder |
2345 | 2364 |
# |
... | ... | |
2347 | 2366 |
$form->{"86r"} = $form->{"861"}; |
2348 | 2367 |
$form->{"97r"} = $form->{"971"}; |
2349 | 2368 |
$form->{"93r"} = $form->{"931"}; |
2369 |
|
|
2350 | 2370 |
#$form->{"96"} = $form->{"94"} * 0.16; |
2351 |
$form->{"43"} =
|
|
2371 |
$form->{"43"} = |
|
2352 | 2372 |
$form->{"51r"} + $form->{"86r"} + $form->{"97r"} + $form->{"93r"} + |
2353 | 2373 |
$form->{"96"}; |
2354 | 2374 |
$form->{"45"} = $form->{"43"}; |
... | ... | |
2359 | 2379 |
|
2360 | 2380 |
foreach $item (@categories_cent) { |
2361 | 2381 |
$form->{$item} = |
2362 |
$form->format_amount($myconfig, $form->round_amount($form->{$item}, 2), 2, '0'); |
|
2382 |
$form->format_amount($myconfig, $form->round_amount($form->{$item}, 2), |
|
2383 |
2, '0'); |
|
2363 | 2384 |
} |
2364 | 2385 |
|
2365 | 2386 |
foreach $item (@categories_euro) { |
2366 | 2387 |
$form->{$item} = |
2367 |
$form->format_amount($myconfig, $form->round_amount($form->{$item}, 0), 0, '0'); |
|
2388 |
$form->format_amount($myconfig, $form->round_amount($form->{$item}, 0), |
|
2389 |
0, '0'); |
|
2368 | 2390 |
} |
2369 | 2391 |
|
2370 | 2392 |
$dbh->disconnect; |
Auch abrufbar als: Unified diff
Kosmetik: Perltidy-Lauf nach den Einstellungen in doc/programmierrichtlinien.txt ueber alle .pl und .pm.