-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(agedDebtors): implement client-side skeleton
This commit implements the client-side skeleton services/controllers around the aged debtors report.
- Loading branch information
Jonathan Niles
committed
Sep 17, 2016
1 parent
d6e7f5e
commit 7513239
Showing
6 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
client/src/partials/finance/reports/agedDebtors/agedDebtors.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<div class="flex-header static"> | ||
<div class="bhima-title"> | ||
<ol class="headercrumb"> | ||
<li class="static">{{ "TREE.FINANCE" | translate }}</li> | ||
<li class="static">{{ "TREE.REPORTS" | translate }}</li> | ||
<li class="title">{{ "TREE.AGED_DEBTORS" | translate }}</li> | ||
</ol> | ||
|
||
<div class="toolbar"> | ||
<div class="toolbar-item"> | ||
<button type="button" class="btn btn-default" ng-click="AgedDebtorsCtrl.create()"> | ||
<i class="fa fa-plus"></i> {{ "FORM.BUTTONS.NEW_REPORT" | translate }} | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="flex-content"> | ||
<div class="container-fluid"> | ||
<div | ||
id="report-grid" | ||
class="grid-full-height" | ||
ui-grid="AgedDebtorsCtrl.gridOptions"> | ||
|
||
<bh-grid-loading-indicator | ||
loading-state="AgedDebtorsCtrl.loading" | ||
empty-state="AgedDebtorsCtrl.gridOptions.data.length === 0" | ||
error-state="AgedDebtorsCtrl.hasError"> | ||
</bh-grid-loading-indicator> | ||
</div> | ||
</div> | ||
</div> |
36 changes: 36 additions & 0 deletions
36
client/src/partials/finance/reports/agedDebtors/agedDebtors.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
angular.module('bhima.controllers') | ||
.controller('AgedDebtorsController', AgedDebtorsController); | ||
|
||
AgedDebtorsController.$inject = [ | ||
'NotifyService', 'AgedDebtorReportService' | ||
]; | ||
|
||
function AgedDebtorsController(Notify, AgedDebtorReports) { | ||
var vm = this; | ||
|
||
// basic grid options | ||
vm.gridOptions = { | ||
fastWatch: true, | ||
flatEntityAccess: true, | ||
appScopeProvider: vm | ||
}; | ||
|
||
// report column definitions | ||
vm.gridOptions.columnDefs = [ | ||
{ field: 'label', displayName: 'FORM.LABELS.LABEL', headerCellFilter: 'translate' }, | ||
{ field: 'timestamp', displayName: 'FORM.LABELS.DATE', headerCellFilter: 'translate', cellFilter: 'date' }, | ||
{ field: 'user', displayName: 'FORM.LABELS.USER', headerCellFilter: 'translate' }, | ||
{ field: 'actions', displayName: 'FORM.LABELS.ACTIONS', headerCellFilter: 'translate' } | ||
]; | ||
|
||
AgedDebtorReports.read() | ||
.then(function (reports) { | ||
vm.gridOptions.data = reports; | ||
}) | ||
.catch(Notify.handleError); | ||
|
||
// open the configuration modal for a new Aged Debtors report | ||
vm.create = function create() { | ||
AgedDebtorReports.openCreateModal(); | ||
}; | ||
} |
13 changes: 13 additions & 0 deletions
13
client/src/partials/finance/reports/agedDebtors/agedDebtors.service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
angular.module('bhima.services') | ||
.service('AgedDebtorReportService', AgedDebtorReportService); | ||
|
||
AgedDebtorReportService.$inject = [ 'PrototypeApiService', 'bhConstants' ]; | ||
|
||
function AgedDebtorReportService(Api, bhConstants) { | ||
var service = new Api('/finance/reports/'); | ||
|
||
// bind the report type to the service | ||
service.REPORT_TYPE = bhConstants.reports.AGED_DEBTOR; | ||
|
||
return service; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters