Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision dbfa733e

Von Moritz Bunkus vor fast 17 Jahren hinzugefügt

  • ID dbfa733e42a95481ab6231334321c6a82ce68064
  • Vorgänger dcd79f61
  • Nachfolger a3efa231

Deutliche Beschleunigung der USTVA-Berechnung durch Einschränkung der betrachteten Datensätze aus acc_trans.

Unterschiede anzeigen:

SL/USTVA.pm
796 796
    $ARwhere  .= " AND acc.transdate <= '$todate'";
797 797
  }
798 798

  
799
  my $acc_trans_where = '1=1';
800
  if ($fromdate || $todate) {
801
    $acc_trans_where = "ac.trans_id IN (SELECT DISTINCT trans_id FROM acc_trans WHERE ";
802

  
803
    if ($fromdate) {
804
      $acc_trans_where .= "transdate >= '$fromdate'";
805
    }
806
    if ($todate) {
807
      $acc_trans_where .= " AND " if ($fromdate);
808
      $acc_trans_where .= "transdate <= '$todate'";
809
    }
810

  
811
    $acc_trans_where .= ")";
812
  }
813

  
799 814
  ############################################
800 815
  # Method eq 'cash' = IST Versteuerung
801 816
  ############################################
......
843 858
         )
844 859
       )
845 860
       WHERE 
846
       1=1 
847
       -- Here no where, please. All Transactions ever should be
848
       -- testet if they are paied in the USTVA report period.
861
       $acc_trans_where
849 862
       GROUP BY tk.pos_ustva
850 863
    |;
851 864
   

Auch abrufbar als: Unified diff