Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 030c2086

Von Rolf Fluehmann vor mehr als 8 Jahren hinzugefügt

  • ID 030c208648ddd8137d8fab33bb8b2eb87f5c080f
  • Vorgänger fc1e3973
  • Nachfolger 39b80fd2

Belege runden, und Rundungsdifferenzen auf Extrakonten buchen.

Unterschiede anzeigen:

SL/RP.pm
1873 1873
  my ($self, $myconfig, $form) = @_;
1874 1874
  $form->{company} = $::instance_conf->get_company;
1875 1875
  $form->{address} = $::instance_conf->get_address;
1876
  #injection-filter
1877
  $form->{fromdate} =~ s/[^0-9\.]//g;
1878
  $form->{todate} =~ s/[^0-9\.]//g;
1879
  #input validation
1880
  $form->{fromdate} = "01.01.2000" if $form->{fromdate} !~ m/[0-9]*\.[0-9]*\.[0-9]*/;
1881
  $form->{todate} = $form->current_date(%{$myconfig}) if $form->{todate} !~ m/[0-9]*\.[0-9]*\.[0-9]*/;
1876
  $form->{fromdate} = DateTime->new(year => 2000, month => 1, day => 1)->to_kivitendo unless $form->{fromdate};
1877
  $form->{todate} = $form->current_date(%{$myconfig}) unless $form->{todate};
1882 1878

  
1883 1879
  my %categories = (I => "ERTRAG", E => "AUFWAND");
1884 1880
  my $fromdate = conv_dateq($form->{fromdate});
......
1924 1920
  my $query = qq|
1925 1921
    SELECT id, accno, description, category
1926 1922
    FROM chart
1927
    WHERE category = '$category' $inclusion
1923
    WHERE category = ? $inclusion
1928 1924
    ORDER BY accno
1929 1925
  |;
1930
  my $accounts = _query($query);
1926
  my $accounts = _query($query, $category);
1931 1927

  
1932 1928
  $main::lxdebug->leave_sub();
1933 1929
  return $accounts;
......
1941 1937
  my $query = qq|
1942 1938
    SELECT SUM(amount)
1943 1939
    FROM acc_trans
1944
    WHERE chart_id = '$chart_id'
1945
      AND transdate >= $fromdate
1946
      AND transdate <= $todate
1940
    WHERE chart_id = ?
1941
      AND transdate >= ?
1942
      AND transdate <= ?
1947 1943
  |;
1948
  $total += _query($query)->[0]->{sum};
1944
  $total += _query($query, $chart_id, $fromdate, $todate)->[0]->{sum};
1949 1945

  
1950 1946
  $main::lxdebug->leave_sub();
1951 1947
  return $total;

Auch abrufbar als: Unified diff