@mseva/digit-ui-module-ptr 1.3.4-UAT.14 → 1.3.4-UAT.15
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 +120 -1217
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
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,11 +20178,10 @@ const PTRApplicationDetails = () => {
|
|
|
20738
20178
|
async function getRecieptSearch({
|
|
20739
20179
|
tenantId,
|
|
20740
20180
|
payments,
|
|
20181
|
+
pdfkey,
|
|
20741
20182
|
...params
|
|
20742
20183
|
}) {
|
|
20743
|
-
var _application$
|
|
20744
|
-
const petImage = application === null || application === void 0 ? void 0 : (_application$document = application.documents) === null || _application$document === void 0 ? void 0 : _application$document.find(doc => (doc === null || doc === void 0 ? void 0 : doc.documentType) === "PET.PETPHOTO");
|
|
20745
|
-
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`;
|
|
20184
|
+
var _application$petDetai, _response;
|
|
20746
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);
|
|
20747
20186
|
let response = {
|
|
20748
20187
|
filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
|
|
@@ -20752,10 +20191,9 @@ const PTRApplicationDetails = () => {
|
|
|
20752
20191
|
...payments,
|
|
20753
20192
|
application,
|
|
20754
20193
|
approver,
|
|
20755
|
-
petAge
|
|
20756
|
-
petImageUrl
|
|
20194
|
+
petAge
|
|
20757
20195
|
}]
|
|
20758
|
-
},
|
|
20196
|
+
}, pdfkey);
|
|
20759
20197
|
const fileStore = await Digit.PaymentService.printReciept(tenantId, {
|
|
20760
20198
|
fileStoreIds: response.filestoreIds[0]
|
|
20761
20199
|
});
|
|
@@ -20764,27 +20202,40 @@ const PTRApplicationDetails = () => {
|
|
|
20764
20202
|
const dowloadOptions = [];
|
|
20765
20203
|
dowloadOptions.push({
|
|
20766
20204
|
label: t("PTR_PET_DOWNLOAD_ACK_FORM"),
|
|
20767
|
-
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
|
+
}
|
|
20768
20213
|
});
|
|
20769
|
-
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") {
|
|
20770
20215
|
dowloadOptions.push({
|
|
20771
20216
|
label: t("PTR_CERTIFICATE"),
|
|
20772
20217
|
onClick: () => {
|
|
20773
|
-
|
|
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
|
+
});
|
|
20774
20224
|
}
|
|
20775
20225
|
});
|
|
20776
20226
|
} else {
|
|
20777
|
-
var _reciept_data$
|
|
20778
|
-
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);
|
|
20779
20229
|
}
|
|
20780
20230
|
if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
|
|
20781
20231
|
dowloadOptions.push({
|
|
20782
20232
|
label: t("PTR_FEE_RECIEPT"),
|
|
20783
20233
|
onClick: () => {
|
|
20784
|
-
var _reciept_data$
|
|
20234
|
+
var _reciept_data$Payment6;
|
|
20785
20235
|
return getRecieptSearch({
|
|
20786
|
-
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$
|
|
20787
|
-
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"
|
|
20788
20239
|
});
|
|
20789
20240
|
}
|
|
20790
20241
|
});
|
|
@@ -20871,7 +20322,7 @@ const PTRApplicationDetails = () => {
|
|
|
20871
20322
|
}, t("WS_COMMON_TABLE_COL_ADDRESS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
|
|
20872
20323
|
className: "border-none",
|
|
20873
20324
|
label: t("PTR_ADDRESS"),
|
|
20874
|
-
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")
|
|
20875
20326
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
20876
20327
|
className: "border-none",
|
|
20877
20328
|
label: t("PTR_PINCODE"),
|
|
@@ -22682,7 +22133,7 @@ const NewApplication = () => {
|
|
|
22682
22133
|
};
|
|
22683
22134
|
|
|
22684
22135
|
const ApplicationDetails = () => {
|
|
22685
|
-
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;
|
|
22686
22137
|
const {
|
|
22687
22138
|
t
|
|
22688
22139
|
} = useTranslation();
|
|
@@ -22721,8 +22172,6 @@ const ApplicationDetails = () => {
|
|
|
22721
22172
|
const [billData, setBillData] = useState(null);
|
|
22722
22173
|
const PetRegistrationApplications = get_1(data, "PetRegistrationApplications", []);
|
|
22723
22174
|
const petId = get_1(data, "PetRegistrationApplications[0].applicationNumber", []);
|
|
22724
|
-
const ulb = tenantInfo === null || tenantInfo === void 0 ? void 0 : (_tenantInfo$city = tenantInfo.city) === null || _tenantInfo$city === void 0 ? void 0 : _tenantInfo$city.name;
|
|
22725
|
-
const ulbType = tenantInfo === null || tenantInfo === void 0 ? void 0 : (_tenantInfo$city2 = tenantInfo.city) === null || _tenantInfo$city2 === void 0 ? void 0 : _tenantInfo$city2.ulbType;
|
|
22726
22175
|
let pet_details = PetRegistrationApplications && PetRegistrationApplications.length > 0 && PetRegistrationApplications[0] || {};
|
|
22727
22176
|
const application = pet_details;
|
|
22728
22177
|
sessionStorage.setItem("ptr-pet", JSON.stringify(application));
|
|
@@ -22796,581 +22245,6 @@ const ApplicationDetails = () => {
|
|
|
22796
22245
|
if (isLoading || auditDataLoading) {
|
|
22797
22246
|
return /*#__PURE__*/React.createElement(Loader$1, null);
|
|
22798
22247
|
}
|
|
22799
|
-
const printCertificate = async () => {
|
|
22800
|
-
const qrDataURL = await browser.toDataURL(window.location.href);
|
|
22801
|
-
try {
|
|
22802
|
-
var _data$PetRegistration;
|
|
22803
|
-
if (!(data !== null && data !== void 0 && (_data$PetRegistration = data.PetRegistrationApplications) !== null && _data$PetRegistration !== void 0 && _data$PetRegistration[0])) {
|
|
22804
|
-
throw new Error("Pet registration data is missing");
|
|
22805
|
-
}
|
|
22806
|
-
const createCertificateHTML = () => {
|
|
22807
|
-
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;
|
|
22808
|
-
const petData = data.PetRegistrationApplications[0];
|
|
22809
|
-
const currentDate = new Date().toLocaleDateString("en-IN", {
|
|
22810
|
-
day: "2-digit",
|
|
22811
|
-
month: "2-digit",
|
|
22812
|
-
year: "numeric"
|
|
22813
|
-
});
|
|
22814
|
-
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");
|
|
22815
|
-
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`;
|
|
22816
|
-
const content = `
|
|
22817
|
-
<html>
|
|
22818
|
-
<head>
|
|
22819
|
-
<title>Pet Registration Certificate</title>
|
|
22820
|
-
<style>
|
|
22821
|
-
@page { margin: 0.5in; }
|
|
22822
|
-
body {
|
|
22823
|
-
font-family: 'Times New Roman', serif;
|
|
22824
|
-
margin: 0;
|
|
22825
|
-
font-size: 11px;
|
|
22826
|
-
}
|
|
22827
|
-
.certificate-container {
|
|
22828
|
-
max-width: 800px;
|
|
22829
|
-
margin: 0 auto;
|
|
22830
|
-
border: 3px solid #000;
|
|
22831
|
-
background: white;
|
|
22832
|
-
}
|
|
22833
|
-
.header {
|
|
22834
|
-
display: flex;
|
|
22835
|
-
justify-content: space-between;
|
|
22836
|
-
align-items: center;
|
|
22837
|
-
text-align: center;
|
|
22838
|
-
margin-bottom: 5px;
|
|
22839
|
-
position: relative;
|
|
22840
|
-
}
|
|
22841
|
-
.header-value{
|
|
22842
|
-
border: none;
|
|
22843
|
-
display: flex;
|
|
22844
|
-
text-align: center;
|
|
22845
|
-
}
|
|
22846
|
-
.header-center {
|
|
22847
|
-
text-align: center;
|
|
22848
|
-
flex: 1;
|
|
22849
|
-
padding-right: 80px
|
|
22850
|
-
}
|
|
22851
|
-
.header-disclaimer {
|
|
22852
|
-
text-align: center;
|
|
22853
|
-
flex: 1;
|
|
22854
|
-
}
|
|
22855
|
-
.header-right {
|
|
22856
|
-
flex: 0 0 auto;
|
|
22857
|
-
}
|
|
22858
|
-
.title {
|
|
22859
|
-
font-size: 13px;
|
|
22860
|
-
font-weight: bold;
|
|
22861
|
-
margin: 10px 0;
|
|
22862
|
-
}
|
|
22863
|
-
.subtitle {
|
|
22864
|
-
font-size: 10px;
|
|
22865
|
-
color: #666;
|
|
22866
|
-
}
|
|
22867
|
-
.main-content {
|
|
22868
|
-
display: flex;
|
|
22869
|
-
gap: 10px;
|
|
22870
|
-
margin: 10px 0;
|
|
22871
|
-
align-items:flex-start;
|
|
22872
|
-
margin-bottom: -13px;
|
|
22873
|
-
}
|
|
22874
|
-
.details-section {
|
|
22875
|
-
}
|
|
22876
|
-
.pet-image-section {
|
|
22877
|
-
flex-shrink: 0;
|
|
22878
|
-
text-align: center;
|
|
22879
|
-
order: 2;
|
|
22880
|
-
}
|
|
22881
|
-
.pet-image {
|
|
22882
|
-
width: 100px;
|
|
22883
|
-
max-width: 100%;
|
|
22884
|
-
aspect-ratio : 1 / 1;
|
|
22885
|
-
height: auto;
|
|
22886
|
-
border: 2px solid #000;
|
|
22887
|
-
object-fit: cover;
|
|
22888
|
-
margin-bottom: 10px;
|
|
22889
|
-
border-right-width: 2px;
|
|
22890
|
-
margin-right: 50px;
|
|
22891
|
-
margin-top: 20px;
|
|
22892
|
-
display: block;
|
|
22893
|
-
}
|
|
22894
|
-
.image-label {
|
|
22895
|
-
font-size: 12px;
|
|
22896
|
-
font-weight: bold;
|
|
22897
|
-
text-align: center;
|
|
22898
|
-
border-right-width: 30px;
|
|
22899
|
-
margin-right: 50px;
|
|
22900
|
-
}
|
|
22901
|
-
.details-grid {
|
|
22902
|
-
display: grid;
|
|
22903
|
-
grid-template-columns: 290px 280px;
|
|
22904
|
-
overflow: hidden;
|
|
22905
|
-
margin: 10px 0;
|
|
22906
|
-
margin-left : 40px;
|
|
22907
|
-
}
|
|
22908
|
-
.detail-row {
|
|
22909
|
-
display: grid;
|
|
22910
|
-
grid-template-columns: 140px 180px;
|
|
22911
|
-
overflow:hidden;
|
|
22912
|
-
border: 1px solid black;
|
|
22913
|
-
}
|
|
22914
|
-
.detail-label {
|
|
22915
|
-
font-weight: bold;
|
|
22916
|
-
white-space: normal;
|
|
22917
|
-
word-break: break-word;
|
|
22918
|
-
margin-left: 10px;
|
|
22919
|
-
flex-shrink: 1;
|
|
22920
|
-
}
|
|
22921
|
-
.detail-value {
|
|
22922
|
-
padding-bottom: 2px;
|
|
22923
|
-
margin-right: 10px;
|
|
22924
|
-
}
|
|
22925
|
-
.owner-section {
|
|
22926
|
-
margin: 5px 40px;
|
|
22927
|
-
margin-bottom: 0px;
|
|
22928
|
-
display: grid;
|
|
22929
|
-
grid-template-columns: 50%;
|
|
22930
|
-
}
|
|
22931
|
-
.footer-section {
|
|
22932
|
-
margin: 0px 40px;
|
|
22933
|
-
display: flex;
|
|
22934
|
-
justify-content: space-between;
|
|
22935
|
-
align-items: anchor-center;
|
|
22936
|
-
}
|
|
22937
|
-
.signature-area {
|
|
22938
|
-
text-align: center;
|
|
22939
|
-
min-width: 200px;
|
|
22940
|
-
}
|
|
22941
|
-
.signature-line {
|
|
22942
|
-
border-top: 1px solid #000;
|
|
22943
|
-
margin: 10px 0 5px 0;
|
|
22944
|
-
}
|
|
22945
|
-
.pet-sub {
|
|
22946
|
-
font-size: 10px;
|
|
22947
|
-
margin: 5px 0;
|
|
22948
|
-
color: #666;
|
|
22949
|
-
font-weight: bold;
|
|
22950
|
-
}
|
|
22951
|
-
.terms-section {
|
|
22952
|
-
border-top: 2px solid #000;
|
|
22953
|
-
padding-top: 5px;
|
|
22954
|
-
font-size: 11px;
|
|
22955
|
-
margin: 0px 10px;
|
|
22956
|
-
}
|
|
22957
|
-
.terms-title {
|
|
22958
|
-
font-weight: bold;
|
|
22959
|
-
margin-bottom: 10px;
|
|
22960
|
-
}
|
|
22961
|
-
.terms-list {
|
|
22962
|
-
margin: 0;
|
|
22963
|
-
padding-left: 20px;
|
|
22964
|
-
}
|
|
22965
|
-
.terms-list li {
|
|
22966
|
-
margin-bottom: 2px;
|
|
22967
|
-
text-align: left;
|
|
22968
|
-
}
|
|
22969
|
-
@media print {
|
|
22970
|
-
body { background: white !important; }
|
|
22971
|
-
}
|
|
22972
|
-
@media (max-width: 700px) {
|
|
22973
|
-
.main-content {
|
|
22974
|
-
flex-wrap: wrap;
|
|
22975
|
-
}
|
|
22976
|
-
.pet-image {
|
|
22977
|
-
width: 100px;
|
|
22978
|
-
max-width: 100%;
|
|
22979
|
-
height: auto;
|
|
22980
|
-
aspect-ratio: 1/1;
|
|
22981
|
-
}
|
|
22982
|
-
.dis-section{
|
|
22983
|
-
font-size: 12px;
|
|
22984
|
-
margin: 0px 10px;
|
|
22985
|
-
}
|
|
22986
|
-
}
|
|
22987
|
-
</style>
|
|
22988
|
-
</head>
|
|
22989
|
-
<body>
|
|
22990
|
-
<div class="certificate-container">
|
|
22991
|
-
<div class="header">
|
|
22992
|
-
<div>
|
|
22993
|
-
<img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/${petData === null || petData === void 0 ? void 0 : petData.tenantId}/logo.png"
|
|
22994
|
-
style="width: 80px; height: 80px; padding-left: 20px; padding-top: 5px;" />
|
|
22995
|
-
</div>
|
|
22996
|
-
<div class="header-center">
|
|
22997
|
-
<div class="title">${t(ulbType)} ${t(ulb)}</div>
|
|
22998
|
-
<div class="subtitle">${t("Veterinary Services- Health Branch")}</div>
|
|
22999
|
-
<div class="pet-sub">Pet Registration Certificate</div>
|
|
23000
|
-
<div class="subtitle">(U/S 399 (1)(E) of PMC Act,1976)</div>
|
|
23001
|
-
</div>
|
|
23002
|
-
<div class="header-right">
|
|
23003
|
-
</div>
|
|
23004
|
-
</div>
|
|
23005
|
-
<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>
|
|
23006
|
-
<div class="main-content">
|
|
23007
|
-
<div class="details-section">
|
|
23008
|
-
<span class="detail-label">Pet Information</span> <br>
|
|
23009
|
-
<span class="detail-label">Registration No:</span> <span class="detail-label">${(petData === null || petData === void 0 ? void 0 : petData.petRegistrationNumber) || ""}</span>
|
|
23010
|
-
<div class="details-grid">
|
|
23011
|
-
<div class="detail-row">
|
|
23012
|
-
<span class="detail-label">Category</span>
|
|
23013
|
-
<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>
|
|
23014
|
-
</div>
|
|
23015
|
-
<div class="detail-row">
|
|
23016
|
-
<span class="detail-label">Breed</span>
|
|
23017
|
-
<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>
|
|
23018
|
-
</div>
|
|
23019
|
-
<div class="detail-row">
|
|
23020
|
-
<span class="detail-label">Name of Animal</span>
|
|
23021
|
-
<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>
|
|
23022
|
-
</div>
|
|
23023
|
-
<div class="detail-row">
|
|
23024
|
-
<span class="detail-label">Gender</span>
|
|
23025
|
-
<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>
|
|
23026
|
-
</div>
|
|
23027
|
-
<div class="detail-row">
|
|
23028
|
-
<span class="detail-label">Pet Age</span>
|
|
23029
|
-
<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>
|
|
23030
|
-
</div>
|
|
23031
|
-
<div class="detail-row">
|
|
23032
|
-
<span class="detail-label">Colour</span>
|
|
23033
|
-
<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>
|
|
23034
|
-
</div>
|
|
23035
|
-
<div class="detail-row">
|
|
23036
|
-
<span class="detail-label">Application Number</span>
|
|
23037
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.applicationNumber) || "Not Specified"}</span>
|
|
23038
|
-
</div>
|
|
23039
|
-
<div class="detail-row">
|
|
23040
|
-
<span class="detail-label">Token No</span>
|
|
23041
|
-
<span class="detail-value">${(petData === null || petData === void 0 ? void 0 : petData.petToken) || "Not Specified"}</span>
|
|
23042
|
-
</div>
|
|
23043
|
-
<div class="detail-row">
|
|
23044
|
-
<span class="detail-label">Issue Date</span>
|
|
23045
|
-
<span class="detail-value">
|
|
23046
|
-
${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"}
|
|
23047
|
-
</span>
|
|
23048
|
-
</div>
|
|
23049
|
-
|
|
23050
|
-
<div class="detail-row">
|
|
23051
|
-
<span class="detail-label">License Valid Upto</span>
|
|
23052
|
-
<span class="detail-value">
|
|
23053
|
-
${petData !== null && petData !== void 0 && petData.validityDate ? new Date(petData.validityDate * 1000).toLocaleDateString("en-GB") : "N/A"}
|
|
23054
|
-
|
|
23055
|
-
</span>
|
|
23056
|
-
</div>
|
|
23057
|
-
<div class="detail-row">
|
|
23058
|
-
<span class="detail-label">Amount</span>
|
|
23059
|
-
<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>
|
|
23060
|
-
</div>
|
|
23061
|
-
<div class="detail-row">
|
|
23062
|
-
<span class="detail-label">G8/Receipt No</span>
|
|
23063
|
-
<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>
|
|
23064
|
-
</div>
|
|
23065
|
-
</div>
|
|
23066
|
-
</div>
|
|
23067
|
-
|
|
23068
|
-
<div class="pet-image-section">
|
|
23069
|
-
<img
|
|
23070
|
-
src="${petImageUrl}"
|
|
23071
|
-
alt="Pet Photo"
|
|
23072
|
-
class="pet-image"
|
|
23073
|
-
onload="console.log('Pet image loaded successfully:', this.src);"
|
|
23074
|
-
onerror="console.log('Pet image failed to load:', this.src); console.log('Trying fallback image...'); this.src='/adorable-golden-retriever.png';"
|
|
23075
|
-
/>
|
|
23076
|
-
<div class="image-label">Pet Photo</div>
|
|
23077
|
-
<script>
|
|
23078
|
-
console.log('Image URL being used:', '${petImageUrl}');
|
|
23079
|
-
console.log('Pet image data:', ${JSON.stringify(petImage)});
|
|
23080
|
-
</script>
|
|
23081
|
-
</div>
|
|
23082
|
-
</div>
|
|
23083
|
-
|
|
23084
|
-
<span class="detail-label">Owner Information</span>
|
|
23085
|
-
<div class="owner-section">
|
|
23086
|
-
<div class="detail-row">
|
|
23087
|
-
<span class="detail-label">Owner Name</span>
|
|
23088
|
-
<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>
|
|
23089
|
-
</div>
|
|
23090
|
-
<div class="detail-row">
|
|
23091
|
-
<span class="detail-label">Father/Spouse Name</span>
|
|
23092
|
-
<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>
|
|
23093
|
-
</div>
|
|
23094
|
-
<div class="detail-row">
|
|
23095
|
-
<span class="detail-label">Address</span>
|
|
23096
|
-
<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>
|
|
23097
|
-
</div>
|
|
23098
|
-
</div>
|
|
23099
|
-
|
|
23100
|
-
<div class="header">
|
|
23101
|
-
<div class="header-left"> </div>
|
|
23102
|
-
<div class="header-disclaimer">
|
|
23103
|
-
<div class="title">DISCLAIMER</div>
|
|
23104
|
-
<div class="dis-section">${t("PET_DISCLAIMER")}</div>
|
|
23105
|
-
<div class="header-right"></div>
|
|
23106
|
-
</div>
|
|
23107
|
-
</div>
|
|
23108
|
-
|
|
23109
|
-
<div class="footer-section">
|
|
23110
|
-
<div>
|
|
23111
|
-
<div>Date:........................</div>
|
|
23112
|
-
<div>Place:.......................</div>
|
|
23113
|
-
</div>
|
|
23114
|
-
<div class="signature-area">
|
|
23115
|
-
<div class="detail-label">Approved by</div>
|
|
23116
|
-
<span class="detail-value">${approver || "Not Specified"}</span>
|
|
23117
|
-
<div class="signature-line"></div>
|
|
23118
|
-
<div>Licensing Authority</div>
|
|
23119
|
-
<div>${t(ulbType)}</div>
|
|
23120
|
-
|
|
23121
|
-
</div>
|
|
23122
|
-
</div>
|
|
23123
|
-
|
|
23124
|
-
<div class="terms-section">
|
|
23125
|
-
<div class="terms-title">${t("TERMS AND CONDITIONS")}</div>
|
|
23126
|
-
<div class="terms-title">${t("PET_TERMS_HEADER")}</div>
|
|
23127
|
-
<ol class="terms-list">
|
|
23128
|
-
<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>
|
|
23129
|
-
<li>${t("PET_NEW_TERM_2")}</li>
|
|
23130
|
-
<li>${t("PET_NEW_TERM_3")}</li>
|
|
23131
|
-
<li>${t("PET_NEW_TERM_4")}</li>
|
|
23132
|
-
<li>${t("PET_NEW_TERM_5")}</li>
|
|
23133
|
-
<li>${t("PET_NEW_TERM_6")}</li>
|
|
23134
|
-
<li>${t("PET_NEW_TERM_7")}</li>
|
|
23135
|
-
<li>${t("PET_NEW_TERM_8")}</li>
|
|
23136
|
-
<li>${t("PET_NEW_TERM_9")}</li>
|
|
23137
|
-
<li>${t("PET_NEW_TERM_10")}</li>
|
|
23138
|
-
<li>${t("PET_NEW_TERM_11")}</li>
|
|
23139
|
-
<li>${t("PET_NEW_TERM_12")}</li>
|
|
23140
|
-
<li>${t("PET_NEW_TERM_13")}</li>
|
|
23141
|
-
<li>${t("PET_NEW_TERM_14")}</li>
|
|
23142
|
-
<li>${t("PET_NEW_TERM_15")}</li>
|
|
23143
|
-
<li>${t("PET_NEW_TERM_16")}</li>
|
|
23144
|
-
</ol>
|
|
23145
|
-
|
|
23146
|
-
<div style="text-align: center;">
|
|
23147
|
-
<img src="${qrDataURL}" style="width: 100px; height: 100px;" />
|
|
23148
|
-
</div>
|
|
23149
|
-
</div>
|
|
23150
|
-
</div>
|
|
23151
|
-
</body>
|
|
23152
|
-
</html>
|
|
23153
|
-
`;
|
|
23154
|
-
const printWindow = window.open("", "_blank");
|
|
23155
|
-
printWindow.document.write(content);
|
|
23156
|
-
printWindow.document.close();
|
|
23157
|
-
printWindow.onload = () => {
|
|
23158
|
-
setTimeout(() => {
|
|
23159
|
-
printWindow.print();
|
|
23160
|
-
printWindow.onafterprint = () => {
|
|
23161
|
-
printWindow.close();
|
|
23162
|
-
};
|
|
23163
|
-
}, 500);
|
|
23164
|
-
};
|
|
23165
|
-
};
|
|
23166
|
-
createCertificateHTML();
|
|
23167
|
-
setShowToast({
|
|
23168
|
-
key: false,
|
|
23169
|
-
label: "PTR_CERTIFICATE_DOWNLOADED_SUCCESSFULLY"
|
|
23170
|
-
});
|
|
23171
|
-
} catch (error) {
|
|
23172
|
-
setShowToast({
|
|
23173
|
-
key: true,
|
|
23174
|
-
label: `PTR_CERTIFICATE_DOWNLOAD_ERROR: ${error.message}`
|
|
23175
|
-
});
|
|
23176
|
-
}
|
|
23177
|
-
};
|
|
23178
|
-
const downloadAcknowledgement = async () => {
|
|
23179
|
-
try {
|
|
23180
|
-
var _data$PetRegistration2;
|
|
23181
|
-
if (!(data !== null && data !== void 0 && (_data$PetRegistration2 = data.PetRegistrationApplications) !== null && _data$PetRegistration2 !== void 0 && _data$PetRegistration2[0])) {
|
|
23182
|
-
throw new Error("Pet registration data is missing");
|
|
23183
|
-
}
|
|
23184
|
-
const createAcknowledgementHTML = () => {
|
|
23185
|
-
var _petData$petDetails8, _petData$petDetails9, _petData$petDetails0, _petData$owner5, _petData$owner6, _petData$owner7;
|
|
23186
|
-
const petData = data.PetRegistrationApplications[0];
|
|
23187
|
-
const ulb = petData === null || petData === void 0 ? void 0 : petData.tenantId.split(".")[1];
|
|
23188
|
-
const currentDate = new Date().toLocaleDateString("en-IN", {
|
|
23189
|
-
day: "2-digit",
|
|
23190
|
-
month: "long",
|
|
23191
|
-
year: "numeric"
|
|
23192
|
-
});
|
|
23193
|
-
const content = `
|
|
23194
|
-
<html>
|
|
23195
|
-
<head>
|
|
23196
|
-
<title>Pet Registration Acknowledgement</title>
|
|
23197
|
-
<style>
|
|
23198
|
-
@page { margin: 0.5in; }
|
|
23199
|
-
body {
|
|
23200
|
-
font-family: 'Arial', sans-serif;
|
|
23201
|
-
margin: 0;
|
|
23202
|
-
padding: 20px;
|
|
23203
|
-
font-size: 14px;
|
|
23204
|
-
line-height: 1.6;
|
|
23205
|
-
}
|
|
23206
|
-
.acknowledgement-container {
|
|
23207
|
-
max-width: 800px;
|
|
23208
|
-
margin: 0 auto;
|
|
23209
|
-
border: 2px solid #333;
|
|
23210
|
-
padding: 30px;
|
|
23211
|
-
background: white;
|
|
23212
|
-
}
|
|
23213
|
-
.header {
|
|
23214
|
-
text-align: center;
|
|
23215
|
-
border-bottom: 2px solid #333;
|
|
23216
|
-
display: flex;
|
|
23217
|
-
justify-content: space-between;
|
|
23218
|
-
align-items: center;
|
|
23219
|
-
position: relative;
|
|
23220
|
-
}
|
|
23221
|
-
.header-center {
|
|
23222
|
-
text-align: center;
|
|
23223
|
-
flex: 1;
|
|
23224
|
-
padding-right: 80px
|
|
23225
|
-
}
|
|
23226
|
-
.header-right {
|
|
23227
|
-
flex: 0 0 auto;
|
|
23228
|
-
}
|
|
23229
|
-
.title {
|
|
23230
|
-
font-size: 20px;
|
|
23231
|
-
font-weight: bold;
|
|
23232
|
-
margin: 10px 0;
|
|
23233
|
-
color: #333;
|
|
23234
|
-
}
|
|
23235
|
-
.subtitle {
|
|
23236
|
-
font-size: 16px;
|
|
23237
|
-
margin: 5px 0;
|
|
23238
|
-
color: #666;
|
|
23239
|
-
}
|
|
23240
|
-
.pet-sub {
|
|
23241
|
-
font-size: 16px;
|
|
23242
|
-
margin: 5px 0;
|
|
23243
|
-
color: #666;
|
|
23244
|
-
font-weight: bold;
|
|
23245
|
-
}
|
|
23246
|
-
.acknowledgement-text {
|
|
23247
|
-
text-align: justify;
|
|
23248
|
-
font-size: 15px;
|
|
23249
|
-
}
|
|
23250
|
-
.details-table {
|
|
23251
|
-
width: 100%;
|
|
23252
|
-
border-collapse: collapse;
|
|
23253
|
-
}
|
|
23254
|
-
.details-table th,
|
|
23255
|
-
.details-table td {
|
|
23256
|
-
padding: 12px;
|
|
23257
|
-
text-align: left;
|
|
23258
|
-
border: 1px solid #ddd;
|
|
23259
|
-
}
|
|
23260
|
-
.details-table th {
|
|
23261
|
-
background: #f5f5f5;
|
|
23262
|
-
font-weight: bold;
|
|
23263
|
-
width: 40%;
|
|
23264
|
-
}
|
|
23265
|
-
.footer {
|
|
23266
|
-
text-align: center;
|
|
23267
|
-
font-size: 12px;
|
|
23268
|
-
color: #666;
|
|
23269
|
-
}
|
|
23270
|
-
@media print {
|
|
23271
|
-
body { background: white !important; }
|
|
23272
|
-
}
|
|
23273
|
-
</style>
|
|
23274
|
-
</head>
|
|
23275
|
-
<body>
|
|
23276
|
-
<div class="acknowledgement-container">
|
|
23277
|
-
<div class="header">
|
|
23278
|
-
<div>
|
|
23279
|
-
<img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/${petData === null || petData === void 0 ? void 0 : petData.tenantId}/logo.png"
|
|
23280
|
-
style="width: 110px; height: 110px; padding-left: 20px; padding-bottom: 20px;" />
|
|
23281
|
-
</div>
|
|
23282
|
-
<div class="header-center">
|
|
23283
|
-
<div class="title">${t(ulbType)} ${t(ulb)}</div>
|
|
23284
|
-
<div class="subtitle">${t("Veterinary Services- Health Branch")}</div>
|
|
23285
|
-
<div class="pet-sub">Pet Registration Acknowledgment</div>
|
|
23286
|
-
<div class="subtitle">(U/S 399 (1)(E) of PMC Act,1976)</div>
|
|
23287
|
-
</div>
|
|
23288
|
-
<div class="header-right">
|
|
23289
|
-
</div>
|
|
23290
|
-
</div>
|
|
23291
|
-
|
|
23292
|
-
<div class="acknowledgement-text">
|
|
23293
|
-
${t("PTR_ACKN_TERM_1")}
|
|
23294
|
-
</div>
|
|
23295
|
-
|
|
23296
|
-
<table class="details-table">
|
|
23297
|
-
<tr>
|
|
23298
|
-
<th>Application Number</th>
|
|
23299
|
-
<td>${(petData === null || petData === void 0 ? void 0 : petData.applicationNumber) || "Not Available"}</td>
|
|
23300
|
-
</tr>
|
|
23301
|
-
<tr>
|
|
23302
|
-
<th>Application Date</th>
|
|
23303
|
-
<td>${currentDate}</td>
|
|
23304
|
-
</tr>
|
|
23305
|
-
<tr>
|
|
23306
|
-
<th>Pet Name</th>
|
|
23307
|
-
<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>
|
|
23308
|
-
</tr>
|
|
23309
|
-
<tr>
|
|
23310
|
-
<th>Pet Type</th>
|
|
23311
|
-
<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>
|
|
23312
|
-
</tr>
|
|
23313
|
-
<tr>
|
|
23314
|
-
<th>Breed</th>
|
|
23315
|
-
<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>
|
|
23316
|
-
</tr>
|
|
23317
|
-
<tr>
|
|
23318
|
-
<th>Owner Name</th>
|
|
23319
|
-
<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>
|
|
23320
|
-
</tr>
|
|
23321
|
-
<tr>
|
|
23322
|
-
<th>Contact Number</th>
|
|
23323
|
-
<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>
|
|
23324
|
-
</tr>
|
|
23325
|
-
<tr>
|
|
23326
|
-
<th>Email</th>
|
|
23327
|
-
<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>
|
|
23328
|
-
</tr>
|
|
23329
|
-
<tr>
|
|
23330
|
-
<th>Application Status</th>
|
|
23331
|
-
<td style="color: #28a745; font-weight: bold;">${t(petData === null || petData === void 0 ? void 0 : petData.status) || "SUBMITTED"}</td>
|
|
23332
|
-
</tr>
|
|
23333
|
-
</table>
|
|
23334
|
-
|
|
23335
|
-
<div class="acknowledgement-text">
|
|
23336
|
-
${t("PTR_ACKN_TERM_2")}
|
|
23337
|
-
</div>
|
|
23338
|
-
|
|
23339
|
-
|
|
23340
|
-
<div class="footer">
|
|
23341
|
-
<p>Generated on: ${currentDate}</p>
|
|
23342
|
-
<p>${t(ulbType)}</p>
|
|
23343
|
-
<p>This is a computer-generated document and does not require a signature.</p>
|
|
23344
|
-
<p>https://mseva.lgpunjab.gov.in/digit-ui/citizen/ptr-home</p>
|
|
23345
|
-
</div>
|
|
23346
|
-
</div>
|
|
23347
|
-
</body>
|
|
23348
|
-
</html>
|
|
23349
|
-
`;
|
|
23350
|
-
const printWindow = window.open("", "_blank");
|
|
23351
|
-
printWindow.document.write(content);
|
|
23352
|
-
printWindow.document.close();
|
|
23353
|
-
printWindow.onload = () => {
|
|
23354
|
-
setTimeout(() => {
|
|
23355
|
-
printWindow.print();
|
|
23356
|
-
printWindow.onafterprint = () => {
|
|
23357
|
-
printWindow.close();
|
|
23358
|
-
};
|
|
23359
|
-
}, 500);
|
|
23360
|
-
};
|
|
23361
|
-
};
|
|
23362
|
-
createAcknowledgementHTML();
|
|
23363
|
-
setShowToast({
|
|
23364
|
-
key: false,
|
|
23365
|
-
label: "PTR_ACKNOWLEDGEMENT_DOWNLOADED_SUCCESSFULLY"
|
|
23366
|
-
});
|
|
23367
|
-
} catch (error) {
|
|
23368
|
-
setShowToast({
|
|
23369
|
-
key: true,
|
|
23370
|
-
label: `PTR_ACKNOWLEDGEMENT_DOWNLOAD_ERROR: ${error.message}`
|
|
23371
|
-
});
|
|
23372
|
-
}
|
|
23373
|
-
};
|
|
23374
22248
|
let documentDate = t("CS_NA");
|
|
23375
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) {
|
|
23376
22250
|
var _pet_details$addition2;
|
|
@@ -23381,17 +22255,22 @@ const ApplicationDetails = () => {
|
|
|
23381
22255
|
async function getRecieptSearch({
|
|
23382
22256
|
tenantId,
|
|
23383
22257
|
payments,
|
|
22258
|
+
pdfkey,
|
|
23384
22259
|
...params
|
|
23385
22260
|
}) {
|
|
23386
|
-
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);
|
|
23387
22263
|
let response = {
|
|
23388
22264
|
filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
|
|
23389
22265
|
};
|
|
23390
22266
|
response = await Digit.PaymentService.generatePdf(tenantId, {
|
|
23391
22267
|
Payments: [{
|
|
23392
|
-
...payments
|
|
22268
|
+
...payments,
|
|
22269
|
+
application,
|
|
22270
|
+
approver,
|
|
22271
|
+
petAge
|
|
23393
22272
|
}]
|
|
23394
|
-
},
|
|
22273
|
+
}, pdfkey);
|
|
23395
22274
|
const fileStore = await Digit.PaymentService.printReciept(tenantId, {
|
|
23396
22275
|
fileStoreIds: response.filestoreIds[0]
|
|
23397
22276
|
});
|
|
@@ -23402,27 +22281,40 @@ const ApplicationDetails = () => {
|
|
|
23402
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");
|
|
23403
22282
|
dowloadOptions.push({
|
|
23404
22283
|
label: t("PTR_PET_DOWNLOAD_ACK_FORM"),
|
|
23405
|
-
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
|
+
}
|
|
23406
22292
|
});
|
|
23407
|
-
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") {
|
|
23408
22294
|
dowloadOptions.push({
|
|
23409
22295
|
label: t("PTR_CERTIFICATE"),
|
|
23410
22296
|
onClick: () => {
|
|
23411
|
-
|
|
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
|
+
});
|
|
23412
22303
|
}
|
|
23413
22304
|
});
|
|
23414
22305
|
} else {
|
|
23415
|
-
var _reciept_data$
|
|
23416
|
-
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);
|
|
23417
22308
|
}
|
|
23418
22309
|
if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
|
|
23419
22310
|
dowloadOptions.push({
|
|
23420
22311
|
label: t("PTR_FEE_RECIEPT"),
|
|
23421
22312
|
onClick: () => {
|
|
23422
|
-
var _reciept_data$
|
|
22313
|
+
var _reciept_data$Payment6;
|
|
23423
22314
|
return getRecieptSearch({
|
|
23424
|
-
tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$
|
|
23425
|
-
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"
|
|
23426
22318
|
});
|
|
23427
22319
|
}
|
|
23428
22320
|
});
|
|
@@ -23494,7 +22386,7 @@ const ApplicationDetails = () => {
|
|
|
23494
22386
|
}, t("WS_COMMON_TABLE_COL_ADDRESS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
|
|
23495
22387
|
className: "border-none",
|
|
23496
22388
|
label: t("PTR_ADDRESS"),
|
|
23497
|
-
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")
|
|
23498
22390
|
}), /*#__PURE__*/React.createElement(Row, {
|
|
23499
22391
|
className: "border-none",
|
|
23500
22392
|
label: t("PTR_PINCODE"),
|
|
@@ -24455,9 +23347,19 @@ const NewPTRStepperForm = () => {
|
|
|
24455
23347
|
const step = formState.step;
|
|
24456
23348
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
24457
23349
|
const pathParts = window.location.pathname.split("/");
|
|
24458
|
-
const
|
|
24459
|
-
|
|
24460
|
-
|
|
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);
|
|
24461
23363
|
console.log("shouldEnableSearch", shouldEnableSearch);
|
|
24462
23364
|
const {
|
|
24463
23365
|
isLoading,
|
|
@@ -24472,6 +23374,7 @@ const NewPTRStepperForm = () => {
|
|
|
24472
23374
|
useEffect(() => {
|
|
24473
23375
|
var _applicationData$PetR;
|
|
24474
23376
|
console.log("applicationData for hereee:>> ", applicationData);
|
|
23377
|
+
console.log("id", id);
|
|
24475
23378
|
if (id && applicationData !== null && applicationData !== void 0 && (_applicationData$PetR = applicationData.PetRegistrationApplications) !== null && _applicationData$PetR !== void 0 && _applicationData$PetR.length) {
|
|
24476
23379
|
dispatch(UPDATE_PTRNewApplication_FORM("responseData", applicationData.PetRegistrationApplications));
|
|
24477
23380
|
}
|