[open-ils-commits] [GIT] Evergreen ILS branch master updated. 3cbd3d76e094e1c8160c684922517431bcf10370
Evergreen Git
git at git.evergreen-ils.org
Fri Jul 31 17:53:54 EDT 2020
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 3cbd3d76e094e1c8160c684922517431bcf10370 (commit)
from ad4ec5958a1a17def4405dc6cce737e92a853009 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 3cbd3d76e094e1c8160c684922517431bcf10370
Author: Mike Rylander <mrylander at gmail.com>
Date: Tue Jun 30 15:33:23 2020 -0400
LP#1885759: Count months and quarters across year boundaries
We need to add year-multiples of months or quarters when using the
months_ago or quarters_ago transforms in the reporter.
Signed-off-by: Mike Rylander <mrylander at gmail.com>
Signed-off-by: Rogan Hamby <rogan.hamby at gmail.com>
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm b/Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm
index 0117d98bad..69eab42c24 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm
@@ -740,7 +740,8 @@ package OpenILS::Reporter::SQLBuilder::Column::Transform::months_ago;
sub toSQL {
my $self = shift;
- return 'EXTRACT(MONTH FROM AGE(NOW(),"' . $self->{_relation} . '"."' . $self->name . '"))';
+ return '(EXTRACT(YEAR FROM AGE(NOW(),"' . $self->{_relation} . '"."' . $self->name . '")) * 12) +'.
+ ' EXTRACT(MONTH FROM AGE(NOW(),"' . $self->{_relation} . '"."' . $self->name . '"))';
}
sub is_aggregate { return 0 }
@@ -762,7 +763,8 @@ package OpenILS::Reporter::SQLBuilder::Column::Transform::quarters_ago;
sub toSQL {
my $self = shift;
- return 'EXTRACT(QUARTER FROM AGE(NOW(),"' . $self->{_relation} . '"."' . $self->name . '"))';
+ return '(EXTRACT(YEAR FROM AGE(NOW(),"' . $self->{_relation} . '"."' . $self->name . '")) * 4) +'.
+ ' EXTRACT(QUARTER FROM AGE(NOW(),"' . $self->{_relation} . '"."' . $self->name . '"))';
}
sub is_aggregate { return 0 }
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/perlmods/lib/OpenILS/Reporter/SQLBuilder.pm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list