Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7e7b6b43

Von Moritz Bunkus vor etwa 16 Jahren hinzugefügt

  • ID 7e7b6b431c1a451c1e5f4a453afa5d5144551fd7
  • Vorgänger 7214b604
  • Nachfolger ddf943f2

1. Tabellenaliasnamen in Queries benutzen, weil PostgreSQL ansonsten einen Fehler rauswirft.
2. Wenn bei E/Ü-Rechnung ein Projekt ausgewählt ist, dann wurde vorher ein Teil des SQL-Codes nicht im eigentlichen Query untergebracht sondern in eine danach nicht mehr benutzte Variable geschrieben.

Unterschiede anzeigen:

SL/RP.pm
609 609
    if ($form->{method} eq 'cash') {
610 610
      $subwhere .= " AND (transdate    >= $fromdate)";
611 611
      $glwhere   = " AND (ac.transdate >= $fromdate)";
612
      $prwhere   = " AND (ar.transdate >= $fromdate)";
612
      $prwhere   = " AND (a.transdate  >= $fromdate)";
613 613
    } else {
614 614
      $where    .= " AND (ac.transdate >= $fromdate)";
615 615
    }
......
619 619
    $todate = conv_dateq($todate);
620 620
    $subwhere   .= " AND (transdate    <= $todate)";
621 621
    $where      .= " AND (ac.transdate <= $todate)";
622
    $prwhere    .= " AND (ar.transdate <= $todate)";
622
    $prwhere    .= " AND (a.transdate  <= $todate)";
623 623
  }
624 624

  
625 625
  if ($department_id) {
......
666 666
         WHERE $where $dpt_where $glwhere 
667 667
           AND NOT ((c.link = 'AR') OR (c.link = 'AP'))
668 668
           $project
669

  
670
         $project_union
671
        GROUP BY c.$category 
669
         GROUP BY c.$category
672 670
        |;
673 671

  
674 672
    if ($form->{project_id}) {
675
      $project_union = qq|
673
      $query .= qq|
676 674
         UNION
677 675

  
678 676
         SELECT SUM(ac.sellprice * ac.qty * chart_category_to_sgn(c.category)) AS amount, c.$category

Auch abrufbar als: Unified diff