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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,32 @@ 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`
3005
+ }, /*#__PURE__*/React.createElement(SubmitBar, {
3006
+ label: t("CORE_COMMON_GO_TO_HOME"),
3007
+ style: {
3008
+ marginTop: "15px"
3009
+ }
3010
+ })), ((business_service === null || business_service === void 0 ? void 0 : business_service.includes("WS")) || (business_service === null || business_service === void 0 ? void 0 : business_service.includes("SW"))) && /*#__PURE__*/React.createElement(Link, {
3011
+ to: `/digit-ui/citizen/ws/my-applications`
2845
3012
  }, /*#__PURE__*/React.createElement(SubmitBar, {
2846
3013
  label: t("CORE_COMMON_GO_TO_HOME"),
2847
3014
  style: {
@@ -2850,10 +3017,12 @@ const WrapPaymentComponent = props => {
2850
3017
  })));
2851
3018
  };
2852
3019
  const FailedPayment = props => {
2853
- const _useTranslation2 = useTranslation(),
2854
- t = _useTranslation2.t;
2855
- const _useParams2 = useParams(),
2856
- consumerCode = _useParams2.consumerCode;
3020
+ const {
3021
+ t
3022
+ } = useTranslation();
3023
+ const {
3024
+ consumerCode
3025
+ } = useParams();
2857
3026
  const getMessage = () => "Failure !";
2858
3027
  return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Banner, {
2859
3028
  message: getMessage(),
@@ -2863,20 +3032,25 @@ const FailedPayment = props => {
2863
3032
  };
2864
3033
 
2865
3034
  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;
3035
+ let {
3036
+ stateCode,
3037
+ cityCode,
3038
+ moduleCode
3039
+ } = _ref;
3040
+ const {
3041
+ path: currentPath
3042
+ } = useRouteMatch();
3043
+ const {
3044
+ state: routerState
3045
+ } = useLocation();
2873
3046
  const commonProps = {
2874
3047
  stateCode,
2875
3048
  cityCode,
2876
3049
  moduleCode
2877
3050
  };
2878
- const _useTranslation = useTranslation(),
2879
- t = _useTranslation.t;
3051
+ const {
3052
+ t
3053
+ } = useTranslation();
2880
3054
  let isMobile = window.Digit.Utils.browser.isMobile();
2881
3055
  const pathname = window.location.pathname;
2882
3056
  const crumbs = [{
@@ -2954,23 +3128,23 @@ const CitizenPayment = _ref => {
2954
3128
  }, /*#__PURE__*/React.createElement("div", {
2955
3129
  className: "employee-form-content"
2956
3130
  }, /*#__PURE__*/React.createElement(PrivateRoute, {
2957
- path: currentPath + "/my-bills/:businessService"
3131
+ path: `${currentPath}/my-bills/:businessService`
2958
3132
  }, /*#__PURE__*/React.createElement(MyBills, {
2959
3133
  stateCode: stateCode
2960
3134
  })), /*#__PURE__*/React.createElement(PrivateRoute, {
2961
- path: currentPath + "/billDetails/:businessService/:consumerCode/:paymentAmt"
3135
+ path: `${currentPath}/billDetails/:businessService/:consumerCode/:paymentAmt`
2962
3136
  }, /*#__PURE__*/React.createElement(SelectPaymentType, _extends({}, commonProps, {
2963
3137
  stateCode: stateCode,
2964
3138
  basePath: currentPath
2965
3139
  }))), /*#__PURE__*/React.createElement(PrivateRoute, {
2966
- path: currentPath + "/collect/:businessService/:consumerCode"
3140
+ path: `${currentPath}/collect/:businessService/:consumerCode`
2967
3141
  }, /*#__PURE__*/React.createElement(SelectPaymentType$1, _extends({}, commonProps, {
2968
3142
  stateCode: stateCode,
2969
3143
  basePath: currentPath
2970
3144
  }))), /*#__PURE__*/React.createElement(PrivateRoute, {
2971
- path: currentPath + "/success/:businessService/:consumerCode/:tenantId"
3145
+ path: `${currentPath}/success/:businessService/:consumerCode/:tenantId`
2972
3146
  }, /*#__PURE__*/React.createElement(SuccessfulPayment, commonProps)), /*#__PURE__*/React.createElement(PrivateRoute, {
2973
- path: currentPath + "/failure"
3147
+ path: `${currentPath}/failure`
2974
3148
  }, /*#__PURE__*/React.createElement(FailedPayment, commonProps))))))));
2975
3149
  };
2976
3150
 
@@ -2991,7 +3165,7 @@ const getKeyNotesConfig = (businessService, t) => {
2991
3165
  fontSize: "16px",
2992
3166
  fontWeight: "normal"
2993
3167
  }
2994
- }, " ( " + t("CS_PAYMENT_OVERDUE") + " " + days + " " + t(days === 1 ? "CS_COMMON_DAY" : "CS_COMMON_DAYS") + ")") : null);
3168
+ }, ` ( ${t("CS_PAYMENT_OVERDUE")} ${days} ${t(days === 1 ? "CS_COMMON_DAY" : "CS_COMMON_DAYS")})`) : null);
2995
3169
  }],
2996
3170
  fallback: "N/A",
2997
3171
  noteStyle: {
@@ -3014,9 +3188,10 @@ const getKeyNotesConfig = (businessService, t) => {
3014
3188
  }, {
3015
3189
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
3016
3190
  keyPath: ["billDetails", d => {
3017
- const _d$ = d[0],
3018
- fromPeriod = _d$.fromPeriod,
3019
- toPeriod = _d$.toPeriod;
3191
+ const {
3192
+ fromPeriod,
3193
+ toPeriod
3194
+ } = d[0];
3020
3195
  if (fromPeriod && toPeriod) {
3021
3196
  let from = new Date(fromPeriod).getFullYear().toString();
3022
3197
  let to = new Date(toPeriod).getFullYear().toString();
@@ -3027,11 +3202,11 @@ const getKeyNotesConfig = (businessService, t) => {
3027
3202
  }, {
3028
3203
  keyValue: "PT_DUE_DATE",
3029
3204
  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);
3205
+ var _d$, _d$2;
3206
+ if (!((_d$ = d[0]) !== null && _d$ !== void 0 && _d$.toPeriod)) return "N/A";
3207
+ const date = new Date((_d$2 = d[0]) === null || _d$2 === void 0 ? void 0 : _d$2.toPeriod);
3033
3208
  const month = Digit.Utils.date.monthNames[date.getMonth()];
3034
- return date.getDate() + " " + month + " " + date.getFullYear();
3209
+ return `${date.getDate()} ${month} ${date.getFullYear()}`;
3035
3210
  }],
3036
3211
  fallback: "N/A"
3037
3212
  }],
@@ -3082,15 +3257,14 @@ const useCashPaymentDetails = (props, t) => {
3082
3257
  };
3083
3258
  const CashDetailsComponent = _ref => {
3084
3259
  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];
3260
+ let {
3261
+ ...props
3262
+ } = _ref;
3263
+ const {
3264
+ t
3265
+ } = useTranslation();
3266
+ 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);
3267
+ 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
3268
  useEffect(() => {
3095
3269
  if (props.onChange) {
3096
3270
  let errorObj = {};
@@ -3141,18 +3315,15 @@ const useCardPaymentDetails = (props, t) => {
3141
3315
  };
3142
3316
  const CardDetailsComponent = _ref => {
3143
3317
  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];
3318
+ let {
3319
+ ...props
3320
+ } = _ref;
3321
+ const {
3322
+ t
3323
+ } = useTranslation();
3324
+ 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);
3325
+ 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);
3326
+ 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
3327
  useEffect(() => {
3157
3328
  if (props.onChange) {
3158
3329
  let errorObj = {};
@@ -3169,19 +3340,19 @@ const CardDetailsComponent = _ref => {
3169
3340
  }, [last4Digits, transactionNumber, reTransanctionNumber]);
3170
3341
  return /*#__PURE__*/React.createElement("div", {
3171
3342
  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, {
3343
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NOC_PAYMENT_CARD_LAST_DIGITS_LABEL")} *`), /*#__PURE__*/React.createElement(TextInput, {
3173
3344
  value: last4Digits,
3174
3345
  name: "instrumentNumber",
3175
3346
  maxLength: "4",
3176
3347
  minLength: "4",
3177
3348
  required: true,
3178
3349
  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, {
3350
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NOC_PAYMENT_TRANS_NO_LABEL")} *`), /*#__PURE__*/React.createElement(TextInput, {
3180
3351
  value: transactionNumber,
3181
3352
  name: "instrumentNumber",
3182
3353
  required: true,
3183
3354
  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, {
3355
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("NOC_PAYMENT_RENTR_TRANS_LABEL")} *`), /*#__PURE__*/React.createElement(TextInput, {
3185
3356
  value: reTransanctionNumber,
3186
3357
  name: "instrumentNumber",
3187
3358
  required: true,
@@ -3220,26 +3391,15 @@ const useChequeDetails = (props, t) => {
3220
3391
  };
3221
3392
  const ChequeDetailsComponent = props => {
3222
3393
  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];
3394
+ const {
3395
+ t
3396
+ } = useTranslation();
3397
+ const [instrumentDate, setChequeDate] = useState(props.chequeDetails.instrumentDate);
3398
+ const [instrumentNumber, setChequeNo] = useState(props.chequeDetails.instrumentNumber);
3399
+ const [ifscCode, setIfsc] = useState(props.chequeDetails.ifscCode);
3400
+ const [ifscCodeError, setIfscCodeError] = useState("");
3401
+ const [bankName, setBankName] = useState(props.chequeDetails.bankName);
3402
+ const [bankBranch, setBankBranch] = useState((_props$chequeDetails$ = props.chequeDetails.bankBranch) === null || _props$chequeDetails$ === void 0 ? void 0 : _props$chequeDetails$.replace(" ", " "));
3243
3403
  useEffect(() => {
3244
3404
  if (props.onChange) {
3245
3405
  let errorObj = {};
@@ -3260,12 +3420,14 @@ const ChequeDetailsComponent = props => {
3260
3420
  const setBankDetailsFromIFSC = function () {
3261
3421
  try {
3262
3422
  const _temp2 = _catch(function () {
3263
- return Promise.resolve(window.fetch("https://ifsc.razorpay.com/" + ifscCode)).then(function (res) {
3423
+ return Promise.resolve(window.fetch(`https://ifsc.razorpay.com/${ifscCode}`)).then(function (res) {
3264
3424
  const _temp = function () {
3265
3425
  if (res.ok) {
3266
3426
  return Promise.resolve(res.json()).then(function (_ref) {
3267
- let BANK = _ref.BANK,
3268
- BRANCH = _ref.BRANCH;
3427
+ let {
3428
+ BANK,
3429
+ BRANCH
3430
+ } = _ref;
3269
3431
  setBankName(BANK);
3270
3432
  setBankBranch(BRANCH === null || BRANCH === void 0 ? void 0 : BRANCH.replace("┬á", " "));
3271
3433
  });
@@ -3287,18 +3449,18 @@ const ChequeDetailsComponent = props => {
3287
3449
  };
3288
3450
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
3289
3451
  className: "formcomposer-section-grid"
3290
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_CHQ_NO_LABEL") + " *"), /*#__PURE__*/React.createElement(TextInput, {
3452
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PAYMENT_CHQ_NO_LABEL")} *`), /*#__PURE__*/React.createElement(TextInput, {
3291
3453
  value: instrumentNumber,
3292
3454
  onChange: e => setChequeNo(e.target.value),
3293
3455
  name: "instrumentNumber",
3294
3456
  required: true
3295
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_CHEQUE_DATE_LABEL") + " *"), /*#__PURE__*/React.createElement(DatePicker, {
3457
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PAYMENT_CHEQUE_DATE_LABEL")} *`), /*#__PURE__*/React.createElement(DatePicker, {
3296
3458
  isRequired: true,
3297
3459
  date: instrumentDate,
3298
3460
  onChange: d => {
3299
3461
  setChequeDate(d);
3300
3462
  }
3301
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("PAYMENT_IFSC_CODE_LABEL") + " *"), /*#__PURE__*/React.createElement("div", {
3463
+ })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, `${t("PAYMENT_IFSC_CODE_LABEL")} *`), /*#__PURE__*/React.createElement("div", {
3302
3464
  className: "field"
3303
3465
  }, /*#__PURE__*/React.createElement("div", {
3304
3466
  className: "cheque-date"
@@ -4317,9 +4479,10 @@ const BillDetailsKeyNoteConfig = () => ({
4317
4479
  }, {
4318
4480
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
4319
4481
  keyPath: ["billDetails", d => {
4320
- const _d$ = d[0],
4321
- fromPeriod = _d$.fromPeriod,
4322
- toPeriod = _d$.toPeriod;
4482
+ const {
4483
+ fromPeriod,
4484
+ toPeriod
4485
+ } = d[0];
4323
4486
  if (fromPeriod && toPeriod) {
4324
4487
  let from = new Date(fromPeriod).getFullYear().toString();
4325
4488
  let to = new Date(toPeriod).getFullYear().toString();
@@ -4330,7 +4493,9 @@ const BillDetailsKeyNoteConfig = () => ({
4330
4493
  }, {
4331
4494
  keyValue: "CS_BILL_NO",
4332
4495
  keyPath: ["billDetails", d => {
4333
- const currentBillNo = d[0].currentBillNo;
4496
+ const {
4497
+ currentBillNo
4498
+ } = d[0];
4334
4499
  if (currentBillNo) {
4335
4500
  return currentBillNo;
4336
4501
  } else return "N/A";
@@ -4339,7 +4504,9 @@ const BillDetailsKeyNoteConfig = () => ({
4339
4504
  }, {
4340
4505
  keyValue: "CS_BILL_DUEDATE",
4341
4506
  keyPath: ["billDetails", d => {
4342
- const currentExpiryDate = d[0].currentExpiryDate;
4507
+ const {
4508
+ currentExpiryDate
4509
+ } = d[0];
4343
4510
  if (currentExpiryDate) {
4344
4511
  return new Date(currentExpiryDate).toLocaleDateString();
4345
4512
  } else return "N/A";
@@ -4364,7 +4531,9 @@ const BillDetailsKeyNoteConfig = () => ({
4364
4531
  }, {
4365
4532
  keyValue: "CS_BILL_NO",
4366
4533
  keyPath: ["billDetails", d => {
4367
- const currentBillNo = d[0].currentBillNo;
4534
+ const {
4535
+ currentBillNo
4536
+ } = d[0];
4368
4537
  if (currentBillNo) {
4369
4538
  return currentBillNo;
4370
4539
  } else return "N/A";
@@ -4373,7 +4542,9 @@ const BillDetailsKeyNoteConfig = () => ({
4373
4542
  }, {
4374
4543
  keyValue: "CS_BILL_DUEDATE",
4375
4544
  keyPath: ["billDetails", d => {
4376
- const currentExpiryDate = d[0].currentExpiryDate;
4545
+ const {
4546
+ currentExpiryDate
4547
+ } = d[0];
4377
4548
  if (currentExpiryDate) {
4378
4549
  return new Date(currentExpiryDate).toLocaleDateString();
4379
4550
  } else return "N/A";
@@ -4430,9 +4601,10 @@ const BillDetailsKeyNoteConfig = () => ({
4430
4601
  }, {
4431
4602
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
4432
4603
  keyPath: ["billDetails", d => {
4433
- const _d$2 = d[0],
4434
- fromPeriod = _d$2.fromPeriod,
4435
- toPeriod = _d$2.toPeriod;
4604
+ const {
4605
+ fromPeriod,
4606
+ toPeriod
4607
+ } = d[0];
4436
4608
  if (fromPeriod && toPeriod) {
4437
4609
  let from = new Date(fromPeriod).toLocaleDateString();
4438
4610
  let to = new Date(toPeriod).toLocaleDateString();
@@ -4447,7 +4619,9 @@ const BillDetailsKeyNoteConfig = () => ({
4447
4619
  }, {
4448
4620
  keyValue: "CS_BILL_DUEDATE",
4449
4621
  keyPath: ["billDetails", d => {
4450
- const currentExpiryDate = d[0].currentExpiryDate;
4622
+ const {
4623
+ currentExpiryDate
4624
+ } = d[0];
4451
4625
  if (currentExpiryDate) {
4452
4626
  return new Date(currentExpiryDate).toLocaleDateString();
4453
4627
  } else return "N/A";
@@ -4464,9 +4638,10 @@ const BillDetailsKeyNoteConfig = () => ({
4464
4638
  }, {
4465
4639
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
4466
4640
  keyPath: ["billDetails", d => {
4467
- const _d$3 = d[0],
4468
- fromPeriod = _d$3.fromPeriod,
4469
- toPeriod = _d$3.toPeriod;
4641
+ const {
4642
+ fromPeriod,
4643
+ toPeriod
4644
+ } = d[0];
4470
4645
  if (fromPeriod && toPeriod) {
4471
4646
  let from = new Date(fromPeriod).toLocaleDateString();
4472
4647
  let to = new Date(toPeriod).toLocaleDateString();
@@ -4481,7 +4656,9 @@ const BillDetailsKeyNoteConfig = () => ({
4481
4656
  }, {
4482
4657
  keyValue: "CS_BILL_DUEDATE",
4483
4658
  keyPath: ["billDetails", d => {
4484
- const expiryDate = d[0].expiryDate;
4659
+ const {
4660
+ expiryDate
4661
+ } = d[0];
4485
4662
  if (expiryDate) {
4486
4663
  return new Date(expiryDate).toLocaleDateString();
4487
4664
  } else return "N/A";
@@ -4704,40 +4881,49 @@ const BillDetailsFormConfig = (props, t) => ({
4704
4881
  });
4705
4882
  const BillDetails$1 = _ref => {
4706
4883
  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;
4884
+ let {
4885
+ businessService,
4886
+ consumerCode,
4887
+ _amount,
4888
+ onChange
4889
+ } = _ref;
4890
+ const {
4891
+ t
4892
+ } = useTranslation();
4893
+ const {
4894
+ workflow: ModuleWorkflow,
4895
+ IsDisconnectionFlow
4896
+ } = Digit.Hooks.useQueryParams();
4715
4897
  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;
4898
+ const {
4899
+ data,
4900
+ isLoading
4901
+ } = Digit.Hooks.useFetchPayment({
4902
+ tenantId,
4903
+ businessService,
4904
+ consumerCode
4905
+ });
4723
4906
  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;
4907
+ const {
4908
+ isLoading: isDataLoading,
4909
+ data: applicationData
4910
+ } = Digit.Hooks.fsm.useSearch(tenantId, {
4911
+ applicationNos: consumerCode
4912
+ }, {
4913
+ staleTime: Infinity,
4914
+ enabled: businessService !== null && businessService !== void 0 && (_businessService$toUp = businessService.toUpperCase()) !== null && _businessService$toUp !== void 0 && _businessService$toUp.includes("FSM") ? true : false
4915
+ });
4916
+ const [bill, setBill] = useState();
4917
+ const [showDetails, setShowDetails] = useState(true);
4918
+ const {
4919
+ isLoading: isFSMLoading,
4920
+ isError,
4921
+ error,
4922
+ data: application,
4923
+ error: errorApplication
4924
+ } = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, consumerCode, {
4925
+ enabled: checkFSM ? true : false
4926
+ }, "EMPLOYEE");
4741
4927
  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
4928
  const billDetails = (yearWiseBills === null || yearWiseBills === void 0 ? void 0 : yearWiseBills[0]) || [];
4743
4929
  const getTotal = () => bill !== null && bill !== void 0 && bill.totalAmount ? bill === null || bill === void 0 ? void 0 : bill.totalAmount : 0;
@@ -4755,38 +4941,31 @@ const BillDetails$1 = _ref => {
4755
4941
  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
4942
  };
4757
4943
  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];
4944
+ const {
4945
+ isLoading: mdmsLoading,
4946
+ data: mdmsBillingData
4947
+ } = Digit.Hooks.useGetPaymentRulesForBusinessServices(tenantId);
4948
+ const [paymentRules, setPaymentRules] = useState();
4764
4949
  useEffect(() => {
4765
4950
  var _mdmsBillingData$Mdms, _mdmsBillingData$Mdms2;
4766
4951
  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
4952
  if (payRestrictiondetails !== null && payRestrictiondetails !== void 0 && payRestrictiondetails.length) {
4768
4953
  if (IsDisconnectionFlow) {
4769
- setPaymentRules(_extends({}, payRestrictiondetails.filter(e => e.code == businessService)[0], {
4954
+ setPaymentRules({
4955
+ ...payRestrictiondetails.filter(e => e.code == businessService)[0],
4770
4956
  partPaymentAllowed: false
4771
- }));
4957
+ });
4772
4958
  } else setPaymentRules(payRestrictiondetails.filter(e => e.code == businessService)[0]);
4773
4959
  } else setPaymentRules({});
4774
4960
  }, [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];
4961
+ const {
4962
+ minAmountPayable,
4963
+ isAdvanceAllowed
4964
+ } = paymentRules || {};
4965
+ const [paymentType, setPaymentType] = useState(t("CS_PAYMENT_FULL_AMOUNT"));
4966
+ const [amount, setAmount] = useState(getTotal());
4967
+ const [paymentAllowed, setPaymentAllowed] = useState(true);
4968
+ const [formError, setError] = useState("");
4790
4969
  const changeAmount = value => {
4791
4970
  setAmount(value);
4792
4971
  };
@@ -4840,15 +5019,19 @@ const BillDetails$1 = _ref => {
4840
5019
  };
4841
5020
  if (isLoading || mdmsLoading) return /*#__PURE__*/React.createElement(Loader, null);
4842
5021
  const getFinancialYear = _bill => {
4843
- const fromPeriod = _bill.fromPeriod,
4844
- toPeriod = _bill.toPeriod;
5022
+ const {
5023
+ fromPeriod,
5024
+ toPeriod
5025
+ } = _bill;
4845
5026
  let from = new Date(fromPeriod).getFullYear().toString();
4846
5027
  let to = new Date(toPeriod).getFullYear().toString();
4847
5028
  return from + "-" + to;
4848
5029
  };
4849
5030
  const getBillingPeriod = _bill => {
4850
- const fromPeriod = _bill.fromPeriod,
4851
- toPeriod = _bill.toPeriod;
5031
+ const {
5032
+ fromPeriod,
5033
+ toPeriod
5034
+ } = _bill;
4852
5035
  let from = new Date(fromPeriod).toLocaleDateString();
4853
5036
  let to = new Date(toPeriod).toLocaleDateString();
4854
5037
  return from + "-" + to;
@@ -4874,11 +5057,17 @@ const BillDetails$1 = _ref => {
4874
5057
  }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
4875
5058
  style: thStyle
4876
5059
  }, t("CS_BILL_NO")), /*#__PURE__*/React.createElement("th", {
4877
- style: _extends({}, thStyle)
5060
+ style: {
5061
+ ...thStyle
5062
+ }
4878
5063
  }, t("CS_PAYMENT_BILLING_PERIOD")), /*#__PURE__*/React.createElement("th", {
4879
- style: _extends({}, thStyle)
5064
+ style: {
5065
+ ...thStyle
5066
+ }
4880
5067
  }, 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),
5068
+ style: {
5069
+ ...thStyle
5070
+ },
4882
5071
  key: index
4883
5072
  }, t(head.taxHeadCode))), /*#__PURE__*/React.createElement("th", {
4884
5073
  style: thStyle
@@ -5036,11 +5225,17 @@ const BillDetails$1 = _ref => {
5036
5225
  }, /*#__PURE__*/React.createElement("thead", null, /*#__PURE__*/React.createElement("tr", null, /*#__PURE__*/React.createElement("th", {
5037
5226
  style: thStyle
5038
5227
  }, t("FINANCIAL_YEAR")), /*#__PURE__*/React.createElement("th", {
5039
- style: _extends({}, thStyle)
5228
+ style: {
5229
+ ...thStyle
5230
+ }
5040
5231
  }, t("CS_BILL_NO")), /*#__PURE__*/React.createElement("th", {
5041
- style: _extends({}, thStyle)
5232
+ style: {
5233
+ ...thStyle
5234
+ }
5042
5235
  }, 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),
5236
+ style: {
5237
+ ...thStyle
5238
+ },
5044
5239
  key: index
5045
5240
  }, t(head.taxHeadCode))), /*#__PURE__*/React.createElement("th", {
5046
5241
  style: thStyle
@@ -5095,7 +5290,7 @@ const BillDetails$1 = _ref => {
5095
5290
  }, /*#__PURE__*/React.createElement("span", {
5096
5291
  className: "payment-amount-front",
5097
5292
  style: {
5098
- border: "1px solid " + (paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? "#9a9a9a" : "black")
5293
+ border: `1px solid ${paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? "#9a9a9a" : "black"}`
5099
5294
  }
5100
5295
  }, "\u20B9"), paymentType !== t("CS_PAYMENT_FULL_AMOUNT") ? /*#__PURE__*/React.createElement(TextInput, {
5101
5296
  style: {
@@ -5119,58 +5314,61 @@ const BillDetails$1 = _ref => {
5119
5314
  }, t(formError)))));
5120
5315
  };
5121
5316
 
5122
- const _excluded$2 = ["ManualRecieptDetails", "paymentModeDetails"],
5123
- _excluded2 = ["errorObj"];
5124
5317
  const CollectPayment = props => {
5125
5318
  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;
5319
+ const {
5320
+ workflow: ModuleWorkflow,
5321
+ IsDisconnectionFlow
5322
+ } = Digit.Hooks.useQueryParams();
5323
+ const {
5324
+ t
5325
+ } = useTranslation();
5131
5326
  const history = useHistory();
5132
5327
  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;
5328
+ const {
5329
+ state,
5330
+ search
5331
+ } = useLocation();
5332
+ const {
5333
+ path: currentPath
5334
+ } = useRouteMatch();
5335
+ let {
5336
+ consumerCode,
5337
+ businessService
5338
+ } = useParams();
5140
5339
  const tenantId = Digit.ULBService.getCurrentTenantId();
5141
- const _useState = useState(0),
5142
- Time = _useState[0],
5143
- setTime = _useState[1];
5340
+ const [Time, setTime] = useState(0);
5144
5341
  if (window.location.href.includes("ISWSAPP")) consumerCode = new URLSearchParams(search).get("applicationNumber");
5145
5342
  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;
5343
+ const {
5344
+ data: paymentdetails,
5345
+ isLoading
5346
+ } = Digit.Hooks.useFetchPayment({
5347
+ tenantId: tenantId,
5348
+ consumerCode,
5349
+ businessService
5350
+ });
5153
5351
  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;
5352
+ const {
5353
+ data: applicationData
5354
+ } = Digit.Hooks.fsm.useSearch(tenantId, {
5355
+ applicationNos: consumerCode
5356
+ }, {
5357
+ staleTime: Infinity,
5358
+ enabled: businessService !== null && businessService !== void 0 && (_businessService$toUp = businessService.toUpperCase()) !== null && _businessService$toUp !== void 0 && _businessService$toUp.includes("FSM") ? true : false
5359
+ });
5161
5360
  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];
5361
+ const {
5362
+ cardConfig
5363
+ } = useCardPaymentDetails(props, t);
5364
+ const {
5365
+ chequeConfig
5366
+ } = useChequeDetails(props, t);
5367
+ const {
5368
+ cashConfig
5369
+ } = useCashPaymentDetails(props, t);
5370
+ const [formState, setFormState] = useState({});
5371
+ const [toast, setToast] = useState(null);
5174
5372
  useEffect(() => {
5175
5373
  if (paymentdetails !== null && paymentdetails !== void 0 && paymentdetails.Bill && paymentdetails.Bill.length === 0) {
5176
5374
  setToast({
@@ -5204,15 +5402,11 @@ const CollectPayment = props => {
5204
5402
  code: "OTHER",
5205
5403
  name: t("COMMON_OTHER")
5206
5404
  }];
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];
5405
+ const [selectedPaymentMode, setPaymentMode] = useState((formState === null || formState === void 0 ? void 0 : formState.selectedPaymentMode) || getPaymentModes()[0]);
5406
+ const [selectedPaidBy, setselectedPaidBy] = useState((formState === null || formState === void 0 ? void 0 : formState.paidBy) || {
5407
+ code: "OWNER",
5408
+ name: t("COMMON_OWNER")
5409
+ });
5216
5410
  const onSubmit = function (data) {
5217
5411
  try {
5218
5412
  var _data$amount, _data$amount6, _data$amount7, _data$paymentMode, _data$paymentModeDeta, _recieptRequest$Payme2, _recieptRequest$Payme3, _recieptRequest$Payme4, _recieptRequest$Payme5, _recieptRequest$Payme6;
@@ -5230,12 +5424,15 @@ const CollectPayment = props => {
5230
5424
  });
5231
5425
  return Promise.resolve();
5232
5426
  }
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);
5427
+ const {
5428
+ ManualRecieptDetails,
5429
+ paymentModeDetails,
5430
+ ...rest
5431
+ } = data;
5432
+ const {
5433
+ errorObj,
5434
+ ...details
5435
+ } = paymentModeDetails || {};
5239
5436
  let recieptRequest = {
5240
5437
  Payment: {
5241
5438
  mobileNumber: data.payerMobile,
@@ -5265,7 +5462,10 @@ const CollectPayment = props => {
5265
5462
  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
5463
  if (data.paymentModeDetails) {
5267
5464
  var _recieptRequest$Payme;
5268
- recieptRequest.Payment = _extends({}, recieptRequest.Payment, details);
5465
+ recieptRequest.Payment = {
5466
+ ...recieptRequest.Payment,
5467
+ ...details
5468
+ };
5269
5469
  delete recieptRequest.Payment.paymentModeDetails;
5270
5470
  if (data.paymentModeDetails.errorObj) {
5271
5471
  const errors = data.paymentModeDetails.errorObj;
@@ -5273,7 +5473,7 @@ const CollectPayment = props => {
5273
5473
  if (messages) {
5274
5474
  setToast({
5275
5475
  key: "error",
5276
- action: messages + " " + t("ES_ERROR_REQUIRED")
5476
+ action: `${messages} ${t("ES_ERROR_REQUIRED")}`
5277
5477
  });
5278
5478
  setTimeout(() => setToast(null), 5000);
5279
5479
  return Promise.resolve();
@@ -5310,7 +5510,7 @@ const CollectPayment = props => {
5310
5510
  return Promise.resolve(Digit.PaymentService.createReciept(tenantId, recieptRequest)).then(function (resposne) {
5311
5511
  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
5512
  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);
5513
+ 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
5514
  });
5315
5515
  }, function (error) {
5316
5516
  var _setToast, _error$response, _error$response$data, _error$response$data$;
@@ -5341,7 +5541,7 @@ const CollectPayment = props => {
5341
5541
  marginBottom: 0,
5342
5542
  textAlign: "right"
5343
5543
  }
5344
- }, " ", "\u20B9 " + (bill === null || bill === void 0 ? void 0 : bill.totalAmount), " ")
5544
+ }, " ", `₹ ${bill === null || bill === void 0 ? void 0 : bill.totalAmount}`, " ")
5345
5545
  }]
5346
5546
  }, {
5347
5547
  head: t("PAYMENT_PAID_BY_HEAD"),
@@ -5501,7 +5701,7 @@ const CollectPayment = props => {
5501
5701
  }
5502
5702
  }), toast && /*#__PURE__*/React.createElement(Toast, {
5503
5703
  error: toast.key === "error",
5504
- label: t(toast.key === "success" ? "ES_" + businessService.split(".")[0].toLowerCase() + "_" + toast.action + "_UPDATE_SUCCESS" : toast.action),
5704
+ label: t(toast.key === "success" ? `ES_${businessService.split(".")[0].toLowerCase()}_${toast.action}_UPDATE_SUCCESS` : toast.action),
5505
5705
  onClose: () => setToast(null),
5506
5706
  style: {
5507
5707
  maxWidth: "670px"
@@ -5517,7 +5717,7 @@ const convertEpochToDate$1 = dateEpoch => {
5517
5717
  let year = dateFromApi.getFullYear();
5518
5718
  month = (month > 9 ? "" : "0") + month;
5519
5719
  day = (day > 9 ? "" : "0") + day;
5520
- return day + "/" + month + "/" + year;
5720
+ return `${day}/${month}/${year}`;
5521
5721
  } else {
5522
5722
  return "NA";
5523
5723
  }
@@ -5525,34 +5725,35 @@ const convertEpochToDate$1 = dateEpoch => {
5525
5725
  const SuccessfulPayment$1 = props => {
5526
5726
  var _location, _location$pathname, _data$6, _data$7, _data$8, _data$9, _data$0, _data$1, _data$10, _data$11, _data$12;
5527
5727
  const history = useHistory();
5528
- const _useTranslation = useTranslation(),
5529
- t = _useTranslation.t;
5728
+ const {
5729
+ t
5730
+ } = useTranslation();
5530
5731
  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];
5732
+ const {
5733
+ IsDisconnectionFlow
5734
+ } = Digit.Hooks.useQueryParams();
5735
+ const [displayMenu, setDisplayMenu] = useState(false);
5736
+ const [selectedAction, setSelectedAction] = useState(null);
5539
5737
  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");
5738
+ const combineResponseFSM = isFSMResponse ? `${t("PAYMENT_COLLECT_LABEL")} / ${t("PAYMENT_COLLECT")}` : t("PAYMENT_LOCALIZATION_RESPONSE");
5541
5739
  props.setLink(combineResponseFSM);
5542
- let _useParams = useParams(),
5543
- consumerCode = _useParams.consumerCode,
5544
- receiptNumber = _useParams.receiptNumber,
5545
- businessService = _useParams.businessService;
5740
+ let {
5741
+ consumerCode,
5742
+ receiptNumber,
5743
+ businessService
5744
+ } = useParams();
5546
5745
  const tenantId = Digit.ULBService.getCurrentTenantId();
5547
5746
  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;
5747
+ const {
5748
+ data = {},
5749
+ isLoading: isBpaSearchLoading,
5750
+ isSuccess: isBpaSuccess,
5751
+ error: bpaerror
5752
+ } = Digit.Hooks.obps.useOBPSSearch("", {}, tenantId, {
5753
+ applicationNo: consumerCode
5754
+ }, {}, {
5755
+ enabled: businessService !== null && businessService !== void 0 && businessService.includes("BPA") ? true : false
5756
+ });
5556
5757
  const FSM_EDITOR = Digit.UserService.hasAccess("FSM_EDITOR_EMP") || false;
5557
5758
  function onActionSelect(action) {
5558
5759
  setSelectedAction(action);
@@ -5595,7 +5796,7 @@ const SuccessfulPayment$1 = props => {
5595
5796
  case "GO_TO_HOME":
5596
5797
  return history.push("/digit-ui/employee");
5597
5798
  case "ASSIGN_TO_DSO":
5598
- return history.push("/digit-ui/employee/fsm/application-details/" + consumerCode);
5799
+ return history.push(`/digit-ui/employee/fsm/application-details/${consumerCode}`);
5599
5800
  default:
5600
5801
  return null;
5601
5802
  }
@@ -5610,23 +5811,26 @@ const SuccessfulPayment$1 = props => {
5610
5811
  if (businessService !== null && businessService !== void 0 && businessService.includes("BPA")) {
5611
5812
  let nameOfAchitect = sessionStorage.getItem("BPA_ARCHITECT_NAME");
5612
5813
  let parsedArchitectName = nameOfAchitect ? JSON.parse(nameOfAchitect) : "ARCHITECT";
5613
- return t("ES_PAYMENT_" + businessService + "_" + parsedArchitectName + "_SUCCESSFUL_DESCRIPTION");
5814
+ return t(`ES_PAYMENT_${businessService}_${parsedArchitectName}_SUCCESSFUL_DESCRIPTION`);
5614
5815
  } 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");
5816
+ return t(`ES_PAYMENT_WS_${businessService === null || businessService === void 0 ? void 0 : businessService.replace(/\./g, "_")}_SUCCESSFUL_DESCRIPTION`);
5616
5817
  } else {
5617
5818
  return t("ES_PAYMENT_SUCCESSFUL_DESCRIPTION");
5618
5819
  }
5619
5820
  };
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;
5821
+ const {
5822
+ data: generatePdfKey
5823
+ } = Digit.Hooks.useCommonMDMS(tenantId, "common-masters", "ReceiptKey", {
5824
+ select: data => {
5825
+ var _data$commonMasters, _data$commonMasters$u, _data$commonMasters$u2;
5826
+ 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 => {
5827
+ let {
5828
+ code
5829
+ } = _ref;
5830
+ return businessService === null || businessService === void 0 ? void 0 : businessService.includes(code);
5831
+ })[0]) === null || _data$commonMasters$u2 === void 0 ? void 0 : _data$commonMasters$u2.receiptKey) || "consolidatedreceipt";
5832
+ }
5833
+ });
5630
5834
  const printCertificate = function () {
5631
5835
  try {
5632
5836
  const tenantId = Digit.ULBService.getCurrentTenantId();
@@ -5719,9 +5923,12 @@ const SuccessfulPayment$1 = props => {
5719
5923
  edcrData = edcrResponse === null || edcrResponse === void 0 ? void 0 : (_edcrResponse$edcrDet = edcrResponse.edcrDetail) === null || _edcrResponse$edcrDet === void 0 ? void 0 : _edcrResponse$edcrDet[0];
5720
5924
  let currentDate = new Date();
5721
5925
  bpaData.additionalDetails.runDate = convertDateToEpoch(currentDate.getFullYear() + "-" + (currentDate.getMonth() + 1) + "-" + currentDate.getDate());
5722
- let reqData = _extends({}, bpaData, {
5723
- edcrDetail: [_extends({}, edcrData)]
5724
- });
5926
+ let reqData = {
5927
+ ...bpaData,
5928
+ edcrDetail: [{
5929
+ ...edcrData
5930
+ }]
5931
+ };
5725
5932
  return Promise.resolve(Digit.PaymentService.generatePdf(bpaData === null || bpaData === void 0 ? void 0 : bpaData.tenantId, {
5726
5933
  Bpa: [reqData]
5727
5934
  }, order)).then(function (response) {
@@ -5732,7 +5939,9 @@ const SuccessfulPayment$1 = props => {
5732
5939
  window.open(fileStore[response === null || response === void 0 ? void 0 : response.filestoreIds[0]], "_blank");
5733
5940
  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
5941
  return Promise.resolve(Digit.OBPSService.edcr_report_download({
5735
- BPA: _extends({}, reqData)
5942
+ BPA: {
5943
+ ...reqData
5944
+ }
5736
5945
  })).then(function (edcrResponseData) {
5737
5946
  const responseStatus = parseInt(edcrResponseData.status, 10);
5738
5947
  if (responseStatus === 201 || responseStatus === 200) {
@@ -5740,7 +5949,7 @@ const SuccessfulPayment$1 = props => {
5740
5949
  type: "application/pdf"
5741
5950
  })) : downloadPdf(new Blob([edcrResponseData.data], {
5742
5951
  type: "application/pdf"
5743
- }), "edcrReport.pdf");
5952
+ }), `edcrReport.pdf`);
5744
5953
  }
5745
5954
  });
5746
5955
  });
@@ -5809,16 +6018,21 @@ const SuccessfulPayment$1 = props => {
5809
6018
  return Promise.resolve(Digit.OBPSService.BPASearch(payments.Payments[0].tenantId, queryObj)).then(function (bpaResponse) {
5810
6019
  var _bpaResponse$BPA$, _bpaResponse$BPA$$add, _paymentData$paymentD, _bpaResponse$BPA$2, _bpaResponse$BPA$2$ad;
5811
6020
  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, {
6021
+ const updatedpayments = {
6022
+ ...paymentData,
6023
+ paymentDetails: [{
6024
+ ...((_paymentData$paymentD = paymentData.paymentDetails) === null || _paymentData$paymentD === void 0 ? void 0 : _paymentData$paymentD[0]),
6025
+ additionalDetails: {
6026
+ ...paymentData.paymentDetails[0].additionalDetails,
5815
6027
  "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
6028
  "stakeholderType": formattedStakeholderType.charAt(0).toUpperCase() + formattedStakeholderType.slice(1).toLowerCase()
5817
- })
5818
- })]
5819
- });
6029
+ }
6030
+ }]
6031
+ };
5820
6032
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
5821
- Payments: [_extends({}, updatedpayments)]
6033
+ Payments: [{
6034
+ ...updatedpayments
6035
+ }]
5822
6036
  }, generatePdfKey)).then(function (_Digit$PaymentService2) {
5823
6037
  response = _Digit$PaymentService2;
5824
6038
  });
@@ -6197,9 +6411,10 @@ const SuccessfulPayment$1 = props => {
6197
6411
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
6198
6412
  hallsBookingApplication: [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]]
6199
6413
  }, generatePdfKeyForTL)).then(function (response) {
6200
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0], {
6414
+ const updatedApplication = {
6415
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]),
6201
6416
  permissionLetterFilestoreId: response === null || response === void 0 ? void 0 : response.filestoreIds[0]
6202
- });
6417
+ };
6203
6418
  return Promise.resolve(mutation.mutateAsync({
6204
6419
  hallsBookingApplication: updatedApplication
6205
6420
  })).then(function () {
@@ -6237,9 +6452,10 @@ const SuccessfulPayment$1 = props => {
6237
6452
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
6238
6453
  bookingApplication: [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]]
6239
6454
  }, generatePdfKeyForTL)).then(function (response) {
6240
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0], {
6455
+ const updatedApplication = {
6456
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]),
6241
6457
  permissionLetterFilestoreId: response === null || response === void 0 ? void 0 : response.filestoreIds[0]
6242
- });
6458
+ };
6243
6459
  return Promise.resolve(AdvertisementCreateApi.mutateAsync({
6244
6460
  bookingApplication: updatedApplication
6245
6461
  })).then(function () {
@@ -6315,9 +6531,10 @@ const SuccessfulPayment$1 = props => {
6315
6531
  }, "advservice-receipt")).then(function (_Digit$PaymentService8) {
6316
6532
  var _response;
6317
6533
  response = _Digit$PaymentService8;
6318
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0], {
6534
+ const updatedApplication = {
6535
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]),
6319
6536
  paymentReceiptFilestoreId: (_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]
6320
- });
6537
+ };
6321
6538
  return Promise.resolve(AdvertisementCreateApi.mutateAsync({
6322
6539
  bookingApplication: updatedApplication
6323
6540
  })).then(function () {
@@ -6365,9 +6582,10 @@ const SuccessfulPayment$1 = props => {
6365
6582
  }, "chbservice-receipt")).then(function (_Digit$PaymentService9) {
6366
6583
  var _response3;
6367
6584
  response = _Digit$PaymentService9;
6368
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0], {
6585
+ const updatedApplication = {
6586
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]),
6369
6587
  paymentReceiptFilestoreId: (_response3 = response) === null || _response3 === void 0 ? void 0 : _response3.filestoreIds[0]
6370
- });
6588
+ };
6371
6589
  return Promise.resolve(mutation.mutateAsync({
6372
6590
  hallsBookingApplication: updatedApplication
6373
6591
  })).then(function () {
@@ -6642,10 +6860,12 @@ const SuccessfulPayment$1 = props => {
6642
6860
  };
6643
6861
  const FailedPayment$1 = props => {
6644
6862
  props.setLink("Response");
6645
- const _useTranslation2 = useTranslation(),
6646
- t = _useTranslation2.t;
6647
- const _useParams2 = useParams(),
6648
- consumerCode = _useParams2.consumerCode;
6863
+ const {
6864
+ t
6865
+ } = useTranslation();
6866
+ const {
6867
+ consumerCode
6868
+ } = useParams();
6649
6869
  const getMessage = () => t("ES_PAYMENT_COLLECTED_ERROR");
6650
6870
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(Banner, {
6651
6871
  message: getMessage(),
@@ -6689,12 +6909,14 @@ const middleWare_3 = function (data, _break, _next) {
6689
6909
  const _temp3 = function () {
6690
6910
  if (data.b === "b") {
6691
6911
  const _temp2 = _catch(function () {
6692
- return Promise.resolve(window.fetch("https://ifsc.razorpay.com/hdfc0000090")).then(function (res) {
6912
+ return Promise.resolve(window.fetch(`https://ifsc.razorpay.com/hdfc0000090`)).then(function (res) {
6693
6913
  const _temp = function () {
6694
6914
  if (res.ok) {
6695
6915
  return Promise.resolve(res.json()).then(function (_ref) {
6696
- let BANK = _ref.BANK,
6697
- BRANCH = _ref.BRANCH;
6916
+ let {
6917
+ BANK,
6918
+ BRANCH
6919
+ } = _ref;
6698
6920
  data.BANKFROMMiddleWare = BANK;
6699
6921
  });
6700
6922
  } else alert("Wrong IFSC Code");
@@ -6789,12 +7011,14 @@ const testForm = {
6789
7011
  setBankDetailsFromIFSC: function (props) {
6790
7012
  try {
6791
7013
  const _temp6 = _catch(function () {
6792
- return Promise.resolve(window.fetch("https://ifsc.razorpay.com/" + props.getValues("ifsc"))).then(function (res) {
7014
+ return Promise.resolve(window.fetch(`https://ifsc.razorpay.com/${props.getValues("ifsc")}`)).then(function (res) {
6793
7015
  const _temp5 = function () {
6794
7016
  if (res.ok) {
6795
7017
  return Promise.resolve(res.json()).then(function (_ref2) {
6796
- let BANK = _ref2.BANK,
6797
- BRANCH = _ref2.BRANCH;
7018
+ let {
7019
+ BANK,
7020
+ BRANCH
7021
+ } = _ref2;
6798
7022
  props.setValue("bank", BANK);
6799
7023
  props.setValue("branch", BRANCH);
6800
7024
  });
@@ -6849,28 +7073,29 @@ const testForm = {
6849
7073
  };
6850
7074
 
6851
7075
  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;
7076
+ const {
7077
+ stateCode
7078
+ } = props;
7079
+ const {
7080
+ moduleName,
7081
+ pageName
7082
+ } = useParams();
7083
+ const {
7084
+ t
7085
+ } = useTranslation();
7086
+ const [url, setUrl] = useState("");
7087
+ const [title, setTitle] = useState("");
7088
+ const {
7089
+ data,
7090
+ isLoading
7091
+ } = Digit.Hooks.dss.useMDMS(stateCode, "common-masters", ["uiCommonConstants"], {
7092
+ select: data => {
7093
+ var _data$commonMasters, _data$commonMasters$u;
7094
+ 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]) || {};
7095
+ return formattedResponse;
7096
+ },
7097
+ enabled: true
7098
+ });
6874
7099
  useEffect(() => {
6875
7100
  var _data$moduleName, _data$moduleName$ifra;
6876
7101
  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 +7103,7 @@ const IFrameInterface = props => {
6878
7103
  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
7104
  const contextPath = (pageObject === null || pageObject === void 0 ? void 0 : pageObject["routePath"]) || "";
6880
7105
  const title = (pageObject === null || pageObject === void 0 ? void 0 : pageObject["title"]) || "";
6881
- let url = "" + domain + contextPath;
7106
+ let url = `${domain}${contextPath}`;
6882
7107
  setUrl(url);
6883
7108
  setTitle(title);
6884
7109
  }, [data, moduleName, pageName]);
@@ -6900,15 +7125,18 @@ const IFrameInterface = props => {
6900
7125
  subFormRegistry === null || subFormRegistry === void 0 ? void 0 : subFormRegistry.addSubForm("testForm", testForm);
6901
7126
  const EmployeePayment = _ref => {
6902
7127
  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];
7128
+ let {
7129
+ stateCode,
7130
+ cityCode,
7131
+ moduleCode
7132
+ } = _ref;
7133
+ const {
7134
+ path: currentPath
7135
+ } = useRouteMatch();
7136
+ const {
7137
+ t
7138
+ } = useTranslation();
7139
+ const [link, setLink] = useState(null);
6912
7140
  const commonProps = {
6913
7141
  stateCode,
6914
7142
  cityCode,
@@ -6965,29 +7193,32 @@ const EmployeePayment = _ref => {
6965
7193
  }, /*#__PURE__*/React.createElement("div", {
6966
7194
  className: "employee-form-content"
6967
7195
  }, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(PrivateRoute, {
6968
- path: currentPath + "/collect/:businessService/:consumerCode"
7196
+ path: `${currentPath}/collect/:businessService/:consumerCode`
6969
7197
  }, /*#__PURE__*/React.createElement(LayoutWrapper, {
6970
7198
  layoutClass: "action"
6971
7199
  }, /*#__PURE__*/React.createElement(CollectPayment, _extends({}, commonProps, {
6972
7200
  basePath: currentPath
6973
7201
  })))), /*#__PURE__*/React.createElement(PrivateRoute, {
6974
- path: currentPath + "/success/:businessService/:receiptNumber/:consumerCode"
7202
+ path: `${currentPath}/success/:businessService/:receiptNumber/:consumerCode`
6975
7203
  }, /*#__PURE__*/React.createElement(SuccessfulPayment$1, commonProps)), /*#__PURE__*/React.createElement(PrivateRoute, {
6976
- path: currentPath + "/integration/:moduleName/:pageName"
7204
+ path: `${currentPath}/integration/:moduleName/:pageName`
6977
7205
  }, /*#__PURE__*/React.createElement(IFrameInterface, commonProps)), /*#__PURE__*/React.createElement(PrivateRoute, {
6978
- path: currentPath + "/failure"
7206
+ path: `${currentPath}/failure`
6979
7207
  }, /*#__PURE__*/React.createElement(FailedPayment$1, commonProps)))))));
6980
7208
  };
6981
7209
 
6982
7210
  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;
7211
+ let {
7212
+ deltaConfig = {},
7213
+ stateCode,
7214
+ cityCode,
7215
+ moduleCode = "Payment",
7216
+ userType
7217
+ } = _ref;
7218
+ const {
7219
+ path,
7220
+ url
7221
+ } = useRouteMatch();
6991
7222
  const store = {
6992
7223
  data: {}
6993
7224
  };
@@ -7010,7 +7241,9 @@ const PaymentModule = _ref => {
7010
7241
  return /*#__PURE__*/React.createElement(React.Fragment, null, getPaymentHome());
7011
7242
  };
7012
7243
  const PaymentLinks = _ref2 => {
7013
- const _useTranslation = useTranslation();
7244
+ const {
7245
+ t
7246
+ } = useTranslation();
7014
7247
  return null;
7015
7248
  };
7016
7249
  const paymentConfigs = {