diff --git a/client/src/css/structure.css b/client/src/css/structure.css index 39be218b9e..7b7eba63ed 100644 --- a/client/src/css/structure.css +++ b/client/src/css/structure.css @@ -842,3 +842,8 @@ growl-notification.fading.ng-leave.ng-leave-active { .ui-select-bootstrap > .ui-select-choices.ui-grid-ui-select { width: initial; } + +/* fix weird whitespace at the top of grids. */ +.ui-grid-canvas { + padding-top : 0; +} diff --git a/client/src/i18n/en.json b/client/src/i18n/en.json index 12c30c348e..1527b8abaa 100644 --- a/client/src/i18n/en.json +++ b/client/src/i18n/en.json @@ -648,6 +648,7 @@ "TRANSACTION" : "Transaction", "TRANSFER_ACCOUNT" : "Transfer Account", "TRANSFER_TYPE" : "Transfer Type", + "TRANSACTION_TYPE" : "Transaction Type", "TYPE" : "Type", "UNCONFIGURED" : "Unconfigured", "UNDEFINED" : "Undefined", diff --git a/client/src/js/services/PatientInvoiceForm.js b/client/src/js/services/PatientInvoiceForm.js index b08a61ed1a..ea5808f525 100644 --- a/client/src/js/services/PatientInvoiceForm.js +++ b/client/src/js/services/PatientInvoiceForm.js @@ -14,8 +14,6 @@ PatientInvoiceFormService.$inject = [ * with the Patient PatientInvoiceForm module. You must specify a cacheKey to enable the * class to be instantiated correctly. * - * @todo (required) discuss if all subsidies/billings services are all - * percentages. If so, the logic can be simplified. * @todo (required) only the maximum of the bill should be subsidised * @todo (required) billing services and subsidies should be ignored for * specific debtors. diff --git a/client/src/js/services/VoucherService.js b/client/src/js/services/VoucherService.js index 3aedad7149..9a17600ce1 100644 --- a/client/src/js/services/VoucherService.js +++ b/client/src/js/services/VoucherService.js @@ -2,8 +2,7 @@ angular.module('bhima.services') .service('VoucherService', VoucherService); VoucherService.$inject = [ - 'PrototypeApiService', '$http', 'util', - 'TransactionTypeStoreService' + 'PrototypeApiService', '$http', 'util', 'TransactionTypeStoreService' ]; /** diff --git a/client/src/js/services/util.js b/client/src/js/services/util.js index 354122e10c..c9b299639e 100644 --- a/client/src/js/services/util.js +++ b/client/src/js/services/util.js @@ -183,7 +183,24 @@ function UtilService(moment) { // if we haven't seen the value yet, add it to the array (otherwise, ignore it). if (uniq.indexOf(value) === -1) { uniq.push(value); } return uniq; - }, []); // initialize with an empty array }; + + + /** + * @function xor + * + * @description + * Returns the logical XOR of two booleans. + * + * @param {Boolean} a - a boolean value to XOR with b + * @param {Boolean} b - a boolean value to XOR with a + * + * @returns {Boolean} - the result + */ + service.xor = function xor(a, b) { + /*jshint -W018 */ + return !a !== !b; + /*jshint +W018 */ + }; } diff --git a/client/src/partials/patient_invoice/templates/grid/status.tmpl.html b/client/src/partials/patient_invoice/templates/grid/status.tmpl.html index 7fbe6fe1d7..7311006dd5 100644 --- a/client/src/partials/patient_invoice/templates/grid/status.tmpl.html +++ b/client/src/partials/patient_invoice/templates/grid/status.tmpl.html @@ -13,7 +13,7 @@ +
-
diff --git a/client/src/partials/reports/modals/cashflow.config.js b/client/src/partials/reports/modals/cashflow.config.js index 371e843878..aaf7edbd24 100644 --- a/client/src/partials/reports/modals/cashflow.config.js +++ b/client/src/partials/reports/modals/cashflow.config.js @@ -19,22 +19,21 @@ function CashflowConfigController($state, ModalInstance, Cashbox, Notify, Langua vm.cancel = ModalInstance.dismiss; vm.report = report; - vm.$loading = false; - - Cashbox.read(null, { detailed: 1, is_auxiliary: 0}) - .then(function (list) { - list.forEach(function (cashbox) { - cashbox.hrlabel = cashbox.label + ' ' + cashbox.symbol; - }); - vm.cashboxes = list; - }) - .catch(Notify.handleError); - - function generate() { - var url = 'reports/finance/cashflow'; - if (!vm.cashbox || !vm.dateFrom || !vm.label || !vm.dateTo) { return ; } + Cashbox.read(null, { detailed: 1 }) + .then(function (cashboxes) { + + cashboxes.forEach(function (cashbox) { + cashbox.hrlabel = cashbox.label + ' ' + cashbox.symbol; + }); + + vm.cashboxes = cashboxes; + }) + .catch(Notify.handleError); - vm.$loading = true; + function generate(form) { + if (form.$invalid) { return; } + + var url = 'reports/finance/cashflow'; var options = { account_id: vm.cashbox.account_id, @@ -45,16 +44,11 @@ function CashflowConfigController($state, ModalInstance, Cashbox, Notify, Langua weekly : vm.weekly }; - SavedReports.requestPDF(url, report, options) + return SavedReports.requestPDF(url, report, options) .then(function (result) { ModalInstance.dismiss(); $state.reload(); }) - .catch(function (error) { - throw error; - }) - .finally(function () { - vm.$loading = false; - }); + .catch(Notify.handleError); } } diff --git a/client/src/partials/reports/modals/cashflow.modal.html b/client/src/partials/reports/modals/cashflow.modal.html index c2340462e5..7afcfd5f2d 100644 --- a/client/src/partials/reports/modals/cashflow.modal.html +++ b/client/src/partials/reports/modals/cashflow.modal.html @@ -1,71 +1,71 @@ -
-