@mseva/upyog-ui-module-ads 1.1.88 → 1.1.90

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.
@@ -235,7 +235,9 @@ const transformBookingResponseToBookingData = (apiResponse = {}) => {
235
235
  advertisementName: first.advertisementName,
236
236
  poleNo: first.poleNo,
237
237
  amount,
238
- amountForDaysChosen
238
+ amountForDaysChosen,
239
+ bookingFromTime: first.bookingFromTime,
240
+ bookingToTime: first.bookingToTime
239
241
  };
240
242
  });
241
243
  out.cartDetails = groupedCartDetails;
@@ -15414,7 +15416,7 @@ const LocationSearchCard = ({
15414
15416
  padding: "12px"
15415
15417
  }
15416
15418
  }, (() => {
15417
- const rawLabel = nextText ?? (t ? t("ADS_PIN_LOCATION_LABEL") : null);
15419
+ const rawLabel = nextText || (t ? t("ADS_PIN_LOCATION_LABEL") : null);
15418
15420
  const labelText = typeof rawLabel === "string" && rawLabel.trim() ? rawLabel : t ? t("ADS_PIN_LOCATION_LABEL") || "Pick" : "Pick";
15419
15421
  return /*#__PURE__*/React.createElement("button", {
15420
15422
  type: "button",
@@ -17851,8 +17853,8 @@ const ADSAddress = ({
17851
17853
  }, [_onBlur]);
17852
17854
  const updateParent = (updatedFields = {}) => {
17853
17855
  var _onChangeRef$current;
17854
- const currentCity = updatedFields.city ?? city ?? ((_value === null || _value === void 0 ? void 0 : _value.city) || "");
17855
- const currentLocality = updatedFields.locality ?? locality ?? ((_value === null || _value === void 0 ? void 0 : _value.locality) || "");
17856
+ const currentCity = updatedFields.city || city || (_value === null || _value === void 0 ? void 0 : _value.city) || "";
17857
+ const currentLocality = updatedFields.locality || locality || (_value === null || _value === void 0 ? void 0 : _value.locality) || "";
17856
17858
  const addr = {
17857
17859
  addressId,
17858
17860
  doorNo,
@@ -18833,8 +18835,8 @@ const ADSAddressField = ({
18833
18835
  const normalize = (geoLocationObj, pincode, place) => {
18834
18836
  const normalized = {
18835
18837
  formattedAddress: place || (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.formattedAddress) || (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.place_name) || "",
18836
- latitude: (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.latitude) ?? (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.lat) ?? (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.y) ?? null,
18837
- longitude: (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.longitude) ?? (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.lng) ?? (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.x) ?? null,
18838
+ latitude: (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.latitude) || (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.lat) || (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.y) || null,
18839
+ longitude: (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.longitude) || (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.lng) || (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.x) || null,
18838
18840
  placeId: (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.placeId) || (geoLocationObj === null || geoLocationObj === void 0 ? void 0 : geoLocationObj.id) || null,
18839
18841
  raw: geoLocationObj || {},
18840
18842
  pincode: pincode || null
@@ -20672,7 +20674,7 @@ function NewApplicationTimeline({
20672
20674
  }, /*#__PURE__*/React.createElement("h3", {
20673
20675
  className: "custom-action-title"
20674
20676
  }, t("Action")), /*#__PURE__*/React.createElement("div", {
20675
- className: "custom-status-text"
20677
+ className: `custom-status-text ${(item === null || item === void 0 ? void 0 : item.performedAction) === "OBSERVATION" ? "chb-slot-status--unavailable" : ""}`
20676
20678
  }, t((item === null || item === void 0 ? void 0 : item.performedAction) || "CS_COMMON_NA")))), (item === null || item === void 0 ? void 0 : item.wfComment) && (item === null || item === void 0 ? void 0 : (_item$wfComment = item.wfComment) === null || _item$wfComment === void 0 ? void 0 : _item$wfComment.length) > 0 && (item === null || item === void 0 ? void 0 : (_item$wfComment2 = item.wfComment) === null || _item$wfComment2 === void 0 ? void 0 : _item$wfComment2.some(c => c === null || c === void 0 ? void 0 : c.trim())) && /*#__PURE__*/React.createElement("div", {
20677
20679
  className: "custom-comments-section container-full-width"
20678
20680
  }, /*#__PURE__*/React.createElement("div", {
@@ -22240,215 +22242,11 @@ function renderCanvas(renderFunc, canvas, text, opts, cb) {
22240
22242
  cb(e);
22241
22243
  }
22242
22244
  }
22243
- var create$1 = qrcode.create;
22244
22245
  var toCanvas = renderCanvas.bind(null, canvas.render);
22245
22246
  var toDataURL = renderCanvas.bind(null, canvas.renderToDataURL);
22246
22247
  var toString_1$1 = renderCanvas.bind(null, function (data, _, opts) {
22247
22248
  return svgTag.render(data, opts);
22248
22249
  });
22249
- var browser = {
22250
- create: create$1,
22251
- toCanvas: toCanvas,
22252
- toDataURL: toDataURL,
22253
- toString: toString_1$1
22254
- };
22255
-
22256
- const getAcknowledgement = async (application, t) => {
22257
- var _application$applican, _application$applican2, _application$applican3, _application$applican4, _application$cartDeta;
22258
- const currentDate = new Date().toLocaleDateString("en-IN", {
22259
- day: "2-digit",
22260
- month: "long",
22261
- year: "numeric"
22262
- });
22263
- const qrDataURL = await browser.toDataURL(window.location.href);
22264
- const content = `
22265
- <html>
22266
- <head>
22267
- <title>${t("ADS_ACKNOWLEDGMENT_FORM")}</title>
22268
- <style>
22269
- @page { margin: 0.5in; }
22270
- body {
22271
- font-family: 'Arial', sans-serif;
22272
- margin: 0;
22273
- padding: 20px;
22274
- font-size: 14px;
22275
- line-height: 1.6;
22276
- }
22277
- .acknowledgement-container {
22278
- max-width: 800px;
22279
- margin: 0 auto;
22280
- border: 2px solid #333;
22281
- padding: 30px;
22282
- background: white;
22283
- }
22284
- .header {
22285
- display: flex;
22286
- justify-content: space-between;
22287
- align-items: center;
22288
- text-align: center;
22289
- margin-bottom: 30px;
22290
- border-bottom: 2px solid #333;
22291
- padding-bottom: 20px;
22292
- position: relative;
22293
- }
22294
- .header-left,
22295
- .header-right {
22296
- flex: 0 0 auto;
22297
- }
22298
- .header-center {
22299
- text-align: center;
22300
- flex: 1;
22301
- }
22302
- .title {
22303
- font-size: 20px;
22304
- font-weight: bold;
22305
- margin: 10px 0;
22306
- color: #333;
22307
- }
22308
- .subtitle {
22309
- font-size: 16px;
22310
- margin: 5px 0;
22311
- color: #666;
22312
- }
22313
- .acknowledgement-text {
22314
- margin: 20px 0;
22315
- text-align: justify;
22316
- font-size: 15px;
22317
- }
22318
- .details-table {
22319
- width: 100%;
22320
- border-collapse: collapse;
22321
- margin: 20px 0;
22322
- }
22323
- .details-table th,
22324
- .details-table td {
22325
- padding: 12px;
22326
- text-align: left;
22327
- border: 1px solid #ddd;
22328
- }
22329
- .details-table th {
22330
- background: #f5f5f5;
22331
- font-weight: bold;
22332
- width: 40%;
22333
- }
22334
- .footer {
22335
- margin-top: 30px;
22336
- text-align: center;
22337
- font-size: 12px;
22338
- color: #666;
22339
- }
22340
- @media print {
22341
- body { background: white !important; }
22342
- }
22343
- </style>
22344
- </head>
22345
- <body>
22346
- <div class="acknowledgement-container">
22347
- <div class="header">
22348
- <div class="header-left">
22349
- <img src="https://s3.ap-south-1.amazonaws.com/pb-egov-assets/${application === null || application === void 0 ? void 0 : application.tenantId}/logo.png"
22350
- style="width: 120px; height: 120px;" />
22351
- </div>
22352
- <div class="header-center">
22353
- <div class="title">Advertisement and Hoarding Booking Acknowledgement</div>
22354
- <div class="subtitle">Municipal Corporation</div>
22355
- </div>
22356
- <div class="header-right">
22357
- <img src="${qrDataURL}" style="width: 120px; height: 120px;" />
22358
- </div>
22359
- </div>
22360
-
22361
- <div class="acknowledgement-text">
22362
- ${t("ADV_ACK_TEXT_2")}
22363
- </div>
22364
-
22365
- <h3>${t("ADS_APPLICANT_DETAILS")}</h3>
22366
- <table class="details-table">
22367
- <tr>
22368
- <th>${t("WS_COMMON_TABLE_COL_APP_NO_LABEL")}</th>
22369
- <td>${(application === null || application === void 0 ? void 0 : application.bookingNo) || "Not Available"}</td>
22370
- </tr>
22371
- <tr>
22372
- <th>${t("BPA_BASIC_DETAILS_APPLICATION_DATE_LABEL")}</th>
22373
- <td>${application !== null && application !== void 0 && application.applicationDate ? new Date(application === null || application === void 0 ? void 0 : application.applicationDate).toLocaleDateString("en-GB") : "N/A"}</td>
22374
- </tr>
22375
- <tr>
22376
- <th>${t("BPA_BASIC_DETAILS_APPLICATION_NAME_LABEL")}</th>
22377
- <td>${(application === null || application === void 0 ? void 0 : (_application$applican = application.applicantDetail) === null || _application$applican === void 0 ? void 0 : _application$applican.applicantName) || "Not Specified"}</td>
22378
- </tr>
22379
- <tr>
22380
- <th>${t("PDF_STATIC_LABEL_WS_CONSOLIDATED_CONCERNED_PLUMBER_CONTACT")}</th>
22381
- <td>${(application === null || application === void 0 ? void 0 : (_application$applican2 = application.applicantDetail) === null || _application$applican2 === void 0 ? void 0 : _application$applican2.applicantMobileNo) || "Not Specified"}</td>
22382
- </tr>
22383
- <tr>
22384
- <th>${t("ADS_ALTERNATE_NUMBER")}</th>
22385
- <td>${(application === null || application === void 0 ? void 0 : (_application$applican3 = application.applicantDetail) === null || _application$applican3 === void 0 ? void 0 : _application$applican3.applicantAlternateMobileNo) || "Not Specified"}</td>
22386
- </tr>
22387
- <tr>
22388
- <th>${t("PDF_STATIC_LABEL_WS_CONSOLIDATED_ACKNOWELDGMENT_EMAIL")}</th>
22389
- <td>${(application === null || application === void 0 ? void 0 : (_application$applican4 = application.applicantDetail) === null || _application$applican4 === void 0 ? void 0 : _application$applican4.applicantEmailId) || "Not Specified"}</td>
22390
- </tr>
22391
- <tr>
22392
- <th>${t("TL_HOME_SEARCH_RESULTS_APP_STATUS_LABEL")}</th>
22393
- <td style="color: #28a745; font-weight: bold;">${t(application === null || application === void 0 ? void 0 : application.bookingStatus) || "SUBMITTED"}</td>
22394
- </tr>
22395
- </table>
22396
-
22397
- ${(application === null || application === void 0 ? void 0 : (_application$cartDeta = application.cartDetails) === null || _application$cartDeta === void 0 ? void 0 : _application$cartDeta.length) > 0 ? `
22398
- <h3>${t("ADVERTISEMENT_DETAILS")}</h3>
22399
- <table class="details-table">
22400
- <tr>
22401
- <th>${t("ADS_AD_TYPE")}</th>
22402
- <th>${t("CS_ADDCOMPLAINT_LOCATION")}</th>
22403
- <th>${t("ADS_FACE_AREA")}</th>
22404
- <th>${t("CHB_BOOKING_DATE")}</th>
22405
- <th>${t("ADS_FROM_TIME")}</th>
22406
- <th>${t("ADS_TO_TIME")}</th>
22407
- <th>${t("ADS_NIGHT_LIGHT")}</th>
22408
- <th>${t("PT_OWNERSHIP_INFO_NAME")}</th>
22409
- <th>${t("POLE_NO")}</th>
22410
- </tr>
22411
- ${application.cartDetails.map(item => `
22412
- <tr>
22413
- <td>${t(item.addType) || "N/A"}</td>
22414
- <td>${t(item.location) || "N/A"}</td>
22415
- <td>${t(item.faceArea.replace(item.addType + "_", "")) || "N/A"}</td>
22416
- <td>${item.bookingDate || "N/A"}</td>
22417
- <td>${item.bookingFromTime || "N/A"}</td>
22418
- <td>${item.bookingToTime || "N/A"}</td>
22419
- <td>${item.nightLight ? "With Light" : "Without Light"}</td>
22420
- <td>${item.advertisementName || "N/A"}</td>
22421
- <td>${item.poleNo || "N/A"}</td>
22422
- </tr>
22423
- `).join("")}
22424
- </table>
22425
- ` : ""}
22426
-
22427
- <div class="acknowledgement-text">
22428
- ${t("ADV_ACK_TEXT_1")}
22429
- </div>
22430
-
22431
- <div class="footer">
22432
- <p>Generated on: ${currentDate}</p>
22433
- <p>Municipal Corporation</p>
22434
- <p>This is a computer-generated document and does not require a signature.</p>
22435
- </div>
22436
- </div>
22437
- </body>
22438
- </html>
22439
- `;
22440
- const printWindow = window.open("", "_blank");
22441
- printWindow.document.write(content);
22442
- printWindow.document.close();
22443
- printWindow.onload = () => {
22444
- setTimeout(() => {
22445
- printWindow.print();
22446
- printWindow.onafterprint = () => {
22447
- printWindow.close();
22448
- };
22449
- }, 500);
22450
- };
22451
- };
22452
22250
 
22453
22251
  const ADSCartDetails$1 = ({
22454
22252
  cartDetails,
@@ -22495,7 +22293,7 @@ const ADSCartDetails$1 = ({
22495
22293
  }, /*#__PURE__*/React.createElement("div", {
22496
22294
  onClick: () => toggleExpand(key),
22497
22295
  className: "ads-cart-item-header ads-cart-item-header--clickable"
22498
- }, /*#__PURE__*/React.createElement("span", null, t((item === null || item === void 0 ? void 0 : (_item$ad = item.ad) === null || _item$ad === void 0 ? void 0 : _item$ad.name) ?? (item === null || item === void 0 ? void 0 : (_item$ad2 = item.ad) === null || _item$ad2 === void 0 ? void 0 : _item$ad2.location)), item !== null && item !== void 0 && (_item$ad3 = item.ad) !== null && _item$ad3 !== void 0 && _item$ad3.amount ? ` — ₹${((item === null || item === void 0 ? void 0 : (_item$ad4 = item.ad) === null || _item$ad4 === void 0 ? void 0 : _item$ad4.amount) * 1.18 * (item === null || item === void 0 ? void 0 : (_item$slots = item.slots) === null || _item$slots === void 0 ? void 0 : _item$slots.length)).toFixed(2)}` : ""), /*#__PURE__*/React.createElement("span", {
22296
+ }, /*#__PURE__*/React.createElement("span", null, t((item === null || item === void 0 ? void 0 : (_item$ad = item.ad) === null || _item$ad === void 0 ? void 0 : _item$ad.name) || (item === null || item === void 0 ? void 0 : (_item$ad2 = item.ad) === null || _item$ad2 === void 0 ? void 0 : _item$ad2.location)), item !== null && item !== void 0 && (_item$ad3 = item.ad) !== null && _item$ad3 !== void 0 && _item$ad3.amount ? ` — ₹${((item === null || item === void 0 ? void 0 : (_item$ad4 = item.ad) === null || _item$ad4 === void 0 ? void 0 : _item$ad4.amount) * 1.18 * (item === null || item === void 0 ? void 0 : (_item$slots = item.slots) === null || _item$slots === void 0 ? void 0 : _item$slots.length)).toFixed(2)}` : ""), /*#__PURE__*/React.createElement("span", {
22499
22297
  className: "ads-cart-item-toggle"
22500
22298
  }, isOpen ? "▾" : "▸")), isOpen && /*#__PURE__*/React.createElement("div", {
22501
22299
  className: "ads-cart-table"
@@ -22598,7 +22396,7 @@ const ADSApplicationDetails = () => {
22598
22396
  enabled: true
22599
22397
  });
22600
22398
  let docs = [];
22601
- docs = (application === null || application === void 0 ? void 0 : application.documents) ?? [];
22399
+ docs = (application === null || application === void 0 ? void 0 : application.documents) || [];
22602
22400
  if (isLoading || auditDataLoading || workflowDetails !== null && workflowDetails !== void 0 && workflowDetails.isLoading) {
22603
22401
  return /*#__PURE__*/React.createElement(Loader$2, null);
22604
22402
  }
@@ -22647,31 +22445,35 @@ const ADSApplicationDetails = () => {
22647
22445
  });
22648
22446
  window.open(fileStore[fileStoreId], "_blank");
22649
22447
  }
22650
- const downloadAcknowledgement = async application => {
22651
- try {
22652
- if (!application) {
22653
- throw new Error("Booking Application data is missing");
22654
- }
22655
- getAcknowledgement(application, t);
22656
- setShowToast({
22657
- key: "success",
22658
- message: "ADV_ACKNOWLEDGEMENT_DOWNLOADED_SUCCESSFULLY"
22659
- });
22660
- setActionError("Acknowledgment downloaded successfully");
22661
- } catch (error) {
22662
- console.error("Acknowledgement download error:", error);
22663
- setShowToast({
22664
- key: "error",
22665
- message: `ADV_ACKNOWLEDGEMENT_DOWNLOAD_ERROR: ${error.message}`
22666
- });
22667
- setActionError("Something went wrong");
22448
+ async function getAcknowledgementLetter({
22449
+ tenantId,
22450
+ payments,
22451
+ ...params
22452
+ }) {
22453
+ let application = new_data;
22454
+ let fileStoreId = application === null || application === void 0 ? void 0 : application.permissionLetterFilestoreId;
22455
+ if (!fileStoreId) {
22456
+ const response = await Digit.PaymentService.generatePdf(tenantId, {
22457
+ Payments: [{
22458
+ ...payments,
22459
+ ...application
22460
+ }]
22461
+ }, "advacknowledgement");
22462
+ fileStoreId = response === null || response === void 0 ? void 0 : response.filestoreIds[0];
22668
22463
  }
22669
- };
22464
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
22465
+ fileStoreIds: fileStoreId
22466
+ });
22467
+ window.open(fileStore[fileStoreId], "_blank");
22468
+ }
22670
22469
  let dowloadOptions = [];
22671
22470
  const cartData = transformAdsData(ads_details === null || ads_details === void 0 ? void 0 : ads_details.cartDetails);
22672
22471
  dowloadOptions.push({
22673
22472
  label: t("PTR_PET_DOWNLOAD_ACK_FORM"),
22674
- onClick: () => downloadAcknowledgement(application)
22473
+ onClick: () => getAcknowledgementLetter({
22474
+ tenantId: tenantId,
22475
+ payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
22476
+ })
22675
22477
  });
22676
22478
  if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
22677
22479
  dowloadOptions.push({
@@ -22751,7 +22553,7 @@ const ADSApplicationDetails = () => {
22751
22553
  fontSize: "24px"
22752
22554
  }
22753
22555
  }, t("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(ADSCartDetails$1, {
22754
- cartDetails: cartData ?? [],
22556
+ cartDetails: cartData || [],
22755
22557
  t: t
22756
22558
  }), /*#__PURE__*/React.createElement(CardSubHeader, {
22757
22559
  style: {
@@ -23158,7 +22960,7 @@ if (_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag || _Ma
23158
22960
  }
23159
22961
 
23160
22962
  const ApplicationDetails = () => {
23161
- var _applicationDetails$b, _Digit$Hooks$ads, _Digit$Hooks$ads$useA, _displayData$applican, _displayData$applican2, _workflowDetails$data, _workflowDetails$data2, _reciept_data$Payment, _displayData$applican4, _displayData$applican5, _displayData$applican6, _displayData$applican7, _displayData$applican8, _application$document, _displayData$applican9, _workflowDetails$data4, _workflowDetails$data5;
22963
+ var _applicationDetails$b, _Digit$Hooks$ads, _Digit$Hooks$ads$useA, _displayData$applican, _displayData$applican2, _workflowDetails$data, _workflowDetails$data2, _displayData$applican4, _displayData$applican5, _displayData$applican6, _displayData$applican7, _displayData$applican8, _application$document, _displayData$applican9, _workflowDetails$data4, _workflowDetails$data5;
23162
22964
  const {
23163
22965
  id
23164
22966
  } = useParams();
@@ -23210,7 +23012,7 @@ const ApplicationDetails = () => {
23210
23012
  const stateId = ((_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ULBService = _Digit.ULBService) === null || _Digit$ULBService === void 0 ? void 0 : (_Digit$ULBService$get = _Digit$ULBService.getStateId) === null || _Digit$ULBService$get === void 0 ? void 0 : _Digit$ULBService$get.call(_Digit$ULBService)) || null;
23211
23013
  const argForFilefetch = stateId || tenantId;
23212
23014
  Digit.UploadServices.Filefetch(filesArray, argForFilefetch).then(res => {
23213
- let data = (res === null || res === void 0 ? void 0 : res.data) ?? (res === null || res === void 0 ? void 0 : res.files) ?? res;
23015
+ let data = (res === null || res === void 0 ? void 0 : res.data) || (res === null || res === void 0 ? void 0 : res.files) || res;
23214
23016
  if (Array.isArray(data)) {
23215
23017
  const asMap = {};
23216
23018
  data.forEach(item => {
@@ -23240,7 +23042,7 @@ const ApplicationDetails = () => {
23240
23042
  bookingNo: id
23241
23043
  }
23242
23044
  });
23243
- const normalizedAppObject = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$b = applicationDetails.bookingApplication) === null || _applicationDetails$b === void 0 ? void 0 : _applicationDetails$b[0]) ?? [];
23045
+ const normalizedAppObject = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$b = applicationDetails.bookingApplication) === null || _applicationDetails$b === void 0 ? void 0 : _applicationDetails$b[0]) || [];
23244
23046
  const bookingObj = normalizedAppObject;
23245
23047
  const application = bookingObj || normalizedAppObject || appDetails || null;
23246
23048
  const new_data = transformBookingResponseToBookingData(applicationDetails);
@@ -23326,26 +23128,6 @@ const ApplicationDetails = () => {
23326
23128
  setAppDetails({});
23327
23129
  }
23328
23130
  }, [isLoading, bookingObj]);
23329
- const downloadAcknowledgement = async application => {
23330
- try {
23331
- if (!application) {
23332
- throw new Error("Booking Application data is missing");
23333
- }
23334
- getAcknowledgement(application, t);
23335
- setShowToast({
23336
- key: "success",
23337
- message: t("ADV_ACKNOWLEDGEMENT_DOWNLOADED_SUCCESSFULLY")
23338
- });
23339
- setError("Acknowledgement Downloaded Successfully");
23340
- } catch (error) {
23341
- console.error("Acknowledgement download error:", error);
23342
- setShowToast({
23343
- key: "error",
23344
- message: `${error.message}`
23345
- });
23346
- setError("Something Went Wrong");
23347
- }
23348
- };
23349
23131
  function onActionSelect(wfAction) {
23350
23132
  if (!wfAction) return;
23351
23133
  if (wfAction.action === "PAY") {
@@ -23370,7 +23152,7 @@ const ApplicationDetails = () => {
23370
23152
  }
23371
23153
  const submitAction = async dataPayload => {
23372
23154
  var _applicationDetails$A, _applicationDetails$d, _dataPayload$Licenses, _workflowDetails$data3;
23373
- const payloadSource = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0]) ?? (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$d = applicationDetails.data) === null || _applicationDetails$d === void 0 ? void 0 : _applicationDetails$d[0]) ?? (applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails[0]) ?? bookingObj;
23155
+ const payloadSource = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0]) || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$d = applicationDetails.data) === null || _applicationDetails$d === void 0 ? void 0 : _applicationDetails$d[0]) || (applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails[0]) || bookingObj;
23374
23156
  if (!payloadSource) {
23375
23157
  setShowToast({
23376
23158
  key: "error",
@@ -23492,32 +23274,59 @@ const ApplicationDetails = () => {
23492
23274
  });
23493
23275
  window.open(fileStore[fileStoreId], "_blank");
23494
23276
  }
23277
+ async function getAcknowledgementLetter({
23278
+ tenantId,
23279
+ payments,
23280
+ ...params
23281
+ }) {
23282
+ let application = new_data;
23283
+ let fileStoreId = application === null || application === void 0 ? void 0 : application.permissionLetterFilestoreId;
23284
+ if (!fileStoreId) {
23285
+ const response = await Digit.PaymentService.generatePdf(tenantId, {
23286
+ Payments: [{
23287
+ ...payments,
23288
+ ...application
23289
+ }]
23290
+ }, "advacknowledgement");
23291
+ fileStoreId = response === null || response === void 0 ? void 0 : response.filestoreIds[0];
23292
+ }
23293
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
23294
+ fileStoreIds: fileStoreId
23295
+ });
23296
+ window.open(fileStore[fileStoreId], "_blank");
23297
+ }
23495
23298
  let downloadOptions = [];
23496
- downloadOptions.push({
23497
- label: t("PTR_PET_DOWNLOAD_ACK_FORM"),
23498
- onClick: () => downloadAcknowledgement(application)
23499
- });
23500
- if (reciept_data && (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$Payment.length) > 0 && recieptDataLoading === false) {
23299
+ if ((bookingObj === null || bookingObj === void 0 ? void 0 : bookingObj.bookingStatus) === "BOOKED" || (bookingObj === null || bookingObj === void 0 ? void 0 : bookingObj.bookingStatus) === "CANCELLED") {
23300
+ var _reciept_data$Payment;
23501
23301
  downloadOptions.push({
23502
- label: t("CHB_FEE_RECEIPT"),
23503
- onClick: () => {
23504
- var _reciept_data$Payment2;
23505
- return getRecieptSearch({
23506
- tenantId: 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.tenantId,
23507
- payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
23508
- });
23509
- }
23510
- });
23511
- if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) downloadOptions.push({
23512
- label: t("CHB_PERMISSION_LETTER"),
23513
- onClick: () => {
23514
- var _reciept_data$Payment3;
23515
- return getPermissionLetter({
23516
- tenantId: 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.tenantId,
23517
- payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
23518
- });
23519
- }
23302
+ label: t("PTR_PET_DOWNLOAD_ACK_FORM"),
23303
+ onClick: () => getAcknowledgementLetter({
23304
+ tenantId: tenantId,
23305
+ payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
23306
+ })
23520
23307
  });
23308
+ if (reciept_data && (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$Payment.length) > 0 && recieptDataLoading === false) {
23309
+ downloadOptions.push({
23310
+ label: t("CHB_FEE_RECEIPT"),
23311
+ onClick: () => {
23312
+ var _reciept_data$Payment2;
23313
+ return getRecieptSearch({
23314
+ tenantId: 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.tenantId,
23315
+ payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
23316
+ });
23317
+ }
23318
+ });
23319
+ if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) downloadOptions.push({
23320
+ label: t("CHB_PERMISSION_LETTER"),
23321
+ onClick: () => {
23322
+ var _reciept_data$Payment3;
23323
+ return getPermissionLetter({
23324
+ tenantId: 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.tenantId,
23325
+ payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
23326
+ });
23327
+ }
23328
+ });
23329
+ }
23521
23330
  }
23522
23331
  const cartData = transformAdsData(bookingObj === null || bookingObj === void 0 ? void 0 : bookingObj.cartDetails);
23523
23332
  const [expired, setExpired] = useState(false);
@@ -23540,7 +23349,25 @@ const ApplicationDetails = () => {
23540
23349
  styles: {
23541
23350
  fontSize: "32px"
23542
23351
  }
23543
- }, t("ADS_APP_OVER_VIEW_HEADER")))), /*#__PURE__*/React.createElement(Card$1, null, (displayData === null || displayData === void 0 ? void 0 : (_displayData$applican4 = displayData.applicantData) === null || _displayData$applican4 === void 0 ? void 0 : (_displayData$applican5 = _displayData$applican4.auditDetails) === null || _displayData$applican5 === void 0 ? void 0 : _displayData$applican5.createdTime) && (displayData === null || displayData === void 0 ? void 0 : (_displayData$applican6 = displayData.applicantData) === null || _displayData$applican6 === void 0 ? void 0 : _displayData$applican6.bookingStatus) === "PENDING_FOR_PAYMENT" && /*#__PURE__*/React.createElement("div", {
23352
+ }, t("ADS_APP_OVER_VIEW_HEADER")), /*#__PURE__*/React.createElement("div", {
23353
+ style: {
23354
+ display: "flex",
23355
+ alignItems: "center",
23356
+ gap: "12px"
23357
+ }
23358
+ }, downloadOptions && (downloadOptions === null || downloadOptions === void 0 ? void 0 : downloadOptions.length) > 0 && /*#__PURE__*/React.createElement("div", {
23359
+ style: {
23360
+ position: "relative",
23361
+ zIndex: 10
23362
+ }
23363
+ }, /*#__PURE__*/React.createElement(MultiLink, {
23364
+ className: "multilinkWrapper",
23365
+ onHeadClick: () => setShowOptions(!showOptions),
23366
+ displayOptions: showOptions,
23367
+ options: downloadOptions,
23368
+ downloadBtnClassName: "employee-download-btn-className",
23369
+ optionsClassName: "employee-options-btn-className"
23370
+ }))))), /*#__PURE__*/React.createElement(Card$1, null, (displayData === null || displayData === void 0 ? void 0 : (_displayData$applican4 = displayData.applicantData) === null || _displayData$applican4 === void 0 ? void 0 : (_displayData$applican5 = _displayData$applican4.auditDetails) === null || _displayData$applican5 === void 0 ? void 0 : _displayData$applican5.createdTime) && (displayData === null || displayData === void 0 ? void 0 : (_displayData$applican6 = displayData.applicantData) === null || _displayData$applican6 === void 0 ? void 0 : _displayData$applican6.bookingStatus) === "PENDING_FOR_PAYMENT" && /*#__PURE__*/React.createElement("div", {
23544
23371
  style: {
23545
23372
  display: "flex",
23546
23373
  justifyContent: "flex-end"
@@ -23560,7 +23387,7 @@ const ApplicationDetails = () => {
23560
23387
  label: t(formatLabel(key)),
23561
23388
  text: Array.isArray(value) ? value.map(item => typeof item === "object" ? t((item === null || item === void 0 ? void 0 : item.code) || "N/A") : t(item || "N/A")).join(", ") : typeof value === "object" ? t((value === null || value === void 0 ? void 0 : value.code) || "N/A") : t(value || "N/A")
23562
23389
  })))), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("ADS_APPLICATION_ADS_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(ADSCartDetails$1, {
23563
- cartDetails: cartData ?? [],
23390
+ cartDetails: cartData || [],
23564
23391
  t: t
23565
23392
  })), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("ADS_APPLICATION_DOCUMENTS_OVERVIEW")), /*#__PURE__*/React.createElement(Fragment$1, null, (application === null || application === void 0 ? void 0 : (_application$document = application.documents) === null || _application$document === void 0 ? void 0 : _application$document.length) > 0 ? /*#__PURE__*/React.createElement("div", {
23566
23393
  style: {
@@ -24349,7 +24176,7 @@ const ADSCitizenDetailsNew = ({
24349
24176
  ...slot,
24350
24177
  isTimerRequired: true
24351
24178
  }));
24352
- })) ?? [];
24179
+ })) || [];
24353
24180
  const payload = {
24354
24181
  advertisementSlotSearchCriteria: enrichedSlots
24355
24182
  };
@@ -25487,7 +25314,7 @@ const ADSPenalty = ({
25487
25314
  useEffect(() => {
25488
25315
  if (currentStepData) {
25489
25316
  Object.entries(currentStepData).forEach(([key, value]) => {
25490
- setValue(key, value ?? "");
25317
+ setValue(key, value || "");
25491
25318
  });
25492
25319
  }
25493
25320
  }, [currentStepData, setValue]);
@@ -25513,12 +25340,12 @@ const ADSPenalty = ({
25513
25340
  value: "Yes",
25514
25341
  checked: props.value === "Yes",
25515
25342
  onChange: () => props.onChange("Yes")
25516
- }), " ", "Yes"), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
25343
+ }), " Yes"), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
25517
25344
  type: "radio",
25518
25345
  value: "No",
25519
25346
  checked: props.value === "No",
25520
25347
  onChange: () => props.onChange("No")
25521
- }), " ", "No"))
25348
+ }), " No"))
25522
25349
  }), /*#__PURE__*/React.createElement(CardLabel, null, t("Penalty Amount")), /*#__PURE__*/React.createElement(Controller, {
25523
25350
  name: "penaltyAmount",
25524
25351
  control: control,
@@ -25526,7 +25353,7 @@ const ADSPenalty = ({
25526
25353
  validate: val => penaltyValue === "No" || !!val || t("This field is required")
25527
25354
  },
25528
25355
  render: props => /*#__PURE__*/React.createElement(TextInput, {
25529
- value: props.value ?? "",
25356
+ value: props.value || "",
25530
25357
  onChange: e => props.onChange(e.target.value),
25531
25358
  disabled: penaltyValue !== "Yes",
25532
25359
  t: t
@@ -25542,7 +25369,7 @@ const ADSPenalty = ({
25542
25369
  validate: val => penaltyValue === "No" || !!val || t("This field is required")
25543
25370
  },
25544
25371
  render: props => /*#__PURE__*/React.createElement(TextInput, {
25545
- value: props.value ?? "",
25372
+ value: props.value || "",
25546
25373
  onChange: e => props.onChange(e.target.value),
25547
25374
  disabled: penaltyValue !== "Yes",
25548
25375
  t: t
@@ -25775,7 +25602,7 @@ const NewADSStepFormFive = ({
25775
25602
  tenantId,
25776
25603
  ...source,
25777
25604
  bookingStatus: statusToSend === "INITIATED" ? "BOOKING_CREATED" : statusToSend === "REFUND" ? "CANCELLED" : statusToSend || (source === null || source === void 0 ? void 0 : source.bookingStatus),
25778
- documents: (source === null || source === void 0 ? void 0 : source.documents) ?? [],
25605
+ documents: (source === null || source === void 0 ? void 0 : source.documents) || [],
25779
25606
  workflow: {
25780
25607
  businessService: (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data4 = workflowDetails.data) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.applicationBusinessService) || "ADV",
25781
25608
  states: matchingState || statusToSend || "",