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