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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -19,18 +19,6 @@ function _extends() {
19
19
  return n;
20
20
  }, _extends.apply(null, arguments);
21
21
  }
22
- function _objectDestructuringEmpty(t) {
23
- if (null == t) throw new TypeError("Cannot destructure " + t);
24
- }
25
- function _objectWithoutPropertiesLoose(r, e) {
26
- if (null == r) return {};
27
- var t = {};
28
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
29
- if (-1 !== e.indexOf(n)) continue;
30
- t[n] = r[n];
31
- }
32
- return t;
33
- }
34
22
 
35
23
  const stringReplaceAll = function (str, searcher, replaceWith) {
36
24
  if (str === void 0) {
@@ -56,7 +44,6 @@ const timerEnabledForBusinessService = businessService => {
56
44
  return false;
57
45
  };
58
46
 
59
- const _excluded = ["state"];
60
47
  const SelectPaymentType = props => {
61
48
  var _Digit$UserService$ge, _Digit$UserService$ge2, _data$Bill, _data$Bill$, _bill$billDetails, _bill$billDetails$sor, _bill$billDetails2, _bill$billDetails2$so;
62
49
  const optionFirst = {
@@ -72,34 +59,37 @@ const SelectPaymentType = props => {
72
59
  const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
73
60
  const payersActiveName = userInfo === null || userInfo === void 0 ? void 0 : userInfo.name;
74
61
  const payersActiveMobileNumber = userInfo === null || userInfo === void 0 ? void 0 : userInfo.mobileNumber;
75
- const _useTranslation = reactI18next.useTranslation(),
76
- t = _useTranslation.t;
62
+ const {
63
+ t
64
+ } = reactI18next.useTranslation();
77
65
  const history = reactRouterDom.useHistory();
78
- const _useLocation = reactRouterDom.useLocation(),
79
- state = _useLocation.state,
80
- location = _objectWithoutPropertiesLoose(_useLocation, _excluded);
81
- const _useParams = reactRouterDom.useParams(),
82
- consumerCode = _useParams.consumerCode,
83
- businessService = _useParams.businessService,
84
- paymentAmt = _useParams.paymentAmt;
85
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
86
- wrkflow = _Digit$Hooks$useQuery.workflow,
87
- _tenantId = _Digit$Hooks$useQuery.tenantId,
88
- ConsumerName = _Digit$Hooks$useQuery.ConsumerName;
89
- const _useState = React.useState(state === null || state === void 0 ? void 0 : state.bill),
90
- bill = _useState[0],
91
- setBill = _useState[1];
66
+ const {
67
+ state,
68
+ ...location
69
+ } = reactRouterDom.useLocation();
70
+ const {
71
+ consumerCode,
72
+ businessService,
73
+ paymentAmt
74
+ } = reactRouterDom.useParams();
75
+ const {
76
+ workflow: wrkflow,
77
+ tenantId: _tenantId,
78
+ ConsumerName
79
+ } = Digit.Hooks.useQueryParams();
80
+ const [bill, setBill] = React.useState(state === null || state === void 0 ? void 0 : state.bill);
92
81
  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);
93
82
  const isLoggedIn = Digit.UserService.getUser();
94
- const _ref = state !== null && state !== void 0 && state.bill ? {
95
- isLoading: false
96
- } : Digit.Hooks.useFetchPayment({
97
- tenantId,
98
- businessService,
99
- consumerCode
100
- }),
101
- data = _ref.data,
102
- isLoading = _ref.isLoading;
83
+ const {
84
+ data,
85
+ isLoading
86
+ } = state !== null && state !== void 0 && state.bill ? {
87
+ isLoading: false
88
+ } : Digit.Hooks.useFetchPayment({
89
+ tenantId,
90
+ businessService,
91
+ consumerCode
92
+ });
103
93
  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) || "";
104
94
  let requestCriteria = ["/user/_search", {}, {
105
95
  data: {
@@ -112,42 +102,31 @@ const SelectPaymentType = props => {
112
102
  enabled: Useruuid ? true : false,
113
103
  cacheTime: 100
114
104
  }];
115
- const _Digit$Hooks$useCusto = Digit.Hooks.useCustomAPIHook(...requestCriteria),
116
- isUserLoading = _Digit$Hooks$useCusto.isLoading,
117
- userData = _Digit$Hooks$useCusto.data;
105
+ const {
106
+ isLoading: isUserLoading,
107
+ data: userData,
108
+ revalidate
109
+ } = Digit.Hooks.useCustomAPIHook(...requestCriteria);
118
110
  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]) || [];
119
111
  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;
120
- const _useState2 = React.useState(optionFirst),
121
- paymentType = _useState2[0],
122
- setPaymentType = _useState2[1];
123
- const _useState3 = React.useState(""),
124
- payersName = _useState3[0],
125
- setPayersName = _useState3[1];
126
- const _useState4 = React.useState(""),
127
- payersMobileNumber = _useState4[0],
128
- setPayersMobileNumber = _useState4[1];
129
- const _useForm = reactHookForm.useForm(),
130
- handleSubmit = _useForm.handleSubmit;
131
- const _useState5 = React.useState(false),
132
- canSubmit = _useState5[0],
133
- setCanSubmit = _useState5[1];
134
- const _useState6 = React.useState(null),
135
- mobileNumberError = _useState6[0],
136
- setmobileNumberError = _useState6[1];
137
- const _useState7 = React.useState(false),
138
- isCheckBox = _useState7[0],
139
- setIsCheckBox = _useState7[1];
140
- const _useState8 = React.useState(false),
141
- isCCFEnabled = _useState8[0],
142
- setisCCFEnabled = _useState8[1];
143
- const _useState9 = React.useState(""),
144
- mdmsConfig = _useState9[0],
145
- setMdmsConfig = _useState9[1];
146
- const _Digit$Hooks$useCusto2 = Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(), "common-masters", [{
147
- name: "CitizenConsentForm"
148
- }]),
149
- citizenConcentFormLoading = _Digit$Hooks$useCusto2.isLoading,
150
- ccfData = _Digit$Hooks$useCusto2.data;
112
+ const [paymentType, setPaymentType] = React.useState(optionFirst);
113
+ const [payersName, setPayersName] = React.useState("");
114
+ const [payersMobileNumber, setPayersMobileNumber] = React.useState("");
115
+ const {
116
+ control,
117
+ handleSubmit
118
+ } = reactHookForm.useForm();
119
+ const [canSubmit, setCanSubmit] = React.useState(false);
120
+ const [mobileNumberError, setmobileNumberError] = React.useState(null);
121
+ const [isCheckBox, setIsCheckBox] = React.useState(false);
122
+ const [isCCFEnabled, setisCCFEnabled] = React.useState(false);
123
+ const [mdmsConfig, setMdmsConfig] = React.useState("");
124
+ const {
125
+ isLoading: citizenConcentFormLoading,
126
+ data: ccfData
127
+ } = Digit.Hooks.useCustomMDMS(Digit.ULBService.getStateId(), "common-masters", [{
128
+ name: "CitizenConsentForm"
129
+ }]);
151
130
  function setTermsAndPolicyDetails(e) {
152
131
  setIsCheckBox(e.target.checked);
153
132
  }
@@ -175,7 +154,7 @@ const SelectPaymentType = props => {
175
154
  var _isCCFEnabled$checkBo;
176
155
  return /*#__PURE__*/React__default.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) => {
177
156
  var _isCCFEnabled$checkBo2;
178
- return /*#__PURE__*/React__default.createElement("span", null, (data === null || data === void 0 ? void 0 : data.linkPrefix) && /*#__PURE__*/React__default.createElement("span", null, t((data === null || data === void 0 ? void 0 : data.linkPrefix) + "_")), (data === null || data === void 0 ? void 0 : data.link) && /*#__PURE__*/React__default.createElement("span", {
157
+ return /*#__PURE__*/React__default.createElement("span", null, (data === null || data === void 0 ? void 0 : data.linkPrefix) && /*#__PURE__*/React__default.createElement("span", null, t(`${data === null || data === void 0 ? void 0 : data.linkPrefix}_`)), (data === null || data === void 0 ? void 0 : data.link) && /*#__PURE__*/React__default.createElement("span", {
179
158
  id: data === null || data === void 0 ? void 0 : data.linkId,
180
159
  onClick: e => {
181
160
  onLinkClick(e);
@@ -184,7 +163,7 @@ const SelectPaymentType = props => {
184
163
  color: "#a82227",
185
164
  cursor: "pointer"
186
165
  }
187
- }, t((data === null || data === void 0 ? void 0 : data.link) + "_")), (data === null || data === void 0 ? void 0 : data.linkPostfix) && /*#__PURE__*/React__default.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"));
166
+ }, t(`${data === null || data === void 0 ? void 0 : data.link}_`)), (data === null || data === void 0 ? void 0 : data.linkPostfix) && /*#__PURE__*/React__default.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"));
188
167
  }));
189
168
  };
190
169
  React.useEffect(() => {
@@ -211,7 +190,7 @@ const SelectPaymentType = props => {
211
190
  const onSubmit = () => {
212
191
  if (wrkflow === "WNS") {
213
192
  var _bill$mobileNumber, _userData$user, _userData$user$;
214
- history.push("/digit-ui/citizen/payment/collect/" + businessService + "/" + consumerCode + "?workflow=WNS&consumerCode=" + stringReplaceAll(consumerCode, "+", "/"), {
193
+ history.push(`/digit-ui/citizen/payment/collect/${businessService}/${consumerCode}?workflow=WNS&consumerCode=${stringReplaceAll(consumerCode, "+", "/")}`, {
215
194
  paymentAmount: paymentAmt,
216
195
  tenantId: billDetails.tenantId,
217
196
  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,
@@ -219,7 +198,7 @@ const SelectPaymentType = props => {
219
198
  });
220
199
  } else {
221
200
  var _bill$mobileNumber2, _userData$user2, _userData$user2$;
222
- history.push("/digit-ui/citizen/payment/collect/" + businessService + "/" + consumerCode, {
201
+ history.push(`/digit-ui/citizen/payment/collect/${businessService}/${consumerCode}`, {
223
202
  paymentAmount: paymentAmt,
224
203
  tenantId: billDetails.tenantId,
225
204
  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,
@@ -285,15 +264,18 @@ const SelectPaymentType = props => {
285
264
 
286
265
  const MyBill = _ref => {
287
266
  var _bill$totalAmount;
288
- let bill = _ref.bill,
289
- currentPath = _ref.currentPath,
290
- businessService = _ref.businessService,
291
- getKeyNotesConfig = _ref.getKeyNotesConfig;
292
- const _useTranslation = reactI18next.useTranslation(),
293
- t = _useTranslation.t;
267
+ let {
268
+ bill,
269
+ currentPath,
270
+ businessService,
271
+ getKeyNotesConfig
272
+ } = _ref;
273
+ const {
274
+ t
275
+ } = reactI18next.useTranslation();
294
276
  const history = reactRouterDom.useHistory();
295
277
  const onSubmit = () => {
296
- history.push(currentPath + "/" + bill.consumerCode, {
278
+ history.push(`${currentPath}/${bill.consumerCode}`, {
297
279
  tenantId: bill === null || bill === void 0 ? void 0 : bill.tenantId
298
280
  });
299
281
  };
@@ -316,11 +298,14 @@ const MyBill = _ref => {
316
298
  };
317
299
 
318
300
  const BillList = _ref => {
319
- let billsList = _ref.billsList,
320
- currentPath = _ref.currentPath,
321
- businessService = _ref.businessService;
322
- const _useTranslation = reactI18next.useTranslation(),
323
- t = _useTranslation.t;
301
+ let {
302
+ billsList,
303
+ currentPath,
304
+ businessService
305
+ } = _ref;
306
+ const {
307
+ t
308
+ } = reactI18next.useTranslation();
324
309
  const history = reactRouterDom.useHistory();
325
310
  const consumerCodes = billsList.map(bill => bill.consumerCode);
326
311
  const searchResult = Digit.Hooks.useApplicationsForBusinessServiceSearch({
@@ -330,14 +315,11 @@ const BillList = _ref => {
330
315
  businessService
331
316
  });
332
317
  const keyForConsumerCode = searchResult.key;
333
- const _useState = React.useState([]),
334
- applicationList = _useState[0],
335
- setApplicationList = _useState[1];
336
- const _useState2 = React.useState(() => {
337
- var _Digit$ComponentRegis;
338
- return (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("getBillDetailsConfigWithBusinessService");
339
- }),
340
- getKeyNotesConfig = _useState2[0];
318
+ const [applicationList, setApplicationList] = React.useState([]);
319
+ const [getKeyNotesConfig, setConfig] = React.useState(() => {
320
+ var _Digit$ComponentRegis;
321
+ return (_Digit$ComponentRegis = Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("getBillDetailsConfigWithBusinessService");
322
+ });
341
323
  const billableApplicationsObj = React.useMemo(() => ({}), []);
342
324
  const billsListObj = React.useMemo(() => ({}), []);
343
325
  React.useEffect(() => {
@@ -353,7 +335,10 @@ const BillList = _ref => {
353
335
  billsList.forEach(bill => {
354
336
  billsListObj[bill.consumerCode] = bill;
355
337
  });
356
- const newBillsList = billableIDs.map(e => _extends({}, billsListObj[e], billableApplicationsObj[e]));
338
+ const newBillsList = billableIDs.map(e => ({
339
+ ...billsListObj[e],
340
+ ...billableApplicationsObj[e]
341
+ }));
357
342
  setApplicationList(newBillsList);
358
343
  }
359
344
  }, [searchResult.data, getKeyNotesConfig]);
@@ -362,7 +347,7 @@ const BillList = _ref => {
362
347
  }
363
348
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
364
349
  className: "static"
365
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.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__default.createElement("div", {
350
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.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__default.createElement("div", {
366
351
  key: index
367
352
  }, /*#__PURE__*/React__default.createElement(MyBill, {
368
353
  bill,
@@ -393,7 +378,7 @@ const styles = {
393
378
  boxShadow: "none"
394
379
  },
395
380
  table: {
396
- minWidth: 700,
381
+ width: "100%",
397
382
  backgroundColor: "rgba(250, 250, 250, var(--bg-opacity))"
398
383
  },
399
384
  cell: {
@@ -413,62 +398,81 @@ const styles = {
413
398
  cellRight: {}
414
399
  };
415
400
  const ArrearTable = _ref => {
416
- let _ref$headers = _ref.headers,
417
- headers = _ref$headers === void 0 ? [] : _ref$headers,
418
- _ref$values = _ref.values,
419
- values = _ref$values === void 0 ? [] : _ref$values,
420
- _ref$arrears = _ref.arrears,
421
- arrears = _ref$arrears === void 0 ? 0 : _ref$arrears;
422
- const _useTranslation = reactI18next.useTranslation(),
423
- t = _useTranslation.t;
401
+ let {
402
+ className = "table",
403
+ headers = [],
404
+ values = [],
405
+ arrears = 0
406
+ } = _ref;
407
+ const {
408
+ t
409
+ } = reactI18next.useTranslation();
424
410
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
425
411
  style: styles.root
426
412
  }, /*#__PURE__*/React__default.createElement("table", {
427
413
  className: "table-fixed-column-common-pay",
428
414
  style: styles.table
429
415
  }, /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
430
- style: _extends({}, styles.cell, styles.cellLeft, styles.cellHeader)
416
+ style: {
417
+ ...styles.cell,
418
+ ...styles.cellLeft,
419
+ ...styles.cellHeader
420
+ }
431
421
  }, t("CS_BILL_PERIOD")), headers.map((header, ind) => {
432
422
  let styleRight = headers.length == ind + 1 ? styles.cellRight : {};
433
423
  return /*#__PURE__*/React__default.createElement("th", {
434
- style: _extends({}, styles.cell, styleRight, styles.cellHeader),
424
+ style: {
425
+ ...styles.cell,
426
+ ...styleRight,
427
+ ...styles.cellHeader
428
+ },
435
429
  key: ind
436
430
  }, t(header));
437
431
  }))), /*#__PURE__*/React__default.createElement("tbody", null, Object.values(values).map((row, ind) => /*#__PURE__*/React__default.createElement("tr", {
438
432
  key: ind
439
433
  }, /*#__PURE__*/React__default.createElement("td", {
440
- style: _extends({}, styles.cell, styles.cellLeft),
434
+ style: {
435
+ ...styles.cell,
436
+ ...styles.cellLeft
437
+ },
441
438
  component: "th",
442
439
  scope: "row"
443
440
  }, Object.keys(values)[ind]), headers.map((header, i) => {
444
441
  let styleRight = headers.length == i + 1 ? styles.cellRight : {};
445
442
  return /*#__PURE__*/React__default.createElement("td", {
446
- style: _extends({}, styles.cell, {
447
- textAlign: "left"
448
- }, styleRight, {
443
+ style: {
444
+ ...styles.cell,
445
+ textAlign: "left",
446
+ ...styleRight,
449
447
  whiteSpace: "pre"
450
- }),
448
+ },
451
449
  key: i,
452
450
  numeric: true
453
451
  }, i > 1 && "₹", row[header] && row[header]["value"] || "0");
454
452
  }))), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
455
- style: _extends({}, styles.cell, styles.cellLeft)
453
+ style: {
454
+ ...styles.cell,
455
+ ...styles.cellLeft
456
+ }
456
457
  }), headers.map((header, ind) => {
457
458
  if (ind == headers.length - 1) {
458
459
  return /*#__PURE__*/React__default.createElement("td", {
459
- style: _extends({}, styles.cell, styles.cellRight, {
460
+ style: {
461
+ ...styles.cell,
462
+ ...styles.cellRight,
460
463
  textAlign: "left",
461
464
  fontWeight: "700",
462
465
  whiteSpace: "pre"
463
- }),
466
+ },
464
467
  key: ind,
465
468
  numeric: true
466
469
  }, arrears);
467
470
  } else if (ind == headers.length - 2) {
468
471
  return /*#__PURE__*/React__default.createElement("td", {
469
- style: _extends({}, styles.cell, {
472
+ style: {
473
+ ...styles.cell,
470
474
  textAlign: "left"
471
- }),
475
+ },
472
476
  key: ind,
473
477
  numeric: true
474
478
  }, t("COMMON_ARREARS_TOTAL"));
@@ -486,7 +490,11 @@ const styles$1 = {
486
490
  buttonStyle: {
487
491
  display: "flex",
488
492
  justifyContent: "flex-end",
489
- color: "#a82227"
493
+ color: "#a82227",
494
+ marginTop: "10px",
495
+ marginBottom: "10px",
496
+ cursor: "pointer",
497
+ fontWeight: "bold"
490
498
  },
491
499
  headerStyle: {
492
500
  marginTop: "10px",
@@ -496,21 +504,102 @@ const styles$1 = {
496
504
  color: " rgba(11, 12, 12, var(--text-opacity))"
497
505
  }
498
506
  };
507
+ const thStyle = {
508
+ textAlign: "left",
509
+ borderBottom: "#D6D5D4 1px solid",
510
+ padding: "16px 12px",
511
+ whiteSpace: "break-spaces",
512
+ fontSize: "14px",
513
+ fontWeight: "bold"
514
+ };
515
+ const tdStyle = {
516
+ textAlign: "left",
517
+ borderBottom: "#D6D5D4 1px solid",
518
+ padding: "8px 10px",
519
+ wordBreak: "keep-all",
520
+ fontSize: "14px"
521
+ };
499
522
  const ArrearSummary = _ref => {
500
- var _bill$billDetails, _sortedBillDetails, _arrears$toFixed;
501
- let _ref$bill = _ref.bill,
502
- bill = _ref$bill === void 0 ? {} : _ref$bill;
503
- const _useTranslation = reactI18next.useTranslation(),
504
- t = _useTranslation.t;
523
+ var _bill$billDetails, _bill$billDetails2, _sortedBillDetails, _arrears$toFixed;
524
+ let {
525
+ bill = {},
526
+ businessService
527
+ } = _ref;
528
+ const {
529
+ t
530
+ } = reactI18next.useTranslation();
531
+ const [showArrear, setShowArrear] = React.useState(false);
532
+ const isWNS = businessService === "WS" || businessService === "SW";
533
+ 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);
534
+ const getBillingPeriod = _bill => {
535
+ const {
536
+ fromPeriod,
537
+ toPeriod
538
+ } = _bill;
539
+ let from = new Date(fromPeriod).toLocaleDateString();
540
+ let to = new Date(toPeriod).toLocaleDateString();
541
+ return from + "-" + to;
542
+ };
543
+ const renderArrearDetailsForWNS = () => {
544
+ var _yearWiseBills$filter, _yearWiseBills$filter2, _yearWiseBills$filter3, _yearWiseBills$filter4, _yearWiseBills$filter5;
545
+ return /*#__PURE__*/React__default.createElement("div", {
546
+ style: {
547
+ maxWidth: "100%",
548
+ overflowX: "auto",
549
+ backgroundColor: "#EEEEEE",
550
+ marginTop: "10px"
551
+ }
552
+ }, /*#__PURE__*/React__default.createElement("table", {
553
+ className: "table-fixed-column-common-pay",
554
+ style: {
555
+ width: "100%",
556
+ borderCollapse: "collapse"
557
+ }
558
+ }, /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
559
+ style: thStyle
560
+ }, t("CS_BILL_NO")), /*#__PURE__*/React__default.createElement("th", {
561
+ style: {
562
+ ...thStyle
563
+ }
564
+ }, t("CS_PAYMENT_BILLING_PERIOD")), /*#__PURE__*/React__default.createElement("th", {
565
+ style: {
566
+ ...thStyle
567
+ }
568
+ }, 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__default.createElement("th", {
569
+ style: {
570
+ ...thStyle
571
+ },
572
+ key: index
573
+ }, t(head.taxHeadCode))), /*#__PURE__*/React__default.createElement("th", {
574
+ style: thStyle
575
+ }, t("TOTAL_TAX")))), /*#__PURE__*/React__default.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) => {
576
+ var _year_bill$billAccoun;
577
+ 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);
578
+ return /*#__PURE__*/React__default.createElement("tr", {
579
+ key: index
580
+ }, /*#__PURE__*/React__default.createElement("td", {
581
+ style: tdStyle
582
+ }, year_bill === null || year_bill === void 0 ? void 0 : year_bill.billNumber), /*#__PURE__*/React__default.createElement("td", {
583
+ style: tdStyle
584
+ }, getBillingPeriod(year_bill)), /*#__PURE__*/React__default.createElement("td", {
585
+ style: tdStyle
586
+ }, (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__default.createElement("td", {
587
+ style: tdStyle,
588
+ key: i
589
+ }, e.amount)), /*#__PURE__*/React__default.createElement("td", {
590
+ style: tdStyle
591
+ }, year_bill.amount));
592
+ }))));
593
+ };
505
594
  const formatTaxHeaders = function (billDetail) {
506
- var _billDetail2, _billDetail3, _billDetail4;
595
+ var _billDetail, _billDetail2, _billDetail3;
507
596
  if (billDetail === void 0) {
508
597
  billDetail = {};
509
598
  }
510
599
  let formattedFees = {};
511
- const _billDetail = billDetail,
512
- _billDetail$billAccou = _billDetail.billAccountDetails,
513
- billAccountDetails = _billDetail$billAccou === void 0 ? [] : _billDetail$billAccou;
600
+ const {
601
+ billAccountDetails = []
602
+ } = billDetail;
514
603
  billAccountDetails.map(taxHead => {
515
604
  formattedFees[taxHead.taxHeadCode] = {
516
605
  value: taxHead.amount,
@@ -518,11 +607,11 @@ const ArrearSummary = _ref => {
518
607
  };
519
608
  });
520
609
  formattedFees["CS_BILL_NO"] = {
521
- value: ((_billDetail2 = billDetail) === null || _billDetail2 === void 0 ? void 0 : _billDetail2.billNumber) || "NA",
610
+ value: ((_billDetail = billDetail) === null || _billDetail === void 0 ? void 0 : _billDetail.billNumber) || "NA",
522
611
  order: -2
523
612
  };
524
613
  formattedFees["CS_BILL_DUEDATE"] = {
525
- 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",
614
+ 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",
526
615
  order: -1
527
616
  };
528
617
  formattedFees["TL_COMMON_TOTAL_AMT"] = {
@@ -535,15 +624,15 @@ const ArrearSummary = _ref => {
535
624
  const fromDate = new Date(from);
536
625
  const toDate = new Date(to);
537
626
  if (toDate.getYear() - fromDate.getYear() != 0) {
538
- return "FY" + (fromDate.getYear() + 1900) + "-" + (toDate.getYear() - 100);
627
+ return `FY${fromDate.getYear() + 1900}-${toDate.getYear() - 100}`;
539
628
  }
540
- return fromDate.toLocaleDateString() + "-" + toDate.toLocaleDateString();
629
+ return `${fromDate.toLocaleDateString()}-${toDate.toLocaleDateString()}`;
541
630
  };
542
631
  let fees = {};
543
- 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)) || [];
632
+ 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)) || [];
544
633
  sortedBillDetails = [...sortedBillDetails];
545
634
  const arrears = ((_sortedBillDetails = sortedBillDetails) === null || _sortedBillDetails === void 0 ? void 0 : _sortedBillDetails.reduce((total, current, index) => index === 0 ? total : total + current.amount, 0)) || 0;
546
- 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));
635
+ 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)}`;
547
636
  sortedBillDetails.shift();
548
637
  sortedBillDetails.map(bill => {
549
638
  let fee = formatTaxHeaders(bill);
@@ -558,9 +647,18 @@ const ArrearSummary = _ref => {
558
647
  let keys = [];
559
648
  keys = Object.keys(head);
560
649
  keys.sort((x, y) => head[x] - head[y]);
561
- const _useState = React.useState(false),
562
- showArrear = _useState[0],
563
- setShowArrear = _useState[1];
650
+ if (isWNS) {
651
+ if (!yearWiseBills || yearWiseBills.length <= 1) {
652
+ return /*#__PURE__*/React__default.createElement("span", null);
653
+ }
654
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, showArrear && renderArrearDetailsForWNS(), /*#__PURE__*/React__default.createElement("div", {
655
+ style: styles$1.buttonStyle
656
+ }, /*#__PURE__*/React__default.createElement("div", {
657
+ onClick: () => {
658
+ setShowArrear(!showArrear);
659
+ }
660
+ }, showArrear ? t("ES_COMMON_HIDE_DETAILS") : t("ES_COMMON_VIEW_DETAILS"))));
661
+ }
564
662
  if (arrears == 0 || arrears < 0) {
565
663
  return /*#__PURE__*/React__default.createElement("span", null);
566
664
  }
@@ -623,13 +721,18 @@ const ReceiptSlashIconSVG = () => /*#__PURE__*/React__default.createElement("svg
623
721
  y2: "21"
624
722
  }));
625
723
  const BillSumary = _ref => {
626
- let billAccountDetails = _ref.billAccountDetails,
627
- total = _ref.total,
628
- arrears = _ref.arrears;
629
- const _useTranslation = reactI18next.useTranslation(),
630
- t = _useTranslation.t;
631
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
632
- ModuleWorkflow = _Digit$Hooks$useQuery.workflow;
724
+ let {
725
+ billAccountDetails,
726
+ total,
727
+ businessService,
728
+ arrears
729
+ } = _ref;
730
+ const {
731
+ t
732
+ } = reactI18next.useTranslation();
733
+ const {
734
+ workflow: ModuleWorkflow
735
+ } = Digit.Hooks.useQueryParams();
633
736
  React.useEffect(() => {
634
737
  ModuleWorkflow === "mcollect" && billAccountDetails && billAccountDetails.map(ob => {
635
738
  if (ob.taxHeadCode.includes("CGST")) ob.order = 3;else if (ob.taxHeadCode.includes("SGST")) ob.order = 4;
@@ -748,33 +851,30 @@ function _catch(body, recover) {
748
851
  }
749
852
 
750
853
  const TimerServices = _ref => {
751
- let businessService = _ref.businessService,
752
- t = _ref.t,
753
- _ref$SlotSearchData = _ref.SlotSearchData,
754
- SlotSearchData = _ref$SlotSearchData === void 0 ? "" : _ref$SlotSearchData,
755
- setTime = _ref.setTime;
756
- const _useState = React.useState(0),
757
- timeRemaining = _useState[0],
758
- setTimeRemaining = _useState[1];
759
- const _useState2 = React.useState(null),
760
- showToast = _useState2[0],
761
- setShowToast = _useState2[1];
762
- const _useState3 = React.useState(false),
763
- hasFetched = _useState3[0],
764
- setHasFetched = _useState3[1];
765
- const _Digit$Hooks$chb$useC = Digit.Hooks.chb.useChbSlotSearch({
766
- tenantId: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.tenantId,
767
- filters: {
768
- bookingId: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingId,
769
- communityHallCode: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.communityHallCode,
770
- bookingStartDate: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingStartDate,
771
- bookingEndDate: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingEndDate,
772
- hallCode: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.hallCode,
773
- isTimerRequired: true
774
- },
775
- enabled: false
776
- }),
777
- refetch = _Digit$Hooks$chb$useC.refetch;
854
+ let {
855
+ businessService,
856
+ t,
857
+ timerValues,
858
+ SlotSearchData = "",
859
+ setTime
860
+ } = _ref;
861
+ const [timeRemaining, setTimeRemaining] = React.useState(0);
862
+ const [showToast, setShowToast] = React.useState(null);
863
+ const [hasFetched, setHasFetched] = React.useState(false);
864
+ const {
865
+ refetch
866
+ } = Digit.Hooks.chb.useChbSlotSearch({
867
+ tenantId: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.tenantId,
868
+ filters: {
869
+ bookingId: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingId,
870
+ communityHallCode: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.communityHallCode,
871
+ bookingStartDate: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingStartDate,
872
+ bookingEndDate: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.bookingEndDate,
873
+ hallCode: SlotSearchData === null || SlotSearchData === void 0 ? void 0 : SlotSearchData.hallCode,
874
+ isTimerRequired: true
875
+ },
876
+ enabled: false
877
+ });
778
878
  const slotSearchData = Digit.Hooks.ads.useADSSlotSearch();
779
879
  React.useEffect(() => {
780
880
  const fetchSlotData = function () {
@@ -870,7 +970,7 @@ const TimerServices = _ref => {
870
970
  const formatTime = seconds => {
871
971
  const minutes = Math.floor(seconds / 60);
872
972
  const remainingSeconds = seconds % 60;
873
- return minutes + ":" + (remainingSeconds < 10 ? '0' : '') + remainingSeconds;
973
+ return `${minutes}:${remainingSeconds < 10 ? '0' : ''}${remainingSeconds}`;
874
974
  };
875
975
  return /*#__PURE__*/React__default.createElement("div", null, t("CS_TIME_REMAINING"), ": ", /*#__PURE__*/React__default.createElement("span", {
876
976
  className: "astericColor"
@@ -886,40 +986,44 @@ const TimerServices = _ref => {
886
986
 
887
987
  const BillDetails = _ref => {
888
988
  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;
889
- let paymentRules = _ref.paymentRules,
890
- businessService = _ref.businessService;
891
- const _useTranslation = reactI18next.useTranslation(),
892
- t = _useTranslation.t;
989
+ let {
990
+ paymentRules,
991
+ businessService
992
+ } = _ref;
993
+ const {
994
+ t
995
+ } = reactI18next.useTranslation();
893
996
  const history = reactRouterDom.useHistory();
894
- const _useLocation = reactRouterDom.useLocation(),
895
- state = _useLocation.state,
896
- pathname = _useLocation.pathname,
897
- search = _useLocation.search;
997
+ const {
998
+ state,
999
+ pathname,
1000
+ search
1001
+ } = reactRouterDom.useLocation();
898
1002
  const userInfo = Digit.UserService.getUser();
899
- let _useParams = reactRouterDom.useParams(),
900
- consumerCode = _useParams.consumerCode;
901
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
902
- wrkflow = _Digit$Hooks$useQuery.workflow,
903
- _tenantId = _Digit$Hooks$useQuery.tenantId,
904
- authorization = _Digit$Hooks$useQuery.authorization,
905
- ConsumerName = _Digit$Hooks$useQuery.ConsumerName;
906
- const _useState = React.useState(state === null || state === void 0 ? void 0 : state.bill),
907
- bill = _useState[0],
908
- setBill = _useState[1];
1003
+ let {
1004
+ consumerCode
1005
+ } = reactRouterDom.useParams();
1006
+ const {
1007
+ workflow: wrkflow,
1008
+ tenantId: _tenantId,
1009
+ authorization,
1010
+ ConsumerName
1011
+ } = Digit.Hooks.useQueryParams();
1012
+ const [bill, setBill] = React.useState(state === null || state === void 0 ? void 0 : state.bill);
909
1013
  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);
910
1014
  const propertyId = state === null || state === void 0 ? void 0 : state.propertyId;
911
- const _useState2 = React.useState(0),
912
- setTime = _useState2[1];
1015
+ const [Time, setTime] = React.useState(0);
913
1016
  if (wrkflow === "WNS" && consumerCode.includes("?")) consumerCode = consumerCode.substring(0, consumerCode.indexOf("?"));
914
- const _ref2 = state !== null && state !== void 0 && state.bill ? {
915
- isLoading: false
916
- } : Digit.Hooks.useFetchPayment({
917
- tenantId,
918
- businessService,
919
- consumerCode: wrkflow === "WNS" ? stringReplaceAll(consumerCode, "+", "/") : consumerCode
920
- }),
921
- data = _ref2.data,
922
- isLoading = _ref2.isLoading;
1017
+ const {
1018
+ data,
1019
+ isLoading
1020
+ } = state !== null && state !== void 0 && state.bill ? {
1021
+ isLoading: false
1022
+ } : Digit.Hooks.useFetchPayment({
1023
+ tenantId,
1024
+ businessService,
1025
+ consumerCode: wrkflow === "WNS" ? stringReplaceAll(consumerCode, "+", "/") : consumerCode
1026
+ });
923
1027
  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) || "";
924
1028
  let requestCriteria = ["/user/_search", {}, {
925
1029
  data: {
@@ -932,27 +1036,40 @@ const BillDetails = _ref => {
932
1036
  enabled: Useruuid ? true : false,
933
1037
  cacheTime: 100
934
1038
  }];
935
- const _Digit$Hooks$useCusto = Digit.Hooks.useCustomAPIHook(...requestCriteria),
936
- userData = _Digit$Hooks$useCusto.data;
937
- const _Digit$Hooks$fsm$useA = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, consumerCode, {
938
- enabled: pathname.includes("FSM") ? true : false
939
- }, "CITIZEN"),
940
- isFSMLoading = _Digit$Hooks$fsm$useA.isLoading,
941
- application = _Digit$Hooks$fsm$useA.data;
942
- let minAmountPayable = paymentRules.minAmountPayable,
943
- isAdvanceAllowed = paymentRules.isAdvanceAllowed;
1039
+ const {
1040
+ isLoading: isUserLoading,
1041
+ data: userData,
1042
+ revalidate
1043
+ } = Digit.Hooks.useCustomAPIHook(...requestCriteria);
1044
+ const {
1045
+ isLoading: isFSMLoading,
1046
+ isError,
1047
+ error,
1048
+ data: application,
1049
+ error: errorApplication
1050
+ } = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, consumerCode, {
1051
+ enabled: pathname.includes("FSM") ? true : false
1052
+ }, "CITIZEN");
1053
+ let {
1054
+ minAmountPayable,
1055
+ isAdvanceAllowed
1056
+ } = paymentRules;
944
1057
  minAmountPayable = wrkflow === "WNS" ? 100 : minAmountPayable;
945
1058
  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]) || [];
946
1059
  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;
947
- const _Digit$Hooks$useAppli = Digit.Hooks.useApplicationsForBusinessServiceSearch({
948
- businessService
949
- }, {
950
- enabled: false
951
- }),
952
- label = _Digit$Hooks$useAppli.label;
1060
+ const {
1061
+ key,
1062
+ label
1063
+ } = Digit.Hooks.useApplicationsForBusinessServiceSearch({
1064
+ businessService
1065
+ }, {
1066
+ enabled: false
1067
+ });
953
1068
  const getBillingPeriod = () => {
954
- const fromPeriod = billDetails.fromPeriod,
955
- toPeriod = billDetails.toPeriod;
1069
+ const {
1070
+ fromPeriod,
1071
+ toPeriod
1072
+ } = billDetails;
956
1073
  if (fromPeriod && toPeriod) {
957
1074
  let from, to;
958
1075
  if (wrkflow === "mcollect" || wrkflow === "WNS") {
@@ -984,23 +1101,15 @@ const BillDetails = _ref => {
984
1101
  var _application$pdfData;
985
1102
  return application === null || application === void 0 ? void 0 : (_application$pdfData = application.pdfData) === null || _application$pdfData === void 0 ? void 0 : _application$pdfData.advanceAmount;
986
1103
  };
987
- const _useState3 = React.useState(t("CS_PAYMENT_FULL_AMOUNT")),
988
- paymentType = _useState3[0],
989
- setPaymentType = _useState3[1];
990
- const _useState4 = React.useState(getTotal()),
991
- amount = _useState4[0],
992
- setAmount = _useState4[1];
993
- const _useState5 = React.useState(true),
994
- paymentAllowed = _useState5[0],
995
- setPaymentAllowed = _useState5[1];
996
- const _useState6 = React.useState(""),
997
- formError = _useState6[0],
998
- setError = _useState6[1];
1104
+ const [paymentType, setPaymentType] = React.useState(t("CS_PAYMENT_FULL_AMOUNT"));
1105
+ const [amount, setAmount] = React.useState(getTotal());
1106
+ const [paymentAllowed, setPaymentAllowed] = React.useState(true);
1107
+ const [formError, setError] = React.useState("");
999
1108
  const kc = window.keycloak;
1000
1109
  if (authorization === "true" && !(kc !== null && kc !== void 0 && kc.authenticated)) {
1001
1110
  localStorage.clear();
1002
1111
  sessionStorage.clear();
1003
- window.location.href = "/digit-ui/citizen/login?from=" + encodeURIComponent(pathname + search);
1112
+ window.location.href = `/digit-ui/citizen/login?from=${encodeURIComponent(pathname + search)}`;
1004
1113
  }
1005
1114
  React.useEffect(() => {
1006
1115
  window.scroll({
@@ -1034,13 +1143,13 @@ const BillDetails = _ref => {
1034
1143
  var _application$pdfData4, _application$pdfData5;
1035
1144
  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;
1036
1145
  if (window.location.href.includes("mcollect")) {
1037
- history.push("/digit-ui/citizen/payment/collect/" + businessService + "/" + consumerCode + "?workflow=mcollect", {
1146
+ history.push(`/digit-ui/citizen/payment/collect/${businessService}/${consumerCode}?workflow=mcollect`, {
1038
1147
  paymentAmount,
1039
1148
  tenantId: billDetails.tenantId
1040
1149
  });
1041
1150
  } else if (wrkflow === "WNS") {
1042
1151
  var _bill$mobileNumber, _userData$user, _userData$user$;
1043
- history.push("/digit-ui/citizen/payment/billDetails/" + businessService + "/" + consumerCode + "/" + paymentAmount + "?workflow=WNS&ConsumerName=" + ConsumerName, {
1152
+ history.push(`/digit-ui/citizen/payment/billDetails/${businessService}/${consumerCode}/${paymentAmount}?workflow=WNS&ConsumerName=${ConsumerName}`, {
1044
1153
  paymentAmount,
1045
1154
  tenantId: billDetails.tenantId,
1046
1155
  name: bill.payerName,
@@ -1048,14 +1157,14 @@ const BillDetails = _ref => {
1048
1157
  });
1049
1158
  } else if (businessService === "PT") {
1050
1159
  var _bill$mobileNumber2, _userData$user2, _userData$user2$;
1051
- history.push("/digit-ui/citizen/payment/billDetails/" + businessService + "/" + consumerCode + "/" + paymentAmount, {
1160
+ history.push(`/digit-ui/citizen/payment/billDetails/${businessService}/${consumerCode}/${paymentAmount}`, {
1052
1161
  paymentAmount,
1053
1162
  tenantId: billDetails.tenantId,
1054
1163
  name: bill.payerName,
1055
1164
  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
1056
1165
  });
1057
1166
  } else if (timerEnabledForBusinessService(businessService)) {
1058
- history.push("/digit-ui/citizen/payment/collect/" + businessService + "/" + consumerCode, {
1167
+ history.push(`/digit-ui/citizen/payment/collect/${businessService}/${consumerCode}`, {
1059
1168
  paymentAmount,
1060
1169
  tenantId: billDetails.tenantId,
1061
1170
  propertyId: propertyId,
@@ -1063,7 +1172,7 @@ const BillDetails = _ref => {
1063
1172
  SlotSearchData: state === null || state === void 0 ? void 0 : state.SlotSearchData
1064
1173
  });
1065
1174
  } else {
1066
- history.push("/digit-ui/citizen/payment/collect/" + businessService + "/" + consumerCode, {
1175
+ history.push(`/digit-ui/citizen/payment/collect/${businessService}/${consumerCode}`, {
1067
1176
  paymentAmount,
1068
1177
  tenantId: billDetails.tenantId,
1069
1178
  propertyId: propertyId
@@ -1138,7 +1247,8 @@ const BillDetails = _ref => {
1138
1247
  businessService: businessService,
1139
1248
  arrears: Arrears
1140
1249
  }), /*#__PURE__*/React__default.createElement(ArrearSummary, {
1141
- bill: bill
1250
+ bill: bill,
1251
+ businessService: businessService
1142
1252
  })), /*#__PURE__*/React__default.createElement("div", {
1143
1253
  className: "bill-payment-amount"
1144
1254
  }, /*#__PURE__*/React__default.createElement("hr", {
@@ -1156,7 +1266,7 @@ const BillDetails = _ref => {
1156
1266
  }, /*#__PURE__*/React__default.createElement("span", {
1157
1267
  className: "payment-amount-front",
1158
1268
  style: {
1159
- border: "1px solid " + (paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? "#9a9a9a" : "#9a9a9a")
1269
+ border: `1px solid ${paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? "#9a9a9a" : "#9a9a9a"}`
1160
1270
  }
1161
1271
  }, "\u20B9"), paymentType !== t("CS_PAYMENT_FULL_AMOUNT") ? businessService === "FSM.TRIP_CHARGES" ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
1162
1272
  className: "text-indent-xl",
@@ -1194,17 +1304,19 @@ const BillDetails = _ref => {
1194
1304
  })))));
1195
1305
  };
1196
1306
 
1197
- const _excluded$1 = ["url"];
1198
1307
  const BillRoutes = _ref => {
1199
- let billsList = _ref.billsList,
1200
- paymentRules = _ref.paymentRules,
1201
- businessService = _ref.businessService;
1202
- const _useRouteMatch = reactRouterDom.useRouteMatch(),
1203
- currentPath = _useRouteMatch.url,
1204
- match = _objectWithoutPropertiesLoose(_useRouteMatch, _excluded$1);
1308
+ let {
1309
+ billsList,
1310
+ paymentRules,
1311
+ businessService
1312
+ } = _ref;
1313
+ const {
1314
+ url: currentPath,
1315
+ ...match
1316
+ } = reactRouterDom.useRouteMatch();
1205
1317
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
1206
1318
  exact: true,
1207
- path: "" + currentPath,
1319
+ path: `${currentPath}`,
1208
1320
  component: () => /*#__PURE__*/React__default.createElement(BillList, {
1209
1321
  billsList,
1210
1322
  currentPath,
@@ -1212,7 +1324,7 @@ const BillRoutes = _ref => {
1212
1324
  businessService
1213
1325
  })
1214
1326
  }), /*#__PURE__*/React__default.createElement(reactRouterDom.Route, {
1215
- path: currentPath + "/:consumerCode",
1327
+ path: `${currentPath}/:consumerCode`,
1216
1328
  component: () => /*#__PURE__*/React__default.createElement(BillDetails, {
1217
1329
  paymentRules,
1218
1330
  businessService
@@ -1221,41 +1333,49 @@ const BillRoutes = _ref => {
1221
1333
  };
1222
1334
 
1223
1335
  const MyBills = _ref => {
1224
- var _Digit$UserService$ge, _location$state, _location$state2;
1225
- let stateCode = _ref.stateCode;
1226
- const _useParams = reactRouterDom.useParams(),
1227
- businessService = _useParams.businessService;
1228
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
1229
- _tenantId = _Digit$Hooks$useQuery.tenantId,
1230
- isDisoconnectFlow = _Digit$Hooks$useQuery.isDisoconnectFlow;
1231
- const _Digit$Services$useSt = Digit.Services.useStore({
1232
- stateCode,
1233
- moduleCode: businessService,
1234
- language: Digit.StoreData.getCurrentLanguage()
1235
- });
1336
+ var _Digit$UserService$ge, _Digit$UserService$ge2, _location$state, _location$state2, _location$state3;
1337
+ let {
1338
+ stateCode
1339
+ } = _ref;
1340
+ const {
1341
+ businessService
1342
+ } = reactRouterDom.useParams();
1343
+ const {
1344
+ tenantId: _tenantId,
1345
+ isDisoconnectFlow
1346
+ } = Digit.Hooks.useQueryParams();
1347
+ const {
1348
+ isLoading: storeLoading,
1349
+ data: store
1350
+ } = Digit.Services.useStore({
1351
+ stateCode,
1352
+ moduleCode: businessService,
1353
+ language: Digit.StoreData.getCurrentLanguage()
1354
+ });
1236
1355
  const history = reactRouterDom.useHistory();
1237
- const _useRouteMatch = reactRouterDom.useRouteMatch(),
1238
- url = _useRouteMatch.url;
1356
+ const {
1357
+ url
1358
+ } = reactRouterDom.useRouteMatch();
1239
1359
  const location = reactRouterDom.useLocation();
1240
- 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) || {
1241
- tenantId: _tenantId
1242
- } || {},
1243
- tenantId = _ref2.tenantId;
1244
- if (!tenantId && !(location !== null && location !== void 0 && (_location$state = location.state) !== null && _location$state !== void 0 && _location$state.fromSearchResults)) {
1245
- history.replace("/digit-ui/citizen/login", {
1360
+ 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;
1361
+ if (!tenantId && !(location !== null && location !== void 0 && (_location$state2 = location.state) !== null && _location$state2 !== void 0 && _location$state2.fromSearchResults)) {
1362
+ history.replace(`/digit-ui/citizen/login`, {
1246
1363
  from: url
1247
1364
  });
1248
1365
  }
1249
- const _Digit$Hooks$useFetch = Digit.Hooks.useFetchCitizenBillsForBuissnessService({
1250
- businessService
1251
- }, {
1252
- refetchOnMount: true,
1253
- enabled: !(location !== null && location !== void 0 && (_location$state2 = location.state) !== null && _location$state2 !== void 0 && _location$state2.fromSearchResults)
1254
- }),
1255
- data = _Digit$Hooks$useFetch.data;
1256
- const _Digit$Hooks$useGetPa = Digit.Hooks.useGetPaymentRulesForBusinessServices(tenantId),
1257
- mdmsLoading = _Digit$Hooks$useGetPa.isLoading,
1258
- mdmsBillingData = _Digit$Hooks$useGetPa.data;
1366
+ const {
1367
+ isLoading,
1368
+ data
1369
+ } = Digit.Hooks.useFetchCitizenBillsForBuissnessService({
1370
+ businessService
1371
+ }, {
1372
+ refetchOnMount: true,
1373
+ enabled: !(location !== null && location !== void 0 && (_location$state3 = location.state) !== null && _location$state3 !== void 0 && _location$state3.fromSearchResults)
1374
+ });
1375
+ const {
1376
+ isLoading: mdmsLoading,
1377
+ data: mdmsBillingData
1378
+ } = Digit.Hooks.useGetPaymentRulesForBusinessServices(tenantId);
1259
1379
  const billsList = (data === null || data === void 0 ? void 0 : data.Bill) || [];
1260
1380
  const getPaymentRestrictionDetails = () => {
1261
1381
  var _mdmsBillingData$Mdms, _mdmsBillingData$Mdms2, _payRestrictiondetail;
@@ -1300,47 +1420,50 @@ const makePayment = function (url, data) {
1300
1420
 
1301
1421
  const SelectPaymentType$1 = props => {
1302
1422
  var _paymentdetails$Bill;
1303
- const _useLocation = reactRouterDom.useLocation(),
1304
- _useLocation$state = _useLocation.state,
1305
- state = _useLocation$state === void 0 ? {} : _useLocation$state;
1423
+ const {
1424
+ state = {}
1425
+ } = reactRouterDom.useLocation();
1306
1426
  const userInfo = Digit.UserService.getUser();
1307
- const _useState = React.useState(null),
1308
- showToast = _useState[0],
1309
- setShowToast = _useState[1];
1310
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
1311
- __tenantId = _Digit$Hooks$useQuery.tenantId,
1312
- authorization = _Digit$Hooks$useQuery.authorization,
1313
- wrkflow = _Digit$Hooks$useQuery.workflow,
1314
- connectionNo = _Digit$Hooks$useQuery.consumerCode;
1427
+ const [showToast, setShowToast] = React.useState(null);
1428
+ const {
1429
+ tenantId: __tenantId,
1430
+ authorization,
1431
+ workflow: wrkflow,
1432
+ consumerCode: connectionNo
1433
+ } = Digit.Hooks.useQueryParams();
1315
1434
  const paymentAmount = state === null || state === void 0 ? void 0 : state.paymentAmount;
1316
- const _useTranslation = reactI18next.useTranslation(),
1317
- t = _useTranslation.t;
1435
+ const {
1436
+ t
1437
+ } = reactI18next.useTranslation();
1318
1438
  const history = reactRouterDom.useHistory();
1319
- const _useLocation2 = reactRouterDom.useLocation(),
1320
- pathname = _useLocation2.pathname,
1321
- search = _useLocation2.search;
1322
- let _useParams = reactRouterDom.useParams(),
1323
- consumerCode = _useParams.consumerCode,
1324
- businessService = _useParams.businessService;
1439
+ const {
1440
+ pathname,
1441
+ search
1442
+ } = reactRouterDom.useLocation();
1443
+ let {
1444
+ consumerCode,
1445
+ businessService
1446
+ } = reactRouterDom.useParams();
1325
1447
  const tenantId = (state === null || state === void 0 ? void 0 : state.tenantId) || __tenantId || Digit.ULBService.getCurrentTenantId();
1326
1448
  const kc = window.keycloak;
1327
1449
  const stateTenant = Digit.ULBService.getStateId();
1328
- const _useForm = reactHookForm.useForm(),
1329
- control = _useForm.control,
1330
- handleSubmit = _useForm.handleSubmit;
1331
- const _useState2 = React.useState(0),
1332
- Time = _useState2[0],
1333
- setTime = _useState2[1];
1334
- const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(stateTenant, "DIGIT-UI", "PaymentGateway"),
1335
- menu = _Digit$Hooks$useCommo.data,
1336
- isLoading = _Digit$Hooks$useCommo.isLoading;
1337
- const _Digit$Hooks$useFetch = Digit.Hooks.useFetchPayment({
1338
- tenantId: tenantId,
1339
- consumerCode: wrkflow === "WNS" ? connectionNo : consumerCode,
1340
- businessService
1341
- }, {}),
1342
- paymentdetails = _Digit$Hooks$useFetch.data,
1343
- paymentLoading = _Digit$Hooks$useFetch.isLoading;
1450
+ const {
1451
+ control,
1452
+ handleSubmit
1453
+ } = reactHookForm.useForm();
1454
+ const [Time, setTime] = React.useState(0);
1455
+ const {
1456
+ data: menu,
1457
+ isLoading
1458
+ } = Digit.Hooks.useCommonMDMS(stateTenant, "DIGIT-UI", "PaymentGateway");
1459
+ const {
1460
+ data: paymentdetails,
1461
+ isLoading: paymentLoading
1462
+ } = Digit.Hooks.useFetchPayment({
1463
+ tenantId: tenantId,
1464
+ consumerCode: wrkflow === "WNS" ? connectionNo : consumerCode,
1465
+ businessService
1466
+ }, {});
1344
1467
  if (window.location.href.includes("ISWSCON") || wrkflow === "WNS") consumerCode = decodeURIComponent(consumerCode);
1345
1468
  if (wrkflow === "WNS") consumerCode = stringReplaceAll(consumerCode, "+", "/");
1346
1469
  React.useEffect(() => {
@@ -1354,8 +1477,10 @@ const SelectPaymentType$1 = props => {
1354
1477
  React.useEffect(() => {
1355
1478
  localStorage.setItem("BillPaymentEnabled", "true");
1356
1479
  }, []);
1357
- const name = state.name,
1358
- mobileNumber = state.mobileNumber;
1480
+ const {
1481
+ name,
1482
+ mobileNumber
1483
+ } = state;
1359
1484
  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] : {};
1360
1485
  const onSubmit = function (d) {
1361
1486
  try {
@@ -1381,7 +1506,7 @@ const SelectPaymentType$1 = props => {
1381
1506
  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),
1382
1507
  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)
1383
1508
  },
1384
- 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),
1509
+ 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)}`,
1385
1510
  additionalDetails: {
1386
1511
  isWhatsapp: false
1387
1512
  }
@@ -1418,7 +1543,7 @@ const SelectPaymentType$1 = props => {
1418
1543
  target: "_top"
1419
1544
  });
1420
1545
  const orderForNDSLPaymentSite = ["checksum", "messageType", "merchantId", "serviceId", "orderId", "customerId", "transactionAmount", "currencyCode", "requestDateTime", "successUrl", "failUrl", "additionalField1", "additionalField2", "additionalField3", "additionalField4", "additionalField5"];
1421
- gatewayParam["requestDateTime"] = (_gatewayParam$request = gatewayParam["requestDateTime"]) === null || _gatewayParam$request === void 0 ? void 0 : _gatewayParam$request.split(new Date().getFullYear()).join(new Date().getFullYear() + " ");
1546
+ gatewayParam["requestDateTime"] = (_gatewayParam$request = gatewayParam["requestDateTime"]) === null || _gatewayParam$request === void 0 ? void 0 : _gatewayParam$request.split(new Date().getFullYear()).join(`${new Date().getFullYear()} `);
1422
1547
  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);
1423
1548
  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);
1424
1549
  for (var key of orderForNDSLPaymentSite) {
@@ -1440,9 +1565,10 @@ const SelectPaymentType$1 = props => {
1440
1565
  let messageToShow = "CS_PAYMENT_UNKNOWN_ERROR_ON_SERVER";
1441
1566
  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]) {
1442
1567
  var _error$response2, _error$response2$data, _error$response2$data2;
1443
- 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],
1444
- code = _error$response$data$2.code,
1445
- message = _error$response$data$2.message;
1568
+ const {
1569
+ code,
1570
+ message
1571
+ } = (_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];
1446
1572
  messageToShow = code;
1447
1573
  }
1448
1574
  setShowToast({
@@ -1458,7 +1584,7 @@ const SelectPaymentType$1 = props => {
1458
1584
  if (authorization === "true" && !kc.authenticated) {
1459
1585
  localStorage.clear();
1460
1586
  sessionStorage.clear();
1461
- window.location.href = "/digit-ui/citizen/login?from=" + encodeURIComponent(pathname + search);
1587
+ window.location.href = `/digit-ui/citizen/login?from=${encodeURIComponent(pathname + search)}`;
1462
1588
  }
1463
1589
  if (isLoading || paymentLoading) {
1464
1590
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
@@ -1524,86 +1650,94 @@ const convertEpochToDate = dateEpoch => {
1524
1650
  let year = dateFromApi.getFullYear();
1525
1651
  month = (month > 9 ? "" : "0") + month;
1526
1652
  day = (day > 9 ? "" : "0") + day;
1527
- return day + "/" + month + "/" + year;
1653
+ return `${day}/${month}/${year}`;
1528
1654
  } else {
1529
1655
  return "NA";
1530
1656
  }
1531
1657
  };
1532
1658
  const WrapPaymentComponent = props => {
1533
1659
  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;
1534
- const _useTranslation = reactI18next.useTranslation(),
1535
- t = _useTranslation.t;
1660
+ const {
1661
+ t
1662
+ } = reactI18next.useTranslation();
1536
1663
  const queryClient = reactQuery.useQueryClient();
1537
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
1538
- egId = _Digit$Hooks$useQuery.eg_pg_txnid,
1539
- workflw = _Digit$Hooks$useQuery.workflow;
1540
- const _useState = React.useState(false),
1541
- printing = _useState[0],
1542
- setPrinting = _useState[1];
1543
- const _useState2 = React.useState(false),
1544
- allowFetchBill = _useState2[0],
1545
- setallowFetchBill = _useState2[1];
1546
- const _useParams = reactRouterDom.useParams(),
1547
- business_service = _useParams.businessService,
1548
- consumerCode = _useParams.consumerCode,
1549
- tenantId = _useParams.tenantId;
1550
- const _Digit$Hooks$obps$use = Digit.Hooks.obps.useOBPSSearch("", {}, tenantId, {
1551
- applicationNo: consumerCode
1552
- }, {}, {
1553
- enabled: window.location.href.includes("bpa") || window.location.href.includes("BPA")
1554
- }),
1555
- _Digit$Hooks$obps$use2 = _Digit$Hooks$obps$use.data,
1556
- bpaData = _Digit$Hooks$obps$use2 === void 0 ? {} : _Digit$Hooks$obps$use2,
1557
- isBpaSearchLoading = _Digit$Hooks$obps$use.isLoading;
1558
- const _Digit$Hooks$usePayme = Digit.Hooks.usePaymentUpdate({
1559
- egId,
1560
- tenantId
1561
- }, business_service, {
1562
- retry: false,
1563
- staleTime: Infinity,
1564
- refetchOnWindowFocus: false
1565
- }),
1566
- isLoading = _Digit$Hooks$usePayme.isLoading,
1567
- data = _Digit$Hooks$usePayme.data,
1568
- isError = _Digit$Hooks$usePayme.isError;
1664
+ const {
1665
+ eg_pg_txnid: egId,
1666
+ workflow: workflw,
1667
+ propertyId
1668
+ } = Digit.Hooks.useQueryParams();
1669
+ const [printing, setPrinting] = React.useState(false);
1670
+ const [allowFetchBill, setallowFetchBill] = React.useState(false);
1671
+ const {
1672
+ businessService: business_service,
1673
+ consumerCode,
1674
+ tenantId
1675
+ } = reactRouterDom.useParams();
1676
+ const {
1677
+ data: bpaData = {},
1678
+ isLoading: isBpaSearchLoading,
1679
+ isSuccess: isBpaSuccess,
1680
+ error: bpaerror
1681
+ } = Digit.Hooks.obps.useOBPSSearch("", {}, tenantId, {
1682
+ applicationNo: consumerCode
1683
+ }, {}, {
1684
+ enabled: window.location.href.includes("bpa") || window.location.href.includes("BPA")
1685
+ });
1686
+ const {
1687
+ isLoading,
1688
+ data,
1689
+ isError
1690
+ } = Digit.Hooks.usePaymentUpdate({
1691
+ egId,
1692
+ tenantId
1693
+ }, business_service, {
1694
+ retry: false,
1695
+ staleTime: Infinity,
1696
+ refetchOnWindowFocus: false
1697
+ });
1569
1698
  console.log("datatatataty", data);
1570
- const _Digit$Hooks$useAppli = Digit.Hooks.useApplicationsForBusinessServiceSearch({
1571
- businessService: business_service
1572
- }, {
1573
- enabled: false
1574
- }),
1575
- label = _Digit$Hooks$useAppli.label;
1699
+ const {
1700
+ label
1701
+ } = Digit.Hooks.useApplicationsForBusinessServiceSearch({
1702
+ businessService: business_service
1703
+ }, {
1704
+ enabled: false
1705
+ });
1576
1706
  const mutation = Digit.Hooks.chb.useChbCreateAPI(tenantId, false);
1577
1707
  const AdvertisementCreateApi = Digit.Hooks.ads.useADSCreateAPI(tenantId, false);
1578
1708
  const newTenantId = business_service.includes("WS.ONE_TIME_FEE" ) ? Digit.ULBService.getStateId() : tenantId;
1579
- const _Digit$Hooks$useRecie = Digit.Hooks.useRecieptSearch({
1580
- tenantId,
1581
- businessService: business_service,
1582
- 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
1583
- }, {
1584
- retry: false,
1585
- staleTime: Infinity,
1586
- refetchOnWindowFocus: false,
1587
- select: dat => {
1588
- return dat.Payments[0];
1589
- },
1590
- enabled: allowFetchBill
1591
- }),
1592
- reciept_data = _Digit$Hooks$useRecie.data,
1593
- recieptDataLoading = _Digit$Hooks$useRecie.isLoading;
1594
- const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(newTenantId, "common-masters", "ReceiptKey", {
1595
- select: data => {
1596
- var _data$commonMasters, _data$commonMasters$u, _data$commonMasters$u2;
1597
- 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 => {
1598
- let code = _ref.code;
1599
- return business_service === null || business_service === void 0 ? void 0 : business_service.includes(code);
1600
- })[0]) === null || _data$commonMasters$u2 === void 0 ? void 0 : _data$commonMasters$u2.receiptKey) || "consolidatedreceipt";
1601
- },
1602
- retry: false,
1603
- staleTime: Infinity,
1604
- refetchOnWindowFocus: false
1605
- }),
1606
- generatePdfKey = _Digit$Hooks$useCommo.data;
1709
+ const {
1710
+ data: reciept_data,
1711
+ isLoading: recieptDataLoading
1712
+ } = Digit.Hooks.useRecieptSearch({
1713
+ tenantId,
1714
+ businessService: business_service,
1715
+ 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
1716
+ }, {
1717
+ retry: false,
1718
+ staleTime: Infinity,
1719
+ refetchOnWindowFocus: false,
1720
+ select: dat => {
1721
+ return dat.Payments[0];
1722
+ },
1723
+ enabled: allowFetchBill
1724
+ });
1725
+ const {
1726
+ data: generatePdfKey
1727
+ } = Digit.Hooks.useCommonMDMS(newTenantId, "common-masters", "ReceiptKey", {
1728
+ select: data => {
1729
+ var _data$commonMasters, _data$commonMasters$u, _data$commonMasters$u2;
1730
+ 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 => {
1731
+ let {
1732
+ code
1733
+ } = _ref;
1734
+ return business_service === null || business_service === void 0 ? void 0 : business_service.includes(code);
1735
+ })[0]) === null || _data$commonMasters$u2 === void 0 ? void 0 : _data$commonMasters$u2.receiptKey) || "consolidatedreceipt";
1736
+ },
1737
+ retry: false,
1738
+ staleTime: Infinity,
1739
+ refetchOnWindowFocus: false
1740
+ });
1607
1741
  const payments = data === null || data === void 0 ? void 0 : data.payments;
1608
1742
  React.useEffect(() => {
1609
1743
  return () => {
@@ -1628,11 +1762,11 @@ const WrapPaymentComponent = props => {
1628
1762
  applicationNumber: egId,
1629
1763
  successful: false
1630
1764
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardText, null, t("CS_PAYMENT_FAILURE_MESSAGE")), !(business_service !== null && business_service !== void 0 && business_service.includes("PT")) ? /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
1631
- to: "/digit-ui/citizen"
1765
+ to: `/digit-ui/citizen`
1632
1766
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
1633
1767
  label: t("CORE_COMMON_GO_TO_HOME")
1634
1768
  })) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
1635
- to: applicationNo && "/digit-ui/citizen/payment/my-bills/" + business_service + "/" + applicationNo || "/digit-ui/citizen"
1769
+ to: applicationNo && `/digit-ui/citizen/payment/my-bills/${business_service}/${applicationNo}` || "/digit-ui/citizen"
1636
1770
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
1637
1771
  label: t("CS_PAYMENT_TRY_AGAIN")
1638
1772
  })), /*#__PURE__*/React__default.createElement("div", {
@@ -1645,7 +1779,7 @@ const WrapPaymentComponent = props => {
1645
1779
  marginTop: "8px"
1646
1780
  }
1647
1781
  }, /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
1648
- to: "/digit-ui/citizen"
1782
+ to: `/digit-ui/citizen`
1649
1783
  }, t("CORE_COMMON_GO_TO_HOME")))));
1650
1784
  }
1651
1785
  const paymentData = data === null || data === void 0 ? void 0 : (_data$payments2 = data.payments) === null || _data$payments2 === void 0 ? void 0 : _data$payments2.Payments[0];
@@ -1743,9 +1877,10 @@ const WrapPaymentComponent = props => {
1743
1877
  let details;
1744
1878
  let businessServ = payments.Payments[0].paymentDetails[0].businessService;
1745
1879
  if (payments.Payments[0].paymentDetails[0].businessService == "BPAREG") {
1746
- details = _extends({}, payments.Payments[0].additionalDetails, {
1880
+ details = {
1881
+ ...payments.Payments[0].additionalDetails,
1747
1882
  "stakeholderType": "Application"
1748
- });
1883
+ };
1749
1884
  }
1750
1885
  payments.Payments[0].additionalDetails = details;
1751
1886
  paymentArray[0] = payments.Payments[0];
@@ -1753,13 +1888,17 @@ const WrapPaymentComponent = props => {
1753
1888
  const _temp4 = function () {
1754
1889
  if (business_service !== null && business_service !== void 0 && business_service.includes("WS") || business_service !== null && business_service !== void 0 && business_service.includes("SW")) {
1755
1890
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
1756
- Payments: [_extends({}, paymentData)]
1891
+ Payments: [{
1892
+ ...paymentData
1893
+ }]
1757
1894
  }, generatePdfKeyForWs)).then(function (_Digit$PaymentService) {
1758
1895
  response = _Digit$PaymentService;
1759
1896
  const _temp2 = function (_response3, _response3$filestoreI, _response4, _response4$fileStoreI) {
1760
1897
  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])) {
1761
1898
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
1762
- Payments: [_extends({}, paymentData)]
1899
+ Payments: [{
1900
+ ...paymentData
1901
+ }]
1763
1902
  }, generatePdfKey)).then(function (_Digit$PaymentService2) {
1764
1903
  response = _Digit$PaymentService2;
1765
1904
  });
@@ -1777,23 +1916,30 @@ const WrapPaymentComponent = props => {
1777
1916
  return Promise.resolve(Digit.OBPSService.BPASearch(payments.Payments[0].tenantId, queryObj)).then(function (bpaResponse) {
1778
1917
  var _bpaResponse$BPA$, _bpaResponse$BPA$$add, _paymentData$paymentD, _bpaResponse$BPA$2, _bpaResponse$BPA$2$ad;
1779
1918
  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;
1780
- const updatedpayments = _extends({}, paymentData, {
1781
- paymentDetails: [_extends({}, (_paymentData$paymentD = paymentData.paymentDetails) === null || _paymentData$paymentD === void 0 ? void 0 : _paymentData$paymentD[0], {
1782
- additionalDetails: _extends({}, paymentData.paymentDetails[0].additionalDetails, {
1919
+ const updatedpayments = {
1920
+ ...paymentData,
1921
+ paymentDetails: [{
1922
+ ...((_paymentData$paymentD = paymentData.paymentDetails) === null || _paymentData$paymentD === void 0 ? void 0 : _paymentData$paymentD[0]),
1923
+ additionalDetails: {
1924
+ ...paymentData.paymentDetails[0].additionalDetails,
1783
1925
  "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,
1784
1926
  "stakeholderType": formattedStakeholderType.charAt(0).toUpperCase() + formattedStakeholderType.slice(1).toLowerCase()
1785
- })
1786
- })]
1787
- });
1927
+ }
1928
+ }]
1929
+ };
1788
1930
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
1789
- Payments: [_extends({}, updatedpayments)]
1931
+ Payments: [{
1932
+ ...updatedpayments
1933
+ }]
1790
1934
  }, generatePdfKey)).then(function (_Digit$PaymentService3) {
1791
1935
  response = _Digit$PaymentService3;
1792
1936
  });
1793
1937
  });
1794
1938
  } else {
1795
1939
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
1796
- Payments: [_extends({}, paymentData)]
1940
+ Payments: [{
1941
+ ...paymentData
1942
+ }]
1797
1943
  }, generatePdfKey)).then(function (_Digit$PaymentService4) {
1798
1944
  response = _Digit$PaymentService4;
1799
1945
  });
@@ -1877,9 +2023,12 @@ const WrapPaymentComponent = props => {
1877
2023
  edcrData = edcrResponse === null || edcrResponse === void 0 ? void 0 : (_edcrResponse$edcrDet = edcrResponse.edcrDetail) === null || _edcrResponse$edcrDet === void 0 ? void 0 : _edcrResponse$edcrDet[0];
1878
2024
  let currentDate = new Date();
1879
2025
  bpaDataDetails.additionalDetails.runDate = convertDateToEpoch(currentDate.getFullYear() + "-" + (currentDate.getMonth() + 1) + "-" + currentDate.getDate());
1880
- let reqData = _extends({}, bpaDataDetails, {
1881
- edcrDetail: [_extends({}, edcrData)]
1882
- });
2026
+ let reqData = {
2027
+ ...bpaDataDetails,
2028
+ edcrDetail: [{
2029
+ ...edcrData
2030
+ }]
2031
+ };
1883
2032
  console.log("reqData", reqData);
1884
2033
  return Promise.resolve(Digit.PaymentService.generatePdf(bpaDataDetails === null || bpaDataDetails === void 0 ? void 0 : bpaDataDetails.tenantId, {
1885
2034
  Bpa: [reqData]
@@ -1891,7 +2040,9 @@ const WrapPaymentComponent = props => {
1891
2040
  window.open(fileStore[response === null || response === void 0 ? void 0 : response.filestoreIds[0]], "_blank");
1892
2041
  reqData["applicationType"] = bpaDataDetails === null || bpaDataDetails === void 0 ? void 0 : (_bpaDataDetails$addit = bpaDataDetails.additionalDetails) === null || _bpaDataDetails$addit === void 0 ? void 0 : _bpaDataDetails$addit.applicationType;
1893
2042
  return Promise.resolve(Digit.OBPSService.edcr_report_download({
1894
- BPA: _extends({}, reqData)
2043
+ BPA: {
2044
+ ...reqData
2045
+ }
1895
2046
  })).then(function (edcrresponse) {
1896
2047
  const responseStatus = parseInt(edcrresponse.status, 10);
1897
2048
  if (responseStatus === 201 || responseStatus === 200) {
@@ -1899,7 +2050,7 @@ const WrapPaymentComponent = props => {
1899
2050
  type: "application/pdf"
1900
2051
  })) : downloadPdf(new Blob([edcrresponse.data], {
1901
2052
  type: "application/pdf"
1902
- }), "edcrReport.pdf");
2053
+ }), `edcrReport.pdf`);
1903
2054
  }
1904
2055
  });
1905
2056
  });
@@ -1911,11 +2062,12 @@ const WrapPaymentComponent = props => {
1911
2062
  }
1912
2063
  };
1913
2064
  const getBillingPeriod = billDetails => {
1914
- const _ref2 = billDetails || {},
1915
- taxPeriodFrom = _ref2.taxPeriodFrom,
1916
- taxPeriodTo = _ref2.taxPeriodTo,
1917
- fromPeriod = _ref2.fromPeriod,
1918
- toPeriod = _ref2.toPeriod;
2065
+ const {
2066
+ taxPeriodFrom,
2067
+ taxPeriodTo,
2068
+ fromPeriod,
2069
+ toPeriod
2070
+ } = billDetails || {};
1919
2071
  if (taxPeriodFrom && taxPeriodTo) {
1920
2072
  let from = new Date(taxPeriodFrom).getFullYear().toString();
1921
2073
  let to = new Date(taxPeriodTo).getFullYear().toString();
@@ -1937,19 +2089,19 @@ const WrapPaymentComponent = props => {
1937
2089
  };
1938
2090
  let bannerText;
1939
2091
  if (workflw) {
1940
- bannerText = "CITIZEN_SUCCESS_UC_PAYMENT_MESSAGE";
2092
+ bannerText = `CITIZEN_SUCCESS_UC_PAYMENT_MESSAGE`;
1941
2093
  } else {
1942
2094
  var _paymentData$paymentD2, _paymentData$paymentD3, _paymentData$paymentD4, _paymentData$paymentD5, _paymentData$paymentD6;
1943
2095
  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")) {
1944
2096
  var _paymentData$paymentD7;
1945
2097
  let nameOfAchitect = sessionStorage.getItem("BPA_ARCHITECT_NAME");
1946
2098
  let parsedArchitectName = nameOfAchitect ? JSON.parse(nameOfAchitect) : "ARCHITECT";
1947
- 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";
2099
+ 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`;
1948
2100
  } else if (business_service !== null && business_service !== void 0 && business_service.includes("WS") || business_service !== null && business_service !== void 0 && business_service.includes("SW")) {
1949
- bannerText = t("CITIZEN_SUCCESS_" + (paymentData === null || paymentData === void 0 ? void 0 : paymentData.paymentDetails[0].businessService.replace(/\./g, "_")) + "_WS_PAYMENT_MESSAGE");
2101
+ bannerText = t(`CITIZEN_SUCCESS_${paymentData === null || paymentData === void 0 ? void 0 : paymentData.paymentDetails[0].businessService.replace(/\./g, "_")}_WS_PAYMENT_MESSAGE`);
1950
2102
  } else {
1951
2103
  var _paymentData$paymentD8, _paymentData$paymentD9;
1952
- 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");
2104
+ 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");
1953
2105
  }
1954
2106
  }
1955
2107
  const rowContainerStyle = {
@@ -1979,9 +2131,10 @@ const WrapPaymentComponent = props => {
1979
2131
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
1980
2132
  hallsBookingApplication: [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]]
1981
2133
  }, generatePdfKeyForTL)).then(function (response) {
1982
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0], {
2134
+ const updatedApplication = {
2135
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]),
1983
2136
  permissionLetterFilestoreId: response === null || response === void 0 ? void 0 : response.filestoreIds[0]
1984
- });
2137
+ };
1985
2138
  return Promise.resolve(mutation.mutateAsync({
1986
2139
  hallsBookingApplication: updatedApplication
1987
2140
  })).then(function () {
@@ -2019,9 +2172,10 @@ const WrapPaymentComponent = props => {
2019
2172
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
2020
2173
  bookingApplication: [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]]
2021
2174
  }, generatePdfKeyForTL)).then(function (response) {
2022
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0], {
2175
+ const updatedApplication = {
2176
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]),
2023
2177
  permissionLetterFilestoreId: response === null || response === void 0 ? void 0 : response.filestoreIds[0]
2024
- });
2178
+ };
2025
2179
  return Promise.resolve(AdvertisementCreateApi.mutateAsync({
2026
2180
  bookingApplication: updatedApplication
2027
2181
  })).then(function () {
@@ -2151,13 +2305,16 @@ const WrapPaymentComponent = props => {
2151
2305
  filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
2152
2306
  };
2153
2307
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
2154
- Payments: [_extends({}, paymentData)]
2308
+ Payments: [{
2309
+ ...paymentData
2310
+ }]
2155
2311
  }, "advservice-receipt")).then(function (_Digit$PaymentService5) {
2156
2312
  var _response5;
2157
2313
  response = _Digit$PaymentService5;
2158
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0], {
2314
+ const updatedApplication = {
2315
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]),
2159
2316
  paymentReceiptFilestoreId: (_response5 = response) === null || _response5 === void 0 ? void 0 : _response5.filestoreIds[0]
2160
- });
2317
+ };
2161
2318
  return Promise.resolve(AdvertisementCreateApi.mutateAsync({
2162
2319
  bookingApplication: updatedApplication
2163
2320
  })).then(function () {
@@ -2196,13 +2353,16 @@ const WrapPaymentComponent = props => {
2196
2353
  filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
2197
2354
  };
2198
2355
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
2199
- Payments: [_extends({}, paymentData)]
2356
+ Payments: [{
2357
+ ...paymentData
2358
+ }]
2200
2359
  }, "chbservice-receipt")).then(function (_Digit$PaymentService6) {
2201
2360
  var _response7;
2202
2361
  response = _Digit$PaymentService6;
2203
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0], {
2362
+ const updatedApplication = {
2363
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]),
2204
2364
  paymentReceiptFilestoreId: (_response7 = response) === null || _response7 === void 0 ? void 0 : _response7.filestoreIds[0]
2205
- });
2365
+ };
2206
2366
  return Promise.resolve(mutation.mutateAsync({
2207
2367
  hallsBookingApplication: updatedApplication
2208
2368
  })).then(function () {
@@ -2505,7 +2665,7 @@ const WrapPaymentComponent = props => {
2505
2665
  rowContainerStyle: rowContainerStyle,
2506
2666
  last: true,
2507
2667
  label: t("CS_PAYMENT_AMOUNT_PENDING"),
2508
- 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
2668
+ 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}`
2509
2669
  }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
2510
2670
  rowContainerStyle: rowContainerStyle,
2511
2671
  last: true,
@@ -2515,7 +2675,7 @@ const WrapPaymentComponent = props => {
2515
2675
  rowContainerStyle: rowContainerStyle,
2516
2676
  last: true,
2517
2677
  label: t(ommitRupeeSymbol ? "CS_PAYMENT_AMOUNT_PAID_WITHOUT_SYMBOL" : "CS_PAYMENT_AMOUNT_PAID"),
2518
- 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")
2678
+ 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`)
2519
2679
  }), (business_service !== "PT" || workflw) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
2520
2680
  rowContainerStyle: rowContainerStyle,
2521
2681
  last: true,
@@ -2626,7 +2786,7 @@ const WrapPaymentComponent = props => {
2626
2786
  marginTop: "10px"
2627
2787
  }
2628
2788
  }, /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
2629
- 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])
2789
+ 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]}`
2630
2790
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
2631
2791
  label: t("CS_REVIEW_AND_FEEDBACK")
2632
2792
  }))), business_service !== null && business_service !== void 0 && business_service.includes("PT") ? /*#__PURE__*/React__default.createElement("div", {
@@ -2826,25 +2986,25 @@ const WrapPaymentComponent = props => {
2826
2986
  marginTop: "8px"
2827
2987
  }
2828
2988
  }, /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
2829
- to: "/digit-ui/citizen"
2989
+ to: `/digit-ui/citizen`
2830
2990
  }, t("CORE_COMMON_GO_TO_HOME"))), business_service == "TL" && /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
2831
- to: "/digit-ui/citizen"
2991
+ to: `/digit-ui/citizen`
2832
2992
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
2833
2993
  label: t("CORE_COMMON_GO_TO_HOME")
2834
2994
  })), business_service == "pet-services" && /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
2835
- to: "/digit-ui/citizen"
2995
+ to: `/digit-ui/citizen`
2836
2996
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
2837
2997
  label: t("CORE_COMMON_GO_TO_HOME")
2838
2998
  })), business_service == "chb-services" && /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
2839
- to: "/digit-ui/citizen"
2999
+ to: `/digit-ui/citizen`
2840
3000
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
2841
3001
  label: t("CORE_COMMON_GO_TO_HOME")
2842
3002
  })), business_service == "adv-services" && /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
2843
- to: "/digit-ui/citizen"
3003
+ to: `/digit-ui/citizen`
2844
3004
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
2845
3005
  label: t("CORE_COMMON_GO_TO_HOME")
2846
3006
  })), business_service == "sv-services" && /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
2847
- to: "/digit-ui/citizen"
3007
+ to: `/digit-ui/citizen`
2848
3008
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
2849
3009
  label: t("CORE_COMMON_GO_TO_HOME"),
2850
3010
  style: {
@@ -2853,10 +3013,12 @@ const WrapPaymentComponent = props => {
2853
3013
  })));
2854
3014
  };
2855
3015
  const FailedPayment = props => {
2856
- const _useTranslation2 = reactI18next.useTranslation(),
2857
- t = _useTranslation2.t;
2858
- const _useParams2 = reactRouterDom.useParams(),
2859
- consumerCode = _useParams2.consumerCode;
3016
+ const {
3017
+ t
3018
+ } = reactI18next.useTranslation();
3019
+ const {
3020
+ consumerCode
3021
+ } = reactRouterDom.useParams();
2860
3022
  const getMessage = () => "Failure !";
2861
3023
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Banner, {
2862
3024
  message: getMessage(),
@@ -2866,20 +3028,25 @@ const FailedPayment = props => {
2866
3028
  };
2867
3029
 
2868
3030
  const CitizenPayment = _ref => {
2869
- let stateCode = _ref.stateCode,
2870
- cityCode = _ref.cityCode,
2871
- moduleCode = _ref.moduleCode;
2872
- const _useRouteMatch = reactRouterDom.useRouteMatch(),
2873
- currentPath = _useRouteMatch.path;
2874
- const _useLocation = reactRouterDom.useLocation(),
2875
- routerState = _useLocation.state;
3031
+ let {
3032
+ stateCode,
3033
+ cityCode,
3034
+ moduleCode
3035
+ } = _ref;
3036
+ const {
3037
+ path: currentPath
3038
+ } = reactRouterDom.useRouteMatch();
3039
+ const {
3040
+ state: routerState
3041
+ } = reactRouterDom.useLocation();
2876
3042
  const commonProps = {
2877
3043
  stateCode,
2878
3044
  cityCode,
2879
3045
  moduleCode
2880
3046
  };
2881
- const _useTranslation = reactI18next.useTranslation(),
2882
- t = _useTranslation.t;
3047
+ const {
3048
+ t
3049
+ } = reactI18next.useTranslation();
2883
3050
  let isMobile = window.Digit.Utils.browser.isMobile();
2884
3051
  const pathname = window.location.pathname;
2885
3052
  const crumbs = [{
@@ -2892,15 +3059,15 @@ const CitizenPayment = _ref => {
2892
3059
  }, {
2893
3060
  path: "/digit-ui/citizen/payment/my-bills",
2894
3061
  label: t("CS_PAYMENT_BILL_DETAILS"),
2895
- show: pathname.includes("/my-bills")
3062
+ show: pathname.includes("/my-bills") || pathname.includes("/billDetails") || pathname.includes("/collect") || pathname.includes("/success") || pathname.includes("/failure")
2896
3063
  }, {
2897
3064
  path: pathname,
2898
3065
  label: t("PAYERS_DETAILS_HEADER"),
2899
- show: pathname.includes("/billDetails")
3066
+ show: pathname.includes("/billDetails") || pathname.includes("/collect") || pathname.includes("/success") || pathname.includes("/failure")
2900
3067
  }, {
2901
3068
  path: pathname,
2902
3069
  label: t("PAYMENT_CS_HEADER"),
2903
- show: pathname.includes("/collect")
3070
+ show: pathname.includes("/collect") || pathname.includes("/success") || pathname.includes("/failure")
2904
3071
  }, {
2905
3072
  path: pathname,
2906
3073
  label: t("CS_TITLE_PAYMENT_SUCCESS"),
@@ -2919,13 +3086,11 @@ const CitizenPayment = _ref => {
2919
3086
  label: t("ES_TITLE_WATER_AND_SEWERAGE"),
2920
3087
  show: true
2921
3088
  });
2922
- if (routerState !== null && routerState !== void 0 && routerState.fromMyApplications || routerState !== null && routerState !== void 0 && routerState.fromApplicationDetails) {
2923
- activeCrumbs.splice(2, 0, {
2924
- path: "/digit-ui/citizen/ws/my-applications",
2925
- label: t("CS_HOME_MY_APPLICATIONS"),
2926
- show: true
2927
- });
2928
- }
3089
+ activeCrumbs.splice(2, 0, {
3090
+ path: "/digit-ui/citizen/ws/my-applications",
3091
+ label: t("CS_HOME_MY_APPLICATIONS"),
3092
+ show: true
3093
+ });
2929
3094
  if (routerState !== null && routerState !== void 0 && routerState.fromApplicationDetails) {
2930
3095
  activeCrumbs.splice(3, 0, {
2931
3096
  label: t("WS_APPLICATION_DETAILS_HEADER"),
@@ -2934,8 +3099,15 @@ const CitizenPayment = _ref => {
2934
3099
  });
2935
3100
  }
2936
3101
  }
3102
+ activeCrumbs.forEach((crumb, index) => {
3103
+ if (index < activeCrumbs.length - 1 && crumb.path === pathname) {
3104
+ crumb.path = "";
3105
+ crumb.onClick = () => window.history.go(index - (activeCrumbs.length - 1));
3106
+ }
3107
+ });
2937
3108
  if (activeCrumbs.length > 0) {
2938
3109
  activeCrumbs[activeCrumbs.length - 1].path = "";
3110
+ delete activeCrumbs[activeCrumbs.length - 1].onClick;
2939
3111
  }
2940
3112
  return activeCrumbs;
2941
3113
  };
@@ -2952,23 +3124,23 @@ const CitizenPayment = _ref => {
2952
3124
  }, /*#__PURE__*/React__default.createElement("div", {
2953
3125
  className: "employee-form-content"
2954
3126
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
2955
- path: currentPath + "/my-bills/:businessService"
3127
+ path: `${currentPath}/my-bills/:businessService`
2956
3128
  }, /*#__PURE__*/React__default.createElement(MyBills, {
2957
3129
  stateCode: stateCode
2958
3130
  })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
2959
- path: currentPath + "/billDetails/:businessService/:consumerCode/:paymentAmt"
3131
+ path: `${currentPath}/billDetails/:businessService/:consumerCode/:paymentAmt`
2960
3132
  }, /*#__PURE__*/React__default.createElement(SelectPaymentType, _extends({}, commonProps, {
2961
3133
  stateCode: stateCode,
2962
3134
  basePath: currentPath
2963
3135
  }))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
2964
- path: currentPath + "/collect/:businessService/:consumerCode"
3136
+ path: `${currentPath}/collect/:businessService/:consumerCode`
2965
3137
  }, /*#__PURE__*/React__default.createElement(SelectPaymentType$1, _extends({}, commonProps, {
2966
3138
  stateCode: stateCode,
2967
3139
  basePath: currentPath
2968
3140
  }))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
2969
- path: currentPath + "/success/:businessService/:consumerCode/:tenantId"
3141
+ path: `${currentPath}/success/:businessService/:consumerCode/:tenantId`
2970
3142
  }, /*#__PURE__*/React__default.createElement(SuccessfulPayment, commonProps)), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
2971
- path: currentPath + "/failure"
3143
+ path: `${currentPath}/failure`
2972
3144
  }, /*#__PURE__*/React__default.createElement(FailedPayment, commonProps))))))));
2973
3145
  };
2974
3146
 
@@ -2989,7 +3161,7 @@ const getKeyNotesConfig = (businessService, t) => {
2989
3161
  fontSize: "16px",
2990
3162
  fontWeight: "normal"
2991
3163
  }
2992
- }, " ( " + t("CS_PAYMENT_OVERDUE") + " " + days + " " + t(days === 1 ? "CS_COMMON_DAY" : "CS_COMMON_DAYS") + ")") : null);
3164
+ }, ` ( ${t("CS_PAYMENT_OVERDUE")} ${days} ${t(days === 1 ? "CS_COMMON_DAY" : "CS_COMMON_DAYS")})`) : null);
2993
3165
  }],
2994
3166
  fallback: "N/A",
2995
3167
  noteStyle: {
@@ -3012,9 +3184,10 @@ const getKeyNotesConfig = (businessService, t) => {
3012
3184
  }, {
3013
3185
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
3014
3186
  keyPath: ["billDetails", d => {
3015
- const _d$ = d[0],
3016
- fromPeriod = _d$.fromPeriod,
3017
- toPeriod = _d$.toPeriod;
3187
+ const {
3188
+ fromPeriod,
3189
+ toPeriod
3190
+ } = d[0];
3018
3191
  if (fromPeriod && toPeriod) {
3019
3192
  let from = new Date(fromPeriod).getFullYear().toString();
3020
3193
  let to = new Date(toPeriod).getFullYear().toString();
@@ -3025,11 +3198,11 @@ const getKeyNotesConfig = (businessService, t) => {
3025
3198
  }, {
3026
3199
  keyValue: "PT_DUE_DATE",
3027
3200
  keyPath: ["billDetails", d => {
3028
- var _d$2, _d$3;
3029
- if (!((_d$2 = d[0]) !== null && _d$2 !== void 0 && _d$2.toPeriod)) return "N/A";
3030
- const date = new Date((_d$3 = d[0]) === null || _d$3 === void 0 ? void 0 : _d$3.toPeriod);
3201
+ var _d$, _d$2;
3202
+ if (!((_d$ = d[0]) !== null && _d$ !== void 0 && _d$.toPeriod)) return "N/A";
3203
+ const date = new Date((_d$2 = d[0]) === null || _d$2 === void 0 ? void 0 : _d$2.toPeriod);
3031
3204
  const month = Digit.Utils.date.monthNames[date.getMonth()];
3032
- return date.getDate() + " " + month + " " + date.getFullYear();
3205
+ return `${date.getDate()} ${month} ${date.getFullYear()}`;
3033
3206
  }],
3034
3207
  fallback: "N/A"
3035
3208
  }],
@@ -3080,15 +3253,14 @@ const useCashPaymentDetails = (props, t) => {
3080
3253
  };
3081
3254
  const CashDetailsComponent = _ref => {
3082
3255
  var _props$value, _props$value2;
3083
- let props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
3084
- const _useTranslation = reactI18next.useTranslation(),
3085
- t = _useTranslation.t;
3086
- const _useState = React.useState(props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.manualReceiptDate),
3087
- manualReceiptDate = _useState[0],
3088
- setManualReceiptDate = _useState[1];
3089
- const _useState2 = React.useState(props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.manualReceiptNumber),
3090
- manualReceiptNumber = _useState2[0],
3091
- setManualReceiptNumber = _useState2[1];
3256
+ let {
3257
+ ...props
3258
+ } = _ref;
3259
+ const {
3260
+ t
3261
+ } = reactI18next.useTranslation();
3262
+ const [manualReceiptDate, setManualReceiptDate] = React.useState(props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.manualReceiptDate);
3263
+ const [manualReceiptNumber, setManualReceiptNumber] = React.useState(props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.manualReceiptNumber);
3092
3264
  React.useEffect(() => {
3093
3265
  if (props.onChange) {
3094
3266
  let errorObj = {};
@@ -3139,18 +3311,15 @@ const useCardPaymentDetails = (props, t) => {
3139
3311
  };
3140
3312
  const CardDetailsComponent = _ref => {
3141
3313
  var _props$value, _props$value2, _props$value3;
3142
- let props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
3143
- const _useTranslation = reactI18next.useTranslation(),
3144
- t = _useTranslation.t;
3145
- const _useState = React.useState(props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.last4Digits),
3146
- last4Digits = _useState[0],
3147
- setLast4Digits = _useState[1];
3148
- const _useState2 = React.useState(props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.transactionNumber),
3149
- transactionNumber = _useState2[0],
3150
- setTransactionNumber = _useState2[1];
3151
- const _useState3 = React.useState(props === null || props === void 0 ? void 0 : (_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.reTransanctionNumber),
3152
- reTransanctionNumber = _useState3[0],
3153
- setReTransanctionNumber = _useState3[1];
3314
+ let {
3315
+ ...props
3316
+ } = _ref;
3317
+ const {
3318
+ t
3319
+ } = reactI18next.useTranslation();
3320
+ const [last4Digits, setLast4Digits] = React.useState(props === null || props === void 0 ? void 0 : (_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value.last4Digits);
3321
+ const [transactionNumber, setTransactionNumber] = React.useState(props === null || props === void 0 ? void 0 : (_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.transactionNumber);
3322
+ const [reTransanctionNumber, setReTransanctionNumber] = React.useState(props === null || props === void 0 ? void 0 : (_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.reTransanctionNumber);
3154
3323
  React.useEffect(() => {
3155
3324
  if (props.onChange) {
3156
3325
  let errorObj = {};
@@ -3167,19 +3336,19 @@ const CardDetailsComponent = _ref => {
3167
3336
  }, [last4Digits, transactionNumber, reTransanctionNumber]);
3168
3337
  return /*#__PURE__*/React__default.createElement("div", {
3169
3338
  className: "formcomposer-section-grid"
3170
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("NOC_PAYMENT_CARD_LAST_DIGITS_LABEL") + " *"), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
3339
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, `${t("NOC_PAYMENT_CARD_LAST_DIGITS_LABEL")} *`), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
3171
3340
  value: last4Digits,
3172
3341
  name: "instrumentNumber",
3173
3342
  maxLength: "4",
3174
3343
  minLength: "4",
3175
3344
  required: true,
3176
3345
  onChange: e => setLast4Digits(e.target.value)
3177
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("NOC_PAYMENT_TRANS_NO_LABEL") + " *"), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
3346
+ })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, `${t("NOC_PAYMENT_TRANS_NO_LABEL")} *`), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
3178
3347
  value: transactionNumber,
3179
3348
  name: "instrumentNumber",
3180
3349
  required: true,
3181
3350
  onChange: e => setTransactionNumber(e.target.value)
3182
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("NOC_PAYMENT_RENTR_TRANS_LABEL") + " *"), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
3351
+ })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, `${t("NOC_PAYMENT_RENTR_TRANS_LABEL")} *`), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
3183
3352
  value: reTransanctionNumber,
3184
3353
  name: "instrumentNumber",
3185
3354
  required: true,
@@ -3218,26 +3387,15 @@ const useChequeDetails = (props, t) => {
3218
3387
  };
3219
3388
  const ChequeDetailsComponent = props => {
3220
3389
  var _props$chequeDetails$;
3221
- const _useTranslation = reactI18next.useTranslation(),
3222
- t = _useTranslation.t;
3223
- const _useState = React.useState(props.chequeDetails.instrumentDate),
3224
- instrumentDate = _useState[0],
3225
- setChequeDate = _useState[1];
3226
- const _useState2 = React.useState(props.chequeDetails.instrumentNumber),
3227
- instrumentNumber = _useState2[0],
3228
- setChequeNo = _useState2[1];
3229
- const _useState3 = React.useState(props.chequeDetails.ifscCode),
3230
- ifscCode = _useState3[0],
3231
- setIfsc = _useState3[1];
3232
- const _useState4 = React.useState(""),
3233
- ifscCodeError = _useState4[0],
3234
- setIfscCodeError = _useState4[1];
3235
- const _useState5 = React.useState(props.chequeDetails.bankName),
3236
- bankName = _useState5[0],
3237
- setBankName = _useState5[1];
3238
- const _useState6 = React.useState((_props$chequeDetails$ = props.chequeDetails.bankBranch) === null || _props$chequeDetails$ === void 0 ? void 0 : _props$chequeDetails$.replace(" ", " ")),
3239
- bankBranch = _useState6[0],
3240
- setBankBranch = _useState6[1];
3390
+ const {
3391
+ t
3392
+ } = reactI18next.useTranslation();
3393
+ const [instrumentDate, setChequeDate] = React.useState(props.chequeDetails.instrumentDate);
3394
+ const [instrumentNumber, setChequeNo] = React.useState(props.chequeDetails.instrumentNumber);
3395
+ const [ifscCode, setIfsc] = React.useState(props.chequeDetails.ifscCode);
3396
+ const [ifscCodeError, setIfscCodeError] = React.useState("");
3397
+ const [bankName, setBankName] = React.useState(props.chequeDetails.bankName);
3398
+ const [bankBranch, setBankBranch] = React.useState((_props$chequeDetails$ = props.chequeDetails.bankBranch) === null || _props$chequeDetails$ === void 0 ? void 0 : _props$chequeDetails$.replace(" ", " "));
3241
3399
  React.useEffect(() => {
3242
3400
  if (props.onChange) {
3243
3401
  let errorObj = {};
@@ -3258,12 +3416,14 @@ const ChequeDetailsComponent = props => {
3258
3416
  const setBankDetailsFromIFSC = function () {
3259
3417
  try {
3260
3418
  const _temp2 = _catch(function () {
3261
- return Promise.resolve(window.fetch("https://ifsc.razorpay.com/" + ifscCode)).then(function (res) {
3419
+ return Promise.resolve(window.fetch(`https://ifsc.razorpay.com/${ifscCode}`)).then(function (res) {
3262
3420
  const _temp = function () {
3263
3421
  if (res.ok) {
3264
3422
  return Promise.resolve(res.json()).then(function (_ref) {
3265
- let BANK = _ref.BANK,
3266
- BRANCH = _ref.BRANCH;
3423
+ let {
3424
+ BANK,
3425
+ BRANCH
3426
+ } = _ref;
3267
3427
  setBankName(BANK);
3268
3428
  setBankBranch(BRANCH === null || BRANCH === void 0 ? void 0 : BRANCH.replace("┬á", " "));
3269
3429
  });
@@ -3285,18 +3445,18 @@ const ChequeDetailsComponent = props => {
3285
3445
  };
3286
3446
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
3287
3447
  className: "formcomposer-section-grid"
3288
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("PAYMENT_CHQ_NO_LABEL") + " *"), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
3448
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, `${t("PAYMENT_CHQ_NO_LABEL")} *`), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
3289
3449
  value: instrumentNumber,
3290
3450
  onChange: e => setChequeNo(e.target.value),
3291
3451
  name: "instrumentNumber",
3292
3452
  required: true
3293
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("PAYMENT_CHEQUE_DATE_LABEL") + " *"), /*#__PURE__*/React__default.createElement(digitUiReactComponents.DatePicker, {
3453
+ })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, `${t("PAYMENT_CHEQUE_DATE_LABEL")} *`), /*#__PURE__*/React__default.createElement(digitUiReactComponents.DatePicker, {
3294
3454
  isRequired: true,
3295
3455
  date: instrumentDate,
3296
3456
  onChange: d => {
3297
3457
  setChequeDate(d);
3298
3458
  }
3299
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("PAYMENT_IFSC_CODE_LABEL") + " *"), /*#__PURE__*/React__default.createElement("div", {
3459
+ })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, `${t("PAYMENT_IFSC_CODE_LABEL")} *`), /*#__PURE__*/React__default.createElement("div", {
3300
3460
  className: "field"
3301
3461
  }, /*#__PURE__*/React__default.createElement("div", {
3302
3462
  className: "cheque-date"
@@ -4315,9 +4475,10 @@ const BillDetailsKeyNoteConfig = () => ({
4315
4475
  }, {
4316
4476
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
4317
4477
  keyPath: ["billDetails", d => {
4318
- const _d$ = d[0],
4319
- fromPeriod = _d$.fromPeriod,
4320
- toPeriod = _d$.toPeriod;
4478
+ const {
4479
+ fromPeriod,
4480
+ toPeriod
4481
+ } = d[0];
4321
4482
  if (fromPeriod && toPeriod) {
4322
4483
  let from = new Date(fromPeriod).getFullYear().toString();
4323
4484
  let to = new Date(toPeriod).getFullYear().toString();
@@ -4328,7 +4489,9 @@ const BillDetailsKeyNoteConfig = () => ({
4328
4489
  }, {
4329
4490
  keyValue: "CS_BILL_NO",
4330
4491
  keyPath: ["billDetails", d => {
4331
- const currentBillNo = d[0].currentBillNo;
4492
+ const {
4493
+ currentBillNo
4494
+ } = d[0];
4332
4495
  if (currentBillNo) {
4333
4496
  return currentBillNo;
4334
4497
  } else return "N/A";
@@ -4337,7 +4500,9 @@ const BillDetailsKeyNoteConfig = () => ({
4337
4500
  }, {
4338
4501
  keyValue: "CS_BILL_DUEDATE",
4339
4502
  keyPath: ["billDetails", d => {
4340
- const currentExpiryDate = d[0].currentExpiryDate;
4503
+ const {
4504
+ currentExpiryDate
4505
+ } = d[0];
4341
4506
  if (currentExpiryDate) {
4342
4507
  return new Date(currentExpiryDate).toLocaleDateString();
4343
4508
  } else return "N/A";
@@ -4362,7 +4527,9 @@ const BillDetailsKeyNoteConfig = () => ({
4362
4527
  }, {
4363
4528
  keyValue: "CS_BILL_NO",
4364
4529
  keyPath: ["billDetails", d => {
4365
- const currentBillNo = d[0].currentBillNo;
4530
+ const {
4531
+ currentBillNo
4532
+ } = d[0];
4366
4533
  if (currentBillNo) {
4367
4534
  return currentBillNo;
4368
4535
  } else return "N/A";
@@ -4371,7 +4538,9 @@ const BillDetailsKeyNoteConfig = () => ({
4371
4538
  }, {
4372
4539
  keyValue: "CS_BILL_DUEDATE",
4373
4540
  keyPath: ["billDetails", d => {
4374
- const currentExpiryDate = d[0].currentExpiryDate;
4541
+ const {
4542
+ currentExpiryDate
4543
+ } = d[0];
4375
4544
  if (currentExpiryDate) {
4376
4545
  return new Date(currentExpiryDate).toLocaleDateString();
4377
4546
  } else return "N/A";
@@ -4428,9 +4597,10 @@ const BillDetailsKeyNoteConfig = () => ({
4428
4597
  }, {
4429
4598
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
4430
4599
  keyPath: ["billDetails", d => {
4431
- const _d$2 = d[0],
4432
- fromPeriod = _d$2.fromPeriod,
4433
- toPeriod = _d$2.toPeriod;
4600
+ const {
4601
+ fromPeriod,
4602
+ toPeriod
4603
+ } = d[0];
4434
4604
  if (fromPeriod && toPeriod) {
4435
4605
  let from = new Date(fromPeriod).toLocaleDateString();
4436
4606
  let to = new Date(toPeriod).toLocaleDateString();
@@ -4445,7 +4615,9 @@ const BillDetailsKeyNoteConfig = () => ({
4445
4615
  }, {
4446
4616
  keyValue: "CS_BILL_DUEDATE",
4447
4617
  keyPath: ["billDetails", d => {
4448
- const currentExpiryDate = d[0].currentExpiryDate;
4618
+ const {
4619
+ currentExpiryDate
4620
+ } = d[0];
4449
4621
  if (currentExpiryDate) {
4450
4622
  return new Date(currentExpiryDate).toLocaleDateString();
4451
4623
  } else return "N/A";
@@ -4462,9 +4634,10 @@ const BillDetailsKeyNoteConfig = () => ({
4462
4634
  }, {
4463
4635
  keyValue: "CS_PAYMENT_BILLING_PERIOD",
4464
4636
  keyPath: ["billDetails", d => {
4465
- const _d$3 = d[0],
4466
- fromPeriod = _d$3.fromPeriod,
4467
- toPeriod = _d$3.toPeriod;
4637
+ const {
4638
+ fromPeriod,
4639
+ toPeriod
4640
+ } = d[0];
4468
4641
  if (fromPeriod && toPeriod) {
4469
4642
  let from = new Date(fromPeriod).toLocaleDateString();
4470
4643
  let to = new Date(toPeriod).toLocaleDateString();
@@ -4479,7 +4652,9 @@ const BillDetailsKeyNoteConfig = () => ({
4479
4652
  }, {
4480
4653
  keyValue: "CS_BILL_DUEDATE",
4481
4654
  keyPath: ["billDetails", d => {
4482
- const expiryDate = d[0].expiryDate;
4655
+ const {
4656
+ expiryDate
4657
+ } = d[0];
4483
4658
  if (expiryDate) {
4484
4659
  return new Date(expiryDate).toLocaleDateString();
4485
4660
  } else return "N/A";
@@ -4702,40 +4877,49 @@ const BillDetailsFormConfig = (props, t) => ({
4702
4877
  });
4703
4878
  const BillDetails$1 = _ref => {
4704
4879
  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;
4705
- let businessService = _ref.businessService,
4706
- consumerCode = _ref.consumerCode,
4707
- onChange = _ref.onChange;
4708
- const _useTranslation = reactI18next.useTranslation(),
4709
- t = _useTranslation.t;
4710
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
4711
- ModuleWorkflow = _Digit$Hooks$useQuery.workflow,
4712
- IsDisconnectionFlow = _Digit$Hooks$useQuery.IsDisconnectionFlow;
4880
+ let {
4881
+ businessService,
4882
+ consumerCode,
4883
+ _amount,
4884
+ onChange
4885
+ } = _ref;
4886
+ const {
4887
+ t
4888
+ } = reactI18next.useTranslation();
4889
+ const {
4890
+ workflow: ModuleWorkflow,
4891
+ IsDisconnectionFlow
4892
+ } = Digit.Hooks.useQueryParams();
4713
4893
  const tenantId = Digit.ULBService.getCurrentTenantId();
4714
- const _Digit$Hooks$useFetch = Digit.Hooks.useFetchPayment({
4715
- tenantId,
4716
- businessService,
4717
- consumerCode
4718
- }),
4719
- data = _Digit$Hooks$useFetch.data,
4720
- isLoading = _Digit$Hooks$useFetch.isLoading;
4894
+ const {
4895
+ data,
4896
+ isLoading
4897
+ } = Digit.Hooks.useFetchPayment({
4898
+ tenantId,
4899
+ businessService,
4900
+ consumerCode
4901
+ });
4721
4902
  const checkFSM = window.location.href.includes("FSM");
4722
- const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSearch(tenantId, {
4723
- applicationNos: consumerCode
4724
- }, {
4725
- staleTime: Infinity,
4726
- enabled: businessService !== null && businessService !== void 0 && (_businessService$toUp = businessService.toUpperCase()) !== null && _businessService$toUp !== void 0 && _businessService$toUp.includes("FSM") ? true : false
4727
- }),
4728
- applicationData = _Digit$Hooks$fsm$useS.data;
4729
- const _useState = React.useState(),
4730
- bill = _useState[0],
4731
- setBill = _useState[1];
4732
- const _useState2 = React.useState(true),
4733
- showDetails = _useState2[0],
4734
- setShowDetails = _useState2[1];
4735
- const _Digit$Hooks$fsm$useA = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, consumerCode, {
4736
- enabled: checkFSM ? true : false
4737
- }, "EMPLOYEE"),
4738
- application = _Digit$Hooks$fsm$useA.data;
4903
+ const {
4904
+ isLoading: isDataLoading,
4905
+ data: applicationData
4906
+ } = Digit.Hooks.fsm.useSearch(tenantId, {
4907
+ applicationNos: consumerCode
4908
+ }, {
4909
+ staleTime: Infinity,
4910
+ enabled: businessService !== null && businessService !== void 0 && (_businessService$toUp = businessService.toUpperCase()) !== null && _businessService$toUp !== void 0 && _businessService$toUp.includes("FSM") ? true : false
4911
+ });
4912
+ const [bill, setBill] = React.useState();
4913
+ const [showDetails, setShowDetails] = React.useState(true);
4914
+ const {
4915
+ isLoading: isFSMLoading,
4916
+ isError,
4917
+ error,
4918
+ data: application,
4919
+ error: errorApplication
4920
+ } = Digit.Hooks.fsm.useApplicationDetail(t, tenantId, consumerCode, {
4921
+ enabled: checkFSM ? true : false
4922
+ }, "EMPLOYEE");
4739
4923
  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);
4740
4924
  const billDetails = (yearWiseBills === null || yearWiseBills === void 0 ? void 0 : yearWiseBills[0]) || [];
4741
4925
  const getTotal = () => bill !== null && bill !== void 0 && bill.totalAmount ? bill === null || bill === void 0 ? void 0 : bill.totalAmount : 0;
@@ -4753,38 +4937,31 @@ const BillDetails$1 = _ref => {
4753
4937
  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;
4754
4938
  };
4755
4939
  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;
4756
- const _Digit$Hooks$useGetPa = Digit.Hooks.useGetPaymentRulesForBusinessServices(tenantId),
4757
- mdmsLoading = _Digit$Hooks$useGetPa.isLoading,
4758
- mdmsBillingData = _Digit$Hooks$useGetPa.data;
4759
- const _useState3 = React.useState(),
4760
- paymentRules = _useState3[0],
4761
- setPaymentRules = _useState3[1];
4940
+ const {
4941
+ isLoading: mdmsLoading,
4942
+ data: mdmsBillingData
4943
+ } = Digit.Hooks.useGetPaymentRulesForBusinessServices(tenantId);
4944
+ const [paymentRules, setPaymentRules] = React.useState();
4762
4945
  React.useEffect(() => {
4763
4946
  var _mdmsBillingData$Mdms, _mdmsBillingData$Mdms2;
4764
4947
  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;
4765
4948
  if (payRestrictiondetails !== null && payRestrictiondetails !== void 0 && payRestrictiondetails.length) {
4766
4949
  if (IsDisconnectionFlow) {
4767
- setPaymentRules(_extends({}, payRestrictiondetails.filter(e => e.code == businessService)[0], {
4950
+ setPaymentRules({
4951
+ ...payRestrictiondetails.filter(e => e.code == businessService)[0],
4768
4952
  partPaymentAllowed: false
4769
- }));
4953
+ });
4770
4954
  } else setPaymentRules(payRestrictiondetails.filter(e => e.code == businessService)[0]);
4771
4955
  } else setPaymentRules({});
4772
4956
  }, [mdmsBillingData]);
4773
- const _ref2 = paymentRules || {},
4774
- minAmountPayable = _ref2.minAmountPayable,
4775
- isAdvanceAllowed = _ref2.isAdvanceAllowed;
4776
- const _useState4 = React.useState(t("CS_PAYMENT_FULL_AMOUNT")),
4777
- paymentType = _useState4[0],
4778
- setPaymentType = _useState4[1];
4779
- const _useState5 = React.useState(getTotal()),
4780
- amount = _useState5[0],
4781
- setAmount = _useState5[1];
4782
- const _useState6 = React.useState(true),
4783
- paymentAllowed = _useState6[0],
4784
- setPaymentAllowed = _useState6[1];
4785
- const _useState7 = React.useState(""),
4786
- formError = _useState7[0],
4787
- setError = _useState7[1];
4957
+ const {
4958
+ minAmountPayable,
4959
+ isAdvanceAllowed
4960
+ } = paymentRules || {};
4961
+ const [paymentType, setPaymentType] = React.useState(t("CS_PAYMENT_FULL_AMOUNT"));
4962
+ const [amount, setAmount] = React.useState(getTotal());
4963
+ const [paymentAllowed, setPaymentAllowed] = React.useState(true);
4964
+ const [formError, setError] = React.useState("");
4788
4965
  const changeAmount = value => {
4789
4966
  setAmount(value);
4790
4967
  };
@@ -4838,15 +5015,19 @@ const BillDetails$1 = _ref => {
4838
5015
  };
4839
5016
  if (isLoading || mdmsLoading) return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
4840
5017
  const getFinancialYear = _bill => {
4841
- const fromPeriod = _bill.fromPeriod,
4842
- toPeriod = _bill.toPeriod;
5018
+ const {
5019
+ fromPeriod,
5020
+ toPeriod
5021
+ } = _bill;
4843
5022
  let from = new Date(fromPeriod).getFullYear().toString();
4844
5023
  let to = new Date(toPeriod).getFullYear().toString();
4845
5024
  return from + "-" + to;
4846
5025
  };
4847
5026
  const getBillingPeriod = _bill => {
4848
- const fromPeriod = _bill.fromPeriod,
4849
- toPeriod = _bill.toPeriod;
5027
+ const {
5028
+ fromPeriod,
5029
+ toPeriod
5030
+ } = _bill;
4850
5031
  let from = new Date(fromPeriod).toLocaleDateString();
4851
5032
  let to = new Date(toPeriod).toLocaleDateString();
4852
5033
  return from + "-" + to;
@@ -4872,11 +5053,17 @@ const BillDetails$1 = _ref => {
4872
5053
  }, /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
4873
5054
  style: thStyle
4874
5055
  }, t("CS_BILL_NO")), /*#__PURE__*/React__default.createElement("th", {
4875
- style: _extends({}, thStyle)
5056
+ style: {
5057
+ ...thStyle
5058
+ }
4876
5059
  }, t("CS_PAYMENT_BILLING_PERIOD")), /*#__PURE__*/React__default.createElement("th", {
4877
- style: _extends({}, thStyle)
5060
+ style: {
5061
+ ...thStyle
5062
+ }
4878
5063
  }, 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__default.createElement("th", {
4879
- style: _extends({}, thStyle),
5064
+ style: {
5065
+ ...thStyle
5066
+ },
4880
5067
  key: index
4881
5068
  }, t(head.taxHeadCode))), /*#__PURE__*/React__default.createElement("th", {
4882
5069
  style: thStyle
@@ -5034,11 +5221,17 @@ const BillDetails$1 = _ref => {
5034
5221
  }, /*#__PURE__*/React__default.createElement("thead", null, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
5035
5222
  style: thStyle
5036
5223
  }, t("FINANCIAL_YEAR")), /*#__PURE__*/React__default.createElement("th", {
5037
- style: _extends({}, thStyle)
5224
+ style: {
5225
+ ...thStyle
5226
+ }
5038
5227
  }, t("CS_BILL_NO")), /*#__PURE__*/React__default.createElement("th", {
5039
- style: _extends({}, thStyle)
5228
+ style: {
5229
+ ...thStyle
5230
+ }
5040
5231
  }, 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__default.createElement("th", {
5041
- style: _extends({}, thStyle),
5232
+ style: {
5233
+ ...thStyle
5234
+ },
5042
5235
  key: index
5043
5236
  }, t(head.taxHeadCode))), /*#__PURE__*/React__default.createElement("th", {
5044
5237
  style: thStyle
@@ -5093,7 +5286,7 @@ const BillDetails$1 = _ref => {
5093
5286
  }, /*#__PURE__*/React__default.createElement("span", {
5094
5287
  className: "payment-amount-front",
5095
5288
  style: {
5096
- border: "1px solid " + (paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? "#9a9a9a" : "black")
5289
+ border: `1px solid ${paymentType === t("CS_PAYMENT_FULL_AMOUNT") ? "#9a9a9a" : "black"}`
5097
5290
  }
5098
5291
  }, "\u20B9"), paymentType !== t("CS_PAYMENT_FULL_AMOUNT") ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
5099
5292
  style: {
@@ -5117,58 +5310,61 @@ const BillDetails$1 = _ref => {
5117
5310
  }, t(formError)))));
5118
5311
  };
5119
5312
 
5120
- const _excluded$2 = ["ManualRecieptDetails", "paymentModeDetails"],
5121
- _excluded2 = ["errorObj"];
5122
5313
  const CollectPayment = props => {
5123
5314
  var _paymentdetails$Bill, _businessService$toUp;
5124
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
5125
- ModuleWorkflow = _Digit$Hooks$useQuery.workflow,
5126
- IsDisconnectionFlow = _Digit$Hooks$useQuery.IsDisconnectionFlow;
5127
- const _useTranslation = reactI18next.useTranslation(),
5128
- t = _useTranslation.t;
5315
+ const {
5316
+ workflow: ModuleWorkflow,
5317
+ IsDisconnectionFlow
5318
+ } = Digit.Hooks.useQueryParams();
5319
+ const {
5320
+ t
5321
+ } = reactI18next.useTranslation();
5129
5322
  const history = reactRouterDom.useHistory();
5130
5323
  const queryClient = reactQuery.useQueryClient();
5131
- const _useLocation = reactRouterDom.useLocation(),
5132
- state = _useLocation.state,
5133
- search = _useLocation.search;
5134
- const _useRouteMatch = reactRouterDom.useRouteMatch();
5135
- let _useParams = reactRouterDom.useParams(),
5136
- consumerCode = _useParams.consumerCode,
5137
- businessService = _useParams.businessService;
5324
+ const {
5325
+ state,
5326
+ search
5327
+ } = reactRouterDom.useLocation();
5328
+ const {
5329
+ path: currentPath
5330
+ } = reactRouterDom.useRouteMatch();
5331
+ let {
5332
+ consumerCode,
5333
+ businessService
5334
+ } = reactRouterDom.useParams();
5138
5335
  const tenantId = Digit.ULBService.getCurrentTenantId();
5139
- const _useState = React.useState(0),
5140
- Time = _useState[0],
5141
- setTime = _useState[1];
5336
+ const [Time, setTime] = React.useState(0);
5142
5337
  if (window.location.href.includes("ISWSAPP")) consumerCode = new URLSearchParams(search).get("applicationNumber");
5143
5338
  if (window.location.href.includes("ISWSCON") || ModuleWorkflow === "WS") consumerCode = decodeURIComponent(consumerCode);
5144
- const _Digit$Hooks$useFetch = Digit.Hooks.useFetchPayment({
5145
- tenantId: tenantId,
5146
- consumerCode,
5147
- businessService
5148
- }),
5149
- paymentdetails = _Digit$Hooks$useFetch.data,
5150
- isLoading = _Digit$Hooks$useFetch.isLoading;
5339
+ const {
5340
+ data: paymentdetails,
5341
+ isLoading
5342
+ } = Digit.Hooks.useFetchPayment({
5343
+ tenantId: tenantId,
5344
+ consumerCode,
5345
+ businessService
5346
+ });
5151
5347
  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] : {};
5152
- const _Digit$Hooks$fsm$useS = Digit.Hooks.fsm.useSearch(tenantId, {
5153
- applicationNos: consumerCode
5154
- }, {
5155
- staleTime: Infinity,
5156
- enabled: businessService !== null && businessService !== void 0 && (_businessService$toUp = businessService.toUpperCase()) !== null && _businessService$toUp !== void 0 && _businessService$toUp.includes("FSM") ? true : false
5157
- }),
5158
- applicationData = _Digit$Hooks$fsm$useS.data;
5348
+ const {
5349
+ data: applicationData
5350
+ } = Digit.Hooks.fsm.useSearch(tenantId, {
5351
+ applicationNos: consumerCode
5352
+ }, {
5353
+ staleTime: Infinity,
5354
+ enabled: businessService !== null && businessService !== void 0 && (_businessService$toUp = businessService.toUpperCase()) !== null && _businessService$toUp !== void 0 && _businessService$toUp.includes("FSM") ? true : false
5355
+ });
5159
5356
  const advanceBill = applicationData === null || applicationData === void 0 ? void 0 : applicationData.advanceAmount;
5160
- const _useCardPaymentDetail = useCardPaymentDetails(props, t),
5161
- cardConfig = _useCardPaymentDetail.cardConfig;
5162
- const _useChequeDetails = useChequeDetails(props, t),
5163
- chequeConfig = _useChequeDetails.chequeConfig;
5164
- const _useCashPaymentDetail = useCashPaymentDetails(props, t),
5165
- cashConfig = _useCashPaymentDetail.cashConfig;
5166
- const _useState2 = React.useState({}),
5167
- formState = _useState2[0],
5168
- setFormState = _useState2[1];
5169
- const _useState3 = React.useState(null),
5170
- toast = _useState3[0],
5171
- setToast = _useState3[1];
5357
+ const {
5358
+ cardConfig
5359
+ } = useCardPaymentDetails(props, t);
5360
+ const {
5361
+ chequeConfig
5362
+ } = useChequeDetails(props, t);
5363
+ const {
5364
+ cashConfig
5365
+ } = useCashPaymentDetails(props, t);
5366
+ const [formState, setFormState] = React.useState({});
5367
+ const [toast, setToast] = React.useState(null);
5172
5368
  React.useEffect(() => {
5173
5369
  if (paymentdetails !== null && paymentdetails !== void 0 && paymentdetails.Bill && paymentdetails.Bill.length === 0) {
5174
5370
  setToast({
@@ -5202,15 +5398,11 @@ const CollectPayment = props => {
5202
5398
  code: "OTHER",
5203
5399
  name: t("COMMON_OTHER")
5204
5400
  }];
5205
- const _useState4 = React.useState((formState === null || formState === void 0 ? void 0 : formState.selectedPaymentMode) || getPaymentModes()[0]),
5206
- selectedPaymentMode = _useState4[0],
5207
- setPaymentMode = _useState4[1];
5208
- const _useState5 = React.useState((formState === null || formState === void 0 ? void 0 : formState.paidBy) || {
5209
- code: "OWNER",
5210
- name: t("COMMON_OWNER")
5211
- }),
5212
- selectedPaidBy = _useState5[0],
5213
- setselectedPaidBy = _useState5[1];
5401
+ const [selectedPaymentMode, setPaymentMode] = React.useState((formState === null || formState === void 0 ? void 0 : formState.selectedPaymentMode) || getPaymentModes()[0]);
5402
+ const [selectedPaidBy, setselectedPaidBy] = React.useState((formState === null || formState === void 0 ? void 0 : formState.paidBy) || {
5403
+ code: "OWNER",
5404
+ name: t("COMMON_OWNER")
5405
+ });
5214
5406
  const onSubmit = function (data) {
5215
5407
  try {
5216
5408
  var _data$amount, _data$amount6, _data$amount7, _data$paymentMode, _data$paymentModeDeta, _recieptRequest$Payme2, _recieptRequest$Payme3, _recieptRequest$Payme4, _recieptRequest$Payme5, _recieptRequest$Payme6;
@@ -5228,12 +5420,15 @@ const CollectPayment = props => {
5228
5420
  });
5229
5421
  return Promise.resolve();
5230
5422
  }
5231
- const ManualRecieptDetails = data.ManualRecieptDetails,
5232
- paymentModeDetails = data.paymentModeDetails,
5233
- rest = _objectWithoutPropertiesLoose(data, _excluded$2);
5234
- const _ref = paymentModeDetails || {},
5235
- errorObj = _ref.errorObj,
5236
- details = _objectWithoutPropertiesLoose(_ref, _excluded2);
5423
+ const {
5424
+ ManualRecieptDetails,
5425
+ paymentModeDetails,
5426
+ ...rest
5427
+ } = data;
5428
+ const {
5429
+ errorObj,
5430
+ ...details
5431
+ } = paymentModeDetails || {};
5237
5432
  let recieptRequest = {
5238
5433
  Payment: {
5239
5434
  mobileNumber: data.payerMobile,
@@ -5263,7 +5458,10 @@ const CollectPayment = props => {
5263
5458
  recieptRequest.Payment.paymentMode = data === null || data === void 0 ? void 0 : (_data$paymentMode = data.paymentMode) === null || _data$paymentMode === void 0 ? void 0 : _data$paymentMode.code;
5264
5459
  if (data.paymentModeDetails) {
5265
5460
  var _recieptRequest$Payme;
5266
- recieptRequest.Payment = _extends({}, recieptRequest.Payment, details);
5461
+ recieptRequest.Payment = {
5462
+ ...recieptRequest.Payment,
5463
+ ...details
5464
+ };
5267
5465
  delete recieptRequest.Payment.paymentModeDetails;
5268
5466
  if (data.paymentModeDetails.errorObj) {
5269
5467
  const errors = data.paymentModeDetails.errorObj;
@@ -5271,7 +5469,7 @@ const CollectPayment = props => {
5271
5469
  if (messages) {
5272
5470
  setToast({
5273
5471
  key: "error",
5274
- action: messages + " " + t("ES_ERROR_REQUIRED")
5472
+ action: `${messages} ${t("ES_ERROR_REQUIRED")}`
5275
5473
  });
5276
5474
  setTimeout(() => setToast(null), 5000);
5277
5475
  return Promise.resolve();
@@ -5308,7 +5506,7 @@ const CollectPayment = props => {
5308
5506
  return Promise.resolve(Digit.PaymentService.createReciept(tenantId, recieptRequest)).then(function (resposne) {
5309
5507
  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;
5310
5508
  queryClient.invalidateQueries();
5311
- 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);
5509
+ 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}`);
5312
5510
  });
5313
5511
  }, function (error) {
5314
5512
  var _setToast, _error$response, _error$response$data, _error$response$data$;
@@ -5339,7 +5537,7 @@ const CollectPayment = props => {
5339
5537
  marginBottom: 0,
5340
5538
  textAlign: "right"
5341
5539
  }
5342
- }, " ", "\u20B9 " + (bill === null || bill === void 0 ? void 0 : bill.totalAmount), " ")
5540
+ }, " ", `₹ ${bill === null || bill === void 0 ? void 0 : bill.totalAmount}`, " ")
5343
5541
  }]
5344
5542
  }, {
5345
5543
  head: t("PAYMENT_PAID_BY_HEAD"),
@@ -5499,7 +5697,7 @@ const CollectPayment = props => {
5499
5697
  }
5500
5698
  }), toast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
5501
5699
  error: toast.key === "error",
5502
- label: t(toast.key === "success" ? "ES_" + businessService.split(".")[0].toLowerCase() + "_" + toast.action + "_UPDATE_SUCCESS" : toast.action),
5700
+ label: t(toast.key === "success" ? `ES_${businessService.split(".")[0].toLowerCase()}_${toast.action}_UPDATE_SUCCESS` : toast.action),
5503
5701
  onClose: () => setToast(null),
5504
5702
  style: {
5505
5703
  maxWidth: "670px"
@@ -5515,7 +5713,7 @@ const convertEpochToDate$1 = dateEpoch => {
5515
5713
  let year = dateFromApi.getFullYear();
5516
5714
  month = (month > 9 ? "" : "0") + month;
5517
5715
  day = (day > 9 ? "" : "0") + day;
5518
- return day + "/" + month + "/" + year;
5716
+ return `${day}/${month}/${year}`;
5519
5717
  } else {
5520
5718
  return "NA";
5521
5719
  }
@@ -5523,34 +5721,35 @@ const convertEpochToDate$1 = dateEpoch => {
5523
5721
  const SuccessfulPayment$1 = props => {
5524
5722
  var _location, _location$pathname, _data$6, _data$7, _data$8, _data$9, _data$0, _data$1, _data$10, _data$11, _data$12;
5525
5723
  const history = reactRouterDom.useHistory();
5526
- const _useTranslation = reactI18next.useTranslation(),
5527
- t = _useTranslation.t;
5724
+ const {
5725
+ t
5726
+ } = reactI18next.useTranslation();
5528
5727
  const queryClient = reactQuery.useQueryClient();
5529
- const _Digit$Hooks$useQuery = Digit.Hooks.useQueryParams(),
5530
- IsDisconnectionFlow = _Digit$Hooks$useQuery.IsDisconnectionFlow;
5531
- const _useState = React.useState(false),
5532
- displayMenu = _useState[0],
5533
- setDisplayMenu = _useState[1];
5534
- const _useState2 = React.useState(null),
5535
- selectedAction = _useState2[0],
5536
- setSelectedAction = _useState2[1];
5728
+ const {
5729
+ IsDisconnectionFlow
5730
+ } = Digit.Hooks.useQueryParams();
5731
+ const [displayMenu, setDisplayMenu] = React.useState(false);
5732
+ const [selectedAction, setSelectedAction] = React.useState(null);
5537
5733
  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");
5538
- const combineResponseFSM = isFSMResponse ? t("PAYMENT_COLLECT_LABEL") + " / " + t("PAYMENT_COLLECT") : t("PAYMENT_LOCALIZATION_RESPONSE");
5734
+ const combineResponseFSM = isFSMResponse ? `${t("PAYMENT_COLLECT_LABEL")} / ${t("PAYMENT_COLLECT")}` : t("PAYMENT_LOCALIZATION_RESPONSE");
5539
5735
  props.setLink(combineResponseFSM);
5540
- let _useParams = reactRouterDom.useParams(),
5541
- consumerCode = _useParams.consumerCode,
5542
- receiptNumber = _useParams.receiptNumber,
5543
- businessService = _useParams.businessService;
5736
+ let {
5737
+ consumerCode,
5738
+ receiptNumber,
5739
+ businessService
5740
+ } = reactRouterDom.useParams();
5544
5741
  const tenantId = Digit.ULBService.getCurrentTenantId();
5545
5742
  receiptNumber = receiptNumber.replace(/%2F/g, "/");
5546
- const _Digit$Hooks$obps$use = Digit.Hooks.obps.useOBPSSearch("", {}, tenantId, {
5547
- applicationNo: consumerCode
5548
- }, {}, {
5549
- enabled: businessService !== null && businessService !== void 0 && businessService.includes("BPA") ? true : false
5550
- }),
5551
- _Digit$Hooks$obps$use2 = _Digit$Hooks$obps$use.data,
5552
- data = _Digit$Hooks$obps$use2 === void 0 ? {} : _Digit$Hooks$obps$use2,
5553
- isBpaSearchLoading = _Digit$Hooks$obps$use.isLoading;
5743
+ const {
5744
+ data = {},
5745
+ isLoading: isBpaSearchLoading,
5746
+ isSuccess: isBpaSuccess,
5747
+ error: bpaerror
5748
+ } = Digit.Hooks.obps.useOBPSSearch("", {}, tenantId, {
5749
+ applicationNo: consumerCode
5750
+ }, {}, {
5751
+ enabled: businessService !== null && businessService !== void 0 && businessService.includes("BPA") ? true : false
5752
+ });
5554
5753
  const FSM_EDITOR = Digit.UserService.hasAccess("FSM_EDITOR_EMP") || false;
5555
5754
  function onActionSelect(action) {
5556
5755
  setSelectedAction(action);
@@ -5593,7 +5792,7 @@ const SuccessfulPayment$1 = props => {
5593
5792
  case "GO_TO_HOME":
5594
5793
  return history.push("/digit-ui/employee");
5595
5794
  case "ASSIGN_TO_DSO":
5596
- return history.push("/digit-ui/employee/fsm/application-details/" + consumerCode);
5795
+ return history.push(`/digit-ui/employee/fsm/application-details/${consumerCode}`);
5597
5796
  default:
5598
5797
  return null;
5599
5798
  }
@@ -5608,23 +5807,26 @@ const SuccessfulPayment$1 = props => {
5608
5807
  if (businessService !== null && businessService !== void 0 && businessService.includes("BPA")) {
5609
5808
  let nameOfAchitect = sessionStorage.getItem("BPA_ARCHITECT_NAME");
5610
5809
  let parsedArchitectName = nameOfAchitect ? JSON.parse(nameOfAchitect) : "ARCHITECT";
5611
- return t("ES_PAYMENT_" + businessService + "_" + parsedArchitectName + "_SUCCESSFUL_DESCRIPTION");
5810
+ return t(`ES_PAYMENT_${businessService}_${parsedArchitectName}_SUCCESSFUL_DESCRIPTION`);
5612
5811
  } else if (businessService !== null && businessService !== void 0 && businessService.includes("WS") || businessService !== null && businessService !== void 0 && businessService.includes("SW")) {
5613
- return t("ES_PAYMENT_WS_" + (businessService === null || businessService === void 0 ? void 0 : businessService.replace(/\./g, "_")) + "_SUCCESSFUL_DESCRIPTION");
5812
+ return t(`ES_PAYMENT_WS_${businessService === null || businessService === void 0 ? void 0 : businessService.replace(/\./g, "_")}_SUCCESSFUL_DESCRIPTION`);
5614
5813
  } else {
5615
5814
  return t("ES_PAYMENT_SUCCESSFUL_DESCRIPTION");
5616
5815
  }
5617
5816
  };
5618
- const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS(tenantId, "common-masters", "ReceiptKey", {
5619
- select: data => {
5620
- var _data$commonMasters, _data$commonMasters$u, _data$commonMasters$u2;
5621
- 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 => {
5622
- let code = _ref.code;
5623
- return businessService === null || businessService === void 0 ? void 0 : businessService.includes(code);
5624
- })[0]) === null || _data$commonMasters$u2 === void 0 ? void 0 : _data$commonMasters$u2.receiptKey) || "consolidatedreceipt";
5625
- }
5626
- }),
5627
- generatePdfKey = _Digit$Hooks$useCommo.data;
5817
+ const {
5818
+ data: generatePdfKey
5819
+ } = Digit.Hooks.useCommonMDMS(tenantId, "common-masters", "ReceiptKey", {
5820
+ select: data => {
5821
+ var _data$commonMasters, _data$commonMasters$u, _data$commonMasters$u2;
5822
+ 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 => {
5823
+ let {
5824
+ code
5825
+ } = _ref;
5826
+ return businessService === null || businessService === void 0 ? void 0 : businessService.includes(code);
5827
+ })[0]) === null || _data$commonMasters$u2 === void 0 ? void 0 : _data$commonMasters$u2.receiptKey) || "consolidatedreceipt";
5828
+ }
5829
+ });
5628
5830
  const printCertificate = function () {
5629
5831
  try {
5630
5832
  const tenantId = Digit.ULBService.getCurrentTenantId();
@@ -5717,9 +5919,12 @@ const SuccessfulPayment$1 = props => {
5717
5919
  edcrData = edcrResponse === null || edcrResponse === void 0 ? void 0 : (_edcrResponse$edcrDet = edcrResponse.edcrDetail) === null || _edcrResponse$edcrDet === void 0 ? void 0 : _edcrResponse$edcrDet[0];
5718
5920
  let currentDate = new Date();
5719
5921
  bpaData.additionalDetails.runDate = convertDateToEpoch(currentDate.getFullYear() + "-" + (currentDate.getMonth() + 1) + "-" + currentDate.getDate());
5720
- let reqData = _extends({}, bpaData, {
5721
- edcrDetail: [_extends({}, edcrData)]
5722
- });
5922
+ let reqData = {
5923
+ ...bpaData,
5924
+ edcrDetail: [{
5925
+ ...edcrData
5926
+ }]
5927
+ };
5723
5928
  return Promise.resolve(Digit.PaymentService.generatePdf(bpaData === null || bpaData === void 0 ? void 0 : bpaData.tenantId, {
5724
5929
  Bpa: [reqData]
5725
5930
  }, order)).then(function (response) {
@@ -5730,7 +5935,9 @@ const SuccessfulPayment$1 = props => {
5730
5935
  window.open(fileStore[response === null || response === void 0 ? void 0 : response.filestoreIds[0]], "_blank");
5731
5936
  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;
5732
5937
  return Promise.resolve(Digit.OBPSService.edcr_report_download({
5733
- BPA: _extends({}, reqData)
5938
+ BPA: {
5939
+ ...reqData
5940
+ }
5734
5941
  })).then(function (edcrResponseData) {
5735
5942
  const responseStatus = parseInt(edcrResponseData.status, 10);
5736
5943
  if (responseStatus === 201 || responseStatus === 200) {
@@ -5738,7 +5945,7 @@ const SuccessfulPayment$1 = props => {
5738
5945
  type: "application/pdf"
5739
5946
  })) : downloadPdf(new Blob([edcrResponseData.data], {
5740
5947
  type: "application/pdf"
5741
- }), "edcrReport.pdf");
5948
+ }), `edcrReport.pdf`);
5742
5949
  }
5743
5950
  });
5744
5951
  });
@@ -5807,16 +6014,21 @@ const SuccessfulPayment$1 = props => {
5807
6014
  return Promise.resolve(Digit.OBPSService.BPASearch(payments.Payments[0].tenantId, queryObj)).then(function (bpaResponse) {
5808
6015
  var _bpaResponse$BPA$, _bpaResponse$BPA$$add, _paymentData$paymentD, _bpaResponse$BPA$2, _bpaResponse$BPA$2$ad;
5809
6016
  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;
5810
- const updatedpayments = _extends({}, paymentData, {
5811
- paymentDetails: [_extends({}, (_paymentData$paymentD = paymentData.paymentDetails) === null || _paymentData$paymentD === void 0 ? void 0 : _paymentData$paymentD[0], {
5812
- additionalDetails: _extends({}, paymentData.paymentDetails[0].additionalDetails, {
6017
+ const updatedpayments = {
6018
+ ...paymentData,
6019
+ paymentDetails: [{
6020
+ ...((_paymentData$paymentD = paymentData.paymentDetails) === null || _paymentData$paymentD === void 0 ? void 0 : _paymentData$paymentD[0]),
6021
+ additionalDetails: {
6022
+ ...paymentData.paymentDetails[0].additionalDetails,
5813
6023
  "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,
5814
6024
  "stakeholderType": formattedStakeholderType.charAt(0).toUpperCase() + formattedStakeholderType.slice(1).toLowerCase()
5815
- })
5816
- })]
5817
- });
6025
+ }
6026
+ }]
6027
+ };
5818
6028
  return Promise.resolve(Digit.PaymentService.generatePdf(state, {
5819
- Payments: [_extends({}, updatedpayments)]
6029
+ Payments: [{
6030
+ ...updatedpayments
6031
+ }]
5820
6032
  }, generatePdfKey)).then(function (_Digit$PaymentService2) {
5821
6033
  response = _Digit$PaymentService2;
5822
6034
  });
@@ -6195,9 +6407,10 @@ const SuccessfulPayment$1 = props => {
6195
6407
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
6196
6408
  hallsBookingApplication: [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]]
6197
6409
  }, generatePdfKeyForTL)).then(function (response) {
6198
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0], {
6410
+ const updatedApplication = {
6411
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]),
6199
6412
  permissionLetterFilestoreId: response === null || response === void 0 ? void 0 : response.filestoreIds[0]
6200
- });
6413
+ };
6201
6414
  return Promise.resolve(mutation.mutateAsync({
6202
6415
  hallsBookingApplication: updatedApplication
6203
6416
  })).then(function () {
@@ -6235,9 +6448,10 @@ const SuccessfulPayment$1 = props => {
6235
6448
  return Promise.resolve(Digit.PaymentService.generatePdf(tenantId, {
6236
6449
  bookingApplication: [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]]
6237
6450
  }, generatePdfKeyForTL)).then(function (response) {
6238
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0], {
6451
+ const updatedApplication = {
6452
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]),
6239
6453
  permissionLetterFilestoreId: response === null || response === void 0 ? void 0 : response.filestoreIds[0]
6240
- });
6454
+ };
6241
6455
  return Promise.resolve(AdvertisementCreateApi.mutateAsync({
6242
6456
  bookingApplication: updatedApplication
6243
6457
  })).then(function () {
@@ -6313,9 +6527,10 @@ const SuccessfulPayment$1 = props => {
6313
6527
  }, "advservice-receipt")).then(function (_Digit$PaymentService8) {
6314
6528
  var _response;
6315
6529
  response = _Digit$PaymentService8;
6316
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0], {
6530
+ const updatedApplication = {
6531
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.bookingApplication[0]),
6317
6532
  paymentReceiptFilestoreId: (_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]
6318
- });
6533
+ };
6319
6534
  return Promise.resolve(AdvertisementCreateApi.mutateAsync({
6320
6535
  bookingApplication: updatedApplication
6321
6536
  })).then(function () {
@@ -6363,9 +6578,10 @@ const SuccessfulPayment$1 = props => {
6363
6578
  }, "chbservice-receipt")).then(function (_Digit$PaymentService9) {
6364
6579
  var _response3;
6365
6580
  response = _Digit$PaymentService9;
6366
- const updatedApplication = _extends({}, applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0], {
6581
+ const updatedApplication = {
6582
+ ...(applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.hallsBookingApplication[0]),
6367
6583
  paymentReceiptFilestoreId: (_response3 = response) === null || _response3 === void 0 ? void 0 : _response3.filestoreIds[0]
6368
- });
6584
+ };
6369
6585
  return Promise.resolve(mutation.mutateAsync({
6370
6586
  hallsBookingApplication: updatedApplication
6371
6587
  })).then(function () {
@@ -6640,10 +6856,12 @@ const SuccessfulPayment$1 = props => {
6640
6856
  };
6641
6857
  const FailedPayment$1 = props => {
6642
6858
  props.setLink("Response");
6643
- const _useTranslation2 = reactI18next.useTranslation(),
6644
- t = _useTranslation2.t;
6645
- const _useParams2 = reactRouterDom.useParams(),
6646
- consumerCode = _useParams2.consumerCode;
6859
+ const {
6860
+ t
6861
+ } = reactI18next.useTranslation();
6862
+ const {
6863
+ consumerCode
6864
+ } = reactRouterDom.useParams();
6647
6865
  const getMessage = () => t("ES_PAYMENT_COLLECTED_ERROR");
6648
6866
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Banner, {
6649
6867
  message: getMessage(),
@@ -6687,12 +6905,14 @@ const middleWare_3 = function (data, _break, _next) {
6687
6905
  const _temp3 = function () {
6688
6906
  if (data.b === "b") {
6689
6907
  const _temp2 = _catch(function () {
6690
- return Promise.resolve(window.fetch("https://ifsc.razorpay.com/hdfc0000090")).then(function (res) {
6908
+ return Promise.resolve(window.fetch(`https://ifsc.razorpay.com/hdfc0000090`)).then(function (res) {
6691
6909
  const _temp = function () {
6692
6910
  if (res.ok) {
6693
6911
  return Promise.resolve(res.json()).then(function (_ref) {
6694
- let BANK = _ref.BANK,
6695
- BRANCH = _ref.BRANCH;
6912
+ let {
6913
+ BANK,
6914
+ BRANCH
6915
+ } = _ref;
6696
6916
  data.BANKFROMMiddleWare = BANK;
6697
6917
  });
6698
6918
  } else alert("Wrong IFSC Code");
@@ -6787,12 +7007,14 @@ const testForm = {
6787
7007
  setBankDetailsFromIFSC: function (props) {
6788
7008
  try {
6789
7009
  const _temp6 = _catch(function () {
6790
- return Promise.resolve(window.fetch("https://ifsc.razorpay.com/" + props.getValues("ifsc"))).then(function (res) {
7010
+ return Promise.resolve(window.fetch(`https://ifsc.razorpay.com/${props.getValues("ifsc")}`)).then(function (res) {
6791
7011
  const _temp5 = function () {
6792
7012
  if (res.ok) {
6793
7013
  return Promise.resolve(res.json()).then(function (_ref2) {
6794
- let BANK = _ref2.BANK,
6795
- BRANCH = _ref2.BRANCH;
7014
+ let {
7015
+ BANK,
7016
+ BRANCH
7017
+ } = _ref2;
6796
7018
  props.setValue("bank", BANK);
6797
7019
  props.setValue("branch", BRANCH);
6798
7020
  });
@@ -6847,28 +7069,29 @@ const testForm = {
6847
7069
  };
6848
7070
 
6849
7071
  const IFrameInterface = props => {
6850
- const stateCode = props.stateCode;
6851
- const _useParams = reactRouterDom.useParams(),
6852
- moduleName = _useParams.moduleName,
6853
- pageName = _useParams.pageName;
6854
- const _useTranslation = reactI18next.useTranslation(),
6855
- t = _useTranslation.t;
6856
- const _useState = React.useState(""),
6857
- url = _useState[0],
6858
- setUrl = _useState[1];
6859
- const _useState2 = React.useState(""),
6860
- title = _useState2[0],
6861
- setTitle = _useState2[1];
6862
- const _Digit$Hooks$dss$useM = Digit.Hooks.dss.useMDMS(stateCode, "common-masters", ["uiCommonConstants"], {
6863
- select: data => {
6864
- var _data$commonMasters, _data$commonMasters$u;
6865
- 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]) || {};
6866
- return formattedResponse;
6867
- },
6868
- enabled: true
6869
- }),
6870
- data = _Digit$Hooks$dss$useM.data,
6871
- isLoading = _Digit$Hooks$dss$useM.isLoading;
7072
+ const {
7073
+ stateCode
7074
+ } = props;
7075
+ const {
7076
+ moduleName,
7077
+ pageName
7078
+ } = reactRouterDom.useParams();
7079
+ const {
7080
+ t
7081
+ } = reactI18next.useTranslation();
7082
+ const [url, setUrl] = React.useState("");
7083
+ const [title, setTitle] = React.useState("");
7084
+ const {
7085
+ data,
7086
+ isLoading
7087
+ } = Digit.Hooks.dss.useMDMS(stateCode, "common-masters", ["uiCommonConstants"], {
7088
+ select: data => {
7089
+ var _data$commonMasters, _data$commonMasters$u;
7090
+ 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]) || {};
7091
+ return formattedResponse;
7092
+ },
7093
+ enabled: true
7094
+ });
6872
7095
  React.useEffect(() => {
6873
7096
  var _data$moduleName, _data$moduleName$ifra;
6874
7097
  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]) || {};
@@ -6876,7 +7099,7 @@ const IFrameInterface = props => {
6876
7099
  const domain = isOrign ? process.env.NODE_ENV === "development" ? "https://qa.digit.org" : document.location.origin : pageObject === null || pageObject === void 0 ? void 0 : pageObject["domain"];
6877
7100
  const contextPath = (pageObject === null || pageObject === void 0 ? void 0 : pageObject["routePath"]) || "";
6878
7101
  const title = (pageObject === null || pageObject === void 0 ? void 0 : pageObject["title"]) || "";
6879
- let url = "" + domain + contextPath;
7102
+ let url = `${domain}${contextPath}`;
6880
7103
  setUrl(url);
6881
7104
  setTitle(title);
6882
7105
  }, [data, moduleName, pageName]);
@@ -6898,15 +7121,18 @@ const IFrameInterface = props => {
6898
7121
  digitUiLibraries.subFormRegistry === null || digitUiLibraries.subFormRegistry === void 0 ? void 0 : digitUiLibraries.subFormRegistry.addSubForm("testForm", testForm);
6899
7122
  const EmployeePayment = _ref => {
6900
7123
  var _location, _location$pathname, _location2, _location2$pathname;
6901
- let stateCode = _ref.stateCode,
6902
- cityCode = _ref.cityCode,
6903
- moduleCode = _ref.moduleCode;
6904
- const _useRouteMatch = reactRouterDom.useRouteMatch(),
6905
- currentPath = _useRouteMatch.path;
6906
- const _useTranslation = reactI18next.useTranslation(),
6907
- t = _useTranslation.t;
6908
- const _useState = React.useState(null),
6909
- setLink = _useState[1];
7124
+ let {
7125
+ stateCode,
7126
+ cityCode,
7127
+ moduleCode
7128
+ } = _ref;
7129
+ const {
7130
+ path: currentPath
7131
+ } = reactRouterDom.useRouteMatch();
7132
+ const {
7133
+ t
7134
+ } = reactI18next.useTranslation();
7135
+ const [link, setLink] = React.useState(null);
6910
7136
  const commonProps = {
6911
7137
  stateCode,
6912
7138
  cityCode,
@@ -6963,29 +7189,32 @@ const EmployeePayment = _ref => {
6963
7189
  }, /*#__PURE__*/React__default.createElement("div", {
6964
7190
  className: "employee-form-content"
6965
7191
  }, /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
6966
- path: currentPath + "/collect/:businessService/:consumerCode"
7192
+ path: `${currentPath}/collect/:businessService/:consumerCode`
6967
7193
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LayoutWrapper, {
6968
7194
  layoutClass: "action"
6969
7195
  }, /*#__PURE__*/React__default.createElement(CollectPayment, _extends({}, commonProps, {
6970
7196
  basePath: currentPath
6971
7197
  })))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
6972
- path: currentPath + "/success/:businessService/:receiptNumber/:consumerCode"
7198
+ path: `${currentPath}/success/:businessService/:receiptNumber/:consumerCode`
6973
7199
  }, /*#__PURE__*/React__default.createElement(SuccessfulPayment$1, commonProps)), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
6974
- path: currentPath + "/integration/:moduleName/:pageName"
7200
+ path: `${currentPath}/integration/:moduleName/:pageName`
6975
7201
  }, /*#__PURE__*/React__default.createElement(IFrameInterface, commonProps)), /*#__PURE__*/React__default.createElement(digitUiReactComponents.PrivateRoute, {
6976
- path: currentPath + "/failure"
7202
+ path: `${currentPath}/failure`
6977
7203
  }, /*#__PURE__*/React__default.createElement(FailedPayment$1, commonProps)))))));
6978
7204
  };
6979
7205
 
6980
7206
  const PaymentModule = _ref => {
6981
- let stateCode = _ref.stateCode,
6982
- cityCode = _ref.cityCode,
6983
- _ref$moduleCode = _ref.moduleCode,
6984
- moduleCode = _ref$moduleCode === void 0 ? "Payment" : _ref$moduleCode,
6985
- userType = _ref.userType;
6986
- const _useRouteMatch = reactRouterDom.useRouteMatch(),
6987
- path = _useRouteMatch.path,
6988
- url = _useRouteMatch.url;
7207
+ let {
7208
+ deltaConfig = {},
7209
+ stateCode,
7210
+ cityCode,
7211
+ moduleCode = "Payment",
7212
+ userType
7213
+ } = _ref;
7214
+ const {
7215
+ path,
7216
+ url
7217
+ } = reactRouterDom.useRouteMatch();
6989
7218
  const store = {
6990
7219
  data: {}
6991
7220
  };
@@ -7008,7 +7237,9 @@ const PaymentModule = _ref => {
7008
7237
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, getPaymentHome());
7009
7238
  };
7010
7239
  const PaymentLinks = _ref2 => {
7011
- const _useTranslation = reactI18next.useTranslation();
7240
+ const {
7241
+ t
7242
+ } = reactI18next.useTranslation();
7012
7243
  return null;
7013
7244
  };
7014
7245
  const paymentConfigs = {