Revision 406563ed
Von Jan Büren vor etwa 10 Jahren hinzugefügt
SL/RP.pm | ||
---|---|---|
923 | 923 |
$sumwhere .= $glsumwhere . " AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL) AND (NOT ac.cb_transaction OR ac.cb_transaction IS NULL)"; |
924 | 924 |
|
925 | 925 |
# get all entries before fromdate, which are not yet fetched |
926 |
# TODO dpt_where_without_arapgl and project |
|
926 |
# TODO dpt_where_without_arapgl and project - project calculation seems bogus anyway |
|
927 |
# TODO use fiscal_year_startdate for the whole trial balance |
|
928 |
# anyway, if the last booking is in a deviating fiscal year, this already improves the query |
|
929 |
my $fiscal_year_startdate = conv_dateq(get_balance_starting_date($form->{fromdate})); |
|
927 | 930 |
$fetch_accounts_before_from = qq|SELECT c.accno, c.description, c.category, SUM(ac.amount) AS amount |
928 | 931 |
FROM acc_trans ac JOIN chart c ON (c.id = ac.chart_id) WHERE 1 = 1 AND (ac.transdate <= $fromdate) |
929 |
AND (ac.transdate >= (SELECT date_trunc('YEAR', | . $fromdate . qq|::date)))
|
|
932 |
AND (ac.transdate >= $fiscal_year_startdate)
|
|
930 | 933 |
AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL) AND (NOT ac.cb_transaction OR ac.cb_transaction IS NULL) |
931 | 934 |
AND c.accno NOT IN (SELECT c.accno FROM acc_trans ac JOIN chart c ON (c.id = ac.chart_id) WHERE 1 = 1 AND (ac.transdate >= $fromdate) AND (ac.transdate <= $todate) |
932 | 935 |
AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL) AND (NOT ac.cb_transaction OR ac.cb_transaction IS NULL)) |
... | ... | |
988 | 991 |
} |
989 | 992 |
$sth->finish; |
990 | 993 |
|
991 |
if ($form->{method} ne "cash") { |
|
994 |
if (!$form->{method} ne "cash") {
|
|
992 | 995 |
$sth = prepare_execute_query($form, $dbh, $fetch_accounts_before_from); |
993 | 996 |
while ($ref = $sth->fetchrow_hashref("NAME_lc")) { |
994 | 997 |
$trb{ $ref->{accno} }{description} = $ref->{description}; |
Auch abrufbar als: Unified diff
SuSa - Summe per und Saldo auch bei abweichenden Geschäftsjahr berechnen
Falls man eine Monats-SuSa zieht werden die Salden korrekt berechnet, allerdings
wurde nicht ein abweichendes Geschäftsjahr berücksichtigt. Jetzt wird
das Startdatum wie in der Bilanz genommen, dass ist schon mal besser, allerdings
ist hier der Fall Startdatum == closedto immer noch etwas unschön, s.a. Kommentar
in der Methode get_balance_startdate_method