@djb25/digit-ui-module-ws 1.0.50 → 1.0.52

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.
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useMemo, useEffect, useRef, Fragment as Fragment$1, useReducer, useCallback } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Link, useHistory, useLocation, Switch, Route, useRouteMatch, Redirect, useParams } from 'react-router-dom';
4
- import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, SearchForm, SearchField, Dropdown, TextInput, Table, Banner, CardText, ActionBar, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, LayoutWrapper, PrintBtnCommon, MultiLink, LinkButton, Toast, TickMark, FormStep, CardLabel, RadioOrSelect, CardHeader, CitizenInfoLabel, CardSubHeader, LabelFieldPair, DatePicker, CollapsibleCardPage, RadioButtons, UploadFile, ViewsIcon, Modal, DeleteIcon, CardLabelError, WrapUnMaskComponent, MobileNumber, CheckBox, StatusTable, Row, Header, CardSectionHeader, InfoIcon, TextArea, FilterFormField, RemoveableTag, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, CloseSvg, Localities, DownloadBtnCommon, CollectionIcon, ResponseComposer, TelePhone, DisplayPhotos, PDFSvg, GenericFileIcon, EditIcon, Label, CardSectionSubText, DownloadIcon, CardLabelDesc, VerticalTimeline, FormComposer, MultiUploadWrapper, Close as Close$e, BreakLine, AddIcon, CheckPoint, ConnectingCheckPoints, Menu, ButtonSelector, CitizenHomeCard } from '@djb25/digit-ui-react-components';
4
+ import { Loader, Card, KeyNote, SubmitBar, InfoBannerIcon, SearchForm, SearchField, Dropdown, TextInput, Table, Banner, CardText, ActionBar, HomeIcon, AppContainer, ModuleHeader, ArrowLeft, PrivateRoute, VerticalTimeline, CollapsibleCardPage, LabelFieldPair, CardLabel, CardLabelError, LayoutWrapper, PrintBtnCommon, MultiLink, LinkButton, Toast, TickMark, FormStep, RadioOrSelect, CardHeader, CitizenInfoLabel, CardSubHeader, DatePicker, RadioButtons, UploadFile, ViewsIcon, Modal, DeleteIcon, WrapUnMaskComponent, MobileNumber, CheckBox, StatusTable, Row, Header, CardSectionHeader, InfoIcon, TextArea, FilterFormField, RemoveableTag, MultiSelectDropdown, InboxComposer, DropIcon, WSICon, EmployeeModuleCard, SearchAction, PopUp, DetailsCard, CloseSvg, Localities, DownloadBtnCommon, CollectionIcon, ResponseComposer, TelePhone, DisplayPhotos, PDFSvg, GenericFileIcon, EditIcon, Label, CardSectionSubText, DownloadIcon, CardLabelDesc, FormComposer, MultiUploadWrapper, Close as Close$e, BreakLine, AddIcon, CheckPoint, ConnectingCheckPoints, Menu, ButtonSelector, CitizenHomeCard } from '@djb25/digit-ui-react-components';
5
5
  import { useForm, Controller, useWatch, useFormContext } from 'react-hook-form';
6
6
  import { read, utils as utils$1 } from 'xlsx';
7
7
  import { useQueryClient } from 'react-query';
@@ -1853,6 +1853,29 @@ const checkForNA = function (value) {
1853
1853
  }
1854
1854
  return value && value != null && value !== undefined && value !== "" && value !== "Image" ? value : " NA";
1855
1855
  };
1856
+ const WSCalculationPayload = (data, tenantId) => {
1857
+ var _useDetails$colonyNam, _useDetails$categoryT, _useDetails$propertyC, _useDetails$propertyT, _useDetails$propertyC2, _useDetails$WaterConn, _useDetails$noOfFloor;
1858
+ const useDetails = (data === null || data === void 0 ? void 0 : data.useDetails) || data || {};
1859
+ const payload = {
1860
+ connectionType: (data === null || data === void 0 ? void 0 : data.connectionType) || "METERED",
1861
+ colonyCategory: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$colonyNam = useDetails.colonyName) === null || _useDetails$colonyNam === void 0 ? void 0 : _useDetails$colonyNam.code) || (useDetails === null || useDetails === void 0 ? void 0 : useDetails.colonyCategory) || "",
1862
+ categoryType: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$categoryT = useDetails.categoryType) === null || _useDetails$categoryT === void 0 ? void 0 : _useDetails$categoryT.code) || "",
1863
+ propertyCategory: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC = useDetails.propertyCategory) === null || _useDetails$propertyC === void 0 ? void 0 : _useDetails$propertyC.code) || "",
1864
+ propertyType: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyT = useDetails.propertyType) === null || _useDetails$propertyT === void 0 ? void 0 : _useDetails$propertyT.code) || "",
1865
+ usageCategory: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$propertyC2 = useDetails.propertyCategory) === null || _useDetails$propertyC2 === void 0 ? void 0 : _useDetails$propertyC2.code) || "",
1866
+ waterConnectionUsageType: (useDetails === null || useDetails === void 0 ? void 0 : (_useDetails$WaterConn = useDetails.WaterConnectionUsageType) === null || _useDetails$WaterConn === void 0 ? void 0 : _useDetails$WaterConn.code) || "",
1867
+ landArea: useDetails !== null && useDetails !== void 0 && useDetails.plotArea ? Number(useDetails.plotArea) : 0,
1868
+ builtUpArea: useDetails !== null && useDetails !== void 0 && useDetails.builtUpArea ? Number(useDetails.builtUpArea) : 0,
1869
+ farArea: useDetails !== null && useDetails !== void 0 && useDetails.farArea ? Number(useDetails.farArea) : 0,
1870
+ numberOfFloors: useDetails !== null && useDetails !== void 0 && (_useDetails$noOfFloor = useDetails.noOfFloors) !== null && _useDetails$noOfFloor !== void 0 && _useDetails$noOfFloor.code ? Number(useDetails.noOfFloors.code) : 0,
1871
+ numberOfStudents: useDetails !== null && useDetails !== void 0 && useDetails.numberOfStudents ? Number(useDetails.numberOfStudents) : 0,
1872
+ numberOfBeds: useDetails !== null && useDetails !== void 0 && useDetails.numberOfBeds ? Number(useDetails.numberOfBeds) : 0
1873
+ };
1874
+ if (useDetails !== null && useDetails !== void 0 && useDetails.NumberofRooms) payload.numberOfRooms = Number(useDetails.NumberofRooms);
1875
+ if (useDetails !== null && useDetails !== void 0 && useDetails.NumberofDwellingUnits) payload.numberOfDwellingUnits = Number(useDetails.NumberofDwellingUnits);
1876
+ if (useDetails !== null && useDetails !== void 0 && useDetails.ServantQuartersRoom) payload.servantQuartersRoom = Number(useDetails.ServantQuartersRoom);
1877
+ return payload;
1878
+ };
1856
1879
 
1857
1880
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
1858
1881
 
@@ -9592,6 +9615,770 @@ const WSDisconnectionResponse$1 = props => {
9592
9615
  }))));
9593
9616
  };
9594
9617
 
9618
+ const _excluded = ["config", "onSelect", "formData", "formState", "setError", "clearErrors"];
9619
+ const colonyNameOptions = [{
9620
+ code: "A",
9621
+ name: "A"
9622
+ }, {
9623
+ code: "B",
9624
+ name: "B"
9625
+ }, {
9626
+ code: "C",
9627
+ name: "C"
9628
+ }, {
9629
+ code: "D",
9630
+ name: "D"
9631
+ }, {
9632
+ code: "E",
9633
+ name: "E"
9634
+ }, {
9635
+ code: "F",
9636
+ name: "F"
9637
+ }, {
9638
+ code: "G",
9639
+ name: "G"
9640
+ }, {
9641
+ code: "H",
9642
+ name: "H"
9643
+ }];
9644
+ const NUMBER_PATTERN = /^\d+$/;
9645
+ const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
9646
+ const WSCalculation = _ref => {
9647
+ var _formData$cpt2, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0, _errors$useDetails1, _errors$useDetails10, _errors$useDetails11;
9648
+ let config = _ref.config,
9649
+ onSelect = _ref.onSelect,
9650
+ formData = _ref.formData,
9651
+ setError = _ref.setError,
9652
+ clearErrors = _ref.clearErrors,
9653
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
9654
+ const _useForm = useForm({
9655
+ defaultValues: (formData === null || formData === void 0 ? void 0 : formData[config === null || config === void 0 ? void 0 : config.key]) || {
9656
+ useDetails: {
9657
+ propertyCategory: null,
9658
+ propertyType: null,
9659
+ WaterConnectionUsageType: null,
9660
+ plotArea: "",
9661
+ builtUpArea: "",
9662
+ farArea: "",
9663
+ NumberofDwellingUnits: "",
9664
+ NumberofRooms: "",
9665
+ numberOfBeds: "",
9666
+ numberOfStudents: "",
9667
+ ServantQuartersRoom: "",
9668
+ colonyName: ""
9669
+ }
9670
+ }
9671
+ }),
9672
+ control = _useForm.control,
9673
+ register = _useForm.register,
9674
+ errors = _useForm.formState.errors,
9675
+ watch = _useForm.watch,
9676
+ setValue = _useForm.setValue,
9677
+ reset = _useForm.reset;
9678
+ const tenantId = Digit.ULBService.getCurrentTenantId();
9679
+ const _useTranslation = useTranslation(),
9680
+ t = _useTranslation.t;
9681
+ const _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSCalculater({
9682
+ tenantId
9683
+ }),
9684
+ calculateCharges = _Digit$Hooks$ws$useWS.mutate;
9685
+ const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["PropertyCategory", "PropertyType", "PropertyNewUsageType"]),
9686
+ ptServicesMastersData = _Digit$Hooks$pt$usePr.data;
9687
+ const _Digit$Hooks$ws$useMD = Digit.Hooks.ws.useMDMS(tenantId, "ws-services-masters", ["WsCategoryType"]),
9688
+ wsServicesMastersData = _Digit$Hooks$ws$useMD.data;
9689
+ const _useState = useState([]),
9690
+ categoryTypeList = _useState[0],
9691
+ setCategoryTypeList = _useState[1];
9692
+ const _useState2 = useState(null),
9693
+ calculationData = _useState2[0],
9694
+ setCalculationData = _useState2[1];
9695
+ useEffect(() => {
9696
+ var _wsServicesMastersDat;
9697
+ const categories = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat === void 0 ? void 0 : _wsServicesMastersDat.WsCategoryType) || [];
9698
+ categories.forEach(data => data.i18nKey = data.i18nKey || "WS_CATEGORY_" + data.code);
9699
+ setCategoryTypeList(categories);
9700
+ }, [wsServicesMastersData]);
9701
+ useEffect(() => {
9702
+ if (props.register) {
9703
+ props.register({
9704
+ name: "cpt"
9705
+ });
9706
+ }
9707
+ }, [props.register]);
9708
+ const formValue = watch();
9709
+ const watchCategoryType = watch("useDetails.categoryType");
9710
+ const watchPropertyType = watch("useDetails.propertyType");
9711
+ const watchPropertyCategory = watch("useDetails.propertyCategory");
9712
+ const watchWaterConnectionUsageType = watch("useDetails.WaterConnectionUsageType");
9713
+ const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
9714
+ const isHotelRestaurantProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOTEL_OR_RESTAURANT" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HotelOrRestaurant";
9715
+ const isSchoolCollegeProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "School" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "College";
9716
+ const isDwellingUnit = (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL" || (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL";
9717
+ const isServentHouse = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "Apartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "FlatOrApartment" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "IndividualHouse";
9718
+ const categoryOptions = useMemo(() => {
9719
+ var _ptServicesMastersDat, _ptServicesMastersDat2;
9720
+ let options = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat === void 0 ? void 0 : (_ptServicesMastersDat2 = _ptServicesMastersDat.PropertyCategory) === null || _ptServicesMastersDat2 === void 0 ? void 0 : _ptServicesMastersDat2.filter(item => item.active)) || [];
9721
+ if (watchCategoryType !== null && watchCategoryType !== void 0 && watchCategoryType.code) {
9722
+ options = options.filter(item => item.type === watchCategoryType.code);
9723
+ }
9724
+ return options.map(item => ({
9725
+ code: item.code,
9726
+ name: item.name
9727
+ }));
9728
+ }, [ptServicesMastersData, watchCategoryType]);
9729
+ useEffect(() => {
9730
+ if (watchCategoryType && watchPropertyCategory) {
9731
+ const isCategoryValid = categoryOptions.some(opt => opt.code === watchPropertyCategory.code);
9732
+ if (!isCategoryValid) {
9733
+ setValue("useDetails.propertyCategory", null);
9734
+ }
9735
+ }
9736
+ }, [watchCategoryType, categoryOptions, setValue, watchPropertyCategory]);
9737
+ const propertyTypeOptions = useMemo(() => {
9738
+ var _ptServicesMastersDat3, _ptServicesMastersDat4;
9739
+ let options = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat3 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat3 === void 0 ? void 0 : (_ptServicesMastersDat4 = _ptServicesMastersDat3.PropertyType) === null || _ptServicesMastersDat4 === void 0 ? void 0 : _ptServicesMastersDat4.filter(item => item.active)) || [];
9740
+ if (watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code) {
9741
+ var _watchPropertyCategor;
9742
+ if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor = watchPropertyCategory.code) === null || _watchPropertyCategor === void 0 ? void 0 : _watchPropertyCategor.toUpperCase()) !== "MIXED") {
9743
+ options = options.filter(item => {
9744
+ var _item$type, _watchPropertyCategor2;
9745
+ return ((_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.toUpperCase()) === ((_watchPropertyCategor2 = watchPropertyCategory.code) === null || _watchPropertyCategor2 === void 0 ? void 0 : _watchPropertyCategor2.toUpperCase());
9746
+ });
9747
+ }
9748
+ }
9749
+ return options.map(item => ({
9750
+ code: item.code,
9751
+ name: item.name
9752
+ }));
9753
+ }, [ptServicesMastersData, watchPropertyCategory]);
9754
+ useEffect(() => {
9755
+ if (watchPropertyCategory && watchPropertyType) {
9756
+ const isTypeValid = propertyTypeOptions.some(opt => opt.code === watchPropertyType.code);
9757
+ if (!isTypeValid) {
9758
+ setValue("useDetails.propertyType", null);
9759
+ }
9760
+ }
9761
+ }, [watchPropertyCategory, propertyTypeOptions, setValue, watchPropertyType]);
9762
+ const usageTypeOptions = useMemo(() => {
9763
+ var _ptServicesMastersDat5, _ptServicesMastersDat6;
9764
+ let options = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat5 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat5 === void 0 ? void 0 : (_ptServicesMastersDat6 = _ptServicesMastersDat5.PropertyNewUsageType) === null || _ptServicesMastersDat6 === void 0 ? void 0 : _ptServicesMastersDat6.filter(item => item.active)) || [];
9765
+ if (watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code) {
9766
+ var _watchPropertyCategor3;
9767
+ if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor3 = watchPropertyCategory.code) === null || _watchPropertyCategor3 === void 0 ? void 0 : _watchPropertyCategor3.toUpperCase()) !== "MIXED") {
9768
+ options = options.filter(item => {
9769
+ var _item$type2, _watchPropertyCategor4;
9770
+ return ((_item$type2 = item.type) === null || _item$type2 === void 0 ? void 0 : _item$type2.toUpperCase()) === ((_watchPropertyCategor4 = watchPropertyCategory.code) === null || _watchPropertyCategor4 === void 0 ? void 0 : _watchPropertyCategor4.toUpperCase());
9771
+ });
9772
+ }
9773
+ }
9774
+ return options.map(item => ({
9775
+ code: item.code,
9776
+ name: item.name
9777
+ }));
9778
+ }, [ptServicesMastersData, watchPropertyCategory]);
9779
+ useEffect(() => {
9780
+ if (watchPropertyType && watchWaterConnectionUsageType) {
9781
+ const isUsageTypeValid = usageTypeOptions.some(opt => opt.code === watchWaterConnectionUsageType.code);
9782
+ if (!isUsageTypeValid) {
9783
+ setValue("useDetails.WaterConnectionUsageType", null);
9784
+ }
9785
+ }
9786
+ }, [watchPropertyType, usageTypeOptions, setValue, watchWaterConnectionUsageType]);
9787
+ const lastSentValue = React.useRef(null);
9788
+ useEffect(() => {
9789
+ if (!lodash.isEqual(lastSentValue.current, formValue)) {
9790
+ lastSentValue.current = lodash.cloneDeep(formValue);
9791
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(config === null || config === void 0 ? void 0 : config.key, formValue);
9792
+ }
9793
+ }, [formValue, config === null || config === void 0 ? void 0 : config.key, onSelect]);
9794
+ useEffect(() => {
9795
+ var _formData$cpt;
9796
+ if (formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && _formData$cpt.details) {
9797
+ var _details$usageCategor, _details$landArea, _details$superBuiltUp;
9798
+ const details = formData.cpt.details;
9799
+ const additionalDetails = (details === null || details === void 0 ? void 0 : details.additionalDetails) || {};
9800
+ const catType = additionalDetails.categoryType || ((_details$usageCategor = details.usageCategory) !== null && _details$usageCategor !== void 0 && _details$usageCategor.includes("RESIDENTIAL") ? "DOMESTIC" : "NON_DOMESTIC");
9801
+ setValue("useDetails.categoryType", (categoryTypeList === null || categoryTypeList === void 0 ? void 0 : categoryTypeList.find(o => o.code === catType)) || null);
9802
+ setValue("useDetails.propertyCategory", (categoryOptions === null || categoryOptions === void 0 ? void 0 : categoryOptions.find(o => o.code === (additionalDetails.propertyCategory || details.usageCategory))) || null);
9803
+ setValue("useDetails.propertyType", (propertyTypeOptions === null || propertyTypeOptions === void 0 ? void 0 : propertyTypeOptions.find(o => o.code === (additionalDetails.propertyType || details.propertyType))) || null);
9804
+ setValue("useDetails.WaterConnectionUsageType", (usageTypeOptions === null || usageTypeOptions === void 0 ? void 0 : usageTypeOptions.find(o => o.code === additionalDetails.waterConnectionUsageType)) || null);
9805
+ setValue("useDetails.plotArea", additionalDetails.plotArea || (details === null || details === void 0 ? void 0 : (_details$landArea = details.landArea) === null || _details$landArea === void 0 ? void 0 : _details$landArea.toString()) || "");
9806
+ setValue("useDetails.builtUpArea", additionalDetails.builtUpArea || (details === null || details === void 0 ? void 0 : (_details$superBuiltUp = details.superBuiltUpArea) === null || _details$superBuiltUp === void 0 ? void 0 : _details$superBuiltUp.toString()) || "");
9807
+ setValue("useDetails.NumberofDwellingUnits", additionalDetails.numberOfDwellingUnits || additionalDetails.noOfDwellingUnits || (details === null || details === void 0 ? void 0 : details.noOfDwellingUnits) || "");
9808
+ setValue("useDetails.NumberofRooms", additionalDetails.numberOfRooms || additionalDetails.noOfRooms || (details === null || details === void 0 ? void 0 : details.noOfRooms) || "");
9809
+ setValue("useDetails.colonyName", additionalDetails.colonyName || "");
9810
+ } else if ((formData === null || formData === void 0 ? void 0 : formData.cpt) === null) {
9811
+ setValue("useDetails.categoryType", null);
9812
+ setValue("useDetails.propertyCategory", null);
9813
+ setValue("useDetails.propertyType", null);
9814
+ setValue("useDetails.WaterConnectionUsageType", null);
9815
+ setValue("useDetails.plotArea", "");
9816
+ setValue("useDetails.builtUpArea", "");
9817
+ setValue("useDetails.farArea", "");
9818
+ setValue("useDetails.NumberofDwellingUnits", "");
9819
+ setValue("useDetails.NumberofRooms", "");
9820
+ setValue("useDetails.numberOfBeds", "");
9821
+ setValue("useDetails.numberOfStudents", "");
9822
+ setValue("useDetails.ServantQuartersRoom", "");
9823
+ setValue("useDetails.colonyName", "");
9824
+ }
9825
+ }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : _formData$cpt2.details, formData === null || formData === void 0 ? void 0 : formData.cpt, categoryOptions, propertyTypeOptions, usageTypeOptions, categoryTypeList, setValue]);
9826
+ const lastErrorState = React.useRef(null);
9827
+ useEffect(() => {
9828
+ const hasErrors = Object.keys(errors).length > 0;
9829
+ if (lastErrorState.current !== hasErrors) {
9830
+ lastErrorState.current = hasErrors;
9831
+ if (hasErrors) {
9832
+ if (setError) setError(config === null || config === void 0 ? void 0 : config.key, {
9833
+ type: "custom",
9834
+ message: "Validation failed"
9835
+ });
9836
+ } else {
9837
+ if (clearErrors) clearErrors(config === null || config === void 0 ? void 0 : config.key);
9838
+ }
9839
+ }
9840
+ }, [errors, config === null || config === void 0 ? void 0 : config.key, setError, clearErrors]);
9841
+ const errorStyle = {
9842
+ width: "70%",
9843
+ marginLeft: "30%",
9844
+ fontSize: "12px",
9845
+ marginTop: "-21px"
9846
+ };
9847
+ const isMobile = window.Digit.Utils.browser.isMobile();
9848
+ const handleSubmit = () => {
9849
+ const payload = WSCalculationPayload(formValue);
9850
+ calculateCharges(payload, {
9851
+ onSuccess: data => {
9852
+ setCalculationData(data);
9853
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(config === null || config === void 0 ? void 0 : config.key, _extends({}, formValue, {
9854
+ payload,
9855
+ calculationResponse: data
9856
+ }));
9857
+ },
9858
+ onError: error => {
9859
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
9860
+ if (setError) setError(config === null || config === void 0 ? void 0 : config.key, {
9861
+ type: "custom",
9862
+ message: (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message) || t("WS_CALCULATION_FAILED")
9863
+ });
9864
+ }
9865
+ });
9866
+ };
9867
+ const RenderCalculationDetails = _ref2 => {
9868
+ var _data$Calculation, _calc$calculationDeta, _calc$calculationDeta2, _calc$calculationDeta3, _waterDemandDetail$co, _waterDemandDetail$co2, _waterDemandDetail$co3, _waterDemandDetail$co4, _waterDemandDetail$co5, _waterDemandDetail$co6, _waterDemandDetail$co7, _waterDemandDetail$co8, _waterDemandDetail$co9, _waterDemandDetail$co0, _waterDemandDetail$co1, _waterDemandDetail$co10, _waterDemandDetail$co11, _waterDemandDetail$co12, _waterDemandDetail$co13, _waterDemandDetail$co14, _waterDemandDetail$co15, _waterDemandDetail$co16, _infraDetail$waterCom, _infraDetail$sewerCom, _infraDetail$grossIFC, _infraDetail$rebateAm, _infraDetail$netIFC;
9869
+ let data = _ref2.data;
9870
+ if (!data) return null;
9871
+ const calc = (_data$Calculation = data.Calculation) === null || _data$Calculation === void 0 ? void 0 : _data$Calculation[0];
9872
+ if (!calc) return null;
9873
+ const propertyDetail = ((_calc$calculationDeta = calc.calculationDetail) === null || _calc$calculationDeta === void 0 ? void 0 : _calc$calculationDeta.propertyDetail) || {};
9874
+ const waterDemandDetail = ((_calc$calculationDeta2 = calc.calculationDetail) === null || _calc$calculationDeta2 === void 0 ? void 0 : _calc$calculationDeta2.waterDemandDetail) || {};
9875
+ const infraDetail = ((_calc$calculationDeta3 = calc.calculationDetail) === null || _calc$calculationDeta3 === void 0 ? void 0 : _calc$calculationDeta3.infrastructureChargeDetail) || {};
9876
+ const taxHeadEstimates = calc.taxHeadEstimates || [];
9877
+ const totalAmount = calc.totalAmount;
9878
+ return /*#__PURE__*/React.createElement("div", {
9879
+ className: "ws-calc-details-wrapper"
9880
+ }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
9881
+ className: "ws-calc-detail-card"
9882
+ }, /*#__PURE__*/React.createElement("div", {
9883
+ className: "ws-calc-detail-card-header"
9884
+ }, /*#__PURE__*/React.createElement("span", {
9885
+ className: "ws-calc-detail-card-badge"
9886
+ }, "1"), /*#__PURE__*/React.createElement("h3", {
9887
+ className: "ws-calc-detail-card-title"
9888
+ }, t("WS_PROPERTY_DETAILS"))), /*#__PURE__*/React.createElement("div", {
9889
+ className: "ws-calc-property-box"
9890
+ }, /*#__PURE__*/React.createElement("div", {
9891
+ className: "ws-calc-grid-4"
9892
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9893
+ className: "ws-calc-label"
9894
+ }, t("WS_PROPERTY_TYPE")), /*#__PURE__*/React.createElement("div", {
9895
+ className: "ws-calc-value"
9896
+ }, propertyDetail.propertyType || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9897
+ className: "ws-calc-label"
9898
+ }, t("WS_PROPERTY_CATEGORY")), /*#__PURE__*/React.createElement("div", {
9899
+ className: "ws-calc-value"
9900
+ }, propertyDetail.usageCategory || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9901
+ className: "ws-calc-label"
9902
+ }, t("WS_WATER_CONNECTION_USAGE_TYPE")), /*#__PURE__*/React.createElement("div", {
9903
+ className: "ws-calc-value"
9904
+ }, propertyDetail.waterConnectionUsageType || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9905
+ className: "ws-calc-label"
9906
+ }, t("WS_COLONY_CATEGORY")), /*#__PURE__*/React.createElement("div", {
9907
+ className: "ws-calc-pill"
9908
+ }, propertyDetail.colonyCategory || "-"))), /*#__PURE__*/React.createElement("hr", {
9909
+ className: "ws-calc-hr"
9910
+ }), /*#__PURE__*/React.createElement("div", {
9911
+ className: "ws-calc-grid-4"
9912
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9913
+ className: "ws-calc-label"
9914
+ }, t("WS_LAND_AREA")), /*#__PURE__*/React.createElement("div", {
9915
+ className: "ws-calc-value"
9916
+ }, propertyDetail.landArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9917
+ className: "ws-calc-label"
9918
+ }, t("WS_FAR_AREA")), /*#__PURE__*/React.createElement("div", {
9919
+ className: "ws-calc-value"
9920
+ }, propertyDetail.farArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9921
+ className: "ws-calc-label"
9922
+ }, t("WS_BUILT_UP_AREA")), /*#__PURE__*/React.createElement("div", {
9923
+ className: "ws-calc-value"
9924
+ }, ((_waterDemandDetail$co = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co === void 0 ? void 0 : _waterDemandDetail$co.built_up_area) || 0, " sq. m.")), (propertyDetail.coveredArea > 0 || ((_waterDemandDetail$co2 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co2 === void 0 ? void 0 : _waterDemandDetail$co2.covered_area) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9925
+ className: "ws-calc-label"
9926
+ }, t("WS_COVERED_AREA")), /*#__PURE__*/React.createElement("div", {
9927
+ className: "ws-calc-value"
9928
+ }, propertyDetail.coveredArea || ((_waterDemandDetail$co3 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co3 === void 0 ? void 0 : _waterDemandDetail$co3.covered_area), " sq. m.")), (propertyDetail.numberOfDwellingUnits > 0 || ((_waterDemandDetail$co4 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co4 === void 0 ? void 0 : _waterDemandDetail$co4.dwelling_units) > 0 || ((_waterDemandDetail$co5 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co5 === void 0 ? void 0 : _waterDemandDetail$co5.total_du) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9929
+ className: "ws-calc-label"
9930
+ }, t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React.createElement("div", {
9931
+ className: "ws-calc-value"
9932
+ }, propertyDetail.numberOfDwellingUnits || ((_waterDemandDetail$co6 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co6 === void 0 ? void 0 : _waterDemandDetail$co6.dwelling_units) || ((_waterDemandDetail$co7 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co7 === void 0 ? void 0 : _waterDemandDetail$co7.total_du))), (propertyDetail.numberOfBeds > 0 || ((_waterDemandDetail$co8 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co8 === void 0 ? void 0 : _waterDemandDetail$co8.total_beds) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9933
+ className: "ws-calc-label"
9934
+ }, t("WS_NUMBER_OF_BEDS")), /*#__PURE__*/React.createElement("div", {
9935
+ className: "ws-calc-value"
9936
+ }, propertyDetail.numberOfBeds || ((_waterDemandDetail$co9 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co9 === void 0 ? void 0 : _waterDemandDetail$co9.total_beds))), (propertyDetail.numberOfRooms > 0 || ((_waterDemandDetail$co0 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co0 === void 0 ? void 0 : _waterDemandDetail$co0.total_rooms) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9937
+ className: "ws-calc-label"
9938
+ }, t("WS_NUMBER_OF_ROOMS")), /*#__PURE__*/React.createElement("div", {
9939
+ className: "ws-calc-value"
9940
+ }, propertyDetail.numberOfRooms || ((_waterDemandDetail$co1 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co1 === void 0 ? void 0 : _waterDemandDetail$co1.total_rooms))), (propertyDetail.numberOfStudents > 0 || ((_waterDemandDetail$co10 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co10 === void 0 ? void 0 : _waterDemandDetail$co10.total_students) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9941
+ className: "ws-calc-label"
9942
+ }, t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React.createElement("div", {
9943
+ className: "ws-calc-value"
9944
+ }, propertyDetail.numberOfStudents || ((_waterDemandDetail$co11 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co11 === void 0 ? void 0 : _waterDemandDetail$co11.total_students))), (propertyDetail.numberOfStaff > 0 || ((_waterDemandDetail$co12 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co12 === void 0 ? void 0 : _waterDemandDetail$co12.total_staff) > 0) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9945
+ className: "ws-calc-label"
9946
+ }, t("WS_NUMBER_OF_STAFF")), /*#__PURE__*/React.createElement("div", {
9947
+ className: "ws-calc-value"
9948
+ }, propertyDetail.numberOfStaff || ((_waterDemandDetail$co13 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co13 === void 0 ? void 0 : _waterDemandDetail$co13.total_staff))), ((_waterDemandDetail$co14 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co14 === void 0 ? void 0 : _waterDemandDetail$co14.total_seats) > 0 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9949
+ className: "ws-calc-label"
9950
+ }, t("WS_NUMBER_OF_SEATS")), /*#__PURE__*/React.createElement("div", {
9951
+ className: "ws-calc-value"
9952
+ }, waterDemandDetail.contextVariables.total_seats)), ((_waterDemandDetail$co15 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co15 === void 0 ? void 0 : _waterDemandDetail$co15.highest_shift_strength) > 0 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9953
+ className: "ws-calc-label"
9954
+ }, t("WS_HIGHEST_SHIFT_STRENGTH")), /*#__PURE__*/React.createElement("div", {
9955
+ className: "ws-calc-value"
9956
+ }, waterDemandDetail.contextVariables.highest_shift_strength)), ((_waterDemandDetail$co16 = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co16 === void 0 ? void 0 : _waterDemandDetail$co16.sanctioned_beds) > 0 && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9957
+ className: "ws-calc-label"
9958
+ }, t("WS_SANCTIONED_BEDS")), /*#__PURE__*/React.createElement("div", {
9959
+ className: "ws-calc-value"
9960
+ }, waterDemandDetail.contextVariables.sanctioned_beds))))), /*#__PURE__*/React.createElement("div", {
9961
+ className: "ws-calc-detail-card"
9962
+ }, /*#__PURE__*/React.createElement("div", {
9963
+ className: "ws-calc-detail-card-header"
9964
+ }, /*#__PURE__*/React.createElement("span", {
9965
+ className: "ws-calc-detail-card-badge"
9966
+ }, "2"), /*#__PURE__*/React.createElement("h3", {
9967
+ className: "ws-calc-detail-card-title"
9968
+ }, t("WS_WATER_DEMAND_DETAILS"))), /*#__PURE__*/React.createElement("div", {
9969
+ className: "ws-calc-split-card"
9970
+ }, /*#__PURE__*/React.createElement("div", {
9971
+ className: "ws-calc-split-left"
9972
+ }, /*#__PURE__*/React.createElement("div", {
9973
+ className: "ws-calc-row"
9974
+ }, /*#__PURE__*/React.createElement("span", {
9975
+ className: "ws-calc-row-label"
9976
+ }, t("WS_MATCHED_NORM_CODE")), /*#__PURE__*/React.createElement("span", {
9977
+ className: "ws-calc-row-value"
9978
+ }, waterDemandDetail.matchedNormCode || "-")), /*#__PURE__*/React.createElement("div", {
9979
+ className: "ws-calc-row"
9980
+ }, /*#__PURE__*/React.createElement("span", {
9981
+ className: "ws-calc-row-label"
9982
+ }, t("WS_MATCHED_NORM_NAME")), /*#__PURE__*/React.createElement("span", {
9983
+ className: "ws-calc-row-value-right"
9984
+ }, waterDemandDetail.matchedNormName || "-")), /*#__PURE__*/React.createElement("div", {
9985
+ className: "ws-calc-row"
9986
+ }, /*#__PURE__*/React.createElement("span", {
9987
+ className: "ws-calc-row-label"
9988
+ }, t("WS_FORMULA_USED")), /*#__PURE__*/React.createElement("span", {
9989
+ className: "ws-calc-row-value"
9990
+ }, waterDemandDetail.formulaUsed || "-")), /*#__PURE__*/React.createElement("div", {
9991
+ className: "ws-calc-row"
9992
+ }, /*#__PURE__*/React.createElement("span", {
9993
+ className: "ws-calc-row-label"
9994
+ }, t("WS_CALCULATED_OCCUPANCY")), /*#__PURE__*/React.createElement("span", {
9995
+ className: "ws-calc-row-value"
9996
+ }, waterDemandDetail.calculatedOccupancy || 0, " Persons")), /*#__PURE__*/React.createElement("div", {
9997
+ className: "ws-calc-row-last"
9998
+ }, /*#__PURE__*/React.createElement("span", {
9999
+ className: "ws-calc-row-label"
10000
+ }, t("WS_LPCD_SELECTED")), /*#__PURE__*/React.createElement("span", {
10001
+ className: "ws-calc-row-value"
10002
+ }, waterDemandDetail.chosenLpcd || 0, " LPD"))), /*#__PURE__*/React.createElement("div", {
10003
+ className: "ws-calc-split-right"
10004
+ }, /*#__PURE__*/React.createElement("div", {
10005
+ className: "ws-calc-row"
10006
+ }, /*#__PURE__*/React.createElement("span", {
10007
+ className: "ws-calc-row-label"
10008
+ }, t("WS_BASE_DEMAND")), /*#__PURE__*/React.createElement("span", {
10009
+ className: "ws-calc-row-value"
10010
+ }, waterDemandDetail.baseDemand || 0, " L/day")), /*#__PURE__*/React.createElement("div", {
10011
+ className: "ws-calc-row",
10012
+ style: {
10013
+ marginBottom: "24px"
10014
+ }
10015
+ }, /*#__PURE__*/React.createElement("span", {
10016
+ className: "ws-calc-row-label"
10017
+ }, t("WS_CONTINGENCY")), /*#__PURE__*/React.createElement("span", {
10018
+ className: "ws-calc-row-value"
10019
+ }, waterDemandDetail.contingencyPercentage || 0, "%")), /*#__PURE__*/React.createElement("div", {
10020
+ className: "ws-calc-highlight-blue"
10021
+ }, /*#__PURE__*/React.createElement("span", {
10022
+ className: "ws-calc-highlight-blue-label"
10023
+ }, t("WS_TOTAL_WATER_DEMAND")), /*#__PURE__*/React.createElement("span", {
10024
+ className: "ws-calc-highlight-blue-value"
10025
+ }, waterDemandDetail.totalWaterDemandLPD || 0, " L/day"))))), /*#__PURE__*/React.createElement("div", {
10026
+ className: "ws-calc-detail-card"
10027
+ }, /*#__PURE__*/React.createElement("div", {
10028
+ className: "ws-calc-detail-card-header"
10029
+ }, /*#__PURE__*/React.createElement("span", {
10030
+ className: "ws-calc-detail-card-badge"
10031
+ }, "3"), /*#__PURE__*/React.createElement("h3", {
10032
+ className: "ws-calc-detail-card-title"
10033
+ }, t("WS_INFRASTRUCTURE_CHARGE_DETAILS"))), /*#__PURE__*/React.createElement("div", {
10034
+ className: "ws-calc-split-card"
10035
+ }, /*#__PURE__*/React.createElement("div", {
10036
+ className: "ws-calc-split-left"
10037
+ }, /*#__PURE__*/React.createElement("div", {
10038
+ className: "ws-calc-row"
10039
+ }, /*#__PURE__*/React.createElement("span", {
10040
+ className: "ws-calc-row-label"
10041
+ }, t("WS_COLONY_CATEGORY")), /*#__PURE__*/React.createElement("span", {
10042
+ className: "ws-calc-row-value"
10043
+ }, infraDetail.colonyCategory || "-")), /*#__PURE__*/React.createElement("div", {
10044
+ className: "ws-calc-row"
10045
+ }, /*#__PURE__*/React.createElement("span", {
10046
+ className: "ws-calc-row-label"
10047
+ }, t("WS_PLOT_AREA")), /*#__PURE__*/React.createElement("span", {
10048
+ className: "ws-calc-row-value"
10049
+ }, infraDetail.plotArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", {
10050
+ className: "ws-calc-row"
10051
+ }, /*#__PURE__*/React.createElement("span", {
10052
+ className: "ws-calc-row-label"
10053
+ }, t("WS_MINIMUM_PLOT_AREA")), /*#__PURE__*/React.createElement("span", {
10054
+ className: "ws-calc-row-value"
10055
+ }, infraDetail.minimumPlotArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", {
10056
+ className: "ws-calc-row"
10057
+ }, /*#__PURE__*/React.createElement("span", {
10058
+ className: "ws-calc-row-label"
10059
+ }, t("WS_WATER_RATE")), /*#__PURE__*/React.createElement("span", {
10060
+ className: "ws-calc-row-value"
10061
+ }, "\u20B9 ", infraDetail.waterRatePerLPD || 0, " / LPD")), /*#__PURE__*/React.createElement("div", {
10062
+ className: "ws-calc-row-last"
10063
+ }, /*#__PURE__*/React.createElement("span", {
10064
+ className: "ws-calc-row-label"
10065
+ }, t("WS_SEWER_RATE")), /*#__PURE__*/React.createElement("span", {
10066
+ className: "ws-calc-row-value"
10067
+ }, "\u20B9 ", infraDetail.sewerRatePerLPD || 0, " / LPD"))), /*#__PURE__*/React.createElement("div", {
10068
+ className: "ws-calc-split-right"
10069
+ }, /*#__PURE__*/React.createElement("div", {
10070
+ className: "ws-calc-row"
10071
+ }, /*#__PURE__*/React.createElement("span", {
10072
+ className: "ws-calc-row-label"
10073
+ }, t("WS_WATER_COMPONENT_IFC")), /*#__PURE__*/React.createElement("span", {
10074
+ className: "ws-calc-row-value"
10075
+ }, "\u20B9 ", ((_infraDetail$waterCom = infraDetail.waterComponentIFC) === null || _infraDetail$waterCom === void 0 ? void 0 : _infraDetail$waterCom.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10076
+ className: "ws-calc-row"
10077
+ }, /*#__PURE__*/React.createElement("span", {
10078
+ className: "ws-calc-row-label"
10079
+ }, t("WS_SEWER_COMPONENT_IFC")), /*#__PURE__*/React.createElement("span", {
10080
+ className: "ws-calc-row-value"
10081
+ }, "\u20B9 ", ((_infraDetail$sewerCom = infraDetail.sewerComponentIFC) === null || _infraDetail$sewerCom === void 0 ? void 0 : _infraDetail$sewerCom.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10082
+ className: "ws-calc-row"
10083
+ }, /*#__PURE__*/React.createElement("span", {
10084
+ className: "ws-calc-row-label"
10085
+ }, t("WS_GROSS_IFC")), /*#__PURE__*/React.createElement("span", {
10086
+ className: "ws-calc-row-value"
10087
+ }, "\u20B9 ", ((_infraDetail$grossIFC = infraDetail.grossIFC) === null || _infraDetail$grossIFC === void 0 ? void 0 : _infraDetail$grossIFC.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10088
+ className: "ws-calc-row"
10089
+ }, /*#__PURE__*/React.createElement("span", {
10090
+ className: "ws-calc-row-label"
10091
+ }, t("WS_REBATE"), " (", infraDetail.rebatePercentage || 0, "%)"), /*#__PURE__*/React.createElement("span", {
10092
+ className: "ws-calc-row-value-red"
10093
+ }, "- \u20B9 ", ((_infraDetail$rebateAm = infraDetail.rebateAmount) === null || _infraDetail$rebateAm === void 0 ? void 0 : _infraDetail$rebateAm.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10094
+ className: "ws-calc-highlight-green"
10095
+ }, /*#__PURE__*/React.createElement("span", {
10096
+ className: "ws-calc-highlight-green-label"
10097
+ }, t("WS_NET_INFRASTRUCTURE_CHARGE")), /*#__PURE__*/React.createElement("span", {
10098
+ className: "ws-calc-highlight-green-value"
10099
+ }, "\u20B9 ", ((_infraDetail$netIFC = infraDetail.netIFC) === null || _infraDetail$netIFC === void 0 ? void 0 : _infraDetail$netIFC.toLocaleString("en-IN")) || 0))))), /*#__PURE__*/React.createElement("div", {
10100
+ className: "ws-calc-detail-card",
10101
+ style: {
10102
+ marginBottom: "0"
10103
+ }
10104
+ }, /*#__PURE__*/React.createElement("div", {
10105
+ className: "ws-calc-detail-card-header"
10106
+ }, /*#__PURE__*/React.createElement("span", {
10107
+ className: "ws-calc-detail-card-badge"
10108
+ }, "4"), /*#__PURE__*/React.createElement("h3", {
10109
+ className: "ws-calc-detail-card-title"
10110
+ }, t("WS_FEE_SUMMARY"))), /*#__PURE__*/React.createElement("div", {
10111
+ className: "ws-calc-split-card",
10112
+ style: {
10113
+ marginBottom: "0"
10114
+ }
10115
+ }, /*#__PURE__*/React.createElement("div", {
10116
+ className: "ws-calc-split-left",
10117
+ style: {
10118
+ display: "flex",
10119
+ flexDirection: "column",
10120
+ justifyContent: "center"
10121
+ }
10122
+ }, taxHeadEstimates.map((taxHead, index) => {
10123
+ var _taxHead$estimateAmou;
10124
+ return /*#__PURE__*/React.createElement("div", {
10125
+ key: index,
10126
+ className: "ws-calc-row"
10127
+ }, /*#__PURE__*/React.createElement("span", {
10128
+ className: "ws-calc-row-label"
10129
+ }, t(taxHead.taxHeadCode)), /*#__PURE__*/React.createElement("span", {
10130
+ className: "ws-calc-row-value"
10131
+ }, "\u20B9 ", (_taxHead$estimateAmou = taxHead.estimateAmount) === null || _taxHead$estimateAmou === void 0 ? void 0 : _taxHead$estimateAmou.toLocaleString("en-IN")));
10132
+ })), /*#__PURE__*/React.createElement("div", {
10133
+ className: "ws-calc-highlight-purple"
10134
+ }, /*#__PURE__*/React.createElement("span", {
10135
+ className: "ws-calc-highlight-purple-label"
10136
+ }, t("WS_TOTAL_AMOUNT_PAYABLE")), /*#__PURE__*/React.createElement("span", {
10137
+ className: "ws-calc-highlight-purple-value"
10138
+ }, "\u20B9 ", totalAmount === null || totalAmount === void 0 ? void 0 : totalAmount.toLocaleString("en-IN")))))));
10139
+ };
10140
+ return /*#__PURE__*/React.createElement("div", {
10141
+ className: "employee-form-section-wrapper"
10142
+ }, /*#__PURE__*/React.createElement(VerticalTimeline, {
10143
+ config: [{
10144
+ timeLine: [{
10145
+ actions: t("WS_CALCULATION"),
10146
+ currentStep: 1
10147
+ }]
10148
+ }],
10149
+ showFinalStep: false
10150
+ }), /*#__PURE__*/React.createElement("div", {
10151
+ style: {
10152
+ flex: 1
10153
+ }
10154
+ }, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
10155
+ title: t("WS_CALCULATION"),
10156
+ defaultOpen: true,
10157
+ style: props.style
10158
+ }, /*#__PURE__*/React.createElement("div", {
10159
+ className: "formcomposer-section-grid"
10160
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_CATEGORY_TYPE") + "*"), /*#__PURE__*/React.createElement("div", {
10161
+ className: "form-field"
10162
+ }, /*#__PURE__*/React.createElement(Controller, {
10163
+ control: control,
10164
+ name: "useDetails.categoryType",
10165
+ rules: {
10166
+ required: t("REQUIRED_FIELD")
10167
+ },
10168
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10169
+ option: categoryTypeList,
10170
+ optionKey: "i18nKey",
10171
+ selected: props.value,
10172
+ select: props.onChange,
10173
+ t: t,
10174
+ onBlur: props.onBlur
10175
+ })
10176
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails = errors.useDetails) === null || _errors$useDetails === void 0 ? void 0 : _errors$useDetails.categoryType) && /*#__PURE__*/React.createElement(CardLabelError, {
10177
+ style: errorStyle
10178
+ }, errors.useDetails.categoryType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_PROPERTY_CATEGORY") + "*"), /*#__PURE__*/React.createElement("div", {
10179
+ className: "form-field"
10180
+ }, /*#__PURE__*/React.createElement(Controller, {
10181
+ control: control,
10182
+ name: "useDetails.propertyCategory",
10183
+ rules: {
10184
+ required: t("REQUIRED_FIELD")
10185
+ },
10186
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10187
+ option: categoryOptions,
10188
+ optionKey: "name",
10189
+ selected: props.value,
10190
+ select: props.onChange,
10191
+ t: t,
10192
+ onBlur: props.onBlur
10193
+ })
10194
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails2 = errors.useDetails) === null || _errors$useDetails2 === void 0 ? void 0 : _errors$useDetails2.propertyCategory) && /*#__PURE__*/React.createElement(CardLabelError, {
10195
+ style: errorStyle
10196
+ }, errors.useDetails.propertyCategory.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_PROPERTY_TYPE") + "*"), /*#__PURE__*/React.createElement("div", {
10197
+ className: "form-field"
10198
+ }, /*#__PURE__*/React.createElement(Controller, {
10199
+ control: control,
10200
+ name: "useDetails.propertyType",
10201
+ rules: {
10202
+ required: t("REQUIRED_FIELD")
10203
+ },
10204
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10205
+ option: propertyTypeOptions,
10206
+ optionKey: "name",
10207
+ selected: props.value,
10208
+ select: props.onChange,
10209
+ t: t,
10210
+ onBlur: props.onBlur
10211
+ })
10212
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails3 = errors.useDetails) === null || _errors$useDetails3 === void 0 ? void 0 : _errors$useDetails3.propertyType) && /*#__PURE__*/React.createElement(CardLabelError, {
10213
+ style: errorStyle
10214
+ }, errors.useDetails.propertyType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_WATER_CONNECTION_USAGE_TYPE") + "*"), /*#__PURE__*/React.createElement("div", {
10215
+ className: "form-field"
10216
+ }, /*#__PURE__*/React.createElement(Controller, {
10217
+ control: control,
10218
+ name: "useDetails.WaterConnectionUsageType",
10219
+ rules: {
10220
+ required: t("REQUIRED_FIELD")
10221
+ },
10222
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10223
+ option: usageTypeOptions,
10224
+ optionKey: "name",
10225
+ selected: props.value,
10226
+ select: props.onChange,
10227
+ t: t,
10228
+ onBlur: props.onBlur
10229
+ })
10230
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails4 = errors.useDetails) === null || _errors$useDetails4 === void 0 ? void 0 : _errors$useDetails4.WaterConnectionUsageType) && /*#__PURE__*/React.createElement(CardLabelError, {
10231
+ style: errorStyle
10232
+ }, errors.useDetails.WaterConnectionUsageType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_COLONY_NAME") + "*"), /*#__PURE__*/React.createElement("div", {
10233
+ className: "form-field"
10234
+ }, /*#__PURE__*/React.createElement(Controller, {
10235
+ control: control,
10236
+ name: "useDetails.colonyName",
10237
+ rules: {
10238
+ required: t("REQUIRED_FIELD")
10239
+ },
10240
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10241
+ option: colonyNameOptions,
10242
+ optionKey: "name",
10243
+ selected: props.value,
10244
+ select: props.onChange,
10245
+ t: t,
10246
+ onBlur: props.onBlur
10247
+ })
10248
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails5 = errors.useDetails) === null || _errors$useDetails5 === void 0 ? void 0 : _errors$useDetails5.colonyName) && /*#__PURE__*/React.createElement(CardLabelError, {
10249
+ style: errorStyle
10250
+ }, errors.useDetails.colonyName.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_PLOT_AREA")), /*#__PURE__*/React.createElement("div", {
10251
+ className: "form-field"
10252
+ }, /*#__PURE__*/React.createElement(TextInput, {
10253
+ t: t,
10254
+ inputRef: register({
10255
+ pattern: {
10256
+ value: DECIMAL_PATTERN,
10257
+ message: t("ERR_INVALID_DECIMAL")
10258
+ }
10259
+ }),
10260
+ name: "useDetails.plotArea"
10261
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails6 = errors.useDetails) === null || _errors$useDetails6 === void 0 ? void 0 : _errors$useDetails6.plotArea) && /*#__PURE__*/React.createElement(CardLabelError, {
10262
+ style: errorStyle
10263
+ }, errors.useDetails.plotArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_BUILT_UP_AREA")), /*#__PURE__*/React.createElement("div", {
10264
+ className: "form-field"
10265
+ }, /*#__PURE__*/React.createElement(TextInput, {
10266
+ t: t,
10267
+ inputRef: register({
10268
+ pattern: {
10269
+ value: DECIMAL_PATTERN,
10270
+ message: t("ERR_INVALID_DECIMAL")
10271
+ }
10272
+ }),
10273
+ name: "useDetails.builtUpArea"
10274
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails7 = errors.useDetails) === null || _errors$useDetails7 === void 0 ? void 0 : _errors$useDetails7.builtUpArea) && /*#__PURE__*/React.createElement(CardLabelError, {
10275
+ style: errorStyle
10276
+ }, errors.useDetails.builtUpArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_FAR_AREA")), /*#__PURE__*/React.createElement("div", {
10277
+ className: "form-field"
10278
+ }, /*#__PURE__*/React.createElement(TextInput, {
10279
+ t: t,
10280
+ inputRef: register({
10281
+ pattern: {
10282
+ value: DECIMAL_PATTERN,
10283
+ message: t("ERR_INVALID_DECIMAL")
10284
+ }
10285
+ }),
10286
+ name: "useDetails.farArea"
10287
+ }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails8 = errors.useDetails) === null || _errors$useDetails8 === void 0 ? void 0 : _errors$useDetails8.farArea) && /*#__PURE__*/React.createElement(CardLabelError, {
10288
+ style: errorStyle
10289
+ }, errors.useDetails.farArea.message), isDwellingUnit ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React.createElement("div", {
10290
+ className: "form-field"
10291
+ }, /*#__PURE__*/React.createElement(TextInput, {
10292
+ t: t,
10293
+ inputRef: register({
10294
+ pattern: {
10295
+ value: NUMBER_PATTERN,
10296
+ message: t("ERR_INVALID_NUMBER")
10297
+ }
10298
+ }),
10299
+ name: "useDetails.NumberofDwellingUnits"
10300
+ }))) : null, isDwellingUnit && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.NumberofDwellingUnits) && /*#__PURE__*/React.createElement(CardLabelError, {
10301
+ style: errorStyle
10302
+ }, errors.useDetails.NumberofDwellingUnits.message), isHotelRestaurantProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NUMBER_OF_ROOMS") + "*"), /*#__PURE__*/React.createElement("div", {
10303
+ className: "form-field"
10304
+ }, /*#__PURE__*/React.createElement(TextInput, {
10305
+ t: t,
10306
+ inputRef: register({
10307
+ pattern: {
10308
+ value: NUMBER_PATTERN,
10309
+ message: t("ERR_INVALID_NUMBER")
10310
+ },
10311
+ required: isHotelRestaurantProperty ? t("REQUIRED_FIELD") : false
10312
+ }),
10313
+ name: "useDetails.NumberofRooms"
10314
+ }))) : null, isHotelRestaurantProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofRooms) && /*#__PURE__*/React.createElement(CardLabelError, {
10315
+ style: errorStyle
10316
+ }, errors.useDetails.NumberofRooms.message), isHospitalProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NUMBER_OF_BEDS") + "*"), /*#__PURE__*/React.createElement("div", {
10317
+ className: "form-field"
10318
+ }, /*#__PURE__*/React.createElement(TextInput, {
10319
+ t: t,
10320
+ inputRef: register({
10321
+ pattern: {
10322
+ value: NUMBER_PATTERN,
10323
+ message: t("ERR_INVALID_NUMBER")
10324
+ },
10325
+ required: isHospitalProperty ? t("REQUIRED_FIELD") : false
10326
+ }),
10327
+ name: "useDetails.numberOfBeds"
10328
+ }))) : null, isHospitalProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails1 = errors.useDetails) === null || _errors$useDetails1 === void 0 ? void 0 : _errors$useDetails1.numberOfBeds) && /*#__PURE__*/React.createElement(CardLabelError, {
10329
+ style: errorStyle
10330
+ }, errors.useDetails.numberOfBeds.message), isSchoolCollegeProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React.createElement("div", {
10331
+ className: "form-field"
10332
+ }, /*#__PURE__*/React.createElement(TextInput, {
10333
+ t: t,
10334
+ inputRef: register({
10335
+ pattern: {
10336
+ value: NUMBER_PATTERN,
10337
+ message: t("ERR_INVALID_NUMBER")
10338
+ }
10339
+ }),
10340
+ name: "useDetails.numberOfStudents"
10341
+ }))) : null, isSchoolCollegeProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails10 = errors.useDetails) === null || _errors$useDetails10 === void 0 ? void 0 : _errors$useDetails10.numberOfStudents) && /*#__PURE__*/React.createElement(CardLabelError, {
10342
+ style: errorStyle
10343
+ }, errors.useDetails.numberOfStudents.message), isServentHouse ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_SERVENT_HOUSE")), /*#__PURE__*/React.createElement("div", {
10344
+ className: "form-field"
10345
+ }, /*#__PURE__*/React.createElement(TextInput, {
10346
+ t: t,
10347
+ inputRef: register({
10348
+ pattern: {
10349
+ value: NUMBER_PATTERN,
10350
+ message: t("ERR_INVALID_NUMBER")
10351
+ }
10352
+ }),
10353
+ name: "useDetails.ServantQuartersRoom"
10354
+ }))) : null, isServentHouse && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails11 = errors.useDetails) === null || _errors$useDetails11 === void 0 ? void 0 : _errors$useDetails11.ServantQuartersRoom) && /*#__PURE__*/React.createElement(CardLabelError, {
10355
+ style: errorStyle
10356
+ }, errors.useDetails.ServantQuartersRoom.message))), /*#__PURE__*/React.createElement("div", {
10357
+ style: {
10358
+ display: "flex",
10359
+ marginTop: "24px",
10360
+ marginBottom: "32px",
10361
+ justifyContent: isMobile ? "center" : "flex-end",
10362
+ alignItems: "center"
10363
+ }
10364
+ }, /*#__PURE__*/React.createElement("button", {
10365
+ type: "button",
10366
+ className: "clear-search generic-button",
10367
+ style: {
10368
+ marginRight: "24px"
10369
+ },
10370
+ onClick: () => {
10371
+ reset();
10372
+ setCalculationData(null);
10373
+ }
10374
+ }, t("CS_COMMON_CLEAR_SEARCH")), /*#__PURE__*/React.createElement(SubmitBar, {
10375
+ label: t("ES_COMMON_CALCULATE"),
10376
+ onSubmit: handleSubmit
10377
+ })), calculationData && /*#__PURE__*/React.createElement(RenderCalculationDetails, {
10378
+ data: calculationData
10379
+ })));
10380
+ };
10381
+
9595
10382
  const BILLSBreadCrumbs = _ref => {
9596
10383
  var _applicationDetails$a, _applicationDetails$a9, _applicationDetails$a0, _applicationDetails$a1, _applicationDetails$a13, _applicationDetails$a14, _reciept_data$Payment2;
9597
10384
  const getRecieptSearch = function (tenantId, payments, consumerCodes, receiptKey) {
@@ -10017,6 +10804,10 @@ const BILLSBreadCrumbs = _ref => {
10017
10804
  path: "/digit-ui/employee/ws/water/bulk-bil",
10018
10805
  label: t("CS_TITLE_BULK_BILL"),
10019
10806
  show: location.pathname.includes("/ws/water/bulk-bill") ? true : false
10807
+ }, {
10808
+ path: "/digit-ui/employee/ws/water/calculation",
10809
+ label: t("WS_CALCULATION"),
10810
+ show: location.pathname.includes("/ws/water/calculation") ? true : false
10020
10811
  }];
10021
10812
  let lastCrumbIndex = findLastIndex(crumbs, "show", true);
10022
10813
  crumbs[lastCrumbIndex] = _extends({}, crumbs[lastCrumbIndex], {
@@ -10274,6 +11065,11 @@ const App$1 = _ref2 => {
10274
11065
  component: props => /*#__PURE__*/React.createElement(WSBulkBillGeneration, _extends({}, props, {
10275
11066
  parentRoute: path
10276
11067
  }))
11068
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
11069
+ path: path + "/water/calculation",
11070
+ component: props => /*#__PURE__*/React.createElement(WSCalculation, _extends({}, props, {
11071
+ parentRoute: path
11072
+ }))
10277
11073
  }))))));
10278
11074
  };
10279
11075
 
@@ -20627,9 +21423,9 @@ const WSDjbEmployee = _ref => {
20627
21423
  return /*#__PURE__*/React.createElement(React.Fragment, null, FormContent);
20628
21424
  };
20629
21425
 
20630
- const _excluded = ["t", "config", "onSelect", "formData", "formState", "setError", "clearErrors"];
20631
- const NUMBER_PATTERN = /^\d+$/;
20632
- const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
21426
+ const _excluded$1 = ["t", "config", "onSelect", "formData", "formState", "setError", "clearErrors"];
21427
+ const NUMBER_PATTERN$1 = /^\d+$/;
21428
+ const DECIMAL_PATTERN$1 = /^\d+(\.\d{1,2})?$/;
20633
21429
  const PropertyWaterConnection = _ref => {
20634
21430
  var _formData$cpt2, _errors$useDetails, _errors$useDetails2, _errors$useDetails3, _errors$useDetails4, _errors$useDetails5, _errors$useDetails6, _errors$useDetails7, _errors$useDetails8, _errors$useDetails9, _errors$useDetails0, _errors$useDetails1, _errors$useDetails10, _errors$useDetails11, _errors$useDetails12;
20635
21431
  let t = _ref.t,
@@ -20638,7 +21434,7 @@ const PropertyWaterConnection = _ref => {
20638
21434
  formData = _ref.formData,
20639
21435
  setError = _ref.setError,
20640
21436
  clearErrors = _ref.clearErrors,
20641
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
21437
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
20642
21438
  const _useForm = useForm({
20643
21439
  defaultValues: (formData === null || formData === void 0 ? void 0 : formData[config.key]) || {
20644
21440
  useDetails: {
@@ -20954,7 +21750,7 @@ const PropertyWaterConnection = _ref => {
20954
21750
  t: t,
20955
21751
  inputRef: register({
20956
21752
  pattern: {
20957
- value: DECIMAL_PATTERN,
21753
+ value: DECIMAL_PATTERN$1,
20958
21754
  message: t("ERR_INVALID_DECIMAL")
20959
21755
  }
20960
21756
  }),
@@ -20968,7 +21764,7 @@ const PropertyWaterConnection = _ref => {
20968
21764
  t: t,
20969
21765
  inputRef: register({
20970
21766
  pattern: {
20971
- value: DECIMAL_PATTERN,
21767
+ value: DECIMAL_PATTERN$1,
20972
21768
  message: t("ERR_INVALID_DECIMAL")
20973
21769
  }
20974
21770
  }),
@@ -20982,7 +21778,7 @@ const PropertyWaterConnection = _ref => {
20982
21778
  t: t,
20983
21779
  inputRef: register({
20984
21780
  pattern: {
20985
- value: DECIMAL_PATTERN,
21781
+ value: DECIMAL_PATTERN$1,
20986
21782
  message: t("ERR_INVALID_DECIMAL")
20987
21783
  }
20988
21784
  }),
@@ -21015,7 +21811,7 @@ const PropertyWaterConnection = _ref => {
21015
21811
  t: t,
21016
21812
  inputRef: register({
21017
21813
  pattern: {
21018
- value: NUMBER_PATTERN,
21814
+ value: NUMBER_PATTERN$1,
21019
21815
  message: t("ERR_INVALID_NUMBER")
21020
21816
  }
21021
21817
  }),
@@ -21029,7 +21825,7 @@ const PropertyWaterConnection = _ref => {
21029
21825
  t: t,
21030
21826
  inputRef: register({
21031
21827
  pattern: {
21032
- value: NUMBER_PATTERN,
21828
+ value: NUMBER_PATTERN$1,
21033
21829
  message: t("ERR_INVALID_NUMBER")
21034
21830
  },
21035
21831
  required: isHotelRestaurantProperty ? t("REQUIRED_FIELD") : false
@@ -21044,7 +21840,7 @@ const PropertyWaterConnection = _ref => {
21044
21840
  t: t,
21045
21841
  inputRef: register({
21046
21842
  pattern: {
21047
- value: NUMBER_PATTERN,
21843
+ value: NUMBER_PATTERN$1,
21048
21844
  message: t("ERR_INVALID_NUMBER")
21049
21845
  },
21050
21846
  required: isHospitalProperty ? t("REQUIRED_FIELD") : false
@@ -21059,7 +21855,7 @@ const PropertyWaterConnection = _ref => {
21059
21855
  t: t,
21060
21856
  inputRef: register({
21061
21857
  pattern: {
21062
- value: NUMBER_PATTERN,
21858
+ value: NUMBER_PATTERN$1,
21063
21859
  message: t("ERR_INVALID_NUMBER")
21064
21860
  }
21065
21861
  }),
@@ -21073,7 +21869,7 @@ const PropertyWaterConnection = _ref => {
21073
21869
  t: t,
21074
21870
  inputRef: register({
21075
21871
  pattern: {
21076
- value: NUMBER_PATTERN,
21872
+ value: NUMBER_PATTERN$1,
21077
21873
  message: t("ERR_INVALID_NUMBER")
21078
21874
  }
21079
21875
  }),
@@ -22045,7 +22841,7 @@ const SearchFields = _ref => {
22045
22841
  }, t("CS_COMMON_CLEAR_SEARCH"))));
22046
22842
  };
22047
22843
 
22048
- const _excluded$1 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
22844
+ const _excluded$2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
22049
22845
  _excluded2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"];
22050
22846
  const MobileSearchApplication = _ref => {
22051
22847
  let Controller = _ref.Controller,
@@ -22092,7 +22888,7 @@ const MobileSearchApplication = _ref => {
22092
22888
  let currentlyActiveMobileModal = _ref2.currentlyActiveMobileModal,
22093
22889
  searchFormFieldsComponentProps = _ref2.searchFormFieldsComponentProps,
22094
22890
  tenantId = _ref2.tenantId,
22095
- props = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
22891
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
22096
22892
  const closeMobilePopupModal = props.closeMobilePopupModal;
22097
22893
  switch (currentlyActiveMobileModal) {
22098
22894
  case "SearchFormComponent":
@@ -22527,7 +23323,7 @@ const SearchFields$1 = _ref => {
22527
23323
  }, t("WS_SEARCH_CONNECTION_RESET_BUTTON"))));
22528
23324
  };
22529
23325
 
22530
- const _excluded$2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
23326
+ const _excluded$3 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
22531
23327
  _excluded2$1 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"];
22532
23328
  const MobileSearchWater = _ref => {
22533
23329
  let Controller = _ref.Controller,
@@ -22572,7 +23368,7 @@ const MobileSearchWater = _ref => {
22572
23368
  let currentlyActiveMobileModal = _ref2.currentlyActiveMobileModal,
22573
23369
  searchFormFieldsComponentProps = _ref2.searchFormFieldsComponentProps,
22574
23370
  tenantId = _ref2.tenantId,
22575
- props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
23371
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$3);
22576
23372
  const closeMobilePopupModal = props.closeMobilePopupModal;
22577
23373
  switch (currentlyActiveMobileModal) {
22578
23374
  case "SearchFormComponent":
@@ -23807,6 +24603,10 @@ const WSCard = () => {
23807
24603
  label: t("WS_WATER_APPLICATION_SEARCH"),
23808
24604
  link: "/digit-ui/employee/ws/water/search-application",
23809
24605
  roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
24606
+ }, {
24607
+ label: t("WS_CALCULATION"),
24608
+ link: "/digit-ui/employee/ws/water/calculation",
24609
+ roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
23810
24610
  }]
23811
24611
  };
23812
24612
  return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
@@ -29002,7 +29802,7 @@ const WSFeeEstimation = _ref => {
29002
29802
  };
29003
29803
 
29004
29804
  const ViewBreakup = _ref => {
29005
- var _breakUpData$calculat, _breakUpData$calculat2, _wsAdditionalDetails$8, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
29805
+ var _breakUpData$calculat, _breakUpData$calculat2, _breakUpData$calculat3, _wsAdditionalDetails$8, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
29006
29806
  let wsAdditionalDetails = _ref.wsAdditionalDetails,
29007
29807
  print = _ref.print,
29008
29808
  download = _ref.download;
@@ -29113,11 +29913,8 @@ const ViewBreakup = _ref => {
29113
29913
  title: t("WS_APPLICATION_FEE_HEADER"),
29114
29914
  values: amountRows([...((breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab = breakUpData.billSlabData) === null || _breakUpData$billSlab === void 0 ? void 0 : _breakUpData$billSlab.FEE) || []), ...((breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab2 = breakUpData.billSlabData) === null || _breakUpData$billSlab2 === void 0 ? void 0 : _breakUpData$billSlab2.CHARGES) || [])])
29115
29915
  }, {
29116
- title: "Taxes",
29117
- values: amountRows(breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : _breakUpData$billSlab3.TAX)
29118
- }, {
29119
- title: "Water demand details",
29120
- values: waterDemandRows.map(_ref4 => {
29916
+ title: "Property details",
29917
+ values: propertyRows.map(_ref4 => {
29121
29918
  let label = _ref4.label,
29122
29919
  value = _ref4.value,
29123
29920
  currency = _ref4.currency,
@@ -29129,8 +29926,11 @@ const ViewBreakup = _ref => {
29129
29926
  };
29130
29927
  })
29131
29928
  }, {
29132
- title: "Infrastructure charge details",
29133
- values: infrastructureChargeRows.map(_ref5 => {
29929
+ title: "Taxes",
29930
+ values: amountRows(breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : _breakUpData$billSlab3.TAX)
29931
+ }, {
29932
+ title: "Water demand details",
29933
+ values: waterDemandRows.map(_ref5 => {
29134
29934
  let label = _ref5.label,
29135
29935
  value = _ref5.value,
29136
29936
  currency = _ref5.currency,
@@ -29141,6 +29941,19 @@ const ViewBreakup = _ref => {
29141
29941
  value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29142
29942
  };
29143
29943
  })
29944
+ }, {
29945
+ title: "Infrastructure charge details",
29946
+ values: infrastructureChargeRows.map(_ref6 => {
29947
+ let label = _ref6.label,
29948
+ value = _ref6.value,
29949
+ currency = _ref6.currency,
29950
+ unit = _ref6.unit,
29951
+ isText = _ref6.isText;
29952
+ return {
29953
+ title: label,
29954
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29955
+ };
29956
+ })
29144
29957
  }, {
29145
29958
  title: "Total",
29146
29959
  values: [{
@@ -29182,8 +29995,58 @@ const ViewBreakup = _ref => {
29182
29995
  printWindow.focus();
29183
29996
  printWindow.print();
29184
29997
  };
29185
- const waterDemandDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat = breakUpData.calculationDetail) === null || _breakUpData$calculat === void 0 ? void 0 : _breakUpData$calculat.waterDemandDetail;
29186
- const infrastructureChargeDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat2 = breakUpData.calculationDetail) === null || _breakUpData$calculat2 === void 0 ? void 0 : _breakUpData$calculat2.infrastructureChargeDetail;
29998
+ const propertyDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat = breakUpData.calculationDetail) === null || _breakUpData$calculat === void 0 ? void 0 : _breakUpData$calculat.propertyDetail;
29999
+ const waterDemandDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat2 = breakUpData.calculationDetail) === null || _breakUpData$calculat2 === void 0 ? void 0 : _breakUpData$calculat2.waterDemandDetail;
30000
+ const infrastructureChargeDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat3 = breakUpData.calculationDetail) === null || _breakUpData$calculat3 === void 0 ? void 0 : _breakUpData$calculat3.infrastructureChargeDetail;
30001
+ const propertyRows = propertyDetail ? [{
30002
+ label: "Property ID",
30003
+ value: propertyDetail.propertyId,
30004
+ isText: true
30005
+ }, {
30006
+ label: "Property type",
30007
+ value: propertyDetail.propertyType,
30008
+ isText: true
30009
+ }, {
30010
+ label: "Plot area",
30011
+ value: propertyDetail.landArea,
30012
+ unit: " (sq. meter.)"
30013
+ }, {
30014
+ label: "Built-up area",
30015
+ value: propertyDetail.superBuiltUpArea,
30016
+ unit: " (sq. meter.)"
30017
+ }, {
30018
+ label: "farArea",
30019
+ value: propertyDetail.farArea,
30020
+ isText: true
30021
+ }, {
30022
+ label: "coveredArea",
30023
+ value: propertyDetail.coveredArea,
30024
+ isText: true
30025
+ }, {
30026
+ label: "numberOfDwellingUnits",
30027
+ value: propertyDetail.numberOfDwellingUnits,
30028
+ isText: true
30029
+ }, {
30030
+ label: "numberOfBeds",
30031
+ value: propertyDetail.numberOfBeds,
30032
+ isText: true
30033
+ }, {
30034
+ label: "numberOfRooms",
30035
+ value: propertyDetail.numberOfRooms,
30036
+ isText: true
30037
+ }, {
30038
+ label: "numberOfStudents",
30039
+ value: propertyDetail.numberOfStudents,
30040
+ isText: true
30041
+ }, {
30042
+ label: "numberOfStaff",
30043
+ value: propertyDetail.numberOfStaff,
30044
+ isText: true
30045
+ }, {
30046
+ label: "Usage category",
30047
+ value: propertyDetail.usageCategory,
30048
+ isText: true
30049
+ }] : [];
29187
30050
  const waterDemandRows = waterDemandDetail ? [{
29188
30051
  label: "Calculated occupancy",
29189
30052
  value: waterDemandDetail.calculatedOccupancy,
@@ -29325,6 +30188,12 @@ const ViewBreakup = _ref => {
29325
30188
  textStyle: {
29326
30189
  textAlign: "right"
29327
30190
  }
30191
+ })), propertyRows.length > 0 && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
30192
+ style: {
30193
+ margin: "10px 0px"
30194
+ }
30195
+ }, "Property details"), /*#__PURE__*/React.createElement(DetailRows, {
30196
+ rows: propertyRows
29328
30197
  })), waterDemandRows.length > 0 && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
29329
30198
  style: {
29330
30199
  margin: "10px 0px"
@@ -34054,7 +34923,7 @@ const WSPropertyLocationDetails = props => {
34054
34923
  return /*#__PURE__*/React.createElement(PropertyLocationDetails, props);
34055
34924
  };
34056
34925
 
34057
- const _excluded$3 = ["errors"],
34926
+ const _excluded$4 = ["errors"],
34058
34927
  _excluded2$2 = ["register", "control", "watch", "setValue", "unregister", "handleSubmit", "formState", "getValues", "reset"];
34059
34928
  const ApplicationBillAmendment = () => {
34060
34929
  var _data$BillingService, _data$BillingService$, _data$BillingService2, _data$BillingService3, _state, _state$data, _state$data$applicati, _state$data$applicati2, _state$data$applicati3, _billSearchData, _billSearchData$filte, _billSearchData2, _state9, _state9$data, _errors$WS_REDUCED_AM, _errors$WS_ADDITIONAL, _billSearchData3, _errors$effectiveTill, _errors$effectiveTill2, _state12, _state12$data;
@@ -34111,7 +34980,7 @@ const ApplicationBillAmendment = () => {
34111
34980
  handleSubmit = _useForm.handleSubmit,
34112
34981
  _useForm$formState = _useForm.formState,
34113
34982
  errors = _useForm$formState.errors,
34114
- rest = _objectWithoutPropertiesLoose(_useForm$formState, _excluded$3),
34983
+ rest = _objectWithoutPropertiesLoose(_useForm$formState, _excluded$4),
34115
34984
  getValues = _useForm.getValues,
34116
34985
  methods = _objectWithoutPropertiesLoose(_useForm, _excluded2$2);
34117
34986
  const _Digit$Hooks$ws$useAp = Digit.Hooks.ws.useApplicationActionsBillAmendUpdate(),
@@ -34976,8 +35845,8 @@ const DECLARATION_POINTS = ["I understand that sanction of connection does not a
34976
35845
  const NAME_PATTERN = /^[a-zA-Z\s.'-]{1,50}$/;
34977
35846
  const EMAIL_PATTERN = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/;
34978
35847
  const MOBILE_PATTERN = /^[6-9][0-9]{9}$/;
34979
- const NUMBER_PATTERN$1 = /^\d+$/;
34980
- const DECIMAL_PATTERN$1 = /^\d+(\.\d{1,2})?$/;
35848
+ const NUMBER_PATTERN$2 = /^\d+$/;
35849
+ const DECIMAL_PATTERN$2 = /^\d+(\.\d{1,2})?$/;
34981
35850
  const IFSC_PATTERN = /^[A-Z]{4}0[A-Z0-9]{6}$/;
34982
35851
  const ACCOUNT_PATTERN = /^[0-9]{9,18}$/;
34983
35852
  const COLLAPSIBLE_CONTENT_TAB = "__WS_SECTION_CONTENT__";
@@ -37246,7 +38115,7 @@ const NewApplication = () => {
37246
38115
  errorStyle: !!getFieldError("useDetails.plotArea"),
37247
38116
  inputRef: register({
37248
38117
  pattern: {
37249
- value: DECIMAL_PATTERN$1,
38118
+ value: DECIMAL_PATTERN$2,
37250
38119
  message: "Enter a valid numeric value."
37251
38120
  },
37252
38121
  required: "Plot Area is required."
@@ -37260,7 +38129,7 @@ const NewApplication = () => {
37260
38129
  errorStyle: !!getFieldError("useDetails.builtUpArea"),
37261
38130
  inputRef: register({
37262
38131
  pattern: {
37263
- value: DECIMAL_PATTERN$1,
38132
+ value: DECIMAL_PATTERN$2,
37264
38133
  message: "Enter a valid numeric value."
37265
38134
  },
37266
38135
  required: "Built Up Area is required."
@@ -37291,7 +38160,7 @@ const NewApplication = () => {
37291
38160
  errorStyle: !!getFieldError("useDetails.NumberofDwellingUnits"),
37292
38161
  inputRef: register({
37293
38162
  pattern: {
37294
- value: DECIMAL_PATTERN$1,
38163
+ value: DECIMAL_PATTERN$2,
37295
38164
  message: "Enter a valid numeric value."
37296
38165
  },
37297
38166
  required: "Built Up Area is required."
@@ -37305,7 +38174,7 @@ const NewApplication = () => {
37305
38174
  errorStyle: !!getFieldError("useDetails.NumberofRooms"),
37306
38175
  inputRef: register({
37307
38176
  pattern: {
37308
- value: DECIMAL_PATTERN$1,
38177
+ value: DECIMAL_PATTERN$2,
37309
38178
  message: "Enter a valid numeric value."
37310
38179
  },
37311
38180
  required: "Built Up Area is required."
@@ -37319,7 +38188,7 @@ const NewApplication = () => {
37319
38188
  errorStyle: !!getFieldError("useDetails.hospitalBeds"),
37320
38189
  inputRef: register({
37321
38190
  pattern: {
37322
- value: NUMBER_PATTERN$1,
38191
+ value: NUMBER_PATTERN$2,
37323
38192
  message: "Enter a valid whole number."
37324
38193
  },
37325
38194
  required: isHospitalProperty ? "No. of Beds is required for Hospital / Nursing Home." : false