@djb25/digit-ui-module-common 1.0.8 → 1.0.9

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.
@@ -16,18 +16,6 @@ function _extends() {
16
16
  return n;
17
17
  }, _extends.apply(null, arguments);
18
18
  }
19
- function _objectDestructuringEmpty(t) {
20
- if (null == t) throw new TypeError("Cannot destructure " + t);
21
- }
22
- function _objectWithoutPropertiesLoose(r, e) {
23
- if (null == r) return {};
24
- var t = {};
25
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
26
- if (-1 !== e.indexOf(n)) continue;
27
- t[n] = r[n];
28
- }
29
- return t;
30
- }
31
19
 
32
20
  const stringReplaceAll = function (str, searcher, replaceWith) {
33
21
  if (str === void 0) {
@@ -53,7 +41,6 @@ const timerEnabledForBusinessService = businessService => {
53
41
  return false;
54
42
  };
55
43
 
56
- const _excluded = ["state"];
57
44
  const SelectPaymentType = props => {
58
45
  var _Digit$UserService$ge, _Digit$UserService$ge2, _data$Bill, _data$Bill$, _bill$billDetails, _bill$billDetails$sor, _bill$billDetails2, _bill$billDetails2$so;
59
46
  const optionFirst = {
@@ -69,34 +56,37 @@ const SelectPaymentType = props => {
69
56
  const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
70
57
  const payersActiveName = userInfo === null || userInfo === void 0 ? void 0 : userInfo.name;
71
58
  const payersActiveMobileNumber = userInfo === null || userInfo === void 0 ? void 0 : userInfo.mobileNumber;
72
- const _useTranslation = useTranslation(),
73
- t = _useTranslation.t;
59
+ const {
60
+ t
61
+ } = useTranslation();
74
62
  const history = useHistory();
75
- const _useLocation = useLocation(),
76
- state = _useLocation.state,
77
- location = _objectWithoutPropertiesLoose(_useLocation, _excluded);
78
- const _useParams = useParams(),
79
- consumerCode = _useParams.consumerCode,
80
- businessService = _useParams.businessService,
81
- paymentAmt = _useParams.paymentAmt;
82
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
83
- wrkflow = _Digit$Hooks$useQuery.workflow,
84
- _tenantId = _Digit$Hooks$useQuery.tenantId,
85
- ConsumerName = _Digit$Hooks$useQuery.ConsumerName;
86
- const _useState = useState(state === null || state === void 0 ? void 0 : state.bill),
87
- bill = _useState[0],
88
- setBill = _useState[1];
63
+ const {
64
+ state,
65
+ ...location
66
+ } = useLocation();
67
+ const {
68
+ consumerCode,
69
+ businessService,
70
+ paymentAmt
71
+ } = useParams();
72
+ const {
73
+ workflow: wrkflow,
74
+ tenantId: _tenantId,
75
+ ConsumerName
76
+ } = Digit.Hooks.useQueryParams();
77
+ const [bill, setBill] = useState(state === null || state === void 0 ? void 0 : state.bill);
89
78
  const tenantId = (state === null || state === void 0 ? void 0 : state.tenantId) || _tenantId || ((_Digit$UserService$ge2 = Digit.UserService.getUser().info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.tenantId);
90
79
  const isLoggedIn = Digit.UserService.getUser();
91
- const _ref = state !== null && state !== void 0 && state.bill ? {
92
- isLoading: false
93
- } : Digit.Hooks.useFetchPayment({
94
- tenantId,
95
- businessService,
96
- consumerCode
97
- }),
98
- data = _ref.data,
99
- isLoading = _ref.isLoading;
80
+ const {
81
+ data,
82
+ isLoading
83
+ } = state !== null && state !== void 0 && state.bill ? {
84
+ isLoading: false
85
+ } : Digit.Hooks.useFetchPayment({
86
+ tenantId,
87
+ businessService,
88
+ consumerCode
89
+ });
100
90
  let Useruuid = (data === null || data === void 0 ? void 0 : (_data$Bill = data.Bill) === null || _data$Bill === void 0 ? void 0 : (_data$Bill$ = _data$Bill[0]) === null || _data$Bill$ === void 0 ? void 0 : _data$Bill$.userId) || "";
101
91
  let requestCriteria = ["/user/_search", {}, {
102
92
  data: {
@@ -109,42 +99,31 @@ const SelectPaymentType = props => {
109
99
  enabled: Useruuid ? true : false,
110
100
  cacheTime: 100
111
101
  }];
112
- const _Digit$Hooks$useCusto = Digit.Hooks.useCustomAPIHook(...requestCriteria),
113
- isUserLoading = _Digit$Hooks$useCusto.isLoading,
114
- userData = _Digit$Hooks$useCusto.data;
102
+ const {
103
+ isLoading: isUserLoading,
104
+ data: userData,
105
+ revalidate
106
+ } = Digit.Hooks.useCustomAPIHook(...requestCriteria);
115
107
  const billDetails = (bill === null || bill === void 0 ? void 0 : (_bill$billDetails = bill.billDetails) === null || _bill$billDetails === void 0 ? void 0 : (_bill$billDetails$sor = _bill$billDetails.sort((a, b) => b.fromPeriod - a.fromPeriod)) === null || _bill$billDetails$sor === void 0 ? void 0 : _bill$billDetails$sor[0]) || [];
116
108
  const Arrears = (bill === null || bill === void 0 ? void 0 : (_bill$billDetails2 = bill.billDetails) === null || _bill$billDetails2 === void 0 ? void 0 : (_bill$billDetails2$so = _bill$billDetails2.sort((a, b) => b.fromPeriod - a.fromPeriod)) === null || _bill$billDetails2$so === void 0 ? void 0 : _bill$billDetails2$so.reduce((total, current, index) => index === 0 ? total : total + current.amount, 0)) || 0;
117
- const _useState2 = useState(optionFirst),
118
- paymentType = _useState2[0],
119
- setPaymentType = _useState2[1];
120
- const _useState3 = useState(""),
121
- payersName = _useState3[0],
122
- setPayersName = _useState3[1];
123
- const _useState4 = useState(""),
124
- payersMobileNumber = _useState4[0],
125
- setPayersMobileNumber = _useState4[1];
126
- const _useForm = useForm(),
127
- handleSubmit = _useForm.handleSubmit;
128
- const _useState5 = useState(false),
129
- canSubmit = _useState5[0],
130
- setCanSubmit = _useState5[1];
131
- const _useState6 = useState(null),
132
- mobileNumberError = _useState6[0],
133
- setmobileNumberError = _useState6[1];
134
- const _useState7 = useState(false),
135
- isCheckBox = _useState7[0],
136
- setIsCheckBox = _useState7[1];
137
- const _useState8 = useState(false),
138
- isCCFEnabled = _useState8[0],
139
- setisCCFEnabled = _useState8[1];
140
- const _useState9 = useState(""),
141
- mdmsConfig = _useState9[0],
142
- setMdmsConfig = _useState9[1];
143
- const _Digit$Hooks$useCusto2 = Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(), "common-masters", [{
144
- name: "CitizenConsentForm"
145
- }]),
146
- citizenConcentFormLoading = _Digit$Hooks$useCusto2.isLoading,
147
- ccfData = _Digit$Hooks$useCusto2.data;
109
+ const [paymentType, setPaymentType] = useState(optionFirst);
110
+ const [payersName, setPayersName] = useState("");
111
+ const [payersMobileNumber, setPayersMobileNumber] = useState("");
112
+ const {
113
+ control,
114
+ handleSubmit
115
+ } = useForm();
116
+ const [canSubmit, setCanSubmit] = useState(false);
117
+ const [mobileNumberError, setmobileNumberError] = useState(null);
118
+ const [isCheckBox, setIsCheckBox] = useState(false);
119
+ const [isCCFEnabled, setisCCFEnabled] = useState(false);
120
+ const [mdmsConfig, setMdmsConfig] = useState("");
121
+ const {
122
+ isLoading: citizenConcentFormLoading,
123
+ data: ccfData
124
+ } = Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(), "common-masters", [{
125
+ name: "CitizenConsentForm"
126
+ }]);
148
127
  function setTermsAndPolicyDetails(e) {
149
128
  setIsCheckBox(e.target.checked);
150
129
  }
@@ -172,7 +151,7 @@ const SelectPaymentType = props => {
172
151
  var _isCCFEnabled$checkBo;
173
152
  return /*#__PURE__*/React.createElement("span", null, isCCFEnabled === null || isCCFEnabled === void 0 ? void 0 : (_isCCFEnabled$checkBo = isCCFEnabled.checkBoxLabels) === null || _isCCFEnabled$checkBo === void 0 ? void 0 : _isCCFEnabled$checkBo.map((data, index) => {
174
153
  var _isCCFEnabled$checkBo2;
175
- return /*#__PURE__*/React.createElement("span", null, (data === null || data === void 0 ? void 0 : data.linkPrefix) && /*#__PURE__*/React.createElement("span", null, t((data === null || data === void 0 ? void 0 : data.linkPrefix) + "_")), (data === null || data === void 0 ? void 0 : data.link) && /*#__PURE__*/React.createElement("span", {
154
+ return /*#__PURE__*/React.createElement("span", null, (data === null || data === void 0 ? void 0 : data.linkPrefix) && /*#__PURE__*/React.createElement("span", null, t(`${data === null || data === void 0 ? void 0 : data.linkPrefix}_`)), (data === null || data === void 0 ? void 0 : data.link) && /*#__PURE__*/React.createElement("span", {
176
155
  id: data === null || data === void 0 ? void 0 : data.linkId,
177
156
  onClick: e => {
178
157
  onLinkClick(e);
@@ -181,7 +160,7 @@ const SelectPaymentType = props => {
181
160
  color: "#a82227",
182
161
  cursor: "pointer"
183
162
  }
184
- }, t((data === null || data === void 0 ? void 0 : data.link) + "_")), (data === null || data === void 0 ? void 0 : data.linkPostfix) && /*#__PURE__*/React.createElement("span", null, t((data === null || data === void 0 ? void 0 : data.linkPostfix) + "_")), index == (isCCFEnabled === null || isCCFEnabled === void 0 ? void 0 : (_isCCFEnabled$checkBo2 = isCCFEnabled.checkBoxLabels) === null || _isCCFEnabled$checkBo2 === void 0 ? void 0 : _isCCFEnabled$checkBo2.length) - 1 && t("LABEL"));
163
+ }, t(`${data === null || data === void 0 ? void 0 : data.link}_`)), (data === null || data === void 0 ? void 0 : data.linkPostfix) && /*#__PURE__*/React.createElement("span", null, t(`${data === null || data === void 0 ? void 0 : data.linkPostfix}_`)), index == (isCCFEnabled === null || isCCFEnabled === void 0 ? void 0 : (_isCCFEnabled$checkBo2 = isCCFEnabled.checkBoxLabels) === null || _isCCFEnabled$checkBo2 === void 0 ? void 0 : _isCCFEnabled$checkBo2.length) - 1 && t("LABEL"));
185
164
  }));
186
165
  };
187
166
  useEffect(() => {
@@ -208,7 +187,7 @@ const SelectPaymentType = props => {
208
187
  const onSubmit = () => {
209
188
  if (wrkflow === "WNS") {
210
189
  var _bill$mobileNumber, _userData$user, _userData$user$;
211
- history.push("/digit-ui/citizen/payment/collect/" + businessService + "/" + consumerCode + "?workflow=WNS&consumerCode=" + stringReplaceAll(consumerCode, "+", "/"), {
190
+ history.push(`/digit-ui/citizen/payment/collect/${businessService}/${consumerCode}?workflow=WNS&consumerCode=${stringReplaceAll(consumerCode, "+", "/")}`, {
212
191
  paymentAmount: paymentAmt,
213
192
  tenantId: billDetails.tenantId,
214
193
  name: (paymentType === null || paymentType === void 0 ? void 0 : paymentType.code) !== (optionSecound === null || optionSecound === void 0 ? void 0 : optionSecound.code) && ConsumerName !== "undefined" ? ConsumerName : userInfo ? payersActiveName : payersName,
@@ -216,7 +195,7 @@ const SelectPaymentType = props => {
216
195
  });
217
196
  } else {
218
197
  var _bill$mobileNumber2, _userData$user2, _userData$user2$;
219
- history.push("/digit-ui/citizen/payment/collect/" + businessService + "/" + consumerCode, {
198
+ history.push(`/digit-ui/citizen/payment/collect/${businessService}/${consumerCode}`, {
220
199
  paymentAmount: paymentAmt,
221
200
  tenantId: billDetails.tenantId,
222
201
  name: (paymentType === null || paymentType === void 0 ? void 0 : paymentType.code) !== (optionSecound === null || optionSecound === void 0 ? void 0 : optionSecound.code) ? bill === null || bill === void 0 ? void 0 : bill.payerName : userInfo ? payersActiveName : payersName,
@@ -282,15 +261,18 @@ const SelectPaymentType = props => {
282
261
 
283
262
  const MyBill = _ref => {
284
263
  var _bill$totalAmount;
285
- let bill = _ref.bill,
286
- currentPath = _ref.currentPath,
287
- businessService = _ref.businessService,
288
- getKeyNotesConfig = _ref.getKeyNotesConfig;
289
- const _useTranslation = useTranslation(),
290
- t = _useTranslation.t;
264
+ let {
265
+ bill,
266
+ currentPath,
267
+ businessService,
268
+ getKeyNotesConfig
269
+ } = _ref;
270
+ const {
271
+ t
272
+ } = useTranslation();
291
273
  const history = useHistory();
292
274
  const onSubmit = () => {
293
- history.push(currentPath + "/" + bill.consumerCode, {
275
+ history.push(`${currentPath}/${bill.consumerCode}`, {
294
276
  tenantId: bill === null || bill === void 0 ? void 0 : bill.tenantId
295
277
  });
296
278
  };
@@ -313,11 +295,14 @@ const MyBill = _ref => {
313
295
  };
314
296
 
315
297
  const BillList = _ref => {
316
- let billsList = _ref.billsList,
317
- currentPath = _ref.currentPath,
318
- businessService = _ref.businessService;
319
- const _useTranslation = useTranslation(),
320
- t = _useTranslation.t;
298
+ let {
299
+ billsList,
300
+ currentPath,
301
+ businessService
302
+ } = _ref;
303
+ const {
304
+ t
305
+ } = useTranslation();
321
306
  const history = useHistory();
322
307
  const consumerCodes = billsList.map(bill => bill.consumerCode);
323
308
  const searchResult = Digit.Hooks.useApplicationsForBusinessServiceSearch({
@@ -327,14 +312,11 @@ const BillList = _ref => {
327
312
  businessService
328
313
  });
329
314
  const keyForConsumerCode = searchResult.key;
330
- const _useState = useState([]),
331
- applicationList = _useState[0],
332
- setApplicationList = _useState[1];
333
- const _useState2 = useState(() => {
334
- var _Digit$ComponentRegis;
335
- return (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("getBillDetailsConfigWithBusinessService");
336
- }),
337
- getKeyNotesConfig = _useState2[0];
315
+ const [applicationList, setApplicationList] = useState([]);
316
+ const [getKeyNotesConfig, setConfig] = useState(() => {
317
+ var _Digit$ComponentRegis;
318
+ return (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("getBillDetailsConfigWithBusinessService");
319
+ });
338
320
  const billableApplicationsObj = useMemo(() => ({}), []);
339
321
  const billsListObj = useMemo(() => ({}), []);
340
322
  useEffect(() => {
@@ -350,7 +332,10 @@ const BillList = _ref => {
350
332
  billsList.forEach(bill => {
351
333
  billsListObj[bill.consumerCode] = bill;
352
334
  });
353
- const newBillsList = billableIDs.map(e => _extends({}, billsListObj[e], billableApplicationsObj[e]));
335
+ const newBillsList = billableIDs.map(e => ({
336
+ ...billsListObj[e],
337
+ ...billableApplicationsObj[e]
338
+ }));
354
339
  setApplicationList(newBillsList);
355
340
  }
356
341
  }, [searchResult.data, getKeyNotesConfig]);
@@ -359,7 +344,7 @@ const BillList = _ref => {
359
344
  }
360
345
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
361
346
  className: "static"
362
- }, /*#__PURE__*/React.createElement(Header, null, t("CS_TITLE_MY_BILLS") + (" (" + applicationList.length + ")")), (applicationList === null || applicationList === void 0 ? void 0 : applicationList.length) > 0 && getKeyNotesConfig && applicationList.map((bill, index) => /*#__PURE__*/React.createElement("div", {
347
+ }, /*#__PURE__*/React.createElement(Header, null, t("CS_TITLE_MY_BILLS") + ` (${applicationList.length})`), (applicationList === null || applicationList === void 0 ? void 0 : applicationList.length) > 0 && getKeyNotesConfig && applicationList.map((bill, index) => /*#__PURE__*/React.createElement("div", {
363
348
  key: index
364
349
  }, /*#__PURE__*/React.createElement(MyBill, {
365
350
  bill,
@@ -390,7 +375,7 @@ const styles = {
390
375
  boxShadow: "none"
391
376
  },
392
377
  table: {
393
- minWidth: 700,
378
+ width: "100%",
394
379
  backgroundColor: "rgba(250, 250, 250, var(--bg-opacity))"
395
380
  },
396
381
  cell: {
@@ -410,62 +395,81 @@ const styles = {
410
395
  cellRight: {}
411
396
  };
412
397
  const ArrearTable = _ref => {
413
- let _ref$headers = _ref.headers,
414
- headers = _ref$headers === void 0 ? [] : _ref$headers,
415
- _ref$values = _ref.values,
416
- values = _ref$values === void 0 ? [] : _ref$values,
417
- _ref$arrears = _ref.arrears,
418
- arrears = _ref$arrears === void 0 ? 0 : _ref$arrears;
419
- const _useTranslation = useTranslation(),
420
- t = _useTranslation.t;
398
+ let {
399
+ className = "table",
400
+ headers = [],
401
+ values = [],
402
+ arrears = 0
403
+ } = _ref;
404
+ const {
405
+ t
406
+ } = useTranslation();
421
407
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
422
408
  style: styles.root
423
409
  }, /*#__PURE__*/React.createElement("table", {
424
410
  className: "table-fixed-column-common-pay",
425
411
  style: styles.table
426
412
  }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
427
- style: _extends({}, styles.cell, styles.cellLeft, styles.cellHeader)
413
+ style: {
414
+ ...styles.cell,
415
+ ...styles.cellLeft,
416
+ ...styles.cellHeader
417
+ }
428
418
  }, t("CS_BILL_PERIOD")), headers.map((header, ind) => {
429
419
  let styleRight = headers.length == ind + 1 ? styles.cellRight : {};
430
420
  return /*#__PURE__*/React.createElement("th", {
431
- style: _extends({}, styles.cell, styleRight, styles.cellHeader),
421
+ style: {
422
+ ...styles.cell,
423
+ ...styleRight,
424
+ ...styles.cellHeader
425
+ },
432
426
  key: ind
433
427
  }, t(header));
434
428
  }))), /*#__PURE__*/React.createElement("tbody", null, Object.values(values).map((row, ind) => /*#__PURE__*/React.createElement("tr", {
435
429
  key: ind
436
430
  }, /*#__PURE__*/React.createElement("td", {
437
- style: _extends({}, styles.cell, styles.cellLeft),
431
+ style: {
432
+ ...styles.cell,
433
+ ...styles.cellLeft
434
+ },
438
435
  component: "th",
439
436
  scope: "row"
440
437
  }, Object.keys(values)[ind]), headers.map((header, i) => {
441
438
  let styleRight = headers.length == i + 1 ? styles.cellRight : {};
442
439
  return /*#__PURE__*/React.createElement("td", {
443
- style: _extends({}, styles.cell, {
444
- textAlign: "left"
445
- }, styleRight, {
440
+ style: {
441
+ ...styles.cell,
442
+ textAlign: "left",
443
+ ...styleRight,
446
444
  whiteSpace: "pre"
447
- }),
445
+ },
448
446
  key: i,
449
447
  numeric: true
450
448
  }, i > 1 && "₹", row[header] && row[header]["value"] || "0");
451
449
  }))), /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("td", {
452
- style: _extends({}, styles.cell, styles.cellLeft)
450
+ style: {
451
+ ...styles.cell,
452
+ ...styles.cellLeft
453
+ }
453
454
  }), headers.map((header, ind) => {
454
455
  if (ind == headers.length - 1) {
455
456
  return /*#__PURE__*/React.createElement("td", {
456
- style: _extends({}, styles.cell, styles.cellRight, {
457
+ style: {
458
+ ...styles.cell,
459
+ ...styles.cellRight,
457
460
  textAlign: "left",
458
461
  fontWeight: "700",
459
462
  whiteSpace: "pre"
460
- }),
463
+ },
461
464
  key: ind,
462
465
  numeric: true
463
466
  }, arrears);
464
467
  } else if (ind == headers.length - 2) {
465
468
  return /*#__PURE__*/React.createElement("td", {
466
- style: _extends({}, styles.cell, {
469
+ style: {
470
+ ...styles.cell,
467
471
  textAlign: "left"
468
- }),
472
+ },
469
473
  key: ind,
470
474
  numeric: true
471
475
  }, t("COMMON_ARREARS_TOTAL"));
@@ -483,7 +487,11 @@ const styles$1 = {
483
487
  buttonStyle: {
484
488
  display: "flex",
485
489
  justifyContent: "flex-end",
486
- color: "#a82227"
490
+ color: "#a82227",
491
+ marginTop: "10px",
492
+ marginBottom: "10px",
493
+ cursor: "pointer",
494
+ fontWeight: "bold"
487
495
  },
488
496
  headerStyle: {
489
497
  marginTop: "10px",
@@ -493,21 +501,102 @@ const styles$1 = {
493
501
  color: " rgba(11, 12, 12, var(--text-opacity))"
494
502
  }
495
503
  };
504
+ const thStyle = {
505
+ textAlign: "left",
506
+ borderBottom: "#D6D5D4 1px solid",
507
+ padding: "16px 12px",
508
+ whiteSpace: "break-spaces",
509
+ fontSize: "14px",
510
+ fontWeight: "bold"
511
+ };
512
+ const tdStyle = {
513
+ textAlign: "left",
514
+ borderBottom: "#D6D5D4 1px solid",
515
+ padding: "8px 10px",
516
+ wordBreak: "keep-all",
517
+ fontSize: "14px"
518
+ };
496
519
  const ArrearSummary = _ref => {
497
- var _bill$billDetails, _sortedBillDetails, _arrears$toFixed;
498
- let _ref$bill = _ref.bill,
499
- bill = _ref$bill === void 0 ? {} : _ref$bill;
500
- const _useTranslation = useTranslation(),
501
- t = _useTranslation.t;
520
+ var _bill$billDetails, _bill$billDetails2, _sortedBillDetails, _arrears$toFixed;
521
+ let {
522
+ bill = {},
523
+ businessService
524
+ } = _ref;
525
+ const {
526
+ t
527
+ } = useTranslation();
528
+ const [showArrear, setShowArrear] = useState(false);
529
+ const isWNS = businessService === "WS" || businessService === "SW";
530
+ const yearWiseBills = bill === null || bill === void 0 ? void 0 : (_bill$billDetails = bill.billDetails) === null || _bill$billDetails === void 0 ? void 0 : _bill$billDetails.sort((a, b) => b.fromPeriod - a.fromPeriod);
531
+ const getBillingPeriod = _bill => {
532
+ const {
533
+ fromPeriod,
534
+ toPeriod
535
+ } = _bill;
536
+ let from = new Date(fromPeriod).toLocaleDateString();
537
+ let to = new Date(toPeriod).toLocaleDateString();
538
+ return from + "-" + to;
539
+ };
540
+ const renderArrearDetailsForWNS = () => {
541
+ var _yearWiseBills$filter, _yearWiseBills$filter2, _yearWiseBills$filter3, _yearWiseBills$filter4, _yearWiseBills$filter5;
542
+ return /*#__PURE__*/React.createElement("div", {
543
+ style: {
544
+ maxWidth: "100%",
545
+ overflowX: "auto",
546
+ backgroundColor: "#EEEEEE",
547
+ marginTop: "10px"
548
+ }
549
+ }, /*#__PURE__*/React.createElement("table", {
550
+ className: "table-fixed-column-common-pay",
551
+ style: {
552
+ width: "100%",
553
+ borderCollapse: "collapse"
554
+ }
555
+ }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
556
+ style: thStyle
557
+ }, t("CS_BILL_NO")), /*#__PURE__*/React.createElement("th", {
558
+ style: {
559
+ ...thStyle
560
+ }
561
+ }, t("CS_PAYMENT_BILLING_PERIOD")), /*#__PURE__*/React.createElement("th", {
562
+ style: {
563
+ ...thStyle
564
+ }
565
+ }, t("CS_BILL_DUEDATE")), yearWiseBills === null || yearWiseBills === void 0 ? void 0 : (_yearWiseBills$filter = yearWiseBills.filter((e, ind) => ind > 0)) === null || _yearWiseBills$filter === void 0 ? void 0 : (_yearWiseBills$filter2 = _yearWiseBills$filter[0]) === null || _yearWiseBills$filter2 === void 0 ? void 0 : (_yearWiseBills$filter3 = _yearWiseBills$filter2.billAccountDetails) === null || _yearWiseBills$filter3 === void 0 ? void 0 : (_yearWiseBills$filter4 = _yearWiseBills$filter3.sort((a, b) => a.order - b.order)) === null || _yearWiseBills$filter4 === void 0 ? void 0 : _yearWiseBills$filter4.map((head, index) => /*#__PURE__*/React.createElement("th", {
566
+ style: {
567
+ ...thStyle
568
+ },
569
+ key: index
570
+ }, t(head.taxHeadCode))), /*#__PURE__*/React.createElement("th", {
571
+ style: thStyle
572
+ }, t("TOTAL_TAX")))), /*#__PURE__*/React.createElement("tbody", null, yearWiseBills === null || yearWiseBills === void 0 ? void 0 : (_yearWiseBills$filter5 = yearWiseBills.filter((e, ind) => ind > 0)) === null || _yearWiseBills$filter5 === void 0 ? void 0 : _yearWiseBills$filter5.map((year_bill, index) => {
573
+ var _year_bill$billAccoun;
574
+ const sorted_tax_heads = year_bill === null || year_bill === void 0 ? void 0 : (_year_bill$billAccoun = year_bill.billAccountDetails) === null || _year_bill$billAccoun === void 0 ? void 0 : _year_bill$billAccoun.sort((a, b) => a.order - b.order);
575
+ return /*#__PURE__*/React.createElement("tr", {
576
+ key: index
577
+ }, /*#__PURE__*/React.createElement("td", {
578
+ style: tdStyle
579
+ }, year_bill === null || year_bill === void 0 ? void 0 : year_bill.billNumber), /*#__PURE__*/React.createElement("td", {
580
+ style: tdStyle
581
+ }, getBillingPeriod(year_bill)), /*#__PURE__*/React.createElement("td", {
582
+ style: tdStyle
583
+ }, (year_bill === null || year_bill === void 0 ? void 0 : year_bill.expiryDate) && new Date(year_bill === null || year_bill === void 0 ? void 0 : year_bill.expiryDate).toLocaleDateString()), sorted_tax_heads === null || sorted_tax_heads === void 0 ? void 0 : sorted_tax_heads.map((e, i) => /*#__PURE__*/React.createElement("td", {
584
+ style: tdStyle,
585
+ key: i
586
+ }, e.amount)), /*#__PURE__*/React.createElement("td", {
587
+ style: tdStyle
588
+ }, year_bill.amount));
589
+ }))));
590
+ };
502
591
  const formatTaxHeaders = function (billDetail) {
503
- var _billDetail2, _billDetail3, _billDetail4;
592
+ var _billDetail, _billDetail2, _billDetail3;
504
593
  if (billDetail === void 0) {
505
594
  billDetail = {};
506
595
  }
507
596
  let formattedFees = {};
508
- const _billDetail = billDetail,
509
- _billDetail$billAccou = _billDetail.billAccountDetails,
510
- billAccountDetails = _billDetail$billAccou === void 0 ? [] : _billDetail$billAccou;
597
+ const {
598
+ billAccountDetails = []
599
+ } = billDetail;
511
600
  billAccountDetails.map(taxHead => {
512
601
  formattedFees[taxHead.taxHeadCode] = {
513
602
  value: taxHead.amount,
@@ -515,11 +604,11 @@ const ArrearSummary = _ref => {
515
604
  };
516
605
  });
517
606
  formattedFees["CS_BILL_NO"] = {
518
- value: ((_billDetail2 = billDetail) === null || _billDetail2 === void 0 ? void 0 : _billDetail2.billNumber) || "NA",
607
+ value: ((_billDetail = billDetail) === null || _billDetail === void 0 ? void 0 : _billDetail.billNumber) || "NA",
519
608
  order: -2
520
609
  };
521
610
  formattedFees["CS_BILL_DUEDATE"] = {
522
- value: ((_billDetail3 = billDetail) === null || _billDetail3 === void 0 ? void 0 : _billDetail3.expiryDate) && new Date((_billDetail4 = billDetail) === null || _billDetail4 === void 0 ? void 0 : _billDetail4.expiryDate).toLocaleDateString() || "NA",
611
+ value: ((_billDetail2 = billDetail) === null || _billDetail2 === void 0 ? void 0 : _billDetail2.expiryDate) && new Date((_billDetail3 = billDetail) === null || _billDetail3 === void 0 ? void 0 : _billDetail3.expiryDate).toLocaleDateString() || "NA",
523
612
  order: -1
524
613
  };
525
614
  formattedFees["TL_COMMON_TOTAL_AMT"] = {
@@ -532,15 +621,15 @@ const ArrearSummary = _ref => {
532
621
  const fromDate = new Date(from);
533
622
  const toDate = new Date(to);
534
623
  if (toDate.getYear() - fromDate.getYear() != 0) {
535
- return "FY" + (fromDate.getYear() + 1900) + "-" + (toDate.getYear() - 100);
624
+ return `FY${fromDate.getYear() + 1900}-${toDate.getYear() - 100}`;
536
625
  }
537
- return fromDate.toLocaleDateString() + "-" + toDate.toLocaleDateString();
626
+ return `${fromDate.toLocaleDateString()}-${toDate.toLocaleDateString()}`;
538
627
  };
539
628
  let fees = {};
540
- let sortedBillDetails = (bill === null || bill === void 0 ? void 0 : (_bill$billDetails = bill.billDetails) === null || _bill$billDetails === void 0 ? void 0 : _bill$billDetails.sort((a, b) => b.fromPeriod - a.fromPeriod)) || [];
629
+ let sortedBillDetails = (bill === null || bill === void 0 ? void 0 : (_bill$billDetails2 = bill.billDetails) === null || _bill$billDetails2 === void 0 ? void 0 : _bill$billDetails2.sort((a, b) => b.fromPeriod - a.fromPeriod)) || [];
541
630
  sortedBillDetails = [...sortedBillDetails];
542
631
  const arrears = ((_sortedBillDetails = sortedBillDetails) === null || _sortedBillDetails === void 0 ? void 0 : _sortedBillDetails.reduce((total, current, index) => index === 0 ? total : total + current.amount, 0)) || 0;
543
- let arrearsAmount = "\u20B9 " + ((arrears === null || arrears === void 0 ? void 0 : (_arrears$toFixed = arrears.toFixed) === null || _arrears$toFixed === void 0 ? void 0 : _arrears$toFixed.call(arrears, 0)) || Number(0).toFixed(0));
632
+ let arrearsAmount = `₹ ${(arrears === null || arrears === void 0 ? void 0 : (_arrears$toFixed = arrears.toFixed) === null || _arrears$toFixed === void 0 ? void 0 : _arrears$toFixed.call(arrears, 0)) || Number(0).toFixed(0)}`;
544
633
  sortedBillDetails.shift();
545
634
  sortedBillDetails.map(bill => {
546
635
  let fee = formatTaxHeaders(bill);
@@ -555,9 +644,18 @@ const ArrearSummary = _ref => {
555
644
  let keys = [];
556
645
  keys = Object.keys(head);
557
646
  keys.sort((x, y) => head[x] - head[y]);
558
- const _useState = useState(false),
559
- showArrear = _useState[0],
560
- setShowArrear = _useState[1];
647
+ if (isWNS) {
648
+ if (!yearWiseBills || yearWiseBills.length <= 1) {
649
+ return /*#__PURE__*/React.createElement("span", null);
650
+ }
651
+ return /*#__PURE__*/React.createElement(React.Fragment, null, showArrear && renderArrearDetailsForWNS(), /*#__PURE__*/React.createElement("div", {
652
+ style: styles$1.buttonStyle
653
+ }, /*#__PURE__*/React.createElement("div", {
654
+ onClick: () => {
655
+ setShowArrear(!showArrear);
656
+ }
657
+ }, showArrear ? t("ES_COMMON_HIDE_DETAILS") : t("ES_COMMON_VIEW_DETAILS"))));
658
+ }
561
659
  if (arrears == 0 || arrears < 0) {
562
660
  return /*#__PURE__*/React.createElement("span", null);
563
661
  }
@@ -620,13 +718,18 @@ const ReceiptSlashIconSVG = () => /*#__PURE__*/React.createElement("svg", {
620
718
  y2: "21"
621
719
  }));
622
720
  const BillSumary = _ref => {
623
- let billAccountDetails = _ref.billAccountDetails,
624
- total = _ref.total,
625
- arrears = _ref.arrears;
626
- const _useTranslation = useTranslation(),
627
- t = _useTranslation.t;
628
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
629
- ModuleWorkflow = _Digit$Hooks$useQuery.workflow;
721
+ let {
722
+ billAccountDetails,
723
+ total,
724
+ businessService,
725
+ arrears
726
+ } = _ref;
727
+ const {
728
+ t
729
+ } = useTranslation();
730
+ const {
731
+ workflow: ModuleWorkflow
732
+ } = Digit.Hooks.useQueryParams();
630
733
  useEffect(() => {
631
734
  ModuleWorkflow === "mcollect" && billAccountDetails && billAccountDetails.map(ob => {
632
735
  if (ob.taxHeadCode.includes("CGST")) ob.order = 3;else if (ob.taxHeadCode.includes("SGST")) ob.order = 4;
@@ -745,33 +848,30 @@ function _catch(body, recover) {
745
848
  }
746
849
 
747
850
  const TimerServices = _ref => {
748
- let businessService = _ref.businessService,
749
- t = _ref.t,
750
- _ref$SlotSearchData = _ref.SlotSearchData,
751
- SlotSearchData = _ref$SlotSearchData === void 0 ? "" : _ref$SlotSearchData,
752
- setTime = _ref.setTime;
753
- const _useState = useState(0),
754
- timeRemaining = _useState[0],
755
- setTimeRemaining = _useState[1];
756
- const _useState2 = useState(null),
757
- showToast = _useState2[0],
758
- setShowToast = _useState2[1];
759
- const _useState3 = useState(false),
760
- hasFetched = _useState3[0],
761
- setHasFetched = _useState3[1];
762
- const _Digit$Hooks$chb$useC = Digit.Hooks.chb.useChbSlotSearch({
763
- tenantId: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.tenantId,
764
- filters: {
765
- bookingId: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingId,
766
- communityHallCode: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.communityHallCode,
767
- bookingStartDate: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingStartDate,
768
- bookingEndDate: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingEndDate,
769
- hallCode: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.hallCode,
770
- isTimerRequired: true
771
- },
772
- enabled: false
773
- }),
774
- refetch = _Digit$Hooks$chb$useC.refetch;
851
+ let {
852
+ businessService,
853
+ t,
854
+ timerValues,
855
+ SlotSearchData = "",
856
+ setTime
857
+ } = _ref;
858
+ const [timeRemaining, setTimeRemaining] = useState(0);
859
+ const [showToast, setShowToast] = useState(null);
860
+ const [hasFetched, setHasFetched] = useState(false);
861
+ const {
862
+ refetch
863
+ } = Digit.Hooks.chb.useChbSlotSearch({
864
+ tenantId: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.tenantId,
865
+ filters: {
866
+ bookingId: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingId,
867
+ communityHallCode: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.communityHallCode,
868
+ bookingStartDate: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingStartDate,
869
+ bookingEndDate: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingEndDate,
870
+ hallCode: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.hallCode,
871
+ isTimerRequired: true
872
+ },
873
+ enabled: false
874
+ });
775
875
  const slotSearchData = Digit.Hooks.ads.useADSSlotSearch();
776
876
  useEffect(() => {
777
877
  const fetchSlotData = function () {
@@ -867,7 +967,7 @@ const TimerServices = _ref => {
867
967
  const formatTime = seconds => {
868
968
  const minutes = Math.floor(seconds / 60);
869
969
  const remainingSeconds = seconds % 60;
870
- return minutes + ":" + (remainingSeconds < 10 ? '0' : '') + remainingSeconds;
970
+ return `${minutes}:${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}`;
871
971
  };
872
972
  return /*#__PURE__*/React.createElement("div", null, t("CS_TIME_REMAINING"), ": ", /*#__PURE__*/React.createElement("span", {
873
973
  className: "astericColor"
@@ -883,40 +983,44 @@ const TimerServices = _ref => {
883
983
 
884
984
  const BillDetails = _ref => {
885
985
  var _Digit$UserService$ge, _data$Bill, _data$Bill$, _bill$billDetails, _bill$billDetails$sor, _bill$billDetails2, _bill$billDetails2$so, _application$pdfData6, _application$pdfData7, _application$pdfData8, _application$pdfData9, _application$pdfData0, _application$pdfData1, _application$pdfData10, _application$pdfData11, _application$pdfData12;
886
- let paymentRules = _ref.paymentRules,
887
- businessService = _ref.businessService;
888
- const _useTranslation = useTranslation(),
889
- t = _useTranslation.t;
986
+ let {
987
+ paymentRules,
988
+ businessService
989
+ } = _ref;
990
+ const {
991
+ t
992
+ } = useTranslation();
890
993
  const history = useHistory();
891
- const _useLocation = useLocation(),
892
- state = _useLocation.state,
893
- pathname = _useLocation.pathname,
894
- search = _useLocation.search;
994
+ const {
995
+ state,
996
+ pathname,
997
+ search
998
+ } = useLocation();
895
999
  const userInfo = Digit.UserService.getUser();
896
- let _useParams = useParams(),
897
- consumerCode = _useParams.consumerCode;
898
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
899
- wrkflow = _Digit$Hooks$useQuery.workflow,
900
- _tenantId = _Digit$Hooks$useQuery.tenantId,
901
- authorization = _Digit$Hooks$useQuery.authorization,
902
- ConsumerName = _Digit$Hooks$useQuery.ConsumerName;
903
- const _useState = useState(state === null || state === void 0 ? void 0 : state.bill),
904
- bill = _useState[0],
905
- setBill = _useState[1];
1000
+ let {
1001
+ consumerCode
1002
+ } = useParams();
1003
+ const {
1004
+ workflow: wrkflow,
1005
+ tenantId: _tenantId,
1006
+ authorization,
1007
+ ConsumerName
1008
+ } = Digit.Hooks.useQueryParams();
1009
+ const [bill, setBill] = useState(state === null || state === void 0 ? void 0 : state.bill);
906
1010
  const tenantId = (state === null || state === void 0 ? void 0 : state.tenantId) || _tenantId || ((_Digit$UserService$ge = Digit.UserService.getUser().info) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.tenantId);
907
1011
  const propertyId = state === null || state === void 0 ? void 0 : state.propertyId;
908
- const _useState2 = useState(0),
909
- setTime = _useState2[1];
1012
+ const [Time, setTime] = useState(0);
910
1013
  if (wrkflow === "WNS" && consumerCode.includes("?")) consumerCode = consumerCode.substring(0, consumerCode.indexOf("?"));
911
- const _ref2 = state !== null && state !== void 0 && state.bill ? {
912
- isLoading: false
913
- } : Digit.Hooks.useFetchPayment({
914
- tenantId,
915
- businessService,
916
- consumerCode: wrkflow === "WNS" ? stringReplaceAll(consumerCode, "+", "/") : consumerCode
917
- }),
918
- data = _ref2.data,
919
- isLoading = _ref2.isLoading;
1014
+ const {
1015
+ data,
1016
+ isLoading
1017
+ } = state !== null && state !== void 0 && state.bill ? {
1018
+ isLoading: false
1019
+ } : Digit.Hooks.useFetchPayment({
1020
+ tenantId,
1021
+ businessService,
1022
+ consumerCode: wrkflow === "WNS" ? stringReplaceAll(consumerCode, "+", "/") : consumerCode
1023
+ });
920
1024
  let Useruuid = (data === null || data === void 0 ? void 0 : (_data$Bill = data.Bill) === null || _data$Bill === void 0 ? void 0 : (_data$Bill$ = _data$Bill[0]) === null || _data$Bill$ === void 0 ? void 0 : _data$Bill$.userId) || "";
921
1025
  let requestCriteria = ["/user/_search", {}, {
922
1026
  data: {
@@ -929,27 +1033,40 @@ const BillDetails = _ref => {
929
1033
  enabled: Useruuid ? true : false,
930
1034
  cacheTime: 100
931
1035
  }];
932
- const _Digit$Hooks$useCusto = Digit.Hooks.useCustomAPIHook(...requestCriteria),
933
- userData = _Digit$Hooks$useCusto.data;
934
- const _Digit$Hooks$fsm$useA = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, consumerCode, {
935
- enabled: pathname.includes("FSM") ? true : false
936
- }, "CITIZEN"),
937
- isFSMLoading = _Digit$Hooks$fsm$useA.isLoading,
938
- application = _Digit$Hooks$fsm$useA.data;
939
- let minAmountPayable = paymentRules.minAmountPayable,
940
- isAdvanceAllowed = paymentRules.isAdvanceAllowed;
1036
+ const {
1037
+ isLoading: isUserLoading,
1038
+ data: userData,
1039
+ revalidate
1040
+ } = Digit.Hooks.useCustomAPIHook(...requestCriteria);
1041
+ const {
1042
+ isLoading: isFSMLoading,
1043
+ isError,
1044
+ error,
1045
+ data: application,
1046
+ error: errorApplication
1047
+ } = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, consumerCode, {
1048
+ enabled: pathname.includes("FSM") ? true : false
1049
+ }, "CITIZEN");
1050
+ let {
1051
+ minAmountPayable,
1052
+ isAdvanceAllowed
1053
+ } = paymentRules;
941
1054
  minAmountPayable = wrkflow === "WNS" ? 100 : minAmountPayable;
942
1055
  const billDetails = (bill === null || bill === void 0 ? void 0 : (_bill$billDetails = bill.billDetails) === null || _bill$billDetails === void 0 ? void 0 : (_bill$billDetails$sor = _bill$billDetails.sort((a, b) => b.fromPeriod - a.fromPeriod)) === null || _bill$billDetails$sor === void 0 ? void 0 : _bill$billDetails$sor[0]) || [];
943
1056
  const Arrears = (bill === null || bill === void 0 ? void 0 : (_bill$billDetails2 = bill.billDetails) === null || _bill$billDetails2 === void 0 ? void 0 : (_bill$billDetails2$so = _bill$billDetails2.sort((a, b) => b.fromPeriod - a.fromPeriod)) === null || _bill$billDetails2$so === void 0 ? void 0 : _bill$billDetails2$so.reduce((total, current, index) => index === 0 ? total : total + current.amount, 0)) || 0;
944
- const _Digit$Hooks$useAppli = Digit.Hooks.useApplicationsForBusinessServiceSearch({
945
- businessService
946
- }, {
947
- enabled: false
948
- }),
949
- label = _Digit$Hooks$useAppli.label;
1057
+ const {
1058
+ key,
1059
+ label
1060
+ } = Digit.Hooks.useApplicationsForBusinessServiceSearch({
1061
+ businessService
1062
+ }, {
1063
+ enabled: false
1064
+ });
950
1065
  const getBillingPeriod = () => {
951
- const fromPeriod = billDetails.fromPeriod,
952
- toPeriod = billDetails.toPeriod;
1066
+ const {
1067
+ fromPeriod,
1068
+ toPeriod
1069
+ } = billDetails;
953
1070
  if (fromPeriod && toPeriod) {
954
1071
  let from, to;
955
1072
  if (wrkflow === "mcollect" || wrkflow === "WNS") {
@@ -981,23 +1098,15 @@ const BillDetails = _ref => {
981
1098
  var _application$pdfData;
982
1099
  return application === null || application === void 0 ? void 0 : (_application$pdfData = application.pdfData) === null || _application$pdfData === void 0 ? void 0 : _application$pdfData.advanceAmount;
983
1100
  };
984
- const _useState3 = useState(t("CS_PAYMENT_FULL_AMOUNT")),
985
- paymentType = _useState3[0],
986
- setPaymentType = _useState3[1];
987
- const _useState4 = useState(getTotal()),
988
- amount = _useState4[0],
989
- setAmount = _useState4[1];
990
- const _useState5 = useState(true),
991
- paymentAllowed = _useState5[0],
992
- setPaymentAllowed = _useState5[1];
993
- const _useState6 = useState(""),
994
- formError = _useState6[0],
995
- setError = _useState6[1];
1101
+ const [paymentType, setPaymentType] = useState(t("CS_PAYMENT_FULL_AMOUNT"));
1102
+ const [amount, setAmount] = useState(getTotal());
1103
+ const [paymentAllowed, setPaymentAllowed] = useState(true);
1104
+ const [formError, setError] = useState("");
996
1105
  const kc = window.keycloak;
997
1106
  if (authorization === "true" && !(kc !== null && kc !== void 0 && kc.authenticated)) {
998
1107
  localStorage.clear();
999
1108
  sessionStorage.clear();
1000
- window.location.href = "/digit-ui/citizen/login?from=" + encodeURIComponent(pathname + search);
1109
+ window.location.href = `/digit-ui/citizen/login?from=${encodeURIComponent(pathname + search)}`;
1001
1110
  }
1002
1111
  useEffect(() => {
1003
1112
  window.scroll({
@@ -1031,13 +1140,13 @@ const BillDetails = _ref => {
1031
1140
  var _application$pdfData4, _application$pdfData5;
1032
1141
  let paymentAmount = paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? businessService === "FSM.TRIP_CHARGES" ? application === null || application === void 0 ? void 0 : (_application$pdfData4 = application.pdfData) === null || _application$pdfData4 === void 0 ? void 0 : _application$pdfData4.advanceAmount : getTotal() : amount || businessService === "FSM.TRIP_CHARGES" ? application === null || application === void 0 ? void 0 : (_application$pdfData5 = application.pdfData) === null || _application$pdfData5 === void 0 ? void 0 : _application$pdfData5.advanceAmount : amount;
1033
1142
  if (window.location.href.includes("mcollect")) {
1034
- history.push("/digit-ui/citizen/payment/collect/" + businessService + "/" + consumerCode + "?workflow=mcollect", {
1143
+ history.push(`/digit-ui/citizen/payment/collect/${businessService}/${consumerCode}?workflow=mcollect`, {
1035
1144
  paymentAmount,
1036
1145
  tenantId: billDetails.tenantId
1037
1146
  });
1038
1147
  } else if (wrkflow === "WNS") {
1039
1148
  var _bill$mobileNumber, _userData$user, _userData$user$;
1040
- history.push("/digit-ui/citizen/payment/billDetails/" + businessService + "/" + consumerCode + "/" + paymentAmount + "?workflow=WNS&ConsumerName=" + ConsumerName, {
1149
+ history.push(`/digit-ui/citizen/payment/billDetails/${businessService}/${consumerCode}/${paymentAmount}?workflow=WNS&ConsumerName=${ConsumerName}`, {
1041
1150
  paymentAmount,
1042
1151
  tenantId: billDetails.tenantId,
1043
1152
  name: bill.payerName,
@@ -1045,14 +1154,14 @@ const BillDetails = _ref => {
1045
1154
  });
1046
1155
  } else if (businessService === "PT") {
1047
1156
  var _bill$mobileNumber2, _userData$user2, _userData$user2$;
1048
- history.push("/digit-ui/citizen/payment/billDetails/" + businessService + "/" + consumerCode + "/" + paymentAmount, {
1157
+ history.push(`/digit-ui/citizen/payment/billDetails/${businessService}/${consumerCode}/${paymentAmount}`, {
1049
1158
  paymentAmount,
1050
1159
  tenantId: billDetails.tenantId,
1051
1160
  name: bill.payerName,
1052
1161
  mobileNumber: bill.mobileNumber && (_bill$mobileNumber2 = bill.mobileNumber) !== null && _bill$mobileNumber2 !== void 0 && _bill$mobileNumber2.includes("*") ? userData === null || userData === void 0 ? void 0 : (_userData$user2 = userData.user) === null || _userData$user2 === void 0 ? void 0 : (_userData$user2$ = _userData$user2[0]) === null || _userData$user2$ === void 0 ? void 0 : _userData$user2$.mobileNumber : bill.mobileNumber
1053
1162
  });
1054
1163
  } else if (timerEnabledForBusinessService(businessService)) {
1055
- history.push("/digit-ui/citizen/payment/collect/" + businessService + "/" + consumerCode, {
1164
+ history.push(`/digit-ui/citizen/payment/collect/${businessService}/${consumerCode}`, {
1056
1165
  paymentAmount,
1057
1166
  tenantId: billDetails.tenantId,
1058
1167
  propertyId: propertyId,
@@ -1060,7 +1169,7 @@ const BillDetails = _ref => {
1060
1169
  SlotSearchData: state === null || state === void 0 ? void 0 : state.SlotSearchData
1061
1170
  });
1062
1171
  } else {
1063
- history.push("/digit-ui/citizen/payment/collect/" + businessService + "/" + consumerCode, {
1172
+ history.push(`/digit-ui/citizen/payment/collect/${businessService}/${consumerCode}`, {
1064
1173
  paymentAmount,
1065
1174
  tenantId: billDetails.tenantId,
1066
1175
  propertyId: propertyId
@@ -1135,7 +1244,8 @@ const BillDetails = _ref => {
1135
1244
  businessService: businessService,
1136
1245
  arrears: Arrears
1137
1246
  }), /*#__PURE__*/React.createElement(ArrearSummary, {
1138
- bill: bill
1247
+ bill: bill,
1248
+ businessService: businessService
1139
1249
  })), /*#__PURE__*/React.createElement("div", {
1140
1250
  className: "bill-payment-amount"
1141
1251
  }, /*#__PURE__*/React.createElement("hr", {
@@ -1153,7 +1263,7 @@ const BillDetails = _ref => {
1153
1263
  }, /*#__PURE__*/React.createElement("span", {
1154
1264
  className: "payment-amount-front",
1155
1265
  style: {
1156
- border: "1px solid " + (paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? "#9a9a9a" : "#9a9a9a")
1266
+ border: `1px solid ${paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? "#9a9a9a" : "#9a9a9a"}`
1157
1267
  }
1158
1268
  }, "\u20B9"), paymentType !== t("CS_PAYMENT_FULL_AMOUNT") ? businessService === "FSM.TRIP_CHARGES" ? /*#__PURE__*/React.createElement(TextInput, {
1159
1269
  className: "text-indent-xl",
@@ -1191,17 +1301,19 @@ const BillDetails = _ref => {
1191
1301
  })))));
1192
1302
  };
1193
1303
 
1194
- const _excluded$1 = ["url"];
1195
1304
  const BillRoutes = _ref => {
1196
- let billsList = _ref.billsList,
1197
- paymentRules = _ref.paymentRules,
1198
- businessService = _ref.businessService;
1199
- const _useRouteMatch = useRouteMatch(),
1200
- currentPath = _useRouteMatch.url,
1201
- match = _objectWithoutPropertiesLoose(_useRouteMatch, _excluded$1);
1305
+ let {
1306
+ billsList,
1307
+ paymentRules,
1308
+ businessService
1309
+ } = _ref;
1310
+ const {
1311
+ url: currentPath,
1312
+ ...match
1313
+ } = useRouteMatch();
1202
1314
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(Route, {
1203
1315
  exact: true,
1204
- path: "" + currentPath,
1316
+ path: `${currentPath}`,
1205
1317
  component: () => /*#__PURE__*/React.createElement(BillList, {
1206
1318
  billsList,
1207
1319
  currentPath,
@@ -1209,7 +1321,7 @@ const BillRoutes = _ref => {
1209
1321
  businessService
1210
1322
  })
1211
1323
  }), /*#__PURE__*/React.createElement(Route, {
1212
- path: currentPath + "/:consumerCode",
1324
+ path: `${currentPath}/:consumerCode`,
1213
1325
  component: () => /*#__PURE__*/React.createElement(BillDetails, {
1214
1326
  paymentRules,
1215
1327
  businessService
@@ -1218,41 +1330,49 @@ const BillRoutes = _ref => {
1218
1330
  };
1219
1331
 
1220
1332
  const MyBills = _ref => {
1221
- var _Digit$UserService$ge, _location$state, _location$state2;
1222
- let stateCode = _ref.stateCode;
1223
- const _useParams = useParams(),
1224
- businessService = _useParams.businessService;
1225
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
1226
- _tenantId = _Digit$Hooks$useQuery.tenantId,
1227
- isDisoconnectFlow = _Digit$Hooks$useQuery.isDisoconnectFlow;
1228
- const _Digit$Services$useSt = Digit.Services.useStore({
1229
- stateCode,
1230
- moduleCode: businessService,
1231
- language: Digit.StoreData.getCurrentLanguage()
1232
- });
1333
+ var _Digit$UserService$ge, _Digit$UserService$ge2, _location$state, _location$state2, _location$state3;
1334
+ let {
1335
+ stateCode
1336
+ } = _ref;
1337
+ const {
1338
+ businessService
1339
+ } = useParams();
1340
+ const {
1341
+ tenantId: _tenantId,
1342
+ isDisoconnectFlow
1343
+ } = Digit.Hooks.useQueryParams();
1344
+ const {
1345
+ isLoading: storeLoading,
1346
+ data: store
1347
+ } = Digit.Services.useStore({
1348
+ stateCode,
1349
+ moduleCode: businessService,
1350
+ language: Digit.StoreData.getCurrentLanguage()
1351
+ });
1233
1352
  const history = useHistory();
1234
- const _useRouteMatch = useRouteMatch(),
1235
- url = _useRouteMatch.url;
1353
+ const {
1354
+ url
1355
+ } = useRouteMatch();
1236
1356
  const location = useLocation();
1237
- const _ref2 = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || (location === null || location === void 0 ? void 0 : location.state) || {
1238
- tenantId: _tenantId
1239
- } || {},
1240
- tenantId = _ref2.tenantId;
1241
- if (!tenantId && !(location !== null && location !== void 0 && (_location$state = location.state) !== null && _location$state !== void 0 && _location$state.fromSearchResults)) {
1242
- history.replace("/digit-ui/citizen/login", {
1357
+ const tenantId = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : (_Digit$UserService$ge2 = _Digit$UserService$ge.info) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.tenantId) || (location === null || location === void 0 ? void 0 : (_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.tenantId) || _tenantId;
1358
+ if (!tenantId && !(location !== null && location !== void 0 && (_location$state2 = location.state) !== null && _location$state2 !== void 0 && _location$state2.fromSearchResults)) {
1359
+ history.replace(`/digit-ui/citizen/login`, {
1243
1360
  from: url
1244
1361
  });
1245
1362
  }
1246
- const _Digit$Hooks$useFetch = Digit.Hooks.useFetchCitizenBillsForBuissnessService({
1247
- businessService
1248
- }, {
1249
- refetchOnMount: true,
1250
- enabled: !(location !== null && location !== void 0 && (_location$state2 = location.state) !== null && _location$state2 !== void 0 && _location$state2.fromSearchResults)
1251
- }),
1252
- data = _Digit$Hooks$useFetch.data;
1253
- const _Digit$Hooks$useGetPa = Digit.Hooks.useGetPaymentRulesForBusinessServices(tenantId),
1254
- mdmsLoading = _Digit$Hooks$useGetPa.isLoading,
1255
- mdmsBillingData = _Digit$Hooks$useGetPa.data;
1363
+ const {
1364
+ isLoading,
1365
+ data
1366
+ } = Digit.Hooks.useFetchCitizenBillsForBuissnessService({
1367
+ businessService
1368
+ }, {
1369
+ refetchOnMount: true,
1370
+ enabled: !(location !== null && location !== void 0 && (_location$state3 = location.state) !== null && _location$state3 !== void 0 && _location$state3.fromSearchResults)
1371
+ });
1372
+ const {
1373
+ isLoading: mdmsLoading,
1374
+ data: mdmsBillingData
1375
+ } = Digit.Hooks.useGetPaymentRulesForBusinessServices(tenantId);
1256
1376
  const billsList = (data === null || data === void 0 ? void 0 : data.Bill) || [];
1257
1377
  const getPaymentRestrictionDetails = () => {
1258
1378
  var _mdmsBillingData$Mdms, _mdmsBillingData$Mdms2, _payRestrictiondetail;
@@ -1297,47 +1417,50 @@ const makePayment = function (url, data) {
1297
1417
 
1298
1418
  const SelectPaymentType$1 = props => {
1299
1419
  var _paymentdetails$Bill;
1300
- const _useLocation = useLocation(),
1301
- _useLocation$state = _useLocation.state,
1302
- state = _useLocation$state === void 0 ? {} : _useLocation$state;
1420
+ const {
1421
+ state = {}
1422
+ } = useLocation();
1303
1423
  const userInfo = Digit.UserService.getUser();
1304
- const _useState = useState(null),
1305
- showToast = _useState[0],
1306
- setShowToast = _useState[1];
1307
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
1308
- __tenantId = _Digit$Hooks$useQuery.tenantId,
1309
- authorization = _Digit$Hooks$useQuery.authorization,
1310
- wrkflow = _Digit$Hooks$useQuery.workflow,
1311
- connectionNo = _Digit$Hooks$useQuery.consumerCode;
1424
+ const [showToast, setShowToast] = useState(null);
1425
+ const {
1426
+ tenantId: __tenantId,
1427
+ authorization,
1428
+ workflow: wrkflow,
1429
+ consumerCode: connectionNo
1430
+ } = Digit.Hooks.useQueryParams();
1312
1431
  const paymentAmount = state === null || state === void 0 ? void 0 : state.paymentAmount;
1313
- const _useTranslation = useTranslation(),
1314
- t = _useTranslation.t;
1432
+ const {
1433
+ t
1434
+ } = useTranslation();
1315
1435
  const history = useHistory();
1316
- const _useLocation2 = useLocation(),
1317
- pathname = _useLocation2.pathname,
1318
- search = _useLocation2.search;
1319
- let _useParams = useParams(),
1320
- consumerCode = _useParams.consumerCode,
1321
- businessService = _useParams.businessService;
1436
+ const {
1437
+ pathname,
1438
+ search
1439
+ } = useLocation();
1440
+ let {
1441
+ consumerCode,
1442
+ businessService
1443
+ } = useParams();
1322
1444
  const tenantId = (state === null || state === void 0 ? void 0 : state.tenantId) || __tenantId || Digit.ULBService.getCurrentTenantId();
1323
1445
  const kc = window.keycloak;
1324
1446
  const stateTenant = Digit.ULBService.getStateId();
1325
- const _useForm = useForm(),
1326
- control = _useForm.control,
1327
- handleSubmit = _useForm.handleSubmit;
1328
- const _useState2 = useState(0),
1329
- Time = _useState2[0],
1330
- setTime = _useState2[1];
1331
- const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(stateTenant, "DIGIT-UI", "PaymentGateway"),
1332
- menu = _Digit$Hooks$useCommo.data,
1333
- isLoading = _Digit$Hooks$useCommo.isLoading;
1334
- const _Digit$Hooks$useFetch = Digit.Hooks.useFetchPayment({
1335
- tenantId: tenantId,
1336
- consumerCode: wrkflow === "WNS" ? connectionNo : consumerCode,
1337
- businessService
1338
- }, {}),
1339
- paymentdetails = _Digit$Hooks$useFetch.data,
1340
- paymentLoading = _Digit$Hooks$useFetch.isLoading;
1447
+ const {
1448
+ control,
1449
+ handleSubmit
1450
+ } = useForm();
1451
+ const [Time, setTime] = useState(0);
1452
+ const {
1453
+ data: menu,
1454
+ isLoading
1455
+ } = Digit.Hooks.useCommonMDMS(stateTenant, "DIGIT-UI", "PaymentGateway");
1456
+ const {
1457
+ data: paymentdetails,
1458
+ isLoading: paymentLoading
1459
+ } = Digit.Hooks.useFetchPayment({
1460
+ tenantId: tenantId,
1461
+ consumerCode: wrkflow === "WNS" ? connectionNo : consumerCode,
1462
+ businessService
1463
+ }, {});
1341
1464
  if (window.location.href.includes("ISWSCON") || wrkflow === "WNS") consumerCode = decodeURIComponent(consumerCode);
1342
1465
  if (wrkflow === "WNS") consumerCode = stringReplaceAll(consumerCode, "+", "/");
1343
1466
  useEffect(() => {
@@ -1351,8 +1474,10 @@ const SelectPaymentType$1 = props => {
1351
1474
  useEffect(() => {
1352
1475
  localStorage.setItem("BillPaymentEnabled", "true");
1353
1476
  }, []);
1354
- const name = state.name,
1355
- mobileNumber = state.mobileNumber;
1477
+ const {
1478
+ name,
1479
+ mobileNumber
1480
+ } = state;
1356
1481
  const billDetails = paymentdetails !== null && paymentdetails !== void 0 && (_paymentdetails$Bill = paymentdetails.Bill) !== null && _paymentdetails$Bill !== void 0 && _paymentdetails$Bill.length ? paymentdetails === null || paymentdetails === void 0 ? void 0 : paymentdetails.Bill[0] : {};
1357
1482
  const onSubmit = function (d) {
1358
1483
  try {
@@ -1378,7 +1503,7 @@ const SelectPaymentType$1 = props => {
1378
1503
  emailId: (userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$info4 = userInfo.info) === null || _userInfo$info4 === void 0 ? void 0 : _userInfo$info4.emailId) || (billDetails === null || billDetails === void 0 ? void 0 : billDetails.emailId),
1379
1504
  username: (userInfo === null || userInfo === void 0 ? void 0 : (_userInfo$info5 = userInfo.info) === null || _userInfo$info5 === void 0 ? void 0 : _userInfo$info5.userName) || (billDetails === null || billDetails === void 0 ? void 0 : billDetails.userName)
1380
1505
  },
1381
- callbackUrl: window.location.href.includes("mcollect") || wrkflow === "WNS" ? window.location.protocol + "//" + window.location.host + "/digit-ui/citizen/payment/success/" + businessService + "/" + encodeURIComponent(consumerCode) + "/" + tenantId + "?workflow=" + (wrkflow === "WNS" ? wrkflow : "mcollect") : window.location.protocol + "//" + window.location.host + "/digit-ui/citizen/payment/success/" + businessService + "/" + encodeURIComponent(consumerCode) + "/" + tenantId + "?propertyId=" + encodeURIComponent(consumerCode),
1506
+ callbackUrl: window.location.href.includes("mcollect") || wrkflow === "WNS" ? `${window.location.protocol}//${window.location.host}/digit-ui/citizen/payment/success/${businessService}/${encodeURIComponent(consumerCode)}/${tenantId}?workflow=${wrkflow === "WNS" ? wrkflow : "mcollect"}` : `${window.location.protocol}//${window.location.host}/digit-ui/citizen/payment/success/${businessService}/${encodeURIComponent(consumerCode)}/${tenantId}?propertyId=${encodeURIComponent(consumerCode)}`,
1382
1507
  additionalDetails: {
1383
1508
  isWhatsapp: false
1384
1509
  }
@@ -1415,7 +1540,7 @@ const SelectPaymentType$1 = props => {
1415
1540
  target: "_top"
1416
1541
  });
1417
1542
  const orderForNDSLPaymentSite = ["checksum", "messageType", "merchantId", "serviceId", "orderId", "customerId", "transactionAmount", "currencyCode", "requestDateTime", "successUrl", "failUrl", "additionalField1", "additionalField2", "additionalField3", "additionalField4", "additionalField5"];
1418
- gatewayParam["requestDateTime"] = (_gatewayParam$request = gatewayParam["requestDateTime"]) === null || _gatewayParam$request === void 0 ? void 0 : _gatewayParam$request.split(new Date().getFullYear()).join(new Date().getFullYear() + " ");
1543
+ gatewayParam["requestDateTime"] = (_gatewayParam$request = gatewayParam["requestDateTime"]) === null || _gatewayParam$request === void 0 ? void 0 : _gatewayParam$request.split(new Date().getFullYear()).join(`${new Date().getFullYear()} `);
1419
1544
  gatewayParam["successUrl"] = (redirectUrl === null || redirectUrl === void 0 ? void 0 : (_redirectUrl$split2 = redirectUrl.split("successUrl=")) === null || _redirectUrl$split2 === void 0 ? void 0 : (_redirectUrl$split2$ = _redirectUrl$split2[1]) === null || _redirectUrl$split2$ === void 0 ? void 0 : (_redirectUrl$split2$$ = _redirectUrl$split2$.split("eg_pg_txnid=")) === null || _redirectUrl$split2$$ === void 0 ? void 0 : _redirectUrl$split2$$[0]) + "eg_pg_txnid=" + (gatewayParam === null || gatewayParam === void 0 ? void 0 : gatewayParam.orderId);
1420
1545
  gatewayParam["failUrl"] = (redirectUrl === null || redirectUrl === void 0 ? void 0 : (_redirectUrl$split3 = redirectUrl.split("failUrl=")) === null || _redirectUrl$split3 === void 0 ? void 0 : (_redirectUrl$split3$ = _redirectUrl$split3[1]) === null || _redirectUrl$split3$ === void 0 ? void 0 : (_redirectUrl$split3$$ = _redirectUrl$split3$.split("eg_pg_txnid=")) === null || _redirectUrl$split3$$ === void 0 ? void 0 : _redirectUrl$split3$$[0]) + "eg_pg_txnid=" + (gatewayParam === null || gatewayParam === void 0 ? void 0 : gatewayParam.orderId);
1421
1546
  for (var key of orderForNDSLPaymentSite) {
@@ -1437,9 +1562,10 @@ const SelectPaymentType$1 = props => {
1437
1562
  let messageToShow = "CS_PAYMENT_UNKNOWN_ERROR_ON_SERVER";
1438
1563
  if ((_error$response = error.response) !== null && _error$response !== void 0 && (_error$response$data = _error$response.data) !== null && _error$response$data !== void 0 && (_error$response$data$ = _error$response$data.Errors) !== null && _error$response$data$ !== void 0 && _error$response$data$[0]) {
1439
1564
  var _error$response2, _error$response2$data, _error$response2$data2;
1440
- const _error$response$data$2 = (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.Errors) === null || _error$response2$data2 === void 0 ? void 0 : _error$response2$data2[0],
1441
- code = _error$response$data$2.code,
1442
- message = _error$response$data$2.message;
1565
+ const {
1566
+ code,
1567
+ message
1568
+ } = (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : (_error$response2$data2 = _error$response2$data.Errors) === null || _error$response2$data2 === void 0 ? void 0 : _error$response2$data2[0];
1443
1569
  messageToShow = code;
1444
1570
  }
1445
1571
  setShowToast({
@@ -1455,7 +1581,7 @@ const SelectPaymentType$1 = props => {
1455
1581
  if (authorization === "true" && !kc.authenticated) {
1456
1582
  localStorage.clear();
1457
1583
  sessionStorage.clear();
1458
- window.location.href = "/digit-ui/citizen/login?from=" + encodeURIComponent(pathname + search);
1584
+ window.location.href = `/digit-ui/citizen/login?from=${encodeURIComponent(pathname + search)}`;
1459
1585
  }
1460
1586
  if (isLoading || paymentLoading) {
1461
1587
  return /*#__PURE__*/React.createElement(Loader, null);
@@ -1521,86 +1647,94 @@ const convertEpochToDate = dateEpoch => {
1521
1647
  let year = dateFromApi.getFullYear();
1522
1648
  month = (month > 9 ? "" : "0") + month;
1523
1649
  day = (day > 9 ? "" : "0") + day;
1524
- return day + "/" + month + "/" + year;
1650
+ return `${day}/${month}/${year}`;
1525
1651
  } else {
1526
1652
  return "NA";
1527
1653
  }
1528
1654
  };
1529
1655
  const WrapPaymentComponent = props => {
1530
1656
  var _data$payments, _data$payments$Paymen, _data$payments$Paymen2, _data$payments2, _paymentData$paymentD0, _paymentData$paymentD1, _reciept_data$payment3, _reciept_data$payment4, _reciept_data$payment5, _reciept_data$payment6, _reciept_data$payment7, _reciept_data$payment8, _reciept_data$payment9, _reciept_data$payment0, _reciept_data$payment1, _reciept_data$payment10, _reciept_data$payment11, _reciept_data$payment12, _bpaData$5, _bpaData$6, _bpaData$7, _bpaData$8, _bpaData$9, _bpaData$0, _bpaData$1, _bpaData$10, _bpaData$11, _business_service$spl;
1531
- const _useTranslation = useTranslation(),
1532
- t = _useTranslation.t;
1657
+ const {
1658
+ t
1659
+ } = useTranslation();
1533
1660
  const queryClient = useQueryClient();
1534
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
1535
- egId = _Digit$Hooks$useQuery.eg_pg_txnid,
1536
- workflw = _Digit$Hooks$useQuery.workflow;
1537
- const _useState = useState(false),
1538
- printing = _useState[0],
1539
- setPrinting = _useState[1];
1540
- const _useState2 = useState(false),
1541
- allowFetchBill = _useState2[0],
1542
- setallowFetchBill = _useState2[1];
1543
- const _useParams = useParams(),
1544
- business_service = _useParams.businessService,
1545
- consumerCode = _useParams.consumerCode,
1546
- tenantId = _useParams.tenantId;
1547
- const _Digit$Hooks$obps$use = Digit.Hooks.obps.useOBPSSearch("", {}, tenantId, {
1548
- applicationNo: consumerCode
1549
- }, {}, {
1550
- enabled: window.location.href.includes("bpa") || window.location.href.includes("BPA")
1551
- }),
1552
- _Digit$Hooks$obps$use2 = _Digit$Hooks$obps$use.data,
1553
- bpaData = _Digit$Hooks$obps$use2 === void 0 ? {} : _Digit$Hooks$obps$use2,
1554
- isBpaSearchLoading = _Digit$Hooks$obps$use.isLoading;
1555
- const _Digit$Hooks$usePayme = Digit.Hooks.usePaymentUpdate({
1556
- egId,
1557
- tenantId
1558
- }, business_service, {
1559
- retry: false,
1560
- staleTime: Infinity,
1561
- refetchOnWindowFocus: false
1562
- }),
1563
- isLoading = _Digit$Hooks$usePayme.isLoading,
1564
- data = _Digit$Hooks$usePayme.data,
1565
- isError = _Digit$Hooks$usePayme.isError;
1661
+ const {
1662
+ eg_pg_txnid: egId,
1663
+ workflow: workflw,
1664
+ propertyId
1665
+ } = Digit.Hooks.useQueryParams();
1666
+ const [printing, setPrinting] = useState(false);
1667
+ const [allowFetchBill, setallowFetchBill] = useState(false);
1668
+ const {
1669
+ businessService: business_service,
1670
+ consumerCode,
1671
+ tenantId
1672
+ } = useParams();
1673
+ const {
1674
+ data: bpaData = {},
1675
+ isLoading: isBpaSearchLoading,
1676
+ isSuccess: isBpaSuccess,
1677
+ error: bpaerror
1678
+ } = Digit.Hooks.obps.useOBPSSearch("", {}, tenantId, {
1679
+ applicationNo: consumerCode
1680
+ }, {}, {
1681
+ enabled: window.location.href.includes("bpa") || window.location.href.includes("BPA")
1682
+ });
1683
+ const {
1684
+ isLoading,
1685
+ data,
1686
+ isError
1687
+ } = Digit.Hooks.usePaymentUpdate({
1688
+ egId,
1689
+ tenantId
1690
+ }, business_service, {
1691
+ retry: false,
1692
+ staleTime: Infinity,
1693
+ refetchOnWindowFocus: false
1694
+ });
1566
1695
  console.log("datatatataty", data);
1567
- const _Digit$Hooks$useAppli = Digit.Hooks.useApplicationsForBusinessServiceSearch({
1568
- businessService: business_service
1569
- }, {
1570
- enabled: false
1571
- }),
1572
- label = _Digit$Hooks$useAppli.label;
1696
+ const {
1697
+ label
1698
+ } = Digit.Hooks.useApplicationsForBusinessServiceSearch({
1699
+ businessService: business_service
1700
+ }, {
1701
+ enabled: false
1702
+ });
1573
1703
  const mutation = Digit.Hooks.chb.useChbCreateAPI(tenantId, false);
1574
1704
  const AdvertisementCreateApi = Digit.Hooks.ads.useADSCreateAPI(tenantId, false);
1575
1705
  const newTenantId = business_service.includes("WS.ONE_TIME_FEE" ) ? Digit.ULBService.getStateId() : tenantId;
1576
- const _Digit$Hooks$useRecie = Digit.Hooks.useRecieptSearch({
1577
- tenantId,
1578
- businessService: business_service,
1579
- receiptNumbers: data === null || data === void 0 ? void 0 : (_data$payments = data.payments) === null || _data$payments === void 0 ? void 0 : (_data$payments$Paymen = _data$payments.Payments) === null || _data$payments$Paymen === void 0 ? void 0 : (_data$payments$Paymen2 = _data$payments$Paymen[0]) === null || _data$payments$Paymen2 === void 0 ? void 0 : _data$payments$Paymen2.paymentDetails[0].receiptNumber
1580
- }, {
1581
- retry: false,
1582
- staleTime: Infinity,
1583
- refetchOnWindowFocus: false,
1584
- select: dat => {
1585
- return dat.Payments[0];
1586
- },
1587
- enabled: allowFetchBill
1588
- }),
1589
- reciept_data = _Digit$Hooks$useRecie.data,
1590
- recieptDataLoading = _Digit$Hooks$useRecie.isLoading;
1591
- const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(newTenantId, "common-masters", "ReceiptKey", {
1592
- select: data => {
1593
- var _data$commonMasters, _data$commonMasters$u, _data$commonMasters$u2;
1594
- return ((_data$commonMasters = data["common-masters"]) === null || _data$commonMasters === void 0 ? void 0 : (_data$commonMasters$u = _data$commonMasters.uiCommonPay) === null || _data$commonMasters$u === void 0 ? void 0 : (_data$commonMasters$u2 = _data$commonMasters$u.filter(_ref => {
1595
- let code = _ref.code;
1596
- return business_service === null || business_service === void 0 ? void 0 : business_service.includes(code);
1597
- })[0]) === null || _data$commonMasters$u2 === void 0 ? void 0 : _data$commonMasters$u2.receiptKey) || "consolidatedreceipt";
1598
- },
1599
- retry: false,
1600
- staleTime: Infinity,
1601
- refetchOnWindowFocus: false
1602
- }),
1603
- generatePdfKey = _Digit$Hooks$useCommo.data;
1706
+ const {
1707
+ data: reciept_data,
1708
+ isLoading: recieptDataLoading
1709
+ } = Digit.Hooks.useRecieptSearch({
1710
+ tenantId,
1711
+ businessService: business_service,
1712
+ receiptNumbers: data === null || data === void 0 ? void 0 : (_data$payments = data.payments) === null || _data$payments === void 0 ? void 0 : (_data$payments$Paymen = _data$payments.Payments) === null || _data$payments$Paymen === void 0 ? void 0 : (_data$payments$Paymen2 = _data$payments$Paymen[0]) === null || _data$payments$Paymen2 === void 0 ? void 0 : _data$payments$Paymen2.paymentDetails[0].receiptNumber
1713
+ }, {
1714
+ retry: false,
1715
+ staleTime: Infinity,
1716
+ refetchOnWindowFocus: false,
1717
+ select: dat => {
1718
+ return dat.Payments[0];
1719
+ },
1720
+ enabled: allowFetchBill
1721
+ });
1722
+ const {
1723
+ data: generatePdfKey
1724
+ } = Digit.Hooks.useCommonMDMS(newTenantId, "common-masters", "ReceiptKey", {
1725
+ select: data => {
1726
+ var _data$commonMasters, _data$commonMasters$u, _data$commonMasters$u2;
1727
+ return ((_data$commonMasters = data["common-masters"]) === null || _data$commonMasters === void 0 ? void 0 : (_data$commonMasters$u = _data$commonMasters.uiCommonPay) === null || _data$commonMasters$u === void 0 ? void 0 : (_data$commonMasters$u2 = _data$commonMasters$u.filter(_ref => {
1728
+ let {
1729
+ code
1730
+ } = _ref;
1731
+ return business_service === null || business_service === void 0 ? void 0 : business_service.includes(code);
1732
+ })[0]) === null || _data$commonMasters$u2 === void 0 ? void 0 : _data$commonMasters$u2.receiptKey) || "consolidatedreceipt";
1733
+ },
1734
+ retry: false,
1735
+ staleTime: Infinity,
1736
+ refetchOnWindowFocus: false
1737
+ });
1604
1738
  const payments = data === null || data === void 0 ? void 0 : data.payments;
1605
1739
  useEffect(() => {
1606
1740
  return () => {
@@ -1625,11 +1759,11 @@ const WrapPaymentComponent = props => {
1625
1759
  applicationNumber: egId,
1626
1760
  successful: false
1627
1761
  }), /*#__PURE__*/React.createElement(CardText, null, t("CS_PAYMENT_FAILURE_MESSAGE")), !(business_service !== null && business_service !== void 0 && business_service.includes("PT")) ? /*#__PURE__*/React.createElement(Link, {
1628
- to: "/digit-ui/citizen"
1762
+ to: `/digit-ui/citizen`
1629
1763
  }, /*#__PURE__*/React.createElement(SubmitBar, {
1630
1764
  label: t("CORE_COMMON_GO_TO_HOME")
1631
1765
  })) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Link, {
1632
- to: applicationNo && "/digit-ui/citizen/payment/my-bills/" + business_service + "/" + applicationNo || "/digit-ui/citizen"
1766
+ to: applicationNo && `/digit-ui/citizen/payment/my-bills/${business_service}/${applicationNo}` || "/digit-ui/citizen"
1633
1767
  }, /*#__PURE__*/React.createElement(SubmitBar, {
1634
1768
  label: t("CS_PAYMENT_TRY_AGAIN")
1635
1769
  })), /*#__PURE__*/React.createElement("div", {
@@ -1642,7 +1776,7 @@ const WrapPaymentComponent = props => {
1642
1776
  marginTop: "8px"
1643
1777
  }
1644
1778
  }, /*#__PURE__*/React.createElement(Link, {
1645
- to: "/digit-ui/citizen"
1779
+ to: `/digit-ui/citizen`
1646
1780
  }, t("CORE_COMMON_GO_TO_HOME")))));
1647
1781
  }
1648
1782
  const paymentData = data === null || data === void 0 ? void 0 : (_data$payments2 = data.payments) === null || _data$payments2 === void 0 ? void 0 : _data$payments2.Payments[0];
@@ -1740,9 +1874,10 @@ const WrapPaymentComponent = props => {
1740
1874
  let details;
1741
1875
  let businessServ = payments.Payments[0].paymentDetails[0].businessService;
1742
1876
  if (payments.Payments[0].paymentDetails[0].businessService == "BPAREG") {
1743
- details = _extends({}, payments.Payments[0].additionalDetails, {
1877
+ details = {
1878
+ ...payments.Payments[0].additionalDetails,
1744
1879
  "stakeholderType": "Application"
1745
- });
1880
+ };
1746
1881
  }
1747
1882
  payments.Payments[0].additionalDetails = details;
1748
1883
  paymentArray[0] = payments.Payments[0];
@@ -1750,13 +1885,17 @@ const WrapPaymentComponent = props => {
1750
1885
  const _temp4 = function () {
1751
1886
  if (business_service !== null && business_service !== void 0 && business_service.includes("WS") || business_service !== null && business_service !== void 0 && business_service.includes("SW")) {
1752
1887
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
1753
- Payments: [_extends({}, paymentData)]
1888
+ Payments: [{
1889
+ ...paymentData
1890
+ }]
1754
1891
  }, generatePdfKeyForWs)).then(function (_Digit$PaymentService) {
1755
1892
  response = _Digit$PaymentService;
1756
1893
  const _temp2 = function (_response3, _response3$filestoreI, _response4, _response4$fileStoreI) {
1757
1894
  if (!((_response3 = response) !== null && _response3 !== void 0 && (_response3$filestoreI = _response3.filestoreIds) !== null && _response3$filestoreI !== void 0 && _response3$filestoreI[0]) && !((_response4 = response) !== null && _response4 !== void 0 && (_response4$fileStoreI = _response4.fileStoreIds) !== null && _response4$fileStoreI !== void 0 && _response4$fileStoreI[0])) {
1758
1895
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
1759
- Payments: [_extends({}, paymentData)]
1896
+ Payments: [{
1897
+ ...paymentData
1898
+ }]
1760
1899
  }, generatePdfKey)).then(function (_Digit$PaymentService2) {
1761
1900
  response = _Digit$PaymentService2;
1762
1901
  });
@@ -1774,23 +1913,30 @@ const WrapPaymentComponent = props => {
1774
1913
  return Promise.resolve(Digit.OBPSService.BPASearch(payments.Payments[0].tenantId, queryObj)).then(function (bpaResponse) {
1775
1914
  var _bpaResponse$BPA$, _bpaResponse$BPA$$add, _paymentData$paymentD, _bpaResponse$BPA$2, _bpaResponse$BPA$2$ad;
1776
1915
  const formattedStakeholderType = bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA$ = bpaResponse.BPA[0]) === null || _bpaResponse$BPA$ === void 0 ? void 0 : (_bpaResponse$BPA$$add = _bpaResponse$BPA$.additionalDetails) === null || _bpaResponse$BPA$$add === void 0 ? void 0 : _bpaResponse$BPA$$add.typeOfArchitect;
1777
- const updatedpayments = _extends({}, paymentData, {
1778
- paymentDetails: [_extends({}, (_paymentData$paymentD = paymentData.paymentDetails) === null || _paymentData$paymentD === void 0 ? void 0 : _paymentData$paymentD[0], {
1779
- additionalDetails: _extends({}, paymentData.paymentDetails[0].additionalDetails, {
1916
+ const updatedpayments = {
1917
+ ...paymentData,
1918
+ paymentDetails: [{
1919
+ ...((_paymentData$paymentD = paymentData.paymentDetails) === null || _paymentData$paymentD === void 0 ? void 0 : _paymentData$paymentD[0]),
1920
+ additionalDetails: {
1921
+ ...paymentData.paymentDetails[0].additionalDetails,
1780
1922
  "propertyID": bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA$2 = bpaResponse.BPA[0]) === null || _bpaResponse$BPA$2 === void 0 ? void 0 : (_bpaResponse$BPA$2$ad = _bpaResponse$BPA$2.additionalDetails) === null || _bpaResponse$BPA$2$ad === void 0 ? void 0 : _bpaResponse$BPA$2$ad.propertyID,
1781
1923
  "stakeholderType": formattedStakeholderType.charAt(0).toUpperCase() + formattedStakeholderType.slice(1).toLowerCase()
1782
- })
1783
- })]
1784
- });
1924
+ }
1925
+ }]
1926
+ };
1785
1927
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
1786
- Payments: [_extends({}, updatedpayments)]
1928
+ Payments: [{
1929
+ ...updatedpayments
1930
+ }]
1787
1931
  }, generatePdfKey)).then(function (_Digit$PaymentService3) {
1788
1932
  response = _Digit$PaymentService3;
1789
1933
  });
1790
1934
  });
1791
1935
  } else {
1792
1936
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
1793
- Payments: [_extends({}, paymentData)]
1937
+ Payments: [{
1938
+ ...paymentData
1939
+ }]
1794
1940
  }, generatePdfKey)).then(function (_Digit$PaymentService4) {
1795
1941
  response = _Digit$PaymentService4;
1796
1942
  });
@@ -1874,9 +2020,12 @@ const WrapPaymentComponent = props => {
1874
2020
  edcrData = edcrResponse === null || edcrResponse === void 0 ? void 0 : (_edcrResponse$edcrDet = edcrResponse.edcrDetail) === null || _edcrResponse$edcrDet === void 0 ? void 0 : _edcrResponse$edcrDet[0];
1875
2021
  let currentDate = new Date();
1876
2022
  bpaDataDetails.additionalDetails.runDate = convertDateToEpoch(currentDate.getFullYear() + "-" + (currentDate.getMonth() + 1) + "-" + currentDate.getDate());
1877
- let reqData = _extends({}, bpaDataDetails, {
1878
- edcrDetail: [_extends({}, edcrData)]
1879
- });
2023
+ let reqData = {
2024
+ ...bpaDataDetails,
2025
+ edcrDetail: [{
2026
+ ...edcrData
2027
+ }]
2028
+ };
1880
2029
  console.log("reqData", reqData);
1881
2030
  return Promise.resolve(Digit.PaymentService.generatePdf(bpaDataDetails === null || bpaDataDetails === void 0 ? void 0 : bpaDataDetails.tenantId, {
1882
2031
  Bpa: [reqData]
@@ -1888,7 +2037,9 @@ const WrapPaymentComponent = props => {
1888
2037
  window.open(fileStore[response === null || response === void 0 ? void 0 : response.filestoreIds[0]], "_blank");
1889
2038
  reqData["applicationType"] = bpaDataDetails === null || bpaDataDetails === void 0 ? void 0 : (_bpaDataDetails$addit = bpaDataDetails.additionalDetails) === null || _bpaDataDetails$addit === void 0 ? void 0 : _bpaDataDetails$addit.applicationType;
1890
2039
  return Promise.resolve(Digit.OBPSService.edcr_report_download({
1891
- BPA: _extends({}, reqData)
2040
+ BPA: {
2041
+ ...reqData
2042
+ }
1892
2043
  })).then(function (edcrresponse) {
1893
2044
  const responseStatus = parseInt(edcrresponse.status, 10);
1894
2045
  if (responseStatus === 201 || responseStatus === 200) {
@@ -1896,7 +2047,7 @@ const WrapPaymentComponent = props => {
1896
2047
  type: "application/pdf"
1897
2048
  })) : downloadPdf(new Blob([edcrresponse.data], {
1898
2049
  type: "application/pdf"
1899
- }), "edcrReport.pdf");
2050
+ }), `edcrReport.pdf`);
1900
2051
  }
1901
2052
  });
1902
2053
  });
@@ -1908,11 +2059,12 @@ const WrapPaymentComponent = props => {
1908
2059
  }
1909
2060
  };
1910
2061
  const getBillingPeriod = billDetails => {
1911
- const _ref2 = billDetails || {},
1912
- taxPeriodFrom = _ref2.taxPeriodFrom,
1913
- taxPeriodTo = _ref2.taxPeriodTo,
1914
- fromPeriod = _ref2.fromPeriod,
1915
- toPeriod = _ref2.toPeriod;
2062
+ const {
2063
+ taxPeriodFrom,
2064
+ taxPeriodTo,
2065
+ fromPeriod,
2066
+ toPeriod
2067
+ } = billDetails || {};
1916
2068
  if (taxPeriodFrom && taxPeriodTo) {
1917
2069
  let from = new Date(taxPeriodFrom).getFullYear().toString();
1918
2070
  let to = new Date(taxPeriodTo).getFullYear().toString();
@@ -1934,19 +2086,19 @@ const WrapPaymentComponent = props => {
1934
2086
  };
1935
2087
  let bannerText;
1936
2088
  if (workflw) {
1937
- bannerText = "CITIZEN_SUCCESS_UC_PAYMENT_MESSAGE";
2089
+ bannerText = `CITIZEN_SUCCESS_UC_PAYMENT_MESSAGE`;
1938
2090
  } else {
1939
2091
  var _paymentData$paymentD2, _paymentData$paymentD3, _paymentData$paymentD4, _paymentData$paymentD5, _paymentData$paymentD6;
1940
2092
  if (paymentData !== null && paymentData !== void 0 && (_paymentData$paymentD2 = paymentData.paymentDetails) !== null && _paymentData$paymentD2 !== void 0 && (_paymentData$paymentD3 = _paymentData$paymentD2[0]) !== null && _paymentData$paymentD3 !== void 0 && _paymentData$paymentD3.businessService && paymentData !== null && paymentData !== void 0 && (_paymentData$paymentD4 = paymentData.paymentDetails) !== null && _paymentData$paymentD4 !== void 0 && (_paymentData$paymentD5 = _paymentData$paymentD4[0]) !== null && _paymentData$paymentD5 !== void 0 && (_paymentData$paymentD6 = _paymentData$paymentD5.businessService) !== null && _paymentData$paymentD6 !== void 0 && _paymentData$paymentD6.includes("BPA")) {
1941
2093
  var _paymentData$paymentD7;
1942
2094
  let nameOfAchitect = sessionStorage.getItem("BPA_ARCHITECT_NAME");
1943
2095
  let parsedArchitectName = nameOfAchitect ? JSON.parse(nameOfAchitect) : "ARCHITECT";
1944
- bannerText = "CITIZEN_SUCCESS_" + (paymentData === null || paymentData === void 0 ? void 0 : (_paymentData$paymentD7 = paymentData.paymentDetails[0]) === null || _paymentData$paymentD7 === void 0 ? void 0 : _paymentData$paymentD7.businessService.replace(/\./g, "_")) + "_" + parsedArchitectName + "_PAYMENT_MESSAGE";
2096
+ bannerText = `CITIZEN_SUCCESS_${paymentData === null || paymentData === void 0 ? void 0 : (_paymentData$paymentD7 = paymentData.paymentDetails[0]) === null || _paymentData$paymentD7 === void 0 ? void 0 : _paymentData$paymentD7.businessService.replace(/\./g, "_")}_${parsedArchitectName}_PAYMENT_MESSAGE`;
1945
2097
  } else if (business_service !== null && business_service !== void 0 && business_service.includes("WS") || business_service !== null && business_service !== void 0 && business_service.includes("SW")) {
1946
- bannerText = t("CITIZEN_SUCCESS_" + (paymentData === null || paymentData === void 0 ? void 0 : paymentData.paymentDetails[0].businessService.replace(/\./g, "_")) + "_WS_PAYMENT_MESSAGE");
2098
+ bannerText = t(`CITIZEN_SUCCESS_${paymentData === null || paymentData === void 0 ? void 0 : paymentData.paymentDetails[0].businessService.replace(/\./g, "_")}_WS_PAYMENT_MESSAGE`);
1947
2099
  } else {
1948
2100
  var _paymentData$paymentD8, _paymentData$paymentD9;
1949
- bannerText = paymentData !== null && paymentData !== void 0 && (_paymentData$paymentD8 = paymentData.paymentDetails[0]) !== null && _paymentData$paymentD8 !== void 0 && _paymentData$paymentD8.businessService ? "CITIZEN_SUCCESS_" + (paymentData === null || paymentData === void 0 ? void 0 : (_paymentData$paymentD9 = paymentData.paymentDetails[0]) === null || _paymentData$paymentD9 === void 0 ? void 0 : _paymentData$paymentD9.businessService.replace(/\./g, "_")) + "_PAYMENT_MESSAGE" : t("CITIZEN_SUCCESS_UC_PAYMENT_MESSAGE");
2101
+ bannerText = paymentData !== null && paymentData !== void 0 && (_paymentData$paymentD8 = paymentData.paymentDetails[0]) !== null && _paymentData$paymentD8 !== void 0 && _paymentData$paymentD8.businessService ? `CITIZEN_SUCCESS_${paymentData === null || paymentData === void 0 ? void 0 : (_paymentData$paymentD9 = paymentData.paymentDetails[0]) === null || _paymentData$paymentD9 === void 0 ? void 0 : _paymentData$paymentD9.businessService.replace(/\./g, "_")}_PAYMENT_MESSAGE` : t("CITIZEN_SUCCESS_UC_PAYMENT_MESSAGE");
1950
2102
  }
1951
2103
  }
1952
2104
  const rowContainerStyle = {
@@ -1976,9 +2128,10 @@ const WrapPaymentComponent = props => {
1976
2128
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
1977
2129
  hallsBookingApplication: [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]]
1978
2130
  }, generatePdfKeyForTL)).then(function (response) {
1979
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0], {
2131
+ const updatedApplication = {
2132
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]),
1980
2133
  permissionLetterFilestoreId: response === null || response === void 0 ? void 0 : response.filestoreIds[0]
1981
- });
2134
+ };
1982
2135
  return Promise.resolve(mutation.mutateAsync({
1983
2136
  hallsBookingApplication: updatedApplication
1984
2137
  })).then(function () {
@@ -2016,9 +2169,10 @@ const WrapPaymentComponent = props => {
2016
2169
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
2017
2170
  bookingApplication: [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]]
2018
2171
  }, generatePdfKeyForTL)).then(function (response) {
2019
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0], {
2172
+ const updatedApplication = {
2173
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]),
2020
2174
  permissionLetterFilestoreId: response === null || response === void 0 ? void 0 : response.filestoreIds[0]
2021
- });
2175
+ };
2022
2176
  return Promise.resolve(AdvertisementCreateApi.mutateAsync({
2023
2177
  bookingApplication: updatedApplication
2024
2178
  })).then(function () {
@@ -2148,13 +2302,16 @@ const WrapPaymentComponent = props => {
2148
2302
  filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
2149
2303
  };
2150
2304
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
2151
- Payments: [_extends({}, paymentData)]
2305
+ Payments: [{
2306
+ ...paymentData
2307
+ }]
2152
2308
  }, "advservice-receipt")).then(function (_Digit$PaymentService5) {
2153
2309
  var _response5;
2154
2310
  response = _Digit$PaymentService5;
2155
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0], {
2311
+ const updatedApplication = {
2312
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]),
2156
2313
  paymentReceiptFilestoreId: (_response5 = response) === null || _response5 === void 0 ? void 0 : _response5.filestoreIds[0]
2157
- });
2314
+ };
2158
2315
  return Promise.resolve(AdvertisementCreateApi.mutateAsync({
2159
2316
  bookingApplication: updatedApplication
2160
2317
  })).then(function () {
@@ -2193,13 +2350,16 @@ const WrapPaymentComponent = props => {
2193
2350
  filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
2194
2351
  };
2195
2352
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
2196
- Payments: [_extends({}, paymentData)]
2353
+ Payments: [{
2354
+ ...paymentData
2355
+ }]
2197
2356
  }, "chbservice-receipt")).then(function (_Digit$PaymentService6) {
2198
2357
  var _response7;
2199
2358
  response = _Digit$PaymentService6;
2200
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0], {
2359
+ const updatedApplication = {
2360
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]),
2201
2361
  paymentReceiptFilestoreId: (_response7 = response) === null || _response7 === void 0 ? void 0 : _response7.filestoreIds[0]
2202
- });
2362
+ };
2203
2363
  return Promise.resolve(mutation.mutateAsync({
2204
2364
  hallsBookingApplication: updatedApplication
2205
2365
  })).then(function () {
@@ -2502,7 +2662,7 @@ const WrapPaymentComponent = props => {
2502
2662
  rowContainerStyle: rowContainerStyle,
2503
2663
  last: true,
2504
2664
  label: t("CS_PAYMENT_AMOUNT_PENDING"),
2505
- text: (paymentData === null || paymentData === void 0 ? void 0 : paymentData.totalDue) - (paymentData === null || paymentData === void 0 ? void 0 : paymentData.totalAmountPaid) || reciept_data !== null && reciept_data !== void 0 && (_reciept_data$payment3 = reciept_data.paymentDetails) !== null && _reciept_data$payment3 !== void 0 && (_reciept_data$payment4 = _reciept_data$payment3[0]) !== null && _reciept_data$payment4 !== void 0 && _reciept_data$payment4.totalDue && reciept_data !== null && reciept_data !== void 0 && (_reciept_data$payment5 = reciept_data.paymentDetails) !== null && _reciept_data$payment5 !== void 0 && (_reciept_data$payment6 = _reciept_data$payment5[0]) !== null && _reciept_data$payment6 !== void 0 && _reciept_data$payment6.totalAmountPaid ? "\u20B9 " + ((reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$payment7 = reciept_data.paymentDetails) === null || _reciept_data$payment7 === void 0 ? void 0 : (_reciept_data$payment8 = _reciept_data$payment7[0]) === null || _reciept_data$payment8 === void 0 ? void 0 : _reciept_data$payment8.totalDue) - (reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$payment9 = reciept_data.paymentDetails) === null || _reciept_data$payment9 === void 0 ? void 0 : (_reciept_data$payment0 = _reciept_data$payment9[0]) === null || _reciept_data$payment0 === void 0 ? void 0 : _reciept_data$payment0.totalAmountPaid)) : "\u20B9 " + 0
2665
+ text: (paymentData === null || paymentData === void 0 ? void 0 : paymentData.totalDue) - (paymentData === null || paymentData === void 0 ? void 0 : paymentData.totalAmountPaid) || reciept_data !== null && reciept_data !== void 0 && (_reciept_data$payment3 = reciept_data.paymentDetails) !== null && _reciept_data$payment3 !== void 0 && (_reciept_data$payment4 = _reciept_data$payment3[0]) !== null && _reciept_data$payment4 !== void 0 && _reciept_data$payment4.totalDue && reciept_data !== null && reciept_data !== void 0 && (_reciept_data$payment5 = reciept_data.paymentDetails) !== null && _reciept_data$payment5 !== void 0 && (_reciept_data$payment6 = _reciept_data$payment5[0]) !== null && _reciept_data$payment6 !== void 0 && _reciept_data$payment6.totalAmountPaid ? `₹ ${(reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$payment7 = reciept_data.paymentDetails) === null || _reciept_data$payment7 === void 0 ? void 0 : (_reciept_data$payment8 = _reciept_data$payment7[0]) === null || _reciept_data$payment8 === void 0 ? void 0 : _reciept_data$payment8.totalDue) - (reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$payment9 = reciept_data.paymentDetails) === null || _reciept_data$payment9 === void 0 ? void 0 : (_reciept_data$payment0 = _reciept_data$payment9[0]) === null || _reciept_data$payment0 === void 0 ? void 0 : _reciept_data$payment0.totalAmountPaid)}` : `₹ ${0}`
2506
2666
  }), /*#__PURE__*/React.createElement(Row, {
2507
2667
  rowContainerStyle: rowContainerStyle,
2508
2668
  last: true,
@@ -2512,7 +2672,7 @@ const WrapPaymentComponent = props => {
2512
2672
  rowContainerStyle: rowContainerStyle,
2513
2673
  last: true,
2514
2674
  label: t(ommitRupeeSymbol ? "CS_PAYMENT_AMOUNT_PAID_WITHOUT_SYMBOL" : "CS_PAYMENT_AMOUNT_PAID"),
2515
- text: (paymentData === null || paymentData === void 0 ? void 0 : paymentData.totalAmountPaid) || (reciept_data !== null && reciept_data !== void 0 && (_reciept_data$payment1 = reciept_data.paymentDetails) !== null && _reciept_data$payment1 !== void 0 && (_reciept_data$payment10 = _reciept_data$payment1[0]) !== null && _reciept_data$payment10 !== void 0 && _reciept_data$payment10.totalAmountPaid ? "₹ " + (reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$payment11 = reciept_data.paymentDetails) === null || _reciept_data$payment11 === void 0 ? void 0 : (_reciept_data$payment12 = _reciept_data$payment11[0]) === null || _reciept_data$payment12 === void 0 ? void 0 : _reciept_data$payment12.totalAmountPaid) : "\u20B9 0")
2675
+ text: (paymentData === null || paymentData === void 0 ? void 0 : paymentData.totalAmountPaid) || (reciept_data !== null && reciept_data !== void 0 && (_reciept_data$payment1 = reciept_data.paymentDetails) !== null && _reciept_data$payment1 !== void 0 && (_reciept_data$payment10 = _reciept_data$payment1[0]) !== null && _reciept_data$payment10 !== void 0 && _reciept_data$payment10.totalAmountPaid ? "₹ " + (reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$payment11 = reciept_data.paymentDetails) === null || _reciept_data$payment11 === void 0 ? void 0 : (_reciept_data$payment12 = _reciept_data$payment11[0]) === null || _reciept_data$payment12 === void 0 ? void 0 : _reciept_data$payment12.totalAmountPaid) : `₹ 0`)
2516
2676
  }), (business_service !== "PT" || workflw) && /*#__PURE__*/React.createElement(Row, {
2517
2677
  rowContainerStyle: rowContainerStyle,
2518
2678
  last: true,
@@ -2623,7 +2783,7 @@ const WrapPaymentComponent = props => {
2623
2783
  marginTop: "10px"
2624
2784
  }
2625
2785
  }, /*#__PURE__*/React.createElement(Link, {
2626
- to: "/digit-ui/citizen/feedback?redirectedFrom=" + "digit-ui/citizen/payment/success" + "&propertyId=" + (consumerCode ? consumerCode : "") + "&acknowldgementNumber=" + (egId ? egId : "") + "&tenantId=" + tenantId + "&creationReason=" + (business_service === null || business_service === void 0 ? void 0 : (_business_service$spl = business_service.split(".")) === null || _business_service$spl === void 0 ? void 0 : _business_service$spl[1])
2786
+ to: `/digit-ui/citizen/feedback?redirectedFrom=${"digit-ui/citizen/payment/success"}&propertyId=${consumerCode ? consumerCode : ""}&acknowldgementNumber=${egId ? egId : ""}&tenantId=${tenantId}&creationReason=${business_service === null || business_service === void 0 ? void 0 : (_business_service$spl = business_service.split(".")) === null || _business_service$spl === void 0 ? void 0 : _business_service$spl[1]}`
2627
2787
  }, /*#__PURE__*/React.createElement(SubmitBar, {
2628
2788
  label: t("CS_REVIEW_AND_FEEDBACK")
2629
2789
  }))), business_service !== null && business_service !== void 0 && business_service.includes("PT") ? /*#__PURE__*/React.createElement("div", {
@@ -2823,25 +2983,25 @@ const WrapPaymentComponent = props => {
2823
2983
  marginTop: "8px"
2824
2984
  }
2825
2985
  }, /*#__PURE__*/React.createElement(Link, {
2826
- to: "/digit-ui/citizen"
2986
+ to: `/digit-ui/citizen`
2827
2987
  }, t("CORE_COMMON_GO_TO_HOME"))), business_service == "TL" && /*#__PURE__*/React.createElement(Link, {
2828
- to: "/digit-ui/citizen"
2988
+ to: `/digit-ui/citizen`
2829
2989
  }, /*#__PURE__*/React.createElement(SubmitBar, {
2830
2990
  label: t("CORE_COMMON_GO_TO_HOME")
2831
2991
  })), business_service == "pet-services" && /*#__PURE__*/React.createElement(Link, {
2832
- to: "/digit-ui/citizen"
2992
+ to: `/digit-ui/citizen`
2833
2993
  }, /*#__PURE__*/React.createElement(SubmitBar, {
2834
2994
  label: t("CORE_COMMON_GO_TO_HOME")
2835
2995
  })), business_service == "chb-services" && /*#__PURE__*/React.createElement(Link, {
2836
- to: "/digit-ui/citizen"
2996
+ to: `/digit-ui/citizen`
2837
2997
  }, /*#__PURE__*/React.createElement(SubmitBar, {
2838
2998
  label: t("CORE_COMMON_GO_TO_HOME")
2839
2999
  })), business_service == "adv-services" && /*#__PURE__*/React.createElement(Link, {
2840
- to: "/digit-ui/citizen"
3000
+ to: `/digit-ui/citizen`
2841
3001
  }, /*#__PURE__*/React.createElement(SubmitBar, {
2842
3002
  label: t("CORE_COMMON_GO_TO_HOME")
2843
3003
  })), business_service == "sv-services" && /*#__PURE__*/React.createElement(Link, {
2844
- to: "/digit-ui/citizen"
3004
+ to: `/digit-ui/citizen`
2845
3005
  }, /*#__PURE__*/React.createElement(SubmitBar, {
2846
3006
  label: t("CORE_COMMON_GO_TO_HOME"),
2847
3007
  style: {
@@ -2850,10 +3010,12 @@ const WrapPaymentComponent = props => {
2850
3010
  })));
2851
3011
  };
2852
3012
  const FailedPayment = props => {
2853
- const _useTranslation2 = useTranslation(),
2854
- t = _useTranslation2.t;
2855
- const _useParams2 = useParams(),
2856
- consumerCode = _useParams2.consumerCode;
3013
+ const {
3014
+ t
3015
+ } = useTranslation();
3016
+ const {
3017
+ consumerCode
3018
+ } = useParams();
2857
3019
  const getMessage = () => "Failure !";
2858
3020
  return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Banner, {
2859
3021
  message: getMessage(),
@@ -2863,20 +3025,25 @@ const FailedPayment = props => {
2863
3025
  };
2864
3026
 
2865
3027
  const CitizenPayment = _ref => {
2866
- let stateCode = _ref.stateCode,
2867
- cityCode = _ref.cityCode,
2868
- moduleCode = _ref.moduleCode;
2869
- const _useRouteMatch = useRouteMatch(),
2870
- currentPath = _useRouteMatch.path;
2871
- const _useLocation = useLocation(),
2872
- routerState = _useLocation.state;
3028
+ let {
3029
+ stateCode,
3030
+ cityCode,
3031
+ moduleCode
3032
+ } = _ref;
3033
+ const {
3034
+ path: currentPath
3035
+ } = useRouteMatch();
3036
+ const {
3037
+ state: routerState
3038
+ } = useLocation();
2873
3039
  const commonProps = {
2874
3040
  stateCode,
2875
3041
  cityCode,
2876
3042
  moduleCode
2877
3043
  };
2878
- const _useTranslation = useTranslation(),
2879
- t = _useTranslation.t;
3044
+ const {
3045
+ t
3046
+ } = useTranslation();
2880
3047
  let isMobile = window.Digit.Utils.browser.isMobile();
2881
3048
  const pathname = window.location.pathname;
2882
3049
  const crumbs = [{
@@ -2954,23 +3121,23 @@ const CitizenPayment = _ref => {
2954
3121
  }, /*#__PURE__*/React.createElement("div", {
2955
3122
  className: "employee-form-content"
2956
3123
  }, /*#__PURE__*/React.createElement(PrivateRoute, {
2957
- path: currentPath + "/my-bills/:businessService"
3124
+ path: `${currentPath}/my-bills/:businessService`
2958
3125
  }, /*#__PURE__*/React.createElement(MyBills, {
2959
3126
  stateCode: stateCode
2960
3127
  })), /*#__PURE__*/React.createElement(PrivateRoute, {
2961
- path: currentPath + "/billDetails/:businessService/:consumerCode/:paymentAmt"
3128
+ path: `${currentPath}/billDetails/:businessService/:consumerCode/:paymentAmt`
2962
3129
  }, /*#__PURE__*/React.createElement(SelectPaymentType, _extends({}, commonProps, {
2963
3130
  stateCode: stateCode,
2964
3131
  basePath: currentPath
2965
3132
  }))), /*#__PURE__*/React.createElement(PrivateRoute, {
2966
- path: currentPath + "/collect/:businessService/:consumerCode"
3133
+ path: `${currentPath}/collect/:businessService/:consumerCode`
2967
3134
  }, /*#__PURE__*/React.createElement(SelectPaymentType$1, _extends({}, commonProps, {
2968
3135
  stateCode: stateCode,
2969
3136
  basePath: currentPath
2970
3137
  }))), /*#__PURE__*/React.createElement(PrivateRoute, {
2971
- path: currentPath + "/success/:businessService/:consumerCode/:tenantId"
3138
+ path: `${currentPath}/success/:businessService/:consumerCode/:tenantId`
2972
3139
  }, /*#__PURE__*/React.createElement(SuccessfulPayment, commonProps)), /*#__PURE__*/React.createElement(PrivateRoute, {
2973
- path: currentPath + "/failure"
3140
+ path: `${currentPath}/failure`
2974
3141
  }, /*#__PURE__*/React.createElement(FailedPayment, commonProps))))))));
2975
3142
  };
2976
3143
 
@@ -2991,7 +3158,7 @@ const getKeyNotesConfig = (businessService, t) => {
2991
3158
  fontSize: "16px",
2992
3159
  fontWeight: "normal"
2993
3160
  }
2994
- }, " ( " + t("CS_PAYMENT_OVERDUE") + " " + days + " " + t(days === 1 ? "CS_COMMON_DAY" : "CS_COMMON_DAYS") + ")") : null);
3161
+ }, ` ( ${t("CS_PAYMENT_OVERDUE")} ${days} ${t(days === 1 ? "CS_COMMON_DAY" : "CS_COMMON_DAYS")})`) : null);
2995
3162
  }],
2996
3163
  fallback: "N/A",
2997
3164
  noteStyle: {
@@ -3014,9 +3181,10 @@ const getKeyNotesConfig = (businessService, t) => {
3014
3181
  }, {
3015
3182
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
3016
3183
  keyPath: ["billDetails", d => {
3017
- const _d$ = d[0],
3018
- fromPeriod = _d$.fromPeriod,
3019
- toPeriod = _d$.toPeriod;
3184
+ const {
3185
+ fromPeriod,
3186
+ toPeriod
3187
+ } = d[0];
3020
3188
  if (fromPeriod && toPeriod) {
3021
3189
  let from = new Date(fromPeriod).getFullYear().toString();
3022
3190
  let to = new Date(toPeriod).getFullYear().toString();
@@ -3027,11 +3195,11 @@ const getKeyNotesConfig = (businessService, t) => {
3027
3195
  }, {
3028
3196
  keyValue: "PT_DUE_DATE",
3029
3197
  keyPath: ["billDetails", d => {
3030
- var _d$2, _d$3;
3031
- if (!((_d$2 = d[0]) !== null && _d$2 !== void 0 && _d$2.toPeriod)) return "N/A";
3032
- const date = new Date((_d$3 = d[0]) === null || _d$3 === void 0 ? void 0 : _d$3.toPeriod);
3198
+ var _d$, _d$2;
3199
+ if (!((_d$ = d[0]) !== null && _d$ !== void 0 && _d$.toPeriod)) return "N/A";
3200
+ const date = new Date((_d$2 = d[0]) === null || _d$2 === void 0 ? void 0 : _d$2.toPeriod);
3033
3201
  const month = Digit.Utils.date.monthNames[date.getMonth()];
3034
- return date.getDate() + " " + month + " " + date.getFullYear();
3202
+ return `${date.getDate()} ${month} ${date.getFullYear()}`;
3035
3203
  }],
3036
3204
  fallback: "N/A"
3037
3205
  }],
@@ -3082,15 +3250,14 @@ const useCashPaymentDetails = (props, t) => {
3082
3250
  };
3083
3251
  const CashDetailsComponent = _ref => {
3084
3252
  var _props$value, _props$value2;
3085
- let props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
3086
- const _useTranslation = useTranslation(),
3087
- t = _useTranslation.t;
3088
- const _useState = useState(props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.manualReceiptDate),
3089
- manualReceiptDate = _useState[0],
3090
- setManualReceiptDate = _useState[1];
3091
- const _useState2 = useState(props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.manualReceiptNumber),
3092
- manualReceiptNumber = _useState2[0],
3093
- setManualReceiptNumber = _useState2[1];
3253
+ let {
3254
+ ...props
3255
+ } = _ref;
3256
+ const {
3257
+ t
3258
+ } = useTranslation();
3259
+ const [manualReceiptDate, setManualReceiptDate] = useState(props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.manualReceiptDate);
3260
+ const [manualReceiptNumber, setManualReceiptNumber] = useState(props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.manualReceiptNumber);
3094
3261
  useEffect(() => {
3095
3262
  if (props.onChange) {
3096
3263
  let errorObj = {};
@@ -3141,18 +3308,15 @@ const useCardPaymentDetails = (props, t) => {
3141
3308
  };
3142
3309
  const CardDetailsComponent = _ref => {
3143
3310
  var _props$value, _props$value2, _props$value3;
3144
- let props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
3145
- const _useTranslation = useTranslation(),
3146
- t = _useTranslation.t;
3147
- const _useState = useState(props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.last4Digits),
3148
- last4Digits = _useState[0],
3149
- setLast4Digits = _useState[1];
3150
- const _useState2 = useState(props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.transactionNumber),
3151
- transactionNumber = _useState2[0],
3152
- setTransactionNumber = _useState2[1];
3153
- const _useState3 = useState(props === null || props === void 0 ? void 0 : (_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.reTransanctionNumber),
3154
- reTransanctionNumber = _useState3[0],
3155
- setReTransanctionNumber = _useState3[1];
3311
+ let {
3312
+ ...props
3313
+ } = _ref;
3314
+ const {
3315
+ t
3316
+ } = useTranslation();
3317
+ const [last4Digits, setLast4Digits] = useState(props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.last4Digits);
3318
+ const [transactionNumber, setTransactionNumber] = useState(props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.transactionNumber);
3319
+ const [reTransanctionNumber, setReTransanctionNumber] = useState(props === null || props === void 0 ? void 0 : (_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.reTransanctionNumber);
3156
3320
  useEffect(() => {
3157
3321
  if (props.onChange) {
3158
3322
  let errorObj = {};
@@ -3169,19 +3333,19 @@ const CardDetailsComponent = _ref => {
3169
3333
  }, [last4Digits, transactionNumber, reTransanctionNumber]);
3170
3334
  return /*#__PURE__*/React.createElement("div", {
3171
3335
  className: "formcomposer-section-grid"
3172
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("NOC_PAYMENT_CARD_LAST_DIGITS_LABEL") + " *"), /*#__PURE__*/React.createElement(TextInput, {
3336
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NOC_PAYMENT_CARD_LAST_DIGITS_LABEL")} *`), /*#__PURE__*/React.createElement(TextInput, {
3173
3337
  value: last4Digits,
3174
3338
  name: "instrumentNumber",
3175
3339
  maxLength: "4",
3176
3340
  minLength: "4",
3177
3341
  required: true,
3178
3342
  onChange: e => setLast4Digits(e.target.value)
3179
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("NOC_PAYMENT_TRANS_NO_LABEL") + " *"), /*#__PURE__*/React.createElement(TextInput, {
3343
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NOC_PAYMENT_TRANS_NO_LABEL")} *`), /*#__PURE__*/React.createElement(TextInput, {
3180
3344
  value: transactionNumber,
3181
3345
  name: "instrumentNumber",
3182
3346
  required: true,
3183
3347
  onChange: e => setTransactionNumber(e.target.value)
3184
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("NOC_PAYMENT_RENTR_TRANS_LABEL") + " *"), /*#__PURE__*/React.createElement(TextInput, {
3348
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NOC_PAYMENT_RENTR_TRANS_LABEL")} *`), /*#__PURE__*/React.createElement(TextInput, {
3185
3349
  value: reTransanctionNumber,
3186
3350
  name: "instrumentNumber",
3187
3351
  required: true,
@@ -3220,26 +3384,15 @@ const useChequeDetails = (props, t) => {
3220
3384
  };
3221
3385
  const ChequeDetailsComponent = props => {
3222
3386
  var _props$chequeDetails$;
3223
- const _useTranslation = useTranslation(),
3224
- t = _useTranslation.t;
3225
- const _useState = useState(props.chequeDetails.instrumentDate),
3226
- instrumentDate = _useState[0],
3227
- setChequeDate = _useState[1];
3228
- const _useState2 = useState(props.chequeDetails.instrumentNumber),
3229
- instrumentNumber = _useState2[0],
3230
- setChequeNo = _useState2[1];
3231
- const _useState3 = useState(props.chequeDetails.ifscCode),
3232
- ifscCode = _useState3[0],
3233
- setIfsc = _useState3[1];
3234
- const _useState4 = useState(""),
3235
- ifscCodeError = _useState4[0],
3236
- setIfscCodeError = _useState4[1];
3237
- const _useState5 = useState(props.chequeDetails.bankName),
3238
- bankName = _useState5[0],
3239
- setBankName = _useState5[1];
3240
- const _useState6 = useState((_props$chequeDetails$ = props.chequeDetails.bankBranch) === null || _props$chequeDetails$ === void 0 ? void 0 : _props$chequeDetails$.replace(" ", " ")),
3241
- bankBranch = _useState6[0],
3242
- setBankBranch = _useState6[1];
3387
+ const {
3388
+ t
3389
+ } = useTranslation();
3390
+ const [instrumentDate, setChequeDate] = useState(props.chequeDetails.instrumentDate);
3391
+ const [instrumentNumber, setChequeNo] = useState(props.chequeDetails.instrumentNumber);
3392
+ const [ifscCode, setIfsc] = useState(props.chequeDetails.ifscCode);
3393
+ const [ifscCodeError, setIfscCodeError] = useState("");
3394
+ const [bankName, setBankName] = useState(props.chequeDetails.bankName);
3395
+ const [bankBranch, setBankBranch] = useState((_props$chequeDetails$ = props.chequeDetails.bankBranch) === null || _props$chequeDetails$ === void 0 ? void 0 : _props$chequeDetails$.replace(" ", " "));
3243
3396
  useEffect(() => {
3244
3397
  if (props.onChange) {
3245
3398
  let errorObj = {};
@@ -3260,12 +3413,14 @@ const ChequeDetailsComponent = props => {
3260
3413
  const setBankDetailsFromIFSC = function () {
3261
3414
  try {
3262
3415
  const _temp2 = _catch(function () {
3263
- return Promise.resolve(window.fetch("https://ifsc.razorpay.com/" + ifscCode)).then(function (res) {
3416
+ return Promise.resolve(window.fetch(`https://ifsc.razorpay.com/${ifscCode}`)).then(function (res) {
3264
3417
  const _temp = function () {
3265
3418
  if (res.ok) {
3266
3419
  return Promise.resolve(res.json()).then(function (_ref) {
3267
- let BANK = _ref.BANK,
3268
- BRANCH = _ref.BRANCH;
3420
+ let {
3421
+ BANK,
3422
+ BRANCH
3423
+ } = _ref;
3269
3424
  setBankName(BANK);
3270
3425
  setBankBranch(BRANCH === null || BRANCH === void 0 ? void 0 : BRANCH.replace("┬á", " "));
3271
3426
  });
@@ -3287,18 +3442,18 @@ const ChequeDetailsComponent = props => {
3287
3442
  };
3288
3443
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
3289
3444
  className: "formcomposer-section-grid"
3290
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_CHQ_NO_LABEL") + " *"), /*#__PURE__*/React.createElement(TextInput, {
3445
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PAYMENT_CHQ_NO_LABEL")} *`), /*#__PURE__*/React.createElement(TextInput, {
3291
3446
  value: instrumentNumber,
3292
3447
  onChange: e => setChequeNo(e.target.value),
3293
3448
  name: "instrumentNumber",
3294
3449
  required: true
3295
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_CHEQUE_DATE_LABEL") + " *"), /*#__PURE__*/React.createElement(DatePicker, {
3450
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PAYMENT_CHEQUE_DATE_LABEL")} *`), /*#__PURE__*/React.createElement(DatePicker, {
3296
3451
  isRequired: true,
3297
3452
  date: instrumentDate,
3298
3453
  onChange: d => {
3299
3454
  setChequeDate(d);
3300
3455
  }
3301
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_IFSC_CODE_LABEL") + " *"), /*#__PURE__*/React.createElement("div", {
3456
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PAYMENT_IFSC_CODE_LABEL")} *`), /*#__PURE__*/React.createElement("div", {
3302
3457
  className: "field"
3303
3458
  }, /*#__PURE__*/React.createElement("div", {
3304
3459
  className: "cheque-date"
@@ -4317,9 +4472,10 @@ const BillDetailsKeyNoteConfig = () => ({
4317
4472
  }, {
4318
4473
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
4319
4474
  keyPath: ["billDetails", d => {
4320
- const _d$ = d[0],
4321
- fromPeriod = _d$.fromPeriod,
4322
- toPeriod = _d$.toPeriod;
4475
+ const {
4476
+ fromPeriod,
4477
+ toPeriod
4478
+ } = d[0];
4323
4479
  if (fromPeriod && toPeriod) {
4324
4480
  let from = new Date(fromPeriod).getFullYear().toString();
4325
4481
  let to = new Date(toPeriod).getFullYear().toString();
@@ -4330,7 +4486,9 @@ const BillDetailsKeyNoteConfig = () => ({
4330
4486
  }, {
4331
4487
  keyValue: "CS_BILL_NO",
4332
4488
  keyPath: ["billDetails", d => {
4333
- const currentBillNo = d[0].currentBillNo;
4489
+ const {
4490
+ currentBillNo
4491
+ } = d[0];
4334
4492
  if (currentBillNo) {
4335
4493
  return currentBillNo;
4336
4494
  } else return "N/A";
@@ -4339,7 +4497,9 @@ const BillDetailsKeyNoteConfig = () => ({
4339
4497
  }, {
4340
4498
  keyValue: "CS_BILL_DUEDATE",
4341
4499
  keyPath: ["billDetails", d => {
4342
- const currentExpiryDate = d[0].currentExpiryDate;
4500
+ const {
4501
+ currentExpiryDate
4502
+ } = d[0];
4343
4503
  if (currentExpiryDate) {
4344
4504
  return new Date(currentExpiryDate).toLocaleDateString();
4345
4505
  } else return "N/A";
@@ -4364,7 +4524,9 @@ const BillDetailsKeyNoteConfig = () => ({
4364
4524
  }, {
4365
4525
  keyValue: "CS_BILL_NO",
4366
4526
  keyPath: ["billDetails", d => {
4367
- const currentBillNo = d[0].currentBillNo;
4527
+ const {
4528
+ currentBillNo
4529
+ } = d[0];
4368
4530
  if (currentBillNo) {
4369
4531
  return currentBillNo;
4370
4532
  } else return "N/A";
@@ -4373,7 +4535,9 @@ const BillDetailsKeyNoteConfig = () => ({
4373
4535
  }, {
4374
4536
  keyValue: "CS_BILL_DUEDATE",
4375
4537
  keyPath: ["billDetails", d => {
4376
- const currentExpiryDate = d[0].currentExpiryDate;
4538
+ const {
4539
+ currentExpiryDate
4540
+ } = d[0];
4377
4541
  if (currentExpiryDate) {
4378
4542
  return new Date(currentExpiryDate).toLocaleDateString();
4379
4543
  } else return "N/A";
@@ -4430,9 +4594,10 @@ const BillDetailsKeyNoteConfig = () => ({
4430
4594
  }, {
4431
4595
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
4432
4596
  keyPath: ["billDetails", d => {
4433
- const _d$2 = d[0],
4434
- fromPeriod = _d$2.fromPeriod,
4435
- toPeriod = _d$2.toPeriod;
4597
+ const {
4598
+ fromPeriod,
4599
+ toPeriod
4600
+ } = d[0];
4436
4601
  if (fromPeriod && toPeriod) {
4437
4602
  let from = new Date(fromPeriod).toLocaleDateString();
4438
4603
  let to = new Date(toPeriod).toLocaleDateString();
@@ -4447,7 +4612,9 @@ const BillDetailsKeyNoteConfig = () => ({
4447
4612
  }, {
4448
4613
  keyValue: "CS_BILL_DUEDATE",
4449
4614
  keyPath: ["billDetails", d => {
4450
- const currentExpiryDate = d[0].currentExpiryDate;
4615
+ const {
4616
+ currentExpiryDate
4617
+ } = d[0];
4451
4618
  if (currentExpiryDate) {
4452
4619
  return new Date(currentExpiryDate).toLocaleDateString();
4453
4620
  } else return "N/A";
@@ -4464,9 +4631,10 @@ const BillDetailsKeyNoteConfig = () => ({
4464
4631
  }, {
4465
4632
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
4466
4633
  keyPath: ["billDetails", d => {
4467
- const _d$3 = d[0],
4468
- fromPeriod = _d$3.fromPeriod,
4469
- toPeriod = _d$3.toPeriod;
4634
+ const {
4635
+ fromPeriod,
4636
+ toPeriod
4637
+ } = d[0];
4470
4638
  if (fromPeriod && toPeriod) {
4471
4639
  let from = new Date(fromPeriod).toLocaleDateString();
4472
4640
  let to = new Date(toPeriod).toLocaleDateString();
@@ -4481,7 +4649,9 @@ const BillDetailsKeyNoteConfig = () => ({
4481
4649
  }, {
4482
4650
  keyValue: "CS_BILL_DUEDATE",
4483
4651
  keyPath: ["billDetails", d => {
4484
- const expiryDate = d[0].expiryDate;
4652
+ const {
4653
+ expiryDate
4654
+ } = d[0];
4485
4655
  if (expiryDate) {
4486
4656
  return new Date(expiryDate).toLocaleDateString();
4487
4657
  } else return "N/A";
@@ -4704,40 +4874,49 @@ const BillDetailsFormConfig = (props, t) => ({
4704
4874
  });
4705
4875
  const BillDetails$1 = _ref => {
4706
4876
  var _businessService$toUp, _bill$billDetails, _bill$billDetails2, _bill$billDetails2$so, _billDetails$billAcco, _arrears$toFixed, _arrears$toFixed2, _yearWiseBills$filter6, _yearWiseBills$filter7, _yearWiseBills$filter8, _yearWiseBills$filter9, _yearWiseBills$filter0;
4707
- let businessService = _ref.businessService,
4708
- consumerCode = _ref.consumerCode,
4709
- onChange = _ref.onChange;
4710
- const _useTranslation = useTranslation(),
4711
- t = _useTranslation.t;
4712
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
4713
- ModuleWorkflow = _Digit$Hooks$useQuery.workflow,
4714
- IsDisconnectionFlow = _Digit$Hooks$useQuery.IsDisconnectionFlow;
4877
+ let {
4878
+ businessService,
4879
+ consumerCode,
4880
+ _amount,
4881
+ onChange
4882
+ } = _ref;
4883
+ const {
4884
+ t
4885
+ } = useTranslation();
4886
+ const {
4887
+ workflow: ModuleWorkflow,
4888
+ IsDisconnectionFlow
4889
+ } = Digit.Hooks.useQueryParams();
4715
4890
  const tenantId = Digit.ULBService.getCurrentTenantId();
4716
- const _Digit$Hooks$useFetch = Digit.Hooks.useFetchPayment({
4717
- tenantId,
4718
- businessService,
4719
- consumerCode
4720
- }),
4721
- data = _Digit$Hooks$useFetch.data,
4722
- isLoading = _Digit$Hooks$useFetch.isLoading;
4891
+ const {
4892
+ data,
4893
+ isLoading
4894
+ } = Digit.Hooks.useFetchPayment({
4895
+ tenantId,
4896
+ businessService,
4897
+ consumerCode
4898
+ });
4723
4899
  const checkFSM = window.location.href.includes("FSM");
4724
- const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSearch(tenantId, {
4725
- applicationNos: consumerCode
4726
- }, {
4727
- staleTime: Infinity,
4728
- enabled: businessService !== null && businessService !== void 0 && (_businessService$toUp = businessService.toUpperCase()) !== null && _businessService$toUp !== void 0 && _businessService$toUp.includes("FSM") ? true : false
4729
- }),
4730
- applicationData = _Digit$Hooks$fsm$useS.data;
4731
- const _useState = useState(),
4732
- bill = _useState[0],
4733
- setBill = _useState[1];
4734
- const _useState2 = useState(true),
4735
- showDetails = _useState2[0],
4736
- setShowDetails = _useState2[1];
4737
- const _Digit$Hooks$fsm$useA = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, consumerCode, {
4738
- enabled: checkFSM ? true : false
4739
- }, "EMPLOYEE"),
4740
- application = _Digit$Hooks$fsm$useA.data;
4900
+ const {
4901
+ isLoading: isDataLoading,
4902
+ data: applicationData
4903
+ } = Digit.Hooks.fsm.useSearch(tenantId, {
4904
+ applicationNos: consumerCode
4905
+ }, {
4906
+ staleTime: Infinity,
4907
+ enabled: businessService !== null && businessService !== void 0 && (_businessService$toUp = businessService.toUpperCase()) !== null && _businessService$toUp !== void 0 && _businessService$toUp.includes("FSM") ? true : false
4908
+ });
4909
+ const [bill, setBill] = useState();
4910
+ const [showDetails, setShowDetails] = useState(true);
4911
+ const {
4912
+ isLoading: isFSMLoading,
4913
+ isError,
4914
+ error,
4915
+ data: application,
4916
+ error: errorApplication
4917
+ } = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, consumerCode, {
4918
+ enabled: checkFSM ? true : false
4919
+ }, "EMPLOYEE");
4741
4920
  const yearWiseBills = bill === null || bill === void 0 ? void 0 : (_bill$billDetails = bill.billDetails) === null || _bill$billDetails === void 0 ? void 0 : _bill$billDetails.sort((a, b) => b.fromPeriod - a.fromPeriod);
4742
4921
  const billDetails = (yearWiseBills === null || yearWiseBills === void 0 ? void 0 : yearWiseBills[0]) || [];
4743
4922
  const getTotal = () => bill !== null && bill !== void 0 && bill.totalAmount ? bill === null || bill === void 0 ? void 0 : bill.totalAmount : 0;
@@ -4755,38 +4934,31 @@ const BillDetails$1 = _ref => {
4755
4934
  return application !== null && application !== void 0 && (_application$addition = application.additionalDetails) !== null && _application$addition !== void 0 && _application$addition.tripAmount ? application === null || application === void 0 ? void 0 : (_application$addition2 = application.additionalDetails) === null || _application$addition2 === void 0 ? void 0 : _application$addition2.tripAmount : 0;
4756
4935
  };
4757
4936
  const arrears = (bill === null || bill === void 0 ? void 0 : (_bill$billDetails2 = bill.billDetails) === null || _bill$billDetails2 === void 0 ? void 0 : (_bill$billDetails2$so = _bill$billDetails2.sort((a, b) => b.fromPeriod - a.fromPeriod)) === null || _bill$billDetails2$so === void 0 ? void 0 : _bill$billDetails2$so.reduce((total, current, index) => index === 0 ? total : total + current.amount, 0)) || 0;
4758
- const _Digit$Hooks$useGetPa = Digit.Hooks.useGetPaymentRulesForBusinessServices(tenantId),
4759
- mdmsLoading = _Digit$Hooks$useGetPa.isLoading,
4760
- mdmsBillingData = _Digit$Hooks$useGetPa.data;
4761
- const _useState3 = useState(),
4762
- paymentRules = _useState3[0],
4763
- setPaymentRules = _useState3[1];
4937
+ const {
4938
+ isLoading: mdmsLoading,
4939
+ data: mdmsBillingData
4940
+ } = Digit.Hooks.useGetPaymentRulesForBusinessServices(tenantId);
4941
+ const [paymentRules, setPaymentRules] = useState();
4764
4942
  useEffect(() => {
4765
4943
  var _mdmsBillingData$Mdms, _mdmsBillingData$Mdms2;
4766
4944
  const payRestrictiondetails = mdmsBillingData === null || mdmsBillingData === void 0 ? void 0 : (_mdmsBillingData$Mdms = mdmsBillingData.MdmsRes) === null || _mdmsBillingData$Mdms === void 0 ? void 0 : (_mdmsBillingData$Mdms2 = _mdmsBillingData$Mdms.BillingService) === null || _mdmsBillingData$Mdms2 === void 0 ? void 0 : _mdmsBillingData$Mdms2.BusinessService;
4767
4945
  if (payRestrictiondetails !== null && payRestrictiondetails !== void 0 && payRestrictiondetails.length) {
4768
4946
  if (IsDisconnectionFlow) {
4769
- setPaymentRules(_extends({}, payRestrictiondetails.filter(e => e.code == businessService)[0], {
4947
+ setPaymentRules({
4948
+ ...payRestrictiondetails.filter(e => e.code == businessService)[0],
4770
4949
  partPaymentAllowed: false
4771
- }));
4950
+ });
4772
4951
  } else setPaymentRules(payRestrictiondetails.filter(e => e.code == businessService)[0]);
4773
4952
  } else setPaymentRules({});
4774
4953
  }, [mdmsBillingData]);
4775
- const _ref2 = paymentRules || {},
4776
- minAmountPayable = _ref2.minAmountPayable,
4777
- isAdvanceAllowed = _ref2.isAdvanceAllowed;
4778
- const _useState4 = useState(t("CS_PAYMENT_FULL_AMOUNT")),
4779
- paymentType = _useState4[0],
4780
- setPaymentType = _useState4[1];
4781
- const _useState5 = useState(getTotal()),
4782
- amount = _useState5[0],
4783
- setAmount = _useState5[1];
4784
- const _useState6 = useState(true),
4785
- paymentAllowed = _useState6[0],
4786
- setPaymentAllowed = _useState6[1];
4787
- const _useState7 = useState(""),
4788
- formError = _useState7[0],
4789
- setError = _useState7[1];
4954
+ const {
4955
+ minAmountPayable,
4956
+ isAdvanceAllowed
4957
+ } = paymentRules || {};
4958
+ const [paymentType, setPaymentType] = useState(t("CS_PAYMENT_FULL_AMOUNT"));
4959
+ const [amount, setAmount] = useState(getTotal());
4960
+ const [paymentAllowed, setPaymentAllowed] = useState(true);
4961
+ const [formError, setError] = useState("");
4790
4962
  const changeAmount = value => {
4791
4963
  setAmount(value);
4792
4964
  };
@@ -4840,15 +5012,19 @@ const BillDetails$1 = _ref => {
4840
5012
  };
4841
5013
  if (isLoading || mdmsLoading) return /*#__PURE__*/React.createElement(Loader, null);
4842
5014
  const getFinancialYear = _bill => {
4843
- const fromPeriod = _bill.fromPeriod,
4844
- toPeriod = _bill.toPeriod;
5015
+ const {
5016
+ fromPeriod,
5017
+ toPeriod
5018
+ } = _bill;
4845
5019
  let from = new Date(fromPeriod).getFullYear().toString();
4846
5020
  let to = new Date(toPeriod).getFullYear().toString();
4847
5021
  return from + "-" + to;
4848
5022
  };
4849
5023
  const getBillingPeriod = _bill => {
4850
- const fromPeriod = _bill.fromPeriod,
4851
- toPeriod = _bill.toPeriod;
5024
+ const {
5025
+ fromPeriod,
5026
+ toPeriod
5027
+ } = _bill;
4852
5028
  let from = new Date(fromPeriod).toLocaleDateString();
4853
5029
  let to = new Date(toPeriod).toLocaleDateString();
4854
5030
  return from + "-" + to;
@@ -4874,11 +5050,17 @@ const BillDetails$1 = _ref => {
4874
5050
  }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
4875
5051
  style: thStyle
4876
5052
  }, t("CS_BILL_NO")), /*#__PURE__*/React.createElement("th", {
4877
- style: _extends({}, thStyle)
5053
+ style: {
5054
+ ...thStyle
5055
+ }
4878
5056
  }, t("CS_PAYMENT_BILLING_PERIOD")), /*#__PURE__*/React.createElement("th", {
4879
- style: _extends({}, thStyle)
5057
+ style: {
5058
+ ...thStyle
5059
+ }
4880
5060
  }, t("CS_BILL_DUEDATE")), yearWiseBills === null || yearWiseBills === void 0 ? void 0 : (_yearWiseBills$filter = yearWiseBills.filter((e, ind) => ind > 0)) === null || _yearWiseBills$filter === void 0 ? void 0 : (_yearWiseBills$filter2 = _yearWiseBills$filter[0]) === null || _yearWiseBills$filter2 === void 0 ? void 0 : (_yearWiseBills$filter3 = _yearWiseBills$filter2.billAccountDetails) === null || _yearWiseBills$filter3 === void 0 ? void 0 : (_yearWiseBills$filter4 = _yearWiseBills$filter3.sort((a, b) => a.order - b.order)) === null || _yearWiseBills$filter4 === void 0 ? void 0 : _yearWiseBills$filter4.map((head, index) => /*#__PURE__*/React.createElement("th", {
4881
- style: _extends({}, thStyle),
5061
+ style: {
5062
+ ...thStyle
5063
+ },
4882
5064
  key: index
4883
5065
  }, t(head.taxHeadCode))), /*#__PURE__*/React.createElement("th", {
4884
5066
  style: thStyle
@@ -5036,11 +5218,17 @@ const BillDetails$1 = _ref => {
5036
5218
  }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
5037
5219
  style: thStyle
5038
5220
  }, t("FINANCIAL_YEAR")), /*#__PURE__*/React.createElement("th", {
5039
- style: _extends({}, thStyle)
5221
+ style: {
5222
+ ...thStyle
5223
+ }
5040
5224
  }, t("CS_BILL_NO")), /*#__PURE__*/React.createElement("th", {
5041
- style: _extends({}, thStyle)
5225
+ style: {
5226
+ ...thStyle
5227
+ }
5042
5228
  }, t("CS_BILL_DUEDATE")), yearWiseBills === null || yearWiseBills === void 0 ? void 0 : (_yearWiseBills$filter6 = yearWiseBills.filter((e, ind) => ind > 0)) === null || _yearWiseBills$filter6 === void 0 ? void 0 : (_yearWiseBills$filter7 = _yearWiseBills$filter6[0]) === null || _yearWiseBills$filter7 === void 0 ? void 0 : (_yearWiseBills$filter8 = _yearWiseBills$filter7.billAccountDetails) === null || _yearWiseBills$filter8 === void 0 ? void 0 : (_yearWiseBills$filter9 = _yearWiseBills$filter8.sort((a, b) => a.order - b.order)) === null || _yearWiseBills$filter9 === void 0 ? void 0 : _yearWiseBills$filter9.map((head, index) => /*#__PURE__*/React.createElement("th", {
5043
- style: _extends({}, thStyle),
5229
+ style: {
5230
+ ...thStyle
5231
+ },
5044
5232
  key: index
5045
5233
  }, t(head.taxHeadCode))), /*#__PURE__*/React.createElement("th", {
5046
5234
  style: thStyle
@@ -5095,7 +5283,7 @@ const BillDetails$1 = _ref => {
5095
5283
  }, /*#__PURE__*/React.createElement("span", {
5096
5284
  className: "payment-amount-front",
5097
5285
  style: {
5098
- border: "1px solid " + (paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? "#9a9a9a" : "black")
5286
+ border: `1px solid ${paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? "#9a9a9a" : "black"}`
5099
5287
  }
5100
5288
  }, "\u20B9"), paymentType !== t("CS_PAYMENT_FULL_AMOUNT") ? /*#__PURE__*/React.createElement(TextInput, {
5101
5289
  style: {
@@ -5119,58 +5307,61 @@ const BillDetails$1 = _ref => {
5119
5307
  }, t(formError)))));
5120
5308
  };
5121
5309
 
5122
- const _excluded$2 = ["ManualRecieptDetails", "paymentModeDetails"],
5123
- _excluded2 = ["errorObj"];
5124
5310
  const CollectPayment = props => {
5125
5311
  var _paymentdetails$Bill, _businessService$toUp;
5126
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
5127
- ModuleWorkflow = _Digit$Hooks$useQuery.workflow,
5128
- IsDisconnectionFlow = _Digit$Hooks$useQuery.IsDisconnectionFlow;
5129
- const _useTranslation = useTranslation(),
5130
- t = _useTranslation.t;
5312
+ const {
5313
+ workflow: ModuleWorkflow,
5314
+ IsDisconnectionFlow
5315
+ } = Digit.Hooks.useQueryParams();
5316
+ const {
5317
+ t
5318
+ } = useTranslation();
5131
5319
  const history = useHistory();
5132
5320
  const queryClient = useQueryClient();
5133
- const _useLocation = useLocation(),
5134
- state = _useLocation.state,
5135
- search = _useLocation.search;
5136
- const _useRouteMatch = useRouteMatch();
5137
- let _useParams = useParams(),
5138
- consumerCode = _useParams.consumerCode,
5139
- businessService = _useParams.businessService;
5321
+ const {
5322
+ state,
5323
+ search
5324
+ } = useLocation();
5325
+ const {
5326
+ path: currentPath
5327
+ } = useRouteMatch();
5328
+ let {
5329
+ consumerCode,
5330
+ businessService
5331
+ } = useParams();
5140
5332
  const tenantId = Digit.ULBService.getCurrentTenantId();
5141
- const _useState = useState(0),
5142
- Time = _useState[0],
5143
- setTime = _useState[1];
5333
+ const [Time, setTime] = useState(0);
5144
5334
  if (window.location.href.includes("ISWSAPP")) consumerCode = new URLSearchParams(search).get("applicationNumber");
5145
5335
  if (window.location.href.includes("ISWSCON") || ModuleWorkflow === "WS") consumerCode = decodeURIComponent(consumerCode);
5146
- const _Digit$Hooks$useFetch = Digit.Hooks.useFetchPayment({
5147
- tenantId: tenantId,
5148
- consumerCode,
5149
- businessService
5150
- }),
5151
- paymentdetails = _Digit$Hooks$useFetch.data,
5152
- isLoading = _Digit$Hooks$useFetch.isLoading;
5336
+ const {
5337
+ data: paymentdetails,
5338
+ isLoading
5339
+ } = Digit.Hooks.useFetchPayment({
5340
+ tenantId: tenantId,
5341
+ consumerCode,
5342
+ businessService
5343
+ });
5153
5344
  const bill = (paymentdetails === null || paymentdetails === void 0 ? void 0 : (_paymentdetails$Bill = paymentdetails.Bill) === null || _paymentdetails$Bill === void 0 ? void 0 : _paymentdetails$Bill.length) > 0 ? paymentdetails === null || paymentdetails === void 0 ? void 0 : paymentdetails.Bill[0] : {};
5154
- const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSearch(tenantId, {
5155
- applicationNos: consumerCode
5156
- }, {
5157
- staleTime: Infinity,
5158
- enabled: businessService !== null && businessService !== void 0 && (_businessService$toUp = businessService.toUpperCase()) !== null && _businessService$toUp !== void 0 && _businessService$toUp.includes("FSM") ? true : false
5159
- }),
5160
- applicationData = _Digit$Hooks$fsm$useS.data;
5345
+ const {
5346
+ data: applicationData
5347
+ } = Digit.Hooks.fsm.useSearch(tenantId, {
5348
+ applicationNos: consumerCode
5349
+ }, {
5350
+ staleTime: Infinity,
5351
+ enabled: businessService !== null && businessService !== void 0 && (_businessService$toUp = businessService.toUpperCase()) !== null && _businessService$toUp !== void 0 && _businessService$toUp.includes("FSM") ? true : false
5352
+ });
5161
5353
  const advanceBill = applicationData === null || applicationData === void 0 ? void 0 : applicationData.advanceAmount;
5162
- const _useCardPaymentDetail = useCardPaymentDetails(props, t),
5163
- cardConfig = _useCardPaymentDetail.cardConfig;
5164
- const _useChequeDetails = useChequeDetails(props, t),
5165
- chequeConfig = _useChequeDetails.chequeConfig;
5166
- const _useCashPaymentDetail = useCashPaymentDetails(props, t),
5167
- cashConfig = _useCashPaymentDetail.cashConfig;
5168
- const _useState2 = useState({}),
5169
- formState = _useState2[0],
5170
- setFormState = _useState2[1];
5171
- const _useState3 = useState(null),
5172
- toast = _useState3[0],
5173
- setToast = _useState3[1];
5354
+ const {
5355
+ cardConfig
5356
+ } = useCardPaymentDetails(props, t);
5357
+ const {
5358
+ chequeConfig
5359
+ } = useChequeDetails(props, t);
5360
+ const {
5361
+ cashConfig
5362
+ } = useCashPaymentDetails(props, t);
5363
+ const [formState, setFormState] = useState({});
5364
+ const [toast, setToast] = useState(null);
5174
5365
  useEffect(() => {
5175
5366
  if (paymentdetails !== null && paymentdetails !== void 0 && paymentdetails.Bill && paymentdetails.Bill.length === 0) {
5176
5367
  setToast({
@@ -5204,15 +5395,11 @@ const CollectPayment = props => {
5204
5395
  code: "OTHER",
5205
5396
  name: t("COMMON_OTHER")
5206
5397
  }];
5207
- const _useState4 = useState((formState === null || formState === void 0 ? void 0 : formState.selectedPaymentMode) || getPaymentModes()[0]),
5208
- selectedPaymentMode = _useState4[0],
5209
- setPaymentMode = _useState4[1];
5210
- const _useState5 = useState((formState === null || formState === void 0 ? void 0 : formState.paidBy) || {
5211
- code: "OWNER",
5212
- name: t("COMMON_OWNER")
5213
- }),
5214
- selectedPaidBy = _useState5[0],
5215
- setselectedPaidBy = _useState5[1];
5398
+ const [selectedPaymentMode, setPaymentMode] = useState((formState === null || formState === void 0 ? void 0 : formState.selectedPaymentMode) || getPaymentModes()[0]);
5399
+ const [selectedPaidBy, setselectedPaidBy] = useState((formState === null || formState === void 0 ? void 0 : formState.paidBy) || {
5400
+ code: "OWNER",
5401
+ name: t("COMMON_OWNER")
5402
+ });
5216
5403
  const onSubmit = function (data) {
5217
5404
  try {
5218
5405
  var _data$amount, _data$amount6, _data$amount7, _data$paymentMode, _data$paymentModeDeta, _recieptRequest$Payme2, _recieptRequest$Payme3, _recieptRequest$Payme4, _recieptRequest$Payme5, _recieptRequest$Payme6;
@@ -5230,12 +5417,15 @@ const CollectPayment = props => {
5230
5417
  });
5231
5418
  return Promise.resolve();
5232
5419
  }
5233
- const ManualRecieptDetails = data.ManualRecieptDetails,
5234
- paymentModeDetails = data.paymentModeDetails,
5235
- rest = _objectWithoutPropertiesLoose(data, _excluded$2);
5236
- const _ref = paymentModeDetails || {},
5237
- errorObj = _ref.errorObj,
5238
- details = _objectWithoutPropertiesLoose(_ref, _excluded2);
5420
+ const {
5421
+ ManualRecieptDetails,
5422
+ paymentModeDetails,
5423
+ ...rest
5424
+ } = data;
5425
+ const {
5426
+ errorObj,
5427
+ ...details
5428
+ } = paymentModeDetails || {};
5239
5429
  let recieptRequest = {
5240
5430
  Payment: {
5241
5431
  mobileNumber: data.payerMobile,
@@ -5265,7 +5455,10 @@ const CollectPayment = props => {
5265
5455
  recieptRequest.Payment.paymentMode = data === null || data === void 0 ? void 0 : (_data$paymentMode = data.paymentMode) === null || _data$paymentMode === void 0 ? void 0 : _data$paymentMode.code;
5266
5456
  if (data.paymentModeDetails) {
5267
5457
  var _recieptRequest$Payme;
5268
- recieptRequest.Payment = _extends({}, recieptRequest.Payment, details);
5458
+ recieptRequest.Payment = {
5459
+ ...recieptRequest.Payment,
5460
+ ...details
5461
+ };
5269
5462
  delete recieptRequest.Payment.paymentModeDetails;
5270
5463
  if (data.paymentModeDetails.errorObj) {
5271
5464
  const errors = data.paymentModeDetails.errorObj;
@@ -5273,7 +5466,7 @@ const CollectPayment = props => {
5273
5466
  if (messages) {
5274
5467
  setToast({
5275
5468
  key: "error",
5276
- action: messages + " " + t("ES_ERROR_REQUIRED")
5469
+ action: `${messages} ${t("ES_ERROR_REQUIRED")}`
5277
5470
  });
5278
5471
  setTimeout(() => setToast(null), 5000);
5279
5472
  return Promise.resolve();
@@ -5310,7 +5503,7 @@ const CollectPayment = props => {
5310
5503
  return Promise.resolve(Digit.PaymentService.createReciept(tenantId, recieptRequest)).then(function (resposne) {
5311
5504
  var _resposne$Payments$, _resposne$Payments$$p, _resposne$Payments$2, _resposne$Payments$2$, _resposne$Payments$2$2, _resposne$Payments$3, _resposne$Payments$3$, _resposne$Payments$4, _resposne$Payments$4$, _resposne$Payments$4$2;
5312
5505
  queryClient.invalidateQueries();
5313
- history.push(IsDisconnectionFlow ? props.basePath + "/success/" + businessService + "/" + (resposne === null || resposne === void 0 ? void 0 : (_resposne$Payments$ = resposne.Payments[0]) === null || _resposne$Payments$ === void 0 ? void 0 : (_resposne$Payments$$p = _resposne$Payments$.paymentDetails[0]) === null || _resposne$Payments$$p === void 0 ? void 0 : _resposne$Payments$$p.receiptNumber.replace(/\//g, "%2F")) + "/" + (resposne === null || resposne === void 0 ? void 0 : (_resposne$Payments$2 = resposne.Payments[0]) === null || _resposne$Payments$2 === void 0 ? void 0 : (_resposne$Payments$2$ = _resposne$Payments$2.paymentDetails[0]) === null || _resposne$Payments$2$ === void 0 ? void 0 : (_resposne$Payments$2$2 = _resposne$Payments$2$.bill) === null || _resposne$Payments$2$2 === void 0 ? void 0 : _resposne$Payments$2$2.consumerCode) + "?IsDisconnectionFlow=" + IsDisconnectionFlow : props.basePath + "/success/" + businessService + "/" + (resposne === null || resposne === void 0 ? void 0 : (_resposne$Payments$3 = resposne.Payments[0]) === null || _resposne$Payments$3 === void 0 ? void 0 : (_resposne$Payments$3$ = _resposne$Payments$3.paymentDetails[0]) === null || _resposne$Payments$3$ === void 0 ? void 0 : _resposne$Payments$3$.receiptNumber.replace(/\//g, "%2F")) + "/" + (resposne === null || resposne === void 0 ? void 0 : (_resposne$Payments$4 = resposne.Payments[0]) === null || _resposne$Payments$4 === void 0 ? void 0 : (_resposne$Payments$4$ = _resposne$Payments$4.paymentDetails[0]) === null || _resposne$Payments$4$ === void 0 ? void 0 : (_resposne$Payments$4$2 = _resposne$Payments$4$.bill) === null || _resposne$Payments$4$2 === void 0 ? void 0 : _resposne$Payments$4$2.consumerCode) + "?IsDisconnectionFlow=" + IsDisconnectionFlow);
5506
+ history.push(IsDisconnectionFlow ? `${props.basePath}/success/${businessService}/${resposne === null || resposne === void 0 ? void 0 : (_resposne$Payments$ = resposne.Payments[0]) === null || _resposne$Payments$ === void 0 ? void 0 : (_resposne$Payments$$p = _resposne$Payments$.paymentDetails[0]) === null || _resposne$Payments$$p === void 0 ? void 0 : _resposne$Payments$$p.receiptNumber.replace(/\//g, "%2F")}/${resposne === null || resposne === void 0 ? void 0 : (_resposne$Payments$2 = resposne.Payments[0]) === null || _resposne$Payments$2 === void 0 ? void 0 : (_resposne$Payments$2$ = _resposne$Payments$2.paymentDetails[0]) === null || _resposne$Payments$2$ === void 0 ? void 0 : (_resposne$Payments$2$2 = _resposne$Payments$2$.bill) === null || _resposne$Payments$2$2 === void 0 ? void 0 : _resposne$Payments$2$2.consumerCode}?IsDisconnectionFlow=${IsDisconnectionFlow}` : `${props.basePath}/success/${businessService}/${resposne === null || resposne === void 0 ? void 0 : (_resposne$Payments$3 = resposne.Payments[0]) === null || _resposne$Payments$3 === void 0 ? void 0 : (_resposne$Payments$3$ = _resposne$Payments$3.paymentDetails[0]) === null || _resposne$Payments$3$ === void 0 ? void 0 : _resposne$Payments$3$.receiptNumber.replace(/\//g, "%2F")}/${resposne === null || resposne === void 0 ? void 0 : (_resposne$Payments$4 = resposne.Payments[0]) === null || _resposne$Payments$4 === void 0 ? void 0 : (_resposne$Payments$4$ = _resposne$Payments$4.paymentDetails[0]) === null || _resposne$Payments$4$ === void 0 ? void 0 : (_resposne$Payments$4$2 = _resposne$Payments$4$.bill) === null || _resposne$Payments$4$2 === void 0 ? void 0 : _resposne$Payments$4$2.consumerCode}?IsDisconnectionFlow=${IsDisconnectionFlow}`);
5314
5507
  });
5315
5508
  }, function (error) {
5316
5509
  var _setToast, _error$response, _error$response$data, _error$response$data$;
@@ -5341,7 +5534,7 @@ const CollectPayment = props => {
5341
5534
  marginBottom: 0,
5342
5535
  textAlign: "right"
5343
5536
  }
5344
- }, " ", "\u20B9 " + (bill === null || bill === void 0 ? void 0 : bill.totalAmount), " ")
5537
+ }, " ", `₹ ${bill === null || bill === void 0 ? void 0 : bill.totalAmount}`, " ")
5345
5538
  }]
5346
5539
  }, {
5347
5540
  head: t("PAYMENT_PAID_BY_HEAD"),
@@ -5501,7 +5694,7 @@ const CollectPayment = props => {
5501
5694
  }
5502
5695
  }), toast && /*#__PURE__*/React.createElement(Toast, {
5503
5696
  error: toast.key === "error",
5504
- label: t(toast.key === "success" ? "ES_" + businessService.split(".")[0].toLowerCase() + "_" + toast.action + "_UPDATE_SUCCESS" : toast.action),
5697
+ label: t(toast.key === "success" ? `ES_${businessService.split(".")[0].toLowerCase()}_${toast.action}_UPDATE_SUCCESS` : toast.action),
5505
5698
  onClose: () => setToast(null),
5506
5699
  style: {
5507
5700
  maxWidth: "670px"
@@ -5517,7 +5710,7 @@ const convertEpochToDate$1 = dateEpoch => {
5517
5710
  let year = dateFromApi.getFullYear();
5518
5711
  month = (month > 9 ? "" : "0") + month;
5519
5712
  day = (day > 9 ? "" : "0") + day;
5520
- return day + "/" + month + "/" + year;
5713
+ return `${day}/${month}/${year}`;
5521
5714
  } else {
5522
5715
  return "NA";
5523
5716
  }
@@ -5525,34 +5718,35 @@ const convertEpochToDate$1 = dateEpoch => {
5525
5718
  const SuccessfulPayment$1 = props => {
5526
5719
  var _location, _location$pathname, _data$6, _data$7, _data$8, _data$9, _data$0, _data$1, _data$10, _data$11, _data$12;
5527
5720
  const history = useHistory();
5528
- const _useTranslation = useTranslation(),
5529
- t = _useTranslation.t;
5721
+ const {
5722
+ t
5723
+ } = useTranslation();
5530
5724
  const queryClient = useQueryClient();
5531
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
5532
- IsDisconnectionFlow = _Digit$Hooks$useQuery.IsDisconnectionFlow;
5533
- const _useState = useState(false),
5534
- displayMenu = _useState[0],
5535
- setDisplayMenu = _useState[1];
5536
- const _useState2 = useState(null),
5537
- selectedAction = _useState2[0],
5538
- setSelectedAction = _useState2[1];
5725
+ const {
5726
+ IsDisconnectionFlow
5727
+ } = Digit.Hooks.useQueryParams();
5728
+ const [displayMenu, setDisplayMenu] = useState(false);
5729
+ const [selectedAction, setSelectedAction] = useState(null);
5539
5730
  const isFSMResponse = (_location = location) === null || _location === void 0 ? void 0 : (_location$pathname = _location.pathname) === null || _location$pathname === void 0 ? void 0 : _location$pathname.includes("payment/success/FSM.TRIP_CHARGES");
5540
- const combineResponseFSM = isFSMResponse ? t("PAYMENT_COLLECT_LABEL") + " / " + t("PAYMENT_COLLECT") : t("PAYMENT_LOCALIZATION_RESPONSE");
5731
+ const combineResponseFSM = isFSMResponse ? `${t("PAYMENT_COLLECT_LABEL")} / ${t("PAYMENT_COLLECT")}` : t("PAYMENT_LOCALIZATION_RESPONSE");
5541
5732
  props.setLink(combineResponseFSM);
5542
- let _useParams = useParams(),
5543
- consumerCode = _useParams.consumerCode,
5544
- receiptNumber = _useParams.receiptNumber,
5545
- businessService = _useParams.businessService;
5733
+ let {
5734
+ consumerCode,
5735
+ receiptNumber,
5736
+ businessService
5737
+ } = useParams();
5546
5738
  const tenantId = Digit.ULBService.getCurrentTenantId();
5547
5739
  receiptNumber = receiptNumber.replace(/%2F/g, "/");
5548
- const _Digit$Hooks$obps$use = Digit.Hooks.obps.useOBPSSearch("", {}, tenantId, {
5549
- applicationNo: consumerCode
5550
- }, {}, {
5551
- enabled: businessService !== null && businessService !== void 0 && businessService.includes("BPA") ? true : false
5552
- }),
5553
- _Digit$Hooks$obps$use2 = _Digit$Hooks$obps$use.data,
5554
- data = _Digit$Hooks$obps$use2 === void 0 ? {} : _Digit$Hooks$obps$use2,
5555
- isBpaSearchLoading = _Digit$Hooks$obps$use.isLoading;
5740
+ const {
5741
+ data = {},
5742
+ isLoading: isBpaSearchLoading,
5743
+ isSuccess: isBpaSuccess,
5744
+ error: bpaerror
5745
+ } = Digit.Hooks.obps.useOBPSSearch("", {}, tenantId, {
5746
+ applicationNo: consumerCode
5747
+ }, {}, {
5748
+ enabled: businessService !== null && businessService !== void 0 && businessService.includes("BPA") ? true : false
5749
+ });
5556
5750
  const FSM_EDITOR = Digit.UserService.hasAccess("FSM_EDITOR_EMP") || false;
5557
5751
  function onActionSelect(action) {
5558
5752
  setSelectedAction(action);
@@ -5595,7 +5789,7 @@ const SuccessfulPayment$1 = props => {
5595
5789
  case "GO_TO_HOME":
5596
5790
  return history.push("/digit-ui/employee");
5597
5791
  case "ASSIGN_TO_DSO":
5598
- return history.push("/digit-ui/employee/fsm/application-details/" + consumerCode);
5792
+ return history.push(`/digit-ui/employee/fsm/application-details/${consumerCode}`);
5599
5793
  default:
5600
5794
  return null;
5601
5795
  }
@@ -5610,23 +5804,26 @@ const SuccessfulPayment$1 = props => {
5610
5804
  if (businessService !== null && businessService !== void 0 && businessService.includes("BPA")) {
5611
5805
  let nameOfAchitect = sessionStorage.getItem("BPA_ARCHITECT_NAME");
5612
5806
  let parsedArchitectName = nameOfAchitect ? JSON.parse(nameOfAchitect) : "ARCHITECT";
5613
- return t("ES_PAYMENT_" + businessService + "_" + parsedArchitectName + "_SUCCESSFUL_DESCRIPTION");
5807
+ return t(`ES_PAYMENT_${businessService}_${parsedArchitectName}_SUCCESSFUL_DESCRIPTION`);
5614
5808
  } else if (businessService !== null && businessService !== void 0 && businessService.includes("WS") || businessService !== null && businessService !== void 0 && businessService.includes("SW")) {
5615
- return t("ES_PAYMENT_WS_" + (businessService === null || businessService === void 0 ? void 0 : businessService.replace(/\./g, "_")) + "_SUCCESSFUL_DESCRIPTION");
5809
+ return t(`ES_PAYMENT_WS_${businessService === null || businessService === void 0 ? void 0 : businessService.replace(/\./g, "_")}_SUCCESSFUL_DESCRIPTION`);
5616
5810
  } else {
5617
5811
  return t("ES_PAYMENT_SUCCESSFUL_DESCRIPTION");
5618
5812
  }
5619
5813
  };
5620
- const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(tenantId, "common-masters", "ReceiptKey", {
5621
- select: data => {
5622
- var _data$commonMasters, _data$commonMasters$u, _data$commonMasters$u2;
5623
- return ((_data$commonMasters = data["common-masters"]) === null || _data$commonMasters === void 0 ? void 0 : (_data$commonMasters$u = _data$commonMasters.uiCommonPay) === null || _data$commonMasters$u === void 0 ? void 0 : (_data$commonMasters$u2 = _data$commonMasters$u.filter(_ref => {
5624
- let code = _ref.code;
5625
- return businessService === null || businessService === void 0 ? void 0 : businessService.includes(code);
5626
- })[0]) === null || _data$commonMasters$u2 === void 0 ? void 0 : _data$commonMasters$u2.receiptKey) || "consolidatedreceipt";
5627
- }
5628
- }),
5629
- generatePdfKey = _Digit$Hooks$useCommo.data;
5814
+ const {
5815
+ data: generatePdfKey
5816
+ } = Digit.Hooks.useCommonMDMS(tenantId, "common-masters", "ReceiptKey", {
5817
+ select: data => {
5818
+ var _data$commonMasters, _data$commonMasters$u, _data$commonMasters$u2;
5819
+ return ((_data$commonMasters = data["common-masters"]) === null || _data$commonMasters === void 0 ? void 0 : (_data$commonMasters$u = _data$commonMasters.uiCommonPay) === null || _data$commonMasters$u === void 0 ? void 0 : (_data$commonMasters$u2 = _data$commonMasters$u.filter(_ref => {
5820
+ let {
5821
+ code
5822
+ } = _ref;
5823
+ return businessService === null || businessService === void 0 ? void 0 : businessService.includes(code);
5824
+ })[0]) === null || _data$commonMasters$u2 === void 0 ? void 0 : _data$commonMasters$u2.receiptKey) || "consolidatedreceipt";
5825
+ }
5826
+ });
5630
5827
  const printCertificate = function () {
5631
5828
  try {
5632
5829
  const tenantId = Digit.ULBService.getCurrentTenantId();
@@ -5719,9 +5916,12 @@ const SuccessfulPayment$1 = props => {
5719
5916
  edcrData = edcrResponse === null || edcrResponse === void 0 ? void 0 : (_edcrResponse$edcrDet = edcrResponse.edcrDetail) === null || _edcrResponse$edcrDet === void 0 ? void 0 : _edcrResponse$edcrDet[0];
5720
5917
  let currentDate = new Date();
5721
5918
  bpaData.additionalDetails.runDate = convertDateToEpoch(currentDate.getFullYear() + "-" + (currentDate.getMonth() + 1) + "-" + currentDate.getDate());
5722
- let reqData = _extends({}, bpaData, {
5723
- edcrDetail: [_extends({}, edcrData)]
5724
- });
5919
+ let reqData = {
5920
+ ...bpaData,
5921
+ edcrDetail: [{
5922
+ ...edcrData
5923
+ }]
5924
+ };
5725
5925
  return Promise.resolve(Digit.PaymentService.generatePdf(bpaData === null || bpaData === void 0 ? void 0 : bpaData.tenantId, {
5726
5926
  Bpa: [reqData]
5727
5927
  }, order)).then(function (response) {
@@ -5732,7 +5932,9 @@ const SuccessfulPayment$1 = props => {
5732
5932
  window.open(fileStore[response === null || response === void 0 ? void 0 : response.filestoreIds[0]], "_blank");
5733
5933
  reqData["applicationType"] = data === null || data === void 0 ? void 0 : (_data$5 = data[0]) === null || _data$5 === void 0 ? void 0 : (_data$5$additionalDet = _data$5.additionalDetails) === null || _data$5$additionalDet === void 0 ? void 0 : _data$5$additionalDet.applicationType;
5734
5934
  return Promise.resolve(Digit.OBPSService.edcr_report_download({
5735
- BPA: _extends({}, reqData)
5935
+ BPA: {
5936
+ ...reqData
5937
+ }
5736
5938
  })).then(function (edcrResponseData) {
5737
5939
  const responseStatus = parseInt(edcrResponseData.status, 10);
5738
5940
  if (responseStatus === 201 || responseStatus === 200) {
@@ -5740,7 +5942,7 @@ const SuccessfulPayment$1 = props => {
5740
5942
  type: "application/pdf"
5741
5943
  })) : downloadPdf(new Blob([edcrResponseData.data], {
5742
5944
  type: "application/pdf"
5743
- }), "edcrReport.pdf");
5945
+ }), `edcrReport.pdf`);
5744
5946
  }
5745
5947
  });
5746
5948
  });
@@ -5809,16 +6011,21 @@ const SuccessfulPayment$1 = props => {
5809
6011
  return Promise.resolve(Digit.OBPSService.BPASearch(payments.Payments[0].tenantId, queryObj)).then(function (bpaResponse) {
5810
6012
  var _bpaResponse$BPA$, _bpaResponse$BPA$$add, _paymentData$paymentD, _bpaResponse$BPA$2, _bpaResponse$BPA$2$ad;
5811
6013
  const formattedStakeholderType = bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA$ = bpaResponse.BPA[0]) === null || _bpaResponse$BPA$ === void 0 ? void 0 : (_bpaResponse$BPA$$add = _bpaResponse$BPA$.additionalDetails) === null || _bpaResponse$BPA$$add === void 0 ? void 0 : _bpaResponse$BPA$$add.typeOfArchitect;
5812
- const updatedpayments = _extends({}, paymentData, {
5813
- paymentDetails: [_extends({}, (_paymentData$paymentD = paymentData.paymentDetails) === null || _paymentData$paymentD === void 0 ? void 0 : _paymentData$paymentD[0], {
5814
- additionalDetails: _extends({}, paymentData.paymentDetails[0].additionalDetails, {
6014
+ const updatedpayments = {
6015
+ ...paymentData,
6016
+ paymentDetails: [{
6017
+ ...((_paymentData$paymentD = paymentData.paymentDetails) === null || _paymentData$paymentD === void 0 ? void 0 : _paymentData$paymentD[0]),
6018
+ additionalDetails: {
6019
+ ...paymentData.paymentDetails[0].additionalDetails,
5815
6020
  "propertyID": bpaResponse === null || bpaResponse === void 0 ? void 0 : (_bpaResponse$BPA$2 = bpaResponse.BPA[0]) === null || _bpaResponse$BPA$2 === void 0 ? void 0 : (_bpaResponse$BPA$2$ad = _bpaResponse$BPA$2.additionalDetails) === null || _bpaResponse$BPA$2$ad === void 0 ? void 0 : _bpaResponse$BPA$2$ad.propertyID,
5816
6021
  "stakeholderType": formattedStakeholderType.charAt(0).toUpperCase() + formattedStakeholderType.slice(1).toLowerCase()
5817
- })
5818
- })]
5819
- });
6022
+ }
6023
+ }]
6024
+ };
5820
6025
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
5821
- Payments: [_extends({}, updatedpayments)]
6026
+ Payments: [{
6027
+ ...updatedpayments
6028
+ }]
5822
6029
  }, generatePdfKey)).then(function (_Digit$PaymentService2) {
5823
6030
  response = _Digit$PaymentService2;
5824
6031
  });
@@ -6197,9 +6404,10 @@ const SuccessfulPayment$1 = props => {
6197
6404
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
6198
6405
  hallsBookingApplication: [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]]
6199
6406
  }, generatePdfKeyForTL)).then(function (response) {
6200
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0], {
6407
+ const updatedApplication = {
6408
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]),
6201
6409
  permissionLetterFilestoreId: response === null || response === void 0 ? void 0 : response.filestoreIds[0]
6202
- });
6410
+ };
6203
6411
  return Promise.resolve(mutation.mutateAsync({
6204
6412
  hallsBookingApplication: updatedApplication
6205
6413
  })).then(function () {
@@ -6237,9 +6445,10 @@ const SuccessfulPayment$1 = props => {
6237
6445
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
6238
6446
  bookingApplication: [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]]
6239
6447
  }, generatePdfKeyForTL)).then(function (response) {
6240
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0], {
6448
+ const updatedApplication = {
6449
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]),
6241
6450
  permissionLetterFilestoreId: response === null || response === void 0 ? void 0 : response.filestoreIds[0]
6242
- });
6451
+ };
6243
6452
  return Promise.resolve(AdvertisementCreateApi.mutateAsync({
6244
6453
  bookingApplication: updatedApplication
6245
6454
  })).then(function () {
@@ -6315,9 +6524,10 @@ const SuccessfulPayment$1 = props => {
6315
6524
  }, "advservice-receipt")).then(function (_Digit$PaymentService8) {
6316
6525
  var _response;
6317
6526
  response = _Digit$PaymentService8;
6318
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0], {
6527
+ const updatedApplication = {
6528
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]),
6319
6529
  paymentReceiptFilestoreId: (_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]
6320
- });
6530
+ };
6321
6531
  return Promise.resolve(AdvertisementCreateApi.mutateAsync({
6322
6532
  bookingApplication: updatedApplication
6323
6533
  })).then(function () {
@@ -6365,9 +6575,10 @@ const SuccessfulPayment$1 = props => {
6365
6575
  }, "chbservice-receipt")).then(function (_Digit$PaymentService9) {
6366
6576
  var _response3;
6367
6577
  response = _Digit$PaymentService9;
6368
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0], {
6578
+ const updatedApplication = {
6579
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]),
6369
6580
  paymentReceiptFilestoreId: (_response3 = response) === null || _response3 === void 0 ? void 0 : _response3.filestoreIds[0]
6370
- });
6581
+ };
6371
6582
  return Promise.resolve(mutation.mutateAsync({
6372
6583
  hallsBookingApplication: updatedApplication
6373
6584
  })).then(function () {
@@ -6642,10 +6853,12 @@ const SuccessfulPayment$1 = props => {
6642
6853
  };
6643
6854
  const FailedPayment$1 = props => {
6644
6855
  props.setLink("Response");
6645
- const _useTranslation2 = useTranslation(),
6646
- t = _useTranslation2.t;
6647
- const _useParams2 = useParams(),
6648
- consumerCode = _useParams2.consumerCode;
6856
+ const {
6857
+ t
6858
+ } = useTranslation();
6859
+ const {
6860
+ consumerCode
6861
+ } = useParams();
6649
6862
  const getMessage = () => t("ES_PAYMENT_COLLECTED_ERROR");
6650
6863
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Banner, {
6651
6864
  message: getMessage(),
@@ -6689,12 +6902,14 @@ const middleWare_3 = function (data, _break, _next) {
6689
6902
  const _temp3 = function () {
6690
6903
  if (data.b === "b") {
6691
6904
  const _temp2 = _catch(function () {
6692
- return Promise.resolve(window.fetch("https://ifsc.razorpay.com/hdfc0000090")).then(function (res) {
6905
+ return Promise.resolve(window.fetch(`https://ifsc.razorpay.com/hdfc0000090`)).then(function (res) {
6693
6906
  const _temp = function () {
6694
6907
  if (res.ok) {
6695
6908
  return Promise.resolve(res.json()).then(function (_ref) {
6696
- let BANK = _ref.BANK,
6697
- BRANCH = _ref.BRANCH;
6909
+ let {
6910
+ BANK,
6911
+ BRANCH
6912
+ } = _ref;
6698
6913
  data.BANKFROMMiddleWare = BANK;
6699
6914
  });
6700
6915
  } else alert("Wrong IFSC Code");
@@ -6789,12 +7004,14 @@ const testForm = {
6789
7004
  setBankDetailsFromIFSC: function (props) {
6790
7005
  try {
6791
7006
  const _temp6 = _catch(function () {
6792
- return Promise.resolve(window.fetch("https://ifsc.razorpay.com/" + props.getValues("ifsc"))).then(function (res) {
7007
+ return Promise.resolve(window.fetch(`https://ifsc.razorpay.com/${props.getValues("ifsc")}`)).then(function (res) {
6793
7008
  const _temp5 = function () {
6794
7009
  if (res.ok) {
6795
7010
  return Promise.resolve(res.json()).then(function (_ref2) {
6796
- let BANK = _ref2.BANK,
6797
- BRANCH = _ref2.BRANCH;
7011
+ let {
7012
+ BANK,
7013
+ BRANCH
7014
+ } = _ref2;
6798
7015
  props.setValue("bank", BANK);
6799
7016
  props.setValue("branch", BRANCH);
6800
7017
  });
@@ -6849,28 +7066,29 @@ const testForm = {
6849
7066
  };
6850
7067
 
6851
7068
  const IFrameInterface = props => {
6852
- const stateCode = props.stateCode;
6853
- const _useParams = useParams(),
6854
- moduleName = _useParams.moduleName,
6855
- pageName = _useParams.pageName;
6856
- const _useTranslation = useTranslation(),
6857
- t = _useTranslation.t;
6858
- const _useState = useState(""),
6859
- url = _useState[0],
6860
- setUrl = _useState[1];
6861
- const _useState2 = useState(""),
6862
- title = _useState2[0],
6863
- setTitle = _useState2[1];
6864
- const _Digit$Hooks$dss$useM = Digit.Hooks.dss.useMDMS(stateCode, "common-masters", ["uiCommonConstants"], {
6865
- select: data => {
6866
- var _data$commonMasters, _data$commonMasters$u;
6867
- let formattedResponse = (data === null || data === void 0 ? void 0 : (_data$commonMasters = data["common-masters"]) === null || _data$commonMasters === void 0 ? void 0 : (_data$commonMasters$u = _data$commonMasters["uiCommonConstants"]) === null || _data$commonMasters$u === void 0 ? void 0 : _data$commonMasters$u[0]) || {};
6868
- return formattedResponse;
6869
- },
6870
- enabled: true
6871
- }),
6872
- data = _Digit$Hooks$dss$useM.data,
6873
- isLoading = _Digit$Hooks$dss$useM.isLoading;
7069
+ const {
7070
+ stateCode
7071
+ } = props;
7072
+ const {
7073
+ moduleName,
7074
+ pageName
7075
+ } = useParams();
7076
+ const {
7077
+ t
7078
+ } = useTranslation();
7079
+ const [url, setUrl] = useState("");
7080
+ const [title, setTitle] = useState("");
7081
+ const {
7082
+ data,
7083
+ isLoading
7084
+ } = Digit.Hooks.dss.useMDMS(stateCode, "common-masters", ["uiCommonConstants"], {
7085
+ select: data => {
7086
+ var _data$commonMasters, _data$commonMasters$u;
7087
+ let formattedResponse = (data === null || data === void 0 ? void 0 : (_data$commonMasters = data["common-masters"]) === null || _data$commonMasters === void 0 ? void 0 : (_data$commonMasters$u = _data$commonMasters["uiCommonConstants"]) === null || _data$commonMasters$u === void 0 ? void 0 : _data$commonMasters$u[0]) || {};
7088
+ return formattedResponse;
7089
+ },
7090
+ enabled: true
7091
+ });
6874
7092
  useEffect(() => {
6875
7093
  var _data$moduleName, _data$moduleName$ifra;
6876
7094
  const pageObject = (data === null || data === void 0 ? void 0 : (_data$moduleName = data[moduleName]) === null || _data$moduleName === void 0 ? void 0 : (_data$moduleName$ifra = _data$moduleName["iframe-routes"]) === null || _data$moduleName$ifra === void 0 ? void 0 : _data$moduleName$ifra[pageName]) || {};
@@ -6878,7 +7096,7 @@ const IFrameInterface = props => {
6878
7096
  const domain = isOrign ? process.env.NODE_ENV === "development" ? "https://qa.digit.org" : document.location.origin : pageObject === null || pageObject === void 0 ? void 0 : pageObject["domain"];
6879
7097
  const contextPath = (pageObject === null || pageObject === void 0 ? void 0 : pageObject["routePath"]) || "";
6880
7098
  const title = (pageObject === null || pageObject === void 0 ? void 0 : pageObject["title"]) || "";
6881
- let url = "" + domain + contextPath;
7099
+ let url = `${domain}${contextPath}`;
6882
7100
  setUrl(url);
6883
7101
  setTitle(title);
6884
7102
  }, [data, moduleName, pageName]);
@@ -6900,15 +7118,18 @@ const IFrameInterface = props => {
6900
7118
  subFormRegistry === null || subFormRegistry === void 0 ? void 0 : subFormRegistry.addSubForm("testForm", testForm);
6901
7119
  const EmployeePayment = _ref => {
6902
7120
  var _location, _location$pathname, _location2, _location2$pathname;
6903
- let stateCode = _ref.stateCode,
6904
- cityCode = _ref.cityCode,
6905
- moduleCode = _ref.moduleCode;
6906
- const _useRouteMatch = useRouteMatch(),
6907
- currentPath = _useRouteMatch.path;
6908
- const _useTranslation = useTranslation(),
6909
- t = _useTranslation.t;
6910
- const _useState = useState(null),
6911
- setLink = _useState[1];
7121
+ let {
7122
+ stateCode,
7123
+ cityCode,
7124
+ moduleCode
7125
+ } = _ref;
7126
+ const {
7127
+ path: currentPath
7128
+ } = useRouteMatch();
7129
+ const {
7130
+ t
7131
+ } = useTranslation();
7132
+ const [link, setLink] = useState(null);
6912
7133
  const commonProps = {
6913
7134
  stateCode,
6914
7135
  cityCode,
@@ -6965,29 +7186,32 @@ const EmployeePayment = _ref => {
6965
7186
  }, /*#__PURE__*/React.createElement("div", {
6966
7187
  className: "employee-form-content"
6967
7188
  }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
6968
- path: currentPath + "/collect/:businessService/:consumerCode"
7189
+ path: `${currentPath}/collect/:businessService/:consumerCode`
6969
7190
  }, /*#__PURE__*/React.createElement(LayoutWrapper, {
6970
7191
  layoutClass: "action"
6971
7192
  }, /*#__PURE__*/React.createElement(CollectPayment, _extends({}, commonProps, {
6972
7193
  basePath: currentPath
6973
7194
  })))), /*#__PURE__*/React.createElement(PrivateRoute, {
6974
- path: currentPath + "/success/:businessService/:receiptNumber/:consumerCode"
7195
+ path: `${currentPath}/success/:businessService/:receiptNumber/:consumerCode`
6975
7196
  }, /*#__PURE__*/React.createElement(SuccessfulPayment$1, commonProps)), /*#__PURE__*/React.createElement(PrivateRoute, {
6976
- path: currentPath + "/integration/:moduleName/:pageName"
7197
+ path: `${currentPath}/integration/:moduleName/:pageName`
6977
7198
  }, /*#__PURE__*/React.createElement(IFrameInterface, commonProps)), /*#__PURE__*/React.createElement(PrivateRoute, {
6978
- path: currentPath + "/failure"
7199
+ path: `${currentPath}/failure`
6979
7200
  }, /*#__PURE__*/React.createElement(FailedPayment$1, commonProps)))))));
6980
7201
  };
6981
7202
 
6982
7203
  const PaymentModule = _ref => {
6983
- let stateCode = _ref.stateCode,
6984
- cityCode = _ref.cityCode,
6985
- _ref$moduleCode = _ref.moduleCode,
6986
- moduleCode = _ref$moduleCode === void 0 ? "Payment" : _ref$moduleCode,
6987
- userType = _ref.userType;
6988
- const _useRouteMatch = useRouteMatch(),
6989
- path = _useRouteMatch.path,
6990
- url = _useRouteMatch.url;
7204
+ let {
7205
+ deltaConfig = {},
7206
+ stateCode,
7207
+ cityCode,
7208
+ moduleCode = "Payment",
7209
+ userType
7210
+ } = _ref;
7211
+ const {
7212
+ path,
7213
+ url
7214
+ } = useRouteMatch();
6991
7215
  const store = {
6992
7216
  data: {}
6993
7217
  };
@@ -7010,7 +7234,9 @@ const PaymentModule = _ref => {
7010
7234
  return /*#__PURE__*/React.createElement(React.Fragment, null, getPaymentHome());
7011
7235
  };
7012
7236
  const PaymentLinks = _ref2 => {
7013
- const _useTranslation = useTranslation();
7237
+ const {
7238
+ t
7239
+ } = useTranslation();
7014
7240
  return null;
7015
7241
  };
7016
7242
  const paymentConfigs = {