Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision be418943

Von Jan Büren vor etwa 10 Jahren hinzugefügt

if-Abfrage eindeutiger geschrieben und Variablenname klarer definiert

Unterschiede anzeigen:

SL/RP.pm
884 884
  my $glwhere       = '';
885 885
  my $glsumwhere    = '';
886 886
  my $tofrom;
887
  my ($fromdate, $todate, $hotfix_query);
887
  my ($fromdate, $todate, $fetch_accounts_before_from);
888 888

  
889 889
  if ($form->{fromdate} || $form->{todate}) {
890 890
    if ($form->{fromdate}) {
......
924 924

  
925 925
    # get all entries before fromdate, which are not yet fetched
926 926
    # TODO dpt_where_without_arapgl and project
927
    $hotfix_query = qq|SELECT c.accno, c.description, c.category, SUM(ac.amount) AS amount
927
    $fetch_accounts_before_from = qq|SELECT c.accno, c.description, c.category, SUM(ac.amount) AS amount
928 928
                       FROM acc_trans ac JOIN chart c ON (c.id = ac.chart_id) WHERE 1 = 1 AND (ac.transdate <= $fromdate)
929 929
                        AND (ac.transdate >= (SELECT date_trunc('YEAR', | . $fromdate . qq|::date)))
930 930
                       AND (NOT ac.ob_transaction OR ac.ob_transaction IS NULL) AND (NOT ac.cb_transaction OR ac.cb_transaction IS NULL)
......
988 988
  }
989 989
  $sth->finish;
990 990

  
991
  if (! $form->{method} eq "cash") {
992
    $sth = prepare_execute_query($form, $dbh, $hotfix_query);
991
  if ($form->{method} ne "cash") {
992
    $sth = prepare_execute_query($form, $dbh, $fetch_accounts_before_from);
993 993
    while ($ref = $sth->fetchrow_hashref("NAME_lc")) {
994 994
      $trb{ $ref->{accno} }{description} = $ref->{description};
995 995
      $trb{ $ref->{accno} }{charttype}   = 'A';

Auch abrufbar als: Unified diff