From 0d7607310dd27827d5a5fba8f0abf7c61e590a82 Mon Sep 17 00:00:00 2001 From: Jonathan Cameron Date: Tue, 29 Aug 2023 13:05:58 +0100 Subject: [PATCH] Minor updates for employee registry and rubrics management page --- client/src/i18n/en/form.json | 3 +- client/src/i18n/en/payroll.json | 5 +- client/src/i18n/fr/form.json | 1 + client/src/i18n/fr/payroll.json | 5 +- .../employees/registration/employees.html | 2 +- .../employees/registration/employees.js | 4 ++ .../payroll/rubrics/modals/rubric.modal.html | 2 +- client/src/modules/payroll/rubrics/rubrics.js | 66 ++++++++++++++++--- .../rubrics/templates/index_type.tmpl.html | 8 +++ 9 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 client/src/modules/payroll/rubrics/templates/index_type.tmpl.html diff --git a/client/src/i18n/en/form.json b/client/src/i18n/en/form.json index 10a3f224de..dc578b557f 100644 --- a/client/src/i18n/en/form.json +++ b/client/src/i18n/en/form.json @@ -99,6 +99,7 @@ "TRIAL_BALANCE": "Trial Balance", "UNHIDE" : "Unhide", "UNLOCK" : "Unlock", + "UPDATE_EMPLOYEE": "Update Employee", "UPDATE_PASSWORD": "Update Password", "UPDATE": "Update", "VALIDATE": "Validate", @@ -770,7 +771,7 @@ "SELECT_MULTIPLE": "Select Multiple", "SELECT_ONE": "Select One", "SELECT": "Select", - "SENIORITY_BONUS": "seniority bonus", + "SENIORITY_BONUS": "Seniority Bonus", "SERIAL_NUMBER": "Serial Number", "SERVER_DATE": "Server Date", "SERVICE": "Service", diff --git a/client/src/i18n/en/payroll.json b/client/src/i18n/en/payroll.json index 3497a39ed3..c85ad70929 100644 --- a/client/src/i18n/en/payroll.json +++ b/client/src/i18n/en/payroll.json @@ -23,7 +23,7 @@ "IMPORT" : "Import rubrics (indexes)", "INDEXES" : "Indexes", "INDICE" : "Index", - "INDICE_TO_GRAPE" : "This rubric must be grapped", + "INDEX_TO_ENTER" : "This index is to be entered", "INDICE_TYPE" : "Index type", "INDIVIDUAL_PERFORMANCE": "Individual performance", "IS_BASE_INDEX" : "This rubric is a base index", @@ -32,6 +32,7 @@ "IS_EXTRA_DAY" : "This rubric is extra days", "IS_GROSS_SALARY" : "This rubric is the gross salary", "IS_INDICE" : "This rubric is an index", + "IS_INDEX_SHORT" : "Index?", "IS_MONETARY_VALUE": "This rubric is a monetary value", "IS_NUMBER_OF_DAYS" : "This rubric is the number of days", "IS_OTHER_PROFIT" : "This rubric is other profit", @@ -53,7 +54,7 @@ "RELATIVE_POINT": "Relative point", "RESPONSABILITY" : "Responsability", "SENIORITY_INDEX": "The seniority index", - "SELECT_INDICE_TYPE" : "Select Index type", + "SELECT_INDICE_TYPE" : "Select index type", "SUM_OF_RUBRICS": "Sum of others", "TITLE" : "Payroll Rubric Management", "TOTAL_CODE" : "Total code", diff --git a/client/src/i18n/fr/form.json b/client/src/i18n/fr/form.json index de89735df9..ee9e60863d 100644 --- a/client/src/i18n/fr/form.json +++ b/client/src/i18n/fr/form.json @@ -100,6 +100,7 @@ "UNHIDE" : "Révéler", "UNLOCK" : "Débloquer", "UPDATE": "Mettre à jour", + "UPDATE_EMPLOYEE": "Modifier l'employé", "UPDATE_PASSWORD": "Modifier le mot de passe", "VALIDATE": "Valider", "VIEW_DETAILS": "Voir les détails", diff --git a/client/src/i18n/fr/payroll.json b/client/src/i18n/fr/payroll.json index 52e1399302..2ed496fd9f 100644 --- a/client/src/i18n/fr/payroll.json +++ b/client/src/i18n/fr/payroll.json @@ -5,7 +5,7 @@ "PARTIALLY_PAID" : "Payé partiellement", "WAITING_FOR_CONFIGURATION" : "En attente de configuration", "WAITING_FOR_PAYMENT" : "En attente de paiement" - }, + }, "PAYROLL_RUBRIC" : { "ADD_PAYROLL_RUBRIC" : "Ajouter une rubrique de paie", "ADD_PAYROLL_RUBRIC_CONFIGURATION" : "Ajouter une configuration des rubriques", @@ -23,7 +23,7 @@ "IMPORT" : "Importer les rubriques (indices)", "INDEXES" : "Indices", "INDICE" : "Indice", - "INDICE_TO_GRAPE" : "Cette rubrique est à saisir", + "INDEX_TO_ENTER" : "Cette rubrique est à saisir", "INDICE_TYPE" : "Type d'indice", "INDIVIDUAL_PERFORMANCE": "Performance individuel", "IS_BASE_INDEX" : "Cette rubrique est un indice de base", @@ -32,6 +32,7 @@ "IS_EXTRA_DAY" : "Cette rubrique est le nombre des jours supplémentaires", "IS_GROSS_SALARY" : "Cette rubrique est le salaire brute", "IS_INDICE" : "Cette rubrique est un indice", + "IS_INDEX_SHORT" : "Indice?", "IS_MONETARY_VALUE": "Cette rubrique est une valeur monnetaire", "IS_NUMBER_OF_DAYS" : "Cette rubrique est le nombre de jours", "IS_OTHER_PROFIT" : "Cette rubric est autres profits", diff --git a/client/src/modules/employees/registration/employees.html b/client/src/modules/employees/registration/employees.html index 718559c2d7..9af736e571 100644 --- a/client/src/modules/employees/registration/employees.html +++ b/client/src/modules/employees/registration/employees.html @@ -271,7 +271,7 @@

FORM.LABELS.CURRENT_LOCATION

diff --git a/client/src/modules/employees/registration/employees.js b/client/src/modules/employees/registration/employees.js index 6b7c5a87e8..74b47972b2 100644 --- a/client/src/modules/employees/registration/employees.js +++ b/client/src/modules/employees/registration/employees.js @@ -17,6 +17,10 @@ function EmployeeController(Employees, Services, Grades, Functions, Titles, Cred vm.enterprise = Session.enterprise; vm.isUpdating = $state.params.uuid; + vm.updateEditLabel = vm.isUpdating + ? 'FORM.BUTTONS.UPDATE_EMPLOYEE' + : 'FORM.BUTTONS.REGISTER_EMPLOYEE'; + vm.origin = ''; if (referenceUuid && !saveAsEmployee) { diff --git a/client/src/modules/payroll/rubrics/modals/rubric.modal.html b/client/src/modules/payroll/rubrics/modals/rubric.modal.html index 44a497bd1e..aec151d103 100644 --- a/client/src/modules/payroll/rubrics/modals/rubric.modal.html +++ b/client/src/modules/payroll/rubrics/modals/rubric.modal.html @@ -47,7 +47,7 @@ diff --git a/client/src/modules/payroll/rubrics/rubrics.js b/client/src/modules/payroll/rubrics/rubrics.js index fdb31567be..facf1fe250 100644 --- a/client/src/modules/payroll/rubrics/rubrics.js +++ b/client/src/modules/payroll/rubrics/rubrics.js @@ -5,7 +5,7 @@ RubricManagementController.$inject = [ 'RubricService', 'ModalService', 'NotifyService', 'uiGridConstants', '$state', 'SessionService', 'GridColumnService', 'GridStateService', - 'ModalService', 'LanguageService', + 'ModalService', 'LanguageService', '$translate', ]; /** @@ -16,7 +16,7 @@ RubricManagementController.$inject = [ */ function RubricManagementController( Rubrics, ModalService, Notify, uiGridConstants, - $state, Session, Columns, GridState, Modal, Language + $state, Session, Columns, GridState, Modal, Language, $translate, ) { const vm = this; const cacheKey = 'RubricUigrid'; @@ -29,20 +29,43 @@ function RubricManagementController( vm.openColumnConfiguration = openColumnConfiguration; vm.currencySymbol = Session.enterprise.currencySymbol; + vm.convertIndexType = function convertIndexType(key) { + const item = Rubrics.indexesMap.find(elt => elt.id === key); + if (item) { + return $translate.instant(item.label); + } + return ''; + }; + // global variables vm.gridApi = {}; vm.filterEnabled = false; const gridColumn = [ - { field : 'label', displayName : 'FORM.LABELS.DESIGNATION', headerCellFilter : 'translate' }, - { field : 'abbr', displayName : 'FORM.LABELS.ABBREVIATION', headerCellFilter : 'translate' }, + { + field : 'label', + displayName : 'FORM.LABELS.DESIGNATION', + headerTooltip : 'FORM.LABELS.DESIGNATION', + headerCellFilter : 'translate', + }, + { + field : 'abbr', + displayName : 'FORM.LABELS.ABBREVIATION', + headerTooltip : 'FORM.LABELS.ABBREVIATION', + headerCellFilter : 'translate', + }, { field : 'is_discount', displayName : '(+)/(-)', cellTemplate : '/modules/payroll/rubrics/templates/discount.tmpl.html', headerCellFilter : 'translate', }, - { field : 'value', displayName : 'FORM.LABELS.VALUE', headerCellFilter : 'translate' }, + { + field : 'value', + displayName : 'FORM.LABELS.VALUE', + headerTooltip : 'FORM.LABELS.VALUE', + headerCellFilter : 'translate', + }, { field : 'is_percent', displayName : '%', @@ -51,57 +74,84 @@ function RubricManagementController( }, { field : 'is_indice', - displayName : 'PAYROLL_RUBRIC.IS_INDICE', + displayName : 'PAYROLL_RUBRIC.IS_INDEX_SHORT', + headerTooltip : 'PAYROLL_RUBRIC.IS_INDICE', cellTemplate : '/modules/payroll/rubrics/templates/index.tmpl.html', headerCellFilter : 'translate', }, + { + field : 'indice_type', + displayName : 'PAYROLL_RUBRIC.INDICE_TYPE', + headerCellFilter : 'translate', + cellTemplate : '/modules/payroll/rubrics/templates/index_type.tmpl.html', + visible : false, + }, { field : 'is_social_care', displayName : 'FORM.LABELS.IS_SOCIAL_CARE', + headerToolTip : 'FORM.LABELS.IS_SOCIAL_CARE', cellTemplate : '/modules/payroll/rubrics/templates/social.tmpl.html', headerCellFilter : 'translate', + visible : false, }, { field : 'is_membership_fee', displayName : 'FORM.INFO.IS_MEMBERSHIP_FEE', + headerToolTip : 'FORM.INFO.IS_MEMBERSHIP_FEE', cellTemplate : '/modules/payroll/rubrics/templates/membership.tmpl.html', headerCellFilter : 'translate', + visible : false, }, { field : 'is_tax', displayName : 'FORM.LABELS.TAX', + headerToolTip : 'FORM.LABELS.TAX', cellTemplate : '/modules/payroll/rubrics/templates/tax.tmpl.html', headerCellFilter : 'translate', }, { field : 'is_ipr', displayName : 'FORM.LABELS.IS_IPR', + headerToolTip : 'FORM.LABELS.IS_IPR', cellTemplate : '/modules/payroll/rubrics/templates/ipr.tmpl.html', headerCellFilter : 'translate', }, { field : 'is_associated_employee', displayName : 'FORM.LABELS.EMPLOYEE_ID', + headerToolTip : 'FORM.LABELS.EMPLOYEE_ID', cellTemplate : '/modules/payroll/rubrics/templates/associated.tmpl.html', headerCellFilter : 'translate', }, { field : 'is_seniority_bonus', displayName : 'FORM.LABELS.SENIORITY_BONUS', + headerToolTip : 'FORM.LABELS.SENIORITY_BONUS', cellTemplate : '/modules/payroll/rubrics/templates/seniority.tmpl.html', headerCellFilter : 'translate', + visible : false, }, { field : 'is_family_allowances', displayName : 'FORM.LABELS.FAMILY_ALLOWANCES', + headerToolTip : 'FORM.LABELS.FAMILY_ALLOWANCES', cellTemplate : '/modules/payroll/rubrics/templates/allowances.tmpl.html', headerCellFilter : 'translate', + visible : false, }, { - field : 'debtorAccount', displayName : 'FORM.LABELS.DEBTOR_ACCOUNT', headerCellFilter : 'translate', + field : 'debtorAccount', + displayName : 'FORM.LABELS.DEBTOR_ACCOUNT', + headerToolTip : 'FORM.LABELS.DEBTOR_ACCOUNT', + headerCellFilter : 'translate', + visible : false, }, { - field : 'expenseAccount', displayName : 'FORM.LABELS.EXPENSE_ACCOUNT', headerCellFilter : 'translate', + field : 'expenseAccount', + displayName : 'FORM.LABELS.EXPENSE_ACCOUNT', + headerToolTip : 'FORM.LABELS.EXPENSE_ACCOUNT', + headerCellFilter : 'translate', + visible : false, }, { field : 'action', diff --git a/client/src/modules/payroll/rubrics/templates/index_type.tmpl.html b/client/src/modules/payroll/rubrics/templates/index_type.tmpl.html new file mode 100644 index 0000000000..8d450847f8 --- /dev/null +++ b/client/src/modules/payroll/rubrics/templates/index_type.tmpl.html @@ -0,0 +1,8 @@ +
+
+ {{row.entity.indice_type}} +
+
\ No newline at end of file