Skip to content

Commit

Permalink
feat(journal): show aggregate header for date + record (#1542)
Browse files Browse the repository at this point in the history
This commit implements the date and record aggregates in the Posting Journal.  I have used MIN for
the aggregation, though MAX would work as well.  Ultimately, no choice would make sense if the
column contains non-uniform information.  These columns are expected to have uniform values.
  • Loading branch information
jniles committed Apr 27, 2017
1 parent de7451a commit 033d9cd
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions client/src/modules/journal/journal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ JournalController.$inject = [
'SessionService', 'NotifyService', 'TransactionService', 'GridEditorService',
'bhConstants', '$state', 'uiGridConstants', 'ModalService', 'LanguageService',
'AppCache', 'Store', 'uiGridGroupingConstants', 'ExportService', 'FindEntityService',
'FilterService', '$rootScope',
'FilterService', '$rootScope', '$filter'
];

/**
Expand All @@ -32,8 +32,8 @@ JournalController.$inject = [
*/
function JournalController(Journal, Sorting, Grouping,
Filtering, Columns, Config, Session, Notify, Transactions, Editors,
bhConstants, $state, uiGridConstants, Modal, Languages,
AppCache, Store, uiGridGroupingConstants, Export, FindEntity, Filters, $rootScope) {
bhConstants, $state, uiGridConstants, Modal, Languages, AppCache, Store,
uiGridGroupingConstants, Export, FindEntity, Filters, $rootScope, $filter) {
// Journal utilities
var sorting;
var grouping;
Expand Down Expand Up @@ -151,21 +151,28 @@ function JournalController(Journal, Sorting, Grouping,
width : 110,
cellTemplate : 'modules/journal/templates/hide-groups-label.cell.html' },

{ field : 'trans_date',
displayName : 'TABLE.COLUMNS.DATE',
{ field : 'trans_date',
displayName : 'TABLE.COLUMNS.DATE',
headerCellFilter : 'translate',
cellFilter : 'date:"' + bhConstants.dates.format + '"',
filter : { condition: filtering.filterByDate },
editableCellTemplate : 'modules/journal/templates/date.edit.html',
treeAggregationType : uiGridGroupingConstants.aggregation.MIN,
customTreeAggregationFinalizerFn : function (aggregation) {
aggregation.rendered = $filter('date')(aggregation.value, bhConstants.dates.format);
},
enableCellEdit : true,
footerCellTemplate : '<i></i>' },

{ field : 'hrRecord',
displayName : 'TABLE.COLUMNS.RECORD',
headerCellFilter : 'translate',
cellFilter : 'date:"' + bhConstants.dates.format + '"',
filter : { condition: filtering.filterByDate },
editableCellTemplate : 'modules/journal/templates/date.edit.html',
enableCellEdit : true,
visible : true,
treeAggregationType : uiGridGroupingConstants.aggregation.MIN,
treeAggregationLabel : '',
enableCellEdit : false,
footerCellTemplate : '<i></i>' },

{ field : 'hrRecord',
displayName : 'TABLE.COLUMNS.RECORD',
headerCellFilter : 'translate',
visible : true,
enableCellEdit : false },

{ field : 'description',
displayName : 'TABLE.COLUMNS.DESCRIPTION',
headerCellFilter : 'translate',
Expand Down

0 comments on commit 033d9cd

Please sign in to comment.