From 1e260c6ebe730403842ae6ddfb6dfca491aa7fde Mon Sep 17 00:00:00 2001 From: Lokendra Tyagi Date: Tue, 28 May 2024 15:17:04 +0530 Subject: [PATCH 1/6] map skills to mdms v2 --- .../src/services/molecules/Attendance/View.js | 55 +++++++++++++++---- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Attendance/View.js b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Attendance/View.js index bf3c038d84..947902121b 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Attendance/View.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/libraries/src/services/molecules/Attendance/View.js @@ -53,7 +53,7 @@ const getAttendanceTableData = async(data, skills, t, expenseCalculations) => { tableRow.actualWorkingDays = item?.actualTotalAttendance || 0 tableRow.nameOfIndividual = item?.additionalDetails?.userName || t("NA") tableRow.guardianName = item?.additionalDetails?.fatherName || t("NA") - tableRow.skill = skills[item?.additionalDetails?.skillCode]?.code || t("NA") + tableRow.skill = skills[item?.additionalDetails?.skillCode]?.description || t("NA") tableRow.amount = skills[item?.additionalDetails?.skillCode]?.amount * item?.actualTotalAttendance || 0 tableRow.modifiedAmount = expenseCalculations?.filter(data=>data?.payee?.identifier === item?.individualId)?.[0]?.lineItems?.[0]?.amount || 0; tableRow.modifiedWorkingDays = item?.modifiedTotalAttendance ? item?.modifiedTotalAttendance : item?.actualTotalAttendance @@ -134,16 +134,49 @@ const workflowDataDetails = async (tenantId, businessIds) => { } const getWageSeekerSkills = async (data) => { - const skills = {} - const skillResponse = await Digit.MDMSService.getMultipleTypesWithFilter(Digit.ULBService.getStateId(), "common-masters", [{"name": "WageSeekerSkills"}]) - const labourChangesResponse = await Digit.MDMSService.getMultipleTypesWithFilter(Digit.ULBService.getStateId(), "expense", [{"name": "LabourCharges"}]) - skillResponse?.['common-masters']?.WageSeekerSkills.forEach(item => { - let amount = labourChangesResponse?.["expense"]?.LabourCharges?.find(charge => charge?.code === item?.code && charge?.effectiveFrom < data?.musterRolls?.[0]?.auditDetails?.createdTime && (charge?.effectiveTo == null || charge?.effectiveTo > data?.musterRolls?.[0]?.auditDetails?.createdTime))?.amount - let skillWithAmount = {...item, amount} - skills[item.code] = skillWithAmount - }) - return skills -} + const tenantId = Digit.ULBService.getStateId(); + const skills = {}; + + const requestCriteria = { + url: "/mdms-v2/v1/_search", + body: { + MdmsCriteria: { + tenantId: tenantId, + moduleDetails: [ + { + moduleName: "WORKS-SOR", + masterDetails: [ + { + name: "SOR" + }, + ], + }, + ], + }, + }, + }; + let skillResponse = await Digit.CustomService.getResponse(requestCriteria) + + + if (skillResponse?.MdmsRes?.['WORKS-SOR']?.SOR) { + skillResponse.MdmsRes['WORKS-SOR'].SOR.forEach(skill => { + skills[skill.id] = { description: skill.description }; + }); + } + return skills; +}; + +// const getWageSeekerSkills = async (data) => { +// const skills = {} +// const skillResponse = await Digit.MDMSService.getMultipleTypesWithFilter(Digit.ULBService.getStateId(), "common-masters", [{"name": "WageSeekerSkills"}]) +// const labourChangesResponse = await Digit.MDMSService.getMultipleTypesWithFilter(Digit.ULBService.getStateId(), "expense", [{"name": "LabourCharges"}]) +// skillResponse?.['common-masters']?.WageSeekerSkills.forEach(item => { +// let amount = labourChangesResponse?.["expense"]?.LabourCharges?.find(charge => charge?.code === item?.code && charge?.effectiveFrom < data?.musterRolls?.[0]?.auditDetails?.createdTime && (charge?.effectiveTo == null || charge?.effectiveTo > data?.musterRolls?.[0]?.auditDetails?.createdTime))?.amount +// let skillWithAmount = {...item, amount} +// skills[item.code] = skillWithAmount +// }) +// return skills +// } export const fetchAttendanceDetails = async (t, tenantId, searchParams) => { try { From db45ff1afa13468eda9b9f346e547e82fbc3f5d8 Mon Sep 17 00:00:00 2001 From: Lokendra Tyagi Date: Tue, 28 May 2024 16:02:25 +0530 Subject: [PATCH 2/6] revert back package changes for build --- frontend/micro-ui/web/micro-ui-internals/package.json | 2 +- frontend/micro-ui/web/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/package.json b/frontend/micro-ui/web/micro-ui-internals/package.json index df2c7fd5fc..1da5494e10 100644 --- a/frontend/micro-ui/web/micro-ui-internals/package.json +++ b/frontend/micro-ui/web/micro-ui-internals/package.json @@ -9,7 +9,7 @@ "packages/react-components", "packages/modules/*", "packages/modules/Estimate", - "packages/modules/*", + "packages/modules/Expenditure", "packages/Mukta" ], "author": "JaganKumar ", diff --git a/frontend/micro-ui/web/package.json b/frontend/micro-ui/web/package.json index 2469654dea..cb208843c9 100644 --- a/frontend/micro-ui/web/package.json +++ b/frontend/micro-ui/web/package.json @@ -12,7 +12,7 @@ "micro-ui-internals/packages/react-components", "micro-ui-internals/packages/modules/Estimate", "micro-ui-internals/packages/modules/Expenditure", - "micro-ui-internals/packages/modules/*", + "micro-ui-internals/packages/modules/Measurement", "micro-ui-internals/packages/Mukta" ], "homepage": "/mukta-works-ui", From 2b229931b32a34819fc02c6be5a4deb4461ac21e Mon Sep 17 00:00:00 2001 From: Lokendra Tyagi Date: Tue, 28 May 2024 16:33:02 +0530 Subject: [PATCH 3/6] fixes for publish --- frontend/micro-ui/web/micro-ui-internals/package.json | 2 +- .../packages/modules/AttendenceMgmt/package.json | 2 +- frontend/micro-ui/web/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/package.json b/frontend/micro-ui/web/micro-ui-internals/package.json index 1da5494e10..df2c7fd5fc 100644 --- a/frontend/micro-ui/web/micro-ui-internals/package.json +++ b/frontend/micro-ui/web/micro-ui-internals/package.json @@ -9,7 +9,7 @@ "packages/react-components", "packages/modules/*", "packages/modules/Estimate", - "packages/modules/Expenditure", + "packages/modules/*", "packages/Mukta" ], "author": "JaganKumar ", diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/package.json b/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/package.json index 8bff5dfcc0..11f7fabf15 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/package.json +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/package.json @@ -1,6 +1,6 @@ { "name": "@egovernments/digit-ui-module-attendencemgmt", - "version": "0.4.0", + "version": "0.4.1", "description": "Attendence Management Module UI", "main": "dist/index.js", "module": "dist/index.modern.js", diff --git a/frontend/micro-ui/web/package.json b/frontend/micro-ui/web/package.json index cb208843c9..2469654dea 100644 --- a/frontend/micro-ui/web/package.json +++ b/frontend/micro-ui/web/package.json @@ -12,7 +12,7 @@ "micro-ui-internals/packages/react-components", "micro-ui-internals/packages/modules/Estimate", "micro-ui-internals/packages/modules/Expenditure", - "micro-ui-internals/packages/modules/Measurement", + "micro-ui-internals/packages/modules/*", "micro-ui-internals/packages/Mukta" ], "homepage": "/mukta-works-ui", From 6f83a4616f56f2efcbc1d0871df78358482c8dfc Mon Sep 17 00:00:00 2001 From: Lokendra Tyagi Date: Tue, 28 May 2024 17:11:17 +0530 Subject: [PATCH 4/6] fixes for build --- frontend/micro-ui/web/micro-ui-internals/package.json | 2 +- frontend/micro-ui/web/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/package.json b/frontend/micro-ui/web/micro-ui-internals/package.json index df2c7fd5fc..1da5494e10 100644 --- a/frontend/micro-ui/web/micro-ui-internals/package.json +++ b/frontend/micro-ui/web/micro-ui-internals/package.json @@ -9,7 +9,7 @@ "packages/react-components", "packages/modules/*", "packages/modules/Estimate", - "packages/modules/*", + "packages/modules/Expenditure", "packages/Mukta" ], "author": "JaganKumar ", diff --git a/frontend/micro-ui/web/package.json b/frontend/micro-ui/web/package.json index 2469654dea..cb208843c9 100644 --- a/frontend/micro-ui/web/package.json +++ b/frontend/micro-ui/web/package.json @@ -12,7 +12,7 @@ "micro-ui-internals/packages/react-components", "micro-ui-internals/packages/modules/Estimate", "micro-ui-internals/packages/modules/Expenditure", - "micro-ui-internals/packages/modules/*", + "micro-ui-internals/packages/modules/Measurement", "micro-ui-internals/packages/Mukta" ], "homepage": "/mukta-works-ui", From f3204c06ed513786dd5361dc945e8a31b9f42c16 Mon Sep 17 00:00:00 2001 From: Lokendra Tyagi Date: Thu, 30 May 2024 14:51:59 +0530 Subject: [PATCH 5/6] removed Mbvalidation --- .../viewAttendance/ViewAttendances.js | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/src/pages/employee/viewAttendance/ViewAttendances.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/src/pages/employee/viewAttendance/ViewAttendances.js index 2651677317..70a6e13ed5 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/src/pages/employee/viewAttendance/ViewAttendances.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/src/pages/employee/viewAttendance/ViewAttendances.js @@ -26,16 +26,16 @@ const ViewAttendance = () => { const {isLoading, data, isError, isSuccess, error} = Digit.Hooks.attendance.useViewAttendance(tenantId, { musterRollNumber },{},isStateChanged); - const requestCriteria = { - url : "/mukta-mukta-services/musterRollValidations/_validate", + // const requestCriteria = { + // url : "/mukta-mukta-services/musterRollValidations/_validate", - body: { - "tenantId" : tenantId, - "musterRollNumber": musterRollNumber, - } + // body: { + // "tenantId" : tenantId, + // "musterRollNumber": musterRollNumber, + // } - } - const {isLoading: isMbValidationLoading, data: mbValidationMr} = Digit.Hooks.useCustomAPIHook(requestCriteria); + // } + // const {isLoading: isMbValidationLoading, data: mbValidationMr} = Digit.Hooks.useCustomAPIHook(requestCriteria); const { isLoading: approverLoading, isErrorApprover, errorApprover, data: employeeDatav1 } = Digit.Hooks.hrms.useHRMSSearch({ roles: "MUSTER_ROLL_VERIFIER", isActive: true }, Digit.ULBService.getCurrentTenantId(), null, null, { enabled:true }); @@ -61,7 +61,7 @@ const ViewAttendance = () => { title: '', values: [ { title: "ATM_MUSTER_ROLL_ID", value: muster?.musterRollNumber || t("ES_COMMON_NA") }, - { title: "WORKS_MB_NUMBER", value: mbValidationMr?.musterRollValidation?.[0]?.measurementNumber || t("ES_COMMON_NA"), isValueLink: mbValidationMr?.musterRollValidation?.[0]?.measurementNumber ? true : false, navigateLinkHandler: () => history.push(`/${window.contextPath}/employee/measurement/view?tenantId=${tenantId}&workOrderNumber=${muster?.additionalDetails?.contractId}&mbNumber=${mbValidationMr?.musterRollValidation?.[0]?.measurementNumber}`) }, + // { title: "WORKS_MB_NUMBER", value: mbValidationMr?.musterRollValidation?.[0]?.measurementNumber || t("ES_COMMON_NA"), isValueLink: mbValidationMr?.musterRollValidation?.[0]?.measurementNumber ? true : false, navigateLinkHandler: () => history.push(`/${window.contextPath}/employee/measurement/view?tenantId=${tenantId}&workOrderNumber=${muster?.additionalDetails?.contractId}&mbNumber=${mbValidationMr?.musterRollValidation?.[0]?.measurementNumber}`) }, { title: "WORKS_ORDER_NO", value: muster?.additionalDetails?.contractId || t("ES_COMMON_NA") }, { title: "WORKS_PROJECT_ID", value: muster?.additionalDetails?.projectId || t("ES_COMMON_NA") }, { title: "PROJECTS_DESCRIPTION", value: muster?.additionalDetails?.projectDesc || t("ES_COMMON_NA")}, @@ -71,12 +71,12 @@ const ViewAttendance = () => { { title: "MUSTER_ROLLS_NO_OF_WAGE_SEEKERS", value: muster?.individualEntries.length || t("ES_COMMON_NA") }, { title: "MUSTER_ROLLS_TOTAL_ATTENDANCE_IN_DAYS", value: muster?.individualEntries?.reduce((acc,row)=>acc + (row?.actualTotalAttendance || row?.modifiedTotalAttendance || 0),0) || "0" }, { title: "MUSTER_ROLLS_QUANTITY_OF_WORK_IN_DAYS", value: muster?.individualEntries?.reduce((acc,row)=>acc + ( row?.modifiedTotalAttendance || row?.actualTotalAttendance || 0),0) || "0" }, - { title: "WORKS_TOTAL_LABOUR_UTILIZATION", value:Digit.Utils.dss.formatterWithoutRound(isNaN(mbValidationMr?.musterRollValidation?.[0]?.totalLabourRate) ? 0 : parseFloat(mbValidationMr?.musterRollValidation?.[0]?.totalLabourRate).toFixed(2), "number",undefined, true, undefined, 2) || t("ES_COMMON_NA") }, + // { title: "WORKS_TOTAL_LABOUR_UTILIZATION", value:Digit.Utils.dss.formatterWithoutRound(isNaN(mbValidationMr?.musterRollValidation?.[0]?.totalLabourRate) ? 0 : parseFloat(mbValidationMr?.musterRollValidation?.[0]?.totalLabourRate).toFixed(2), "number",undefined, true, undefined, 2) || t("ES_COMMON_NA") }, { title: "MUSTER_TOTAL_WAGE_AMOUNT", value:Digit.Utils.dss.formatterWithoutRound(muster?.totalAmount, "number") || t("ES_COMMON_NA") }, ] } ]) - }, [data,mbValidationMr]) + }, [data]) if(isLoading || approverLoading || isMbValidationLoading) return return ( @@ -128,27 +128,27 @@ const ViewAttendance = () => { setStateChanged={setStateChanged} moduleCode="attendencemgmt" editApplicationNumber={""} - WorflowValidation={(setShowModal) => { - try { - let validationFlag = false; - for (const validation of mbValidationMr?.musterRollValidation) { - if (validation?.type === 'error') { - validationFlag = true; - setShowToast({error : true, label : t(validation?.message)}); - break; - } else if (validation?.type === 'warn') { - validationFlag = true; - setShowPopUp({setShowWfModal:setShowModal, label:t(validation?.message)}); - break; - } - } - if(!validationFlag) - setShowModal(true); + // WorflowValidation={(setShowModal) => { + // try { + // let validationFlag = false; + // for (const validation of mbValidationMr?.musterRollValidation) { + // if (validation?.type === 'error') { + // validationFlag = true; + // setShowToast({error : true, label : t(validation?.message)}); + // break; + // } else if (validation?.type === 'warn') { + // validationFlag = true; + // setShowPopUp({setShowWfModal:setShowModal, label:t(validation?.message)}); + // break; + // } + // } + // if(!validationFlag) + // setShowModal(true); - } catch (error) { - showToast(error.message); - } - }} + // } catch (error) { + // showToast(error.message); + // } + // }} editCallback={() => { setModify(true); setshowEditTitle(true); From a0f86e9596ab1098fa47e66ff814375b84681c2c Mon Sep 17 00:00:00 2001 From: Lokendra Tyagi Date: Thu, 30 May 2024 15:07:14 +0530 Subject: [PATCH 6/6] Removed Mb validation for now --- .../src/pages/employee/viewAttendance/ViewAttendances.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/src/pages/employee/viewAttendance/ViewAttendances.js b/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/src/pages/employee/viewAttendance/ViewAttendances.js index 70a6e13ed5..51464b493a 100644 --- a/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/src/pages/employee/viewAttendance/ViewAttendances.js +++ b/frontend/micro-ui/web/micro-ui-internals/packages/modules/AttendenceMgmt/src/pages/employee/viewAttendance/ViewAttendances.js @@ -78,7 +78,7 @@ const ViewAttendance = () => { ]) }, [data]) - if(isLoading || approverLoading || isMbValidationLoading) return + if(isLoading || approverLoading /*|| isMbValidationLoading*/ ) return return (