Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/UAT' into UAT
Browse files Browse the repository at this point in the history
  • Loading branch information
manastanmay-eGov committed Oct 30, 2024
2 parents 370731b + 5c98e3b commit 6e26373
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ export const UICustomizations = {
}
if(businessService === businessServiceMap?.["works.purchase"]){
const workflow = {
comment: data.comments,
documents: data?.documents?.map((document) => {
return {
documentType: action?.action + " DOC",
fileName: document?.[1]?.file?.name,
fileStoreId: document?.[1]?.fileStoreId?.fileStoreId,
documentUid: document?.[1]?.fileStoreId?.fileStoreId,
tenantId: document?.[1]?.fileStoreId?.tenantId,
};
}),
comments: data.comments,
// documents: data?.documents?.map((document) => {
// return {
// documentType: action?.action + " DOC",
// fileName: document?.[1]?.file?.name,
// fileStoreId: document?.[1]?.fileStoreId?.fileStoreId,
// documentUid: document?.[1]?.fileStoreId?.fileStoreId,
// tenantId: document?.[1]?.fileStoreId?.tenantId,
// };
// }),
assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null,
action: action.action,
};
Expand Down
20 changes: 10 additions & 10 deletions frontend/micro-ui/web/src/Customisations/UICustomizations.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ export const UICustomizations = {
}
if(businessService === businessServiceMap?.["works.purchase"]){
const workflow = {
comment: data.comments,
documents: data?.documents?.map((document) => {
return {
documentType: action?.action + " DOC",
fileName: document?.[1]?.file?.name,
fileStoreId: document?.[1]?.fileStoreId?.fileStoreId,
documentUid: document?.[1]?.fileStoreId?.fileStoreId,
tenantId: document?.[1]?.fileStoreId?.tenantId,
};
}),
comments: data.comments,
// documents: data?.documents?.map((document) => {
// return {
// documentType: action?.action + " DOC",
// fileName: document?.[1]?.file?.name,
// fileStoreId: document?.[1]?.fileStoreId?.fileStoreId,
// documentUid: document?.[1]?.fileStoreId?.fileStoreId,
// tenantId: document?.[1]?.fileStoreId?.tenantId,
// };
// }),
assignees: data?.assignees?.uuid ? [data?.assignees?.uuid] : null,
action: action.action,
};
Expand Down
87 changes: 42 additions & 45 deletions utilities/works-pdf/src/routes/paymentTracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,47 +27,47 @@ function getCurrentDate() {
return formattedDate;
}

// async function getStateCityLocalizaitons(request, tenantId) {
// let localizationMaps = {};
// let lang = getLanguageFromRequest(request);
// let modules = [getStateLocalizationModule(tenantId),getCityLocalizationModule(tenantId)].join(",");
// let localRequest = {}
// localRequest["RequestInfo"] = request["RequestInfo"];
// let localizations = await search_localization(localRequest, lang, modules, tenantId);
// if (localizations?.data?.messages?.length) {
// localizations.data.messages.forEach(localObj => {
// localizationMaps[localObj.code] = localObj.message;
// });
// }
// return localizationMaps;
// }
async function getStateCityLocalizaitons(request, tenantId) {
let localizationMaps = {};
let lang = getLanguageFromRequest(request);
let modules = [getStateLocalizationModule(tenantId),getCityLocalizationModule(tenantId)].join(",");
let localRequest = {}
localRequest["RequestInfo"] = request["RequestInfo"];
let localizations = await search_localization(localRequest, lang, modules, tenantId);
if (localizations?.data?.messages?.length) {
localizations.data.messages.forEach(localObj => {
localizationMaps[localObj.code] = localObj.message;
});
}
return localizationMaps;
}

// function updateLocalization(projects, localizationMaps, tenantId) {
// projects = projects.map((project) => {
// if (project?.address?.latitude != null && project?.address?.latitude != 0 && project?.address?.longitude != null && project?.address?.longitude != 0) {
// project.address.pdfLatlong = `${project.address.latitude}, ${project.address.longitude}`;
// } else {
// project.address.pdfLatlong = null;
// }
// if (project?.address?.city) {
// project.address.city = project.address.city.toUpperCase();
// cityKey = "TENANT_TENANTS_" + project.address.city.split(".").join("_");
// project.address.city = getLocalizationByKey(cityKey, localizationMaps);
// }
// if (project?.additionalDetails?.locality) {
// let localityKey = getCityLocalizationPrefix(tenantId);
// localityKey = localityKey + "_ADMIN_" + project.additionalDetails.locality;
// project.additionalDetails.locality = getLocalizationByKey(localityKey, localizationMaps);
// }
// if (project?.address?.boundary) {
// let boundaryKey = getCityLocalizationPrefix(tenantId);
// boundaryKey = boundaryKey + "_ADMIN_" + project.address.boundary;
// project.address.boundary = getLocalizationByKey(boundaryKey, localizationMaps);
// }
// return project;
// })
// return projects;
// }
function updateLocalization(projects, localizationMaps, tenantId) {
projects = projects.map((project) => {
if (project?.address?.latitude != null && project?.address?.latitude != 0 && project?.address?.longitude != null && project?.address?.longitude != 0) {
project.address.pdfLatlong = `${project.address.latitude}, ${project.address.longitude}`;
} else {
project.address.pdfLatlong = null;
}
if (project?.address?.city) {
project.address.city = project.address.city.toUpperCase();
cityKey = "TENANT_TENANTS_" + project.address.city.split(".").join("_");
project.address.city = getLocalizationByKey(cityKey, localizationMaps);
}
if (project?.additionalDetails?.locality) {
let localityKey = getCityLocalizationPrefix(tenantId);
localityKey = localityKey + "_ADMIN_" + project.additionalDetails.locality;
project.additionalDetails.locality = getLocalizationByKey(localityKey, localizationMaps);
}
if (project?.address?.boundary) {
let boundaryKey = getCityLocalizationPrefix(tenantId);
boundaryKey = boundaryKey + "_ADMIN_" + project.address.boundary;
project.address.boundary = getLocalizationByKey(boundaryKey, localizationMaps);
}
return project;
})
return projects;
}

router.post(
"/payment-tracker",
Expand Down Expand Up @@ -199,15 +199,12 @@ router.post(


var project = resProject.data;
project.Project[0].address.city = project.Project[0].address.city
.replace("od.", "") // Remove the "od." prefix
.replace(/^\w/, c => c.toUpperCase()); // Capitalize the first letter
if (project && project.Project && project.Project.length > 0) {
var pdfResponse;
var pdfkey = config.pdf.paymentTracker_template;

// let localizationMap = await getStateCityLocalizaitons(requestinfo, tenantId);
// project.Project = updateLocalization(project.Project, localizationMap, tenantId);
let localizationMap = await getStateCityLocalizaitons(requestinfo, tenantId);
project.Project = updateLocalization(project.Project, localizationMap, tenantId);
// Adding project as Projects because it's updating on create_pdf
project["Projects"] = project.Project;
project["Projects"][0]["date"] = getCurrentDate();
Expand Down
30 changes: 16 additions & 14 deletions utilities/works-pdf/src/routes/workOrder.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,24 +203,26 @@ router.post(

let termAndConditions = [];
if (contract.contracts[0].executingAuthority == 'IA') {
let tnClength = mdmsData[0].termsAndConditions.length;

for (i = 0; i < tnClength; i++) {
var termsKey = mdmsData[0].termsAndConditions[i].disclaimer;
var tnc = getLocalizationByKey(termsKey, localizationMaps);
termAndConditions.push(tnc.replace('{nameoftheulb}', tenantIdForTnC));

let iaItem = mdmsData.find(item => item.code === 'IA');
if(iaItem){
let tnClength = iaItem.termsAndConditions.length;
for (i = 0; i < tnClength; i++) {
var termsKey = iaItem.termsAndConditions[i].disclaimer;
var tnc = getLocalizationByKey(termsKey, localizationMaps);
termAndConditions.push(tnc.replace('{nameoftheulb}', tenantIdForTnC));
}
}
}

if (contract.contracts[0].executingAuthority == 'IP') {
let tnClength = mdmsData[1].termsAndConditions.length;

for (i = 0; i < tnClength; i++) {
let termsKey = mdmsData[1].termsAndConditions[i].disclaimer;
let tnc = getLocalizationByKey(termsKey, localizationMaps);
termAndConditions.push(tnc.replace('{nameoftheulb}', tenantIdForTnC));

let ipItem = mdmsData.find(item => item.code === 'IP');
if(ipItem){
let tnClength = ipItem.termsAndConditions.length;
for (i = 0; i < tnClength; i++) {
var termsKey = ipItem.termsAndConditions[i].disclaimer;
var tnc = getLocalizationByKey(termsKey, localizationMaps);
termAndConditions.push(tnc.replace('{nameoftheulb}', tenantIdForTnC));
}
}
}
let newTC = [];
Expand Down

0 comments on commit 6e26373

Please sign in to comment.