@mseva/digit-ui-module-mcollect 1.0.3 → 1.0.5

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.
@@ -2,7 +2,7 @@ import { CheckBox, Loader, MultiSelectDropdown, RemoveableTag, CloseSvg, Refresh
2
2
  import React, { useState, useEffect, useMemo, useCallback } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useParams, useHistory, useRouteMatch, useLocation, Switch, Link, Route } from 'react-router-dom';
5
- import { useForm, useWatch, Controller } from 'react-hook-form';
5
+ import { useForm, useWatch, Controller, FormProvider } from 'react-hook-form';
6
6
  import 'react-query';
7
7
 
8
8
  const StatusCount = ({
@@ -6025,7 +6025,7 @@ const getActionButton = (businessService, receiptNumber) => {
6025
6025
  onClick: value => {
6026
6026
  downloadAndPrintReciept(businessService, receiptNumber);
6027
6027
  }
6028
- }, " ", t(`${"UC_DOWNLOAD_RECEIPT"}`), " ");
6028
+ }, " ", t(`${"CS_COMMON_DOWNLOAD_RECEIPT"}`), " ");
6029
6029
  };
6030
6030
  const stringReplaceAll = (str = "", searcher = "", replaceWith = "") => {
6031
6031
  if (searcher == "") return str;
@@ -6074,7 +6074,7 @@ const printPdf = blob => {
6074
6074
  });
6075
6075
  }
6076
6076
  };
6077
- const downloadAndPrintChallan = async (challanNo, mode = "download") => {
6077
+ const downloadAndPrintChallan = async (challanNo, mode) => {
6078
6078
  const tenantId = Digit.ULBService.getCurrentTenantId();
6079
6079
  const response = await Digit.MCollectService.downloadPdf(challanNo, tenantId);
6080
6080
  const responseStatus = parseInt(response.status, 10);
@@ -6086,24 +6086,19 @@ const downloadAndPrintChallan = async (challanNo, mode = "download") => {
6086
6086
  }), `CHALLAN-${challanNo}.pdf`);
6087
6087
  }
6088
6088
  };
6089
- const downloadAndPrintReciept = async (bussinessService, consumerCode, mode = "download") => {
6089
+ const downloadAndPrintReciept = async (bussinessService, consumerCode, mode) => {
6090
6090
  var _response;
6091
6091
  const tenantId = Digit.ULBService.getCurrentTenantId();
6092
6092
  const data = await Digit.PaymentService.getReciept(tenantId, bussinessService, {
6093
6093
  consumerCodes: consumerCode
6094
6094
  });
6095
6095
  const payments = data === null || data === void 0 ? void 0 : data.Payments[0];
6096
+ console.log("payments", payments);
6096
6097
  let response = null;
6097
- if (payments !== null && payments !== void 0 && payments.fileStoreIdS) {
6098
+ if (payments !== null && payments !== void 0 && payments.fileStoreId) {
6098
6099
  response = {
6099
6100
  filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
6100
6101
  };
6101
- } else {
6102
- response = await Digit.PaymentService.generatePdf(tenantId, {
6103
- Payments: [{
6104
- ...payments
6105
- }]
6106
- }, "consolidatedreceipt");
6107
6102
  }
6108
6103
  const fileStore = await Digit.PaymentService.printReciept(tenantId, {
6109
6104
  fileStoreIds: response.filestoreIds[0]
@@ -6185,7 +6180,7 @@ const Filter = ({
6185
6180
  marginLeft: "8px",
6186
6181
  fontWeight: "normal"
6187
6182
  }
6188
- }, t("UC_FILTERS_LABEL"), ":")), /*#__PURE__*/React.createElement("div", {
6183
+ }, t("COMMON_TABLE_FILTERS"), ":")), /*#__PURE__*/React.createElement("div", {
6189
6184
  className: "clearAll",
6190
6185
  onClick: clearAll
6191
6186
  }, t("ES_COMMON_CLEAR_ALL")), props.type === "desktop" && /*#__PURE__*/React.createElement("span", {
@@ -6242,8 +6237,8 @@ const Filter = ({
6242
6237
  var _ob$, _ob$2, _ob$3;
6243
6238
  filterParam.push(ob === null || ob === void 0 ? void 0 : (_ob$ = ob[1]) === null || _ob$ === void 0 ? void 0 : _ob$.code);
6244
6239
  selectedCategory.push({
6245
- "code": ob === null || ob === void 0 ? void 0 : (_ob$2 = ob[1]) === null || _ob$2 === void 0 ? void 0 : _ob$2.code,
6246
- "i18nKey": `BILLINGSERVICE_BUSINESSSERVICE_${stringReplaceAll(ob === null || ob === void 0 ? void 0 : (_ob$3 = ob[1]) === null || _ob$3 === void 0 ? void 0 : _ob$3.code, ".", "_").toUpperCase()}`
6240
+ code: ob === null || ob === void 0 ? void 0 : (_ob$2 = ob[1]) === null || _ob$2 === void 0 ? void 0 : _ob$2.code,
6241
+ i18nKey: `BILLINGSERVICE_BUSINESSSERVICE_${stringReplaceAll(ob === null || ob === void 0 ? void 0 : (_ob$3 = ob[1]) === null || _ob$3 === void 0 ? void 0 : _ob$3.code, ".", "_").toUpperCase()}`
6247
6242
  });
6248
6243
  });
6249
6244
  let _new = {
@@ -6504,12 +6499,12 @@ const EmployeeChallan = props => {
6504
6499
  const challanDownload = {
6505
6500
  order: 1,
6506
6501
  label: t("UC_CHALLAN"),
6507
- onClick: () => downloadAndPrintChallan(challanno)
6502
+ onClick: () => downloadAndPrintChallan(challanno, "download")
6508
6503
  };
6509
6504
  const receiptDownload = {
6510
6505
  order: 2,
6511
6506
  label: t("Receipt"),
6512
- onClick: () => downloadAndPrintReciept(challanDetails === null || challanDetails === void 0 ? void 0 : challanDetails.businessService, challanno)
6507
+ onClick: () => downloadAndPrintReciept(challanDetails === null || challanDetails === void 0 ? void 0 : challanDetails.businessService, challanno, "download")
6513
6508
  };
6514
6509
  const workflowActions = ["CANCEL_CHALLAN", "UPDATE_CHALLAN", "BUTTON_PAY"];
6515
6510
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
@@ -6558,7 +6553,7 @@ const EmployeeChallan = props => {
6558
6553
  style: {
6559
6554
  padding: "10px 0px"
6560
6555
  }
6561
- }, t("UC_TOTAL_DUE_AMOUT_LABEL")),
6556
+ }, t("PAYMENT_CS_TOTAL_AMOUNT_DUE")),
6562
6557
  text: `₹${totalDueAmount}`,
6563
6558
  textStyle: {
6564
6559
  fontSize: "24px",
@@ -6571,7 +6566,7 @@ const EmployeeChallan = props => {
6571
6566
  padding: "10px 0px",
6572
6567
  fontWeight: "700"
6573
6568
  }
6574
- }, t("UC_SERVICE_DETAILS_LABEL")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
6569
+ }, t("SERVICEDETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
6575
6570
  label: `${t("UC_SERVICE_CATEGORY_LABEL")}`,
6576
6571
  text: `${t(`BILLINGSERVICE_BUSINESSSERVICE_${stringReplaceAll(challanDetails === null || challanDetails === void 0 ? void 0 : (_challanDetails$busin = challanDetails.businessService) === null || _challanDetails$busin === void 0 ? void 0 : _challanDetails$busin.toUpperCase(), ".", "_")}` || t("CS_NA"))}`,
6577
6572
  textStyle: {
@@ -6595,7 +6590,7 @@ const EmployeeChallan = props => {
6595
6590
  padding: "10px 0px",
6596
6591
  fontWeight: "700"
6597
6592
  }
6598
- }, t("UC_CONSUMER_DETAILS_LABEL")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
6593
+ }, t("CONSUMERDETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, /*#__PURE__*/React.createElement(Row, {
6599
6594
  label: `${t("UC_CONS_NAME_LABEL")}`,
6600
6595
  text: (challanDetails === null || challanDetails === void 0 ? void 0 : challanDetails.citizen.name) || t("CS_NA")
6601
6596
  }), /*#__PURE__*/React.createElement(Row, {
@@ -10272,6 +10267,18 @@ const InboxLinks = ({
10272
10267
  text: t("UC_GENERATE_NEW_CHALLAN"),
10273
10268
  link: "/digit-ui/employee/mcollect/new-application",
10274
10269
  roles: []
10270
+ }, {
10271
+ text: "Search Receipt",
10272
+ link: "/digit-ui/employee/mcollect/search-receipt",
10273
+ roles: []
10274
+ }, {
10275
+ text: "Search Challan",
10276
+ link: "/digit-ui/employee/mcollect/search-challan",
10277
+ roles: []
10278
+ }, {
10279
+ text: "Search and Pay",
10280
+ link: "/digit-ui/employee/mcollect/search-bill",
10281
+ roles: []
10275
10282
  }];
10276
10283
  useEffect(() => {
10277
10284
  let linksToShow = allLinks;
@@ -10377,7 +10384,7 @@ const SearchApplication = ({
10377
10384
  ...mobileViewStyles
10378
10385
  },
10379
10386
  onClick: clearSearch
10380
- }, t("UC_CLEAR_SEARCH_LABEL"));
10387
+ }, t("CS_COMMON_CLEAR_SEARCH"));
10381
10388
  };
10382
10389
  return /*#__PURE__*/React.createElement("form", {
10383
10390
  onSubmit: handleSubmit(onSubmitInput)
@@ -10405,7 +10412,7 @@ const SearchApplication = ({
10405
10412
  }, /*#__PURE__*/React.createElement("span", {
10406
10413
  key: index,
10407
10414
  className: "complaint-input"
10408
- }, " ", /*#__PURE__*/React.createElement(Label, null, input.label), input.type !== "date" ? /*#__PURE__*/React.createElement("div", {
10415
+ }, " ", /*#__PURE__*/React.createElement(Label, null, input.label), input.type !== "date" ? /*#__PURE__*/React.createElement("div", {
10409
10416
  className: "field-container"
10410
10417
  }, input !== null && input !== void 0 && input.componentInFront ? /*#__PURE__*/React.createElement("span", {
10411
10418
  className: "citizen-card-input citizen-card-input--front",
@@ -10439,7 +10446,7 @@ const SearchApplication = ({
10439
10446
  className: "search-submit-wrapper"
10440
10447
  }, /*#__PURE__*/React.createElement(SubmitBar, {
10441
10448
  className: "submit-bar-search",
10442
- label: t("UC_SEARCH_LABEL"),
10449
+ label: t("CS_INBOX_SEARCH"),
10443
10450
  submit: true
10444
10451
  }), !isInboxPage && /*#__PURE__*/React.createElement("div", null, clearAll()))))), (type === "mobile" || mobileView) && /*#__PURE__*/React.createElement(ActionBar, {
10445
10452
  className: "clear-search-container"
@@ -10449,7 +10456,7 @@ const SearchApplication = ({
10449
10456
  flex: 1
10450
10457
  }
10451
10458
  }, clearAll(mobileView)), /*#__PURE__*/React.createElement(SubmitBar, {
10452
- label: t("UC_SEARCH_LABEL"),
10459
+ label: t("CS_INBOX_SEARCH"),
10453
10460
  style: {
10454
10461
  flex: 1
10455
10462
  },
@@ -10466,6 +10473,7 @@ const DesktopInbox = ({
10466
10473
  const {
10467
10474
  data
10468
10475
  } = props;
10476
+ console.log("data", data);
10469
10477
  const {
10470
10478
  t
10471
10479
  } = useTranslation();
@@ -10499,7 +10507,7 @@ const DesktopInbox = ({
10499
10507
  className: "sla-cell"
10500
10508
  }, value);
10501
10509
  const inboxColumns = () => [{
10502
- Header: t("UC_CHALLAN_NUMBER"),
10510
+ Header: t("UC_CHALLAN_NO"),
10503
10511
  Cell: ({
10504
10512
  row
10505
10513
  }) => {
@@ -10532,7 +10540,7 @@ const DesktopInbox = ({
10532
10540
  },
10533
10541
  mobileCell: original => GetMobCell(`BILLINGSERVICE_BUSINESSSERVICE_${original === null || original === void 0 ? void 0 : original["businessService"]}`)
10534
10542
  }, {
10535
- Header: t("UC_RECIEPT_NUMBER_LABEL"),
10543
+ Header: t("UC_RECEPIT_NO_LABEL"),
10536
10544
  Cell: ({
10537
10545
  row
10538
10546
  }) => {
@@ -10541,7 +10549,7 @@ const DesktopInbox = ({
10541
10549
  },
10542
10550
  mobileCell: original => GetMobCell(original === null || original === void 0 ? void 0 : original["receiptNumber"]) || "-"
10543
10551
  }, {
10544
- Header: t("UC_DUE_DATE"),
10552
+ Header: t("WS_COMMON_TABLE_COL_DUE_DATE_LABEL"),
10545
10553
  Cell: ({
10546
10554
  row
10547
10555
  }) => {
@@ -10551,7 +10559,7 @@ const DesktopInbox = ({
10551
10559
  },
10552
10560
  mobileCell: original => GetMobCell(convertEpochToDate(original === null || original === void 0 ? void 0 : original["dueDate"]))
10553
10561
  }, {
10554
- Header: t("UC_TOTAL_AMOUNT"),
10562
+ Header: t("UC_COMMON_TOTAL_AMT"),
10555
10563
  Cell: ({
10556
10564
  row
10557
10565
  }) => {
@@ -10564,36 +10572,36 @@ const DesktopInbox = ({
10564
10572
  Cell: ({
10565
10573
  row
10566
10574
  }) => {
10567
- var _row$original11;
10568
- return GetCell(t(`${(_row$original11 = row.original) === null || _row$original11 === void 0 ? void 0 : _row$original11.applicationStatus}`));
10575
+ var _row$original1;
10576
+ return GetCell(t(`${(_row$original1 = row.original) === null || _row$original1 === void 0 ? void 0 : _row$original1.applicationStatus}`));
10569
10577
  },
10570
10578
  mobileCell: original => {
10571
10579
  var _original$workflowDat, _original$workflowDat2;
10572
10580
  return GetMobCell(original === null || original === void 0 ? void 0 : (_original$workflowDat = original.workflowData) === null || _original$workflowDat === void 0 ? void 0 : (_original$workflowDat2 = _original$workflowDat.state) === null || _original$workflowDat2 === void 0 ? void 0 : _original$workflowDat2["state"]);
10573
10581
  }
10574
10582
  }, {
10575
- Header: t("UC_TABLE_COL_ACTION"),
10583
+ Header: t("WS_COMMON_TABLE_COL_ACTION"),
10576
10584
  Cell: ({
10577
10585
  row
10578
10586
  }) => {
10579
- var _row$original12, _row$original16;
10580
- const amount = (_row$original12 = row.original) === null || _row$original12 === void 0 ? void 0 : _row$original12.totalAmount;
10587
+ var _row$original10, _row$original14;
10588
+ const amount = (_row$original10 = row.original) === null || _row$original10 === void 0 ? void 0 : _row$original10.totalAmount;
10581
10589
  let action = "ACTIVE";
10582
10590
  if (amount > 0) action = "COLLECT";
10583
10591
  if (action == "COLLECT") {
10584
- var _row$original13, _row$original14, _row$original15;
10592
+ var _row$original11, _row$original12, _row$original13;
10585
10593
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
10586
10594
  className: "link"
10587
10595
  }, /*#__PURE__*/React.createElement(Link, {
10588
10596
  to: {
10589
- pathname: `/digit-ui/employee/payment/collect/${(_row$original13 = row.original) === null || _row$original13 === void 0 ? void 0 : _row$original13["businessService"]}/${(_row$original14 = row.original) === null || _row$original14 === void 0 ? void 0 : _row$original14["challanNo"]}/tenantId=${(_row$original15 = row.original) === null || _row$original15 === void 0 ? void 0 : _row$original15["tenantId"]}?workflow=mcollect`
10597
+ pathname: `/digit-ui/employee/payment/collect/${(_row$original11 = row.original) === null || _row$original11 === void 0 ? void 0 : _row$original11["businessService"]}/${(_row$original12 = row.original) === null || _row$original12 === void 0 ? void 0 : _row$original12["challanNo"]}/tenantId=${(_row$original13 = row.original) === null || _row$original13 === void 0 ? void 0 : _row$original13["tenantId"]}?workflow=mcollect`
10590
10598
  }
10591
10599
  }, t(`UC_${action}`))));
10592
- } else if (((_row$original16 = row.original) === null || _row$original16 === void 0 ? void 0 : _row$original16.applicationStatus) == "PAID") {
10593
- var _row$original17, _row$original18;
10600
+ } else if (((_row$original14 = row.original) === null || _row$original14 === void 0 ? void 0 : _row$original14.applicationStatus) == "PAID") {
10601
+ var _row$original15, _row$original16;
10594
10602
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
10595
10603
  className: "link"
10596
- }, getActionButton((_row$original17 = row.original) === null || _row$original17 === void 0 ? void 0 : _row$original17["businessService"], (_row$original18 = row.original) === null || _row$original18 === void 0 ? void 0 : _row$original18["challanNo"])));
10604
+ }, getActionButton((_row$original15 = row.original) === null || _row$original15 === void 0 ? void 0 : _row$original15["businessService"], (_row$original16 = row.original) === null || _row$original16 === void 0 ? void 0 : _row$original16["challanNo"])));
10597
10605
  } else {
10598
10606
  return GetCell(t(`${"CS_NA"}`));
10599
10607
  }
@@ -10935,7 +10943,7 @@ const MobileInbox = ({
10935
10943
  onClick: value => {
10936
10944
  printReciept(original === null || original === void 0 ? void 0 : original["businessService"], original === null || original === void 0 ? void 0 : original["challanNo"]);
10937
10945
  }
10938
- }, " ", t(`${"UC_DOWNLOAD_RECEIPT"}`), " "))));
10946
+ }, " ", t(`${"CS_COMMON_DOWNLOAD_RECEIPT"}`), " "))));
10939
10947
  } else {
10940
10948
  return GetMobCell(t(`${"CS_NA"}`));
10941
10949
  }
@@ -11004,9 +11012,8 @@ const Inbox = ({
11004
11012
  middlewaresWf,
11005
11013
  middlewareSearch
11006
11014
  }) => {
11007
- var _sortParams$, _sortParams$2, _data$challans, _data$challans2, _data$challans7, _rest$data;
11015
+ var _sortParams$, _sortParams$2, _rest$data;
11008
11016
  const tenantId = Digit.ULBService.getCurrentTenantId();
11009
- let isMcollectAppChanged = Digit.SessionStorage.get("isMcollectAppChanged");
11010
11017
  const {
11011
11018
  t
11012
11019
  } = useTranslation();
@@ -11018,17 +11025,13 @@ const Inbox = ({
11018
11025
  }]);
11019
11026
  const {
11020
11027
  isLoading,
11021
- isError: isCountError,
11022
- error: counterror,
11023
11028
  data: countData
11024
11029
  } = Digit.Hooks.mcollect.useMCollectCount(tenantId);
11025
- const [searchParams, setSearchParams] = useState(() => {
11026
- return _initialStates.searchParams || {};
11027
- });
11030
+ const [searchParams, setSearchParams] = useState(_initialStates.searchParams || {});
11028
11031
  const [businessIdToOwnerMappings, setBusinessIdToOwnerMappings] = useState({});
11029
- const [isLoader, setIsLoader] = useState(true);
11030
- let isMobile = window.Digit.Utils.browser.isMobile();
11031
- let paginationParams = isMobile ? {
11032
+ const [isLoader, setIsLoader] = useState(false);
11033
+ const isMobile = window.Digit.Utils.browser.isMobile();
11034
+ const paginationParams = isMobile ? {
11032
11035
  limit: 100,
11033
11036
  offset: 0,
11034
11037
  sortOrder: sortParams !== null && sortParams !== void 0 && (_sortParams$ = sortParams[0]) !== null && _sortParams$ !== void 0 && _sortParams$.desc ? "DESC" : "ASC"
@@ -11037,10 +11040,9 @@ const Inbox = ({
11037
11040
  offset: pageOffset,
11038
11041
  sortOrder: sortParams !== null && sortParams !== void 0 && (_sortParams$2 = sortParams[0]) !== null && _sortParams$2 !== void 0 && _sortParams$2.desc ? "DESC" : "ASC"
11039
11042
  };
11043
+ const isMcollectAppChanged = Digit.SessionStorage.get("isMcollectAppChanged");
11040
11044
  const {
11041
11045
  isLoading: hookLoading,
11042
- isError,
11043
- error,
11044
11046
  data,
11045
11047
  ...rest
11046
11048
  } = Digit.Hooks.mcollect.useMCollectSearch({
@@ -11051,129 +11053,93 @@ const Inbox = ({
11051
11053
  },
11052
11054
  isMcollectAppChanged
11053
11055
  });
11054
- console.log("mcollect data: ", data);
11055
- console.log("hookloading", hookLoading);
11056
- console.log("data challan", (data === null || data === void 0 ? void 0 : (_data$challans = data.challans) === null || _data$challans === void 0 ? void 0 : _data$challans.length) > 0);
11057
- console.log(!hookLoading && (data === null || data === void 0 ? void 0 : (_data$challans2 = data.challans) === null || _data$challans2 === void 0 ? void 0 : _data$challans2.length) > 0);
11058
- useEffect(() => {
11059
- var _data$challans3, _data$challans4;
11060
- if (!hookLoading && !(data !== null && data !== void 0 && (_data$challans3 = data.challans) !== null && _data$challans3 !== void 0 && _data$challans3.length) > 0) setIsLoader(false);else if (hookLoading || data !== null && data !== void 0 && (_data$challans4 = data.challans) !== null && _data$challans4 !== void 0 && _data$challans4.length) setIsLoader(true);
11061
- }, [hookLoading, data]);
11062
- console.log("isLoader", isLoader);
11063
- let formedData = [];
11064
- let res;
11065
- let businessIdToOwnerMapping = {};
11066
11056
  useEffect(() => {
11067
- var _data$challans6;
11068
- async function fetchMyAPI() {
11069
- var _data$challans5;
11057
+ var _data$challans2;
11058
+ async function fetchBills() {
11059
+ var _data$challans;
11070
11060
  let businessServiceMap = {};
11071
- let challanNums = [];
11072
- data === null || data === void 0 ? void 0 : (_data$challans5 = data.challans) === null || _data$challans5 === void 0 ? void 0 : _data$challans5.forEach(item => {
11073
- challanNums = businessServiceMap[item.businessService] || [];
11061
+ data === null || data === void 0 ? void 0 : (_data$challans = data.challans) === null || _data$challans === void 0 ? void 0 : _data$challans.forEach(item => {
11074
11062
  if (item.businessService !== "ADVT.Canopy_Fee") {
11075
- challanNums.push(item.challanNo);
11076
- businessServiceMap[item.businessService] = challanNums;
11063
+ if (!businessServiceMap[item.businessService]) businessServiceMap[item.businessService] = [];
11064
+ businessServiceMap[item.businessService].push(item.challanNo);
11077
11065
  }
11078
11066
  });
11079
11067
  let processInstanceArray = [];
11080
- for (var key in businessServiceMap) {
11081
- let consumerCodes = businessServiceMap[key].toString();
11082
- res = await Digit.PaymentService.fetchBill(tenantId, {
11068
+ for (let key in businessServiceMap) {
11069
+ const consumerCodes = businessServiceMap[key].join(",");
11070
+ const res = await Digit.PaymentService.fetchBill(tenantId, {
11083
11071
  consumerCode: consumerCodes,
11084
11072
  businessService: key
11085
11073
  });
11086
- processInstanceArray = processInstanceArray.concat(res.Bill);
11087
- businessIdToOwnerMapping = {};
11088
- processInstanceArray.filter(record => record === null || record === void 0 ? void 0 : record.businessService).forEach(item => {
11089
- var _item$billDetails$, _item$billDetails$2;
11090
- businessIdToOwnerMapping[item === null || item === void 0 ? void 0 : item.consumerCode] = {
11091
- businessService: item === null || item === void 0 ? void 0 : item.businessService,
11092
- otalAmount: (item === null || item === void 0 ? void 0 : (_item$billDetails$ = item.billDetails[0]) === null || _item$billDetails$ === void 0 ? void 0 : _item$billDetails$.totalAmount) || 0,
11093
- dueDate: item === null || item === void 0 ? void 0 : (_item$billDetails$2 = item.billDetails[0]) === null || _item$billDetails$2 === void 0 ? void 0 : _item$billDetails$2.expiryDate
11094
- };
11095
- });
11096
- }
11074
+ processInstanceArray = [...processInstanceArray, ...((res === null || res === void 0 ? void 0 : res.Bill) || [])];
11075
+ }
11076
+ const mapping = {};
11077
+ processInstanceArray.forEach(item => {
11078
+ var _item$billDetails, _item$billDetails$, _item$billDetails2, _item$billDetails2$;
11079
+ mapping[item === null || item === void 0 ? void 0 : item.consumerCode] = {
11080
+ businessService: item === null || item === void 0 ? void 0 : item.businessService,
11081
+ totalAmount: (item === null || item === void 0 ? void 0 : (_item$billDetails = item.billDetails) === null || _item$billDetails === void 0 ? void 0 : (_item$billDetails$ = _item$billDetails[0]) === null || _item$billDetails$ === void 0 ? void 0 : _item$billDetails$.totalAmount) || 0,
11082
+ dueDate: item === null || item === void 0 ? void 0 : (_item$billDetails2 = item.billDetails) === null || _item$billDetails2 === void 0 ? void 0 : (_item$billDetails2$ = _item$billDetails2[0]) === null || _item$billDetails2$ === void 0 ? void 0 : _item$billDetails2$.expiryDate
11083
+ };
11084
+ });
11085
+ setBusinessIdToOwnerMappings(mapping);
11097
11086
  setIsLoader(false);
11098
- setBusinessIdToOwnerMappings(businessIdToOwnerMapping);
11099
11087
  }
11100
- if (data !== null && data !== void 0 && data.challans && (data === null || data === void 0 ? void 0 : (_data$challans6 = data.challans) === null || _data$challans6 === void 0 ? void 0 : _data$challans6.length) > 0) {
11101
- setIsLoader(true);
11102
- fetchMyAPI();
11088
+ if ((data === null || data === void 0 ? void 0 : (_data$challans2 = data.challans) === null || _data$challans2 === void 0 ? void 0 : _data$challans2.length) > 0) {
11089
+ fetchBills();
11103
11090
  }
11104
11091
  }, [data]);
11105
- console.log("isLoader 2", isLoader);
11106
- data === null || data === void 0 ? void 0 : (_data$challans7 = data.challans) === null || _data$challans7 === void 0 ? void 0 : _data$challans7.map(data => {
11107
- var _data$citizen, _businessIdToOwnerMap, _businessIdToOwnerMap2;
11108
- formedData.push({
11109
- challanNo: data === null || data === void 0 ? void 0 : data.challanNo,
11110
- name: data === null || data === void 0 ? void 0 : (_data$citizen = data.citizen) === null || _data$citizen === void 0 ? void 0 : _data$citizen.name,
11111
- applicationStatus: data === null || data === void 0 ? void 0 : data.applicationStatus,
11112
- businessService: data === null || data === void 0 ? void 0 : data.businessService,
11113
- totalAmount: ((_businessIdToOwnerMap = businessIdToOwnerMappings[data.challanNo]) === null || _businessIdToOwnerMap === void 0 ? void 0 : _businessIdToOwnerMap.totalAmount) || 0,
11114
- dueDate: ((_businessIdToOwnerMap2 = businessIdToOwnerMappings[data.challanNo]) === null || _businessIdToOwnerMap2 === void 0 ? void 0 : _businessIdToOwnerMap2.dueDate) || "NA",
11115
- tenantId: data === null || data === void 0 ? void 0 : data.tenantId,
11116
- receiptNumber: data === null || data === void 0 ? void 0 : data.receiptNumber
11117
- });
11092
+ const formedData = ((data === null || data === void 0 ? void 0 : data.challans) || []).map(item => {
11093
+ var _item$citizen, _businessIdToOwnerMap, _businessIdToOwnerMap2;
11094
+ return {
11095
+ challanNo: item === null || item === void 0 ? void 0 : item.challanNo,
11096
+ name: item === null || item === void 0 ? void 0 : (_item$citizen = item.citizen) === null || _item$citizen === void 0 ? void 0 : _item$citizen.name,
11097
+ applicationStatus: item === null || item === void 0 ? void 0 : item.applicationStatus,
11098
+ businessService: item === null || item === void 0 ? void 0 : item.businessService,
11099
+ totalAmount: ((_businessIdToOwnerMap = businessIdToOwnerMappings[item.challanNo]) === null || _businessIdToOwnerMap === void 0 ? void 0 : _businessIdToOwnerMap.totalAmount) || 0,
11100
+ dueDate: ((_businessIdToOwnerMap2 = businessIdToOwnerMappings[item.challanNo]) === null || _businessIdToOwnerMap2 === void 0 ? void 0 : _businessIdToOwnerMap2.dueDate) || "NA",
11101
+ tenantId: item === null || item === void 0 ? void 0 : item.tenantId,
11102
+ receiptNumber: item === null || item === void 0 ? void 0 : item.receiptNumber
11103
+ };
11118
11104
  });
11119
11105
  useEffect(() => {
11120
11106
  setPageOffset(0);
11121
11107
  }, [searchParams]);
11122
- const fetchNextPage = () => {
11123
- setPageOffset(prevState => prevState + pageSize);
11124
- };
11125
- const fetchPrevPage = () => {
11126
- setPageOffset(prevState => prevState - pageSize);
11127
- };
11128
- const fetchLastPage = () => {
11129
- setPageOffset((data === null || data === void 0 ? void 0 : data.totalCount) && Math.ceil((data === null || data === void 0 ? void 0 : data.totalCount) / 10) * 10 - pageSize);
11130
- };
11131
- const fetchFirstPage = () => {
11132
- setPageOffset(prevState => 0);
11133
- };
11108
+ const fetchNextPage = () => setPageOffset(prev => prev + pageSize);
11109
+ const fetchPrevPage = () => setPageOffset(prev => prev - pageSize);
11110
+ const fetchLastPage = () => setPageOffset(data !== null && data !== void 0 && data.totalCount ? Math.ceil(data.totalCount / 10) * 10 - pageSize : 0);
11111
+ const fetchFirstPage = () => setPageOffset(0);
11134
11112
  const handleFilterChange = filterParam => {
11135
11113
  let keys_to_delete = filterParam.delete;
11136
- let _new = {};
11137
- if (isMobile) {
11138
- _new = {
11139
- ...filterParam
11140
- };
11141
- } else {
11142
- _new = {
11143
- ...searchParams,
11144
- ...filterParam
11145
- };
11146
- }
11114
+ let _new = isMobile ? {
11115
+ ...filterParam
11116
+ } : {
11117
+ ...searchParams,
11118
+ ...filterParam
11119
+ };
11147
11120
  if (keys_to_delete) keys_to_delete.forEach(key => delete _new[key]);
11148
11121
  delete _new.delete;
11149
- delete filterParam.delete;
11150
- setSearchParams({
11151
- ..._new
11152
- });
11122
+ setSearchParams(_new);
11153
11123
  };
11154
11124
  const handleSort = useCallback(args => {
11155
11125
  if (args.length === 0) return;
11156
11126
  setSortParams(args);
11157
11127
  }, []);
11158
- const handlePageSizeChange = e => {
11159
- setPageSize(Number(e.target.value));
11160
- };
11161
- const getSearchFields = () => {
11162
- return [{
11163
- label: t("UC_CHALLAN_NUMBER"),
11164
- name: "challanNo"
11165
- }, {
11166
- label: t("UC_MOBILE_NUMBER_LABEL"),
11167
- name: "mobileNumber",
11168
- maxlength: 10,
11169
- pattern: "[6-9][0-9]{9}",
11170
- title: t("ES_SEARCH_APPLICATION_MOBILE_INVALID"),
11171
- componentInFront: "+91"
11172
- }, {
11173
- label: t("UC_RECIEPT_NUMBER_LABEL"),
11174
- name: "receiptNumber"
11175
- }];
11176
- };
11128
+ const handlePageSizeChange = e => setPageSize(Number(e.target.value));
11129
+ const getSearchFields = () => [{
11130
+ label: t("UC_CHALLAN_NO"),
11131
+ name: "challanNo"
11132
+ }, {
11133
+ label: t("UC_MOBILE_NO_LABEL"),
11134
+ name: "mobileNumber",
11135
+ maxlength: 10,
11136
+ pattern: "[6-9][0-9]{9}",
11137
+ title: t("ES_SEARCH_APPLICATION_MOBILE_INVALID"),
11138
+ componentInFront: "+91"
11139
+ }, {
11140
+ label: t("UC_RECEPIT_NO_LABEL"),
11141
+ name: "receiptNumber"
11142
+ }];
11177
11143
  if ((rest === null || rest === void 0 ? void 0 : (_rest$data = rest.data) === null || _rest$data === void 0 ? void 0 : _rest$data.length) !== null) {
11178
11144
  if (isMobile) {
11179
11145
  return /*#__PURE__*/React.createElement(MobileInbox, {
@@ -11192,7 +11158,7 @@ const Inbox = ({
11192
11158
  filterComponent: filterComponent
11193
11159
  });
11194
11160
  } else {
11195
- return /*#__PURE__*/React.createElement("div", null, isInbox && /*#__PURE__*/React.createElement(Header, null, t("UC_SEARCH_MCOLLECT_HEADER")), /*#__PURE__*/React.createElement(DesktopInbox, {
11161
+ return /*#__PURE__*/React.createElement("div", null, isInbox && /*#__PURE__*/React.createElement(Header, null, t("ACTION_TEST_NATIONAL_MCOLLECT")), /*#__PURE__*/React.createElement(DesktopInbox, {
11196
11162
  businessService: _businessService,
11197
11163
  data: formedData,
11198
11164
  tableConfig: rest === null || rest === void 0 ? void 0 : rest.tableConfig,
@@ -11220,6 +11186,7 @@ const Inbox = ({
11220
11186
  }));
11221
11187
  }
11222
11188
  }
11189
+ return null;
11223
11190
  };
11224
11191
 
11225
11192
  const EmployeeApp = ({
@@ -11227,12 +11194,13 @@ const EmployeeApp = ({
11227
11194
  url,
11228
11195
  userType
11229
11196
  }) => {
11230
- var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi;
11197
+ var _Digit, _Digit$ComponentRegis, _Digit2, _Digit2$ComponentRegi, _Digit3, _Digit3$ComponentRegi, _Digit4, _Digit4$ComponentRegi, _Digit5, _Digit5$ComponentRegi, _Digit6, _Digit6$ComponentRegi, _Digit7, _Digit7$ComponentRegi, _Digit8, _Digit8$ComponentRegi;
11231
11198
  const {
11232
11199
  t
11233
11200
  } = useTranslation();
11234
11201
  const location = useLocation();
11235
11202
  const mobileView = innerWidth <= 640;
11203
+ console.log("her here here here");
11236
11204
  const inboxInitialState = {
11237
11205
  searchParams: {
11238
11206
  status: [],
@@ -11272,10 +11240,14 @@ const EmployeeApp = ({
11272
11240
  const searchMW = [{
11273
11241
  combineTaxDueInSearchData
11274
11242
  }];
11275
- const EmployeeChallan = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent('MCollectEmployeeChallan');
11276
- const MCollectAcknowledgement = (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$ComponentRegi = _Digit2.ComponentRegistryService) === null || _Digit2$ComponentRegi === void 0 ? void 0 : _Digit2$ComponentRegi.getComponent('MCollectAcknowledgement');
11277
- const EditChallan = (_Digit3 = Digit) === null || _Digit3 === void 0 ? void 0 : (_Digit3$ComponentRegi = _Digit3.ComponentRegistryService) === null || _Digit3$ComponentRegi === void 0 ? void 0 : _Digit3$ComponentRegi.getComponent('MCollectEditChallan');
11278
- const NewChallan = (_Digit4 = Digit) === null || _Digit4 === void 0 ? void 0 : (_Digit4$ComponentRegi = _Digit4.ComponentRegistryService) === null || _Digit4$ComponentRegi === void 0 ? void 0 : _Digit4$ComponentRegi.getComponent('MCollectNewChallan');
11243
+ const EmployeeChallan = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("MCollectEmployeeChallan");
11244
+ const MCollectAcknowledgement = (_Digit2 = Digit) === null || _Digit2 === void 0 ? void 0 : (_Digit2$ComponentRegi = _Digit2.ComponentRegistryService) === null || _Digit2$ComponentRegi === void 0 ? void 0 : _Digit2$ComponentRegi.getComponent("MCollectAcknowledgement");
11245
+ const EditChallan = (_Digit3 = Digit) === null || _Digit3 === void 0 ? void 0 : (_Digit3$ComponentRegi = _Digit3.ComponentRegistryService) === null || _Digit3$ComponentRegi === void 0 ? void 0 : _Digit3$ComponentRegi.getComponent("MCollectEditChallan");
11246
+ const NewChallan = (_Digit4 = Digit) === null || _Digit4 === void 0 ? void 0 : (_Digit4$ComponentRegi = _Digit4.ComponentRegistryService) === null || _Digit4$ComponentRegi === void 0 ? void 0 : _Digit4$ComponentRegi.getComponent("MCollectNewChallan");
11247
+ const SearchReceiptPage = (_Digit5 = Digit) === null || _Digit5 === void 0 ? void 0 : (_Digit5$ComponentRegi = _Digit5.ComponentRegistryService) === null || _Digit5$ComponentRegi === void 0 ? void 0 : _Digit5$ComponentRegi.getComponent("SearchReceipt");
11248
+ const SearchChallanPage = (_Digit6 = Digit) === null || _Digit6 === void 0 ? void 0 : (_Digit6$ComponentRegi = _Digit6.ComponentRegistryService) === null || _Digit6$ComponentRegi === void 0 ? void 0 : _Digit6$ComponentRegi.getComponent("SearchChallan");
11249
+ const SearchBillPage = (_Digit7 = Digit) === null || _Digit7 === void 0 ? void 0 : (_Digit7$ComponentRegi = _Digit7.ComponentRegistryService) === null || _Digit7$ComponentRegi === void 0 ? void 0 : _Digit7$ComponentRegi.getComponent("SearchBill");
11250
+ const GroupBillPage = (_Digit8 = Digit) === null || _Digit8 === void 0 ? void 0 : (_Digit8$ComponentRegi = _Digit8.ComponentRegistryService) === null || _Digit8$ComponentRegi === void 0 ? void 0 : _Digit8$ComponentRegi.getComponent("GroupBill");
11279
11251
  return /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
11280
11252
  className: "ground-container"
11281
11253
  }, /*#__PURE__*/React.createElement("p", {
@@ -11305,7 +11277,7 @@ const EmployeeApp = ({
11305
11277
  initialStates: inboxInitialState,
11306
11278
  isInbox: true
11307
11279
  })
11308
- }), " ", /*#__PURE__*/React.createElement(PrivateRoute, {
11280
+ }), " ", /*#__PURE__*/React.createElement(PrivateRoute, {
11309
11281
  path: `${path}/new-application`,
11310
11282
  component: () => /*#__PURE__*/React.createElement(NewChallan, {
11311
11283
  parentUrl: url
@@ -11328,6 +11300,20 @@ const EmployeeApp = ({
11328
11300
  }), /*#__PURE__*/React.createElement(PrivateRoute, {
11329
11301
  path: `${path}/modify-challan/:challanNo`,
11330
11302
  component: () => /*#__PURE__*/React.createElement(EditChallan, null)
11303
+ }), " ", /*#__PURE__*/React.createElement(PrivateRoute, {
11304
+ path: `${path}/search-receipt`,
11305
+ component: () => /*#__PURE__*/React.createElement(SearchReceiptPage, null)
11306
+ }), " ", /*#__PURE__*/React.createElement(PrivateRoute, {
11307
+ path: `${path}/search-challan`,
11308
+ component: () => /*#__PURE__*/React.createElement(SearchChallanPage, {
11309
+ parentRoute: path
11310
+ })
11311
+ }), " ", /*#__PURE__*/React.createElement(PrivateRoute, {
11312
+ path: `${path}/search-bill`,
11313
+ component: () => /*#__PURE__*/React.createElement(SearchBillPage, null)
11314
+ }), " ", /*#__PURE__*/React.createElement(PrivateRoute, {
11315
+ path: `${path}/group-bill`,
11316
+ component: () => /*#__PURE__*/React.createElement(GroupBillPage, null)
11331
11317
  }), " ")));
11332
11318
  };
11333
11319
 
@@ -11456,7 +11442,7 @@ const newConfig = [{
11456
11442
  }];
11457
11443
 
11458
11444
  const getformDataforEdit = (ChallanData, fetchBillData) => {
11459
- var _ChallanData$, _ChallanData$$address, _ChallanData$$address2, _ChallanData$2, _ChallanData$3, _ChallanData$5;
11445
+ var _ChallanData$, _ChallanData$$address, _ChallanData$$address2, _ChallanData$2, _ChallanData$3, _ChallanData$4;
11460
11446
  let defaultval = {
11461
11447
  ConsumerName: ChallanData[0].citizen.name,
11462
11448
  mobileNumber: ChallanData[0].citizen.mobileNumber,
@@ -11481,13 +11467,7 @@ const getformDataforEdit = (ChallanData, fetchBillData) => {
11481
11467
  toDate: ChallanData[0] ? new Date(ChallanData[0].taxPeriodTo).getFullYear().toString() + "-" + `${new Date(ChallanData[0].taxPeriodTo).getMonth() + 1 < 10 ? "0" : ""}${new Date(ChallanData[0].taxPeriodTo).getMonth() + 1}` + "-" + `${new Date(ChallanData[0].taxPeriodTo).getDate() < 10 ? "0" : ""}${new Date(ChallanData[0].taxPeriodTo).getDate()}` : null
11482
11468
  };
11483
11469
  defaultval[`${(_ChallanData$3 = ChallanData[0]) === null || _ChallanData$3 === void 0 ? void 0 : _ChallanData$3.businessService.split(".")[0]}`] = {};
11484
- if (fetchBillData.Bill[0].billDetails[0].billAccountDetails.length > 0) {
11485
- fetchBillData.Bill[0].billDetails[0].billAccountDetails.map(ele => {
11486
- var _ChallanData$4;
11487
- return defaultval[`${(_ChallanData$4 = ChallanData[0]) === null || _ChallanData$4 === void 0 ? void 0 : _ChallanData$4.businessService.split(".")[0]}`][`${ele.taxHeadCode.split(".")[1]}`] = `${ele.amount}`;
11488
- });
11489
- }
11490
- sessionStorage.setItem("InitialTaxFeilds", JSON.stringify(defaultval[`${(_ChallanData$5 = ChallanData[0]) === null || _ChallanData$5 === void 0 ? void 0 : _ChallanData$5.businessService.split(".")[0]}`]));
11470
+ sessionStorage.setItem("InitialTaxFeilds", JSON.stringify(defaultval[`${(_ChallanData$4 = ChallanData[0]) === null || _ChallanData$4 === void 0 ? void 0 : _ChallanData$4.businessService.split(".")[0]}`]));
11491
11471
  return defaultval;
11492
11472
  };
11493
11473
  const NewChallan = ({
@@ -11505,6 +11485,7 @@ const NewChallan = ({
11505
11485
  if (url.includes("modify-challan")) {
11506
11486
  isEdit = true;
11507
11487
  }
11488
+ console.log("here", ChallanData);
11508
11489
  const [canSubmit, setSubmitValve] = useState(false);
11509
11490
  const defaultValues = {};
11510
11491
  const history = useHistory();
@@ -11530,8 +11511,9 @@ const NewChallan = ({
11530
11511
  lastModTime
11531
11512
  }) : {};
11532
11513
  useEffect(() => {
11533
- if (isEdit && fetchBillData) {
11534
- let formdata = getformDataforEdit(ChallanData, fetchBillData);
11514
+ console.log("isEdit", isEdit, fetchBillData);
11515
+ if (isEdit) {
11516
+ let formdata = getformDataforEdit(ChallanData);
11535
11517
  setdefaultUpdatedValue(true);
11536
11518
  sessionStorage.setItem("mcollectEditObject", JSON.stringify({
11537
11519
  consomerDetails1: [{
@@ -11562,7 +11544,7 @@ const NewChallan = ({
11562
11544
  let TaxHeadMasterValues = data[`${(_data4 = data) === null || _data4 === void 0 ? void 0 : (_data4$category = _data4.category) === null || _data4$category === void 0 ? void 0 : (_data4$category$code = _data4$category.code) === null || _data4$category$code === void 0 ? void 0 : _data4$category$code.split(".")[0]}`] ? Object.values(data[`${(_data5 = data) === null || _data5 === void 0 ? void 0 : (_data5$category = _data5.category) === null || _data5$category === void 0 ? void 0 : (_data5$category$code = _data5$category.code) === null || _data5$category$code === void 0 ? void 0 : _data5$category$code.split(".")[0]}`]) : [];
11563
11545
  let Challan = {};
11564
11546
  if (!isEdit) {
11565
- var _data7, _data7$categoryType, _data8, _data8$category, _data8$category$code, _data9, _data10, _data11, _data12, _data12$mohalla;
11547
+ var _data7, _data7$categoryType, _data8, _data8$category, _data8$category$code, _data9, _data0, _data1, _data10, _data10$mohalla;
11566
11548
  Challan = {
11567
11549
  citizen: {
11568
11550
  name: data.ConsumerName,
@@ -11572,28 +11554,28 @@ const NewChallan = ({
11572
11554
  businessService: (_data7 = data) === null || _data7 === void 0 ? void 0 : (_data7$categoryType = _data7.categoryType) === null || _data7$categoryType === void 0 ? void 0 : _data7$categoryType.code,
11573
11555
  consumerType: (_data8 = data) === null || _data8 === void 0 ? void 0 : (_data8$category = _data8.category) === null || _data8$category === void 0 ? void 0 : (_data8$category$code = _data8$category.code) === null || _data8$category$code === void 0 ? void 0 : _data8$category$code.split(".")[0],
11574
11556
  description: (_data9 = data) === null || _data9 === void 0 ? void 0 : _data9.comments,
11575
- taxPeriodFrom: Date.parse((_data10 = data) === null || _data10 === void 0 ? void 0 : _data10.fromDate),
11576
- taxPeriodTo: Date.parse((_data11 = data) === null || _data11 === void 0 ? void 0 : _data11.toDate),
11557
+ taxPeriodFrom: Date.parse((_data0 = data) === null || _data0 === void 0 ? void 0 : _data0.fromDate),
11558
+ taxPeriodTo: Date.parse((_data1 = data) === null || _data1 === void 0 ? void 0 : _data1.toDate),
11577
11559
  tenantId: tenantId,
11578
11560
  address: {
11579
11561
  buildingName: data.building,
11580
11562
  doorNo: data.doorNo,
11581
11563
  street: data.streetName,
11582
11564
  locality: {
11583
- code: (_data12 = data) === null || _data12 === void 0 ? void 0 : (_data12$mohalla = _data12.mohalla) === null || _data12$mohalla === void 0 ? void 0 : _data12$mohalla.code
11565
+ code: (_data10 = data) === null || _data10 === void 0 ? void 0 : (_data10$mohalla = _data10.mohalla) === null || _data10$mohalla === void 0 ? void 0 : _data10$mohalla.code
11584
11566
  },
11585
11567
  pincode: data.pincode
11586
11568
  },
11587
11569
  amount: TaxHeadMasterKeys.map((ele, index) => {
11588
- var _data13, _data13$category, _data13$category$code;
11570
+ var _data11, _data11$category, _data11$category$code;
11589
11571
  return {
11590
- taxHeadCode: `${(_data13 = data) === null || _data13 === void 0 ? void 0 : (_data13$category = _data13.category) === null || _data13$category === void 0 ? void 0 : (_data13$category$code = _data13$category.code) === null || _data13$category$code === void 0 ? void 0 : _data13$category$code.split(".")[0]}.${ele}`,
11572
+ taxHeadCode: `${(_data11 = data) === null || _data11 === void 0 ? void 0 : (_data11$category = _data11.category) === null || _data11$category === void 0 ? void 0 : (_data11$category$code = _data11$category.code) === null || _data11$category$code === void 0 ? void 0 : _data11$category$code.split(".")[0]}.${ele}`,
11591
11573
  amount: TaxHeadMasterValues[index] ? Math.round(TaxHeadMasterValues[index]) : 0
11592
11574
  };
11593
11575
  })
11594
11576
  };
11595
11577
  } else {
11596
- var _data14, _data14$category;
11578
+ var _data12, _data12$category;
11597
11579
  Challan = {
11598
11580
  accountId: ChallanData[0].accountId,
11599
11581
  citizen: ChallanData[0].citizen,
@@ -11602,16 +11584,16 @@ const NewChallan = ({
11602
11584
  id: ChallanData[0].id,
11603
11585
  businessService: ChallanData[0].businessService,
11604
11586
  challanNo: ChallanData[0].challanNo,
11605
- consumerType: (_data14 = data) === null || _data14 === void 0 ? void 0 : (_data14$category = _data14.category) === null || _data14$category === void 0 ? void 0 : _data14$category.code,
11587
+ consumerType: (_data12 = data) === null || _data12 === void 0 ? void 0 : (_data12$category = _data12.category) === null || _data12$category === void 0 ? void 0 : _data12$category.code,
11606
11588
  description: data.comments,
11607
11589
  taxPeriodFrom: Date.parse(data.fromDate),
11608
11590
  taxPeriodTo: Date.parse(data.toDate),
11609
11591
  tenantId: tenantId,
11610
11592
  address: ChallanData[0].address,
11611
11593
  amount: TaxHeadMasterKeys.map((ele, index) => {
11612
- var _data15, _data15$category, _data15$category$code;
11594
+ var _data13, _data13$category, _data13$category$code;
11613
11595
  return {
11614
- taxHeadCode: `${(_data15 = data) === null || _data15 === void 0 ? void 0 : (_data15$category = _data15.category) === null || _data15$category === void 0 ? void 0 : (_data15$category$code = _data15$category.code) === null || _data15$category$code === void 0 ? void 0 : _data15$category$code.split(".")[0]}.${ele}`,
11596
+ taxHeadCode: `${(_data13 = data) === null || _data13 === void 0 ? void 0 : (_data13$category = _data13.category) === null || _data13$category === void 0 ? void 0 : (_data13$category$code = _data13$category.code) === null || _data13$category$code === void 0 ? void 0 : _data13$category$code.split(".")[0]}.${ele}`,
11615
11597
  amount: TaxHeadMasterValues[index] ? Math.round(TaxHeadMasterValues[index]) : 0
11616
11598
  };
11617
11599
  })
@@ -11623,7 +11605,7 @@ const NewChallan = ({
11623
11605
  }, tenantId).then((result, err) => {
11624
11606
  if (result.challans && result.challans.length > 0) {
11625
11607
  const challan = result.challans[0];
11626
- sessionStorage.removeItem('mcollectEditObject');
11608
+ sessionStorage.removeItem("mcollectEditObject");
11627
11609
  let LastModifiedTime = Digit.SessionStorage.set("isMcollectAppChanged", challan.auditDetails.lastModifiedTime);
11628
11610
  Digit.MCollectService.generateBill(challan.challanNo, tenantId, challan.businessService, "challan").then(response => {
11629
11611
  if (response.Bill && response.Bill.length > 0) {
@@ -11839,6 +11821,1223 @@ const MCollectAcknowledgement = () => {
11839
11821
  })))));
11840
11822
  };
11841
11823
 
11824
+ const SearchReceipt = () => {
11825
+ const {
11826
+ t
11827
+ } = useTranslation();
11828
+ const history = useHistory();
11829
+ const tenantId = Digit.ULBService.getCurrentTenantId();
11830
+ const [isLoading, setIsLoading] = useState(false);
11831
+ const [showToast, setShowToast] = useState(null);
11832
+ const [tableData, setTableData] = useState([]);
11833
+ const [hasSearched, setHasSearched] = useState(false);
11834
+ const {
11835
+ data: EmployeeStatusData = [],
11836
+ isLoading: callMDMS
11837
+ } = Digit.Hooks.useCustomMDMS(tenantId, "BillingService", [{
11838
+ name: "BusinessService",
11839
+ filter: "[?(@.type=='Adhoc')]"
11840
+ }], {
11841
+ select: data => {
11842
+ var _data$BillingService;
11843
+ const formattedData = data === null || data === void 0 ? void 0 : (_data$BillingService = data["BillingService"]) === null || _data$BillingService === void 0 ? void 0 : _data$BillingService["BusinessService"];
11844
+ return formattedData;
11845
+ }
11846
+ });
11847
+ const methods = useForm({
11848
+ defaultValues: {
11849
+ categoryName: ""
11850
+ }
11851
+ });
11852
+ const {
11853
+ register,
11854
+ handleSubmit,
11855
+ reset,
11856
+ control,
11857
+ getValues,
11858
+ formState: {
11859
+ errors
11860
+ }
11861
+ } = methods;
11862
+ const onSubmit = async data => {
11863
+ var _data$businessService;
11864
+ setIsLoading(true);
11865
+ setHasSearched(true);
11866
+ console.log("data is here==========", data);
11867
+ const businessService = data === null || data === void 0 ? void 0 : (_data$businessService = data.businessServices) === null || _data$businessService === void 0 ? void 0 : _data$businessService.code;
11868
+ const filteredData = Object.entries(data).reduce((acc, [key, value]) => {
11869
+ if (value !== null && value !== undefined && !(typeof value === "string" && value.trim() === "") && !(Array.isArray(value) && value.length === 0)) {
11870
+ acc[key] = key === "businessServices" ? businessService : value;
11871
+ }
11872
+ return acc;
11873
+ }, {});
11874
+ try {
11875
+ const response = await Digit.MCollectService.recieptSearch(tenantId, businessService, filteredData);
11876
+ console.log("✅ recieptSearch response", response === null || response === void 0 ? void 0 : response.Payments);
11877
+ setTableData(response === null || response === void 0 ? void 0 : response.Payments);
11878
+ setIsLoading(false);
11879
+ } catch (error) {
11880
+ setIsLoading(false);
11881
+ console.log("error", error);
11882
+ }
11883
+ };
11884
+ const closeToast = () => {
11885
+ setShowToast(null);
11886
+ };
11887
+ const downloadPDF = async rowData => {
11888
+ console.log("generating pdf here==========");
11889
+ setIsLoading(true);
11890
+ try {
11891
+ var _response$filestoreId;
11892
+ const response = await Digit.MCollectService.generatePdf(tenantId, {
11893
+ Payments: [{
11894
+ ...rowData
11895
+ }]
11896
+ }, "consolidatedreceiptold");
11897
+ setIsLoading(false);
11898
+ fileFetch(response === null || response === void 0 ? void 0 : (_response$filestoreId = response.filestoreIds) === null || _response$filestoreId === void 0 ? void 0 : _response$filestoreId[0]);
11899
+ console.log("✅ generating pdf response", response);
11900
+ } catch (error) {
11901
+ setIsLoading(false);
11902
+ console.log("error", error);
11903
+ }
11904
+ };
11905
+ const fileFetch = async fileStoreId => {
11906
+ setIsLoading(true);
11907
+ console.log("fetching file here==========");
11908
+ try {
11909
+ var _response$fileStoreId, _response$fileStoreId2;
11910
+ const response = await Digit.MCollectService.file_fetch(tenantId, fileStoreId);
11911
+ setIsLoading(false);
11912
+ console.log("✅ fetching file response", response);
11913
+ const fileUrl = (response === null || response === void 0 ? void 0 : response[fileStoreId]) || (response === null || response === void 0 ? void 0 : (_response$fileStoreId = response.fileStoreIds) === null || _response$fileStoreId === void 0 ? void 0 : (_response$fileStoreId2 = _response$fileStoreId[0]) === null || _response$fileStoreId2 === void 0 ? void 0 : _response$fileStoreId2.url);
11914
+ if (fileUrl) {
11915
+ window.open(fileUrl, "_blank");
11916
+ } else {
11917
+ console.error("File URL not found in response.");
11918
+ }
11919
+ } catch (error) {
11920
+ setIsLoading(false);
11921
+ console.log("error", error);
11922
+ }
11923
+ };
11924
+ const GetCell = value => /*#__PURE__*/React.createElement("span", {
11925
+ className: "cell-text"
11926
+ }, value);
11927
+ const columns = useMemo(() => [{
11928
+ Header: "Receipt No",
11929
+ disableSortBy: true,
11930
+ accessor: row => {
11931
+ var _row$paymentDetails, _row$paymentDetails$;
11932
+ const receiptNumber = row === null || row === void 0 ? void 0 : (_row$paymentDetails = row.paymentDetails) === null || _row$paymentDetails === void 0 ? void 0 : (_row$paymentDetails$ = _row$paymentDetails[0]) === null || _row$paymentDetails$ === void 0 ? void 0 : _row$paymentDetails$.receiptNumber;
11933
+ return /*#__PURE__*/React.createElement("span", {
11934
+ className: "cell-text",
11935
+ style: {
11936
+ color: "blue",
11937
+ textDecoration: "underline",
11938
+ cursor: "pointer"
11939
+ },
11940
+ onClick: () => downloadPDF(row)
11941
+ }, receiptNumber);
11942
+ }
11943
+ }, {
11944
+ Header: "Consumer Code/Application No/Challan No",
11945
+ disableSortBy: true,
11946
+ accessor: row => {
11947
+ var _row$paymentDetails2, _row$paymentDetails2$, _row$paymentDetails2$2;
11948
+ return GetCell(row === null || row === void 0 ? void 0 : (_row$paymentDetails2 = row.paymentDetails) === null || _row$paymentDetails2 === void 0 ? void 0 : (_row$paymentDetails2$ = _row$paymentDetails2[0]) === null || _row$paymentDetails2$ === void 0 ? void 0 : (_row$paymentDetails2$2 = _row$paymentDetails2$.bill) === null || _row$paymentDetails2$2 === void 0 ? void 0 : _row$paymentDetails2$2.consumerCode);
11949
+ }
11950
+ }, {
11951
+ Header: "Consumer Name",
11952
+ disableSortBy: true,
11953
+ accessor: row => {
11954
+ return GetCell(row === null || row === void 0 ? void 0 : row.paidBy);
11955
+ }
11956
+ }, {
11957
+ Header: "Service Type",
11958
+ disableSortBy: true,
11959
+ accessor: row => {
11960
+ var _row$paymentDetails3, _row$paymentDetails3$;
11961
+ return GetCell(row === null || row === void 0 ? void 0 : (_row$paymentDetails3 = row.paymentDetails) === null || _row$paymentDetails3 === void 0 ? void 0 : (_row$paymentDetails3$ = _row$paymentDetails3[0]) === null || _row$paymentDetails3$ === void 0 ? void 0 : _row$paymentDetails3$.businessService);
11962
+ }
11963
+ }, {
11964
+ Header: "Receipt Date",
11965
+ disableSortBy: true,
11966
+ accessor: row => {
11967
+ var _row$paymentDetails4, _row$paymentDetails4$;
11968
+ return GetCell(row === null || row === void 0 ? void 0 : (_row$paymentDetails4 = row.paymentDetails) === null || _row$paymentDetails4 === void 0 ? void 0 : (_row$paymentDetails4$ = _row$paymentDetails4[0]) === null || _row$paymentDetails4$ === void 0 ? void 0 : _row$paymentDetails4$.receiptNumber);
11969
+ }
11970
+ }, {
11971
+ Header: "Amount Paid[INR]",
11972
+ disableSortBy: true,
11973
+ accessor: row => {
11974
+ var _row$paymentDetails5, _row$paymentDetails5$, _row$paymentDetails5$2;
11975
+ return GetCell(row === null || row === void 0 ? void 0 : (_row$paymentDetails5 = row.paymentDetails) === null || _row$paymentDetails5 === void 0 ? void 0 : (_row$paymentDetails5$ = _row$paymentDetails5[0]) === null || _row$paymentDetails5$ === void 0 ? void 0 : (_row$paymentDetails5$2 = _row$paymentDetails5$.bill) === null || _row$paymentDetails5$2 === void 0 ? void 0 : _row$paymentDetails5$2.totalAmount);
11976
+ }
11977
+ }], []);
11978
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
11979
+ .formWrapperNDC {
11980
+ // padding: 20px;
11981
+ // background: #fff;
11982
+ // border-radius: 10px;
11983
+ max-width: 1200px;
11984
+ // margin: auto;
11985
+ // box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
11986
+ }
11987
+
11988
+ .ndcFormCard {
11989
+ display: grid;
11990
+ grid-template-columns: repeat(3, 1fr);
11991
+ gap: 20px;
11992
+ }
11993
+
11994
+ .surveydetailsform-wrapper {
11995
+ display: flex;
11996
+ flex-direction: column;
11997
+ width: 100%;
11998
+ }
11999
+ .surveydetailsform-wrapper p {
12000
+ color: red;
12001
+ font-size: 14px;
12002
+ }
12003
+
12004
+ .citizen-card-input{
12005
+ margin-bottom: 0 !important;
12006
+ }
12007
+
12008
+ @media (max-width: 1024px) {
12009
+ .ndcFormCard {
12010
+ grid-template-columns: repeat(2, 1fr);
12011
+ }
12012
+ }
12013
+
12014
+ @media (max-width: 768px) {
12015
+ .ndcFormCard {
12016
+ grid-template-columns: 1fr;
12017
+ }
12018
+ }
12019
+ `), /*#__PURE__*/React.createElement("div", {
12020
+ className: "employee-application-details",
12021
+ style: {
12022
+ marginBottom: "15px"
12023
+ }
12024
+ }, /*#__PURE__*/React.createElement(Header, null, "Search Receipts")), /*#__PURE__*/React.createElement("div", {
12025
+ className: "pageCard"
12026
+ }, /*#__PURE__*/React.createElement(FormProvider, methods, /*#__PURE__*/React.createElement("form", {
12027
+ onSubmit: handleSubmit(onSubmit)
12028
+ }, /*#__PURE__*/React.createElement("div", {
12029
+ className: "ndcFormCard"
12030
+ }, /*#__PURE__*/React.createElement("div", {
12031
+ className: "surveydetailsform-wrapper"
12032
+ }, /*#__PURE__*/React.createElement("label", null, "Receipt No"), /*#__PURE__*/React.createElement(TextInput, {
12033
+ name: "receiptNumbers",
12034
+ type: "text",
12035
+ inputRef: register({
12036
+ maxLength: {
12037
+ value: 200
12038
+ }
12039
+ })
12040
+ }), errors.receiptNumbers && /*#__PURE__*/React.createElement("p", {
12041
+ style: {
12042
+ color: "red"
12043
+ }
12044
+ }, errors.receiptNumbers.message)), /*#__PURE__*/React.createElement("div", {
12045
+ className: "surveydetailsform-wrapper"
12046
+ }, /*#__PURE__*/React.createElement("label", null, "Service Type ", /*#__PURE__*/React.createElement("span", {
12047
+ style: {
12048
+ color: "red"
12049
+ }
12050
+ }, "*")), /*#__PURE__*/React.createElement(Controller, {
12051
+ control: control,
12052
+ rules: {
12053
+ required: t("REQUIRED_FIELD")
12054
+ },
12055
+ name: "businessServices",
12056
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
12057
+ option: EmployeeStatusData,
12058
+ select: e => {
12059
+ props.onChange(e);
12060
+ },
12061
+ optionKey: "code",
12062
+ onBlur: props.onBlur,
12063
+ t: t,
12064
+ selected: props.value
12065
+ })
12066
+ }), errors.businessServices && /*#__PURE__*/React.createElement("p", {
12067
+ style: {
12068
+ color: "red"
12069
+ }
12070
+ }, errors.businessServices.message)), /*#__PURE__*/React.createElement("div", {
12071
+ className: "surveydetailsform-wrapper"
12072
+ }, /*#__PURE__*/React.createElement("label", null, "Consumer code"), /*#__PURE__*/React.createElement(TextInput, {
12073
+ name: "consumerCodes",
12074
+ type: "text",
12075
+ inputRef: register({
12076
+ maxLength: {
12077
+ value: 500
12078
+ }
12079
+ })
12080
+ }), errors.consumerCodes && /*#__PURE__*/React.createElement("p", {
12081
+ style: {
12082
+ color: "red"
12083
+ }
12084
+ }, errors.consumerCodes.message)), /*#__PURE__*/React.createElement("div", {
12085
+ className: "surveydetailsform-wrapper"
12086
+ }, /*#__PURE__*/React.createElement("label", null, "Mobile No"), /*#__PURE__*/React.createElement("div", {
12087
+ className: "field-container"
12088
+ }, /*#__PURE__*/React.createElement("span", {
12089
+ className: "citizen-card-input citizen-card-input--front",
12090
+ style: {
12091
+ flex: "none"
12092
+ }
12093
+ }, "+91"), /*#__PURE__*/React.createElement(TextInput, {
12094
+ name: "mobileNumber",
12095
+ type: "text",
12096
+ inputRef: register({
12097
+ pattern: {
12098
+ value: /^[0-9]+$/,
12099
+ message: "Only numbers are allowed"
12100
+ },
12101
+ minLength: {
12102
+ value: 10,
12103
+ message: "Mobile number must be at least 10 digits"
12104
+ },
12105
+ maxLength: {
12106
+ value: 15,
12107
+ message: "Mobile number cannot exceed 15 digits"
12108
+ }
12109
+ })
12110
+ }), errors.mobileNumber && /*#__PURE__*/React.createElement("p", {
12111
+ style: {
12112
+ color: "red"
12113
+ }
12114
+ }, errors.mobileNumber.message)))), /*#__PURE__*/React.createElement(SubmitBar, {
12115
+ label: "Search",
12116
+ submit: "submit"
12117
+ }))), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 0 ? /*#__PURE__*/React.createElement("div", {
12118
+ style: {
12119
+ backgroundColor: "white",
12120
+ marginRight: "200px",
12121
+ marginLeft: "2.5%",
12122
+ width: "100%"
12123
+ }
12124
+ }, /*#__PURE__*/React.createElement(Table, {
12125
+ t: t,
12126
+ data: tableData,
12127
+ totalRecords: 9,
12128
+ columns: columns,
12129
+ getCellProps: cellInfo => {
12130
+ return {
12131
+ style: {
12132
+ minWidth: cellInfo.column.Header === t("ES_INBOX_APPLICATION_NO") ? "240px" : "",
12133
+ padding: "20px 18px",
12134
+ fontSize: "16px"
12135
+ }
12136
+ };
12137
+ },
12138
+ currentPage: getValues("offset") / getValues("limit"),
12139
+ pageSizeLimit: getValues("limit"),
12140
+ disableSort: false,
12141
+ sortParams: [{
12142
+ id: getValues("sortBy"),
12143
+ desc: getValues("sortOrder") === "DESC" ? true : false
12144
+ }]
12145
+ })) : hasSearched && !isLoading && /*#__PURE__*/React.createElement("div", {
12146
+ style: {
12147
+ margin: "2rem 0",
12148
+ textAlign: "center",
12149
+ fontSize: "18px",
12150
+ color: "#505050"
12151
+ }
12152
+ }, t("No Records Found")), isLoading && /*#__PURE__*/React.createElement(Loader, null), showToast && /*#__PURE__*/React.createElement(Toast, {
12153
+ error: showToast.isError,
12154
+ label: t(showToast.label),
12155
+ onClose: closeToast,
12156
+ isDleteBtn: "true"
12157
+ })));
12158
+ };
12159
+
12160
+ const SearchChallan$2 = props => {
12161
+ console.log("props", props);
12162
+ const {
12163
+ t
12164
+ } = useTranslation();
12165
+ const history = useHistory();
12166
+ const tenantId = Digit.ULBService.getCurrentTenantId();
12167
+ const [isLoading, setIsLoading] = useState(false);
12168
+ const [showToast, setShowToast] = useState(null);
12169
+ const [tableData, setTableData] = useState([]);
12170
+ const {
12171
+ data: EmployeeStatusData = [],
12172
+ isLoading: callMDMS
12173
+ } = Digit.Hooks.useCustomMDMS(tenantId, "BillingService", [{
12174
+ name: "BusinessService",
12175
+ filter: "[?(@.type=='Adhoc')]"
12176
+ }], {
12177
+ select: data => {
12178
+ var _data$BillingService;
12179
+ const formattedData = data === null || data === void 0 ? void 0 : (_data$BillingService = data["BillingService"]) === null || _data$BillingService === void 0 ? void 0 : _data$BillingService["BusinessService"];
12180
+ return formattedData;
12181
+ }
12182
+ });
12183
+ const methods = useForm({
12184
+ defaultValues: {
12185
+ categoryName: ""
12186
+ }
12187
+ });
12188
+ const {
12189
+ register,
12190
+ handleSubmit,
12191
+ reset,
12192
+ control,
12193
+ getValues,
12194
+ formState: {
12195
+ errors
12196
+ }
12197
+ } = methods;
12198
+ const onSubmit = async data => {
12199
+ var _data$challanNo, _data$mobileNumber, _data$businessService;
12200
+ const noFieldFilled = !(data !== null && data !== void 0 && (_data$challanNo = data.challanNo) !== null && _data$challanNo !== void 0 && _data$challanNo.trim()) && !(data !== null && data !== void 0 && data.businessService) && !(data !== null && data !== void 0 && (_data$mobileNumber = data.mobileNumber) !== null && _data$mobileNumber !== void 0 && _data$mobileNumber.trim());
12201
+ if (noFieldFilled) {
12202
+ setShowToast({
12203
+ isError: true,
12204
+ label: "Please fill at least one field to search."
12205
+ });
12206
+ return;
12207
+ }
12208
+ console.log("data is here==========", data);
12209
+ setIsLoading(true);
12210
+ const businessServiceData = data === null || data === void 0 ? void 0 : (_data$businessService = data.businessService) === null || _data$businessService === void 0 ? void 0 : _data$businessService.code;
12211
+ const filters = Object.entries(data).reduce((acc, [key, value]) => {
12212
+ if (value !== null && value !== undefined && !(typeof value === "string" && value.trim() === "") && !(Array.isArray(value) && value.length === 0)) {
12213
+ acc[key] = key === "businessService" ? businessServiceData : value;
12214
+ }
12215
+ return acc;
12216
+ }, {});
12217
+ console.log("filters", filters);
12218
+ try {
12219
+ const response = await Digit.MCollectService.search({
12220
+ tenantId,
12221
+ filters
12222
+ });
12223
+ console.log("✅ recieptSearch response", response === null || response === void 0 ? void 0 : response.challans);
12224
+ setTableData(response === null || response === void 0 ? void 0 : response.challans);
12225
+ setIsLoading(false);
12226
+ } catch (error) {
12227
+ setIsLoading(false);
12228
+ console.log("error", error);
12229
+ }
12230
+ };
12231
+ const closeToast = () => {
12232
+ setShowToast(null);
12233
+ };
12234
+ const GetCell = value => /*#__PURE__*/React.createElement("span", {
12235
+ className: "cell-text"
12236
+ }, value);
12237
+ const columns = useMemo(() => [{
12238
+ Header: "Challan No",
12239
+ disableSortBy: true,
12240
+ accessor: row => {
12241
+ const challanNumber = row === null || row === void 0 ? void 0 : row.challanNo;
12242
+ return /*#__PURE__*/React.createElement("span", {
12243
+ className: "link"
12244
+ }, /*#__PURE__*/React.createElement(Link, {
12245
+ to: `${props.parentRoute}/challansearch/` + challanNumber
12246
+ }, challanNumber));
12247
+ }
12248
+ }, {
12249
+ Header: "Consumer Name",
12250
+ disableSortBy: true,
12251
+ accessor: row => {
12252
+ var _row$citizen;
12253
+ return GetCell(row === null || row === void 0 ? void 0 : (_row$citizen = row.citizen) === null || _row$citizen === void 0 ? void 0 : _row$citizen.name);
12254
+ }
12255
+ }, {
12256
+ Header: "Service Type",
12257
+ disableSortBy: true,
12258
+ accessor: row => {
12259
+ return GetCell(row === null || row === void 0 ? void 0 : row.businessService);
12260
+ }
12261
+ }, {
12262
+ Header: "Status",
12263
+ disableSortBy: true,
12264
+ accessor: row => {
12265
+ const formattedStatus = row === null || row === void 0 ? void 0 : row.applicationStatus.toLowerCase().replace(/^\w/, c => c.toUpperCase());
12266
+ return /*#__PURE__*/React.createElement("span", {
12267
+ className: "cell-text",
12268
+ style: {
12269
+ color: "green"
12270
+ }
12271
+ }, formattedStatus);
12272
+ }
12273
+ }], []);
12274
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
12275
+ .formWrapperNDC {
12276
+ // padding: 20px;
12277
+ // background: #fff;
12278
+ // border-radius: 10px;
12279
+ max-width: 1200px;
12280
+ // margin: auto;
12281
+ // box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
12282
+ }
12283
+
12284
+ .ndcFormCard {
12285
+ display: grid;
12286
+ grid-template-columns: repeat(3, 1fr);
12287
+ gap: 20px;
12288
+ }
12289
+
12290
+ .surveydetailsform-wrapper {
12291
+ display: flex;
12292
+ flex-direction: column;
12293
+ width: 100%;
12294
+ }
12295
+ .surveydetailsform-wrapper p {
12296
+ color: red;
12297
+ font-size: 14px;
12298
+ }
12299
+
12300
+ .citizen-card-input{
12301
+ margin-bottom: 0 !important;
12302
+ }
12303
+
12304
+ @media (max-width: 1024px) {
12305
+ .ndcFormCard {
12306
+ grid-template-columns: repeat(2, 1fr);
12307
+ }
12308
+ }
12309
+
12310
+ @media (max-width: 768px) {
12311
+ .ndcFormCard {
12312
+ grid-template-columns: 1fr;
12313
+ }
12314
+ }
12315
+ `), /*#__PURE__*/React.createElement("div", {
12316
+ className: "employee-application-details",
12317
+ style: {
12318
+ marginBottom: "15px"
12319
+ }
12320
+ }, /*#__PURE__*/React.createElement(Header, null, "Search Challan")), /*#__PURE__*/React.createElement("div", {
12321
+ className: "pageCard"
12322
+ }, /*#__PURE__*/React.createElement(FormProvider, methods, /*#__PURE__*/React.createElement("form", {
12323
+ onSubmit: handleSubmit(onSubmit)
12324
+ }, /*#__PURE__*/React.createElement("div", {
12325
+ className: "ndcFormCard"
12326
+ }, /*#__PURE__*/React.createElement("div", {
12327
+ className: "surveydetailsform-wrapper"
12328
+ }, /*#__PURE__*/React.createElement("label", null, "Challan No"), /*#__PURE__*/React.createElement(TextInput, {
12329
+ name: "challanNo",
12330
+ type: "text",
12331
+ inputRef: register({
12332
+ maxLength: {
12333
+ value: 200
12334
+ }
12335
+ })
12336
+ }), errors.challanNo && /*#__PURE__*/React.createElement("p", {
12337
+ style: {
12338
+ color: "red"
12339
+ }
12340
+ }, errors.challanNo.message)), /*#__PURE__*/React.createElement("div", {
12341
+ className: "surveydetailsform-wrapper"
12342
+ }, /*#__PURE__*/React.createElement("label", null, "Service Type"), /*#__PURE__*/React.createElement(Controller, {
12343
+ control: control,
12344
+ name: "businessService",
12345
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
12346
+ option: EmployeeStatusData,
12347
+ select: e => {
12348
+ props.onChange(e);
12349
+ },
12350
+ optionKey: "code",
12351
+ onBlur: props.onBlur,
12352
+ t: t,
12353
+ selected: props.value
12354
+ })
12355
+ }), errors.businessService && /*#__PURE__*/React.createElement("p", {
12356
+ style: {
12357
+ color: "red"
12358
+ }
12359
+ }, errors.businessService.message)), /*#__PURE__*/React.createElement("div", {
12360
+ className: "surveydetailsform-wrapper"
12361
+ }, /*#__PURE__*/React.createElement("label", null, "Mobile No"), /*#__PURE__*/React.createElement("div", {
12362
+ className: "field-container"
12363
+ }, /*#__PURE__*/React.createElement("span", {
12364
+ className: "citizen-card-input citizen-card-input--front",
12365
+ style: {
12366
+ flex: "none"
12367
+ }
12368
+ }, "+91"), /*#__PURE__*/React.createElement(TextInput, {
12369
+ name: "mobileNumber",
12370
+ type: "text",
12371
+ inputRef: register({
12372
+ pattern: {
12373
+ value: /^[0-9]+$/,
12374
+ message: "Only numbers are allowed"
12375
+ },
12376
+ minLength: {
12377
+ value: 10,
12378
+ message: "Mobile number must be at least 10 digits"
12379
+ },
12380
+ maxLength: {
12381
+ value: 15,
12382
+ message: "Mobile number cannot exceed 15 digits"
12383
+ }
12384
+ })
12385
+ }), errors.mobileNumber && /*#__PURE__*/React.createElement("p", {
12386
+ style: {
12387
+ color: "red"
12388
+ }
12389
+ }, errors.mobileNumber.message)))), /*#__PURE__*/React.createElement(SubmitBar, {
12390
+ label: "Search",
12391
+ submit: "submit"
12392
+ }))), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 0 && /*#__PURE__*/React.createElement("div", {
12393
+ style: {
12394
+ backgroundColor: "white",
12395
+ marginRight: "200px",
12396
+ marginLeft: "2.5%",
12397
+ width: "100%"
12398
+ }
12399
+ }, /*#__PURE__*/React.createElement(Table, {
12400
+ t: t,
12401
+ data: tableData,
12402
+ totalRecords: 9,
12403
+ columns: columns,
12404
+ getCellProps: cellInfo => {
12405
+ return {
12406
+ style: {
12407
+ minWidth: cellInfo.column.Header === t("ES_INBOX_APPLICATION_NO") ? "240px" : "",
12408
+ padding: "20px 18px",
12409
+ fontSize: "16px"
12410
+ }
12411
+ };
12412
+ },
12413
+ currentPage: getValues("offset") / getValues("limit"),
12414
+ pageSizeLimit: getValues("limit"),
12415
+ disableSort: false,
12416
+ sortParams: [{
12417
+ id: getValues("sortBy"),
12418
+ desc: getValues("sortOrder") === "DESC" ? true : false
12419
+ }]
12420
+ })), showToast && /*#__PURE__*/React.createElement(Toast, {
12421
+ error: showToast.isError,
12422
+ label: t(showToast.label),
12423
+ onClose: closeToast,
12424
+ isDleteBtn: "true"
12425
+ }), isLoading && /*#__PURE__*/React.createElement(Loader, null)));
12426
+ };
12427
+
12428
+ const SearchBill = () => {
12429
+ const {
12430
+ t
12431
+ } = useTranslation();
12432
+ const history = useHistory();
12433
+ const tenantId = Digit.ULBService.getCurrentTenantId();
12434
+ const [isLoading, setIsLoading] = useState(false);
12435
+ const [showToast, setShowToast] = useState(null);
12436
+ const [tableData, setTableData] = useState([]);
12437
+ const [hasSearched, setHasSearched] = useState(false);
12438
+ const {
12439
+ data: EmployeeStatusData = [],
12440
+ isLoading: callMDMS
12441
+ } = Digit.Hooks.useCustomMDMS(tenantId, "BillingService", [{
12442
+ name: "BusinessService",
12443
+ filter: "[?(@.type=='Adhoc')]"
12444
+ }], {
12445
+ select: data => {
12446
+ var _data$BillingService;
12447
+ const formattedData = data === null || data === void 0 ? void 0 : (_data$BillingService = data["BillingService"]) === null || _data$BillingService === void 0 ? void 0 : _data$BillingService["BusinessService"];
12448
+ return formattedData;
12449
+ }
12450
+ });
12451
+ const {
12452
+ data: ULBData = [],
12453
+ isLoading: ulbLoading
12454
+ } = Digit.Hooks.useCustomMDMS(tenantId, "tenant", [{
12455
+ name: "tenants"
12456
+ }], {
12457
+ select: data => {
12458
+ var _data$tenant;
12459
+ const formattedData = data === null || data === void 0 ? void 0 : (_data$tenant = data["tenant"]) === null || _data$tenant === void 0 ? void 0 : _data$tenant["tenants"];
12460
+ return formattedData;
12461
+ }
12462
+ });
12463
+ const methods = useForm({
12464
+ defaultValues: {
12465
+ categoryName: ""
12466
+ }
12467
+ });
12468
+ const {
12469
+ register,
12470
+ handleSubmit,
12471
+ reset,
12472
+ control,
12473
+ formState: {
12474
+ errors
12475
+ },
12476
+ getValues
12477
+ } = methods;
12478
+ const onSubmit = async data => {
12479
+ var _data$businesService;
12480
+ setIsLoading(true);
12481
+ setHasSearched(true);
12482
+ console.log("data is here==========", data);
12483
+ const businessServiceData = data === null || data === void 0 ? void 0 : (_data$businesService = data.businesService) === null || _data$businesService === void 0 ? void 0 : _data$businesService.code;
12484
+ delete data["ULB"];
12485
+ data["url"] = "egov-searcher/bill-genie/mcollectbills/_get";
12486
+ const filteredData = Object.entries(data).reduce((acc, [key, value]) => {
12487
+ if (value !== null && value !== undefined && !(typeof value === "string" && value.trim() === "") && !(Array.isArray(value) && value.length === 0)) {
12488
+ acc[key] = key === "businesService" ? businessServiceData : value;
12489
+ }
12490
+ return acc;
12491
+ }, {});
12492
+ console.log("filteredData", filteredData);
12493
+ try {
12494
+ const response = await Digit.MCollectService.search_bill(tenantId, filteredData);
12495
+ console.log("response", response === null || response === void 0 ? void 0 : response.Bills);
12496
+ setTableData(response === null || response === void 0 ? void 0 : response.Bills);
12497
+ setIsLoading(false);
12498
+ } catch (error) {
12499
+ setIsLoading(false);
12500
+ console.log("error", error);
12501
+ }
12502
+ };
12503
+ const closeToast = () => {
12504
+ setShowToast(null);
12505
+ };
12506
+ const GetCell = value => /*#__PURE__*/React.createElement("span", {
12507
+ className: "cell-text"
12508
+ }, value);
12509
+ const columns = useMemo(() => [{
12510
+ Header: "Bill No",
12511
+ disableSortBy: true,
12512
+ accessor: row => {
12513
+ const receiptNumber = row === null || row === void 0 ? void 0 : row.billNumber;
12514
+ return /*#__PURE__*/React.createElement("span", {
12515
+ className: "cell-text",
12516
+ style: {
12517
+ color: "blue",
12518
+ textDecoration: "underline",
12519
+ cursor: "pointer"
12520
+ },
12521
+ onClick: () => downloadPDF(row)
12522
+ }, receiptNumber);
12523
+ }
12524
+ }, {
12525
+ Header: "Consumer Name",
12526
+ disableSortBy: true,
12527
+ accessor: row => {
12528
+ return GetCell(row === null || row === void 0 ? void 0 : row.payerName);
12529
+ }
12530
+ }, {
12531
+ Header: "Bill Date",
12532
+ disableSortBy: true,
12533
+ accessor: row => {
12534
+ const date = new Date(row === null || row === void 0 ? void 0 : row.billDate);
12535
+ const formattedDate = date.toLocaleDateString("en-GB");
12536
+ return GetCell(formattedDate);
12537
+ }
12538
+ }, {
12539
+ Header: "Bill Amount (Rs)",
12540
+ disableSortBy: true,
12541
+ accessor: row => {
12542
+ return GetCell(row === null || row === void 0 ? void 0 : row.totalAmount);
12543
+ }
12544
+ }, {
12545
+ Header: "Status",
12546
+ disableSortBy: true,
12547
+ accessor: row => {
12548
+ return GetCell(row === null || row === void 0 ? void 0 : row.status);
12549
+ }
12550
+ }, {
12551
+ Header: "Action",
12552
+ disableSortBy: true,
12553
+ accessor: row => {
12554
+ return /*#__PURE__*/React.createElement(SubmitBar, {
12555
+ onSubmit: () => alert("payment integration is pending"),
12556
+ label: "Pay"
12557
+ });
12558
+ }
12559
+ }], []);
12560
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
12561
+ .formWrapperNDC {
12562
+ // padding: 20px;
12563
+ // background: #fff;
12564
+ // border-radius: 10px;
12565
+ max-width: 1200px;
12566
+ // margin: auto;
12567
+ // box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
12568
+ }
12569
+
12570
+ .ndcFormCard {
12571
+ display: grid;
12572
+ grid-template-columns: repeat(3, 1fr);
12573
+ gap: 20px;
12574
+ }
12575
+
12576
+ .surveydetailsform-wrapper {
12577
+ display: flex;
12578
+ flex-direction: column;
12579
+ width: 100%;
12580
+ }
12581
+ .surveydetailsform-wrapper p {
12582
+ color: red;
12583
+ font-size: 14px;
12584
+ }
12585
+
12586
+ .citizen-card-input{
12587
+ margin-bottom: 0 !important;
12588
+ }
12589
+
12590
+ @media (max-width: 1024px) {
12591
+ .ndcFormCard {
12592
+ grid-template-columns: repeat(2, 1fr);
12593
+ }
12594
+ }
12595
+
12596
+ @media (max-width: 768px) {
12597
+ .ndcFormCard {
12598
+ grid-template-columns: 1fr;
12599
+ }
12600
+ }
12601
+ `), /*#__PURE__*/React.createElement("div", {
12602
+ className: "employee-application-details",
12603
+ style: {
12604
+ marginBottom: "15px"
12605
+ }
12606
+ }, /*#__PURE__*/React.createElement(Header, null, "Search Bill"), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SubmitBar, {
12607
+ onSubmit: () => history.push("/digit-ui/employee/mcollect/group-bill"),
12608
+ label: "Group Bills"
12609
+ }), " ")), /*#__PURE__*/React.createElement("div", {
12610
+ className: "pageCard"
12611
+ }, /*#__PURE__*/React.createElement(FormProvider, methods, /*#__PURE__*/React.createElement("form", {
12612
+ onSubmit: handleSubmit(onSubmit)
12613
+ }, /*#__PURE__*/React.createElement("div", {
12614
+ className: "ndcFormCard"
12615
+ }, /*#__PURE__*/React.createElement("div", {
12616
+ className: "surveydetailsform-wrapper"
12617
+ }, /*#__PURE__*/React.createElement("label", null, "ULB", /*#__PURE__*/React.createElement("span", {
12618
+ style: {
12619
+ color: "red"
12620
+ }
12621
+ }, "*")), /*#__PURE__*/React.createElement(Controller, {
12622
+ control: control,
12623
+ name: "ULB",
12624
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
12625
+ option: ULBData,
12626
+ select: e => {
12627
+ props.onChange(e);
12628
+ },
12629
+ optionKey: "name",
12630
+ onBlur: props.onBlur,
12631
+ t: t,
12632
+ selected: props.value
12633
+ })
12634
+ }), errors.serviceCategory && /*#__PURE__*/React.createElement("p", {
12635
+ style: {
12636
+ color: "red"
12637
+ }
12638
+ }, errors.serviceCategory.message)), /*#__PURE__*/React.createElement("div", {
12639
+ className: "surveydetailsform-wrapper"
12640
+ }, /*#__PURE__*/React.createElement("label", null, "Service Type ", /*#__PURE__*/React.createElement("span", {
12641
+ style: {
12642
+ color: "red"
12643
+ }
12644
+ }, "*")), /*#__PURE__*/React.createElement(Controller, {
12645
+ control: control,
12646
+ rules: {
12647
+ required: t("REQUIRED_FIELD")
12648
+ },
12649
+ name: "businesService",
12650
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
12651
+ option: EmployeeStatusData,
12652
+ select: e => {
12653
+ props.onChange(e);
12654
+ },
12655
+ optionKey: "code",
12656
+ onBlur: props.onBlur,
12657
+ t: t,
12658
+ selected: props.value
12659
+ })
12660
+ }), errors.businesService && /*#__PURE__*/React.createElement("p", {
12661
+ style: {
12662
+ color: "red"
12663
+ }
12664
+ }, errors.businesService.message)), /*#__PURE__*/React.createElement("div", {
12665
+ className: "surveydetailsform-wrapper"
12666
+ }, /*#__PURE__*/React.createElement("label", null, "Consumer code"), /*#__PURE__*/React.createElement(TextInput, {
12667
+ name: "consumerCode",
12668
+ type: "text",
12669
+ inputRef: register({
12670
+ maxLength: {
12671
+ value: 500
12672
+ }
12673
+ })
12674
+ }), errors.consumerCode && /*#__PURE__*/React.createElement("p", {
12675
+ style: {
12676
+ color: "red"
12677
+ }
12678
+ }, errors.consumerCode.message)), /*#__PURE__*/React.createElement("div", {
12679
+ className: "surveydetailsform-wrapper"
12680
+ }, /*#__PURE__*/React.createElement("label", null, "Bill No"), /*#__PURE__*/React.createElement(TextInput, {
12681
+ name: "billNo",
12682
+ type: "text",
12683
+ inputRef: register({
12684
+ maxLength: {
12685
+ value: 500
12686
+ }
12687
+ })
12688
+ }), errors.billNo && /*#__PURE__*/React.createElement("p", {
12689
+ style: {
12690
+ color: "red"
12691
+ }
12692
+ }, errors.billNo.message)), /*#__PURE__*/React.createElement("div", {
12693
+ className: "surveydetailsform-wrapper"
12694
+ }, /*#__PURE__*/React.createElement("label", null, "Mobile No"), /*#__PURE__*/React.createElement("div", {
12695
+ className: "field-container"
12696
+ }, /*#__PURE__*/React.createElement("span", {
12697
+ className: "citizen-card-input citizen-card-input--front",
12698
+ style: {
12699
+ flex: "none"
12700
+ }
12701
+ }, "+91"), /*#__PURE__*/React.createElement(TextInput, {
12702
+ name: "mobileNumber",
12703
+ type: "text",
12704
+ inputRef: register({
12705
+ pattern: {
12706
+ value: /^[0-9]+$/,
12707
+ message: "Only numbers are allowed"
12708
+ },
12709
+ minLength: {
12710
+ value: 10,
12711
+ message: "Mobile number must be at least 10 digits"
12712
+ },
12713
+ maxLength: {
12714
+ value: 15,
12715
+ message: "Mobile number cannot exceed 15 digits"
12716
+ }
12717
+ })
12718
+ }), errors.mobileNumber && /*#__PURE__*/React.createElement("p", {
12719
+ style: {
12720
+ color: "red"
12721
+ }
12722
+ }, errors.mobileNumber.message)))), /*#__PURE__*/React.createElement(SubmitBar, {
12723
+ label: "Next",
12724
+ submit: "submit"
12725
+ }))), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 0 ? /*#__PURE__*/React.createElement("div", {
12726
+ style: {
12727
+ backgroundColor: "white",
12728
+ marginRight: "200px",
12729
+ marginLeft: "2.5%",
12730
+ width: "100%"
12731
+ }
12732
+ }, /*#__PURE__*/React.createElement(Table, {
12733
+ t: t,
12734
+ data: tableData,
12735
+ totalRecords: 9,
12736
+ columns: columns,
12737
+ getCellProps: cellInfo => {
12738
+ return {
12739
+ style: {
12740
+ minWidth: cellInfo.column.Header === t("ES_INBOX_APPLICATION_NO") ? "240px" : "",
12741
+ padding: "20px 18px",
12742
+ fontSize: "16px"
12743
+ }
12744
+ };
12745
+ },
12746
+ currentPage: getValues("offset") / getValues("limit"),
12747
+ pageSizeLimit: getValues("limit"),
12748
+ disableSort: false,
12749
+ sortParams: [{
12750
+ id: getValues("sortBy"),
12751
+ desc: getValues("sortOrder") === "DESC" ? true : false
12752
+ }]
12753
+ })) : hasSearched && !isLoading && /*#__PURE__*/React.createElement("div", {
12754
+ style: {
12755
+ margin: "2rem 0",
12756
+ textAlign: "center",
12757
+ fontSize: "18px",
12758
+ color: "#505050"
12759
+ }
12760
+ }, t("No Records Found")), showToast && /*#__PURE__*/React.createElement(Toast, {
12761
+ error: showToast.isError,
12762
+ label: t(showToast.label),
12763
+ onClose: closeToast,
12764
+ isDleteBtn: "true"
12765
+ }), isLoading && /*#__PURE__*/React.createElement(Loader, null)));
12766
+ };
12767
+
12768
+ const GroupBills = () => {
12769
+ const {
12770
+ t
12771
+ } = useTranslation();
12772
+ const history = useHistory();
12773
+ const tenantId = Digit.ULBService.getCurrentTenantId();
12774
+ const [isLoading, setIsLoading] = useState(false);
12775
+ const [showToast, setShowToast] = useState(null);
12776
+ const [tableData, setTableData] = useState([]);
12777
+ const [hasSearched, setHasSearched] = useState(false);
12778
+ const {
12779
+ data: EmployeeStatusData = [],
12780
+ isLoading: callMDMS
12781
+ } = Digit.Hooks.useCustomMDMS(tenantId, "BillingService", [{
12782
+ name: "BusinessService",
12783
+ filter: "[?(@.type=='Adhoc')]"
12784
+ }], {
12785
+ select: data => {
12786
+ var _data$BillingService;
12787
+ const formattedData = data === null || data === void 0 ? void 0 : (_data$BillingService = data["BillingService"]) === null || _data$BillingService === void 0 ? void 0 : _data$BillingService["BusinessService"];
12788
+ return formattedData;
12789
+ }
12790
+ });
12791
+ const methods = useForm({
12792
+ defaultValues: {
12793
+ categoryName: ""
12794
+ }
12795
+ });
12796
+ const {
12797
+ register,
12798
+ handleSubmit,
12799
+ reset,
12800
+ control,
12801
+ formState: {
12802
+ errors
12803
+ }
12804
+ } = methods;
12805
+ const onSubmit = async data => {
12806
+ console.log("data is here==========", data);
12807
+ };
12808
+ useEffect(() => {
12809
+ console.log("errors", errors);
12810
+ }, [errors]);
12811
+ const closeToast = () => {
12812
+ setShowToast(null);
12813
+ };
12814
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
12815
+ .formWrapperNDC {
12816
+ // padding: 20px;
12817
+ // background: #fff;
12818
+ // border-radius: 10px;
12819
+ max-width: 1200px;
12820
+ // margin: auto;
12821
+ // box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
12822
+ }
12823
+
12824
+ .ndcFormCard {
12825
+ display: grid;
12826
+ grid-template-columns: repeat(3, 1fr);
12827
+ gap: 20px;
12828
+ }
12829
+
12830
+ .surveydetailsform-wrapper {
12831
+ display: flex;
12832
+ flex-direction: column;
12833
+ width: 100%;
12834
+ }
12835
+ .surveydetailsform-wrapper p {
12836
+ color: red;
12837
+ font-size: 14px;
12838
+ }
12839
+
12840
+
12841
+ @media (max-width: 1024px) {
12842
+ .ndcFormCard {
12843
+ grid-template-columns: repeat(2, 1fr);
12844
+ }
12845
+ }
12846
+
12847
+ @media (max-width: 768px) {
12848
+ .ndcFormCard {
12849
+ grid-template-columns: 1fr;
12850
+ }
12851
+ }
12852
+ `), /*#__PURE__*/React.createElement("div", {
12853
+ className: "employee-application-details",
12854
+ style: {
12855
+ marginBottom: "15px"
12856
+ }
12857
+ }, /*#__PURE__*/React.createElement(Header, null, "Group Bills")), /*#__PURE__*/React.createElement("div", {
12858
+ className: "pageCard"
12859
+ }, /*#__PURE__*/React.createElement(FormProvider, methods, /*#__PURE__*/React.createElement("form", {
12860
+ onSubmit: handleSubmit(onSubmit)
12861
+ }, /*#__PURE__*/React.createElement("div", {
12862
+ className: "ndcFormCard"
12863
+ }, /*#__PURE__*/React.createElement("div", {
12864
+ className: "surveydetailsform-wrapper"
12865
+ }, /*#__PURE__*/React.createElement("label", null, "ULB ", /*#__PURE__*/React.createElement("span", {
12866
+ style: {
12867
+ color: "red"
12868
+ }
12869
+ }, "*")), /*#__PURE__*/React.createElement(Controller, {
12870
+ control: control,
12871
+ rules: {
12872
+ required: t("REQUIRED_FIELD")
12873
+ },
12874
+ name: "ULB",
12875
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
12876
+ option: [{
12877
+ active: true,
12878
+ code: "CONTRACT"
12879
+ }],
12880
+ select: e => {
12881
+ props.onChange(e);
12882
+ },
12883
+ optionKey: "code",
12884
+ onBlur: props.onBlur,
12885
+ t: t,
12886
+ selected: props.value
12887
+ })
12888
+ }), errors.ULB && /*#__PURE__*/React.createElement("p", {
12889
+ style: {
12890
+ color: "red"
12891
+ }
12892
+ }, errors.ULB.message)), /*#__PURE__*/React.createElement("div", {
12893
+ className: "surveydetailsform-wrapper"
12894
+ }, /*#__PURE__*/React.createElement("label", null, "Service Category ", /*#__PURE__*/React.createElement("span", {
12895
+ style: {
12896
+ color: "red"
12897
+ }
12898
+ }, "*")), /*#__PURE__*/React.createElement(Controller, {
12899
+ control: control,
12900
+ rules: {
12901
+ required: t("REQUIRED_FIELD")
12902
+ },
12903
+ name: "businesService",
12904
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
12905
+ option: EmployeeStatusData,
12906
+ select: e => {
12907
+ props.onChange(e);
12908
+ },
12909
+ optionKey: "code",
12910
+ onBlur: props.onBlur,
12911
+ t: t,
12912
+ selected: props.value
12913
+ })
12914
+ }), errors.businesService && /*#__PURE__*/React.createElement("p", {
12915
+ style: {
12916
+ color: "red"
12917
+ }
12918
+ }, errors.businesService.message)), /*#__PURE__*/React.createElement("div", {
12919
+ className: "surveydetailsform-wrapper"
12920
+ }, /*#__PURE__*/React.createElement("label", null, "select Batch or Locality\u2009*", /*#__PURE__*/React.createElement("span", {
12921
+ style: {
12922
+ color: "red"
12923
+ }
12924
+ }, "*")), /*#__PURE__*/React.createElement(Controller, {
12925
+ control: control,
12926
+ rules: {
12927
+ required: t("REQUIRED_FIELD")
12928
+ },
12929
+ name: "serviceCategory",
12930
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
12931
+ option: [{
12932
+ active: true,
12933
+ code: "CONTRACT"
12934
+ }],
12935
+ select: e => {
12936
+ props.onChange(e);
12937
+ },
12938
+ optionKey: "code",
12939
+ onBlur: props.onBlur,
12940
+ t: t,
12941
+ selected: props.value
12942
+ })
12943
+ }), errors.serviceCategory && /*#__PURE__*/React.createElement("p", {
12944
+ style: {
12945
+ color: "red"
12946
+ }
12947
+ }, errors.serviceCategory.message)), /*#__PURE__*/React.createElement("div", {
12948
+ className: "surveydetailsform-wrapper"
12949
+ }, /*#__PURE__*/React.createElement("label", null, "Location/Mohalla"), /*#__PURE__*/React.createElement(Controller, {
12950
+ control: control,
12951
+ rules: {
12952
+ required: t("REQUIRED_FIELD")
12953
+ },
12954
+ name: "serviceCategory",
12955
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
12956
+ option: [{
12957
+ active: true,
12958
+ code: "CONTRACT"
12959
+ }],
12960
+ select: e => {
12961
+ props.onChange(e);
12962
+ },
12963
+ optionKey: "code",
12964
+ onBlur: props.onBlur,
12965
+ t: t,
12966
+ selected: props.value
12967
+ })
12968
+ }), errors.serviceCategory && /*#__PURE__*/React.createElement("p", {
12969
+ style: {
12970
+ color: "red"
12971
+ }
12972
+ }, errors.serviceCategory.message)), /*#__PURE__*/React.createElement("div", {
12973
+ className: "surveydetailsform-wrapper"
12974
+ }, /*#__PURE__*/React.createElement("label", null, "Batch"), /*#__PURE__*/React.createElement(Controller, {
12975
+ control: control,
12976
+ name: "serviceCategory",
12977
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
12978
+ option: [{
12979
+ active: true,
12980
+ code: "CONTRACT"
12981
+ }],
12982
+ select: e => {
12983
+ props.onChange(e);
12984
+ },
12985
+ optionKey: "code",
12986
+ onBlur: props.onBlur,
12987
+ t: t,
12988
+ selected: props.value
12989
+ })
12990
+ }), errors.serviceCategory && /*#__PURE__*/React.createElement("p", {
12991
+ style: {
12992
+ color: "red"
12993
+ }
12994
+ }, errors.serviceCategory.message)), /*#__PURE__*/React.createElement("div", {
12995
+ className: "surveydetailsform-wrapper"
12996
+ }, /*#__PURE__*/React.createElement("label", null, "Group"), /*#__PURE__*/React.createElement(Controller, {
12997
+ control: control,
12998
+ name: "group",
12999
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
13000
+ option: [{
13001
+ active: true,
13002
+ code: "CONTRACT"
13003
+ }],
13004
+ select: e => {
13005
+ props.onChange(e);
13006
+ },
13007
+ optionKey: "code",
13008
+ onBlur: props.onBlur,
13009
+ t: t,
13010
+ selected: props.value
13011
+ })
13012
+ }), errors.serviceCategory && /*#__PURE__*/React.createElement("p", {
13013
+ style: {
13014
+ color: "red"
13015
+ }
13016
+ }, errors.serviceCategory.message)), /*#__PURE__*/React.createElement("div", {
13017
+ className: "surveydetailsform-wrapper"
13018
+ }, /*#__PURE__*/React.createElement("label", null, "Consumer ID"), /*#__PURE__*/React.createElement(TextInput, {
13019
+ name: "billNo",
13020
+ type: "text",
13021
+ inputRef: register({
13022
+ maxLength: {
13023
+ value: 500
13024
+ }
13025
+ })
13026
+ }), errors.billNo && /*#__PURE__*/React.createElement("p", {
13027
+ style: {
13028
+ color: "red"
13029
+ }
13030
+ }, errors.billNo.message))), /*#__PURE__*/React.createElement(SubmitBar, {
13031
+ label: "Next",
13032
+ submit: "submit"
13033
+ }))), showToast && /*#__PURE__*/React.createElement(Toast, {
13034
+ error: showToast.isError,
13035
+ label: t(showToast.label),
13036
+ onClose: closeToast,
13037
+ isDleteBtn: "true"
13038
+ }), isLoading && /*#__PURE__*/React.createElement(Loader, null)));
13039
+ };
13040
+
11842
13041
  const MCollectModule = ({
11843
13042
  stateCode,
11844
13043
  userType,
@@ -11910,6 +13109,10 @@ const componentsToRegister = {
11910
13109
  MCollectSearchChallanComponent: SearchChallan$1,
11911
13110
  MCollectSearchResultsComponent: CitizenSearchResults,
11912
13111
  MCollectMyChallanResultsComponent: MyChallans,
13112
+ SearchReceipt,
13113
+ SearchChallan: SearchChallan$2,
13114
+ SearchBill,
13115
+ GroupBill: GroupBills,
11913
13116
  MCOLLECT_INBOX_FILTER: props => /*#__PURE__*/React.createElement(Filter, props)
11914
13117
  };
11915
13118
  const initMCollectComponents = () => {