-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Voucher Registry Module #561
Changes from 17 commits
d936e22
ac888fb
c00b046
5baf6fa
5b86593
92458cd
c0046b5
f647b0b
d54aa5a
3711adb
77fd28a
b029bd5
34f6255
965c597
96074df
8f7c57b
5c14fa4
18f3749
20adb89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -218,6 +218,11 @@ function bhimaConfig($stateProvider, $urlRouterProvider, $urlMatcherFactoryProvi | |
controller: 'ComplexJournalVoucherController as ComplexVoucherCtrl', | ||
templateUrl: 'partials/vouchers/complex.html' | ||
}) | ||
.state('vouchers', { | ||
url : '/vouchers', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Much better! |
||
controller: 'VoucherController as VoucherCtrl', | ||
templateUrl: 'partials/vouchers/index.html' | ||
}) | ||
|
||
/* 2.X Journal routes */ | ||
.state('journal', { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ bhPDFPrintController.$inject = ['$window', '$http', '$sce', '$timeout']; | |
* options="options"> | ||
* </bh-pdf-print> | ||
*/ | ||
function bhPDFPrintController($window, $http, $sce, $timeout) { | ||
function bhPDFPrintController($window, $http, $sce, $timeout, uuid) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You still don't need |
||
var cachedRequest; | ||
var component = this; | ||
|
||
|
@@ -57,7 +57,7 @@ function bhPDFPrintController($window, $http, $sce, $timeout) { | |
var loadingIndicatorDelay = 1000; | ||
|
||
component.$loading = false; | ||
component.embeddedContentId = 'pdfdirect'; | ||
component.embeddedContentId = 'pdfdirect' + Date.now(); | ||
|
||
// expose the print method to the view | ||
component.print = print; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,9 @@ function ModalService(Modal) { | |
// inventory list action : add or edit | ||
service.openInventoryListActions = openInventoryListActions; | ||
|
||
// date interval modal | ||
service.openDateInterval = openDateInterval; | ||
|
||
/** | ||
* Opens a "confirm delete" modal with a button for "Confirm" or "Cancel". | ||
* The modal is a safe replacement for $window.confirm(), since you cannot | ||
|
@@ -279,4 +282,23 @@ function ModalService(Modal) { | |
return instance.result; | ||
} | ||
|
||
/** Find by Date interval modal */ | ||
function openDateInterval(request) { | ||
|
||
var params = angular.extend(modalParameters, { | ||
templateUrl : 'partials/templates/modals/dateInterval.tmpl.html', | ||
controller : 'DateIntervalModalController', | ||
controllerAs : '$ctrl', | ||
size : 'xs', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this size There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see. Good decision 👍!
|
||
backdrop : 'static', | ||
animation : false, | ||
resolve : { | ||
data : function dataProvider() { return request; } | ||
} | ||
}); | ||
|
||
var instance = Modal.open(params); | ||
return instance.result; | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,17 +244,32 @@ function PrototypeApiService($http, util) { | |
|
||
// append the id to the base url | ||
var target = this.url.concat('reports/', param); | ||
return reportBuilder(this, param, filetype); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This |
||
} | ||
|
||
/** | ||
* Receipt | ||
*/ | ||
function receipt(param, filetype) { | ||
|
||
// append the id to the base url | ||
var target = this.url.concat('receipts/', param); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Putting this function in var voucherService = new Api('vouchers/');
voucherService.receipt(uuid); // sends GET vouchers/receipts/uuid
var accountService = new Api('accounts/');
accountService.receipt(uuid); // sends GET accounts/receipts/uuid
var inventoryService = new Api('inventory/');
inventoryService.receipt(uuid); // sends GET inventory/receipts/uuid That's a pretty cool API standard. I like it. @sfount, what do you think of this standard for APIs? Should receipts be part of each API, or a separate API altogether? You could also imagine...
Which do you prefer? |
||
return reportBuilder(param, filetype); | ||
} | ||
|
||
/** report builder */ | ||
function reportBuilder(param, filetype) { | ||
|
||
// filetype setup | ||
var responseType = filetype === 'pdf' ? 'arraybuffer' : null; | ||
var params = { renderer: filetype }; | ||
|
||
// send the GET request | ||
return this.$http.get(target, { | ||
return $http.get(target, { | ||
params: params, | ||
responseType: responseType | ||
}) | ||
.then(util.unwrapHttpResponse); | ||
.then(util.unwrapHttpResponse); | ||
} | ||
|
||
return Api; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div style="padding: 5px;"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Much better! |
||
<a href="" | ||
ng-if="row.entity.uuid" | ||
ng-click="grid.appScope.showReceipt(row.entity.uuid)" | ||
data-link-receipt="{{ row.entity.uuid }}"> | ||
<i class="fa fa-file-pdf-o"></i> {{ "TABLE.COLUMNS.RECEIPT" | translate }} | ||
</a> | ||
</div> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div style="padding: 5px;"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think @sfount created a class |
||
<span ng-class="{'label label-success': grid.appScope.getType(row.entity.type_id).incomeExpense == 'income', 'label label-warning': grid.appScope.getType(row.entity.type_id).incomeExpense == 'expense'}" href=""> | ||
{{ grid.appScope.getType(row.entity.type_id).text | translate }} | ||
<span ng-if="row.groupHeader">{{ COL_FIELD }}</span> | ||
</span> | ||
<a ng-if="grid.appScope.isDefined(row.entity)" class="label label-default">{{ "FORM.LABELS.UNDEFINED" | translate }}</a> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this
padding-top
necessary? It seems very ... custom.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the
flex-util
need some fixation, thepadding-top: 7px
is necessary to avoid to have something like this :The content of the util bar is so closed to the top of the
flex-util
bar, thepadding-top: 7px;
is not so good, maybe i can useline-height: 35px
or other things to center the content in the util bar.All proposals are welcome