diff --git a/client/src/modules/ipr_tax/configuration/iprTaxConfig.js b/client/src/modules/ipr_tax/configuration/iprTaxConfig.js index 0df96f9b1c..860b233395 100644 --- a/client/src/modules/ipr_tax/configuration/iprTaxConfig.js +++ b/client/src/modules/ipr_tax/configuration/iprTaxConfig.js @@ -2,22 +2,19 @@ angular.module('bhima.controllers') .controller('IprTaxConfigurationController', IprTaxConfigurationController); IprTaxConfigurationController.$inject = [ - 'IprTaxConfigService', 'ModalService', - 'NotifyService', 'uiGridConstants', '$state', 'SessionService', + 'IprTaxConfigService', 'ModalService', 'NotifyService', 'uiGridConstants', '$state', ]; /** * IprTax Configuration Controller * - * This controller is about the IprTax configuration module in the admin zone - * It's responsible for creating, editing and updating a IprTax + * This controller is about the IprTax configuration module in the payroll modules. + * It's responsible for creating, editing and deleteing IprTax configurations. */ function IprTaxConfigurationController( - IprTaxes, ModalService, - Notify, uiGridConstants, $state, Session + IprTaxes, ModalService, Notify, uiGridConstants, $state, ) { - var vm = this; - var gridColumn; + const vm = this; // bind methods vm.deleteIprTax = deleteIprTax; @@ -29,49 +26,74 @@ function IprTaxConfigurationController( vm.gridApi = {}; vm.filterEnabled = false; - gridColumn = [ - { - field : 'rate', displayName : 'FORM.LABELS.RATE', headerCellFilter : 'translate', width : 60, cellFilter : 'percentage', - }, - { - field : 'tranche_annuelle_debut', displayName : 'FORM.LABELS.ANNUAL_TRANCH_FROM', headerCellFilter : 'translate', width : 170, cellFilter : 'currency:row.entity.currency_id', - }, - { - field : 'tranche_annuelle_fin', displayName : 'FORM.LABELS.ANNUAL_TRANCH_TO', headerCellFilter : 'translate', width : 170, cellFilter : 'currency:row.entity.currency_id', - }, - { - field : 'tranche_mensuelle_debut', displayName : 'FORM.LABELS.MONTH_TRANCH_FROM', headerCellFilter : 'translate', width : 170, cellFilter : 'currency:row.entity.currency_id', - }, - { - field : 'tranche_mensuelle_fin', displayName : 'FORM.LABELS.MONTH_TRANCH_TO', headerCellFilter : 'translate', width : 170, cellFilter : 'currency:row.entity.currency_id', - }, - { - field : 'ecart_annuel', displayName : 'FORM.LABELS.ANNUAL_ECART', headerCellFilter : 'translate', cellFilter : 'currency:row.entity.currency_id', - }, - { - field : 'ecart_mensuel', displayName : 'FORM.LABELS.MONTH_ECART', headerCellFilter : 'translate', cellFilter : 'currency:row.entity.currency_id', - }, - { - field : 'impot_annuel', displayName : 'FORM.LABELS.ANNUAL_IMPOT', headerCellFilter : 'translate', cellFilter : 'currency:row.entity.currency_id', - }, - { - field : 'impot_mensuel', displayName : 'FORM.LABELS.MONTH_IMPOT', headerCellFilter : 'translate', cellFilter : 'currency:row.entity.currency_id', - }, - { - field : 'cumul_annuel', displayName : 'FORM.LABELS.ANNUAL_CUMUL', headerCellFilter : 'translate', cellFilter : 'currency:row.entity.currency_id', - }, - { - field : 'cumul_mensuel', displayName : 'FORM.LABELS.MONTH_CUMUL', headerCellFilter : 'translate', cellFilter : 'currency:row.entity.currency_id', - }, - { - field : 'action', - width : 80, - displayName : '', - cellTemplate : '/modules/ipr_tax/templates/actionConfig.tmpl.html', - enableSorting : false, - enableFiltering : false, - }, - ]; + const gridColumn = [{ + field : 'rate', + displayName : 'FORM.LABELS.RATE', + headerCellFilter : 'translate', + width : 60, + cellFilter : 'percentage', + }, { + field : 'tranche_annuelle_debut', + displayName : 'FORM.LABELS.ANNUAL_TRANCH_FROM', + headerCellFilter : 'translate', + width : 170, + cellFilter : 'currency:row.entity.currency_id', + }, { + field : 'tranche_annuelle_fin', + displayName : 'FORM.LABELS.ANNUAL_TRANCH_TO', + headerCellFilter : 'translate', + width : 170, + cellFilter : 'currency:row.entity.currency_id', + }, { + field : 'tranche_mensuelle_debut', + displayName : 'FORM.LABELS.MONTH_TRANCH_FROM', + headerCellFilter : 'translate', + width : 170, + cellFilter : 'currency:row.entity.currency_id', + }, { + field : 'tranche_mensuelle_fin', + displayName : 'FORM.LABELS.MONTH_TRANCH_TO', + headerCellFilter : 'translate', + width : 170, + cellFilter : 'currency:row.entity.currency_id', + }, { + field : 'ecart_annuel', + displayName : 'FORM.LABELS.ANNUAL_ECART', + headerCellFilter : 'translate', + cellFilter : 'currency:row.entity.currency_id', + }, { + field : 'ecart_mensuel', + displayName : 'FORM.LABELS.MONTH_ECART', + headerCellFilter : 'translate', + cellFilter : 'currency:row.entity.currency_id', + }, { + field : 'impot_annuel', + displayName : 'FORM.LABELS.ANNUAL_IMPOT', + headerCellFilter : 'translate', + cellFilter : 'currency:row.entity.currency_id', + }, { + field : 'impot_mensuel', + displayName : 'FORM.LABELS.MONTH_IMPOT', + headerCellFilter : 'translate', + cellFilter : 'currency:row.entity.currency_id', + }, { + field : 'cumul_annuel', + displayName : 'FORM.LABELS.ANNUAL_CUMUL', + headerCellFilter : 'translate', + cellFilter : 'currency:row.entity.currency_id', + }, { + field : 'cumul_mensuel', + displayName : 'FORM.LABELS.MONTH_CUMUL', + headerCellFilter : 'translate', + cellFilter : 'currency:row.entity.currency_id', + }, { + field : 'action', + width : 80, + displayName : '', + cellTemplate : '/modules/ipr_tax/templates/actionConfig.tmpl.html', + enableSorting : false, + enableFiltering : false, + }]; // options for the UI grid vm.gridOptions = { @@ -97,6 +119,11 @@ function IprTaxConfigurationController( function iprScaleSelect(scaleId) { vm.taxIprId = scaleId; + // If taxIPrId is not defined, we can't load the taxes + // The user should select the year from the top of the grid to select + // the data to load. + // TODO(@jniles) - can we just reuse past IPR configurations? Do they change often + // enough to merit the user having to recreate it every year? if (vm.taxIprId) { loadIprTaxes(); } @@ -106,11 +133,11 @@ function IprTaxConfigurationController( vm.loading = true; IprTaxes.read(null, { taxe_ipr_id : vm.taxIprId }) - .then(function (data) { + .then((data) => { vm.gridOptions.data = data; }) .catch(Notify.handleError) - .finally(function () { + .finally(() => { vm.loading = false; }); } @@ -118,11 +145,11 @@ function IprTaxConfigurationController( // switch to delete warning mode function deleteIprTax(title) { ModalService.confirm('FORM.DIALOGS.CONFIRM_DELETE') - .then(function (bool) { + .then((bool) => { if (!bool) { return; } IprTaxes.delete(title.id) - .then(function () { + .then(() => { Notify.success('FORM.INFO.DELETE_SUCCESS'); loadIprTaxes(); }) diff --git a/client/src/modules/ipr_tax/ipr_tax.routes.js b/client/src/modules/ipr_tax/ipr_tax.routes.js index 3401b0ce3f..b2c2778998 100644 --- a/client/src/modules/ipr_tax/ipr_tax.routes.js +++ b/client/src/modules/ipr_tax/ipr_tax.routes.js @@ -23,7 +23,7 @@ angular.module('bhima.routes') }) .state('iprConfiguration.createConfig', { - url : '/:taxIprId/configuration/create', + url : '/:taxIprId/create', params : { isCreateState : { value : true }, taxIprId : { value : null }, @@ -42,7 +42,7 @@ angular.module('bhima.routes') }) .state('iprConfiguration.editConfig', { - url : '/:taxIprId/configuration/:id/edit', + url : '/:taxIprId/edit/:id', params : { taxIprId : { value : null }, id : { value : null }, diff --git a/client/src/modules/ipr_tax/ipr_tax.service.js b/client/src/modules/ipr_tax/ipr_tax.service.js index 16daa5393a..4b1d19d0a6 100644 --- a/client/src/modules/ipr_tax/ipr_tax.service.js +++ b/client/src/modules/ipr_tax/ipr_tax.service.js @@ -8,10 +8,8 @@ IprTaxService.$inject = ['PrototypeApiService']; * @extends PrototypeApiService * * @description - * Encapsulates common requests to the /iprTaxes/ URL. + * Encapsulates common requests to the /iprTax/ URL. */ function IprTaxService(Api) { - var service = new Api('/iprTax/'); - - return service; + return new Api('/iprTax/'); } diff --git a/client/src/modules/ipr_tax/ipr_tax_config.service.js b/client/src/modules/ipr_tax/ipr_tax_config.service.js index 87dc8a56b4..969c59eb48 100644 --- a/client/src/modules/ipr_tax/ipr_tax_config.service.js +++ b/client/src/modules/ipr_tax/ipr_tax_config.service.js @@ -1,7 +1,7 @@ angular.module('bhima.services') .service('IprTaxConfigService', IprTaxConfigService); -IprTaxConfigService.$inject = ['PrototypeApiService', '$uibModal']; +IprTaxConfigService.$inject = ['PrototypeApiService']; /** * @class IprTaxConfigService @@ -10,13 +10,13 @@ IprTaxConfigService.$inject = ['PrototypeApiService', '$uibModal']; * @description * Encapsulates common requests to the /iprTaxConfig/ URL. */ -function IprTaxConfigService(Api, Modal) { - var service = new Api('/iprTaxConfig/'); +function IprTaxConfigService(Api) { + const service = new Api('/iprTaxConfig/'); service.configData = configData; function configData(params, scales) { - var iprConfig = {}; - var cumul = 0; + const iprConfig = {}; + let cumul = 0; iprConfig.taxe_ipr_id = params.taxe_ipr_id; iprConfig.rate = params.rate; @@ -26,20 +26,24 @@ function IprTaxConfigService(Api, Modal) { iprConfig.tranche_mensuelle_debut = params.tranche_annuelle_debut / 12; iprConfig.tranche_mensuelle_fin = params.tranche_annuelle_fin / 12; - iprConfig.ecart_annuel = params.tranche_annuelle_fin - params.tranche_annuelle_debut; + iprConfig.ecart_annuel = params.tranche_annuelle_fin - params.tranche_annuelle_debut; iprConfig.ecart_mensuel = iprConfig.tranche_mensuelle_fin - iprConfig.tranche_mensuelle_debut; iprConfig.impot_annuel = iprConfig.ecart_annuel * (params.rate / 100); iprConfig.impot_mensuel = iprConfig.impot_annuel / 12; - scales.forEach(function (scale) { + // TODO(@jniles) - test this configData() function + scales.forEach((scale) => { if (scale.tranche_annuelle_fin === iprConfig.tranche_annuelle_debut) { cumul = iprConfig.impot_annuel + scale.cumul_annuel; } }); + // calculate the cumulative annual tax rate iprConfig.cumul_annuel = cumul; + // compute the monthly cumulative tax rate iprConfig.cumul_mensuel = iprConfig.cumul_annuel / 12; + return iprConfig; } diff --git a/client/src/modules/ipr_tax/modals/ipr_tax_config.modal.html b/client/src/modules/ipr_tax/modals/ipr_tax_config.modal.html index 089b5ae27f..e2514fd504 100644 --- a/client/src/modules/ipr_tax/modals/ipr_tax_config.modal.html +++ b/client/src/modules/ipr_tax/modals/ipr_tax_config.modal.html @@ -42,7 +42,7 @@ FORM.BUTTONS.CANCEL - + FORM.BUTTONS.SUBMIT diff --git a/client/src/modules/ipr_tax/modals/ipr_tax_config.modal.js b/client/src/modules/ipr_tax/modals/ipr_tax_config.modal.js index a5a2bf495a..fa6b4ab083 100644 --- a/client/src/modules/ipr_tax/modals/ipr_tax_config.modal.js +++ b/client/src/modules/ipr_tax/modals/ipr_tax_config.modal.js @@ -2,10 +2,10 @@ angular.module('bhima.controllers') .controller('IprTaxConfigModalController', IprTaxConfigModalController); IprTaxConfigModalController.$inject = [ - '$state', 'IprTaxService', 'IprTaxConfigService', 'NotifyService', 'appcache', 'params', + '$state', '$q', 'IprTaxService', 'IprTaxConfigService', 'NotifyService', 'appcache', 'params', ]; -function IprTaxConfigModalController($state, IprTax, IprConfig, Notify, AppCache, params) { +function IprTaxConfigModalController($state, $q, IprTax, IprConfig, Notify, AppCache, params) { const vm = this; vm.iprTax = {}; @@ -23,38 +23,41 @@ function IprTaxConfigModalController($state, IprTax, IprConfig, Notify, AppCache // exposed methods vm.submit = submit; - if (vm.stateParams.taxIprId) { - IprTax.read(vm.stateParams.taxIprId) - .then((iprTax) => { + function startup() { + vm.loading = true; + + // both edit and create state + $q.all([ + IprTax.read(vm.stateParams.taxIprId), + IprConfig.read(null, { taxe_ipr_id : vm.stateParams.taxIprId }), + ]) + .then(([iprTax, iprConfig]) => { iprTax.taxe_ipr_id = iprTax.id; delete iprTax.id; vm.iprTax = iprTax; - }) - .catch(Notify.handleError); - - IprConfig.read(null, { taxe_ipr_id : vm.taxIprId }) - .then((iprConfig) => { vm.iprConfig = iprConfig; - }) - .catch(Notify.handleError); - } - if (!vm.isCreateState) { - IprConfig.read(vm.stateParams.id) - .then((iprTax) => { - vm.iprTax = iprTax; + // edit state only + if (!vm.isCreateState) { + return IprConfig.read(vm.stateParams.id) + .then(iprTaxData => { vm.iprTax = iprTaxData; }); + } + + return 0; }) - .catch(Notify.handleError); + .catch(Notify.handleError) + .finally(() => { vm.loading = false; }); } // submit the data to the server from all two forms (update, create) function submit(iprTaxForm) { - if (iprTaxForm.$invalid) { return 0; } + const iprConfigData = IprConfig.configData(vm.iprTax, vm.iprConfig); - const promise = (vm.isCreateState) ? IprConfig.create(iprConfigData) + const promise = (vm.isCreateState) + ? IprConfig.create(iprConfigData) : IprConfig.update(vm.iprTax.id, iprConfigData); return promise @@ -66,4 +69,5 @@ function IprTaxConfigModalController($state, IprTax, IprConfig, Notify, AppCache .catch(Notify.handleError); } + startup(); } diff --git a/client/src/modules/payroll/rubric_configuration/configuration.routes.js b/client/src/modules/payroll/rubric_configuration/configuration.routes.js index b7324060e4..4a7a7b96e6 100644 --- a/client/src/modules/payroll/rubric_configuration/configuration.routes.js +++ b/client/src/modules/payroll/rubric_configuration/configuration.routes.js @@ -12,7 +12,7 @@ angular.module('bhima.routes') params : { isCreateState : { value : true }, }, - onEnter : ['$uibModal', '$transition$', configurationRubricModal], + onEnter : ['$uibModal', '$transition$', configurationRubric], onExit : ['$uibModalStack', closeModal], }) @@ -21,32 +21,16 @@ angular.module('bhima.routes') params : { id : { value : null }, }, - onEnter : ['$uibModal', '$transition$', configurationRubricModal], - onExit : ['$uibModalStack', closeModal], - }) - - .state('configurationRubric.config', { - url : '/:id/config', - params : { - id : { value : null }, - }, onEnter : ['$uibModal', '$transition$', configurationRubric], onExit : ['$uibModalStack', closeModal], }); }]); -function configurationRubricModal($modal, $transition) { - $modal.open({ - templateUrl : 'modules/payroll/rubric_configuration/modals/rubric.modal.html', - controller : 'ConfigModalController as ConfigModalCtrl', - resolve : { params : () => $transition.params('to') }, - }).result.catch(angular.noop); -} - function configurationRubric($modal, $transition) { $modal.open({ templateUrl : 'modules/payroll/rubric_configuration/modals/config.modal.html', controller : 'RubricConfigModalController as RubricConfigModalCtrl', + size : 'lg', resolve : { params : () => $transition.params('to') }, }).result.catch(angular.noop); } diff --git a/client/src/modules/payroll/rubric_configuration/configuration.service.js b/client/src/modules/payroll/rubric_configuration/configuration.service.js index e92bb345ab..248f61665b 100644 --- a/client/src/modules/payroll/rubric_configuration/configuration.service.js +++ b/client/src/modules/payroll/rubric_configuration/configuration.service.js @@ -1,38 +1,16 @@ angular.module('bhima.services') .service('ConfigurationService', ConfigurationService); -ConfigurationService.$inject = ['PrototypeApiService', '$http', 'util']; +ConfigurationService.$inject = ['PrototypeApiService']; /** - * @class RubricService + * @class ConfigurationService * @extends PrototypeApiService * * @description - * Encapsulates common requests to the /rubric_config/ URL. + * Encapsulates common requests to the /payroll/rubric_config/ URL. + * TODO(@jniles): rename this service */ -function ConfigurationService(Api, $http, util) { - const service = new Api('/rubric_config/'); - - service.getRubrics = getRubrics; - service.setRubrics = setRubrics; - - // loads the configuration's rubrics - function getRubrics(id) { - if (angular.isUndefined(id)) { - throw new Error( - 'Trying to get configuration of rubrics without the identity property', - ); - } - - return $http.get(`/rubric_config/${id}/setting`) - .then(util.unwrapHttpResponse); - } - - // Sets Payroll Rubric's Configuration using the public API - function setRubrics(id, data) { - return $http.post(`/rubric_config/${id}/setting`, { configuration : data }) - .then(util.unwrapHttpResponse); - } - - return service; +function ConfigurationService(Api) { + return new Api('/payroll/rubric_config/'); } diff --git a/client/src/modules/payroll/rubric_configuration/modals/config.modal.html b/client/src/modules/payroll/rubric_configuration/modals/config.modal.html index d42d23ec4c..4d90dd97c5 100644 --- a/client/src/modules/payroll/rubric_configuration/modals/config.modal.html +++ b/client/src/modules/payroll/rubric_configuration/modals/config.modal.html @@ -9,108 +9,118 @@ - - - + + + FORM.LABELS.DESIGNATION + + + + + + + + + + TABLE.COLUMNS.EMPTY - + - PAYROLL_RUBRIC.ALL_PAYROLL_RUBRICS + PAYROLL_RUBRIC.ALL_PAYROLL_RUBRICS - - - + + + - FORM.LABELS.SOCIAL_CARE + FORM.LABELS.SOCIAL_CARE - - - + + + - {{ rubric.label }} + {{::rubric.label }} - - - + + + - FORM.LABELS.MEMBERSHIP_FEE + FORM.LABELS.MEMBERSHIP_FEE - - - + + + {{ rubric.label }} - - - + + + - FORM.LABELS.TAXES + FORM.LABELS.TAXES - - - + + + {{ rubric.label }} - - - + + + - PAYROLL_RUBRIC.INDEXES + PAYROLL_RUBRIC.INDEXES - - - + + + {{ rubric.label }} - - - + + + - FORM.LABELS.OTHERS + FORM.LABELS.OTHERS - - - + + + - {{ unit.label }} + {{ ::unit.label }} diff --git a/client/src/modules/payroll/rubric_configuration/modals/config.modal.js b/client/src/modules/payroll/rubric_configuration/modals/config.modal.js index 848c0653a6..f46733ed8c 100644 --- a/client/src/modules/payroll/rubric_configuration/modals/config.modal.js +++ b/client/src/modules/payroll/rubric_configuration/modals/config.modal.js @@ -2,10 +2,16 @@ angular.module('bhima.controllers') .controller('RubricConfigModalController', RubricConfigModalController); RubricConfigModalController.$inject = [ - '$state', 'ConfigurationService', 'NotifyService', 'appcache', 'RubricService', 'params', + '$state', 'ConfigurationService', 'NotifyService', 'appcache', 'RubricService', 'params', '$q', ]; -function RubricConfigModalController($state, Configs, Notify, AppCache, Rubrics, params) { +/** +* @function RubricConfigModalController +* +* @description This controller is responsible for the configuration of rubrics in the payroll module. +* It provides the user with a modal to select which rubrics are active in the payroll configuration. +*/ +function RubricConfigModalController($state, Configs, Notify, AppCache, Rubrics, params, $q) { const vm = this; vm.config = {}; @@ -26,7 +32,6 @@ function RubricConfigModalController($state, Configs, Notify, AppCache, Rubrics, vm.taxCheck = false; vm.otherCheck = false; vm.membershipFeeCheck = false; - vm.loading = true; vm.toggleAllRubrics = toggleAllRubrics; vm.toggleSocialCares = toggleSocialCares; @@ -38,51 +43,45 @@ function RubricConfigModalController($state, Configs, Notify, AppCache, Rubrics, vm.submit = submit; vm.closeModal = closeModal; - Configs.read(vm.stateParams.id) - .then(config => { - vm.config = config; - }) - .catch(Notify.handleError); - - Rubrics.read() - .then(rubrics => { - vm.rubrics = rubrics; - - vm.socialCares = rubrics.filter(item => item.is_social_care); - - vm.taxes = rubrics.filter(item => item.is_tax); - - vm.indexes = rubrics.filter(item => item.is_indice); - - vm.membershipFee = rubrics.filter(item => item.is_membership_fee); - - vm.others = rubrics.filter(item => { - return (!item.is_tax && !item.is_social_care && !item.is_membership_fee && !item.is_indice); - }); - - vm.loading = false; - - return Configs.getRubrics(vm.stateParams.id); - }) - .then(rubConfig => { - vm.rubConfig = rubConfig; - const rubConfigMap = {}; - rubConfig.forEach(object => { - rubConfigMap[object.rubric_payroll_id] = true; - }); - - const rubricGroups = [vm.socialCares, vm.taxes, vm.indexes, vm.membershipFee, vm.others]; - - rubricGroups.forEach(group => { - group.forEach(unit => { - if (rubConfigMap[unit.id]) { - unit.checked = true; - } + // TODO(@jniles): use a classify() statement to classify the rubrics based on their respective categtorization + function startup() { + vm.loading = true; + + $q.all([ + Configs.read(vm.stateParams.id), + Rubrics.read(), + ]) + .then(([config, rubrics]) => { + vm.config = config; + vm.rubrics = rubrics; + + // TODO(@jniles): why do we have a different classifcation of rubrics here? + vm.socialCares = rubrics.filter(Rubrics.isSocialCareRubric); + vm.taxes = rubrics.filter(Rubrics.isTaxRubric); + vm.indexes = rubrics.filter(Rubrics.isIndexRubric); + vm.membershipFee = rubrics.filter(Rubrics.isMembershipFeeRubric); + vm.others = rubrics.filter(Rubrics.isOtherRubric); + + // return early if we are in the "create" state, since we don't have any items to process. + if (vm.isCreateState) { + return; + } + + // check the rubrics in the UI that are configured for this rubric. + const rubricGroups = [vm.socialCares, vm.taxes, vm.indexes, vm.membershipFee, vm.others]; + const rubricItems = new Set(vm.config.items.map(c => c.rubric_payroll_id)); + + rubricGroups.forEach(group => { + group.forEach(unit => { + if (rubricItems.has(unit.id)) { + unit.checked = true; + } + }); }); - }); - - }) - .catch(Notify.handleError); + }) + .catch(Notify.handleError) + .finally(() => { vm.loading = false; }); + } // toggles all Rubrics to match there Configuration Rubric's setting function toggleAllRubrics(bool) { @@ -138,7 +137,12 @@ function RubricConfigModalController($state, Configs, Notify, AppCache, Rubrics, } // submit the data to the server from all two forms (update, create) - function submit() { + function submit(form) { + if (form.$invalid) { + Notify.danger('FORM.ERRORS.HAS_ERRORS'); + return 0; + } + const rubricChecked = []; const rubricGroups = [vm.socialCares, vm.taxes, vm.indexes, vm.membershipFee, vm.others]; @@ -148,15 +152,28 @@ function RubricConfigModalController($state, Configs, Notify, AppCache, Rubrics, }); }); - return Configs.setRubrics(vm.stateParams.id, rubricChecked) + const data = { + items : rubricChecked, + label : vm.config.label, + }; + + const promise = vm.isCreateState + ? Configs.create(data) + : Configs.update(vm.stateParams.id, data); + + return promise .then(() => { - Notify.success('FORM.INFO.UPDATE_SUCCESS'); + if (vm.isCreateState) { + Notify.success('FORM.INFO.CREATE_SUCCESS'); + } else { + Notify.success('FORM.INFO.UPDATE_SUCCESS'); + } $state.go('configurationRubric', null, { reload : true }); }) .catch(Notify.handleError); } - function closeModal() { - $state.go('configurationRubric'); - } + function closeModal() { $state.go('^'); } + + startup(); } diff --git a/client/src/modules/payroll/rubric_configuration/modals/rubric.modal.html b/client/src/modules/payroll/rubric_configuration/modals/rubric.modal.html deleted file mode 100644 index 4148e3ffb5..0000000000 --- a/client/src/modules/payroll/rubric_configuration/modals/rubric.modal.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - TREE.HUMAN_RESOURCES - - PAYROLL_RUBRIC.ADD_PAYROLL_RUBRIC_CONFIGURATION - FORM.LABELS.CREATE - - - PAYROLL_RUBRIC.EDIT_PAYROLL_RUBRIC - FORM.LABELS.UPDATE - - - - - - - FORM.LABELS.DESIGNATION - - - - - - - - - \ No newline at end of file diff --git a/client/src/modules/payroll/rubric_configuration/modals/rubric.modal.js b/client/src/modules/payroll/rubric_configuration/modals/rubric.modal.js deleted file mode 100644 index 6debe6b724..0000000000 --- a/client/src/modules/payroll/rubric_configuration/modals/rubric.modal.js +++ /dev/null @@ -1,56 +0,0 @@ -angular.module('bhima.controllers') - .controller('ConfigModalController', ConfigModalController); - -ConfigModalController.$inject = [ - '$state', 'ConfigurationService', 'ModalService', 'NotifyService', 'appcache', 'params', -]; - -function ConfigModalController($state, Configs, ModalService, Notify, AppCache, params) { - const vm = this; - vm.rubric = {}; - - const cache = AppCache('RubricModal'); - - if (params.isCreateState || params.id) { - cache.stateParams = params; - vm.stateParams = cache.stateParams; - } else { - vm.stateParams = cache.stateParams; - } - - vm.isCreateState = vm.stateParams.isCreateState; - - // exposed methods - vm.submit = submit; - vm.closeModal = closeModal; - - if (!vm.isCreateState) { - Configs.read(vm.stateParams.id) - .then((rubric) => { - vm.rubric = rubric; - vm.setting = true; - }) - .catch(Notify.handleError); - } - - // submit the data to the server from all two forms (update, create) - function submit(rubricForm) { - if (rubricForm.$invalid || rubricForm.$pristine) { return 0; } - - const promise = (vm.isCreateState) - ? Configs.create(vm.rubric) - : Configs.update(vm.rubric.id, vm.rubric); - - return promise - .then(() => { - const translateKey = (vm.isCreateState) ? 'FORM.INFO.CREATE_SUCCESS' : 'FORM.INFO.UPDATE_SUCCESS'; - Notify.success(translateKey); - $state.go('configurationRubric', null, { reload : true }); - }) - .catch(Notify.handleError); - } - - function closeModal() { - $state.go('configurationRubric'); - } -} diff --git a/client/src/modules/payroll/rubric_configuration/templates/action.tmpl.html b/client/src/modules/payroll/rubric_configuration/templates/action.tmpl.html index 12831e4163..104c1fa781 100644 --- a/client/src/modules/payroll/rubric_configuration/templates/action.tmpl.html +++ b/client/src/modules/payroll/rubric_configuration/templates/action.tmpl.html @@ -11,11 +11,6 @@ FORM.BUTTONS.EDIT - - - FORM.BUTTONS.CONFIGURE - - diff --git a/client/src/modules/payroll/rubrics/rubrics.service.js b/client/src/modules/payroll/rubrics/rubrics.service.js index f7ba8ac86e..2a79b44403 100644 --- a/client/src/modules/payroll/rubrics/rubrics.service.js +++ b/client/src/modules/payroll/rubrics/rubrics.service.js @@ -40,5 +40,25 @@ function RubricService(Api) { { id : 'is_performance_bonus', label : 'PAYROLL_RUBRIC.PERFORMANCE_BONUS' }, { id : 'is_individual_performance', label : 'PAYROLL_RUBRIC.INDIVIDUAL_PERFORMANCE' }, ]; + + // NOTE(@jniles): these are the same definitions as found in payroll/common.js + service.isBenefitRubric = (rubric) => rubric.is_discount !== 1; + service.isWithholdingRubric = (rubric) => rubric.is_discount === 1 && rubric.is_employee === 1; + service.isPayrollTaxRubric = (rubric) => ( + rubric.is_employee !== 1 && rubric.is_discount === 1 && rubric.is_linked_pension_fund === 0 + ); + service.isPensionFundRubric = (rubric) => ( + rubric.is_employee !== 1 && rubric.is_discount === 1 && rubric.is_linked_pension_fund === 1 + ); + + // TODO(@jniles) - document these rubric types. + service.isSocialCareRubric = (rubric) => rubric.is_social_care === 1; + service.isTaxRubric = (rubric) => rubric.is_tax === 1; + service.isIndexRubric = rubric => rubric.is_indice === 1; + service.isMembershipFeeRubric = rubric => rubric.is_membership_fee === 1; + service.isOtherRubric = rubric => ( + !rubric.is_tax && !rubric.is_social_care && !rubric.is_membership_fee && !rubric.is_indice + ); + return service; } diff --git a/server/config/routes.js b/server/config/routes.js index 1231860aa1..81a8afe6bf 100644 --- a/server/config/routes.js +++ b/server/config/routes.js @@ -761,13 +761,11 @@ exports.configure = function configure(app) { app.delete('/rubrics/:id', rubrics.delete); // rubrics payroll Configuration api - app.get('/rubric_config', rubricConfig.list); - app.get('/rubric_config/:id', rubricConfig.detail); - app.post('/rubric_config', rubricConfig.create); - app.put('/rubric_config/:id', rubricConfig.update); - app.get('/rubric_config/:id/setting', rubricConfig.listConfig); - app.post('/rubric_config/:id/setting', rubricConfig.createConfig); - app.delete('/rubric_config/:id', rubricConfig.delete); + app.get('/payroll/rubric_config', rubricConfig.list); + app.get('/payroll/rubric_config/:id', rubricConfig.detail); + app.post('/payroll/rubric_config', rubricConfig.create); + app.put('/payroll/rubric_config/:id', rubricConfig.update); + app.delete('/payroll/rubric_config/:id', rubricConfig.delete); // grades api app.get('/grades', grades.list); @@ -804,14 +802,14 @@ exports.configure = function configure(app) { app.put('/iprTaxConfig/:id', iprTax.updateConfig); app.delete('/iprTaxConfig/:id', iprTax.deleteConfig); - // account payroll Configuration api + // account payroll configuration api app.get('/payroll/account_config', accountConfig.list); app.get('/payroll/account_config/:id', accountConfig.detail); app.post('/payroll/account_config', accountConfig.create); app.put('/payroll/account_config/:id', accountConfig.update); app.delete('/payroll/account_config/:id', accountConfig.delete); - // week end payroll Configuration api + // weekend payroll configuration api app.get('/weekend_config', weekendConfig.list); app.get('/weekend_config/:id', weekendConfig.detail); app.post('/weekend_config', weekendConfig.create); @@ -819,7 +817,7 @@ exports.configure = function configure(app) { app.get('/weekend_config/:id/days', weekendConfig.listConfig); app.delete('/weekend_config/:id', weekendConfig.delete); - // Employee payroll Configuration api + // employee payroll configuration api app.get('/employee_config', employeeConfig.list); app.get('/employee_config/:id', employeeConfig.detail); app.post('/employee_config', employeeConfig.create); diff --git a/server/controllers/admin/iprTax.js b/server/controllers/admin/iprTax.js index 7fbaf98de1..9c177125fb 100644 --- a/server/controllers/admin/iprTax.js +++ b/server/controllers/admin/iprTax.js @@ -5,7 +5,6 @@ */ const db = require('../../lib/db'); -const NotFound = require('../../lib/errors/NotFound'); const FilterParser = require('../../lib/filter'); // GET /IprTax @@ -64,20 +63,15 @@ function create(req, res, next) { } -// PUT /IprTax /:id -function update(req, res, next) { +// PUT /IprTax/:id +async function update(req, res, next) { const sql = `UPDATE taxe_ipr SET ? WHERE id = ?;`; - db.exec(sql, [req.body, req.params.id]) - .then(() => { - return lookupIprTax(req.params.id); - }) - .then((record) => { - // all updates completed successfull, return full object to client - res.status(200).json(record); - }) - .catch(next); - + try { + await db.exec(sql, [req.body, req.params.id]); + const record = await lookupIprTax(req.params.id); + res.status(200).json(record); + } catch (e) { next(e); } } // DELETE /IprTax/:id @@ -154,19 +148,15 @@ function createConfig(req, res, next) { } -// PUT /IprTaxConfig /:id -function updateConfig(req, res, next) { +// PUT /IprTaxConfig/:id +async function updateConfig(req, res, next) { const sql = `UPDATE taxe_ipr_configuration SET ? WHERE id = ?;`; - db.exec(sql, [req.body, req.params.id]) - .then(() => { - return lookupIprTaxConfig(req.params.id); - }) - .then((record) => { - // all updates completed successfull, return full object to client - res.status(200).json(record); - }) - .catch(next); + try { + await db.exec(sql, [req.body, req.params.id]); + const record = await lookupIprTaxConfig(req.params.id); + res.status(200).json(record); + } catch (e) { next(e); } } diff --git a/server/controllers/finance/cash.create.js b/server/controllers/finance/cash.create.js index e0493a2dcf..0a95723d93 100644 --- a/server/controllers/finance/cash.create.js +++ b/server/controllers/finance/cash.create.js @@ -119,7 +119,6 @@ function create(req, res, next) { * If this looks weird, it is to try and have a single level of stored procedures. * Having nested stored procedures reduces guarantees on the */ - const transaction = db.transaction(); // proposed posting process diff --git a/server/controllers/payroll/rubricConfig/index.js b/server/controllers/payroll/rubricConfig/index.js index 2efd0fcd2e..c25a271b8e 100644 --- a/server/controllers/payroll/rubricConfig/index.js +++ b/server/controllers/payroll/rubricConfig/index.js @@ -1,147 +1,145 @@ /** * Rubrics Configuration Controller * -* This controller exposes an API to the client for reading and writing Rubric Configuration +* This controller exposes an API for reading and writing rubric configurations for payroll. */ - const db = require('../../../lib/db'); +const debug = require('debug')('payroll:rubric:configuration'); + +async function lookupRubricConfig(id) { + const sql = `SELECT id, label FROM config_rubric WHERE id = ?`; + + const sqlItems = ` + SELECT config_rubric_item.id, config_rubric_item.config_rubric_id, config_rubric_item.rubric_payroll_id + FROM config_rubric_item + WHERE config_rubric_item.config_rubric_id = ?; + `; + + const record = await db.one(sql, [id]); + record.items = await db.exec(sqlItems, [id]); + return record; -function lookupRubricConfig(id) { - const sql = ` - SELECT id, label FROM config_rubric WHERE id = ?`; - return db.one(sql, [id]); } // Lists the Payroll RubricConfigs -function list(req, res, next) { +async function list(req, res, next) { const sql = `SELECT id, label FROM config_rubric;`; - db.exec(sql) - .then((rows) => { - res.status(200).json(rows); - }) - .catch(next); - + try { + const rows = await db.exec(sql); + res.status(200).json(rows); + } catch (e) { + next(e); + } } /** -* GET /RubricConfig/:ID +* GET /payroll/rubric_config/:id * * Returns the detail of a single RubricConfig */ -function detail(req, res, next) { +async function detail(req, res, next) { const { id } = req.params; - lookupRubricConfig(id) - .then((record) => { - res.status(200).json(record); - }) - .catch(next); - + try { + const record = await lookupRubricConfig(id); + res.status(200).json(record); + } catch (e) { + next(e); + } } -// POST /RubricConfig -function create(req, res, next) { - const sql = `INSERT INTO config_rubric SET ?`; - const data = req.body; +// POST /payroll/rubric_config +async function create(req, res, next) { + const { label, items } = req.body; + + debug(`Creating rubric configuration ${label} with ${items.length} items.`); + + try { + + // first create the config_rubric item so we have the id + const row = await db.exec('INSERT INTO config_rubric SET ?', [{ label }]); - db.exec(sql, [data]) - .then((row) => { - res.status(201).json({ id : row.insertId }); - }) - .catch(next); + // NOTE(@jniles): you are allowed to make a rubric with just a label, and no items + // attached. + if (items && items.length > 0) { + const configItems = items.map(id => ([id, row.insertId])); + // next, create the config_rubric_item records + await db.exec('INSERT INTO config_rubric_item (rubric_payroll_id, config_rubric_id) VALUES ?', [configItems]); + } + + // if all goes well, return to the client + // TODO(@jniles): use a db.transcation here so that we are able to roll this back as needed. + res.status(201).json({ id : row.insertId }); + } catch (e) { + next(e); + } } -// PUT /RubricConfig /:id -function update(req, res, next) { +// PUT /payroll/rubric_config/:id +async function update(req, res, next) { const sql = `UPDATE config_rubric SET ? WHERE id = ?;`; - db.exec(sql, [req.body, req.params.id]) - .then(() => { - return lookupRubricConfig(req.params.id); - }) - .then((record) => { - // all updates completed successfull, return full object to client - res.status(200).json(record); - }) - .catch(next); + debug(`Updating rubric configuration with id ${req.params.id}.`); -} + const items = req.body.items.map(id => ([id, req.params.id])); + delete req.body.items; -// DELETE /RubricConfig/:id -function del(req, res, next) { - db.delete( - 'config_rubric', 'id', req.params.id, res, next, `Could not find a RubricConfig with id ${req.params.id}`, - ); -} + try { + await db.exec(sql, [req.body, req.params.id]); -/** - * GET /rubric_config/:id/setting - * This function returns the list of items configured for a pay period -*/ -function listConfig(req, res, next) { - const sql = ` - SELECT config_rubric_item.id, config_rubric_item.config_rubric_id, config_rubric_item.rubric_payroll_id - FROM config_rubric_item - WHERE config_rubric_item.config_rubric_id = ?; - `; + const transaction = db.transaction() + .addQuery(sql, [req.body, req.params.id]) + .addQuery('DELETE FROM config_rubric_item WHERE config_rubric_id = ?;', [req.params.id]); - db.exec(sql, [req.params.id]) - .then((rows) => { - res.status(200).json(rows); - }) - .catch(next); + if (items.length > 0) { + transaction + .addQuery('INSERT INTO config_rubric_item (rubric_payroll_id, config_rubric_id) VALUES ?', [items]); + } -} + await transaction.execute(); -/** - * POST /rubric_config/:id/setting - * - * Creates and updates a Rubric's Configurations. This works by completely deleting - * the rubric's configuration and then replacing them with the new rubrics set. - */ -function createConfig(req, res, next) { - const data = req.body.configuration.map((id) => { - return [id, req.params.id]; - }); - - const transaction = db.transaction(); - - transaction - .addQuery('DELETE FROM config_rubric_item WHERE config_rubric_id = ?;', [req.params.id]); - - // if an array of configuration has been sent, add them to an INSERT query - if (req.body.configuration.length) { - transaction - .addQuery('INSERT INTO config_rubric_item (rubric_payroll_id, config_rubric_id) VALUES ?', [data]); + // all updates completed successfull, return full object to client + const record = await lookupRubricConfig(req.params.id); + + res.status(200).json(record); + } catch (e) { + next(e); } +} + +// DELETE /payroll/rubric_config/:id +async function del(req, res, next) { + + try { + // check to see if the rubric configuration exists + await lookupRubricConfig(req.params.id); - transaction.execute() - .then(() => { - res.sendStatus(201); - }) - .catch(next); + // if so, delete it. + await db.transaction() + .addQuery('DELETE FROM config_rubric_item WHERE config_rubric_id = ?;', [req.params.id]) + .addQuery('DELETE FROM config_rubric WHERE id = ?;', [req.params.id]) + .execute(); + res.sendStatus(204); + + } catch (e) { + next(e); + } } -// get list of Rubrics Configurations +// get list of rubrics configurations exports.list = list; -// get details of a Rubric Configuration +// get details of a rubric configuration exports.detail = detail; -// create a new Rubric Configuration +// create a new rubric configuration exports.create = create; -// update Rubric Configuration +// update rubric configuration exports.update = update; -// Delete a Rubric Configuration +// deletes a rubric configuration exports.delete = del; - -// Create or Update New Configuration of Payroll Rubrics -exports.createConfig = createConfig; - -// Get list of Rubrics configured by Configuration -exports.listConfig = listConfig; diff --git a/sh/integration-stock-tests.sh b/sh/integration-stock-tests.sh index e75a119849..1d888b9f82 100755 --- a/sh/integration-stock-tests.sh +++ b/sh/integration-stock-tests.sh @@ -7,7 +7,10 @@ if [[ ! -d results ]]; then mkdir results fi -./sh/build-stock-database.sh || { echo 'failed to build DB' ; exit 1; } +./sh/build-stock-database.sh || { + echo 'failed to build DB' + exit 1 +} echo "[test]" diff --git a/test/client-unit/services/rubricsConfigurationService.spec.js b/test/client-unit/services/rubricsConfigurationService.spec.js deleted file mode 100644 index a02056ae00..0000000000 --- a/test/client-unit/services/rubricsConfigurationService.spec.js +++ /dev/null @@ -1,79 +0,0 @@ -/* global expect inject */ -describe('test/client-unit/services/RubricsConfigurationService', () => { - let RubricsConfigs; - let $httpBackend; - let configs; - - beforeEach(module( - 'bhima.services', - 'angularMoment', - 'bhima.mocks', - 'ngStorage' - )); - - beforeEach(inject((_ConfigurationService_, _$httpBackend_) => { - RubricsConfigs = _ConfigurationService_; - $httpBackend = _$httpBackend_; - - /** - * Configuration des Rubriques - */ - const rubricConfigId = 1; - - const configRubricItems = [{ - id : 1, - config_rubric_id : 1, - rubric_payroll_id : 1, - }, { - id : 2, - config_rubric_id : 1, - rubric_payroll_id : 2, - }, { - id : 3, - config_rubric_id : 1, - rubric_payroll_id : 1, - }, { - id : 4, - config_rubric_id : 1, - rubric_payroll_id : 4, - }]; - - configs = [{ - id : 1, - label : 'Configuration des rubriques', - }, { - id : 2, - label : 'Nouvelle Configuration', - }]; - - $httpBackend.when('GET', '/rubric_config') - .respond(configs); - - const baseUrl = `/rubric_config/${rubricConfigId}`; - $httpBackend.when('GET', `${baseUrl}/setting`) - .respond(configRubricItems); - })); - - afterEach(() => { - $httpBackend.verifyNoOutstandingExpectation(); - $httpBackend.verifyNoOutstandingRequest(); - }); - - it('Count the Numbers of Rubrics Configured For the period 1', () => { - let value; - - RubricsConfigs.getRubrics(1) - .then(rubrics => { - value = rubrics; - }); - - $httpBackend.flush(); - - expect(value).to.have.length(4); - }); - - it('Count the Numbers of Rubrics Configured For the period Undefined', () => { - let value; - expect(RubricsConfigs.getRubrics).to.throw('Trying to get configuration of rubrics without the identity property'); - }); -}); diff --git a/test/end-to-end/iprTaxesConfig/iprTaxesConfig.page.js b/test/end-to-end/iprTaxesConfig/iprTaxesConfig.page.js index 0331244dc6..6d4e6e603b 100644 --- a/test/end-to-end/iprTaxesConfig/iprTaxesConfig.page.js +++ b/test/end-to-end/iprTaxesConfig/iprTaxesConfig.page.js @@ -15,12 +15,14 @@ class IprTaxConfigPage { */ async createIprTaxConfig(iprTaxConfig) { await components.iprScale.set(iprTaxConfig.scale); - await TU.buttons.create(); + await TU.waitForSelector('.modal-dialog form[name="IprTaxForm"]'); + await TU.input('IprTaxConfigModalCtrl.iprTax.rate', iprTaxConfig.rate); await components.currencyInput.set(iprTaxConfig.tranche_annuelle_debut, 'tranche_annuelle_debut'); await components.currencyInput.set(iprTaxConfig.tranche_annuelle_fin, 'tranche_annuelle_fin'); + await TU.buttons.submit(); await components.notification.hasSuccess(); } diff --git a/test/end-to-end/report b/test/end-to-end/report deleted file mode 100644 index 60e44d38ff..0000000000 --- a/test/end-to-end/report +++ /dev/null @@ -1,496 +0,0 @@ - -[2mRunning [22m452[2m tests using [22m1[2m worker[22m - -[1A[2K[1/452] [chromium] › cash/cash.spec.js:42:5 › Cash Payments › Cashbox Select Interface › navigating to /cash/:unknown should send a notification error -[1A[2K[2/452] [chromium] › cash/cash.spec.js:62:5 › Cash Payments › Cashbox Select Interface › navigating directly to /cash should be re-routed to selected cashbox after a selection is made -[1A[2K[3/452] [chromium] › cash/cash.spec.js:85:5 › Cash Payments › Cashbox Select Interface › should allow a user to select and deselect a cashbox -[1A[2K[4/452] [chromium] › cash/cash.spec.js:134:5 › Cash Payments › Cash Payments Form Page › should make a caution payment -[1A[2K[5/452] [chromium] › cash/cash.spec.js:160:5 › Cash Payments › Cash Payments Form Page › should block invoice payments without invoices -[1A[2K[6/452] [chromium] › cash/cash.spec.js:185:5 › Cash Payments › Cash Payments Form Page › should make a payment against previous invoices -[1A[2K[7/452] [chromium] › cash/cash.spec.js:236:5 › Cash Payments › Cash transfer › should make a transfer between accounts -[1A[2K[8/452] [chromium] › cash/cash.spec.js:266:5 › Cash Payments › Credit Notes › cancels a payment with a credit note -[1A[2K[9/452] [chromium] › cash/cash.spec.js:276:5 › Cash Payments › Credit Notes › deletes a cash payment from the database -[1A[2K[10/452] [chromium] › cash/cash.spec.js:317:5 › Cash Payments › Payments Registry › finds only 1 payment for today -[1A[2K[11/452] [chromium] › cash/cash.spec.js:326:5 › Cash Payments › Payments Registry › finds 2 payments for this year -[1A[2K[12/452] [chromium] › cash/cash.spec.js:334:5 › Cash Payments › Payments Registry › finds 3 payments for all time -[1A[2K[13/452] [chromium] › cash/cash.spec.js:341:5 › Cash Payments › Payments Registry › finds a payment given a reference -[1A[2K[14/452] [chromium] › cash/cash.spec.js:347:5 › Cash Payments › Payments Registry › produces an empty grid for an invalid payment -[1A[2K[15/452] [chromium] › cash/cash.spec.js:353:5 › Cash Payments › Payments Registry › finds two payments in the primary cashbox -[1A[2K[16/452] [chromium] › cash/cash.spec.js:359:5 › Cash Payments › Payments Registry › finds all payments made by the super user -[1A[2K[17/452] [chromium] › cash/cash.spec.js:365:5 › Cash Payments › Payments Registry › finds all payments for debtor group: Church Employees -[1A[2K[18/452] [chromium] › cash/cash.spec.js:373:5 › Cash Payments › Payments Registry › finds no payments for the disallowed user -[1A[2K[19/452] [chromium] › cashboxes/cashboxes.spec.js:31:3 › Cashboxes › creates a new cashbox -[1A[2K[20/452] [chromium] › cashboxes/cashboxes.spec.js:46:3 › Cashboxes › successfully edits a cashbox -[1A[2K[21/452] [chromium] › cashboxes/cashboxes.spec.js:60:8 › Cashboxes › allows the user to change currency accounts -[1A[2K[22/452] [chromium] › cashboxes/cashboxes.spec.js:82:3 › Cashboxes › rejects a missing account on the currency modal -[1A[2K[23/452] [chromium] › cashboxes/cashboxes.spec.js:119:3 › Cashboxes › allows you to delete a cashbox -[1A[2K[24/452] [chromium] › cashboxes/cashboxes.spec.js:132:3 › Cashboxes › performs form validation -[1A[2K[25/452] [chromium] › choiceListManagement/choiceListManagement.spec.js:39:3 › Choice List Management › successfully creates a new Choice List Management -[1A[2K[26/452] [chromium] › choiceListManagement/choiceListManagement.spec.js:43:3 › Choice List Management › successfully edits a Choice List Management -[1A[2K[27/452] [chromium] › choiceListManagement/choiceListManagement.spec.js:47:3 › Choice List Management › do not create when incorrect Choice List Management -[1A[2K[28/452] [chromium] › choiceListManagement/choiceListManagement.spec.js:51:3 › Choice List Management › successfully creates a deletable element -[1A[2K[29/452] [chromium] › choiceListManagement/choiceListManagement.spec.js:55:3 › Choice List Management › successfully delete a list Element -[1A[2K[30/452] [chromium] › configurationAnalysisTools/configurationAnalysisTools.spec.js:35:3 › Configuration Analysis Tools › successfully creates a new Configuration Analysis -[1A[2K[31/452] [chromium] › configurationAnalysisTools/configurationAnalysisTools.spec.js:39:3 › Configuration Analysis Tools › successfully edits a Configuration Analysis -[1A[2K[32/452] [chromium] › configurationAnalysisTools/configurationAnalysisTools.spec.js:43:3 › Configuration Analysis Tools › errors when missing Configuration Analysis create when incorrect Configuration -[1A[2K[33/452] [chromium] › configurationAnalysisTools/configurationAnalysisTools.spec.js:47:3 › Configuration Analysis Tools › begins with 5 Configuration Analysis -[1A[2K[34/452] [chromium] › configurationAnalysisTools/configurationAnalysisTools.spec.js:53:3 › Configuration Analysis Tools › successfully delete Configuration Analysis -[1A[2K[35/452] [chromium] › costCenter/cost_center.spec.js:72:8 › Cost Center Management › creates a new Cost Center -[1A[2K[36/452] [chromium] › costCenter/cost_center.spec.js:77:8 › Cost Center Management › edits a Cost Center label -[1A[2K[37/452] [chromium] › costCenter/cost_center.spec.js:82:8 › Cost Center Management › change of the Principal Cost Center to Auxiliary and the modification of the expense center -[1A[2K[38/452] [chromium] › costCenter/cost_center.spec.js:87:8 › Cost Center Management › deletes a Cost Center -[1A[2K[39/452] [chromium] › costCenter/cost_center.spec.js:92:8 › Cost Center Management › unable to assign an expense center a reference already used during creation -[1A[2K[40/452] [chromium] › costCenter/cost_center.spec.js:97:8 › Cost Center Management › unable to assign an expense center a reference already used during update -[1A[2K[41/452] [chromium] › costCenter/cost_center.spec.js:102:8 › Cost Center Management › does not create a Cost Center with incorrect information -[1A[2K[42/452] [chromium] › creditorGroups/creditor_groups.spec.js:38:3 › Creditor Groups Management › has an initial list of 3 creditor groups -[1A[2K[43/452] [chromium] › creditorGroups/creditor_groups.spec.js:42:3 › Creditor Groups Management › creates a creditor group -[1A[2K[44/452] [chromium] › creditorGroups/creditor_groups.spec.js:53:3 › Creditor Groups Management › updates a creditor group -[1A[2K[45/452] [chromium] › creditorGroups/creditor_groups.spec.js:63:3 › Creditor Groups Management › deletes a creditor group -[1A[2K[46/452] [chromium] › creditorGroups/creditor_groups.spec.js:73:3 › Creditor Groups Management › blocks deletion of a creditor group used in a transaction -[1A[2K[47/452] [chromium] › dataCollectorManagement/dataCollectorManagement.spec.js:37:3 › Data Collector Management › successfully creates a new Data Collector Management -[1A[2K[48/452] [chromium] › dataCollectorManagement/dataCollectorManagement.spec.js:41:3 › Data Collector Management › successfully edits a Data Collector Management -[1A[2K[49/452] [chromium] › dataCollectorManagement/dataCollectorManagement.spec.js:45:3 › Data Collector Management › do not create when incorrect Data Collector Management -[1A[2K[50/452] [chromium] › dataCollectorManagement/dataCollectorManagement.spec.js:49:3 › Data Collector Management › successfully delete a Data Collector Management -[1A[2K[51/452] [chromium] › debtors/debtorgroups.spec.js:31:3 › Debtor Groups Management › lists base test debtor groups -[1A[2K[52/452] [chromium] › debtors/debtorgroups.spec.js:35:3 › Debtor Groups Management › creates a debtor group -[1A[2K[53/452] [chromium] › debtors/debtorgroups.spec.js:57:3 › Debtor Groups Management › deletes a debtor group -[1A[2K[54/452] [chromium] › debtors/debtorgroups.spec.js:73:3 › Debtor Groups Management › updates a debtor group -[1A[2K[55/452] [chromium] › debtors/debtorgroups.spec.js:102:3 › Debtor Groups Management › updates debtor group invoicing fee subscriptions -[1A[2K[56/452] [chromium] › debtors/debtorgroups.spec.js:115:3 › Debtor Groups Management › updates debtor group subsidy subscriptions -[1A[2K[57/452] [chromium] › depots/depots.spec.js:63:3 › Depots Management › successfully creates a new depot -[1A[2K[58/452] [chromium] › depots/depots.spec.js:67:3 › Depots Management › successfully edits a depot -[1A[2K[59/452] [chromium] › depots/depots.spec.js:71:3 › Depots Management › successfully creates a new depot by depot Parent -[1A[2K[60/452] [chromium] › depots/depots.spec.js:75:3 › Depots Management › Edits a depot, set depot without parent -[1A[2K[61/452] [chromium] › depots/depots.spec.js:79:3 › Depots Management › join a location to a depot -[1A[2K[62/452] [chromium] › depots/depots.spec.js:83:3 › Depots Management › Join depot to depot Parent -[1A[2K[63/452] [chromium] › depots/depots.spec.js:87:3 › Depots Management › remove a location to a depot -[1A[2K[64/452] [chromium] › depots/depots.spec.js:91:3 › Depots Management › don't create when incorrect depot name -[1A[2K[65/452] [chromium] › depots/depots.spec.js:95:3 › Depots Management › successfully delete a depot -[1A[2K[66/452] [chromium] › depots/depots.spec.js:99:3 › Depots Management › successfully delete a depot create by parent -[1A[2K[67/452] [chromium] › depots/depots.spec.js:108:3 › Depots Management › set the depot manage by user -[1A[2K[68/452] [chromium] › displayMetadata/displayMetadata.spec.js:39:3 › Metadata Management › successfully Delete data for survey -[1A[2K[69/452] [chromium] › displayMetadata/displayMetadata.spec.js:45:3 › Metadata Management › successfully Searching for form data for posting and updatingSearches = for form data for posting and updating -[1A[2K[70/452] [chromium] › editJournal/edit_journal.spec.js:35:3 › Edit Posting Journal › edits a transaction to change an account -[1A[2K[71/452] [chromium] › editJournal/edit_journal.spec.js:70:3 › Edit Posting Journal › edits a transaction to change the value of debit and credit -[1A[2K[72/452] [chromium] › editJournal/edit_journal.spec.js:86:3 › Edit Posting Journal › prevents an unbalanced transaction -[1A[2K[73/452] [chromium] › editJournal/edit_journal.spec.js:104:3 › Edit Posting Journal › prevents a single line transaction -[1A[2K[74/452] [chromium] › editJournal/edit_journal.spec.js:118:8 › Edit Posting Journal › preventing transaction who have debit and credit null -[1A[2K[75/452] [chromium] › editJournal/edit_journal.spec.js:133:3 › Edit Posting Journal › preventing transaction who was debited and credited in a same line -[1A[2K[76/452] [chromium] › employees/registration.spec.js:52:3 › Employees › blocks invalid form submission with relevant error classes -[1A[2K[77/452] [chromium] › employees/registration.spec.js:61:3 › Employees › creates a new employee -[1A[2K[78/452] [chromium] › employees/registration.spec.js:95:3 › Employees › register an employee from a patient -[1A[2K[79/452] [chromium] › employees/registry.spec.js:38:3 › Employees Registry › list all registered employees -[1A[2K[80/452] [chromium] › employees/registry.spec.js:44:3 › Employees Registry › should find one employee with name "Employee Test" -[1A[2K[81/452] [chromium] › employees/registry.spec.js:52:3 › Employees Registry › should find one "female" employee with name "Employee Test" -[1A[2K[82/452] [chromium] › employees/registry.spec.js:61:3 › Employees Registry › should find no female employee registered in the last year. -[1A[2K[83/452] [chromium] › employees/registry.spec.js:70:3 › Employees Registry › should find one employee With reference "EM.TE.2" -[1A[2K[84/452] [chromium] › employees/registry.spec.js:80:3 › Employees Registry › clearing filters restores default number of rows to the grid -[1A[2K[85/452] [chromium] › employees/registry.spec.js:95:3 › Employees Registry › should search for employees in service Administration, to function Infirmier and grade 3 -[1A[2K[86/452] [chromium] › employees/update.spec.js:26:3 › Update Employees › should update data for employee -[1A[2K[87/452] [chromium] › employees/update.spec.js:44:3 › Update Employees › blocks validation when the value is already taken when the field must be Unique -[1A[2K[88/452] [chromium] › employeesConfig/employees_config.spec.js:32:3 › Employees Configuration Management › successfully creates a new Employee Configuration -[1A[2K[89/452] [chromium] › employeesConfig/employees_config.spec.js:37:8 › Employees Configuration Management › successfully edits Employee Configuration -[1A[2K[90/452] [chromium] › employeesConfig/employees_config.spec.js:42:8 › Employees Configuration Management › successfully Set Employees in Employee Configuration -[1A[2K[91/452] [chromium] › employeesConfig/employees_config.spec.js:47:8 › Employees Configuration Management › successfully unset Employees in Employee Configuration -[1A[2K[92/452] [chromium] › employeesConfig/employees_config.spec.js:51:3 › Employees Configuration Management › successfully set Employees in Employee Configuration -[1A[2K[93/452] [chromium] › employeesConfig/employees_config.spec.js:55:3 › Employees Configuration Management › do not create when incorrect Employee -[1A[2K[94/452] [chromium] › employeesConfig/employees_config.spec.js:60:8 › Employees Configuration Management › successfully delete an employee configuration -[1A[2K[95/452] [chromium] › enterprises/enterprises.spec.js:66:3 › Enterprises › set enterprise data -[1A[2K[96/452] [chromium] › enterprises/enterprises.spec.js:86:3 › Enterprises › blocks invalid form submission with relevant error classes -[1A[2K[97/452] [chromium] › enterprises/enterprises.spec.js:102:3 › Enterprises › reset enterprise data to default -[1A[2K[98/452] [chromium] › enterprises/enterprises.spec.js:122:3 › Enterprises › upload a new enterprise logo -[1A[2K[99/452] [chromium] › enterprises/enterprises.spec.js:137:3 › Enterprises › add a new project for the enterprise -[1A[2K[100/452] [chromium] › enterprises/enterprises.spec.js:148:3 › Enterprises › edit an existing project -[1A[2K[101/452] [chromium] › enterprises/enterprises.spec.js:158:3 › Enterprises › delete an existing project -[1A[2K[102/452] [chromium] › entities/entities.spec.js:42:3 › Entity Management › successfully creates a new entity -[1A[2K[103/452] [chromium] › entities/entities.spec.js:53:3 › Entity Management › successfully edits a entity -[1A[2K[104/452] [chromium] › entities/entities.spec.js:63:3 › Entity Management › do not create when an entity with invalid name -[1A[2K[105/452] [chromium] › entities/entities.spec.js:67:3 › Entity Management › successfully delete a entity -[1A[2K[106/452] [chromium] › errors/errors.spec.js:21:3 › Errors › 404 › shows a 404 page when the path does exist -[1A[2K[107/452] [chromium] › errors/errors.spec.js:59:3 › Errors › 403 › check Unauthorized Paths of the user RegularUser: -[1A[2K[108/452] [chromium] › exchange/exchange.spec.js:27:3 › Exchange Rate › set exchange rate for the current date -[1A[2K[109/452] [chromium] › exchange/exchange.spec.js:38:3 › Exchange Rate › set exchange rate for an old date -[1A[2K[110/452] [chromium] › fillForm/fillForm.spec.js:45:3 › Fill Form Management › successfully creates a new Survey data Element -[1A[2K[111/452] [chromium] › fillForm/fillForm.spec.js:49:3 › Fill Form Management › successfully creates a new Survey data Element for complexe form -[1A[2K[112/452] [chromium] › fiscalYears/fiscalYears.spec.js:34:3 › Fiscal Year › blocks invalid form submission with relevant error classes -[1A[2K[113/452] [chromium] › fiscalYears/fiscalYears.spec.js:54:3 › Fiscal Year › creates a new Fiscal Year -[1A[2K[114/452] [chromium] › fiscalYears/fiscalYears.spec.js:72:3 › Fiscal Year › edits a fiscal year -[1A[2K[115/452] [chromium] › fiscalYears/fiscalYears.spec.js:83:3 › Fiscal Year › delete a fiscal Year -[1A[2K[116/452] [chromium] › fiscalYears/fiscalYears.spec.js:91:3 › Fiscal Year › set the opening balance for the first fiscal year -[1A[2K[117/452] [chromium] › fiscalYears/fiscalYears.spec.js:113:3 › Fiscal Year › forbid not balanced submission -[1A[2K[118/452] [chromium] › fiscalYears/fiscalYears.spec.js:138:3 › Fiscal Year › closing a fiscal year in normal way -[1A[2K[119/452] [chromium] › functions/functions.spec.js:25:3 › Job Titles Management › successfully creates a new job title -[1A[2K[120/452] [chromium] › functions/functions.spec.js:30:3 › Job Titles Management › successfully edits a job title -[1A[2K[121/452] [chromium] › functions/functions.spec.js:35:3 › Job Titles Management › errors when missing job tit create when incorrect job title -[1A[2K[122/452] [chromium] › functions/functions.spec.js:39:3 › Job Titles Management › successfully delete a job title -[1A[2K[123/452] [chromium] › grades/grades.spec.js:37:3 › Grades Management › begins with 3 grades -[1A[2K[124/452] [chromium] › grades/grades.spec.js:41:3 › Grades Management › successfully creates a new grade -[1A[2K[125/452] [chromium] › grades/grades.spec.js:45:3 › Grades Management › successfully edits a grade -[1A[2K[126/452] [chromium] › grades/grades.spec.js:49:3 › Grades Management › doesn't create a record when grade name is incorrect -[1A[2K[127/452] [chromium] › grades/grades.spec.js:53:3 › Grades Management › successfully delete a grade -[1A[2K[128/452] [chromium] › holidays/holidays.spec.js:41:3 › Holidays Management › successfully creates a new holiday -[1A[2K[129/452] [chromium] › holidays/holidays.spec.js:45:3 › Holidays Management › successfully edits a holiday -[1A[2K[130/452] [chromium] › holidays/holidays.spec.js:49:3 › Holidays Management › prevent the definition of a nested vacation period -[1A[2K[131/452] [chromium] › holidays/holidays.spec.js:53:3 › Holidays Management › do not create when incorrect Holiday -[1A[2K[132/452] [chromium] › holidays/holidays.spec.js:57:3 › Holidays Management › successfully delete a holiday -[1A[2K[133/452] [chromium] › indicatorsFiles/indicators_files.spec.js:62:3 › Patient IndicatorsFiles › successfully creates a new hospitalization file -[1A[2K[134/452] [chromium] › indicatorsFiles/indicators_files.spec.js:66:3 › Patient IndicatorsFiles › successfully creates a new staff file -[1A[2K[135/452] [chromium] › indicatorsFiles/indicators_files.spec.js:70:3 › Patient IndicatorsFiles › successfully creates a new finance file -[1A[2K[136/452] [chromium] › indicatorsFiles/indicators_files.spec.js:74:3 › Patient IndicatorsFiles › search indicators files by period -[1A[2K[137/452] [chromium] › inventory/configuration.spec.js:57:5 › Inventory Configuration › Groups › creates a new inventory group -[1A[2K[138/452] [chromium] › inventory/configuration.spec.js:73:5 › Inventory Configuration › Groups › updates an existing inventory group -[1A[2K[139/452] [chromium] › inventory/configuration.spec.js:84:5 › Inventory Configuration › Groups › deletes an existing inventory group -[1A[2K[140/452] [chromium] › inventory/configuration.spec.js:90:5 › Inventory Configuration › Groups › creates an inventory group with only a sales account -[1A[2K[141/452] [chromium] › inventory/configuration.spec.js:114:5 › Inventory Configuration › Types › creates a new inventory type -[1A[2K[142/452] [chromium] › inventory/configuration.spec.js:121:5 › Inventory Configuration › Types › updates an existing inventory type -[1A[2K[143/452] [chromium] › inventory/configuration.spec.js:128:5 › Inventory Configuration › Types › deletes an existing inventory type -[1A[2K[144/452] [chromium] › inventory/configuration.spec.js:144:5 › Inventory Configuration › Units › creates a new inventory unit -[1A[2K[145/452] [chromium] › inventory/configuration.spec.js:152:5 › Inventory Configuration › Units › updates an existing inventory unit -[1A[2K[146/452] [chromium] › inventory/configuration.spec.js:160:5 › Inventory Configuration › Units › deletes an existing inventory unit -[1A[2K[147/452] [chromium] › inventory/list.spec.js:71:3 › Inventory List › successfully creates a new inventory item (metadata) -[1A[2K[148/452] [chromium] › inventory/list.spec.js:105:3 › Inventory List › successfully updates an existing inventory item (metadata) -[1A[2K[149/452] [chromium] › inventory/list.spec.js:132:3 › Inventory List › should find 21 inventory items with the label "Quinine" -[1A[2K[150/452] [chromium] › inventory/list.spec.js:145:3 › Inventory List › should find 17 inventory items with group "Eau" and type "Article" -[1A[2K[151/452] [chromium] › inventory/list.spec.js:158:8 › Inventory List › should find 1 inventory item with tag string "Medicament Traceur" -[1A[2K[152/452] [chromium] › inventory/list.spec.js:170:8 › Inventory List › should find inventory items within this tags array [Medicament Traceur,Virologie] -[1A[2K[153/452] [chromium] › inventory/list.spec.js:181:3 › Inventory List › do not create a new inventory item (metadata) for invalid data -[1A[2K[154/452] [chromium] › invoicingFees/invoicingFees.spec.js:26:8 › Invoicing Fees › can create an invoicing fee -[1A[2K[155/452] [chromium] › invoicingFees/invoicingFees.spec.js:45:8 › Invoicing Fees › can update an invoicing fee -[1A[2K[156/452] [chromium] › invoicingFees/invoicingFees.spec.js:62:8 › Invoicing Fees › can delete a invoicing fee -[1A[2K[157/452] [chromium] › iprTaxes/iprTaxes.spec.js:49:3 › Ipr Tax Management › should start with one IPR taxes -[1A[2K[158/452] [chromium] › iprTaxes/iprTaxes.spec.js:53:3 › Ipr Tax Management › successfully creates a new IPR Scale 1995 -[1A[2K[159/452] [chromium] › iprTaxes/iprTaxes.spec.js:58:3 › Ipr Tax Management › successfully creates a new IPR Scale 2000 -[1A[2K[160/452] [chromium] › iprTaxes/iprTaxes.spec.js:62:3 › Ipr Tax Management › successfully creates a new IPR Scale 2013 -[1A[2K[161/452] [chromium] › iprTaxes/iprTaxes.spec.js:66:3 › Ipr Tax Management › successfully edits an IPR Tax -[1A[2K[162/452] [chromium] › iprTaxes/iprTaxes.spec.js:70:3 › Ipr Tax Management › successfully delete a Ipr tax Scale -[1A[2K[163/452] [chromium] › iprTaxes/iprTaxes.spec.js:74:3 › Ipr Tax Management › do not create when incorrect Ipr Tax -[1A[2K[164/452] [chromium] › iprTaxes/iprTaxes.spec.js:78:3 › Ipr Tax Management › should end with three IPR taxes -[1A[2K[165/452] [chromium] › iprTaxesConfig/iprTaxesConfig.spec.js:62:3 › Ipr Tax Configuration Scale Management › successfully creates a Scale 1 in IPR Scale 2013 -[1A[2K[166/452] [chromium] › iprTaxesConfig/iprTaxesConfig.spec.js:66:3 › Ipr Tax Configuration Scale Management › successfully creates a Scale 2 in IPR Scale 2013 -[1A[2K[167/452] [chromium] › iprTaxesConfig/iprTaxesConfig.spec.js:70:3 › Ipr Tax Configuration Scale Management › successfully creates a Scale 1 in IPR Scale 2002 -[1A[2K[168/452] [chromium] › iprTaxesConfig/iprTaxesConfig.spec.js:81:3 › Ipr Tax Configuration Scale Management › successfully edits Scale for IPR 2002 -[1A[2K[169/452] [chromium] › iprTaxesConfig/iprTaxesConfig.spec.js:85:3 › Ipr Tax Configuration Scale Management › successfully delete a Ipr tax Scale -[1A[2K[170/452] [chromium] › iprTaxesConfig/iprTaxesConfig.spec.js:89:3 › Ipr Tax Configuration Scale Management › cannot create when incorrect Ipr Tax -[1A[2K[171/452] [chromium] › journal/ConfigurationModal.tests.js:11:3 › Posting Journal › Configuration Modal Tests › displays 9 visible columns by default -[1A[2K[172/452] [chromium] › journal/ConfigurationModal.tests.js:19:3 › Posting Journal › Configuration Modal Tests › removes all but the debit and credit columns -[1A[2K[173/452] [chromium] › journal/ConfigurationModal.tests.js:29:3 › Posting Journal › Configuration Modal Tests › resets the columns to the defaults -[1A[2K[174/452] [chromium] › journal/SearchModal.tests.js:29:3 › Posting Journal › Search Tests › loads at least 11 unposted rows from the database -[1A[2K[175/452] [chromium] › journal/SearchModal.tests.js:35:3 › Posting Journal › Search Tests › should have 2,4 rows for the church account -[1A[2K[176/452] [chromium] › journal/SearchModal.tests.js:43:3 › Posting Journal › Search Tests › finds 2,5 rows for patient reference PA.TPA.2 -[1A[2K[177/452] [chromium] › journal/SearchModal.tests.js:50:3 › Posting Journal › Search Tests › shows more rows when "showFullTransaction" option is set -[1A[2K[178/452] [chromium] › journal/SearchModal.tests.js:59:3 › Posting Journal › Search Tests › finds 0 rows for transfer transaction type -[1A[2K[179/452] [chromium] › journal/SearchModal.tests.js:67:3 › Posting Journal › Search Tests › finds 2 rows for record CP.TPA.1 -[1A[2K[180/452] [chromium] › journal/SearchModal.tests.js:75:3 › Posting Journal › Search Tests › finds 4,8 rows for reference IV.TPA.1 -[1A[2K[181/452] [chromium] › journal/TrialBalance.tests.js:32:3 › Posting Journal › Trial Balance Tests › posts multiple transactions (TPA1) to the General Ledger -[1A[2K[182/452] [chromium] › journal/TrialBalance.tests.js:50:3 › Posting Journal › Trial Balance Tests › blocks TPA1 as it is already posted -[1A[2K[183/452] [chromium] › locations/countries.spec.js:30:3 › Countries Management › Merge country -[1A[2K[184/452] [chromium] › locations/countries.spec.js:50:3 › Countries Management › creates a new country -[1A[2K[185/452] [chromium] › locations/countries.spec.js:57:3 › Countries Management › edits a country -[1A[2K[186/452] [chromium] › locations/countries.spec.js:70:3 › Countries Management › creates another country -[1A[2K[187/452] [chromium] › locations/countries.spec.js:82:3 › Countries Management › should delete the test country -[1A[2K[188/452] [chromium] › locations/countries.spec.js:91:3 › Countries Management › blocks invalid form submission with relevant error classes -[1A[2K[189/452] [chromium] › locations/modal.spec.js:58:3 › Locations (in create patient modal) › registers a new country -[1A[2K[190/452] [chromium] › locations/modal.spec.js:75:3 › Locations (in create patient modal) › registers a new province -[1A[2K[191/452] [chromium] › locations/modal.spec.js:93:3 › Locations (in create patient modal) › register a new sector -[1A[2K[192/452] [chromium] › locations/modal.spec.js:111:3 › Locations (in create patient modal) › register a new village -[1A[2K[193/452] [chromium] › locations/provinces.spec.js:35:3 › Provinces Management › Merge Province -[1A[2K[194/452] [chromium] › locations/provinces.spec.js:60:3 › Provinces Management › creates a new province -[1A[2K[195/452] [chromium] › locations/provinces.spec.js:73:3 › Provinces Management › edits a province -[1A[2K[196/452] [chromium] › locations/provinces.spec.js:87:3 › Provinces Management › creates another province -[1A[2K[197/452] [chromium] › locations/provinces.spec.js:101:3 › Provinces Management › should delete the test province -[1A[2K[198/452] [chromium] › locations/provinces.spec.js:111:3 › Provinces Management › blocks invalid form submission with relevant error classes -[1A[2K[199/452] [chromium] › locations/sectors.spec.js:34:3 › Sectors Management › Merge Sector -[1A[2K[200/452] [chromium] › locations/sectors.spec.js:68:3 › Sectors Management › creates a new sector -[1A[2K[201/452] [chromium] › locations/sectors.spec.js:83:3 › Sectors Management › edits a sector -[1A[2K[202/452] [chromium] › locations/sectors.spec.js:99:3 › Sectors Management › creates another sector -[1A[2K[203/452] [chromium] › locations/sectors.spec.js:115:3 › Sectors Management › should delete the test sector -[1A[2K[204/452] [chromium] › locations/sectors.spec.js:125:3 › Sectors Management › blocks invalid form submission with relevant error classes -[1A[2K[205/452] [chromium] › locations/villages.spec.js:34:3 › Villages Management › Merge village -[1A[2K[206/452] [chromium] › locations/villages.spec.js:68:3 › Villages Management › creates a new village -[1A[2K[207/452] [chromium] › locations/villages.spec.js:84:3 › Villages Management › edits a village -[1A[2K[208/452] [chromium] › locations/villages.spec.js:101:3 › Villages Management › creates another village -[1A[2K[209/452] [chromium] › locations/villages.spec.js:118:3 › Villages Management › should delete the test village -[1A[2K[210/452] [chromium] › locations/villages.spec.js:128:3 › Villages Management › correctly blocks invalid form submission with relevant error classes -[1A[2K[211/452] [chromium] › login/login.spec.js:15:3 › Login › verify we can log in -[1A[2K[212/452] [chromium] › login/login.spec.js:29:3 › Login › rejects an invalid username/password combo with (only) a growl notification -[1A[2K[213/452] [chromium] › login/login.spec.js:42:3 › Login › has a default project value -[1A[2K[214/452] [chromium] › login/login.spec.js:50:3 › Login › page refresh preserves the user session -[1A[2K[215/452] [chromium] › navigation/navigation.spec.js:14:3 › Tree Navigation › toggles the tree open and closed -[1A[2K[216/452] [chromium] › navigation/navigation.spec.js:28:3 › Tree Navigation › remembers the currently selected node -[1A[2K[217/452] [chromium] › navigation/navigation.spec.js:43:3 › Tree Navigation › toggles tree nodes open and closed -[1A[2K[218/452] [chromium] › offdays/offdays.spec.js:34:3 › Offdays Management › successfully creates a new Offday -[1A[2K[219/452] [chromium] › offdays/offdays.spec.js:38:3 › Offdays Management › successfully edits a Offday -[1A[2K[220/452] [chromium] › offdays/offdays.spec.js:42:3 › Offdays Management › do not create when incorrect Offday -[1A[2K[221/452] [chromium] › offdays/offdays.spec.js:46:3 › Offdays Management › successfully delete a Offday -[1A[2K[222/452] [chromium] › patient/groups.spec.js:37:3 › Patient Groups › creates a patient group -[1A[2K[223/452] [chromium] › patient/groups.spec.js:49:3 › Patient Groups › creates a second patient group -[1A[2K[224/452] [chromium] › patient/groups.spec.js:61:3 › Patient Groups › updates a patient group -[1A[2K[225/452] [chromium] › patient/groups.spec.js:73:3 › Patient Groups › deletes a patient group -[1A[2K[226/452] [chromium] › patient/picture.spec.js:26:3 › Patient Record › uploads a patient picture -[1A[2K[227/452] [chromium] › patient/picture.spec.js:33:3 › Patient Record › unable to upload a file that is not a picture -[1A[2K[228/452] [chromium] › patient/record.spec.js:54:3 › Patient Record › View and complete a patient's medical sheet -[1A[2K[229/452] [chromium] › patient/record.spec.js:59:3 › Patient Record › downloads and correctly displays patient information -[1A[2K[230/452] [chromium] › patient/record.spec.js:68:3 › Patient Record › displays the correct number of patient visits -[1A[2K[231/452] [chromium] › patient/record.spec.js:73:3 › Patient Record › admits a patient -[1A[2K[232/452] [chromium] › patient/record.spec.js:92:3 › Patient Record › dicharges a patient with a new diagnosis -[1A[2K[233/452] [chromium] › patient/record.spec.js:109:3 › Patient Record › upload a valid image as document -[1A[2K[234/452] [chromium] › patient/record.spec.js:124:3 › Patient Record › upload a PDF document -[1A[2K[235/452] [chromium] › patient/record.spec.js:138:3 › Patient Record › cannot upload invalid document -[1A[2K[236/452] [chromium] › patient/record.spec.js:153:3 › Patient Record › change document view -[1A[2K[237/452] [chromium] › patient/record.spec.js:161:3 › Patient Record › thumbnail should not be shown if the upload is not an image -[1A[2K[238/452] [chromium] › patient/record.spec.js:175:8 › Patient Record › Should check if upload_thumbnail is displayed if the upload is an image -[1A[2K[239/452] [chromium] › patient/record.spec.js:188:3 › Patient Record › informs the user that there is no patient for invalid request -[1A[2K[240/452] [chromium] › patient/registration.spec.js:30:3 › Patient Registration › registers a valid patient -[1A[2K[241/452] [chromium] › patient/registration.spec.js:62:5 › Patient Registration › form validation › blocks invalid form submission with relevant error classes -[1A[2K[242/452] [chromium] › patient/registration.spec.js:80:5 › Patient Registration › form validation › alerts for minimum and maximum dates -[1A[2K[243/452] [chromium] › patient/registry.search.js:67:3 › Patient Registry › Search › grid should have 3, 4, or 5 visible rows -[1A[2K[244/452] [chromium] › patient/registry.search.js:79:3 › Patient Registry › Search › should find one patient with name "Mock" -[1A[2K[245/452] [chromium] › patient/registry.search.js:87:3 › Patient Registry › Search › should find patients with Debtor Group "NGO IMA World Health" -[1A[2K[246/452] [chromium] › patient/registry.search.js:98:3 › Patient Registry › Search › should find three "male" patients with name "Patient" -[1A[2K[247/452] [chromium] › patient/registry.search.js:108:3 › Patient Registry › Search › should find no patients with name "Patient" registered in the last week -[1A[2K[248/452] [chromium] › patient/registry.search.js:118:3 › Patient Registry › Search › should find two patient with patient group "Test Patient Group 2" registered in allTime -[1A[2K[249/452] [chromium] › patient/registry.search.js:128:3 › Patient Registry › Search › should find patients with origin location "Gombe" -[1A[2K[250/452] [chromium] › patient/registry.search.js:137:3 › Patient Registry › Search › should find one female patients registered in the last year. -[1A[2K[251/452] [chromium] › patient/registry.search.js:148:3 › Patient Registry › Search › should find 6 or 7 patients with complex limited dates. -[1A[2K[252/452] [chromium] › patient/registry.search.js:161:3 › Patient Registry › Search › clearing filters restores default number of rows to the grid -[1A[2K[253/452] [chromium] › patient/registry.search.js:172:3 › Patient Registry › Search › should remember the cached filters -[1A[2K[254/452] [chromium] › patient/registry.search.js:183:3 › Patient Registry › Search › bulk group assignment without selecting patients warns the user -[1A[2K[255/452] [chromium] › patient/registry.search.js:190:3 › Patient Registry › Search › changes the patient group for multiple patients -[1A[2K[256/452] [chromium] › patient/registry.merge.js:23:3 › Patient Registry › Merge patients › forbid selection of more than two patients -[1A[2K[257/452] [chromium] › patient/registry.merge.js:32:3 › Patient Registry › Merge patients › successfully merge two selected patients into one -[1A[2K[258/452] [chromium] › patient/update.spec.js:21:3 › Patient Edit › ignores and warns for submission with no changes -[1A[2K[259/452] [chromium] › patient/update.spec.js:26:3 › Patient Edit › updates a patients details -[1A[2K[260/452] [chromium] › patient/update.spec.js:37:3 › Patient Edit › updates a patients debtor group subscription -[1A[2K[261/452] [chromium] › patient/update.spec.js:46:3 › Patient Edit › updates a patients group subscriptions -[1A[2K[262/452] [chromium] › payrollConfig/payroll_config.spec.js:40:3 › Payroll Configuration Management › successfully creates a Configuration Payroll Period -[1A[2K[263/452] [chromium] › payrollConfig/payroll_config.spec.js:44:3 › Payroll Configuration Management › successfully edits a Configuration Payroll Period -[1A[2K[264/452] [chromium] › payrollConfig/payroll_config.spec.js:48:3 › Payroll Configuration Management › do not create when incorrect Configuration Payroll Period -[1A[2K[265/452] [chromium] › payrollConfig/payroll_config.spec.js:52:3 › Payroll Configuration Management › successfully delete a Configuration Payroll Period -[1A[2K[266/452] [chromium] › payrollProcess/payroll_process.spec.js:39:8 › Payroll Process Management › should find Default Employee In Default Payroll Period -[1A[2K[267/452] [chromium] › payrollProcess/payroll_process.spec.js:56:8 › Payroll Process Management › should configure multiple employees for payment -[1A[2K[268/452] [chromium] › payrollProcess/payroll_process.spec.js:68:8 › Payroll Process Management › Configure and edit Rubrics Payroll values -[1A[2K[269/452] [chromium] › payrollProcess/payroll_process.spec.js:75:8 › Payroll Process Management › should set multiple employees on waiting list of payroll -[1A[2K[270/452] [chromium] › priceList/price_list.spec.js:42:3 › Price Lists › prices should create a price list -[1A[2K[271/452] [chromium] › priceList/price_list.spec.js:52:3 › Price Lists › prices should update a price list -[1A[2K[272/452] [chromium] › priceList/price_list.spec.js:61:3 › Price Lists › prices should add a price list item -[1A[2K[273/452] [chromium] › priceList/price_list.spec.js:75:3 › Price Lists › prices should delete a price list item -[1A[2K[274/452] [chromium] › priceList/price_list.spec.js:85:3 › Price Lists › import price list item from csv file into the system -[1A[2K[275/452] [chromium] › purchases/purchases.spec.js:28:3 › Purchase Orders › supports single item purchase orders -[1A[2K[276/452] [chromium] › purchases/purchases.spec.js:59:3 › Purchase Orders › supports multi-item purchase orders -[1A[2K[277/452] [chromium] › purchases/purchases.spec.js:106:8 › Purchase Orders › supports An optimal purchase orders -[1A[2K[278/452] [chromium] › purchases/purchases.spec.js:139:3 › Purchase Orders › blocks submission if no supplier is available -[1A[2K[279/452] [chromium] › purchases/purchases.spec.js:151:3 › Purchase Orders › blocks submission for an invalid grid -[1A[2K[280/452] [chromium] › purchases/registry.search.js:48:3 › Purchase Order Registry › Search › grid should have 0 visible rows -[1A[2K[281/452] [chromium] › purchases/registry.search.js:58:3 › Purchase Order Registry › Search › should find one Purchase Order with Reference "PO.TPA.2" for all time -[1A[2K[282/452] [chromium] › purchases/registry.search.js:69:3 › Purchase Order Registry › Search › should find four Purchases Orders authored By "Super User" for all time -[1A[2K[283/452] [chromium] › purchases/registry.search.js:80:3 › Purchase Order Registry › Search › should list all purchase orders ordered to "SNEL" for all time -[1A[2K[284/452] [chromium] › purchases/registry.search.js:91:3 › Purchase Order Registry › Search › should list all purchase orders with "Quinine Bichlorhydrate, sirop, 100mg base" for all time -[1A[2K[285/452] [chromium] › purchases/registry.search.js:102:3 › Purchase Order Registry › Search › choose the status confirmed and should find two purchases orders status by "Confirmed" for all time -[1A[2K[286/452] [chromium] › reports/accountReport/account_report.spec.js:30:3 › Accounts Report › preview a new account report -[1A[2K[287/452] [chromium] › reports/accountReport/account_report.spec.js:35:3 › Accounts Report › save a previewed report -[1A[2K[288/452] [chromium] › reports/accountReport/account_report.spec.js:39:3 › Accounts Report › report has been saved into archive -[1A[2K[289/452] [chromium] › reports/accountReport/account_report.spec.js:43:3 › Accounts Report › print the previewed report -[1A[2K[290/452] [chromium] › reports/agedCreditors/aged_creditors.spec.js:32:3 › Aged Creditors Report › preview a new Aged Creditors Report -[1A[2K[291/452] [chromium] › reports/agedCreditors/aged_creditors.spec.js:37:3 › Aged Creditors Report › save a previewed report -[1A[2K[292/452] [chromium] › reports/agedCreditors/aged_creditors.spec.js:41:3 › Aged Creditors Report › report has been saved into archive -[1A[2K[293/452] [chromium] › reports/agedCreditors/aged_creditors.spec.js:45:3 › Aged Creditors Report › print the previewed report -[1A[2K[294/452] [chromium] › reports/agedDebtors/aged_debtors.spec.js:33:3 › Aged Debtors Report › preview a new Aged Debtors Report -[1A[2K[295/452] [chromium] › reports/agedDebtors/aged_debtors.spec.js:39:3 › Aged Debtors Report › save a previewed report -[1A[2K[296/452] [chromium] › reports/agedDebtors/aged_debtors.spec.js:44:3 › Aged Debtors Report › report has been saved into archive -[1A[2K[297/452] [chromium] › reports/agedDebtors/aged_debtors.spec.js:48:3 › Aged Debtors Report › print the previewed report -[1A[2K[298/452] [chromium] › reports/annualClientsReport/balanceReport.spec.js:29:3 › Annual Clients Report › preview a new debtor client account balance report -[1A[2K[299/452] [chromium] › reports/annualClientsReport/balanceReport.spec.js:34:3 › Annual Clients Report › save a previewed report -[1A[2K[300/452] [chromium] › reports/annualClientsReport/balanceReport.spec.js:38:3 › Annual Clients Report › report has been saved into archive -[1A[2K[301/452] [chromium] › reports/annualClientsReport/balanceReport.spec.js:42:3 › Annual Clients Report › print the previewed report -[1A[2K[302/452] [chromium] › reports/balanceReport/balance_report.spec.js:36:3 › Balance Report › preview a new balance report -[1A[2K[303/452] [chromium] › reports/balanceReport/balance_report.spec.js:41:3 › Balance Report › save report for cron task of emailing -[1A[2K[304/452] [chromium] › reports/balanceReport/balance_report.spec.js:46:3 › Balance Report › save a previewed report -[1A[2K[305/452] [chromium] › reports/balanceReport/balance_report.spec.js:50:3 › Balance Report › report has been saved into archive -[1A[2K[306/452] [chromium] › reports/balanceReport/balance_report.spec.js:54:3 › Balance Report › print the previewed report -[1A[2K[307/452] [chromium] › reports/cashflow/cashflow.spec.js:33:8 › Cashflow Report › preview a new Cashflow Report -[1A[2K[308/452] [chromium] › reports/cashflow/cashflow.spec.js:39:8 › Cashflow Report › save a previewed report -[1A[2K[309/452] [chromium] › reports/cashflow/cashflow.spec.js:50:8 › Cashflow Report › report has been saved into archive -[1A[2K[310/452] [chromium] › reports/cashflow/cashflow.spec.js:55:8 › Cashflow Report › print the previewed report -[1A[2K[311/452] [chromium] › reports/cashflowByService/cashflow_by_service.spec.js:33:3 › Cashflow By Service Report › preview a new Cashflow By Service Report -[1A[2K[312/452] [chromium] › reports/cashflowByService/cashflow_by_service.spec.js:38:3 › Cashflow By Service Report › save a previewed report -[1A[2K[313/452] [chromium] › reports/cashflowByService/cashflow_by_service.spec.js:49:3 › Cashflow By Service Report › report has been saved into archive -[1A[2K[314/452] [chromium] › reports/cashflowByService/cashflow_by_service.spec.js:53:3 › Cashflow By Service Report › print the previewed report -[1A[2K[315/452] [chromium] › reports/employeeStanding/employee_standing.spec.js:29:3 › Employee Standing Report › preview a new Employee Standing Report -[1A[2K[316/452] [chromium] › reports/employeeStanding/employee_standing.spec.js:34:3 › Employee Standing Report › save a previewed report -[1A[2K[31m 1) [chromium] › reports/employeeStanding/employee_standing.spec.js:34:3 › Employee Standing Report › save a previewed report [39m - - Error: Expected a success notification, but could not find one. - - Expected: [32mtrue[39m - Received: [31mfalse[39m - - [90m at [39mshared/components/notify.js:28 - - 26 | } - 27 | } - > 28 | expect(success, 'Expected a success notification, but could not find one.').toBe(true); - | ^ - 29 | return dismiss(); - 30 | }, - 31 | - - [2m at Object.hasSuccess (/home/jniles/code/bhima/test/end-to-end/shared/components/notify.js:28:81)[22m - [2m at EmployeeStandingReportPage.saveEmployeeStandingReport (/home/jniles/code/bhima/test/end-to-end/reports/employeeStanding/employee_standing.page.js:28:5)[22m - [2m at /home/jniles/code/bhima/test/end-to-end/reports/employeeStanding/employee_standing.spec.js:35:5[22m - -[36m attachment #1: trace (application/zip) [2m─────────────────────────────────────────────────────────[22m[39m -[36m test-results/reports-employeeStanding-employee_standing-Employee-Standing-Report-save-a-previewed-report-chromium/trace.zip[39m -[36m Usage:[39m - -[36m npx playwright show-trace test-results/reports-employeeStanding-employee_standing-Employee-Standing-Report-save-a-previewed-report-chromium/trace.zip[39m - -[36m [2m────────────────────────────────────────────────────────────────────────────────────────────────[22m[39m - - -[1A[2K[317/452] [chromium] › reports/employeeStanding/employee_standing.spec.js:38:3 › Employee Standing Report › report has been saved into archive -[1A[2K[318/452] [chromium] › reports/employeeStanding/employee_standing.spec.js:42:3 › Employee Standing Report › print the previewed report -[1A[2K[319/452] [chromium] › reports/openDebtors/open_debtors.spec.js:29:3 › Open Debtors Report › preview a new Open Debtors report - order by Total Debt -[1A[2K[320/452] [chromium] › reports/openDebtors/open_debtors.spec.js:34:3 › Open Debtors Report › save a previewed report -[1A[2K[321/452] [chromium] › reports/openDebtors/open_debtors.spec.js:38:3 › Open Debtors Report › report has been saved into archive -[1A[2K[322/452] [chromium] › reports/openDebtors/open_debtors.spec.js:42:3 › Open Debtors Report › print the previewed report -[1A[2K[323/452] [chromium] › reports/patientStanding/patient_standing.spec.js:29:3 › Patient Standing Report › preview report -[1A[2K[324/452] [chromium] › reports/patientStanding/patient_standing.spec.js:34:3 › Patient Standing Report › save a previewed report -[1A[2K[325/452] [chromium] › reports/patientStanding/patient_standing.spec.js:38:3 › Patient Standing Report › report has been saved into archive -[1A[2K[326/452] [chromium] › reports/patientStanding/patient_standing.spec.js:42:3 › Patient Standing Report › print the previewed report -[1A[2K[327/452] [chromium] › reports/stockExit/stock_exit.spec.js:31:3 › StockExit Report › preview a new StockExit Report -[1A[2K[328/452] [chromium] › reports/stockExit/stock_exit.spec.js:38:8 › StockExit Report › save a previewed report -[1A[2K[329/452] [chromium] › reports/stockExit/stock_exit.spec.js:48:8 › StockExit Report › report has been saved into archive -[1A[2K[330/452] [chromium] › reports/stockExit/stock_exit.spec.js:52:8 › StockExit Report › print the previewed report -[1A[2K[331/452] [chromium] › rubrics/rubrics.spec.js:40:3 › Rubrics Management › successfully creates a new rubric -[1A[2K[332/452] [chromium] › rubrics/rubrics.spec.js:44:3 › Rubrics Management › successfully edits a rubric -[1A[2K[333/452] [chromium] › rubrics/rubrics.spec.js:48:3 › Rubrics Management › do not create when incorrect rubric -[1A[2K[334/452] [chromium] › rubrics/rubrics.spec.js:52:3 › Rubrics Management › successfully deletes a rubric -[1A[2K[335/452] [chromium] › rubrics/rubrics.spec.js:56:3 › Rubrics Management › successfully import indexes rubrics -[1A[2K[336/452] [chromium] › rubricsConfig/rubrics_config.spec.js:30:3 › Rubrics Configuration Management › successfully creates a new rubric configuration -[1A[2K[337/452] [chromium] › rubricsConfig/rubrics_config.spec.js:34:3 › Rubrics Configuration Management › successfully edits a rubric configuration -[1A[2K[338/452] [chromium] › rubricsConfig/rubrics_config.spec.js:38:3 › Rubrics Configuration Management › successfully set rubrics in rubric configuration -[1A[2K[339/452] [chromium] › rubricsConfig/rubrics_config.spec.js:42:3 › Rubrics Configuration Management › successfully unset rubrics in rubric configuration -[1A[2K[340/452] [chromium] › rubricsConfig/rubrics_config.spec.js:46:3 › Rubrics Configuration Management › do not create when incorrect rubric -[1A[2K[341/452] [chromium] › rubricsConfig/rubrics_config.spec.js:50:3 › Rubrics Configuration Management › successfully delete a rubric -[1A[2K[342/452] [chromium] › rubricsConfig/rubrics_config.spec.js:54:3 › Rubrics Configuration Management › should have 2 rubrics to end with -[1A[2K[343/452] [chromium] › services/services.spec.js:34:3 › Services › successfully creates a new service -[1A[2K[344/452] [chromium] › services/services.spec.js:38:3 › Services › successfully edits a service -[1A[2K[345/452] [chromium] › services/services.spec.js:42:3 › Services › correctly blocks invalid form submission with relevant error classes -[1A[2K[346/452] [chromium] › services/services.spec.js:46:3 › Services › successfully delete a service -[1A[2K[347/452] [chromium] › services/services.spec.js:50:3 › Services › cancellation of removal process of a service -[1A[2K[348/452] [chromium] › services/services.spec.js:54:3 › Services › no way to delete a service -[1A[2K[349/452] [chromium] › settings/settings.spec.js:21:3 › Settings › loads the page, and selects a language -[1A[2K[350/452] [chromium] › settings/settings.spec.js:28:3 › Settings › uses the back button to return to previous state -[1A[2K[351/452] [chromium] › staffingIndice/payroll-indice.spec.js:38:3 › Multipayroll (indice) › should search period -[1A[2K[352/452] [chromium] › staffingIndice/payroll-indice.spec.js:44:3 › Multipayroll (indice) › should a config Staffing indice for TEST 2 PATIENT -[1A[2K[353/452] [chromium] › staffingIndice/payroll-indice.spec.js:54:3 › Multipayroll (indice) › should a config Staffing indice for EMPLOYEE TEST 1 -[1A[2K[354/452] [chromium] › staffingIndice/payroll-indice.spec.js:65:8 › Multipayroll (indice) › should set the enveloppe salarial -[1A[2K[355/452] [chromium] › staffingIndice/staffing-indice.spec.js:42:3 › Staffing indice Management Tests › creates a new staffing indice -[1A[2K[356/452] [chromium] › staffingIndice/staffing-indice.spec.js:54:3 › Staffing indice Management Tests › should edit a staffing indice -[1A[2K[357/452] [chromium] › staffingIndice/staffing-indice.spec.js:64:3 › Staffing indice Management Tests › creates a new Staffing indice -[1A[2K[358/452] [chromium] › staffingIndice/staffing-indice.spec.js:76:3 › Staffing indice Management Tests › should delete the staffing indice -[1A[2K[359/452] [chromium] › staffingIndice/staffing-indice.spec.js:85:3 › Staffing indice Management Tests › blocks invalid form submission with relevant error classes -[1A[2K[360/452] [chromium] › subsidies/subsidies.spec.js:29:8 › Subsidies › creates a new subsidy -[1A[2K[361/452] [chromium] › subsidies/subsidies.spec.js:45:8 › Subsidies › edits a subsidy -[1A[2K[362/452] [chromium] › subsidies/subsidies.spec.js:59:3 › Subsidies › blocks invalid form submission with relevant error classes -[1A[2K[363/452] [chromium] › subsidies/subsidies.spec.js:73:8 › Subsidies › deletes a subsidy -[1A[2K[364/452] [chromium] › suppliers/suppliers.spec.js:33:3 › Suppliers › creates a new supplier -[1A[2K[365/452] [chromium] › suppliers/suppliers.spec.js:54:3 › Suppliers › edits a supplier -[1A[2K[366/452] [chromium] › suppliers/suppliers.spec.js:68:3 › Suppliers › blocks invalid form submission with relevant error classes -[1A[2K[367/452] [chromium] › surveyForm/surveyForm.spec.js:58:3 › Survey Form Management › successfully creates a new Survey Form Element -[1A[2K[368/452] [chromium] › surveyForm/surveyForm.spec.js:62:3 › Survey Form Management › Failed to create a form element whose name parameter with space -[1A[2K[369/452] [chromium] › surveyForm/surveyForm.spec.js:66:3 › Survey Form Management › Failed to create a form element whose name parameter with virgul -[1A[2K[370/452] [chromium] › surveyForm/surveyForm.spec.js:70:3 › Survey Form Management › Failed to create a form element whose name parameter with @ -[1A[2K[371/452] [chromium] › surveyForm/surveyForm.spec.js:74:3 › Survey Form Management › Failed to create a form element whose name parameter with Quotation mark and apostrophe -[1A[2K[372/452] [chromium] › surveyForm/surveyForm.spec.js:78:3 › Survey Form Management › Failed to create a form element whose name parameter with parenthesis -[1A[2K[373/452] [chromium] › surveyForm/surveyForm.spec.js:82:3 › Survey Form Management › successfully edits a Survey Form Element -[1A[2K[374/452] [chromium] › surveyForm/surveyForm.spec.js:86:3 › Survey Form Management › successfully creates a deletable element -[1A[2K[375/452] [chromium] › surveyForm/surveyForm.spec.js:90:3 › Survey Form Management › successfully delete a list Element -[1A[2K[376/452] [chromium] › tags/tags.spec.js:24:3 › tags Management Tests › should add a new tags -[1A[2K[377/452] [chromium] › tags/tags.spec.js:32:3 › tags Management Tests › should add another tags -[1A[2K[378/452] [chromium] › tags/tags.spec.js:40:3 › tags Management Tests › should add a third tags -[1A[2K[379/452] [chromium] › tags/tags.spec.js:48:3 › tags Management Tests › should edit tags -[1A[2K[380/452] [chromium] › tags/tags.spec.js:56:3 › tags Management Tests › should delete the test tags -[1A[2K[381/452] [chromium] › transactionType/transactionType.spec.js:36:3 › transaction types › successfully creates a transaction type -[1A[2K[382/452] [chromium] › transactionType/transactionType.spec.js:44:3 › transaction types › successfully updates an existing transaction type -[1A[2K[383/452] [chromium] › transactionType/transactionType.spec.js:52:3 › transaction types › successfully creates a transaction type with a specific type -[1A[2K[384/452] [chromium] › transactionType/transactionType.spec.js:60:3 › transaction types › do not create a new transaction type for missing type -[1A[2K[385/452] [chromium] › transactionType/transactionType.spec.js:72:3 › transaction types › do not create a new transaction type for missing required values -[1A[2K[386/452] [chromium] › user/roles.spec.js:26:5 › Role Management Tests › Role Management › should add a new role -[1A[2K[387/452] [chromium] › user/roles.spec.js:33:5 › Role Management Tests › Role Management › should add a edit role -[1A[2K[388/452] [chromium] › user/roles.spec.js:40:5 › Role Management Tests › Role Management › should edit permissions for a role -[1A[2K[389/452] [chromium] › user/roles.spec.js:47:5 › Role Management Tests › Role Management › should add a test role -[1A[2K[390/452] [chromium] › user/roles.spec.js:54:5 › Role Management Tests › Role Management › should delete the test role -[1A[2K[391/452] [chromium] › user/roles.spec.js:60:5 › Role Management Tests › Role Management › should assign an action to a role -[1A[2K[392/452] [chromium] › user/roles.spec.js:74:5 › Role Management Tests › Role Assignment › should assign a role to a user -[1A[2K[393/452] [chromium] › user/user.spec.js:58:3 › User Management Page › displays all users loaded from the database -[1A[2K[394/452] [chromium] › user/user.spec.js:62:3 › User Management Page › creates a user successfully -[1A[2K[395/452] [chromium] › user/user.spec.js:77:8 › User Management Page › edits a user successfully without changing the password -[1A[2K[396/452] [chromium] › user/user.spec.js:88:8 › User Management Page › edits a user password successfully -[1A[2K[397/452] [chromium] › user/user.spec.js:101:8 › User Management Page › deactivate user system access successfully -[1A[2K[398/452] [chromium] › user/user.spec.js:108:8 › User Management Page › validates form on editing password -[1A[2K[399/452] [chromium] › user/user.spec.js:127:3 › User Management Page › sets the cashbox Caisse Auxiliaire management rights for "Regular User" -[1A[2K[400/452] [chromium] › user/user.spec.js:135:3 › User Management Page › validates form on creation -[1A[2K[401/452] [chromium] › user/user.spec.js:147:3 › User Management Page › sets the depot Depot Secondaire and Depot Principal management rights for "Regular User" -[1A[2K[402/452] [chromium] › verificationLinks/verificationLinks.spec.js:28:3 › Check Inter-Registry Links › Checks the link between Patient Groups -> Patient Registry -[1A[2K[403/452] [chromium] › verificationLinks/verificationLinks.spec.js:37:3 › Check Inter-Registry Links › Checks the link between Debtor Groups -> Patient Registry -[1A[2K[404/452] [chromium] › verificationLinks/verificationLinks.spec.js:44:3 › Check Inter-Registry Links › Checks the link between Patient Registry -> Invoice Registry -[1A[2K[405/452] [chromium] › verificationLinks/verificationLinks.spec.js:55:3 › Check Inter-Registry Links › Checks the link between Invoice Registry -> Cash Registry -[1A[2K[406/452] [chromium] › verificationLinks/verificationLinks.spec.js:66:3 › Check Inter-Registry Links › Checks the link between Inventory Registry -> Invoice Registry -[1A[2K[407/452] [chromium] › verificationLinks/verificationLinks.spec.js:84:3 › Check Inter-Registry Links › Checks the link between Invoice Registry -> Voucher Registry -[1A[2K[408/452] [chromium] › verificationLinks/verificationLinks.spec.js:94:3 › Check Inter-Registry Links › Checks the link between Cash Registry -> Voucher Registry -[1A[2K[409/452] [chromium] › visits/visits.spec.js:43:3 › Patient Visits › successfully creates a new visit -[1A[2K[410/452] [chromium] › visits/visits.spec.js:52:3 › Patient Visits › forbid to create a new visit for a pending patient -[1A[2K[411/452] [chromium] › visits/visits.spec.js:61:3 › Patient Visits › successfully creates a new hospitalization visit -[1A[2K[412/452] [chromium] › visits/visits.spec.js:74:3 › Patient Visits › counts visits in the registry -[1A[2K[413/452] [chromium] › visits/visits.spec.js:78:3 › Patient Visits › search only hospitalized patients -[1A[2K[414/452] [chromium] › visits/visits.spec.js:87:3 › Patient Visits › search by patient name -[1A[2K[415/452] [chromium] › visits/visits.spec.js:95:3 › Patient Visits › search pregnant visits -[1A[2K[416/452] [chromium] › visits/visits.spec.js:104:3 › Patient Visits › search patient visits by service -[1A[2K[417/452] [chromium] › visits/visits.spec.js:112:3 › Patient Visits › search patient visits by ward -[1A[2K[418/452] [chromium] › visits/visits.spec.js:124:3 › Patient Visits › search patient visits -[1A[2K[419/452] [chromium] › vouchers/complex.spec.js:27:3 › Complex Vouchers › creates a complex voucher -[1A[2K[420/452] [chromium] › vouchers/complex.spec.js:111:8 › Complex Vouchers › Convention import invoices and payment via the tool -[1A[2K[421/452] [chromium] › vouchers/complex.spec.js:156:3 › Complex Vouchers › Support Patient Invoices by an Account via the tool -[1A[2K[422/452] [chromium] › vouchers/complex.spec.js:196:3 › Complex Vouchers › Generic Income via the tool -[1A[2K[423/452] [chromium] › vouchers/complex.spec.js:236:3 › Complex Vouchers › Generic Expense via the tool -[1A[2K[424/452] [chromium] › vouchers/complex.spec.js:276:8 › Complex Vouchers › Employees Salary Paiement via the tool -[1A[2K[425/452] [chromium] › vouchers/simple.spec.js:36:3 › Simple Vouchers › can create a simple voucher -[1A[2K[426/452] [chromium] › vouchers/vouchers.spec.js:25:3 › Voucher Registry › displays 4,11 vouchers on the page -[1A[2K[427/452] [chromium] › vouchers/vouchers.search.js:34:3 › Voucher Registry › Search › filters vouchers by clicking the month button -[1A[2K[428/452] [chromium] › vouchers/vouchers.search.js:45:3 › Voucher Registry › Search › filters by reference should return a single result -[1A[2K[429/452] [chromium] › vouchers/vouchers.search.js:52:3 › Voucher Registry › Search › filters by should return 5,11 results -[1A[2K[430/452] [chromium] › vouchers/vouchers.search.js:59:3 › Voucher Registry › Search › filters by transaction type should return 1,3 results -[1A[2K[431/452] [chromium] › vouchers/vouchers.search.js:66:3 › Voucher Registry › Search › filters by transaction type should return 0 results -[1A[2K[432/452] [chromium] › vouchers/vouchers.search.js:73:3 › Voucher Registry › Search › filtering by description should return 1 results -[1A[2K[433/452] [chromium] › vouchers/vouchers.spec.js:31:3 › Voucher Registry › deletes a record from the voucher registry -[1A[2K[434/452] [chromium] › ward/bed/bed.spec.js:25:3 › Bed Management Tests › should add a new Bed -[1A[2K[435/452] [chromium] › ward/bed/bed.spec.js:34:3 › Bed Management Tests › should not add a new Bed without ward -[1A[2K[436/452] [chromium] › ward/bed/bed.spec.js:42:3 › Bed Management Tests › should edit Bed -[1A[2K[437/452] [chromium] › ward/bed/bed.spec.js:51:3 › Bed Management Tests › should delete the test Bed -[1A[2K[438/452] [chromium] › ward/room/room.spec.js:27:3 › Room Management Tests › should add a new Room -[1A[2K[439/452] [chromium] › ward/room/room.spec.js:36:3 › Room Management Tests › should add a new Room without description -[1A[2K[440/452] [chromium] › ward/room/room.spec.js:44:3 › Room Management Tests › should edit Room -[1A[2K[441/452] [chromium] › ward/room/room.spec.js:53:3 › Room Management Tests › should not add a new Room without ward -[1A[2K[442/452] [chromium] › ward/room/room.spec.js:61:3 › Room Management Tests › should delete the test Room -[1A[2K[443/452] [chromium] › ward/ward/ward.spec.js:24:3 › Ward Management Tests › should add a new Ward -[1A[2K[444/452] [chromium] › ward/ward/ward.spec.js:31:3 › Ward Management Tests › should add another new Ward -[1A[2K[445/452] [chromium] › ward/ward/ward.spec.js:38:3 › Ward Management Tests › should add a new Ward linked to a service -[1A[2K[446/452] [chromium] › ward/ward/ward.spec.js:46:3 › Ward Management Tests › should add a new Ward with a description -[1A[2K[447/452] [chromium] › ward/ward/ward.spec.js:54:3 › Ward Management Tests › should edit Ward -[1A[2K[448/452] [chromium] › ward/ward/ward.spec.js:62:3 › Ward Management Tests › should delete the test Ward -[1A[2K[449/452] [chromium] › weekendConfig/weekend_config.spec.js:25:3 › Weekend Configuration Management › successfully creates a new weekend configuration -[1A[2K[450/452] [chromium] › weekendConfig/weekend_config.spec.js:29:3 › Weekend Configuration Management › successfully edits a weekend configuration -[1A[2K[451/452] [chromium] › weekendConfig/weekend_config.spec.js:33:3 › Weekend Configuration Management › do not create an incorrect weekend -[1A[2K[452/452] [chromium] › weekendConfig/weekend_config.spec.js:37:3 › Weekend Configuration Management › successfully deletes a weekend -[1A[2K[33m Slow test file: [39m[chromium] › reports/employeeStanding/employee_standing.spec.js[33m (22.6s)[39m -[33m Slow test file: [39m[chromium] › patient/registry.search.js[33m (18.0s)[39m -[33m Slow test file: [39m[chromium] › visits/visits.spec.js[33m (17.2s)[39m -[33m Slow test file: [39m[chromium] › cash/cash.spec.js[33m (16.1s)[39m -[33m Consider splitting slow test files to speed up parallel execution[39m -[31m 1 failed[39m -[31m [chromium] › reports/employeeStanding/employee_standing.spec.js:34:3 › Employee Standing Report › save a previewed report [39m -[33m 42 skipped[39m -[32m 409 passed[39m[2m (10.7m)[22m - -[36m Serving HTML report at http://localhost:9323. Press Ctrl+C to quit.[39m diff --git a/test/end-to-end/rubricsConfig/rubrics_config.page.js b/test/end-to-end/rubricsConfig/rubrics_config.page.js index bbd018fa82..056d544647 100644 --- a/test/end-to-end/rubricsConfig/rubrics_config.page.js +++ b/test/end-to-end/rubricsConfig/rubrics_config.page.js @@ -18,8 +18,7 @@ class RubricConfigPage { async create(rubric) { await TU.buttons.create(); - await TU.input('ConfigModalCtrl.rubric.label', rubric.label); - + await TU.input('RubricConfigModalCtrl.config.label', rubric.label); await TU.modal.submit(); await notification.hasSuccess(); } @@ -27,7 +26,7 @@ class RubricConfigPage { async errorOnCreateRubricConfig() { await TU.buttons.create(); await TU.modal.submit(); - await TU.validation.error('ConfigModalCtrl.rubric.label'); + await TU.validation.error('RubricConfigModalCtrl.config.label'); await TU.modal.cancel(); } @@ -36,7 +35,7 @@ class RubricConfigPage { await row.dropdown(); await row.edit(); - await TU.input('ConfigModalCtrl.rubric.label', updateRubricConfig.label); + await TU.input('RubricConfigModalCtrl.config.label', updateRubricConfig.label); await TU.modal.submit(); await notification.hasSuccess(); @@ -45,7 +44,7 @@ class RubricConfigPage { async setRubricConfig(label) { const row = new GridRow(label); await row.dropdown(); - await row.method('configure'); + await row.edit(); await TU.waitForSelector(by.id('social')); @@ -59,7 +58,7 @@ class RubricConfigPage { async unsetRubricConfig(label) { const row = new GridRow(label); await row.dropdown(); - await row.method('configure'); + await row.edit(); await TU.waitForSelector(by.id('all')); const checkbox = TU.locator(by.id('all')); diff --git a/test/integration/rubrics.js b/test/integration/rubrics.js index 9102f644f8..999c8d1780 100644 --- a/test/integration/rubrics.js +++ b/test/integration/rubrics.js @@ -6,10 +6,9 @@ const helpers = require('./helpers'); /* * The /payroll/rubrics API * - * This test suite implements full CRUD on the /payroll/rubrics API. + * This test suite implements full CRUD on the /payroll/rubrics and the rubrics_config API. */ describe('test/integration/rubrics The /payroll/rubrics API', () => { - // Rubric we will add during this test suite. const rubric = { label : 'Rubric Test', @@ -29,19 +28,18 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { const rubricConfig = { label : 'Configuration 2013', + items : [5, 2, 3, 1, 4], }; const rubricConfigUpdate = { label : 'Configuration 2013 Updated', + items : [5, 2], }; - const configRubric = { configuration : [5, 2, 3, 1, 4] }; - const configRubricEmpty = { configuration : [] }; - const NUM_RUBRICS = 24; const NUM_CONFIG_RUBRICS = 2; - it('GET /RUBRICS returns a list of Rubrics ', () => { + it('GET /rubrics returns a list of Rubrics ', () => { return agent.get('/rubrics') .then((res) => { helpers.api.listed(res, NUM_RUBRICS); @@ -49,7 +47,7 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { .catch(helpers.handler); }); - it('POST /RUBRICS should create a new Rubric', () => { + it('POST /rubrics should create a new Rubric', () => { return agent.post('/rubrics') .send(rubric) .then((res) => { @@ -59,7 +57,7 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { .catch(helpers.handler); }); - it('GET /RUBRICS/:ID send back a 404 if the rubrics id does not exist', () => { + it('GET /rubrics/:id send back a 404 if the rubrics id does not exist', () => { return agent.get('/rubrics/123456789') .then((res) => { helpers.api.errored(res, 404); @@ -67,7 +65,7 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { .catch(helpers.handler); }); - it('GET /RUBRICS/:ID send back a 404 if the rubrics id is a string', () => { + it('GET /rubrics/:id send back a 404 if the rubrics id is a string', () => { return agent.get('/rubrics/str') .then((res) => { helpers.api.errored(res, 404); @@ -75,7 +73,7 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { .catch(helpers.handler); }); - it('PUT /RUBRICS should update an existing Rubric ', () => { + it('PUT /rubrics should update an existing Rubric ', () => { return agent.put('/rubrics/'.concat(rubric.id)) .send(rubricUpdate) .then((res) => { @@ -85,7 +83,7 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { .catch(helpers.handler); }); - it('GET /RUBRICS/:ID returns a single Rubric ', () => { + it('GET /rubrics/:id returns a single Rubric ', () => { return agent.get('/rubrics/'.concat(rubric.id)) .then((res) => { expect(res).to.have.status(200); @@ -93,7 +91,7 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { .catch(helpers.handler); }); - it('DELETE /RUBRICS/:ID will send back a 404 if the Rubric id does not exist', () => { + it('DELETE /rubrics/:id will send back a 404 if the Rubric id does not exist', () => { return agent.delete('/rubrics/123456789') .then((res) => { helpers.api.errored(res, 404); @@ -101,7 +99,7 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { .catch(helpers.handler); }); - it('DELETE /RUBRICS/:ID will send back a 404 if the Rubric id is a string', () => { + it('DELETE /rubrics/:id will send back a 404 if the Rubric id is a string', () => { return agent.delete('/rubrics/str') .then((res) => { helpers.api.errored(res, 404); @@ -109,7 +107,7 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { .catch(helpers.handler); }); - it('DELETE /RUBRICS/:ID should delete a Rubric ', () => { + it('DELETE /rubrics/:id should delete a Rubric ', () => { return agent.delete('/rubrics/'.concat(rubric.id)) .then((res) => { helpers.api.deleted(res); @@ -119,16 +117,16 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { // INTEGRATION TEST FOR RUBRIC CONFIGURATION - it('GET /RUBRIC_CONFIG returns a list of function ', () => { - return agent.get('/rubric_config') + it('GET /payroll/rubric_config returns a list of rubrics', () => { + return agent.get('/payroll/rubric_config') .then((res) => { helpers.api.listed(res, NUM_CONFIG_RUBRICS); }) .catch(helpers.handler); }); - it('POST /RUBRIC_CONFIG should create a new Rubric Configuration', () => { - return agent.post('/rubric_config') + it('POST /payroll/rubric_config should create a new Rubric Configuration', () => { + return agent.post('/payroll/rubric_config') .send(rubricConfig) .then((res) => { rubricConfig.id = res.body.id; @@ -137,89 +135,60 @@ describe('test/integration/rubrics The /payroll/rubrics API', () => { .catch(helpers.handler); }); - it('GET /RUBRIC_CONFIG/:ID will send back a 404 if the Rubric Configuration id does not exist', () => { - return agent.get('/rubric_config/123456789') + it('GET /payroll/rubric_config/:id will send back a 404 if the Rubric Configuration id does not exist', () => { + return agent.get('/payroll/rubric_config/123456789') .then((res) => { helpers.api.errored(res, 404); }) .catch(helpers.handler); }); - it('GET /RUBRIC_CONFIG/:ID will send back a 404 if the Rubric Configuration id is a string', () => { - return agent.get('/rubric_config/str') + it('GET /payroll/rubric_config/:id will send back a 404 if the Rubric Configuration id is a string', () => { + return agent.get('/payroll/rubric_config/str') .then((res) => { helpers.api.errored(res, 404); }) .catch(helpers.handler); }); - it('PUT /RUBRIC_CONFIG should update an existing Rubric Configuration', () => { - return agent.put('/rubric_config/'.concat(rubricConfig.id)) + it('PUT /payroll/rubric_config should update an existing Rubric Configuration', () => { + return agent.put('/payroll/rubric_config/'.concat(rubricConfig.id)) .send(rubricConfigUpdate) .then((res) => { expect(res).to.have.status(200); expect(res.body.label).to.equal('Configuration 2013 Updated'); + expect(res.body.items).to.have.length(2); }) .catch(helpers.handler); }); - it('GET /RUBRIC_CONFIG/:ID returns a single Rubric Configuration', () => { - return agent.get('/rubric_config/'.concat(rubricConfig.id)) + it('GET /payroll/rubric_config/:id returns a single Rubric Configuration', () => { + return agent.get('/payroll/rubric_config/'.concat(rubricConfig.id)) .then((res) => { expect(res).to.have.status(200); + expect(res.body.items).to.have.length(2); }) .catch(helpers.handler); }); - it('DELETE /RUBRIC_CONFIG/:ID will send back a 404 if the Rubric Configuration id does not exist', () => { - return agent.delete('/rubric_config/123456789') + it('DELETE /payroll/rubric_config/:id will send back a 404 if the Rubric Configuration id does not exist', () => { + return agent.delete('/payroll/rubric_config/123456789') .then((res) => { helpers.api.errored(res, 404); }) .catch(helpers.handler); }); - it('DELETE /RUBRIC_CONFIG/:ID will send back a 404 if the Rubric Configuration id is a string', () => { - return agent.delete('/rubric_config/str') + it('DELETE /payroll/rubric_config/:id will send back a 404 if the Rubric Configuration id is a string', () => { + return agent.delete('/payroll/rubric_config/str') .then((res) => { helpers.api.errored(res, 404); }) .catch(helpers.handler); }); - // INTEGRATION TEST FOR SETTING RUBRICS IN CONFIGURATION - - it('POST /RUBRIC_CONFIG/:ID/SETTING should Set Rubrics in Configuration', () => { - return agent.post(`/rubric_config/${rubricConfig.id}/setting`) - .send(configRubric) - .then((res) => { - expect(res).to.have.status(201); - return agent.get(`/rubric_config/${rubricConfig.id}/setting`); - }) - .then(res => { - helpers.api.listed(res, 5); - expect(res).to.have.status(200); - expect(res.body).to.not.be.empty; - }) - .catch(helpers.handler); - }); - - it('POST /RUBRIC_CONFIG/:ID/SETTING Update Rubrucs Configuration', () => { - return agent.post(`/rubric_config/${rubricConfig.id}/setting`) - .send(configRubricEmpty) - .then((res) => { - expect(res).to.have.status(201); - return agent.get(`/rubric_config/${rubricConfig.id}/setting`); - }) - .then(res => { - helpers.api.listed(res, 0); - expect(res).to.have.status(200); - }) - .catch(helpers.handler); - }); - - it('DELETE /RUBRICS/:ID should delete a Rubric ', () => { - return agent.delete('/rubric_config/'.concat(rubricConfig.id)) + it('DELETE /payroll/rubric_config/:id should delete a Rubric ', () => { + return agent.delete('/payroll/rubric_config/'.concat(rubricConfig.id)) .then((res) => { helpers.api.deleted(res); })