...
It is a Key value pair constructed using the generateKeyValue
present in https://github.com/egovernments/frontend/blob/154afa9e97ab50201602aaef05f672c5c6c6d3ca/web/rainmaker/dev-packages/egov-ui-kit-dev/src/utils/pdfUtils/generatePDF.js
screen config should be exported from the respective module ,
example:
Code Block |
---|
export const registrationSummaryDetails={
transferReason: getLabelWithValue(
{
labelName: "Reason for Transfer",
labelKey: "PT_MUTATION_TRANSFER_REASON"
},
{
jsonPath:
"Property.additionalDetails.reasonForTransfer",
callBack: checkValueForNA
}
),
marketValue: getLabelWithValue(
{
labelName: "Market Value",
labelKey: "PT_MUTATION_MARKET_VALUE"
},
{
jsonPath:
"Property.additionalDetails.marketValue",
callBack: checkValueForNA
}
),
documentNo: getLabelWithValue(
{
labelName: "Document No.",
labelKey: "PT_MUTATION_DOCUMENT_NO"
},
{
jsonPath:
"Property.additionalDetails.documentNumber",
callBack: checkValueForNA
}
), documentDate: getLabelWithValue(
{
labelName: "Document Issue Date",
labelKey: "PT_MUTATION_DOCUMENT_DATE"
},
{
jsonPath:
"Property.additionalDetails.documentDate",
callBack: value => {
return convertEpochToDate(value);
}
}
), documentValue: getLabelWithValue(
{
labelName: "Document Value",
labelKey: "PT_MUTATION_DOCUMENT_VALUE"
},
{
jsonPath:
"Property.additionalDetails.documentValue",
callBack: checkValueForNA
}
),
remarks: getLabelWithValue(
{
labelName: "Remarks",
labelKey: "PT_MUTATION_REMARKS"
},
{
jsonPath:
"Property.additionalDetails.remarks",
callBack: checkValueForNA
}
)
} |
to generateKeyValue method we have to pass screen config of that card
...
Code Block |
---|
if (get(property, "ownershipCategoryInit", "").startsWith("INSTITUTION")) { transferorDetails = generateKeyValue(preparedFinalObject, transferorInstitutionSummaryDetails) } else if (get(property, "ownershipCategoryInit", "").includes("SINGLEOWNER")) { transferorDetails = generateKeyValue(preparedFinalObject, transferorSummaryDetails) } else { transferorDetailsInfo = getMultiItems(preparedFinalObject, transferorSummaryDetails, 'Property.ownersTemp[0]') transferorDetails = getMultipleItemCard(transferorDetailsInfo, 'PT_OWNER') } |
if any value needs to be localised then from the exported screen config select the attribute and specify the
localiseValue
as true.
Code Block |
---|
registrationSummaryDetails.transferReason.localiseValue=true;
transferorSummaryDetails.ownerType.localiseValue=true;
transfereeSummaryDetails.ownerType.localiseValue=true;
transfereeInstitutionSummaryDetails.institutionType.localiseValue=true;
transferorInstitutionSummaryDetails.institutionType.localiseValue=true; |
if QR code is required in the header then it should be sent to pdf data and qr code needs to be constructed based on the qr text .
Code Block |
---|
let qrText = `Application: ${FireNOC.fireNOCDetails.applicationNumber}, Date: ${
applicationDate
}, Buildings: ${data.propertyType}, Applicant: ${
FireNOC.fireNOCDetails.applicantDetails.owners[0].name
}, Address: ${data.address}`;
let qrcode = await getQRCode(qrText);
let pdfData = {
header: "NOC_APPLICATION", tenantId: FireNOC.tenantId, qrcode: qrcode, |