@mseva/digit-ui-module-ptr 1.3.4-dev.2.0 → 1.3.4-dev.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +126 -1216
- package/dist/index.modern.js.map +1 -1
- package/package.json +38 -38
package/dist/index.modern.js
CHANGED
|
@@ -7684,9 +7684,18 @@ const PTRCitizenPet = ({
|
|
|
7684
7684
|
return gt.name === (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$3 = apiDataCheck[0]) === null || _apiDataCheck$3 === void 0 ? void 0 : (_apiDataCheck$3$petDe = _apiDataCheck$3.petDetails) === null || _apiDataCheck$3$petDe === void 0 ? void 0 : _apiDataCheck$3$petDe.petGender);
|
|
7685
7685
|
})) || null;
|
|
7686
7686
|
const pathParts = window.location.pathname.split("/");
|
|
7687
|
-
const
|
|
7688
|
-
|
|
7689
|
-
|
|
7687
|
+
const startIndex = pathParts.findIndex(part => part === "new-application");
|
|
7688
|
+
let id = null;
|
|
7689
|
+
if (startIndex !== -1) {
|
|
7690
|
+
const nextPart = pathParts[startIndex + 1];
|
|
7691
|
+
if (nextPart !== null && nextPart !== void 0 && nextPart.startsWith("PB-PTR-")) {
|
|
7692
|
+
id = nextPart;
|
|
7693
|
+
} else if (nextPart === "PL") {
|
|
7694
|
+
id = pathParts.slice(startIndex + 1, startIndex + 5).join("/");
|
|
7695
|
+
}
|
|
7696
|
+
}
|
|
7697
|
+
id = id ? decodeURIComponent(id) : null;
|
|
7698
|
+
const checkForRenew = window.location.pathname.includes("renew-application");
|
|
7690
7699
|
const today = new Date();
|
|
7691
7700
|
const todayStr = today.toISOString().split("T")[0];
|
|
7692
7701
|
const minVaccineDate = new Date();
|
|
@@ -7712,7 +7721,7 @@ const PTRCitizenPet = ({
|
|
|
7712
7721
|
return new Date(dateStr).getTime();
|
|
7713
7722
|
}
|
|
7714
7723
|
const onSubmit = async data => {
|
|
7715
|
-
var _currentStepData$Crea, _currentStepData$appl, _data$petType, _data$breedType, _data$petGender, _currentStepData$resp;
|
|
7724
|
+
var _currentStepData$Crea, _currentStepData$appl, _data$petType, _data$breedType, _data$petGender, _currentStepData$owne, _currentStepData$resp;
|
|
7716
7725
|
if (validateStep) {
|
|
7717
7726
|
const validationErrors = validateStep(data);
|
|
7718
7727
|
if (Object.keys(validationErrors).length > 0) return;
|
|
@@ -7750,9 +7759,9 @@ const PTRCitizenPet = ({
|
|
|
7750
7759
|
},
|
|
7751
7760
|
address: {
|
|
7752
7761
|
pincode,
|
|
7753
|
-
|
|
7762
|
+
addressLine1: currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne = currentStepData.ownerDetails) === null || _currentStepData$owne === void 0 ? void 0 : _currentStepData$owne.address
|
|
7754
7763
|
},
|
|
7755
|
-
previousApplicationNumber:
|
|
7764
|
+
previousApplicationNumber: id ? id : null,
|
|
7756
7765
|
applicationType: checkForRenew ? "RENEWAPPLICATION" : "NEWAPPLICATION",
|
|
7757
7766
|
ownerName: name,
|
|
7758
7767
|
fatherName: filteredOwnerDetails === null || filteredOwnerDetails === void 0 ? void 0 : filteredOwnerDetails.fatherOrHusbandName,
|
|
@@ -7779,7 +7788,7 @@ const PTRCitizenPet = ({
|
|
|
7779
7788
|
address: {
|
|
7780
7789
|
...existing.address,
|
|
7781
7790
|
pincode: pick(pincode, (_existing$address = existing.address) === null || _existing$address === void 0 ? void 0 : _existing$address.pincode),
|
|
7782
|
-
|
|
7791
|
+
addressLine1: pick(currentStepData.ownerDetails.address, (_existing$address2 = existing.address) === null || _existing$address2 === void 0 ? void 0 : _existing$address2.addressLine1),
|
|
7783
7792
|
tenantId
|
|
7784
7793
|
},
|
|
7785
7794
|
petDetails: {
|
|
@@ -7910,7 +7919,7 @@ const PTRCitizenPet = ({
|
|
|
7910
7919
|
totalYears: years + months / 12
|
|
7911
7920
|
};
|
|
7912
7921
|
};
|
|
7913
|
-
const AGE_REGEX = /^(?:(?:[1-9]|[1-3][0-9])(?:\.(?:[1-9]|1[01]))?|40(?:\.0?)?|0?\.(?:[1-9]|1[01]))$/;
|
|
7922
|
+
const AGE_REGEX = /^(?:(?:[1-9]|[1-3][0-9])(?:\.(?:0|[1-9]|1[01]))?|40(?:\.0?)?|0?\.(?:[1-9]|1[01]))$/;
|
|
7914
7923
|
const petAgeVal = watch("petAge");
|
|
7915
7924
|
useEffect(() => {
|
|
7916
7925
|
if (!petAgeVal) return;
|
|
@@ -15369,12 +15378,12 @@ const PTRCitizenDetails = ({
|
|
|
15369
15378
|
var _apiDataCheck$;
|
|
15370
15379
|
const formattedData = (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$ = apiDataCheck[0]) === null || _apiDataCheck$ === void 0 ? void 0 : _apiDataCheck$.owner) || (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.ownerDetails);
|
|
15371
15380
|
if (formattedData) {
|
|
15372
|
-
var _apiDataCheck$2, _apiDataCheck$2$addre, _currentStepData$owne, _apiDataCheck$
|
|
15381
|
+
var _apiDataCheck$2, _apiDataCheck$2$addre, _apiDataCheck$3, _apiDataCheck$3$addre, _apiDataCheck$4, _apiDataCheck$4$addre, _currentStepData$owne, _apiDataCheck$5, _apiDataCheck$5$addre, _currentStepData$owne2;
|
|
15373
15382
|
Object.entries(formattedData).forEach(([key, value]) => {
|
|
15374
15383
|
setValue(key, value);
|
|
15375
15384
|
});
|
|
15376
|
-
setValue("address", (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$
|
|
15377
|
-
setValue("pincode", (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$
|
|
15385
|
+
setValue("address", (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$2 = apiDataCheck[0]) !== null && _apiDataCheck$2 !== void 0 && (_apiDataCheck$2$addre = _apiDataCheck$2.address) !== null && _apiDataCheck$2$addre !== void 0 && _apiDataCheck$2$addre.addressLine1 ? apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$3 = apiDataCheck[0]) === null || _apiDataCheck$3 === void 0 ? void 0 : (_apiDataCheck$3$addre = _apiDataCheck$3.address) === null || _apiDataCheck$3$addre === void 0 ? void 0 : _apiDataCheck$3$addre.addressLine1 : apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$4 = apiDataCheck[0]) === null || _apiDataCheck$4 === void 0 ? void 0 : (_apiDataCheck$4$addre = _apiDataCheck$4.address) === null || _apiDataCheck$4$addre === void 0 ? void 0 : _apiDataCheck$4$addre.addressId) || (currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne = currentStepData.ownerDetails) === null || _currentStepData$owne === void 0 ? void 0 : _currentStepData$owne.address) || "");
|
|
15386
|
+
setValue("pincode", (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$5 = apiDataCheck[0]) === null || _apiDataCheck$5 === void 0 ? void 0 : (_apiDataCheck$5$addre = _apiDataCheck$5.address) === null || _apiDataCheck$5$addre === void 0 ? void 0 : _apiDataCheck$5$addre.pincode) || (currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne2 = currentStepData.ownerDetails) === null || _currentStepData$owne2 === void 0 ? void 0 : _currentStepData$owne2.pincode) || "");
|
|
15378
15387
|
}
|
|
15379
15388
|
}, [apiDataCheck, currentStepData, setValue]);
|
|
15380
15389
|
const getErrorMessage = fieldName => {
|
|
@@ -17032,7 +17041,7 @@ function NewApplicationTimeline({
|
|
|
17032
17041
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
17033
17042
|
className: "custom-timeline-entries"
|
|
17034
17043
|
}, sortedData === null || sortedData === void 0 ? void 0 : sortedData.map((item, index) => {
|
|
17035
|
-
var _item$auditDetails, _item$auditDetails2, _item$assigner2, _item$assigner3, _item$assigner4, _item$
|
|
17044
|
+
var _item$auditDetails, _item$auditDetails2, _item$assigner2, _item$assigner3, _item$assigner4, _item$wfComment, _item$wfComment2, _item$wfComment3, _item$assignes, _item$assignes$, _item$assignes$2, _item$assignes$3, _item$wfDocuments, _item$wfDocuments2;
|
|
17036
17045
|
return /*#__PURE__*/React.createElement("div", {
|
|
17037
17046
|
key: index,
|
|
17038
17047
|
className: "custom-timeline-entry"
|
|
@@ -17069,13 +17078,9 @@ function NewApplicationTimeline({
|
|
|
17069
17078
|
className: "custom-officer-info"
|
|
17070
17079
|
}, /*#__PURE__*/React.createElement("div", {
|
|
17071
17080
|
className: "custom-officer-name"
|
|
17072
|
-
}, (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.name) || t("CS_COMMON_NA"), deptMap[item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.userName] && /*#__PURE__*/React.createElement("
|
|
17081
|
+
}, (item === null || item === void 0 ? void 0 : (_item$assigner2 = item.assigner) === null || _item$assigner2 === void 0 ? void 0 : _item$assigner2.name) || t("CS_COMMON_NA")), deptMap[item === null || item === void 0 ? void 0 : (_item$assigner3 = item.assigner) === null || _item$assigner3 === void 0 ? void 0 : _item$assigner3.userName] && /*#__PURE__*/React.createElement("div", {
|
|
17073
17082
|
className: "custom-officer-name"
|
|
17074
|
-
},
|
|
17075
|
-
className: "custom-officer-email"
|
|
17076
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
17077
|
-
className: "custom-email-label"
|
|
17078
|
-
}, t("Email")), " ", item === null || item === void 0 ? void 0 : (_item$assigner6 = item.assigner) === null || _item$assigner6 === void 0 ? void 0 : _item$assigner6.emailId))), /*#__PURE__*/React.createElement("div", {
|
|
17083
|
+
}, t(deptMap[item === null || item === void 0 ? void 0 : (_item$assigner4 = item.assigner) === null || _item$assigner4 === void 0 ? void 0 : _item$assigner4.userName])))), /*#__PURE__*/React.createElement("div", {
|
|
17079
17084
|
className: "custom-card-column custom-card-column-mid"
|
|
17080
17085
|
}, (item === null || item === void 0 ? void 0 : item.sla) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h3", {
|
|
17081
17086
|
className: "custom-action-title"
|
|
@@ -17129,7 +17134,7 @@ function NewApplicationTimeline({
|
|
|
17129
17134
|
}
|
|
17130
17135
|
|
|
17131
17136
|
const PTRWFApplicationTimeline = props => {
|
|
17132
|
-
var _props$application2, _props$application3, _props$application4, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _props$application0, _props$application1,
|
|
17137
|
+
var _props$application2, _props$application3, _props$application4, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9, _workflowDetails$data0, _data$PetService, _data$PetService$Appl, _checkRenewTime$, _props$application0, _props$application1, _props$application10, _props$application11, _props$application12, _actions$, _props$application13, _props$application14, _props$application16, _props$application18, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11;
|
|
17133
17138
|
const {
|
|
17134
17139
|
t
|
|
17135
17140
|
} = useTranslation();
|
|
@@ -17319,10 +17324,23 @@ const PTRWFApplicationTimeline = props => {
|
|
|
17319
17324
|
fetchWorkflowService();
|
|
17320
17325
|
}
|
|
17321
17326
|
}, [tenantId]);
|
|
17327
|
+
const {
|
|
17328
|
+
data
|
|
17329
|
+
} = Digit.Hooks.useCustomMDMS(tenantId, "PetService", [{
|
|
17330
|
+
name: "ApplicationType"
|
|
17331
|
+
}]);
|
|
17332
|
+
const checkRenewTime = data === null || data === void 0 ? void 0 : (_data$PetService = data.PetService) === null || _data$PetService === void 0 ? void 0 : (_data$PetService$Appl = _data$PetService.ApplicationType) === null || _data$PetService$Appl === void 0 ? void 0 : _data$PetService$Appl.filter(item => item.code == "RENEWAPPLICATION");
|
|
17333
|
+
const checkTimeRenew = (checkRenewTime === null || checkRenewTime === void 0 ? void 0 : (_checkRenewTime$ = checkRenewTime[0]) === null || _checkRenewTime$ === void 0 ? void 0 : _checkRenewTime$.renewalPeriod) * 1000;
|
|
17334
|
+
const validToObj = (_props$application0 = props.application) === null || _props$application0 === void 0 ? void 0 : _props$application0.validityDate;
|
|
17335
|
+
const validToMillis = validToObj ? validToObj * 1000 : null;
|
|
17336
|
+
const currentDateObj = Date.now();
|
|
17337
|
+
const duration = validToObj && currentDateObj ? validToMillis - currentDateObj : null;
|
|
17338
|
+
const checkDuration = duration !== null && duration <= checkTimeRenew;
|
|
17339
|
+
const checkRenewal = ((_props$application1 = props.application) === null || _props$application1 === void 0 ? void 0 : _props$application1.status) == "APPROVED" || ((_props$application10 = props.application) === null || _props$application10 === void 0 ? void 0 : _props$application10.status) == "EXPIRED";
|
|
17322
17340
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(NewApplicationTimeline, {
|
|
17323
17341
|
workflowDetails: workflowDetails,
|
|
17324
17342
|
t: t
|
|
17325
|
-
}), (((_props$
|
|
17343
|
+
}), (((_props$application11 = props.application) === null || _props$application11 === void 0 ? void 0 : _props$application11.status) != "CITIZENACTIONREQUIRED" || ((_props$application12 = props.application) === null || _props$application12 === void 0 ? void 0 : _props$application12.status) != "INITIATED") && actions && actions.length > 0 && ((_actions$ = actions[0]) === null || _actions$ === void 0 ? void 0 : _actions$.action) != "PAY" && !isCitizen && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu ? /*#__PURE__*/React.createElement(Menu, {
|
|
17326
17344
|
localeKeyPrefix: `WF_EMPLOYEE_${"PTR"}`,
|
|
17327
17345
|
options: actions,
|
|
17328
17346
|
optionKey: "action",
|
|
@@ -17332,18 +17350,24 @@ const PTRWFApplicationTimeline = props => {
|
|
|
17332
17350
|
ref: menuRef,
|
|
17333
17351
|
label: t("WF_TAKE_ACTION"),
|
|
17334
17352
|
onSubmit: () => setDisplayMenu(!displayMenu)
|
|
17335
|
-
})), (((_props$
|
|
17353
|
+
})), (((_props$application13 = props.application) === null || _props$application13 === void 0 ? void 0 : _props$application13.status) == "CITIZENACTIONREQUIRED" || ((_props$application14 = props.application) === null || _props$application14 === void 0 ? void 0 : _props$application14.status) == "INITIATED") && !isCitizen && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
17336
17354
|
label: t("COMMON_EDIT"),
|
|
17337
17355
|
onSubmit: () => {
|
|
17338
|
-
var _props$
|
|
17339
|
-
history.push(`/digit-ui/employee/ptr/petservice/new-application/${(_props$
|
|
17356
|
+
var _props$application15;
|
|
17357
|
+
history.push(`/digit-ui/employee/ptr/petservice/new-application/${(_props$application15 = props.application) === null || _props$application15 === void 0 ? void 0 : _props$application15.applicationNumber}`);
|
|
17358
|
+
}
|
|
17359
|
+
})), checkRenewal && checkDuration && ((_props$application16 = props.application) === null || _props$application16 === void 0 ? void 0 : _props$application16.status) == "APPROVED" && !isCitizen && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar, {
|
|
17360
|
+
label: t("PT_RENEW_HEADER"),
|
|
17361
|
+
onSubmit: () => {
|
|
17362
|
+
var _props$application17;
|
|
17363
|
+
history.push(`/digit-ui/employee/ptr/petservice/new-application/${props === null || props === void 0 ? void 0 : (_props$application17 = props.application) === null || _props$application17 === void 0 ? void 0 : _props$application17.applicationNumber}/renew-application`);
|
|
17340
17364
|
}
|
|
17341
17365
|
})), showModal ? /*#__PURE__*/React.createElement(PTRModal, {
|
|
17342
17366
|
t: t,
|
|
17343
17367
|
action: selectedAction,
|
|
17344
17368
|
tenantId: tenantId,
|
|
17345
17369
|
state: state,
|
|
17346
|
-
id: (_props$
|
|
17370
|
+
id: (_props$application18 = props.application) === null || _props$application18 === void 0 ? void 0 : _props$application18.applicationNumber,
|
|
17347
17371
|
applicationDetails: props.application,
|
|
17348
17372
|
closeModal: closeModal,
|
|
17349
17373
|
submitAction: submitAction,
|
|
@@ -20037,21 +20061,14 @@ function renderCanvas(renderFunc, canvas, text, opts, cb) {
|
|
|
20037
20061
|
cb(e);
|
|
20038
20062
|
}
|
|
20039
20063
|
}
|
|
20040
|
-
var create$1 = qrcode.create;
|
|
20041
20064
|
var toCanvas = renderCanvas.bind(null, canvas.render);
|
|
20042
20065
|
var toDataURL = renderCanvas.bind(null, canvas.renderToDataURL);
|
|
20043
20066
|
var toString_1$1 = renderCanvas.bind(null, function (data, _, opts) {
|
|
20044
20067
|
return svgTag.render(data, opts);
|
|
20045
20068
|
});
|
|
20046
|
-
var browser = {
|
|
20047
|
-
create: create$1,
|
|
20048
|
-
toCanvas: toCanvas,
|
|
20049
|
-
toDataURL: toDataURL,
|
|
20050
|
-
toString: toString_1$1
|
|
20051
|
-
};
|
|
20052
20069
|
|
|
20053
20070
|
const PTRApplicationDetails = () => {
|
|
20054
|
-
var
|
|
20071
|
+
var _pet_details$addition, _reciept_data$Payment2, _reciept_data$Payment3, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$owner5, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai6, _pet_details$petDetai8, _pet_details$petDetai9, _pet_details$petDetai0;
|
|
20055
20072
|
const {
|
|
20056
20073
|
t
|
|
20057
20074
|
} = useTranslation();
|
|
@@ -20094,8 +20111,6 @@ const PTRApplicationDetails = () => {
|
|
|
20094
20111
|
});
|
|
20095
20112
|
console.log("data====", data);
|
|
20096
20113
|
const [billData, setBillData] = useState(null);
|
|
20097
|
-
const ulb = tenantInfo === null || tenantInfo === void 0 ? void 0 : (_tenantInfo$city = tenantInfo.city) === null || _tenantInfo$city === void 0 ? void 0 : _tenantInfo$city.name;
|
|
20098
|
-
const ulbType = tenantInfo === null || tenantInfo === void 0 ? void 0 : (_tenantInfo$city2 = tenantInfo.city) === null || _tenantInfo$city2 === void 0 ? void 0 : _tenantInfo$city2.ulbType;
|
|
20099
20114
|
const PetRegistrationApplications = get_1(data, "PetRegistrationApplications", []);
|
|
20100
20115
|
const pet_details = PetRegistrationApplications && PetRegistrationApplications.length > 0 && PetRegistrationApplications[0] || {};
|
|
20101
20116
|
const application = pet_details;
|
|
@@ -20153,581 +20168,6 @@ const PTRApplicationDetails = () => {
|
|
|
20153
20168
|
};
|
|
20154
20169
|
pet_details.workflow = workflow;
|
|
20155
20170
|
}
|
|
20156
|
-
const printCertificate = async () => {
|
|
20157
|
-
const qrDataURL = await browser.toDataURL(window.location.href);
|
|
20158
|
-
try {
|
|
20159
|
-
var _data$PetRegistration;
|
|
20160
|
-
if (!(data !== null && data !== void 0 && (_data$PetRegistration = data.PetRegistrationApplications) !== null && _data$PetRegistration !== void 0 && _data$PetRegistration[0])) {
|
|
20161
|
-
throw new Error("Pet registration data is missing");
|
|
20162
|
-
}
|
|
20163
|
-
const createCertificateHTML = () => {
|
|
20164
|
-
var _petData$documents, _petData$petDetails, _petData$owner, _petData$address, _petData$address2, _petData$owner2, _petData$petDetails2, _petData$petDetails3, _petData$petDetails4, _petData$petDetails5, _petData$petDetails6, _petData$petDetails7, _petData$auditDetails, _petData$auditDetails2, _reciept_data$Payment, _reciept_data$Payment2, _reciept_data$Payment3, _reciept_data$Payment4, _reciept_data$Payment5, _reciept_data$Payment6, _petData$owner3, _petData$owner4, _petData$address3, _petData$address4;
|
|
20165
|
-
const petData = data.PetRegistrationApplications[0];
|
|
20166
|
-
const currentDate = new Date().toLocaleDateString("en-IN", {
|
|
20167
|
-
day: "2-digit",
|
|
20168
|
-
month: "2-digit",
|
|
20169
|
-
year: "numeric"
|
|
20170
|
-
});
|
|
20171
|
-
const petImage = petData === null || petData === void 0 ? void 0 : (_petData$documents = petData.documents) === null || _petData$documents === void 0 ? void 0 : _petData$documents.find(doc => (doc === null || doc === void 0 ? void 0 : doc.documentType) === "PET.PETPHOTO");
|
|
20172
|
-
const petImageUrl = petImage !== null && petImage !== void 0 && petImage.filestoreId ? `${window.location.origin}/filestore/v1/files/id?tenantId=pb&fileStoreId=${petImage.filestoreId}` : `${window.location.origin}/adorable-golden-retriever.png`;
|
|
20173
|
-
const content = `
|
|
20174
|
-
<html>
|
|
20175
|
-
<head>
|
|
20176
|
-
<title>Pet Registration Certificate</title>
|
|
20177
|
-
<style>
|
|
20178
|
-
@page { margin: 0.5in; }
|
|
20179
|
-
body {
|
|
20180
|
-
font-family: 'Times New Roman', serif;
|
|
20181
|
-
margin: 0;
|
|
20182
|
-
font-size: 11px;
|
|
20183
|
-
}
|
|
20184
|
-
.certificate-container {
|
|
20185
|
-
max-width: 800px;
|
|
20186
|
-
margin: 0 auto;
|
|
20187
|
-
border: 3px solid #000;
|
|
20188
|
-
background: white;
|
|
20189
|
-
}
|
|
20190
|
-
.header {
|
|
20191
|
-
display: flex;
|
|
20192
|
-
justify-content: space-between;
|
|
20193
|
-
align-items: center;
|
|
20194
|
-
text-align: center;
|
|
20195
|
-
margin-bottom: 5px;
|
|
20196
|
-
position: relative;
|
|
20197
|
-
}
|
|
20198
|
-
.header-value{
|
|
20199
|
-
border: none;
|
|
20200
|
-
display: flex;
|
|
20201
|
-
text-align: center;
|
|
20202
|
-
}
|
|
20203
|
-
.header-center {
|
|
20204
|
-
text-align: center;
|
|
20205
|
-
flex: 1;
|
|
20206
|
-
padding-right: 80px
|
|
20207
|
-
}
|
|
20208
|
-
.header-disclaimer {
|
|
20209
|
-
text-align: center;
|
|
20210
|
-
flex: 1;
|
|
20211
|
-
}
|
|
20212
|
-
.header-right {
|
|
20213
|
-
flex: 0 0 auto;
|
|
20214
|
-
}
|
|
20215
|
-
.title {
|
|
20216
|
-
font-size: 13px;
|
|
20217
|
-
font-weight: bold;
|
|
20218
|
-
margin: 10px 0;
|
|
20219
|
-
}
|
|
20220
|
-
.subtitle {
|
|
20221
|
-
font-size: 10px;
|
|
20222
|
-
color: #666;
|
|
20223
|
-
}
|
|
20224
|
-
.main-content {
|
|
20225
|
-
display: flex;
|
|
20226
|
-
gap: 10px;
|
|
20227
|
-
margin: 10px 0;
|
|
20228
|
-
align-items:flex-start;
|
|
20229
|
-
margin-bottom: -13px;
|
|
20230
|
-
}
|
|
20231
|
-
.details-section {
|
|
20232
|
-
}
|
|
20233
|
-
.pet-image-section {
|
|
20234
|
-
flex-shrink: 0;
|
|
20235
|
-
text-align: center;
|
|
20236
|
-
order: 2;
|
|
20237
|
-
}
|
|
20238
|
-
.pet-image {
|
|
20239
|
-
width: 100px;
|
|
20240
|
-
max-width: 100%;
|
|
20241
|
-
aspect-ratio : 1 / 1;
|
|
20242
|
-
height: auto;
|
|
20243
|
-
border: 2px solid #000;
|
|
20244
|
-
object-fit: cover;
|
|
20245
|
-
margin-bottom: 10px;
|
|
20246
|
-
border-right-width: 2px;
|
|
20247
|
-
margin-right: 50px;
|
|
20248
|
-
margin-top: 20px;
|
|
20249
|
-
display: block;
|
|
20250
|
-
}
|
|
20251
|
-
.image-label {
|
|
20252
|
-
font-size: 12px;
|
|
20253
|
-
font-weight: bold;
|
|
20254
|
-
text-align: center;
|
|
20255
|
-
border-right-width: 30px;
|
|
20256
|
-
margin-right: 50px;
|
|
20257
|
-
}
|
|
20258
|
-
.details-grid {
|
|
20259
|
-
display: grid;
|
|
20260
|
-
grid-template-columns: 290px 280px;
|
|
20261
|
-
overflow: hidden;
|
|
20262
|
-
margin: 10px 0;
|
|
20263
|
-
margin-left : 40px;
|
|
20264
|
-
}
|
|
20265
|
-
.detail-row {
|
|
20266
|
-
display: grid;
|
|
20267
|
-
grid-template-columns: 140px 180px;
|
|
20268
|
-
overflow:hidden;
|
|
20269
|
-
border: 1px solid black;
|
|
20270
|
-
}
|
|
20271
|
-
.detail-label {
|
|
20272
|
-
font-weight: bold;
|
|
20273
|
-
white-space: normal;
|
|
20274
|
-
word-break: break-word;
|
|
20275
|
-
margin-left: 10px;
|
|
20276
|
-
flex-shrink: 1;
|
|
20277
|
-
}
|
|
20278
|
-
.detail-value {
|
|
20279
|
-
padding-bottom: 2px;
|
|
20280
|
-
margin-right: 10px;
|
|
20281
|
-
}
|
|
20282
|
-
.owner-section {
|
|
20283
|
-
margin: 5px 40px;
|
|
20284
|
-
margin-bottom: 0px;
|
|
20285
|
-
display: grid;
|
|
20286
|
-
grid-template-columns: 50%;
|
|
20287
|
-
}
|
|
20288
|
-
.footer-section {
|
|
20289
|
-
margin: 0px 40px;
|
|
20290
|
-
display: flex;
|
|
20291
|
-
justify-content: space-between;
|
|
20292
|
-
align-items: anchor-center;
|
|
20293
|
-
}
|
|
20294
|
-
.signature-area {
|
|
20295
|
-
text-align: center;
|
|
20296
|
-
min-width: 200px;
|
|
20297
|
-
}
|
|
20298
|
-
.signature-line {
|
|
20299
|
-
border-top: 1px solid #000;
|
|
20300
|
-
margin: 10px 0 5px 0;
|
|
20301
|
-
}
|
|
20302
|
-
.pet-sub {
|
|
20303
|
-
font-size: 10px;
|
|
20304
|
-
margin: 5px 0;
|
|
20305
|
-
color: #666;
|
|
20306
|
-
font-weight: bold;
|
|
20307
|
-
}
|
|
20308
|
-
.terms-section {
|
|
20309
|
-
border-top: 2px solid #000;
|
|
20310
|
-
padding-top: 5px;
|
|
20311
|
-
font-size: 11px;
|
|
20312
|
-
margin: 0px 10px;
|
|
20313
|
-
}
|
|
20314
|
-
.terms-title {
|
|
20315
|
-
font-weight: bold;
|
|
20316
|
-
margin-bottom: 10px;
|
|
20317
|
-
}
|
|
20318
|
-
.terms-list {
|
|
20319
|
-
margin: 0;
|
|
20320
|
-
padding-left: 20px;
|
|
20321
|
-
}
|
|
20322
|
-
.terms-list li {
|
|
20323
|
-
margin-bottom: 2px;
|
|
20324
|
-
text-align: left;
|
|
20325
|
-
}
|
|
20326
|
-
@media print {
|
|
20327
|
-
body { background: white !important; }
|
|
20328
|
-
}
|
|
20329
|
-
@media (max-width: 700px) {
|
|
20330
|
-
.main-content {
|
|
20331
|
-
flex-wrap: wrap;
|
|
20332
|
-
}
|
|
20333
|
-
.pet-image {
|
|
20334
|
-
width: 100px;
|
|
20335
|
-
max-width: 100%;
|
|
20336
|
-
height: auto;
|
|
20337
|
-
aspect-ratio: 1/1;
|
|
20338
|
-
}
|
|
20339
|
-
.dis-section{
|
|
20340
|
-
font-size: 12px;
|
|
20341
|
-
margin: 0px 10px;
|
|
20342
|
-
}
|
|
20343
|
-
}
|
|
20344
|
-
</style>
|
|
20345
|
-
</head>
|
|
20346
|
-
<body>
|
|
20347
|
-
<div class="certificate-container">
|
|
20348
|
-
<div class="header">
|
|
20349
|
-
<div>
|
|
20350
|
-
<img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/${petData === null || petData === void 0 ? void 0 : petData.tenantId}/logo.png"
|
|
20351
|
-
style="width: 80px; height: 80px; padding-left: 20px; padding-top: 5px;" />
|
|
20352
|
-
</div>
|
|
20353
|
-
<div class="header-center">
|
|
20354
|
-
<div class="title">${t(ulbType)} ${t(ulb)}</div>
|
|
20355
|
-
<div class="subtitle">${t("Veterinary Services- Health Branch")}</div>
|
|
20356
|
-
<div class="pet-sub">Pet Registration Certificate</div>
|
|
20357
|
-
<div class="subtitle">(U/S 399 (1)(E) of PMC Act,1976)</div>
|
|
20358
|
-
</div>
|
|
20359
|
-
<div class="header-right">
|
|
20360
|
-
</div>
|
|
20361
|
-
</div>
|
|
20362
|
-
<span class="header-value">This is to certify that the ${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails = petData.petDetails) === null || _petData$petDetails === void 0 ? void 0 : _petData$petDetails.petType) || "Dog"} kept by Mr./Mrs./Ms. ${(petData === null || petData === void 0 ? void 0 : (_petData$owner = petData.owner) === null || _petData$owner === void 0 ? void 0 : _petData$owner.name) || "Not Specified"} at ${(petData === null || petData === void 0 ? void 0 : (_petData$address = petData.address) === null || _petData$address === void 0 ? void 0 : _petData$address.addressId) || "Not Specified"}, ${(petData === null || petData === void 0 ? void 0 : (_petData$address2 = petData.address) === null || _petData$address2 === void 0 ? void 0 : _petData$address2.pincode) || ""} mobile no. ${(petData === null || petData === void 0 ? void 0 : (_petData$owner2 = petData.owner) === null || _petData$owner2 === void 0 ? void 0 : _petData$owner2.mobileNumber) || "Not Specified"} is registered with ${ulbType} ${ulb} as per following details:</span>
|
|
20363
|
-
<div class="main-content">
|
|
20364
|
-
<div class="details-section">
|
|
20365
|
-
<span class="detail-label">Pet Information</span> <br>
|
|
20366
|
-
<span class="detail-label">Registration No:</span> <span class="detail-label">${(petData === null || petData === void 0 ? void 0 : petData.petRegistrationNumber) || ""}</span>
|
|
20367
|
-
<div class="details-grid">
|
|
20368
|
-
<div class="detail-row">
|
|
20369
|
-
<span class="detail-label">Category</span>
|
|
20370
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails2 = petData.petDetails) === null || _petData$petDetails2 === void 0 ? void 0 : _petData$petDetails2.petType) || "Dog"}</span>
|
|
20371
|
-
</div>
|
|
20372
|
-
<div class="detail-row">
|
|
20373
|
-
<span class="detail-label">Breed</span>
|
|
20374
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails3 = petData.petDetails) === null || _petData$petDetails3 === void 0 ? void 0 : _petData$petDetails3.breedType) || "Not Specified"}</span>
|
|
20375
|
-
</div>
|
|
20376
|
-
<div class="detail-row">
|
|
20377
|
-
<span class="detail-label">Name of Animal</span>
|
|
20378
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails4 = petData.petDetails) === null || _petData$petDetails4 === void 0 ? void 0 : _petData$petDetails4.petName) || "Not Specified"}</span>
|
|
20379
|
-
</div>
|
|
20380
|
-
<div class="detail-row">
|
|
20381
|
-
<span class="detail-label">Gender</span>
|
|
20382
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails5 = petData.petDetails) === null || _petData$petDetails5 === void 0 ? void 0 : _petData$petDetails5.petGender) || "Not Specified"}</span>
|
|
20383
|
-
</div>
|
|
20384
|
-
<div class="detail-row">
|
|
20385
|
-
<span class="detail-label">Pet Age</span>
|
|
20386
|
-
<span class="detail-value">${formatPetAge(petData === null || petData === void 0 ? void 0 : (_petData$petDetails6 = petData.petDetails) === null || _petData$petDetails6 === void 0 ? void 0 : _petData$petDetails6.petAge, t) || t("CS_NA")}</span>
|
|
20387
|
-
</div>
|
|
20388
|
-
<div class="detail-row">
|
|
20389
|
-
<span class="detail-label">Colour</span>
|
|
20390
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails7 = petData.petDetails) === null || _petData$petDetails7 === void 0 ? void 0 : _petData$petDetails7.petColor) || "Not Specified"}</span>
|
|
20391
|
-
</div>
|
|
20392
|
-
<div class="detail-row">
|
|
20393
|
-
<span class="detail-label">Application Number</span>
|
|
20394
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.applicationNumber) || "Not Specified"}</span>
|
|
20395
|
-
</div>
|
|
20396
|
-
<div class="detail-row">
|
|
20397
|
-
<span class="detail-label">Token No</span>
|
|
20398
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.petToken) || "Not Specified"}</span>
|
|
20399
|
-
</div>
|
|
20400
|
-
<div class="detail-row">
|
|
20401
|
-
<span class="detail-label">Issue Date</span>
|
|
20402
|
-
<span class="detail-value">
|
|
20403
|
-
${petData !== null && petData !== void 0 && (_petData$auditDetails = petData.auditDetails) !== null && _petData$auditDetails !== void 0 && _petData$auditDetails.lastModifiedTime ? new Date((_petData$auditDetails2 = petData.auditDetails) === null || _petData$auditDetails2 === void 0 ? void 0 : _petData$auditDetails2.lastModifiedTime).toLocaleDateString("en-GB") : "N/A"}
|
|
20404
|
-
</span>
|
|
20405
|
-
</div>
|
|
20406
|
-
|
|
20407
|
-
<div class="detail-row">
|
|
20408
|
-
<span class="detail-label">License Valid Upto</span>
|
|
20409
|
-
<span class="detail-value">
|
|
20410
|
-
${petData !== null && petData !== void 0 && petData.validityDate ? new Date(petData.validityDate * 1000).toLocaleDateString("en-GB") : "N/A"}
|
|
20411
|
-
|
|
20412
|
-
</span>
|
|
20413
|
-
</div>
|
|
20414
|
-
<div class="detail-row">
|
|
20415
|
-
<span class="detail-label">Amount</span>
|
|
20416
|
-
<span class="detail-value">Rs. ${(reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment = reciept_data.Payments) === null || _reciept_data$Payment === void 0 ? void 0 : (_reciept_data$Payment2 = _reciept_data$Payment[0]) === null || _reciept_data$Payment2 === void 0 ? void 0 : _reciept_data$Payment2.totalAmountPaid) || "Not Specified"}/-</span>
|
|
20417
|
-
</div>
|
|
20418
|
-
<div class="detail-row">
|
|
20419
|
-
<span class="detail-label">G8/Receipt No</span>
|
|
20420
|
-
<span class="detail-value">${(reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment3 = reciept_data.Payments) === null || _reciept_data$Payment3 === void 0 ? void 0 : (_reciept_data$Payment4 = _reciept_data$Payment3[0]) === null || _reciept_data$Payment4 === void 0 ? void 0 : (_reciept_data$Payment5 = _reciept_data$Payment4.paymentDetails) === null || _reciept_data$Payment5 === void 0 ? void 0 : (_reciept_data$Payment6 = _reciept_data$Payment5[0]) === null || _reciept_data$Payment6 === void 0 ? void 0 : _reciept_data$Payment6.receiptNumber) || "Not Specified"}</span>
|
|
20421
|
-
</div>
|
|
20422
|
-
</div>
|
|
20423
|
-
</div>
|
|
20424
|
-
|
|
20425
|
-
<div class="pet-image-section">
|
|
20426
|
-
<img
|
|
20427
|
-
src="${petImageUrl}"
|
|
20428
|
-
alt="Pet Photo"
|
|
20429
|
-
class="pet-image"
|
|
20430
|
-
onload="console.log('Pet image loaded successfully:', this.src);"
|
|
20431
|
-
onerror="console.log('Pet image failed to load:', this.src); console.log('Trying fallback image...'); this.src='/adorable-golden-retriever.png';"
|
|
20432
|
-
/>
|
|
20433
|
-
<div class="image-label">Pet Photo</div>
|
|
20434
|
-
<script>
|
|
20435
|
-
console.log('Image URL being used:', '${petImageUrl}');
|
|
20436
|
-
console.log('Pet image data:', ${JSON.stringify(petImage)});
|
|
20437
|
-
</script>
|
|
20438
|
-
</div>
|
|
20439
|
-
</div>
|
|
20440
|
-
|
|
20441
|
-
<span class="detail-label">Owner Information</span>
|
|
20442
|
-
<div class="owner-section">
|
|
20443
|
-
<div class="detail-row">
|
|
20444
|
-
<span class="detail-label">Owner Name</span>
|
|
20445
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$owner3 = petData.owner) === null || _petData$owner3 === void 0 ? void 0 : _petData$owner3.name) || "Not Specified"}</span>
|
|
20446
|
-
</div>
|
|
20447
|
-
<div class="detail-row">
|
|
20448
|
-
<span class="detail-label">Father/Spouse Name</span>
|
|
20449
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.fatherName) || (petData === null || petData === void 0 ? void 0 : (_petData$owner4 = petData.owner) === null || _petData$owner4 === void 0 ? void 0 : _petData$owner4.fatherOrHusbandName) || "Not Specified"}</span>
|
|
20450
|
-
</div>
|
|
20451
|
-
<div class="detail-row">
|
|
20452
|
-
<span class="detail-label">Address</span>
|
|
20453
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$address3 = petData.address) === null || _petData$address3 === void 0 ? void 0 : _petData$address3.addressId) || "Not Specified"}, ${(petData === null || petData === void 0 ? void 0 : (_petData$address4 = petData.address) === null || _petData$address4 === void 0 ? void 0 : _petData$address4.pincode) || ""}</span>
|
|
20454
|
-
</div>
|
|
20455
|
-
</div>
|
|
20456
|
-
|
|
20457
|
-
<div class="header">
|
|
20458
|
-
<div class="header-left"> </div>
|
|
20459
|
-
<div class="header-disclaimer">
|
|
20460
|
-
<div class="title">DISCLAIMER</div>
|
|
20461
|
-
<div class="dis-section">${t("PET_DISCLAIMER")}</div>
|
|
20462
|
-
<div class="header-right"></div>
|
|
20463
|
-
</div>
|
|
20464
|
-
</div>
|
|
20465
|
-
|
|
20466
|
-
<div class="footer-section">
|
|
20467
|
-
<div>
|
|
20468
|
-
<div>Date:........................</div>
|
|
20469
|
-
<div>Place:.......................</div>
|
|
20470
|
-
</div>
|
|
20471
|
-
<div class="signature-area">
|
|
20472
|
-
<div class="detail-label">Approved by</div>
|
|
20473
|
-
<span class="detail-value">${approver || "Not Specified"}</span>
|
|
20474
|
-
<div class="signature-line"></div>
|
|
20475
|
-
<div>Licensing Authority</div>
|
|
20476
|
-
<div>${t(ulbType)}</div>
|
|
20477
|
-
|
|
20478
|
-
</div>
|
|
20479
|
-
</div>
|
|
20480
|
-
|
|
20481
|
-
<div class="terms-section">
|
|
20482
|
-
<div class="terms-title">${t("TERMS AND CONDITIONS")}</div>
|
|
20483
|
-
<div class="terms-title">${t("PET_TERMS_HEADER")}</div>
|
|
20484
|
-
<ol class="terms-list">
|
|
20485
|
-
<li>${t("PET_TERM1A")} <strong> ${(petData === null || petData === void 0 ? void 0 : petData.petRegistrationNumber) || ""} </strong> ${t("PET_TERM1B")} <strong>'https://mseva.lgpunjab.gov.in/digit-ui/citizen/ptr-home'</strong></li>
|
|
20486
|
-
<li>${t("PET_NEW_TERM_2")}</li>
|
|
20487
|
-
<li>${t("PET_NEW_TERM_3")}</li>
|
|
20488
|
-
<li>${t("PET_NEW_TERM_4")}</li>
|
|
20489
|
-
<li>${t("PET_NEW_TERM_5")}</li>
|
|
20490
|
-
<li>${t("PET_NEW_TERM_6")}</li>
|
|
20491
|
-
<li>${t("PET_NEW_TERM_7")}</li>
|
|
20492
|
-
<li>${t("PET_NEW_TERM_8")}</li>
|
|
20493
|
-
<li>${t("PET_NEW_TERM_9")}</li>
|
|
20494
|
-
<li>${t("PET_NEW_TERM_10")}</li>
|
|
20495
|
-
<li>${t("PET_NEW_TERM_11")}</li>
|
|
20496
|
-
<li>${t("PET_NEW_TERM_12")}</li>
|
|
20497
|
-
<li>${t("PET_NEW_TERM_13")}</li>
|
|
20498
|
-
<li>${t("PET_NEW_TERM_14")}</li>
|
|
20499
|
-
<li>${t("PET_NEW_TERM_15")}</li>
|
|
20500
|
-
<li>${t("PET_NEW_TERM_16")}</li>
|
|
20501
|
-
</ol>
|
|
20502
|
-
|
|
20503
|
-
<div style="text-align: center;">
|
|
20504
|
-
<img src="${qrDataURL}" style="width: 100px; height: 100px;" />
|
|
20505
|
-
</div>
|
|
20506
|
-
</div>
|
|
20507
|
-
</div>
|
|
20508
|
-
</body>
|
|
20509
|
-
</html>
|
|
20510
|
-
`;
|
|
20511
|
-
const printWindow = window.open("", "_blank");
|
|
20512
|
-
printWindow.document.write(content);
|
|
20513
|
-
printWindow.document.close();
|
|
20514
|
-
printWindow.onload = () => {
|
|
20515
|
-
setTimeout(() => {
|
|
20516
|
-
printWindow.print();
|
|
20517
|
-
printWindow.onafterprint = () => {
|
|
20518
|
-
printWindow.close();
|
|
20519
|
-
};
|
|
20520
|
-
}, 500);
|
|
20521
|
-
};
|
|
20522
|
-
};
|
|
20523
|
-
createCertificateHTML();
|
|
20524
|
-
setShowToast({
|
|
20525
|
-
key: false,
|
|
20526
|
-
label: "PTR_CERTIFICATE_DOWNLOADED_SUCCESSFULLY"
|
|
20527
|
-
});
|
|
20528
|
-
} catch (error) {
|
|
20529
|
-
setShowToast({
|
|
20530
|
-
key: true,
|
|
20531
|
-
label: `PTR_CERTIFICATE_DOWNLOAD_ERROR: ${error.message}`
|
|
20532
|
-
});
|
|
20533
|
-
}
|
|
20534
|
-
};
|
|
20535
|
-
const downloadAcknowledgement = async () => {
|
|
20536
|
-
try {
|
|
20537
|
-
var _data$PetRegistration2;
|
|
20538
|
-
if (!(data !== null && data !== void 0 && (_data$PetRegistration2 = data.PetRegistrationApplications) !== null && _data$PetRegistration2 !== void 0 && _data$PetRegistration2[0])) {
|
|
20539
|
-
throw new Error("Pet registration data is missing");
|
|
20540
|
-
}
|
|
20541
|
-
const createAcknowledgementHTML = () => {
|
|
20542
|
-
var _petData$petDetails8, _petData$petDetails9, _petData$petDetails0, _petData$owner5, _petData$owner6, _petData$owner7;
|
|
20543
|
-
const petData = data.PetRegistrationApplications[0];
|
|
20544
|
-
const ulb = petData === null || petData === void 0 ? void 0 : petData.tenantId.split(".")[1];
|
|
20545
|
-
const currentDate = new Date().toLocaleDateString("en-IN", {
|
|
20546
|
-
day: "2-digit",
|
|
20547
|
-
month: "long",
|
|
20548
|
-
year: "numeric"
|
|
20549
|
-
});
|
|
20550
|
-
const content = `
|
|
20551
|
-
<html>
|
|
20552
|
-
<head>
|
|
20553
|
-
<title>Pet Registration Acknowledgement</title>
|
|
20554
|
-
<style>
|
|
20555
|
-
@page { margin: 0.5in; }
|
|
20556
|
-
body {
|
|
20557
|
-
font-family: 'Arial', sans-serif;
|
|
20558
|
-
margin: 0;
|
|
20559
|
-
padding: 20px;
|
|
20560
|
-
font-size: 14px;
|
|
20561
|
-
line-height: 1.6;
|
|
20562
|
-
}
|
|
20563
|
-
.acknowledgement-container {
|
|
20564
|
-
max-width: 800px;
|
|
20565
|
-
margin: 0 auto;
|
|
20566
|
-
border: 2px solid #333;
|
|
20567
|
-
padding: 30px;
|
|
20568
|
-
background: white;
|
|
20569
|
-
}
|
|
20570
|
-
.header {
|
|
20571
|
-
text-align: center;
|
|
20572
|
-
border-bottom: 2px solid #333;
|
|
20573
|
-
display: flex;
|
|
20574
|
-
justify-content: space-between;
|
|
20575
|
-
align-items: center;
|
|
20576
|
-
position: relative;
|
|
20577
|
-
}
|
|
20578
|
-
.header-center {
|
|
20579
|
-
text-align: center;
|
|
20580
|
-
flex: 1;
|
|
20581
|
-
padding-right: 80px
|
|
20582
|
-
}
|
|
20583
|
-
.header-right {
|
|
20584
|
-
flex: 0 0 auto;
|
|
20585
|
-
}
|
|
20586
|
-
.title {
|
|
20587
|
-
font-size: 20px;
|
|
20588
|
-
font-weight: bold;
|
|
20589
|
-
margin: 10px 0;
|
|
20590
|
-
color: #333;
|
|
20591
|
-
}
|
|
20592
|
-
.subtitle {
|
|
20593
|
-
font-size: 16px;
|
|
20594
|
-
margin: 5px 0;
|
|
20595
|
-
color: #666;
|
|
20596
|
-
}
|
|
20597
|
-
.pet-sub {
|
|
20598
|
-
font-size: 16px;
|
|
20599
|
-
margin: 5px 0;
|
|
20600
|
-
color: #666;
|
|
20601
|
-
font-weight: bold;
|
|
20602
|
-
}
|
|
20603
|
-
.acknowledgement-text {
|
|
20604
|
-
text-align: justify;
|
|
20605
|
-
font-size: 15px;
|
|
20606
|
-
}
|
|
20607
|
-
.details-table {
|
|
20608
|
-
width: 100%;
|
|
20609
|
-
border-collapse: collapse;
|
|
20610
|
-
}
|
|
20611
|
-
.details-table th,
|
|
20612
|
-
.details-table td {
|
|
20613
|
-
padding: 12px;
|
|
20614
|
-
text-align: left;
|
|
20615
|
-
border: 1px solid #ddd;
|
|
20616
|
-
}
|
|
20617
|
-
.details-table th {
|
|
20618
|
-
background: #f5f5f5;
|
|
20619
|
-
font-weight: bold;
|
|
20620
|
-
width: 40%;
|
|
20621
|
-
}
|
|
20622
|
-
.footer {
|
|
20623
|
-
text-align: center;
|
|
20624
|
-
font-size: 12px;
|
|
20625
|
-
color: #666;
|
|
20626
|
-
}
|
|
20627
|
-
@media print {
|
|
20628
|
-
body { background: white !important; }
|
|
20629
|
-
}
|
|
20630
|
-
</style>
|
|
20631
|
-
</head>
|
|
20632
|
-
<body>
|
|
20633
|
-
<div class="acknowledgement-container">
|
|
20634
|
-
<div class="header">
|
|
20635
|
-
<div>
|
|
20636
|
-
<img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/${petData === null || petData === void 0 ? void 0 : petData.tenantId}/logo.png"
|
|
20637
|
-
style="width: 110px; height: 110px; padding-left: 20px; padding-bottom: 20px;" />
|
|
20638
|
-
</div>
|
|
20639
|
-
<div class="header-center">
|
|
20640
|
-
<div class="title">${t(ulbType)} ${t(ulb)}</div>
|
|
20641
|
-
<div class="subtitle">${t("Veterinary Services- Health Branch")}</div>
|
|
20642
|
-
<div class="pet-sub">Pet Registration Acknowledgment</div>
|
|
20643
|
-
<div class="subtitle">(U/S 399 (1)(E) of PMC Act,1976)</div>
|
|
20644
|
-
</div>
|
|
20645
|
-
<div class="header-right">
|
|
20646
|
-
</div>
|
|
20647
|
-
</div>
|
|
20648
|
-
|
|
20649
|
-
<div class="acknowledgement-text">
|
|
20650
|
-
${t("PTR_ACKN_TERM_1")}
|
|
20651
|
-
</div>
|
|
20652
|
-
|
|
20653
|
-
<table class="details-table">
|
|
20654
|
-
<tr>
|
|
20655
|
-
<th>Application Number</th>
|
|
20656
|
-
<td>${(petData === null || petData === void 0 ? void 0 : petData.applicationNumber) || "Not Available"}</td>
|
|
20657
|
-
</tr>
|
|
20658
|
-
<tr>
|
|
20659
|
-
<th>Application Date</th>
|
|
20660
|
-
<td>${currentDate}</td>
|
|
20661
|
-
</tr>
|
|
20662
|
-
<tr>
|
|
20663
|
-
<th>Pet Name</th>
|
|
20664
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails8 = petData.petDetails) === null || _petData$petDetails8 === void 0 ? void 0 : _petData$petDetails8.petName) || "Not Specified"}</td>
|
|
20665
|
-
</tr>
|
|
20666
|
-
<tr>
|
|
20667
|
-
<th>Pet Type</th>
|
|
20668
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails9 = petData.petDetails) === null || _petData$petDetails9 === void 0 ? void 0 : _petData$petDetails9.petType) || "Not Specified"}</td>
|
|
20669
|
-
</tr>
|
|
20670
|
-
<tr>
|
|
20671
|
-
<th>Breed</th>
|
|
20672
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails0 = petData.petDetails) === null || _petData$petDetails0 === void 0 ? void 0 : _petData$petDetails0.breedType) || "Not Specified"}</td>
|
|
20673
|
-
</tr>
|
|
20674
|
-
<tr>
|
|
20675
|
-
<th>Owner Name</th>
|
|
20676
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$owner5 = petData.owner) === null || _petData$owner5 === void 0 ? void 0 : _petData$owner5.name) || "Not Specified"}</td>
|
|
20677
|
-
</tr>
|
|
20678
|
-
<tr>
|
|
20679
|
-
<th>Contact Number</th>
|
|
20680
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$owner6 = petData.owner) === null || _petData$owner6 === void 0 ? void 0 : _petData$owner6.mobileNumber) || "Not Specified"}</td>
|
|
20681
|
-
</tr>
|
|
20682
|
-
<tr>
|
|
20683
|
-
<th>Email</th>
|
|
20684
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$owner7 = petData.owner) === null || _petData$owner7 === void 0 ? void 0 : _petData$owner7.emailId) || "Not Specified"}</td>
|
|
20685
|
-
</tr>
|
|
20686
|
-
<tr>
|
|
20687
|
-
<th>Application Status</th>
|
|
20688
|
-
<td style="color: #28a745; font-weight: bold;">${t(petData === null || petData === void 0 ? void 0 : petData.status) || "SUBMITTED"}</td>
|
|
20689
|
-
</tr>
|
|
20690
|
-
</table>
|
|
20691
|
-
|
|
20692
|
-
<div class="acknowledgement-text">
|
|
20693
|
-
${t("PTR_ACKN_TERM_2")}
|
|
20694
|
-
</div>
|
|
20695
|
-
|
|
20696
|
-
|
|
20697
|
-
<div class="footer">
|
|
20698
|
-
<p>Generated on: ${currentDate}</p>
|
|
20699
|
-
<p>${t(ulbType)}</p>
|
|
20700
|
-
<p>This is a computer-generated document and does not require a signature.</p>
|
|
20701
|
-
<p>https://mseva.lgpunjab.gov.in/digit-ui/citizen/ptr-home</p>
|
|
20702
|
-
</div>
|
|
20703
|
-
</div>
|
|
20704
|
-
</body>
|
|
20705
|
-
</html>
|
|
20706
|
-
`;
|
|
20707
|
-
const printWindow = window.open("", "_blank");
|
|
20708
|
-
printWindow.document.write(content);
|
|
20709
|
-
printWindow.document.close();
|
|
20710
|
-
printWindow.onload = () => {
|
|
20711
|
-
setTimeout(() => {
|
|
20712
|
-
printWindow.print();
|
|
20713
|
-
printWindow.onafterprint = () => {
|
|
20714
|
-
printWindow.close();
|
|
20715
|
-
};
|
|
20716
|
-
}, 500);
|
|
20717
|
-
};
|
|
20718
|
-
};
|
|
20719
|
-
createAcknowledgementHTML();
|
|
20720
|
-
setShowToast({
|
|
20721
|
-
key: false,
|
|
20722
|
-
label: "PTR_ACKNOWLEDGEMENT_DOWNLOADED_SUCCESSFULLY"
|
|
20723
|
-
});
|
|
20724
|
-
} catch (error) {
|
|
20725
|
-
setShowToast({
|
|
20726
|
-
key: true,
|
|
20727
|
-
label: `PTR_ACKNOWLEDGEMENT_DOWNLOAD_ERROR: ${error.message}`
|
|
20728
|
-
});
|
|
20729
|
-
}
|
|
20730
|
-
};
|
|
20731
20171
|
let documentDate = t("CS_NA");
|
|
20732
20172
|
if (pet_details !== null && pet_details !== void 0 && (_pet_details$addition = pet_details.additionalDetails) !== null && _pet_details$addition !== void 0 && _pet_details$addition.documentDate) {
|
|
20733
20173
|
var _pet_details$addition2;
|
|
@@ -20738,17 +20178,22 @@ const PTRApplicationDetails = () => {
|
|
|
20738
20178
|
async function getRecieptSearch({
|
|
20739
20179
|
tenantId,
|
|
20740
20180
|
payments,
|
|
20181
|
+
pdfkey,
|
|
20741
20182
|
...params
|
|
20742
20183
|
}) {
|
|
20743
|
-
var _response;
|
|
20184
|
+
var _application$petDetai, _response;
|
|
20185
|
+
const petAge = formatPetAge(application === null || application === void 0 ? void 0 : (_application$petDetai = application.petDetails) === null || _application$petDetai === void 0 ? void 0 : _application$petDetai.petAge, t);
|
|
20744
20186
|
let response = {
|
|
20745
20187
|
filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
|
|
20746
20188
|
};
|
|
20747
20189
|
response = await Digit.PaymentService.generatePdf(tenantId, {
|
|
20748
20190
|
Payments: [{
|
|
20749
|
-
...payments
|
|
20191
|
+
...payments,
|
|
20192
|
+
application,
|
|
20193
|
+
approver,
|
|
20194
|
+
petAge
|
|
20750
20195
|
}]
|
|
20751
|
-
},
|
|
20196
|
+
}, pdfkey);
|
|
20752
20197
|
const fileStore = await Digit.PaymentService.printReciept(tenantId, {
|
|
20753
20198
|
fileStoreIds: response.filestoreIds[0]
|
|
20754
20199
|
});
|
|
@@ -20757,27 +20202,40 @@ const PTRApplicationDetails = () => {
|
|
|
20757
20202
|
const dowloadOptions = [];
|
|
20758
20203
|
dowloadOptions.push({
|
|
20759
20204
|
label: t("PTR_PET_DOWNLOAD_ACK_FORM"),
|
|
20760
|
-
onClick: () =>
|
|
20205
|
+
onClick: () => {
|
|
20206
|
+
var _reciept_data$Payment;
|
|
20207
|
+
return getRecieptSearch({
|
|
20208
|
+
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment = reciept_data.Payments[0]) === null || _reciept_data$Payment === void 0 ? void 0 : _reciept_data$Payment.tenantId,
|
|
20209
|
+
payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0],
|
|
20210
|
+
pdfkey: "petacknowledgement"
|
|
20211
|
+
});
|
|
20212
|
+
}
|
|
20761
20213
|
});
|
|
20762
|
-
if ((reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$
|
|
20214
|
+
if ((reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment2 = reciept_data.Payments[0]) === null || _reciept_data$Payment2 === void 0 ? void 0 : _reciept_data$Payment2.paymentStatus) === "NEW" || (reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment3 = reciept_data.Payments[0]) === null || _reciept_data$Payment3 === void 0 ? void 0 : _reciept_data$Payment3.paymentStatus) === "DEPOSITED") {
|
|
20763
20215
|
dowloadOptions.push({
|
|
20764
20216
|
label: t("PTR_CERTIFICATE"),
|
|
20765
20217
|
onClick: () => {
|
|
20766
|
-
|
|
20218
|
+
var _reciept_data$Payment4;
|
|
20219
|
+
return getRecieptSearch({
|
|
20220
|
+
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment4 = reciept_data.Payments[0]) === null || _reciept_data$Payment4 === void 0 ? void 0 : _reciept_data$Payment4.tenantId,
|
|
20221
|
+
payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0],
|
|
20222
|
+
pdfkey: "petcertificatenew"
|
|
20223
|
+
});
|
|
20767
20224
|
}
|
|
20768
20225
|
});
|
|
20769
20226
|
} else {
|
|
20770
|
-
var _reciept_data$
|
|
20771
|
-
console.log("Certificate not available. Payment status:", reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$
|
|
20227
|
+
var _reciept_data$Payment5;
|
|
20228
|
+
console.log("Certificate not available. Payment status:", reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment5 = reciept_data.Payments[0]) === null || _reciept_data$Payment5 === void 0 ? void 0 : _reciept_data$Payment5.paymentStatus);
|
|
20772
20229
|
}
|
|
20773
20230
|
if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
|
|
20774
20231
|
dowloadOptions.push({
|
|
20775
20232
|
label: t("PTR_FEE_RECIEPT"),
|
|
20776
20233
|
onClick: () => {
|
|
20777
|
-
var _reciept_data$
|
|
20234
|
+
var _reciept_data$Payment6;
|
|
20778
20235
|
return getRecieptSearch({
|
|
20779
|
-
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$
|
|
20780
|
-
payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
|
|
20236
|
+
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment6 = reciept_data.Payments[0]) === null || _reciept_data$Payment6 === void 0 ? void 0 : _reciept_data$Payment6.tenantId,
|
|
20237
|
+
payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0],
|
|
20238
|
+
pdfkey: "petservice-receipt"
|
|
20781
20239
|
});
|
|
20782
20240
|
}
|
|
20783
20241
|
});
|
|
@@ -20864,7 +20322,7 @@ const PTRApplicationDetails = () => {
|
|
|
20864
20322
|
}, t("WS_COMMON_TABLE_COL_ADDRESS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
|
|
20865
20323
|
className: "border-none",
|
|
20866
20324
|
label: t("PTR_ADDRESS"),
|
|
20867
|
-
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address = pet_details.address) === null || _pet_details$address === void 0 ? void 0 : _pet_details$address.
|
|
20325
|
+
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address = pet_details.address) === null || _pet_details$address === void 0 ? void 0 : _pet_details$address.addressLine1) || t("CS_NA")
|
|
20868
20326
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
20869
20327
|
className: "border-none",
|
|
20870
20328
|
label: t("PTR_PINCODE"),
|
|
@@ -22675,7 +22133,7 @@ const NewApplication = () => {
|
|
|
22675
22133
|
};
|
|
22676
22134
|
|
|
22677
22135
|
const ApplicationDetails = () => {
|
|
22678
|
-
var
|
|
22136
|
+
var _pet_details$addition, _user$info, _reciept_data$Payment2, _reciept_data$Payment3, _pet_details$owner, _pet_details$owner2, _pet_details$owner3, _pet_details$owner4, _pet_details$owner5, _pet_details$address, _pet_details$address2, _pet_details$petDetai, _pet_details$petDetai2, _pet_details$petDetai3, _pet_details$petDetai4, _pet_details$petDetai5, _pet_details$petDetai6, _pet_details$petDetai8, _pet_details$petDetai9, _pet_details$petDetai0;
|
|
22679
22137
|
const {
|
|
22680
22138
|
t
|
|
22681
22139
|
} = useTranslation();
|
|
@@ -22714,8 +22172,6 @@ const ApplicationDetails = () => {
|
|
|
22714
22172
|
const [billData, setBillData] = useState(null);
|
|
22715
22173
|
const PetRegistrationApplications = get_1(data, "PetRegistrationApplications", []);
|
|
22716
22174
|
const petId = get_1(data, "PetRegistrationApplications[0].applicationNumber", []);
|
|
22717
|
-
const ulb = tenantInfo === null || tenantInfo === void 0 ? void 0 : (_tenantInfo$city = tenantInfo.city) === null || _tenantInfo$city === void 0 ? void 0 : _tenantInfo$city.name;
|
|
22718
|
-
const ulbType = tenantInfo === null || tenantInfo === void 0 ? void 0 : (_tenantInfo$city2 = tenantInfo.city) === null || _tenantInfo$city2 === void 0 ? void 0 : _tenantInfo$city2.ulbType;
|
|
22719
22175
|
let pet_details = PetRegistrationApplications && PetRegistrationApplications.length > 0 && PetRegistrationApplications[0] || {};
|
|
22720
22176
|
const application = pet_details;
|
|
22721
22177
|
sessionStorage.setItem("ptr-pet", JSON.stringify(application));
|
|
@@ -22789,581 +22245,6 @@ const ApplicationDetails = () => {
|
|
|
22789
22245
|
if (isLoading || auditDataLoading) {
|
|
22790
22246
|
return /*#__PURE__*/React.createElement(Loader$1, null);
|
|
22791
22247
|
}
|
|
22792
|
-
const printCertificate = async () => {
|
|
22793
|
-
const qrDataURL = await browser.toDataURL(window.location.href);
|
|
22794
|
-
try {
|
|
22795
|
-
var _data$PetRegistration;
|
|
22796
|
-
if (!(data !== null && data !== void 0 && (_data$PetRegistration = data.PetRegistrationApplications) !== null && _data$PetRegistration !== void 0 && _data$PetRegistration[0])) {
|
|
22797
|
-
throw new Error("Pet registration data is missing");
|
|
22798
|
-
}
|
|
22799
|
-
const createCertificateHTML = () => {
|
|
22800
|
-
var _petData$documents, _petData$petDetails, _petData$owner, _petData$address, _petData$address2, _petData$owner2, _petData$petDetails2, _petData$petDetails3, _petData$petDetails4, _petData$petDetails5, _petData$petDetails6, _petData$petDetails7, _petData$auditDetails, _petData$auditDetails2, _reciept_data$Payment, _reciept_data$Payment2, _reciept_data$Payment3, _reciept_data$Payment4, _reciept_data$Payment5, _reciept_data$Payment6, _petData$owner3, _petData$owner4, _petData$address3, _petData$address4;
|
|
22801
|
-
const petData = data.PetRegistrationApplications[0];
|
|
22802
|
-
const currentDate = new Date().toLocaleDateString("en-IN", {
|
|
22803
|
-
day: "2-digit",
|
|
22804
|
-
month: "2-digit",
|
|
22805
|
-
year: "numeric"
|
|
22806
|
-
});
|
|
22807
|
-
const petImage = petData === null || petData === void 0 ? void 0 : (_petData$documents = petData.documents) === null || _petData$documents === void 0 ? void 0 : _petData$documents.find(doc => (doc === null || doc === void 0 ? void 0 : doc.documentType) === "PET.PETPHOTO");
|
|
22808
|
-
const petImageUrl = petImage !== null && petImage !== void 0 && petImage.filestoreId ? `${window.location.origin}/filestore/v1/files/id?tenantId=pb&fileStoreId=${petImage.filestoreId}` : `${window.location.origin}/adorable-golden-retriever.png`;
|
|
22809
|
-
const content = `
|
|
22810
|
-
<html>
|
|
22811
|
-
<head>
|
|
22812
|
-
<title>Pet Registration Certificate</title>
|
|
22813
|
-
<style>
|
|
22814
|
-
@page { margin: 0.5in; }
|
|
22815
|
-
body {
|
|
22816
|
-
font-family: 'Times New Roman', serif;
|
|
22817
|
-
margin: 0;
|
|
22818
|
-
font-size: 11px;
|
|
22819
|
-
}
|
|
22820
|
-
.certificate-container {
|
|
22821
|
-
max-width: 800px;
|
|
22822
|
-
margin: 0 auto;
|
|
22823
|
-
border: 3px solid #000;
|
|
22824
|
-
background: white;
|
|
22825
|
-
}
|
|
22826
|
-
.header {
|
|
22827
|
-
display: flex;
|
|
22828
|
-
justify-content: space-between;
|
|
22829
|
-
align-items: center;
|
|
22830
|
-
text-align: center;
|
|
22831
|
-
margin-bottom: 5px;
|
|
22832
|
-
position: relative;
|
|
22833
|
-
}
|
|
22834
|
-
.header-value{
|
|
22835
|
-
border: none;
|
|
22836
|
-
display: flex;
|
|
22837
|
-
text-align: center;
|
|
22838
|
-
}
|
|
22839
|
-
.header-center {
|
|
22840
|
-
text-align: center;
|
|
22841
|
-
flex: 1;
|
|
22842
|
-
padding-right: 80px
|
|
22843
|
-
}
|
|
22844
|
-
.header-disclaimer {
|
|
22845
|
-
text-align: center;
|
|
22846
|
-
flex: 1;
|
|
22847
|
-
}
|
|
22848
|
-
.header-right {
|
|
22849
|
-
flex: 0 0 auto;
|
|
22850
|
-
}
|
|
22851
|
-
.title {
|
|
22852
|
-
font-size: 13px;
|
|
22853
|
-
font-weight: bold;
|
|
22854
|
-
margin: 10px 0;
|
|
22855
|
-
}
|
|
22856
|
-
.subtitle {
|
|
22857
|
-
font-size: 10px;
|
|
22858
|
-
color: #666;
|
|
22859
|
-
}
|
|
22860
|
-
.main-content {
|
|
22861
|
-
display: flex;
|
|
22862
|
-
gap: 10px;
|
|
22863
|
-
margin: 10px 0;
|
|
22864
|
-
align-items:flex-start;
|
|
22865
|
-
margin-bottom: -13px;
|
|
22866
|
-
}
|
|
22867
|
-
.details-section {
|
|
22868
|
-
}
|
|
22869
|
-
.pet-image-section {
|
|
22870
|
-
flex-shrink: 0;
|
|
22871
|
-
text-align: center;
|
|
22872
|
-
order: 2;
|
|
22873
|
-
}
|
|
22874
|
-
.pet-image {
|
|
22875
|
-
width: 100px;
|
|
22876
|
-
max-width: 100%;
|
|
22877
|
-
aspect-ratio : 1 / 1;
|
|
22878
|
-
height: auto;
|
|
22879
|
-
border: 2px solid #000;
|
|
22880
|
-
object-fit: cover;
|
|
22881
|
-
margin-bottom: 10px;
|
|
22882
|
-
border-right-width: 2px;
|
|
22883
|
-
margin-right: 50px;
|
|
22884
|
-
margin-top: 20px;
|
|
22885
|
-
display: block;
|
|
22886
|
-
}
|
|
22887
|
-
.image-label {
|
|
22888
|
-
font-size: 12px;
|
|
22889
|
-
font-weight: bold;
|
|
22890
|
-
text-align: center;
|
|
22891
|
-
border-right-width: 30px;
|
|
22892
|
-
margin-right: 50px;
|
|
22893
|
-
}
|
|
22894
|
-
.details-grid {
|
|
22895
|
-
display: grid;
|
|
22896
|
-
grid-template-columns: 290px 280px;
|
|
22897
|
-
overflow: hidden;
|
|
22898
|
-
margin: 10px 0;
|
|
22899
|
-
margin-left : 40px;
|
|
22900
|
-
}
|
|
22901
|
-
.detail-row {
|
|
22902
|
-
display: grid;
|
|
22903
|
-
grid-template-columns: 140px 180px;
|
|
22904
|
-
overflow:hidden;
|
|
22905
|
-
border: 1px solid black;
|
|
22906
|
-
}
|
|
22907
|
-
.detail-label {
|
|
22908
|
-
font-weight: bold;
|
|
22909
|
-
white-space: normal;
|
|
22910
|
-
word-break: break-word;
|
|
22911
|
-
margin-left: 10px;
|
|
22912
|
-
flex-shrink: 1;
|
|
22913
|
-
}
|
|
22914
|
-
.detail-value {
|
|
22915
|
-
padding-bottom: 2px;
|
|
22916
|
-
margin-right: 10px;
|
|
22917
|
-
}
|
|
22918
|
-
.owner-section {
|
|
22919
|
-
margin: 5px 40px;
|
|
22920
|
-
margin-bottom: 0px;
|
|
22921
|
-
display: grid;
|
|
22922
|
-
grid-template-columns: 50%;
|
|
22923
|
-
}
|
|
22924
|
-
.footer-section {
|
|
22925
|
-
margin: 0px 40px;
|
|
22926
|
-
display: flex;
|
|
22927
|
-
justify-content: space-between;
|
|
22928
|
-
align-items: anchor-center;
|
|
22929
|
-
}
|
|
22930
|
-
.signature-area {
|
|
22931
|
-
text-align: center;
|
|
22932
|
-
min-width: 200px;
|
|
22933
|
-
}
|
|
22934
|
-
.signature-line {
|
|
22935
|
-
border-top: 1px solid #000;
|
|
22936
|
-
margin: 10px 0 5px 0;
|
|
22937
|
-
}
|
|
22938
|
-
.pet-sub {
|
|
22939
|
-
font-size: 10px;
|
|
22940
|
-
margin: 5px 0;
|
|
22941
|
-
color: #666;
|
|
22942
|
-
font-weight: bold;
|
|
22943
|
-
}
|
|
22944
|
-
.terms-section {
|
|
22945
|
-
border-top: 2px solid #000;
|
|
22946
|
-
padding-top: 5px;
|
|
22947
|
-
font-size: 11px;
|
|
22948
|
-
margin: 0px 10px;
|
|
22949
|
-
}
|
|
22950
|
-
.terms-title {
|
|
22951
|
-
font-weight: bold;
|
|
22952
|
-
margin-bottom: 10px;
|
|
22953
|
-
}
|
|
22954
|
-
.terms-list {
|
|
22955
|
-
margin: 0;
|
|
22956
|
-
padding-left: 20px;
|
|
22957
|
-
}
|
|
22958
|
-
.terms-list li {
|
|
22959
|
-
margin-bottom: 2px;
|
|
22960
|
-
text-align: left;
|
|
22961
|
-
}
|
|
22962
|
-
@media print {
|
|
22963
|
-
body { background: white !important; }
|
|
22964
|
-
}
|
|
22965
|
-
@media (max-width: 700px) {
|
|
22966
|
-
.main-content {
|
|
22967
|
-
flex-wrap: wrap;
|
|
22968
|
-
}
|
|
22969
|
-
.pet-image {
|
|
22970
|
-
width: 100px;
|
|
22971
|
-
max-width: 100%;
|
|
22972
|
-
height: auto;
|
|
22973
|
-
aspect-ratio: 1/1;
|
|
22974
|
-
}
|
|
22975
|
-
.dis-section{
|
|
22976
|
-
font-size: 12px;
|
|
22977
|
-
margin: 0px 10px;
|
|
22978
|
-
}
|
|
22979
|
-
}
|
|
22980
|
-
</style>
|
|
22981
|
-
</head>
|
|
22982
|
-
<body>
|
|
22983
|
-
<div class="certificate-container">
|
|
22984
|
-
<div class="header">
|
|
22985
|
-
<div>
|
|
22986
|
-
<img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/${petData === null || petData === void 0 ? void 0 : petData.tenantId}/logo.png"
|
|
22987
|
-
style="width: 80px; height: 80px; padding-left: 20px; padding-top: 5px;" />
|
|
22988
|
-
</div>
|
|
22989
|
-
<div class="header-center">
|
|
22990
|
-
<div class="title">${t(ulbType)} ${t(ulb)}</div>
|
|
22991
|
-
<div class="subtitle">${t("Veterinary Services- Health Branch")}</div>
|
|
22992
|
-
<div class="pet-sub">Pet Registration Certificate</div>
|
|
22993
|
-
<div class="subtitle">(U/S 399 (1)(E) of PMC Act,1976)</div>
|
|
22994
|
-
</div>
|
|
22995
|
-
<div class="header-right">
|
|
22996
|
-
</div>
|
|
22997
|
-
</div>
|
|
22998
|
-
<span class="header-value">This is to certify that the ${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails = petData.petDetails) === null || _petData$petDetails === void 0 ? void 0 : _petData$petDetails.petType) || "Dog"} kept by Mr./Mrs./Ms. ${(petData === null || petData === void 0 ? void 0 : (_petData$owner = petData.owner) === null || _petData$owner === void 0 ? void 0 : _petData$owner.name) || "Not Specified"} at ${(petData === null || petData === void 0 ? void 0 : (_petData$address = petData.address) === null || _petData$address === void 0 ? void 0 : _petData$address.addressId) || "Not Specified"}, ${(petData === null || petData === void 0 ? void 0 : (_petData$address2 = petData.address) === null || _petData$address2 === void 0 ? void 0 : _petData$address2.pincode) || ""} mobile no. ${(petData === null || petData === void 0 ? void 0 : (_petData$owner2 = petData.owner) === null || _petData$owner2 === void 0 ? void 0 : _petData$owner2.mobileNumber) || "Not Specified"} is registered with ${ulbType} ${ulb} as per following details:</span>
|
|
22999
|
-
<div class="main-content">
|
|
23000
|
-
<div class="details-section">
|
|
23001
|
-
<span class="detail-label">Pet Information</span> <br>
|
|
23002
|
-
<span class="detail-label">Registration No:</span> <span class="detail-label">${(petData === null || petData === void 0 ? void 0 : petData.petRegistrationNumber) || ""}</span>
|
|
23003
|
-
<div class="details-grid">
|
|
23004
|
-
<div class="detail-row">
|
|
23005
|
-
<span class="detail-label">Category</span>
|
|
23006
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails2 = petData.petDetails) === null || _petData$petDetails2 === void 0 ? void 0 : _petData$petDetails2.petType) || "Dog"}</span>
|
|
23007
|
-
</div>
|
|
23008
|
-
<div class="detail-row">
|
|
23009
|
-
<span class="detail-label">Breed</span>
|
|
23010
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails3 = petData.petDetails) === null || _petData$petDetails3 === void 0 ? void 0 : _petData$petDetails3.breedType) || "Not Specified"}</span>
|
|
23011
|
-
</div>
|
|
23012
|
-
<div class="detail-row">
|
|
23013
|
-
<span class="detail-label">Name of Animal</span>
|
|
23014
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails4 = petData.petDetails) === null || _petData$petDetails4 === void 0 ? void 0 : _petData$petDetails4.petName) || "Not Specified"}</span>
|
|
23015
|
-
</div>
|
|
23016
|
-
<div class="detail-row">
|
|
23017
|
-
<span class="detail-label">Gender</span>
|
|
23018
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails5 = petData.petDetails) === null || _petData$petDetails5 === void 0 ? void 0 : _petData$petDetails5.petGender) || "Not Specified"}</span>
|
|
23019
|
-
</div>
|
|
23020
|
-
<div class="detail-row">
|
|
23021
|
-
<span class="detail-label">Pet Age</span>
|
|
23022
|
-
<span class="detail-value">${formatPetAge(petData === null || petData === void 0 ? void 0 : (_petData$petDetails6 = petData.petDetails) === null || _petData$petDetails6 === void 0 ? void 0 : _petData$petDetails6.petAge, t) || t("CS_NA")}</span>
|
|
23023
|
-
</div>
|
|
23024
|
-
<div class="detail-row">
|
|
23025
|
-
<span class="detail-label">Colour</span>
|
|
23026
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails7 = petData.petDetails) === null || _petData$petDetails7 === void 0 ? void 0 : _petData$petDetails7.petColor) || "Not Specified"}</span>
|
|
23027
|
-
</div>
|
|
23028
|
-
<div class="detail-row">
|
|
23029
|
-
<span class="detail-label">Application Number</span>
|
|
23030
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.applicationNumber) || "Not Specified"}</span>
|
|
23031
|
-
</div>
|
|
23032
|
-
<div class="detail-row">
|
|
23033
|
-
<span class="detail-label">Token No</span>
|
|
23034
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.petToken) || "Not Specified"}</span>
|
|
23035
|
-
</div>
|
|
23036
|
-
<div class="detail-row">
|
|
23037
|
-
<span class="detail-label">Issue Date</span>
|
|
23038
|
-
<span class="detail-value">
|
|
23039
|
-
${petData !== null && petData !== void 0 && (_petData$auditDetails = petData.auditDetails) !== null && _petData$auditDetails !== void 0 && _petData$auditDetails.lastModifiedTime ? new Date((_petData$auditDetails2 = petData.auditDetails) === null || _petData$auditDetails2 === void 0 ? void 0 : _petData$auditDetails2.lastModifiedTime).toLocaleDateString("en-GB") : "N/A"}
|
|
23040
|
-
</span>
|
|
23041
|
-
</div>
|
|
23042
|
-
|
|
23043
|
-
<div class="detail-row">
|
|
23044
|
-
<span class="detail-label">License Valid Upto</span>
|
|
23045
|
-
<span class="detail-value">
|
|
23046
|
-
${petData !== null && petData !== void 0 && petData.validityDate ? new Date(petData.validityDate * 1000).toLocaleDateString("en-GB") : "N/A"}
|
|
23047
|
-
|
|
23048
|
-
</span>
|
|
23049
|
-
</div>
|
|
23050
|
-
<div class="detail-row">
|
|
23051
|
-
<span class="detail-label">Amount</span>
|
|
23052
|
-
<span class="detail-value">Rs. ${(reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment = reciept_data.Payments) === null || _reciept_data$Payment === void 0 ? void 0 : (_reciept_data$Payment2 = _reciept_data$Payment[0]) === null || _reciept_data$Payment2 === void 0 ? void 0 : _reciept_data$Payment2.totalAmountPaid) || "Not Specified"}/-</span>
|
|
23053
|
-
</div>
|
|
23054
|
-
<div class="detail-row">
|
|
23055
|
-
<span class="detail-label">G8/Receipt No</span>
|
|
23056
|
-
<span class="detail-value">${(reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment3 = reciept_data.Payments) === null || _reciept_data$Payment3 === void 0 ? void 0 : (_reciept_data$Payment4 = _reciept_data$Payment3[0]) === null || _reciept_data$Payment4 === void 0 ? void 0 : (_reciept_data$Payment5 = _reciept_data$Payment4.paymentDetails) === null || _reciept_data$Payment5 === void 0 ? void 0 : (_reciept_data$Payment6 = _reciept_data$Payment5[0]) === null || _reciept_data$Payment6 === void 0 ? void 0 : _reciept_data$Payment6.receiptNumber) || "Not Specified"}</span>
|
|
23057
|
-
</div>
|
|
23058
|
-
</div>
|
|
23059
|
-
</div>
|
|
23060
|
-
|
|
23061
|
-
<div class="pet-image-section">
|
|
23062
|
-
<img
|
|
23063
|
-
src="${petImageUrl}"
|
|
23064
|
-
alt="Pet Photo"
|
|
23065
|
-
class="pet-image"
|
|
23066
|
-
onload="console.log('Pet image loaded successfully:', this.src);"
|
|
23067
|
-
onerror="console.log('Pet image failed to load:', this.src); console.log('Trying fallback image...'); this.src='/adorable-golden-retriever.png';"
|
|
23068
|
-
/>
|
|
23069
|
-
<div class="image-label">Pet Photo</div>
|
|
23070
|
-
<script>
|
|
23071
|
-
console.log('Image URL being used:', '${petImageUrl}');
|
|
23072
|
-
console.log('Pet image data:', ${JSON.stringify(petImage)});
|
|
23073
|
-
</script>
|
|
23074
|
-
</div>
|
|
23075
|
-
</div>
|
|
23076
|
-
|
|
23077
|
-
<span class="detail-label">Owner Information</span>
|
|
23078
|
-
<div class="owner-section">
|
|
23079
|
-
<div class="detail-row">
|
|
23080
|
-
<span class="detail-label">Owner Name</span>
|
|
23081
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$owner3 = petData.owner) === null || _petData$owner3 === void 0 ? void 0 : _petData$owner3.name) || "Not Specified"}</span>
|
|
23082
|
-
</div>
|
|
23083
|
-
<div class="detail-row">
|
|
23084
|
-
<span class="detail-label">Father/Spouse Name</span>
|
|
23085
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.fatherName) || (petData === null || petData === void 0 ? void 0 : (_petData$owner4 = petData.owner) === null || _petData$owner4 === void 0 ? void 0 : _petData$owner4.fatherOrHusbandName) || "Not Specified"}</span>
|
|
23086
|
-
</div>
|
|
23087
|
-
<div class="detail-row">
|
|
23088
|
-
<span class="detail-label">Address</span>
|
|
23089
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : (_petData$address3 = petData.address) === null || _petData$address3 === void 0 ? void 0 : _petData$address3.addressId) || "Not Specified"}, ${(petData === null || petData === void 0 ? void 0 : (_petData$address4 = petData.address) === null || _petData$address4 === void 0 ? void 0 : _petData$address4.pincode) || ""}</span>
|
|
23090
|
-
</div>
|
|
23091
|
-
</div>
|
|
23092
|
-
|
|
23093
|
-
<div class="header">
|
|
23094
|
-
<div class="header-left"> </div>
|
|
23095
|
-
<div class="header-disclaimer">
|
|
23096
|
-
<div class="title">DISCLAIMER</div>
|
|
23097
|
-
<div class="dis-section">${t("PET_DISCLAIMER")}</div>
|
|
23098
|
-
<div class="header-right"></div>
|
|
23099
|
-
</div>
|
|
23100
|
-
</div>
|
|
23101
|
-
|
|
23102
|
-
<div class="footer-section">
|
|
23103
|
-
<div>
|
|
23104
|
-
<div>Date:........................</div>
|
|
23105
|
-
<div>Place:.......................</div>
|
|
23106
|
-
</div>
|
|
23107
|
-
<div class="signature-area">
|
|
23108
|
-
<div class="detail-label">Approved by</div>
|
|
23109
|
-
<span class="detail-value">${approver || "Not Specified"}</span>
|
|
23110
|
-
<div class="signature-line"></div>
|
|
23111
|
-
<div>Licensing Authority</div>
|
|
23112
|
-
<div>${t(ulbType)}</div>
|
|
23113
|
-
|
|
23114
|
-
</div>
|
|
23115
|
-
</div>
|
|
23116
|
-
|
|
23117
|
-
<div class="terms-section">
|
|
23118
|
-
<div class="terms-title">${t("TERMS AND CONDITIONS")}</div>
|
|
23119
|
-
<div class="terms-title">${t("PET_TERMS_HEADER")}</div>
|
|
23120
|
-
<ol class="terms-list">
|
|
23121
|
-
<li>${t("PET_TERM1A")} <strong> ${(petData === null || petData === void 0 ? void 0 : petData.petRegistrationNumber) || ""} </strong> ${t("PET_TERM1B")} <strong>'https://mseva.lgpunjab.gov.in/digit-ui/citizen/ptr-home'</strong></li>
|
|
23122
|
-
<li>${t("PET_NEW_TERM_2")}</li>
|
|
23123
|
-
<li>${t("PET_NEW_TERM_3")}</li>
|
|
23124
|
-
<li>${t("PET_NEW_TERM_4")}</li>
|
|
23125
|
-
<li>${t("PET_NEW_TERM_5")}</li>
|
|
23126
|
-
<li>${t("PET_NEW_TERM_6")}</li>
|
|
23127
|
-
<li>${t("PET_NEW_TERM_7")}</li>
|
|
23128
|
-
<li>${t("PET_NEW_TERM_8")}</li>
|
|
23129
|
-
<li>${t("PET_NEW_TERM_9")}</li>
|
|
23130
|
-
<li>${t("PET_NEW_TERM_10")}</li>
|
|
23131
|
-
<li>${t("PET_NEW_TERM_11")}</li>
|
|
23132
|
-
<li>${t("PET_NEW_TERM_12")}</li>
|
|
23133
|
-
<li>${t("PET_NEW_TERM_13")}</li>
|
|
23134
|
-
<li>${t("PET_NEW_TERM_14")}</li>
|
|
23135
|
-
<li>${t("PET_NEW_TERM_15")}</li>
|
|
23136
|
-
<li>${t("PET_NEW_TERM_16")}</li>
|
|
23137
|
-
</ol>
|
|
23138
|
-
|
|
23139
|
-
<div style="text-align: center;">
|
|
23140
|
-
<img src="${qrDataURL}" style="width: 100px; height: 100px;" />
|
|
23141
|
-
</div>
|
|
23142
|
-
</div>
|
|
23143
|
-
</div>
|
|
23144
|
-
</body>
|
|
23145
|
-
</html>
|
|
23146
|
-
`;
|
|
23147
|
-
const printWindow = window.open("", "_blank");
|
|
23148
|
-
printWindow.document.write(content);
|
|
23149
|
-
printWindow.document.close();
|
|
23150
|
-
printWindow.onload = () => {
|
|
23151
|
-
setTimeout(() => {
|
|
23152
|
-
printWindow.print();
|
|
23153
|
-
printWindow.onafterprint = () => {
|
|
23154
|
-
printWindow.close();
|
|
23155
|
-
};
|
|
23156
|
-
}, 500);
|
|
23157
|
-
};
|
|
23158
|
-
};
|
|
23159
|
-
createCertificateHTML();
|
|
23160
|
-
setShowToast({
|
|
23161
|
-
key: false,
|
|
23162
|
-
label: "PTR_CERTIFICATE_DOWNLOADED_SUCCESSFULLY"
|
|
23163
|
-
});
|
|
23164
|
-
} catch (error) {
|
|
23165
|
-
setShowToast({
|
|
23166
|
-
key: true,
|
|
23167
|
-
label: `PTR_CERTIFICATE_DOWNLOAD_ERROR: ${error.message}`
|
|
23168
|
-
});
|
|
23169
|
-
}
|
|
23170
|
-
};
|
|
23171
|
-
const downloadAcknowledgement = async () => {
|
|
23172
|
-
try {
|
|
23173
|
-
var _data$PetRegistration2;
|
|
23174
|
-
if (!(data !== null && data !== void 0 && (_data$PetRegistration2 = data.PetRegistrationApplications) !== null && _data$PetRegistration2 !== void 0 && _data$PetRegistration2[0])) {
|
|
23175
|
-
throw new Error("Pet registration data is missing");
|
|
23176
|
-
}
|
|
23177
|
-
const createAcknowledgementHTML = () => {
|
|
23178
|
-
var _petData$petDetails8, _petData$petDetails9, _petData$petDetails0, _petData$owner5, _petData$owner6, _petData$owner7;
|
|
23179
|
-
const petData = data.PetRegistrationApplications[0];
|
|
23180
|
-
const ulb = petData === null || petData === void 0 ? void 0 : petData.tenantId.split(".")[1];
|
|
23181
|
-
const currentDate = new Date().toLocaleDateString("en-IN", {
|
|
23182
|
-
day: "2-digit",
|
|
23183
|
-
month: "long",
|
|
23184
|
-
year: "numeric"
|
|
23185
|
-
});
|
|
23186
|
-
const content = `
|
|
23187
|
-
<html>
|
|
23188
|
-
<head>
|
|
23189
|
-
<title>Pet Registration Acknowledgement</title>
|
|
23190
|
-
<style>
|
|
23191
|
-
@page { margin: 0.5in; }
|
|
23192
|
-
body {
|
|
23193
|
-
font-family: 'Arial', sans-serif;
|
|
23194
|
-
margin: 0;
|
|
23195
|
-
padding: 20px;
|
|
23196
|
-
font-size: 14px;
|
|
23197
|
-
line-height: 1.6;
|
|
23198
|
-
}
|
|
23199
|
-
.acknowledgement-container {
|
|
23200
|
-
max-width: 800px;
|
|
23201
|
-
margin: 0 auto;
|
|
23202
|
-
border: 2px solid #333;
|
|
23203
|
-
padding: 30px;
|
|
23204
|
-
background: white;
|
|
23205
|
-
}
|
|
23206
|
-
.header {
|
|
23207
|
-
text-align: center;
|
|
23208
|
-
border-bottom: 2px solid #333;
|
|
23209
|
-
display: flex;
|
|
23210
|
-
justify-content: space-between;
|
|
23211
|
-
align-items: center;
|
|
23212
|
-
position: relative;
|
|
23213
|
-
}
|
|
23214
|
-
.header-center {
|
|
23215
|
-
text-align: center;
|
|
23216
|
-
flex: 1;
|
|
23217
|
-
padding-right: 80px
|
|
23218
|
-
}
|
|
23219
|
-
.header-right {
|
|
23220
|
-
flex: 0 0 auto;
|
|
23221
|
-
}
|
|
23222
|
-
.title {
|
|
23223
|
-
font-size: 20px;
|
|
23224
|
-
font-weight: bold;
|
|
23225
|
-
margin: 10px 0;
|
|
23226
|
-
color: #333;
|
|
23227
|
-
}
|
|
23228
|
-
.subtitle {
|
|
23229
|
-
font-size: 16px;
|
|
23230
|
-
margin: 5px 0;
|
|
23231
|
-
color: #666;
|
|
23232
|
-
}
|
|
23233
|
-
.pet-sub {
|
|
23234
|
-
font-size: 16px;
|
|
23235
|
-
margin: 5px 0;
|
|
23236
|
-
color: #666;
|
|
23237
|
-
font-weight: bold;
|
|
23238
|
-
}
|
|
23239
|
-
.acknowledgement-text {
|
|
23240
|
-
text-align: justify;
|
|
23241
|
-
font-size: 15px;
|
|
23242
|
-
}
|
|
23243
|
-
.details-table {
|
|
23244
|
-
width: 100%;
|
|
23245
|
-
border-collapse: collapse;
|
|
23246
|
-
}
|
|
23247
|
-
.details-table th,
|
|
23248
|
-
.details-table td {
|
|
23249
|
-
padding: 12px;
|
|
23250
|
-
text-align: left;
|
|
23251
|
-
border: 1px solid #ddd;
|
|
23252
|
-
}
|
|
23253
|
-
.details-table th {
|
|
23254
|
-
background: #f5f5f5;
|
|
23255
|
-
font-weight: bold;
|
|
23256
|
-
width: 40%;
|
|
23257
|
-
}
|
|
23258
|
-
.footer {
|
|
23259
|
-
text-align: center;
|
|
23260
|
-
font-size: 12px;
|
|
23261
|
-
color: #666;
|
|
23262
|
-
}
|
|
23263
|
-
@media print {
|
|
23264
|
-
body { background: white !important; }
|
|
23265
|
-
}
|
|
23266
|
-
</style>
|
|
23267
|
-
</head>
|
|
23268
|
-
<body>
|
|
23269
|
-
<div class="acknowledgement-container">
|
|
23270
|
-
<div class="header">
|
|
23271
|
-
<div>
|
|
23272
|
-
<img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/${petData === null || petData === void 0 ? void 0 : petData.tenantId}/logo.png"
|
|
23273
|
-
style="width: 110px; height: 110px; padding-left: 20px; padding-bottom: 20px;" />
|
|
23274
|
-
</div>
|
|
23275
|
-
<div class="header-center">
|
|
23276
|
-
<div class="title">${t(ulbType)} ${t(ulb)}</div>
|
|
23277
|
-
<div class="subtitle">${t("Veterinary Services- Health Branch")}</div>
|
|
23278
|
-
<div class="pet-sub">Pet Registration Acknowledgment</div>
|
|
23279
|
-
<div class="subtitle">(U/S 399 (1)(E) of PMC Act,1976)</div>
|
|
23280
|
-
</div>
|
|
23281
|
-
<div class="header-right">
|
|
23282
|
-
</div>
|
|
23283
|
-
</div>
|
|
23284
|
-
|
|
23285
|
-
<div class="acknowledgement-text">
|
|
23286
|
-
${t("PTR_ACKN_TERM_1")}
|
|
23287
|
-
</div>
|
|
23288
|
-
|
|
23289
|
-
<table class="details-table">
|
|
23290
|
-
<tr>
|
|
23291
|
-
<th>Application Number</th>
|
|
23292
|
-
<td>${(petData === null || petData === void 0 ? void 0 : petData.applicationNumber) || "Not Available"}</td>
|
|
23293
|
-
</tr>
|
|
23294
|
-
<tr>
|
|
23295
|
-
<th>Application Date</th>
|
|
23296
|
-
<td>${currentDate}</td>
|
|
23297
|
-
</tr>
|
|
23298
|
-
<tr>
|
|
23299
|
-
<th>Pet Name</th>
|
|
23300
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails8 = petData.petDetails) === null || _petData$petDetails8 === void 0 ? void 0 : _petData$petDetails8.petName) || "Not Specified"}</td>
|
|
23301
|
-
</tr>
|
|
23302
|
-
<tr>
|
|
23303
|
-
<th>Pet Type</th>
|
|
23304
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails9 = petData.petDetails) === null || _petData$petDetails9 === void 0 ? void 0 : _petData$petDetails9.petType) || "Not Specified"}</td>
|
|
23305
|
-
</tr>
|
|
23306
|
-
<tr>
|
|
23307
|
-
<th>Breed</th>
|
|
23308
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$petDetails0 = petData.petDetails) === null || _petData$petDetails0 === void 0 ? void 0 : _petData$petDetails0.breedType) || "Not Specified"}</td>
|
|
23309
|
-
</tr>
|
|
23310
|
-
<tr>
|
|
23311
|
-
<th>Owner Name</th>
|
|
23312
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$owner5 = petData.owner) === null || _petData$owner5 === void 0 ? void 0 : _petData$owner5.name) || "Not Specified"}</td>
|
|
23313
|
-
</tr>
|
|
23314
|
-
<tr>
|
|
23315
|
-
<th>Contact Number</th>
|
|
23316
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$owner6 = petData.owner) === null || _petData$owner6 === void 0 ? void 0 : _petData$owner6.mobileNumber) || "Not Specified"}</td>
|
|
23317
|
-
</tr>
|
|
23318
|
-
<tr>
|
|
23319
|
-
<th>Email</th>
|
|
23320
|
-
<td>${(petData === null || petData === void 0 ? void 0 : (_petData$owner7 = petData.owner) === null || _petData$owner7 === void 0 ? void 0 : _petData$owner7.emailId) || "Not Specified"}</td>
|
|
23321
|
-
</tr>
|
|
23322
|
-
<tr>
|
|
23323
|
-
<th>Application Status</th>
|
|
23324
|
-
<td style="color: #28a745; font-weight: bold;">${t(petData === null || petData === void 0 ? void 0 : petData.status) || "SUBMITTED"}</td>
|
|
23325
|
-
</tr>
|
|
23326
|
-
</table>
|
|
23327
|
-
|
|
23328
|
-
<div class="acknowledgement-text">
|
|
23329
|
-
${t("PTR_ACKN_TERM_2")}
|
|
23330
|
-
</div>
|
|
23331
|
-
|
|
23332
|
-
|
|
23333
|
-
<div class="footer">
|
|
23334
|
-
<p>Generated on: ${currentDate}</p>
|
|
23335
|
-
<p>${t(ulbType)}</p>
|
|
23336
|
-
<p>This is a computer-generated document and does not require a signature.</p>
|
|
23337
|
-
<p>https://mseva.lgpunjab.gov.in/digit-ui/citizen/ptr-home</p>
|
|
23338
|
-
</div>
|
|
23339
|
-
</div>
|
|
23340
|
-
</body>
|
|
23341
|
-
</html>
|
|
23342
|
-
`;
|
|
23343
|
-
const printWindow = window.open("", "_blank");
|
|
23344
|
-
printWindow.document.write(content);
|
|
23345
|
-
printWindow.document.close();
|
|
23346
|
-
printWindow.onload = () => {
|
|
23347
|
-
setTimeout(() => {
|
|
23348
|
-
printWindow.print();
|
|
23349
|
-
printWindow.onafterprint = () => {
|
|
23350
|
-
printWindow.close();
|
|
23351
|
-
};
|
|
23352
|
-
}, 500);
|
|
23353
|
-
};
|
|
23354
|
-
};
|
|
23355
|
-
createAcknowledgementHTML();
|
|
23356
|
-
setShowToast({
|
|
23357
|
-
key: false,
|
|
23358
|
-
label: "PTR_ACKNOWLEDGEMENT_DOWNLOADED_SUCCESSFULLY"
|
|
23359
|
-
});
|
|
23360
|
-
} catch (error) {
|
|
23361
|
-
setShowToast({
|
|
23362
|
-
key: true,
|
|
23363
|
-
label: `PTR_ACKNOWLEDGEMENT_DOWNLOAD_ERROR: ${error.message}`
|
|
23364
|
-
});
|
|
23365
|
-
}
|
|
23366
|
-
};
|
|
23367
22248
|
let documentDate = t("CS_NA");
|
|
23368
22249
|
if (pet_details !== null && pet_details !== void 0 && (_pet_details$addition = pet_details.additionalDetails) !== null && _pet_details$addition !== void 0 && _pet_details$addition.documentDate) {
|
|
23369
22250
|
var _pet_details$addition2;
|
|
@@ -23374,17 +22255,22 @@ const ApplicationDetails = () => {
|
|
|
23374
22255
|
async function getRecieptSearch({
|
|
23375
22256
|
tenantId,
|
|
23376
22257
|
payments,
|
|
22258
|
+
pdfkey,
|
|
23377
22259
|
...params
|
|
23378
22260
|
}) {
|
|
23379
|
-
var _response;
|
|
22261
|
+
var _application$petDetai, _response;
|
|
22262
|
+
const petAge = formatPetAge(application === null || application === void 0 ? void 0 : (_application$petDetai = application.petDetails) === null || _application$petDetai === void 0 ? void 0 : _application$petDetai.petAge, t);
|
|
23380
22263
|
let response = {
|
|
23381
22264
|
filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
|
|
23382
22265
|
};
|
|
23383
22266
|
response = await Digit.PaymentService.generatePdf(tenantId, {
|
|
23384
22267
|
Payments: [{
|
|
23385
|
-
...payments
|
|
22268
|
+
...payments,
|
|
22269
|
+
application,
|
|
22270
|
+
approver,
|
|
22271
|
+
petAge
|
|
23386
22272
|
}]
|
|
23387
|
-
},
|
|
22273
|
+
}, pdfkey);
|
|
23388
22274
|
const fileStore = await Digit.PaymentService.printReciept(tenantId, {
|
|
23389
22275
|
fileStoreIds: response.filestoreIds[0]
|
|
23390
22276
|
});
|
|
@@ -23392,30 +22278,43 @@ const ApplicationDetails = () => {
|
|
|
23392
22278
|
}
|
|
23393
22279
|
let dowloadOptions = [];
|
|
23394
22280
|
let user = Digit.UserService.getUser();
|
|
23395
|
-
const isCemp = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 :
|
|
22281
|
+
const isCemp = user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.roles.filter(role => role.code === "CEMP");
|
|
23396
22282
|
dowloadOptions.push({
|
|
23397
22283
|
label: t("PTR_PET_DOWNLOAD_ACK_FORM"),
|
|
23398
|
-
onClick: () =>
|
|
22284
|
+
onClick: () => {
|
|
22285
|
+
var _reciept_data$Payment;
|
|
22286
|
+
return getRecieptSearch({
|
|
22287
|
+
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment = reciept_data.Payments[0]) === null || _reciept_data$Payment === void 0 ? void 0 : _reciept_data$Payment.tenantId,
|
|
22288
|
+
payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0],
|
|
22289
|
+
pdfkey: "petacknowledgement"
|
|
22290
|
+
});
|
|
22291
|
+
}
|
|
23399
22292
|
});
|
|
23400
|
-
if ((reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$
|
|
22293
|
+
if ((reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment2 = reciept_data.Payments[0]) === null || _reciept_data$Payment2 === void 0 ? void 0 : _reciept_data$Payment2.paymentStatus) === "NEW" || (reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment3 = reciept_data.Payments[0]) === null || _reciept_data$Payment3 === void 0 ? void 0 : _reciept_data$Payment3.paymentStatus) === "DEPOSITED") {
|
|
23401
22294
|
dowloadOptions.push({
|
|
23402
22295
|
label: t("PTR_CERTIFICATE"),
|
|
23403
22296
|
onClick: () => {
|
|
23404
|
-
|
|
22297
|
+
var _reciept_data$Payment4;
|
|
22298
|
+
return getRecieptSearch({
|
|
22299
|
+
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment4 = reciept_data.Payments[0]) === null || _reciept_data$Payment4 === void 0 ? void 0 : _reciept_data$Payment4.tenantId,
|
|
22300
|
+
payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0],
|
|
22301
|
+
pdfkey: "petcertificatenew"
|
|
22302
|
+
});
|
|
23405
22303
|
}
|
|
23406
22304
|
});
|
|
23407
22305
|
} else {
|
|
23408
|
-
var _reciept_data$
|
|
23409
|
-
console.log("Certificate not available. Payment status:", reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$
|
|
22306
|
+
var _reciept_data$Payment5;
|
|
22307
|
+
console.log("Certificate not available. Payment status:", reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment5 = reciept_data.Payments[0]) === null || _reciept_data$Payment5 === void 0 ? void 0 : _reciept_data$Payment5.paymentStatus);
|
|
23410
22308
|
}
|
|
23411
22309
|
if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
|
|
23412
22310
|
dowloadOptions.push({
|
|
23413
22311
|
label: t("PTR_FEE_RECIEPT"),
|
|
23414
22312
|
onClick: () => {
|
|
23415
|
-
var _reciept_data$
|
|
22313
|
+
var _reciept_data$Payment6;
|
|
23416
22314
|
return getRecieptSearch({
|
|
23417
|
-
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$
|
|
23418
|
-
payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
|
|
22315
|
+
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment6 = reciept_data.Payments[0]) === null || _reciept_data$Payment6 === void 0 ? void 0 : _reciept_data$Payment6.tenantId,
|
|
22316
|
+
payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0],
|
|
22317
|
+
pdfkey: "pet-receipt-employee"
|
|
23419
22318
|
});
|
|
23420
22319
|
}
|
|
23421
22320
|
});
|
|
@@ -23451,7 +22350,7 @@ const ApplicationDetails = () => {
|
|
|
23451
22350
|
styles: {
|
|
23452
22351
|
fontSize: "32px"
|
|
23453
22352
|
}
|
|
23454
|
-
}, t("CS_APPLICATION_DETAILS")), isCemp &&
|
|
22353
|
+
}, t("CS_APPLICATION_DETAILS")), isCemp && dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
|
|
23455
22354
|
className: "multilinkWrapper",
|
|
23456
22355
|
onHeadClick: () => setShowOptions(!showOptions),
|
|
23457
22356
|
displayOptions: showOptions,
|
|
@@ -23487,7 +22386,7 @@ const ApplicationDetails = () => {
|
|
|
23487
22386
|
}, t("WS_COMMON_TABLE_COL_ADDRESS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
|
|
23488
22387
|
className: "border-none",
|
|
23489
22388
|
label: t("PTR_ADDRESS"),
|
|
23490
|
-
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address = pet_details.address) === null || _pet_details$address === void 0 ? void 0 : _pet_details$address.
|
|
22389
|
+
text: (pet_details === null || pet_details === void 0 ? void 0 : (_pet_details$address = pet_details.address) === null || _pet_details$address === void 0 ? void 0 : _pet_details$address.addressLine1) || t("CS_NA")
|
|
23491
22390
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
23492
22391
|
className: "border-none",
|
|
23493
22392
|
label: t("PTR_PINCODE"),
|
|
@@ -24448,9 +23347,19 @@ const NewPTRStepperForm = () => {
|
|
|
24448
23347
|
const step = formState.step;
|
|
24449
23348
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
24450
23349
|
const pathParts = window.location.pathname.split("/");
|
|
24451
|
-
const
|
|
24452
|
-
|
|
24453
|
-
|
|
23350
|
+
const startIndex = pathParts.findIndex(part => part === "new-application");
|
|
23351
|
+
let id = null;
|
|
23352
|
+
if (startIndex !== -1) {
|
|
23353
|
+
const nextPart = pathParts[startIndex + 1];
|
|
23354
|
+
if (nextPart !== null && nextPart !== void 0 && nextPart.startsWith("PB-PTR-")) {
|
|
23355
|
+
id = nextPart;
|
|
23356
|
+
} else if (nextPart === "PL") {
|
|
23357
|
+
id = pathParts.slice(startIndex + 1, startIndex + 5).join("/");
|
|
23358
|
+
}
|
|
23359
|
+
}
|
|
23360
|
+
id = id ? decodeURIComponent(id) : null;
|
|
23361
|
+
console.log("id:", id);
|
|
23362
|
+
const shouldEnableSearch = Boolean(id);
|
|
24454
23363
|
console.log("shouldEnableSearch", shouldEnableSearch);
|
|
24455
23364
|
const {
|
|
24456
23365
|
isLoading,
|
|
@@ -24465,6 +23374,7 @@ const NewPTRStepperForm = () => {
|
|
|
24465
23374
|
useEffect(() => {
|
|
24466
23375
|
var _applicationData$PetR;
|
|
24467
23376
|
console.log("applicationData for hereee:>> ", applicationData);
|
|
23377
|
+
console.log("id", id);
|
|
24468
23378
|
if (id && applicationData !== null && applicationData !== void 0 && (_applicationData$PetR = applicationData.PetRegistrationApplications) !== null && _applicationData$PetR !== void 0 && _applicationData$PetR.length) {
|
|
24469
23379
|
dispatch(UPDATE_PTRNewApplication_FORM("responseData", applicationData.PetRegistrationApplications));
|
|
24470
23380
|
}
|