Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4fd0c773

Von Bernd Bleßmann vor fast 2 Jahren hinzugefügt

  • ID 4fd0c773094412acd1daa6d20f982540061dfb8f
  • Vorgänger e92b48eb
  • Nachfolger e7499a1c

Umsatzstatistik-Chart: Sortierung aufsteigend

Unterschiede anzeigen:

SL/Controller/CustomerVendorTurnover.pm
119 119

  
120 120
  return $self->render('generic/error', { layout => 0 }, label_error => "list_transactions needs a trans_id") unless $::form->{id};
121 121

  
122
  my $sort_dir   = 'DESC';
123

  
124
  if ($::request->type eq 'json') {
125
    $sort_dir   = 'ASC';
126
  }
127

  
122 128
  my $dbh = SL::DB->client->dbh;
123 129
  my $cv = $::form->{id};
124 130
  my ($db, $cv_type);
......
134 140
  if ('month' eq $::form->{mode}) {
135 141
    $date_part_select = "CONCAT(EXTRACT (MONTH FROM transdate),'/',EXTRACT (YEAR FROM transdate))";
136 142
    $group_by         = "EXTRACT (YEAR FROM transdate), EXTRACT (MONTH FROM transdate)";
137
    $order_by         = "EXTRACT (YEAR FROM transdate) DESC, EXTRACT (MONTH FROM transdate) DESC";
143
    $order_by         = "EXTRACT (YEAR FROM transdate) $sort_dir, EXTRACT (MONTH FROM transdate) $sort_dir";
138 144
  } else {
139 145
    $date_part_select = "EXTRACT (YEAR FROM transdate)";
140 146
    $group_by         = "EXTRACT (YEAR FROM transdate)";
141
    $order_by         = "EXTRACT (YEAR FROM transdate) DESC";
147
    $order_by         = "EXTRACT (YEAR FROM transdate) $sort_dir";
142 148
  }
143 149

  
144 150
  my $query = <<SQL;

Auch abrufbar als: Unified diff