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

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,722 @@ 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
+ const tenantId = Digit.ULBService.getCurrentTenantId();
9678
+ const _useTranslation = useTranslation(),
9679
+ t = _useTranslation.t;
9680
+ const _Digit$Hooks$ws$useWS = Digit.Hooks.ws.useWSCalculater({
9681
+ tenantId
9682
+ }),
9683
+ calculateCharges = _Digit$Hooks$ws$useWS.mutate;
9684
+ const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["PropertyCategory", "PropertyType", "PropertyNewUsageType"]),
9685
+ ptServicesMastersData = _Digit$Hooks$pt$usePr.data;
9686
+ const _Digit$Hooks$ws$useMD = Digit.Hooks.ws.useMDMS(tenantId, "ws-services-masters", ["WsCategoryType"]),
9687
+ wsServicesMastersData = _Digit$Hooks$ws$useMD.data;
9688
+ const _useState = useState([]),
9689
+ categoryTypeList = _useState[0],
9690
+ setCategoryTypeList = _useState[1];
9691
+ const _useState2 = useState(null),
9692
+ calculationData = _useState2[0],
9693
+ setCalculationData = _useState2[1];
9694
+ useEffect(() => {
9695
+ var _wsServicesMastersDat;
9696
+ const categories = (wsServicesMastersData === null || wsServicesMastersData === void 0 ? void 0 : (_wsServicesMastersDat = wsServicesMastersData["ws-services-masters"]) === null || _wsServicesMastersDat === void 0 ? void 0 : _wsServicesMastersDat.WsCategoryType) || [];
9697
+ categories.forEach(data => data.i18nKey = data.i18nKey || "WS_CATEGORY_" + data.code);
9698
+ setCategoryTypeList(categories);
9699
+ }, [wsServicesMastersData]);
9700
+ useEffect(() => {
9701
+ if (props.register) {
9702
+ props.register({
9703
+ name: "cpt"
9704
+ });
9705
+ }
9706
+ }, [props.register]);
9707
+ const formValue = watch();
9708
+ const watchCategoryType = watch("useDetails.categoryType");
9709
+ const watchPropertyType = watch("useDetails.propertyType");
9710
+ const watchPropertyCategory = watch("useDetails.propertyCategory");
9711
+ const watchWaterConnectionUsageType = watch("useDetails.WaterConnectionUsageType");
9712
+ const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
9713
+ const isHotelRestaurantProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOTEL_OR_RESTAURANT" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HotelOrRestaurant";
9714
+ const isSchoolCollegeProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "School" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "College";
9715
+ const isDwellingUnit = (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL" || (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL";
9716
+ 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";
9717
+ const categoryOptions = useMemo(() => {
9718
+ var _ptServicesMastersDat, _ptServicesMastersDat2;
9719
+ 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)) || [];
9720
+ if (watchCategoryType !== null && watchCategoryType !== void 0 && watchCategoryType.code) {
9721
+ options = options.filter(item => item.type === watchCategoryType.code);
9722
+ }
9723
+ return options.map(item => ({
9724
+ code: item.code,
9725
+ name: item.name
9726
+ }));
9727
+ }, [ptServicesMastersData, watchCategoryType]);
9728
+ useEffect(() => {
9729
+ if (watchCategoryType && watchPropertyCategory) {
9730
+ const isCategoryValid = categoryOptions.some(opt => opt.code === watchPropertyCategory.code);
9731
+ if (!isCategoryValid) {
9732
+ setValue("useDetails.propertyCategory", null);
9733
+ }
9734
+ }
9735
+ }, [watchCategoryType, categoryOptions, setValue, watchPropertyCategory]);
9736
+ const propertyTypeOptions = useMemo(() => {
9737
+ var _ptServicesMastersDat3, _ptServicesMastersDat4;
9738
+ 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)) || [];
9739
+ if (watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code) {
9740
+ var _watchPropertyCategor;
9741
+ if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor = watchPropertyCategory.code) === null || _watchPropertyCategor === void 0 ? void 0 : _watchPropertyCategor.toUpperCase()) !== "MIXED") {
9742
+ options = options.filter(item => {
9743
+ var _item$type, _watchPropertyCategor2;
9744
+ 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());
9745
+ });
9746
+ }
9747
+ }
9748
+ return options.map(item => ({
9749
+ code: item.code,
9750
+ name: item.name
9751
+ }));
9752
+ }, [ptServicesMastersData, watchPropertyCategory]);
9753
+ useEffect(() => {
9754
+ if (watchPropertyCategory && watchPropertyType) {
9755
+ const isTypeValid = propertyTypeOptions.some(opt => opt.code === watchPropertyType.code);
9756
+ if (!isTypeValid) {
9757
+ setValue("useDetails.propertyType", null);
9758
+ }
9759
+ }
9760
+ }, [watchPropertyCategory, propertyTypeOptions, setValue, watchPropertyType]);
9761
+ const usageTypeOptions = useMemo(() => {
9762
+ var _ptServicesMastersDat5, _ptServicesMastersDat6;
9763
+ 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)) || [];
9764
+ if (watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code) {
9765
+ var _watchPropertyCategor3;
9766
+ if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor3 = watchPropertyCategory.code) === null || _watchPropertyCategor3 === void 0 ? void 0 : _watchPropertyCategor3.toUpperCase()) !== "MIXED") {
9767
+ options = options.filter(item => {
9768
+ var _item$type2, _watchPropertyCategor4;
9769
+ 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());
9770
+ });
9771
+ }
9772
+ }
9773
+ return options.map(item => ({
9774
+ code: item.code,
9775
+ name: item.name
9776
+ }));
9777
+ }, [ptServicesMastersData, watchPropertyCategory]);
9778
+ useEffect(() => {
9779
+ if (watchPropertyType && watchWaterConnectionUsageType) {
9780
+ const isUsageTypeValid = usageTypeOptions.some(opt => opt.code === watchWaterConnectionUsageType.code);
9781
+ if (!isUsageTypeValid) {
9782
+ setValue("useDetails.WaterConnectionUsageType", null);
9783
+ }
9784
+ }
9785
+ }, [watchPropertyType, usageTypeOptions, setValue, watchWaterConnectionUsageType]);
9786
+ const lastSentValue = React.useRef(null);
9787
+ useEffect(() => {
9788
+ if (!lodash.isEqual(lastSentValue.current, formValue)) {
9789
+ lastSentValue.current = lodash.cloneDeep(formValue);
9790
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(config === null || config === void 0 ? void 0 : config.key, formValue);
9791
+ }
9792
+ }, [formValue, config === null || config === void 0 ? void 0 : config.key, onSelect]);
9793
+ useEffect(() => {
9794
+ var _formData$cpt;
9795
+ if (formData !== null && formData !== void 0 && (_formData$cpt = formData.cpt) !== null && _formData$cpt !== void 0 && _formData$cpt.details) {
9796
+ var _details$usageCategor, _details$landArea, _details$superBuiltUp;
9797
+ const details = formData.cpt.details;
9798
+ const additionalDetails = (details === null || details === void 0 ? void 0 : details.additionalDetails) || {};
9799
+ const catType = additionalDetails.categoryType || ((_details$usageCategor = details.usageCategory) !== null && _details$usageCategor !== void 0 && _details$usageCategor.includes("RESIDENTIAL") ? "DOMESTIC" : "NON_DOMESTIC");
9800
+ setValue("useDetails.categoryType", (categoryTypeList === null || categoryTypeList === void 0 ? void 0 : categoryTypeList.find(o => o.code === catType)) || null);
9801
+ setValue("useDetails.propertyCategory", (categoryOptions === null || categoryOptions === void 0 ? void 0 : categoryOptions.find(o => o.code === (additionalDetails.propertyCategory || details.usageCategory))) || null);
9802
+ setValue("useDetails.propertyType", (propertyTypeOptions === null || propertyTypeOptions === void 0 ? void 0 : propertyTypeOptions.find(o => o.code === (additionalDetails.propertyType || details.propertyType))) || null);
9803
+ setValue("useDetails.WaterConnectionUsageType", (usageTypeOptions === null || usageTypeOptions === void 0 ? void 0 : usageTypeOptions.find(o => o.code === additionalDetails.waterConnectionUsageType)) || null);
9804
+ 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()) || "");
9805
+ 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()) || "");
9806
+ setValue("useDetails.NumberofDwellingUnits", additionalDetails.numberOfDwellingUnits || additionalDetails.noOfDwellingUnits || (details === null || details === void 0 ? void 0 : details.noOfDwellingUnits) || "");
9807
+ setValue("useDetails.NumberofRooms", additionalDetails.numberOfRooms || additionalDetails.noOfRooms || (details === null || details === void 0 ? void 0 : details.noOfRooms) || "");
9808
+ setValue("useDetails.colonyName", additionalDetails.colonyName || "");
9809
+ } else if ((formData === null || formData === void 0 ? void 0 : formData.cpt) === null) {
9810
+ setValue("useDetails.categoryType", null);
9811
+ setValue("useDetails.propertyCategory", null);
9812
+ setValue("useDetails.propertyType", null);
9813
+ setValue("useDetails.WaterConnectionUsageType", null);
9814
+ setValue("useDetails.plotArea", "");
9815
+ setValue("useDetails.builtUpArea", "");
9816
+ setValue("useDetails.farArea", "");
9817
+ setValue("useDetails.NumberofDwellingUnits", "");
9818
+ setValue("useDetails.NumberofRooms", "");
9819
+ setValue("useDetails.numberOfBeds", "");
9820
+ setValue("useDetails.numberOfStudents", "");
9821
+ setValue("useDetails.ServantQuartersRoom", "");
9822
+ setValue("useDetails.colonyName", "");
9823
+ }
9824
+ }, [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]);
9825
+ const lastErrorState = React.useRef(null);
9826
+ useEffect(() => {
9827
+ const hasErrors = Object.keys(errors).length > 0;
9828
+ if (lastErrorState.current !== hasErrors) {
9829
+ lastErrorState.current = hasErrors;
9830
+ if (hasErrors) {
9831
+ if (setError) setError(config === null || config === void 0 ? void 0 : config.key, {
9832
+ type: "custom",
9833
+ message: "Validation failed"
9834
+ });
9835
+ } else {
9836
+ if (clearErrors) clearErrors(config === null || config === void 0 ? void 0 : config.key);
9837
+ }
9838
+ }
9839
+ }, [errors, config === null || config === void 0 ? void 0 : config.key, setError, clearErrors]);
9840
+ const errorStyle = {
9841
+ width: "70%",
9842
+ marginLeft: "30%",
9843
+ fontSize: "12px",
9844
+ marginTop: "-21px"
9845
+ };
9846
+ const isMobile = window.Digit.Utils.browser.isMobile();
9847
+ const handleSubmit = () => {
9848
+ const payload = WSCalculationPayload(formValue);
9849
+ calculateCharges(payload, {
9850
+ onSuccess: data => {
9851
+ setCalculationData(data);
9852
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(config === null || config === void 0 ? void 0 : config.key, _extends({}, formValue, {
9853
+ payload,
9854
+ calculationResponse: data
9855
+ }));
9856
+ },
9857
+ onError: error => {
9858
+ var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
9859
+ if (setError) setError(config === null || config === void 0 ? void 0 : config.key, {
9860
+ type: "custom",
9861
+ 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")
9862
+ });
9863
+ }
9864
+ });
9865
+ };
9866
+ const RenderCalculationDetails = _ref2 => {
9867
+ var _data$Calculation, _calc$calculationDeta, _calc$calculationDeta2, _calc$calculationDeta3, _waterDemandDetail$co, _infraDetail$waterCom, _infraDetail$sewerCom, _infraDetail$grossIFC, _infraDetail$rebateAm, _infraDetail$netIFC;
9868
+ let data = _ref2.data;
9869
+ if (!data) return null;
9870
+ const calc = (_data$Calculation = data.Calculation) === null || _data$Calculation === void 0 ? void 0 : _data$Calculation[0];
9871
+ if (!calc) return null;
9872
+ const propertyDetail = ((_calc$calculationDeta = calc.calculationDetail) === null || _calc$calculationDeta === void 0 ? void 0 : _calc$calculationDeta.propertyDetail) || {};
9873
+ const waterDemandDetail = ((_calc$calculationDeta2 = calc.calculationDetail) === null || _calc$calculationDeta2 === void 0 ? void 0 : _calc$calculationDeta2.waterDemandDetail) || {};
9874
+ const infraDetail = ((_calc$calculationDeta3 = calc.calculationDetail) === null || _calc$calculationDeta3 === void 0 ? void 0 : _calc$calculationDeta3.infrastructureChargeDetail) || {};
9875
+ const taxHeadEstimates = calc.taxHeadEstimates || [];
9876
+ const totalAmount = calc.totalAmount;
9877
+ return /*#__PURE__*/React.createElement("div", {
9878
+ className: "ws-calc-details-wrapper"
9879
+ }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("div", {
9880
+ className: "ws-calc-detail-card"
9881
+ }, /*#__PURE__*/React.createElement("div", {
9882
+ className: "ws-calc-detail-card-header"
9883
+ }, /*#__PURE__*/React.createElement("span", {
9884
+ className: "ws-calc-detail-card-badge"
9885
+ }, "1"), /*#__PURE__*/React.createElement("h3", {
9886
+ className: "ws-calc-detail-card-title"
9887
+ }, t("WS_PROPERTY_DETAILS"))), /*#__PURE__*/React.createElement("div", {
9888
+ className: "ws-calc-property-box"
9889
+ }, /*#__PURE__*/React.createElement("div", {
9890
+ className: "ws-calc-grid-3"
9891
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9892
+ className: "ws-calc-label"
9893
+ }, t("WS_PROPERTY_TYPE")), /*#__PURE__*/React.createElement("div", {
9894
+ className: "ws-calc-value"
9895
+ }, propertyDetail.propertyType || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9896
+ className: "ws-calc-label"
9897
+ }, t("WS_PROPERTY_CATEGORY")), /*#__PURE__*/React.createElement("div", {
9898
+ className: "ws-calc-value"
9899
+ }, propertyDetail.usageCategory || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9900
+ className: "ws-calc-label"
9901
+ }, t("WS_WATER_CONNECTION_USAGE_TYPE")), /*#__PURE__*/React.createElement("div", {
9902
+ className: "ws-calc-value"
9903
+ }, propertyDetail.usageCategory || "-")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9904
+ className: "ws-calc-label"
9905
+ }, t("WS_COLONY_CATEGORY")), /*#__PURE__*/React.createElement("div", {
9906
+ className: "ws-calc-pill"
9907
+ }, propertyDetail.colonyCategory || "-"))), /*#__PURE__*/React.createElement("hr", {
9908
+ className: "ws-calc-hr"
9909
+ }), /*#__PURE__*/React.createElement("div", {
9910
+ className: "ws-calc-grid-4"
9911
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9912
+ className: "ws-calc-label"
9913
+ }, t("WS_LAND_AREA")), /*#__PURE__*/React.createElement("div", {
9914
+ className: "ws-calc-value"
9915
+ }, propertyDetail.landArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9916
+ className: "ws-calc-label"
9917
+ }, t("WS_FAR_AREA")), /*#__PURE__*/React.createElement("div", {
9918
+ className: "ws-calc-value"
9919
+ }, propertyDetail.farArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
9920
+ className: "ws-calc-label"
9921
+ }, t("WS_BUILT_UP_AREA")), /*#__PURE__*/React.createElement("div", {
9922
+ className: "ws-calc-value"
9923
+ }, ((_waterDemandDetail$co = waterDemandDetail.contextVariables) === null || _waterDemandDetail$co === void 0 ? void 0 : _waterDemandDetail$co.built_up_area) || 0, " sq. m."))))), /*#__PURE__*/React.createElement("div", {
9924
+ className: "ws-calc-detail-card"
9925
+ }, /*#__PURE__*/React.createElement("div", {
9926
+ className: "ws-calc-detail-card-header"
9927
+ }, /*#__PURE__*/React.createElement("span", {
9928
+ className: "ws-calc-detail-card-badge"
9929
+ }, "2"), /*#__PURE__*/React.createElement("h3", {
9930
+ className: "ws-calc-detail-card-title"
9931
+ }, t("WS_WATER_DEMAND_DETAILS"))), /*#__PURE__*/React.createElement("div", {
9932
+ className: "ws-calc-split-card"
9933
+ }, /*#__PURE__*/React.createElement("div", {
9934
+ className: "ws-calc-split-left"
9935
+ }, /*#__PURE__*/React.createElement("div", {
9936
+ className: "ws-calc-row"
9937
+ }, /*#__PURE__*/React.createElement("span", {
9938
+ className: "ws-calc-row-label"
9939
+ }, t("WS_MATCHED_NORM_CODE")), /*#__PURE__*/React.createElement("span", {
9940
+ className: "ws-calc-row-value"
9941
+ }, waterDemandDetail.matchedNormCode || "-")), /*#__PURE__*/React.createElement("div", {
9942
+ className: "ws-calc-row"
9943
+ }, /*#__PURE__*/React.createElement("span", {
9944
+ className: "ws-calc-row-label"
9945
+ }, t("WS_MATCHED_NORM_NAME")), /*#__PURE__*/React.createElement("span", {
9946
+ className: "ws-calc-row-value-right"
9947
+ }, waterDemandDetail.matchedNormName || "-")), /*#__PURE__*/React.createElement("div", {
9948
+ className: "ws-calc-row"
9949
+ }, /*#__PURE__*/React.createElement("span", {
9950
+ className: "ws-calc-row-label"
9951
+ }, t("WS_FORMULA_USED")), /*#__PURE__*/React.createElement("span", {
9952
+ className: "ws-calc-row-value"
9953
+ }, waterDemandDetail.formulaUsed || "-")), /*#__PURE__*/React.createElement("div", {
9954
+ className: "ws-calc-row"
9955
+ }, /*#__PURE__*/React.createElement("span", {
9956
+ className: "ws-calc-row-label"
9957
+ }, t("WS_CALCULATED_OCCUPANCY")), /*#__PURE__*/React.createElement("span", {
9958
+ className: "ws-calc-row-value"
9959
+ }, waterDemandDetail.calculatedOccupancy || 0, " Persons")), /*#__PURE__*/React.createElement("div", {
9960
+ className: "ws-calc-row-last"
9961
+ }, /*#__PURE__*/React.createElement("span", {
9962
+ className: "ws-calc-row-label"
9963
+ }, t("WS_LPCD_SELECTED")), /*#__PURE__*/React.createElement("span", {
9964
+ className: "ws-calc-row-value"
9965
+ }, waterDemandDetail.chosenLpcd || 0, " LPD"))), /*#__PURE__*/React.createElement("div", {
9966
+ className: "ws-calc-split-right"
9967
+ }, /*#__PURE__*/React.createElement("div", {
9968
+ className: "ws-calc-row"
9969
+ }, /*#__PURE__*/React.createElement("span", {
9970
+ className: "ws-calc-row-label"
9971
+ }, t("WS_BASE_DEMAND")), /*#__PURE__*/React.createElement("span", {
9972
+ className: "ws-calc-row-value"
9973
+ }, waterDemandDetail.baseDemand || 0, " L/day")), /*#__PURE__*/React.createElement("div", {
9974
+ className: "ws-calc-row",
9975
+ style: {
9976
+ marginBottom: "24px"
9977
+ }
9978
+ }, /*#__PURE__*/React.createElement("span", {
9979
+ className: "ws-calc-row-label"
9980
+ }, t("WS_CONTINGENCY")), /*#__PURE__*/React.createElement("span", {
9981
+ className: "ws-calc-row-value"
9982
+ }, waterDemandDetail.contingencyPercentage || 0, "%")), /*#__PURE__*/React.createElement("div", {
9983
+ className: "ws-calc-highlight-blue"
9984
+ }, /*#__PURE__*/React.createElement("span", {
9985
+ className: "ws-calc-highlight-blue-label"
9986
+ }, t("WS_TOTAL_WATER_DEMAND")), /*#__PURE__*/React.createElement("span", {
9987
+ className: "ws-calc-highlight-blue-value"
9988
+ }, waterDemandDetail.totalWaterDemandLPD || 0, " L/day"))))), /*#__PURE__*/React.createElement("div", {
9989
+ className: "ws-calc-detail-card"
9990
+ }, /*#__PURE__*/React.createElement("div", {
9991
+ className: "ws-calc-detail-card-header"
9992
+ }, /*#__PURE__*/React.createElement("span", {
9993
+ className: "ws-calc-detail-card-badge"
9994
+ }, "3"), /*#__PURE__*/React.createElement("h3", {
9995
+ className: "ws-calc-detail-card-title"
9996
+ }, t("WS_INFRASTRUCTURE_CHARGE_DETAILS"))), /*#__PURE__*/React.createElement("div", {
9997
+ className: "ws-calc-split-card"
9998
+ }, /*#__PURE__*/React.createElement("div", {
9999
+ className: "ws-calc-split-left"
10000
+ }, /*#__PURE__*/React.createElement("div", {
10001
+ className: "ws-calc-row"
10002
+ }, /*#__PURE__*/React.createElement("span", {
10003
+ className: "ws-calc-row-label"
10004
+ }, t("WS_COLONY_CATEGORY")), /*#__PURE__*/React.createElement("span", {
10005
+ className: "ws-calc-row-value"
10006
+ }, infraDetail.colonyCategory || "-")), /*#__PURE__*/React.createElement("div", {
10007
+ className: "ws-calc-row"
10008
+ }, /*#__PURE__*/React.createElement("span", {
10009
+ className: "ws-calc-row-label"
10010
+ }, t("WS_PLOT_AREA")), /*#__PURE__*/React.createElement("span", {
10011
+ className: "ws-calc-row-value"
10012
+ }, infraDetail.plotArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", {
10013
+ className: "ws-calc-row"
10014
+ }, /*#__PURE__*/React.createElement("span", {
10015
+ className: "ws-calc-row-label"
10016
+ }, t("WS_MINIMUM_PLOT_AREA")), /*#__PURE__*/React.createElement("span", {
10017
+ className: "ws-calc-row-value"
10018
+ }, infraDetail.minimumPlotArea || 0, " sq. m.")), /*#__PURE__*/React.createElement("div", {
10019
+ className: "ws-calc-row"
10020
+ }, /*#__PURE__*/React.createElement("span", {
10021
+ className: "ws-calc-row-label"
10022
+ }, t("WS_WATER_RATE")), /*#__PURE__*/React.createElement("span", {
10023
+ className: "ws-calc-row-value"
10024
+ }, "\u20B9 ", infraDetail.waterRatePerLPD || 0, " / LPD")), /*#__PURE__*/React.createElement("div", {
10025
+ className: "ws-calc-row-last"
10026
+ }, /*#__PURE__*/React.createElement("span", {
10027
+ className: "ws-calc-row-label"
10028
+ }, t("WS_SEWER_RATE")), /*#__PURE__*/React.createElement("span", {
10029
+ className: "ws-calc-row-value"
10030
+ }, "\u20B9 ", infraDetail.sewerRatePerLPD || 0, " / LPD"))), /*#__PURE__*/React.createElement("div", {
10031
+ className: "ws-calc-split-right"
10032
+ }, /*#__PURE__*/React.createElement("div", {
10033
+ className: "ws-calc-row"
10034
+ }, /*#__PURE__*/React.createElement("span", {
10035
+ className: "ws-calc-row-label"
10036
+ }, t("WS_WATER_COMPONENT_IFC")), /*#__PURE__*/React.createElement("span", {
10037
+ className: "ws-calc-row-value"
10038
+ }, "\u20B9 ", ((_infraDetail$waterCom = infraDetail.waterComponentIFC) === null || _infraDetail$waterCom === void 0 ? void 0 : _infraDetail$waterCom.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10039
+ className: "ws-calc-row"
10040
+ }, /*#__PURE__*/React.createElement("span", {
10041
+ className: "ws-calc-row-label"
10042
+ }, t("WS_SEWER_COMPONENT_IFC")), /*#__PURE__*/React.createElement("span", {
10043
+ className: "ws-calc-row-value"
10044
+ }, "\u20B9 ", ((_infraDetail$sewerCom = infraDetail.sewerComponentIFC) === null || _infraDetail$sewerCom === void 0 ? void 0 : _infraDetail$sewerCom.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10045
+ className: "ws-calc-row"
10046
+ }, /*#__PURE__*/React.createElement("span", {
10047
+ className: "ws-calc-row-label"
10048
+ }, t("WS_GROSS_IFC")), /*#__PURE__*/React.createElement("span", {
10049
+ className: "ws-calc-row-value"
10050
+ }, "\u20B9 ", ((_infraDetail$grossIFC = infraDetail.grossIFC) === null || _infraDetail$grossIFC === void 0 ? void 0 : _infraDetail$grossIFC.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10051
+ className: "ws-calc-row"
10052
+ }, /*#__PURE__*/React.createElement("span", {
10053
+ className: "ws-calc-row-label"
10054
+ }, t("WS_REBATE"), " (", infraDetail.rebatePercentage || 0, "%)"), /*#__PURE__*/React.createElement("span", {
10055
+ className: "ws-calc-row-value-red"
10056
+ }, "- \u20B9 ", ((_infraDetail$rebateAm = infraDetail.rebateAmount) === null || _infraDetail$rebateAm === void 0 ? void 0 : _infraDetail$rebateAm.toLocaleString("en-IN")) || 0)), /*#__PURE__*/React.createElement("div", {
10057
+ className: "ws-calc-highlight-green"
10058
+ }, /*#__PURE__*/React.createElement("span", {
10059
+ className: "ws-calc-highlight-green-label"
10060
+ }, t("WS_NET_INFRASTRUCTURE_CHARGE")), /*#__PURE__*/React.createElement("span", {
10061
+ className: "ws-calc-highlight-green-value"
10062
+ }, "\u20B9 ", ((_infraDetail$netIFC = infraDetail.netIFC) === null || _infraDetail$netIFC === void 0 ? void 0 : _infraDetail$netIFC.toLocaleString("en-IN")) || 0))))), /*#__PURE__*/React.createElement("div", {
10063
+ className: "ws-calc-detail-card",
10064
+ style: {
10065
+ marginBottom: "0"
10066
+ }
10067
+ }, /*#__PURE__*/React.createElement("div", {
10068
+ className: "ws-calc-detail-card-header"
10069
+ }, /*#__PURE__*/React.createElement("span", {
10070
+ className: "ws-calc-detail-card-badge"
10071
+ }, "4"), /*#__PURE__*/React.createElement("h3", {
10072
+ className: "ws-calc-detail-card-title"
10073
+ }, t("WS_FEE_SUMMARY"))), /*#__PURE__*/React.createElement("div", {
10074
+ className: "ws-calc-split-card",
10075
+ style: {
10076
+ marginBottom: "0"
10077
+ }
10078
+ }, /*#__PURE__*/React.createElement("div", {
10079
+ className: "ws-calc-split-left",
10080
+ style: {
10081
+ display: "flex",
10082
+ flexDirection: "column",
10083
+ justifyContent: "center"
10084
+ }
10085
+ }, taxHeadEstimates.map((taxHead, index) => {
10086
+ var _taxHead$estimateAmou;
10087
+ return /*#__PURE__*/React.createElement("div", {
10088
+ key: index,
10089
+ className: "ws-calc-row"
10090
+ }, /*#__PURE__*/React.createElement("span", {
10091
+ className: "ws-calc-row-label"
10092
+ }, t(taxHead.taxHeadCode)), /*#__PURE__*/React.createElement("span", {
10093
+ className: "ws-calc-row-value"
10094
+ }, "\u20B9 ", (_taxHead$estimateAmou = taxHead.estimateAmount) === null || _taxHead$estimateAmou === void 0 ? void 0 : _taxHead$estimateAmou.toLocaleString("en-IN")));
10095
+ })), /*#__PURE__*/React.createElement("div", {
10096
+ className: "ws-calc-highlight-purple"
10097
+ }, /*#__PURE__*/React.createElement("span", {
10098
+ className: "ws-calc-highlight-purple-label"
10099
+ }, t("WS_TOTAL_AMOUNT_PAYABLE")), /*#__PURE__*/React.createElement("span", {
10100
+ className: "ws-calc-highlight-purple-value"
10101
+ }, "\u20B9 ", totalAmount === null || totalAmount === void 0 ? void 0 : totalAmount.toLocaleString("en-IN")))))));
10102
+ };
10103
+ return /*#__PURE__*/React.createElement("div", {
10104
+ className: "employee-form-section-wrapper"
10105
+ }, /*#__PURE__*/React.createElement(VerticalTimeline, {
10106
+ config: [{
10107
+ timeLine: [{
10108
+ actions: t("WS_CALCULATION"),
10109
+ currentStep: 1
10110
+ }]
10111
+ }],
10112
+ showFinalStep: false
10113
+ }), /*#__PURE__*/React.createElement("div", {
10114
+ style: {
10115
+ flex: 1
10116
+ }
10117
+ }, /*#__PURE__*/React.createElement(CollapsibleCardPage, {
10118
+ title: t("WS_CALCULATION"),
10119
+ defaultOpen: true,
10120
+ style: props.style
10121
+ }, /*#__PURE__*/React.createElement("div", {
10122
+ className: "formcomposer-section-grid"
10123
+ }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_CATEGORY_TYPE") + "*"), /*#__PURE__*/React.createElement("div", {
10124
+ className: "form-field"
10125
+ }, /*#__PURE__*/React.createElement(Controller, {
10126
+ control: control,
10127
+ name: "useDetails.categoryType",
10128
+ rules: {
10129
+ required: t("REQUIRED_FIELD")
10130
+ },
10131
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10132
+ option: categoryTypeList,
10133
+ optionKey: "i18nKey",
10134
+ selected: props.value,
10135
+ select: props.onChange,
10136
+ t: t,
10137
+ onBlur: props.onBlur
10138
+ })
10139
+ }))), (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, {
10140
+ style: errorStyle
10141
+ }, errors.useDetails.categoryType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_PROPERTY_CATEGORY") + "*"), /*#__PURE__*/React.createElement("div", {
10142
+ className: "form-field"
10143
+ }, /*#__PURE__*/React.createElement(Controller, {
10144
+ control: control,
10145
+ name: "useDetails.propertyCategory",
10146
+ rules: {
10147
+ required: t("REQUIRED_FIELD")
10148
+ },
10149
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10150
+ option: categoryOptions,
10151
+ optionKey: "name",
10152
+ selected: props.value,
10153
+ select: props.onChange,
10154
+ t: t,
10155
+ onBlur: props.onBlur
10156
+ })
10157
+ }))), (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, {
10158
+ style: errorStyle
10159
+ }, errors.useDetails.propertyCategory.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_PROPERTY_TYPE") + "*"), /*#__PURE__*/React.createElement("div", {
10160
+ className: "form-field"
10161
+ }, /*#__PURE__*/React.createElement(Controller, {
10162
+ control: control,
10163
+ name: "useDetails.propertyType",
10164
+ rules: {
10165
+ required: t("REQUIRED_FIELD")
10166
+ },
10167
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10168
+ option: propertyTypeOptions,
10169
+ optionKey: "name",
10170
+ selected: props.value,
10171
+ select: props.onChange,
10172
+ t: t,
10173
+ onBlur: props.onBlur
10174
+ })
10175
+ }))), (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, {
10176
+ style: errorStyle
10177
+ }, errors.useDetails.propertyType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_WATER_CONNECTION_USAGE_TYPE") + "*"), /*#__PURE__*/React.createElement("div", {
10178
+ className: "form-field"
10179
+ }, /*#__PURE__*/React.createElement(Controller, {
10180
+ control: control,
10181
+ name: "useDetails.WaterConnectionUsageType",
10182
+ rules: {
10183
+ required: t("REQUIRED_FIELD")
10184
+ },
10185
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10186
+ option: usageTypeOptions,
10187
+ optionKey: "name",
10188
+ selected: props.value,
10189
+ select: props.onChange,
10190
+ t: t,
10191
+ onBlur: props.onBlur
10192
+ })
10193
+ }))), (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, {
10194
+ style: errorStyle
10195
+ }, errors.useDetails.WaterConnectionUsageType.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_COLONY_NAME") + "*"), /*#__PURE__*/React.createElement("div", {
10196
+ className: "form-field"
10197
+ }, /*#__PURE__*/React.createElement(Controller, {
10198
+ control: control,
10199
+ name: "useDetails.colonyName",
10200
+ rules: {
10201
+ required: t("REQUIRED_FIELD")
10202
+ },
10203
+ render: props => /*#__PURE__*/React.createElement(Dropdown, {
10204
+ option: colonyNameOptions,
10205
+ optionKey: "name",
10206
+ selected: props.value,
10207
+ select: props.onChange,
10208
+ t: t,
10209
+ onBlur: props.onBlur
10210
+ })
10211
+ }))), (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, {
10212
+ style: errorStyle
10213
+ }, errors.useDetails.colonyName.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_PLOT_AREA")), /*#__PURE__*/React.createElement("div", {
10214
+ className: "form-field"
10215
+ }, /*#__PURE__*/React.createElement(TextInput, {
10216
+ t: t,
10217
+ inputRef: register({
10218
+ pattern: {
10219
+ value: DECIMAL_PATTERN,
10220
+ message: t("ERR_INVALID_DECIMAL")
10221
+ }
10222
+ }),
10223
+ name: "useDetails.plotArea"
10224
+ }))), (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, {
10225
+ style: errorStyle
10226
+ }, errors.useDetails.plotArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_BUILT_UP_AREA")), /*#__PURE__*/React.createElement("div", {
10227
+ className: "form-field"
10228
+ }, /*#__PURE__*/React.createElement(TextInput, {
10229
+ t: t,
10230
+ inputRef: register({
10231
+ pattern: {
10232
+ value: DECIMAL_PATTERN,
10233
+ message: t("ERR_INVALID_DECIMAL")
10234
+ }
10235
+ }),
10236
+ name: "useDetails.builtUpArea"
10237
+ }))), (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, {
10238
+ style: errorStyle
10239
+ }, errors.useDetails.builtUpArea.message), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_FAR_AREA")), /*#__PURE__*/React.createElement("div", {
10240
+ className: "form-field"
10241
+ }, /*#__PURE__*/React.createElement(TextInput, {
10242
+ t: t,
10243
+ inputRef: register({
10244
+ pattern: {
10245
+ value: DECIMAL_PATTERN,
10246
+ message: t("ERR_INVALID_DECIMAL")
10247
+ }
10248
+ }),
10249
+ name: "useDetails.farArea"
10250
+ }))), (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, {
10251
+ style: errorStyle
10252
+ }, 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", {
10253
+ className: "form-field"
10254
+ }, /*#__PURE__*/React.createElement(TextInput, {
10255
+ t: t,
10256
+ inputRef: register({
10257
+ pattern: {
10258
+ value: NUMBER_PATTERN,
10259
+ message: t("ERR_INVALID_NUMBER")
10260
+ }
10261
+ }),
10262
+ name: "useDetails.NumberofDwellingUnits"
10263
+ }))) : 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, {
10264
+ style: errorStyle
10265
+ }, errors.useDetails.NumberofDwellingUnits.message), isHotelRestaurantProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NUMBER_OF_ROOMS") + "*"), /*#__PURE__*/React.createElement("div", {
10266
+ className: "form-field"
10267
+ }, /*#__PURE__*/React.createElement(TextInput, {
10268
+ t: t,
10269
+ inputRef: register({
10270
+ pattern: {
10271
+ value: NUMBER_PATTERN,
10272
+ message: t("ERR_INVALID_NUMBER")
10273
+ },
10274
+ required: isHotelRestaurantProperty ? t("REQUIRED_FIELD") : false
10275
+ }),
10276
+ name: "useDetails.NumberofRooms"
10277
+ }))) : 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, {
10278
+ style: errorStyle
10279
+ }, errors.useDetails.NumberofRooms.message), isHospitalProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, t("WS_NUMBER_OF_BEDS") + "*"), /*#__PURE__*/React.createElement("div", {
10280
+ className: "form-field"
10281
+ }, /*#__PURE__*/React.createElement(TextInput, {
10282
+ t: t,
10283
+ inputRef: register({
10284
+ pattern: {
10285
+ value: NUMBER_PATTERN,
10286
+ message: t("ERR_INVALID_NUMBER")
10287
+ },
10288
+ required: isHospitalProperty ? t("REQUIRED_FIELD") : false
10289
+ }),
10290
+ name: "useDetails.numberOfBeds"
10291
+ }))) : 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, {
10292
+ style: errorStyle
10293
+ }, errors.useDetails.numberOfBeds.message), isSchoolCollegeProperty ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_NUMBER_OF_STUDENTS")), /*#__PURE__*/React.createElement("div", {
10294
+ className: "form-field"
10295
+ }, /*#__PURE__*/React.createElement(TextInput, {
10296
+ t: t,
10297
+ inputRef: register({
10298
+ pattern: {
10299
+ value: NUMBER_PATTERN,
10300
+ message: t("ERR_INVALID_NUMBER")
10301
+ }
10302
+ }),
10303
+ name: "useDetails.numberOfStudents"
10304
+ }))) : 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, {
10305
+ style: errorStyle
10306
+ }, errors.useDetails.numberOfStudents.message), isServentHouse ? /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, null, "" + t("WS_SERVENT_HOUSE")), /*#__PURE__*/React.createElement("div", {
10307
+ className: "form-field"
10308
+ }, /*#__PURE__*/React.createElement(TextInput, {
10309
+ t: t,
10310
+ inputRef: register({
10311
+ pattern: {
10312
+ value: NUMBER_PATTERN,
10313
+ message: t("ERR_INVALID_NUMBER")
10314
+ }
10315
+ }),
10316
+ name: "useDetails.ServantQuartersRoom"
10317
+ }))) : 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, {
10318
+ style: errorStyle
10319
+ }, errors.useDetails.ServantQuartersRoom.message))), /*#__PURE__*/React.createElement("div", {
10320
+ style: {
10321
+ display: "flex",
10322
+ marginTop: "24px",
10323
+ marginBottom: "32px",
10324
+ justifyContent: isMobile ? "center" : "flex-end"
10325
+ }
10326
+ }, /*#__PURE__*/React.createElement(SubmitBar, {
10327
+ label: t("ES_COMMON_CALCULATE"),
10328
+ onSubmit: handleSubmit
10329
+ })), calculationData && /*#__PURE__*/React.createElement(RenderCalculationDetails, {
10330
+ data: calculationData
10331
+ })));
10332
+ };
10333
+
9595
10334
  const BILLSBreadCrumbs = _ref => {
9596
10335
  var _applicationDetails$a, _applicationDetails$a9, _applicationDetails$a0, _applicationDetails$a1, _applicationDetails$a13, _applicationDetails$a14, _reciept_data$Payment2;
9597
10336
  const getRecieptSearch = function (tenantId, payments, consumerCodes, receiptKey) {
@@ -10017,6 +10756,10 @@ const BILLSBreadCrumbs = _ref => {
10017
10756
  path: "/digit-ui/employee/ws/water/bulk-bil",
10018
10757
  label: t("CS_TITLE_BULK_BILL"),
10019
10758
  show: location.pathname.includes("/ws/water/bulk-bill") ? true : false
10759
+ }, {
10760
+ path: "/digit-ui/employee/ws/water/calculation",
10761
+ label: t("WS_CALCULATION"),
10762
+ show: location.pathname.includes("/ws/water/calculation") ? true : false
10020
10763
  }];
10021
10764
  let lastCrumbIndex = findLastIndex(crumbs, "show", true);
10022
10765
  crumbs[lastCrumbIndex] = _extends({}, crumbs[lastCrumbIndex], {
@@ -10274,6 +11017,11 @@ const App$1 = _ref2 => {
10274
11017
  component: props => /*#__PURE__*/React.createElement(WSBulkBillGeneration, _extends({}, props, {
10275
11018
  parentRoute: path
10276
11019
  }))
11020
+ }), /*#__PURE__*/React.createElement(PrivateRoute, {
11021
+ path: path + "/water/calculation",
11022
+ component: props => /*#__PURE__*/React.createElement(WSCalculation, _extends({}, props, {
11023
+ parentRoute: path
11024
+ }))
10277
11025
  }))))));
10278
11026
  };
10279
11027
 
@@ -20627,9 +21375,9 @@ const WSDjbEmployee = _ref => {
20627
21375
  return /*#__PURE__*/React.createElement(React.Fragment, null, FormContent);
20628
21376
  };
20629
21377
 
20630
- const _excluded = ["t", "config", "onSelect", "formData", "formState", "setError", "clearErrors"];
20631
- const NUMBER_PATTERN = /^\d+$/;
20632
- const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
21378
+ const _excluded$1 = ["t", "config", "onSelect", "formData", "formState", "setError", "clearErrors"];
21379
+ const NUMBER_PATTERN$1 = /^\d+$/;
21380
+ const DECIMAL_PATTERN$1 = /^\d+(\.\d{1,2})?$/;
20633
21381
  const PropertyWaterConnection = _ref => {
20634
21382
  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
21383
  let t = _ref.t,
@@ -20638,7 +21386,7 @@ const PropertyWaterConnection = _ref => {
20638
21386
  formData = _ref.formData,
20639
21387
  setError = _ref.setError,
20640
21388
  clearErrors = _ref.clearErrors,
20641
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
21389
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
20642
21390
  const _useForm = useForm({
20643
21391
  defaultValues: (formData === null || formData === void 0 ? void 0 : formData[config.key]) || {
20644
21392
  useDetails: {
@@ -20954,7 +21702,7 @@ const PropertyWaterConnection = _ref => {
20954
21702
  t: t,
20955
21703
  inputRef: register({
20956
21704
  pattern: {
20957
- value: DECIMAL_PATTERN,
21705
+ value: DECIMAL_PATTERN$1,
20958
21706
  message: t("ERR_INVALID_DECIMAL")
20959
21707
  }
20960
21708
  }),
@@ -20968,7 +21716,7 @@ const PropertyWaterConnection = _ref => {
20968
21716
  t: t,
20969
21717
  inputRef: register({
20970
21718
  pattern: {
20971
- value: DECIMAL_PATTERN,
21719
+ value: DECIMAL_PATTERN$1,
20972
21720
  message: t("ERR_INVALID_DECIMAL")
20973
21721
  }
20974
21722
  }),
@@ -20982,7 +21730,7 @@ const PropertyWaterConnection = _ref => {
20982
21730
  t: t,
20983
21731
  inputRef: register({
20984
21732
  pattern: {
20985
- value: DECIMAL_PATTERN,
21733
+ value: DECIMAL_PATTERN$1,
20986
21734
  message: t("ERR_INVALID_DECIMAL")
20987
21735
  }
20988
21736
  }),
@@ -21015,7 +21763,7 @@ const PropertyWaterConnection = _ref => {
21015
21763
  t: t,
21016
21764
  inputRef: register({
21017
21765
  pattern: {
21018
- value: NUMBER_PATTERN,
21766
+ value: NUMBER_PATTERN$1,
21019
21767
  message: t("ERR_INVALID_NUMBER")
21020
21768
  }
21021
21769
  }),
@@ -21029,7 +21777,7 @@ const PropertyWaterConnection = _ref => {
21029
21777
  t: t,
21030
21778
  inputRef: register({
21031
21779
  pattern: {
21032
- value: NUMBER_PATTERN,
21780
+ value: NUMBER_PATTERN$1,
21033
21781
  message: t("ERR_INVALID_NUMBER")
21034
21782
  },
21035
21783
  required: isHotelRestaurantProperty ? t("REQUIRED_FIELD") : false
@@ -21044,7 +21792,7 @@ const PropertyWaterConnection = _ref => {
21044
21792
  t: t,
21045
21793
  inputRef: register({
21046
21794
  pattern: {
21047
- value: NUMBER_PATTERN,
21795
+ value: NUMBER_PATTERN$1,
21048
21796
  message: t("ERR_INVALID_NUMBER")
21049
21797
  },
21050
21798
  required: isHospitalProperty ? t("REQUIRED_FIELD") : false
@@ -21059,7 +21807,7 @@ const PropertyWaterConnection = _ref => {
21059
21807
  t: t,
21060
21808
  inputRef: register({
21061
21809
  pattern: {
21062
- value: NUMBER_PATTERN,
21810
+ value: NUMBER_PATTERN$1,
21063
21811
  message: t("ERR_INVALID_NUMBER")
21064
21812
  }
21065
21813
  }),
@@ -21073,7 +21821,7 @@ const PropertyWaterConnection = _ref => {
21073
21821
  t: t,
21074
21822
  inputRef: register({
21075
21823
  pattern: {
21076
- value: NUMBER_PATTERN,
21824
+ value: NUMBER_PATTERN$1,
21077
21825
  message: t("ERR_INVALID_NUMBER")
21078
21826
  }
21079
21827
  }),
@@ -22045,7 +22793,7 @@ const SearchFields = _ref => {
22045
22793
  }, t("CS_COMMON_CLEAR_SEARCH"))));
22046
22794
  };
22047
22795
 
22048
- const _excluded$1 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
22796
+ const _excluded$2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
22049
22797
  _excluded2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"];
22050
22798
  const MobileSearchApplication = _ref => {
22051
22799
  let Controller = _ref.Controller,
@@ -22092,7 +22840,7 @@ const MobileSearchApplication = _ref => {
22092
22840
  let currentlyActiveMobileModal = _ref2.currentlyActiveMobileModal,
22093
22841
  searchFormFieldsComponentProps = _ref2.searchFormFieldsComponentProps,
22094
22842
  tenantId = _ref2.tenantId,
22095
- props = _objectWithoutPropertiesLoose(_ref2, _excluded$1);
22843
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
22096
22844
  const closeMobilePopupModal = props.closeMobilePopupModal;
22097
22845
  switch (currentlyActiveMobileModal) {
22098
22846
  case "SearchFormComponent":
@@ -22527,7 +23275,7 @@ const SearchFields$1 = _ref => {
22527
23275
  }, t("WS_SEARCH_CONNECTION_RESET_BUTTON"))));
22528
23276
  };
22529
23277
 
22530
- const _excluded$2 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
23278
+ const _excluded$3 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"],
22531
23279
  _excluded2$1 = ["currentlyActiveMobileModal", "searchFormFieldsComponentProps", "tenantId"];
22532
23280
  const MobileSearchWater = _ref => {
22533
23281
  let Controller = _ref.Controller,
@@ -22572,7 +23320,7 @@ const MobileSearchWater = _ref => {
22572
23320
  let currentlyActiveMobileModal = _ref2.currentlyActiveMobileModal,
22573
23321
  searchFormFieldsComponentProps = _ref2.searchFormFieldsComponentProps,
22574
23322
  tenantId = _ref2.tenantId,
22575
- props = _objectWithoutPropertiesLoose(_ref2, _excluded$2);
23323
+ props = _objectWithoutPropertiesLoose(_ref2, _excluded$3);
22576
23324
  const closeMobilePopupModal = props.closeMobilePopupModal;
22577
23325
  switch (currentlyActiveMobileModal) {
22578
23326
  case "SearchFormComponent":
@@ -23807,6 +24555,10 @@ const WSCard = () => {
23807
24555
  label: t("WS_WATER_APPLICATION_SEARCH"),
23808
24556
  link: "/digit-ui/employee/ws/water/search-application",
23809
24557
  roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
24558
+ }, {
24559
+ label: t("WS_CALCULATION"),
24560
+ link: "/digit-ui/employee/ws/water/calculation",
24561
+ roles: ["WS_CEMP", "WS_APPROVER", "WS_FIELD_INSPECTOR", "WS_DOC_VERIFIER", "WS_CLERK"]
23810
24562
  }]
23811
24563
  };
23812
24564
  return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
@@ -29002,7 +29754,7 @@ const WSFeeEstimation = _ref => {
29002
29754
  };
29003
29755
 
29004
29756
  const ViewBreakup = _ref => {
29005
- var _breakUpData$calculat, _breakUpData$calculat2, _wsAdditionalDetails$8, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
29757
+ var _breakUpData$calculat, _breakUpData$calculat2, _breakUpData$calculat3, _wsAdditionalDetails$8, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
29006
29758
  let wsAdditionalDetails = _ref.wsAdditionalDetails,
29007
29759
  print = _ref.print,
29008
29760
  download = _ref.download;
@@ -29113,11 +29865,8 @@ const ViewBreakup = _ref => {
29113
29865
  title: t("WS_APPLICATION_FEE_HEADER"),
29114
29866
  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
29867
  }, {
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 => {
29868
+ title: "Property details",
29869
+ values: propertyRows.map(_ref4 => {
29121
29870
  let label = _ref4.label,
29122
29871
  value = _ref4.value,
29123
29872
  currency = _ref4.currency,
@@ -29129,8 +29878,11 @@ const ViewBreakup = _ref => {
29129
29878
  };
29130
29879
  })
29131
29880
  }, {
29132
- title: "Infrastructure charge details",
29133
- values: infrastructureChargeRows.map(_ref5 => {
29881
+ title: "Taxes",
29882
+ values: amountRows(breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : _breakUpData$billSlab3.TAX)
29883
+ }, {
29884
+ title: "Water demand details",
29885
+ values: waterDemandRows.map(_ref5 => {
29134
29886
  let label = _ref5.label,
29135
29887
  value = _ref5.value,
29136
29888
  currency = _ref5.currency,
@@ -29141,6 +29893,19 @@ const ViewBreakup = _ref => {
29141
29893
  value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29142
29894
  };
29143
29895
  })
29896
+ }, {
29897
+ title: "Infrastructure charge details",
29898
+ values: infrastructureChargeRows.map(_ref6 => {
29899
+ let label = _ref6.label,
29900
+ value = _ref6.value,
29901
+ currency = _ref6.currency,
29902
+ unit = _ref6.unit,
29903
+ isText = _ref6.isText;
29904
+ return {
29905
+ title: label,
29906
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
29907
+ };
29908
+ })
29144
29909
  }, {
29145
29910
  title: "Total",
29146
29911
  values: [{
@@ -29182,8 +29947,58 @@ const ViewBreakup = _ref => {
29182
29947
  printWindow.focus();
29183
29948
  printWindow.print();
29184
29949
  };
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;
29950
+ const propertyDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat = breakUpData.calculationDetail) === null || _breakUpData$calculat === void 0 ? void 0 : _breakUpData$calculat.propertyDetail;
29951
+ const waterDemandDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat2 = breakUpData.calculationDetail) === null || _breakUpData$calculat2 === void 0 ? void 0 : _breakUpData$calculat2.waterDemandDetail;
29952
+ const infrastructureChargeDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat3 = breakUpData.calculationDetail) === null || _breakUpData$calculat3 === void 0 ? void 0 : _breakUpData$calculat3.infrastructureChargeDetail;
29953
+ const propertyRows = propertyDetail ? [{
29954
+ label: "Property ID",
29955
+ value: propertyDetail.propertyId,
29956
+ isText: true
29957
+ }, {
29958
+ label: "Property type",
29959
+ value: propertyDetail.propertyType,
29960
+ isText: true
29961
+ }, {
29962
+ label: "Plot area",
29963
+ value: propertyDetail.landArea,
29964
+ unit: " (sq. meter.)"
29965
+ }, {
29966
+ label: "Built-up area",
29967
+ value: propertyDetail.superBuiltUpArea,
29968
+ unit: " (sq. meter.)"
29969
+ }, {
29970
+ label: "farArea",
29971
+ value: propertyDetail.farArea,
29972
+ isText: true
29973
+ }, {
29974
+ label: "coveredArea",
29975
+ value: propertyDetail.coveredArea,
29976
+ isText: true
29977
+ }, {
29978
+ label: "numberOfDwellingUnits",
29979
+ value: propertyDetail.numberOfDwellingUnits,
29980
+ isText: true
29981
+ }, {
29982
+ label: "numberOfBeds",
29983
+ value: propertyDetail.numberOfBeds,
29984
+ isText: true
29985
+ }, {
29986
+ label: "numberOfRooms",
29987
+ value: propertyDetail.numberOfRooms,
29988
+ isText: true
29989
+ }, {
29990
+ label: "numberOfStudents",
29991
+ value: propertyDetail.numberOfStudents,
29992
+ isText: true
29993
+ }, {
29994
+ label: "numberOfStaff",
29995
+ value: propertyDetail.numberOfStaff,
29996
+ isText: true
29997
+ }, {
29998
+ label: "Usage category",
29999
+ value: propertyDetail.usageCategory,
30000
+ isText: true
30001
+ }] : [];
29187
30002
  const waterDemandRows = waterDemandDetail ? [{
29188
30003
  label: "Calculated occupancy",
29189
30004
  value: waterDemandDetail.calculatedOccupancy,
@@ -29325,6 +30140,12 @@ const ViewBreakup = _ref => {
29325
30140
  textStyle: {
29326
30141
  textAlign: "right"
29327
30142
  }
30143
+ })), propertyRows.length > 0 && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
30144
+ style: {
30145
+ margin: "10px 0px"
30146
+ }
30147
+ }, "Property details"), /*#__PURE__*/React.createElement(DetailRows, {
30148
+ rows: propertyRows
29328
30149
  })), waterDemandRows.length > 0 && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(CardSectionHeader, {
29329
30150
  style: {
29330
30151
  margin: "10px 0px"
@@ -34054,7 +34875,7 @@ const WSPropertyLocationDetails = props => {
34054
34875
  return /*#__PURE__*/React.createElement(PropertyLocationDetails, props);
34055
34876
  };
34056
34877
 
34057
- const _excluded$3 = ["errors"],
34878
+ const _excluded$4 = ["errors"],
34058
34879
  _excluded2$2 = ["register", "control", "watch", "setValue", "unregister", "handleSubmit", "formState", "getValues", "reset"];
34059
34880
  const ApplicationBillAmendment = () => {
34060
34881
  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 +34932,7 @@ const ApplicationBillAmendment = () => {
34111
34932
  handleSubmit = _useForm.handleSubmit,
34112
34933
  _useForm$formState = _useForm.formState,
34113
34934
  errors = _useForm$formState.errors,
34114
- rest = _objectWithoutPropertiesLoose(_useForm$formState, _excluded$3),
34935
+ rest = _objectWithoutPropertiesLoose(_useForm$formState, _excluded$4),
34115
34936
  getValues = _useForm.getValues,
34116
34937
  methods = _objectWithoutPropertiesLoose(_useForm, _excluded2$2);
34117
34938
  const _Digit$Hooks$ws$useAp = Digit.Hooks.ws.useApplicationActionsBillAmendUpdate(),
@@ -34976,8 +35797,8 @@ const DECLARATION_POINTS = ["I understand that sanction of connection does not a
34976
35797
  const NAME_PATTERN = /^[a-zA-Z\s.'-]{1,50}$/;
34977
35798
  const EMAIL_PATTERN = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$/;
34978
35799
  const MOBILE_PATTERN = /^[6-9][0-9]{9}$/;
34979
- const NUMBER_PATTERN$1 = /^\d+$/;
34980
- const DECIMAL_PATTERN$1 = /^\d+(\.\d{1,2})?$/;
35800
+ const NUMBER_PATTERN$2 = /^\d+$/;
35801
+ const DECIMAL_PATTERN$2 = /^\d+(\.\d{1,2})?$/;
34981
35802
  const IFSC_PATTERN = /^[A-Z]{4}0[A-Z0-9]{6}$/;
34982
35803
  const ACCOUNT_PATTERN = /^[0-9]{9,18}$/;
34983
35804
  const COLLAPSIBLE_CONTENT_TAB = "__WS_SECTION_CONTENT__";
@@ -37246,7 +38067,7 @@ const NewApplication = () => {
37246
38067
  errorStyle: !!getFieldError("useDetails.plotArea"),
37247
38068
  inputRef: register({
37248
38069
  pattern: {
37249
- value: DECIMAL_PATTERN$1,
38070
+ value: DECIMAL_PATTERN$2,
37250
38071
  message: "Enter a valid numeric value."
37251
38072
  },
37252
38073
  required: "Plot Area is required."
@@ -37260,7 +38081,7 @@ const NewApplication = () => {
37260
38081
  errorStyle: !!getFieldError("useDetails.builtUpArea"),
37261
38082
  inputRef: register({
37262
38083
  pattern: {
37263
- value: DECIMAL_PATTERN$1,
38084
+ value: DECIMAL_PATTERN$2,
37264
38085
  message: "Enter a valid numeric value."
37265
38086
  },
37266
38087
  required: "Built Up Area is required."
@@ -37291,7 +38112,7 @@ const NewApplication = () => {
37291
38112
  errorStyle: !!getFieldError("useDetails.NumberofDwellingUnits"),
37292
38113
  inputRef: register({
37293
38114
  pattern: {
37294
- value: DECIMAL_PATTERN$1,
38115
+ value: DECIMAL_PATTERN$2,
37295
38116
  message: "Enter a valid numeric value."
37296
38117
  },
37297
38118
  required: "Built Up Area is required."
@@ -37305,7 +38126,7 @@ const NewApplication = () => {
37305
38126
  errorStyle: !!getFieldError("useDetails.NumberofRooms"),
37306
38127
  inputRef: register({
37307
38128
  pattern: {
37308
- value: DECIMAL_PATTERN$1,
38129
+ value: DECIMAL_PATTERN$2,
37309
38130
  message: "Enter a valid numeric value."
37310
38131
  },
37311
38132
  required: "Built Up Area is required."
@@ -37319,7 +38140,7 @@ const NewApplication = () => {
37319
38140
  errorStyle: !!getFieldError("useDetails.hospitalBeds"),
37320
38141
  inputRef: register({
37321
38142
  pattern: {
37322
- value: NUMBER_PATTERN$1,
38143
+ value: NUMBER_PATTERN$2,
37323
38144
  message: "Enter a valid whole number."
37324
38145
  },
37325
38146
  required: isHospitalProperty ? "No. of Beds is required for Hospital / Nursing Home." : false