Author: spadkins
Date: Fri Aug 31 10:08:27 2007
New Revision: 9900
Modified:
p5ee/trunk/App-Repository/lib/App/Repository.pm
Log:
0000345: Hotel Occ% Totals was zero (summarize_rows). Plus fixed null column in
extend_columns
Modified: p5ee/trunk/App-Repository/lib/App/Repository.pm
==============================================================================
--- p5ee/trunk/App-Repository/lib/App/Repository.pm (original)
+++ p5ee/trunk/App-Repository/lib/App/Repository.pm Fri Aug 31 10:08:27 2007
@@ -919,7 +919,7 @@
&App::sub_entry if ($App::trace);
my ($self, $table, $cols, $options) = @_;
my (%colidx, $expr_columns, $expr, $extended, $col);
- my $OPTIONAL_DEFAULT = '(?::([-0-9\.]+))?';
+ my $OPTIONAL_DEFAULT = '(?::[-0-9\.]+)?';
# Take note of which columns are alread in the list of requested columns.
for (my $i = 0; $i <= $#$cols; $i++) {
$col = $cols->[$i];
@@ -2962,6 +2962,11 @@
&App::sub_entry if ($App::trace);
my ($self, $table, $rows, $columns, $summary_keys, $options) = @_;
+ #print STDERR "summarize_rows($table, ..., ..., [EMAIL PROTECTED], ...)\n";
+ #foreach my $row (@$rows) {
+ # print STDERR "summarize_rows(IN) {", join("|", %$row), "}\n";
+ #}
+
$summary_keys = [] if (!$summary_keys);
my $table_def = $self->get_table_def($table);
@@ -3069,6 +3074,14 @@
elsif ($column_defs->{$column}{is_key}) {
# do nothing
}
+ elsif ($column_defs->{$column}{type} &&
$column_defs->{$column}{type} =~ /^(integer|float)$/) {
+ push(@$sum_column_idx, $i);
+ $alternate_aggregate->[$i] = $rel_aggregate{$rel_name};
+ }
+ elsif (defined $column_defs->{$column}{default} &&
$column_defs->{$column}{default} =~ /^-?[0-9\.]+$/) {
+ push(@$sum_column_idx, $i);
+ $alternate_aggregate->[$i] = $rel_aggregate{$rel_name};
+ }
elsif (defined $value && $value =~ /^-?[0-9\.]+$/) {
push(@$sum_column_idx, $i);
$alternate_aggregate->[$i] = $rel_aggregate{$rel_name};
@@ -3239,6 +3252,10 @@
}
}
}
+
+ #foreach my $row (@summary_rows) {
+ # print STDERR "summarize_rows(OUT) {", join("|", %$row), "}\n";
+ #}
&App::sub_exit([EMAIL PROTECTED]) if ($App::trace);
return([EMAIL PROTECTED]);