@djb25/digit-ui-module-commonpt 1.0.22 → 1.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6033,13 +6033,14 @@ const setPropertyDetailsLW = data => {
6033
6033
  farArea: useDetails === null || useDetails === void 0 ? void 0 : useDetails.farArea,
6034
6034
  numberOfRooms: useDetails === null || useDetails === void 0 ? void 0 : useDetails.NumberofRooms,
6035
6035
  numberOfBeds: useDetails === null || useDetails === void 0 ? void 0 : useDetails.numberOfBeds,
6036
- numberOfStudents: useDetails === null || useDetails === void 0 ? void 0 : useDetails.numberOfStudents
6036
+ numberOfStudents: useDetails === null || useDetails === void 0 ? void 0 : useDetails.numberOfStudents,
6037
+ servantQuarterArea: useDetails === null || useDetails === void 0 ? void 0 : useDetails.servantQuarterArea
6037
6038
  };
6038
6039
  data.propertyDetails = propertyDetails;
6039
6040
  return data;
6040
6041
  };
6041
6042
  const convertToPropertyLightWeight = function (data) {
6042
- var _data$propertyDetails, _data$propertyDetails2, _data, _data$owners2, _data$owners2$, _data$propertyDetails3, _data$propertyDetails4, _data$waterConnection, _data$waterConnection2, _data$waterConnection3, _data$useDetails, _data$useDetails$cate, _data$waterConnection4, _data$waterConnection5, _data$waterConnection6, _data$useDetails2, _data$useDetails2$Wat, _data$waterConnection7, _data$waterConnection8, _data$waterConnection9, _data$useDetails3, _data$useDetails3$Sel, _data$waterConnection0, _data$waterConnection1, _data$useDetails4, _data$waterConnection10, _data$waterConnection11, _data$useDetails5, _data$waterConnection12, _data$waterConnection13, _data$waterConnection14, _data$useDetails6, _data$useDetails6$noO, _data$waterConnection15, _data$waterConnection16, _data$useDetails7, _data$waterConnection17, _data$waterConnection18, _data$useDetails8, _data$waterConnection19, _data$waterConnection20, _data$useDetails9, _data$waterConnection21, _data$waterConnection22, _data$useDetails0, _data$waterConnection23, _data$waterConnection24, _data$useDetails1;
6043
+ var _data$propertyDetails, _data$propertyDetails2, _data, _data$owners2, _data$owners2$, _data$propertyDetails3, _data$propertyDetails4, _data$waterConnection, _data$waterConnection2, _data$waterConnection3, _data$useDetails, _data$useDetails$cate, _data$waterConnection4, _data$waterConnection5, _data$waterConnection6, _data$useDetails2, _data$useDetails2$Wat, _data$waterConnection7, _data$waterConnection8, _data$waterConnection9, _data$useDetails3, _data$useDetails3$Sel, _data$waterConnection0, _data$waterConnection1, _data$useDetails4, _data$waterConnection10, _data$waterConnection11, _data$useDetails5, _data$waterConnection12, _data$waterConnection13, _data$waterConnection14, _data$useDetails6, _data$useDetails6$noO, _data$waterConnection15, _data$waterConnection16, _data$useDetails7, _data$waterConnection17, _data$waterConnection18, _data$useDetails8, _data$waterConnection19, _data$waterConnection20, _data$useDetails9, _data$waterConnection21, _data$waterConnection22, _data$useDetails0, _data$waterConnection23, _data$waterConnection24, _data$useDetails1, _data$waterConnection25, _data$waterConnection26, _data$useDetails10;
6043
6044
  if (data === void 0) {
6044
6045
  data = {};
6045
6046
  }
@@ -6094,8 +6095,9 @@ const convertToPropertyLightWeight = function (data) {
6094
6095
  plotArea: ((_data$waterConnection15 = data.waterConnection) === null || _data$waterConnection15 === void 0 ? void 0 : (_data$waterConnection16 = _data$waterConnection15.useDetails) === null || _data$waterConnection16 === void 0 ? void 0 : _data$waterConnection16.plotArea) || ((_data$useDetails7 = data.useDetails) === null || _data$useDetails7 === void 0 ? void 0 : _data$useDetails7.plotArea),
6095
6096
  builtUpArea: ((_data$waterConnection17 = data.waterConnection) === null || _data$waterConnection17 === void 0 ? void 0 : (_data$waterConnection18 = _data$waterConnection17.useDetails) === null || _data$waterConnection18 === void 0 ? void 0 : _data$waterConnection18.builtUpArea) || ((_data$useDetails8 = data.useDetails) === null || _data$useDetails8 === void 0 ? void 0 : _data$useDetails8.builtUpArea),
6096
6097
  farArea: ((_data$waterConnection19 = data.waterConnection) === null || _data$waterConnection19 === void 0 ? void 0 : (_data$waterConnection20 = _data$waterConnection19.useDetails) === null || _data$waterConnection20 === void 0 ? void 0 : _data$waterConnection20.farArea) || ((_data$useDetails9 = data.useDetails) === null || _data$useDetails9 === void 0 ? void 0 : _data$useDetails9.farArea),
6097
- numberOfStudents: ((_data$waterConnection21 = data.waterConnection) === null || _data$waterConnection21 === void 0 ? void 0 : (_data$waterConnection22 = _data$waterConnection21.useDetails) === null || _data$waterConnection22 === void 0 ? void 0 : _data$waterConnection22.numberOfStudents) || ((_data$useDetails0 = data.useDetails) === null || _data$useDetails0 === void 0 ? void 0 : _data$useDetails0.numberOfStudents),
6098
- numberOfBeds: ((_data$waterConnection23 = data.waterConnection) === null || _data$waterConnection23 === void 0 ? void 0 : (_data$waterConnection24 = _data$waterConnection23.useDetails) === null || _data$waterConnection24 === void 0 ? void 0 : _data$waterConnection24.numberOfBeds) || ((_data$useDetails1 = data.useDetails) === null || _data$useDetails1 === void 0 ? void 0 : _data$useDetails1.numberOfBeds),
6098
+ servantQuarterArea: ((_data$waterConnection21 = data.waterConnection) === null || _data$waterConnection21 === void 0 ? void 0 : (_data$waterConnection22 = _data$waterConnection21.useDetails) === null || _data$waterConnection22 === void 0 ? void 0 : _data$waterConnection22.servantQuarterArea) || ((_data$useDetails0 = data.useDetails) === null || _data$useDetails0 === void 0 ? void 0 : _data$useDetails0.servantQuarterArea),
6099
+ numberOfStudents: ((_data$waterConnection23 = data.waterConnection) === null || _data$waterConnection23 === void 0 ? void 0 : (_data$waterConnection24 = _data$waterConnection23.useDetails) === null || _data$waterConnection24 === void 0 ? void 0 : _data$waterConnection24.numberOfStudents) || ((_data$useDetails1 = data.useDetails) === null || _data$useDetails1 === void 0 ? void 0 : _data$useDetails1.numberOfStudents),
6100
+ numberOfBeds: ((_data$waterConnection25 = data.waterConnection) === null || _data$waterConnection25 === void 0 ? void 0 : (_data$waterConnection26 = _data$waterConnection25.useDetails) === null || _data$waterConnection26 === void 0 ? void 0 : _data$waterConnection26.numberOfBeds) || ((_data$useDetails10 = data.useDetails) === null || _data$useDetails10 === void 0 ? void 0 : _data$useDetails10.numberOfBeds),
6099
6101
  owners: [...(data.owners || []).map((owner, index) => {
6100
6102
  var _owner$gender3, _owner$gender4, _owner$ownerType2, _owner$relationship2, _owner$inistitutetype2;
6101
6103
  return _extends({}, owner, {
@@ -6133,7 +6135,7 @@ const convertToPropertyLightWeight = function (data) {
6133
6135
  return formdata;
6134
6136
  };
6135
6137
  const convertToUpdatePropertyLightWeight = function (data) {
6136
- var _data$propertyDetails5, _data$propertyDetails6, _data$waterConnection25, _data$waterConnection26, _data$waterConnection27, _data$useDetails10, _data$useDetails10$ca, _data$waterConnection28, _data$waterConnection29, _data$waterConnection30, _data$useDetails11, _data$useDetails11$Wa, _data$waterConnection31, _data$waterConnection32, _data$waterConnection33, _data$useDetails12, _data$useDetails12$Se, _data$waterConnection34, _data$waterConnection35, _data$useDetails13, _data$waterConnection36, _data$waterConnection37, _data$useDetails14, _data$waterConnection38, _data$waterConnection39, _data$waterConnection40, _data$useDetails15, _data$useDetails15$no, _data$waterConnection41, _data$waterConnection42, _data$useDetails16, _data$waterConnection43, _data$waterConnection44, _data$useDetails17, _data$waterConnection45, _data$waterConnection46, _data$useDetails18, _data$waterConnection47, _data$waterConnection48, _data$useDetails19, _data$waterConnection49, _data$waterConnection50, _data$useDetails20, _formdata$Property, _data3, _formdata$Property3;
6138
+ var _data$propertyDetails5, _data$propertyDetails6, _data$waterConnection27, _data$waterConnection28, _data$waterConnection29, _data$useDetails11, _data$useDetails11$ca, _data$waterConnection30, _data$waterConnection31, _data$waterConnection32, _data$useDetails12, _data$useDetails12$Wa, _data$waterConnection33, _data$waterConnection34, _data$waterConnection35, _data$useDetails13, _data$useDetails13$Se, _data$waterConnection36, _data$waterConnection37, _data$useDetails14, _data$waterConnection38, _data$waterConnection39, _data$useDetails15, _data$waterConnection40, _data$waterConnection41, _data$waterConnection42, _data$useDetails16, _data$useDetails16$no, _data$waterConnection43, _data$waterConnection44, _data$useDetails17, _data$waterConnection45, _data$waterConnection46, _data$useDetails18, _data$waterConnection47, _data$waterConnection48, _data$useDetails19, _data$waterConnection49, _data$waterConnection50, _data$useDetails20, _data$waterConnection51, _data$waterConnection52, _data$useDetails21, _data$waterConnection53, _data$waterConnection54, _data$useDetails22, _formdata$Property, _data3, _formdata$Property3;
6137
6139
  if (data === void 0) {
6138
6140
  data = {};
6139
6141
  }
@@ -6180,17 +6182,18 @@ const convertToUpdatePropertyLightWeight = function (data) {
6180
6182
  noOfFloors: noOfFloors,
6181
6183
  additionalDetails: {
6182
6184
  isRainwaterHarvesting: false,
6183
- categoryType: ((_data$waterConnection25 = data.waterConnection) === null || _data$waterConnection25 === void 0 ? void 0 : (_data$waterConnection26 = _data$waterConnection25.useDetails) === null || _data$waterConnection26 === void 0 ? void 0 : (_data$waterConnection27 = _data$waterConnection26.categoryType) === null || _data$waterConnection27 === void 0 ? void 0 : _data$waterConnection27.code) || ((_data$useDetails10 = data.useDetails) === null || _data$useDetails10 === void 0 ? void 0 : (_data$useDetails10$ca = _data$useDetails10.categoryType) === null || _data$useDetails10$ca === void 0 ? void 0 : _data$useDetails10$ca.code),
6184
- waterConnectionUsageType: ((_data$waterConnection28 = data.waterConnection) === null || _data$waterConnection28 === void 0 ? void 0 : (_data$waterConnection29 = _data$waterConnection28.useDetails) === null || _data$waterConnection29 === void 0 ? void 0 : (_data$waterConnection30 = _data$waterConnection29.WaterConnectionUsageType) === null || _data$waterConnection30 === void 0 ? void 0 : _data$waterConnection30.code) || ((_data$useDetails11 = data.useDetails) === null || _data$useDetails11 === void 0 ? void 0 : (_data$useDetails11$Wa = _data$useDetails11.WaterConnectionUsageType) === null || _data$useDetails11$Wa === void 0 ? void 0 : _data$useDetails11$Wa.code),
6185
- yearOfConstruction: ((_data$waterConnection31 = data.waterConnection) === null || _data$waterConnection31 === void 0 ? void 0 : (_data$waterConnection32 = _data$waterConnection31.useDetails) === null || _data$waterConnection32 === void 0 ? void 0 : (_data$waterConnection33 = _data$waterConnection32.SelectYearofConstruction) === null || _data$waterConnection33 === void 0 ? void 0 : _data$waterConnection33.value) || ((_data$useDetails12 = data.useDetails) === null || _data$useDetails12 === void 0 ? void 0 : (_data$useDetails12$Se = _data$useDetails12.SelectYearofConstruction) === null || _data$useDetails12$Se === void 0 ? void 0 : _data$useDetails12$Se.value),
6186
- numberOfDwellingUnits: ((_data$waterConnection34 = data.waterConnection) === null || _data$waterConnection34 === void 0 ? void 0 : (_data$waterConnection35 = _data$waterConnection34.useDetails) === null || _data$waterConnection35 === void 0 ? void 0 : _data$waterConnection35.NumberofDwellingUnits) || ((_data$useDetails13 = data.useDetails) === null || _data$useDetails13 === void 0 ? void 0 : _data$useDetails13.NumberofDwellingUnits),
6187
- numberOfRooms: ((_data$waterConnection36 = data.waterConnection) === null || _data$waterConnection36 === void 0 ? void 0 : (_data$waterConnection37 = _data$waterConnection36.useDetails) === null || _data$waterConnection37 === void 0 ? void 0 : _data$waterConnection37.NumberofRooms) || ((_data$useDetails14 = data.useDetails) === null || _data$useDetails14 === void 0 ? void 0 : _data$useDetails14.NumberofRooms),
6188
- numberOfFloors: ((_data$waterConnection38 = data.waterConnection) === null || _data$waterConnection38 === void 0 ? void 0 : (_data$waterConnection39 = _data$waterConnection38.useDetails) === null || _data$waterConnection39 === void 0 ? void 0 : (_data$waterConnection40 = _data$waterConnection39.noOfFloors) === null || _data$waterConnection40 === void 0 ? void 0 : _data$waterConnection40.code) || ((_data$useDetails15 = data.useDetails) === null || _data$useDetails15 === void 0 ? void 0 : (_data$useDetails15$no = _data$useDetails15.noOfFloors) === null || _data$useDetails15$no === void 0 ? void 0 : _data$useDetails15$no.code) || 1,
6189
- plotArea: ((_data$waterConnection41 = data.waterConnection) === null || _data$waterConnection41 === void 0 ? void 0 : (_data$waterConnection42 = _data$waterConnection41.useDetails) === null || _data$waterConnection42 === void 0 ? void 0 : _data$waterConnection42.plotArea) || ((_data$useDetails16 = data.useDetails) === null || _data$useDetails16 === void 0 ? void 0 : _data$useDetails16.plotArea),
6190
- builtUpArea: ((_data$waterConnection43 = data.waterConnection) === null || _data$waterConnection43 === void 0 ? void 0 : (_data$waterConnection44 = _data$waterConnection43.useDetails) === null || _data$waterConnection44 === void 0 ? void 0 : _data$waterConnection44.builtUpArea) || ((_data$useDetails17 = data.useDetails) === null || _data$useDetails17 === void 0 ? void 0 : _data$useDetails17.builtUpArea),
6191
- farArea: ((_data$waterConnection45 = data.waterConnection) === null || _data$waterConnection45 === void 0 ? void 0 : (_data$waterConnection46 = _data$waterConnection45.useDetails) === null || _data$waterConnection46 === void 0 ? void 0 : _data$waterConnection46.farArea) || ((_data$useDetails18 = data.useDetails) === null || _data$useDetails18 === void 0 ? void 0 : _data$useDetails18.farArea),
6192
- numberOfStudents: ((_data$waterConnection47 = data.waterConnection) === null || _data$waterConnection47 === void 0 ? void 0 : (_data$waterConnection48 = _data$waterConnection47.useDetails) === null || _data$waterConnection48 === void 0 ? void 0 : _data$waterConnection48.numberOfStudents) || ((_data$useDetails19 = data.useDetails) === null || _data$useDetails19 === void 0 ? void 0 : _data$useDetails19.numberOfStudents),
6193
- numberOfBeds: ((_data$waterConnection49 = data.waterConnection) === null || _data$waterConnection49 === void 0 ? void 0 : (_data$waterConnection50 = _data$waterConnection49.useDetails) === null || _data$waterConnection50 === void 0 ? void 0 : _data$waterConnection50.numberOfBeds) || ((_data$useDetails20 = data.useDetails) === null || _data$useDetails20 === void 0 ? void 0 : _data$useDetails20.numberOfBeds),
6185
+ categoryType: ((_data$waterConnection27 = data.waterConnection) === null || _data$waterConnection27 === void 0 ? void 0 : (_data$waterConnection28 = _data$waterConnection27.useDetails) === null || _data$waterConnection28 === void 0 ? void 0 : (_data$waterConnection29 = _data$waterConnection28.categoryType) === null || _data$waterConnection29 === void 0 ? void 0 : _data$waterConnection29.code) || ((_data$useDetails11 = data.useDetails) === null || _data$useDetails11 === void 0 ? void 0 : (_data$useDetails11$ca = _data$useDetails11.categoryType) === null || _data$useDetails11$ca === void 0 ? void 0 : _data$useDetails11$ca.code),
6186
+ waterConnectionUsageType: ((_data$waterConnection30 = data.waterConnection) === null || _data$waterConnection30 === void 0 ? void 0 : (_data$waterConnection31 = _data$waterConnection30.useDetails) === null || _data$waterConnection31 === void 0 ? void 0 : (_data$waterConnection32 = _data$waterConnection31.WaterConnectionUsageType) === null || _data$waterConnection32 === void 0 ? void 0 : _data$waterConnection32.code) || ((_data$useDetails12 = data.useDetails) === null || _data$useDetails12 === void 0 ? void 0 : (_data$useDetails12$Wa = _data$useDetails12.WaterConnectionUsageType) === null || _data$useDetails12$Wa === void 0 ? void 0 : _data$useDetails12$Wa.code),
6187
+ yearOfConstruction: ((_data$waterConnection33 = data.waterConnection) === null || _data$waterConnection33 === void 0 ? void 0 : (_data$waterConnection34 = _data$waterConnection33.useDetails) === null || _data$waterConnection34 === void 0 ? void 0 : (_data$waterConnection35 = _data$waterConnection34.SelectYearofConstruction) === null || _data$waterConnection35 === void 0 ? void 0 : _data$waterConnection35.value) || ((_data$useDetails13 = data.useDetails) === null || _data$useDetails13 === void 0 ? void 0 : (_data$useDetails13$Se = _data$useDetails13.SelectYearofConstruction) === null || _data$useDetails13$Se === void 0 ? void 0 : _data$useDetails13$Se.value),
6188
+ numberOfDwellingUnits: ((_data$waterConnection36 = data.waterConnection) === null || _data$waterConnection36 === void 0 ? void 0 : (_data$waterConnection37 = _data$waterConnection36.useDetails) === null || _data$waterConnection37 === void 0 ? void 0 : _data$waterConnection37.NumberofDwellingUnits) || ((_data$useDetails14 = data.useDetails) === null || _data$useDetails14 === void 0 ? void 0 : _data$useDetails14.NumberofDwellingUnits),
6189
+ numberOfRooms: ((_data$waterConnection38 = data.waterConnection) === null || _data$waterConnection38 === void 0 ? void 0 : (_data$waterConnection39 = _data$waterConnection38.useDetails) === null || _data$waterConnection39 === void 0 ? void 0 : _data$waterConnection39.NumberofRooms) || ((_data$useDetails15 = data.useDetails) === null || _data$useDetails15 === void 0 ? void 0 : _data$useDetails15.NumberofRooms),
6190
+ numberOfFloors: ((_data$waterConnection40 = data.waterConnection) === null || _data$waterConnection40 === void 0 ? void 0 : (_data$waterConnection41 = _data$waterConnection40.useDetails) === null || _data$waterConnection41 === void 0 ? void 0 : (_data$waterConnection42 = _data$waterConnection41.noOfFloors) === null || _data$waterConnection42 === void 0 ? void 0 : _data$waterConnection42.code) || ((_data$useDetails16 = data.useDetails) === null || _data$useDetails16 === void 0 ? void 0 : (_data$useDetails16$no = _data$useDetails16.noOfFloors) === null || _data$useDetails16$no === void 0 ? void 0 : _data$useDetails16$no.code) || 1,
6191
+ plotArea: ((_data$waterConnection43 = data.waterConnection) === null || _data$waterConnection43 === void 0 ? void 0 : (_data$waterConnection44 = _data$waterConnection43.useDetails) === null || _data$waterConnection44 === void 0 ? void 0 : _data$waterConnection44.plotArea) || ((_data$useDetails17 = data.useDetails) === null || _data$useDetails17 === void 0 ? void 0 : _data$useDetails17.plotArea),
6192
+ builtUpArea: ((_data$waterConnection45 = data.waterConnection) === null || _data$waterConnection45 === void 0 ? void 0 : (_data$waterConnection46 = _data$waterConnection45.useDetails) === null || _data$waterConnection46 === void 0 ? void 0 : _data$waterConnection46.builtUpArea) || ((_data$useDetails18 = data.useDetails) === null || _data$useDetails18 === void 0 ? void 0 : _data$useDetails18.builtUpArea),
6193
+ farArea: ((_data$waterConnection47 = data.waterConnection) === null || _data$waterConnection47 === void 0 ? void 0 : (_data$waterConnection48 = _data$waterConnection47.useDetails) === null || _data$waterConnection48 === void 0 ? void 0 : _data$waterConnection48.farArea) || ((_data$useDetails19 = data.useDetails) === null || _data$useDetails19 === void 0 ? void 0 : _data$useDetails19.farArea),
6194
+ numberOfServantQuarters: ((_data$waterConnection49 = data.waterConnection) === null || _data$waterConnection49 === void 0 ? void 0 : (_data$waterConnection50 = _data$waterConnection49.useDetails) === null || _data$waterConnection50 === void 0 ? void 0 : _data$waterConnection50.servantQuarterArea) || ((_data$useDetails20 = data.useDetails) === null || _data$useDetails20 === void 0 ? void 0 : _data$useDetails20.servantQuarterArea),
6195
+ numberOfStudents: ((_data$waterConnection51 = data.waterConnection) === null || _data$waterConnection51 === void 0 ? void 0 : (_data$waterConnection52 = _data$waterConnection51.useDetails) === null || _data$waterConnection52 === void 0 ? void 0 : _data$waterConnection52.numberOfStudents) || ((_data$useDetails21 = data.useDetails) === null || _data$useDetails21 === void 0 ? void 0 : _data$useDetails21.numberOfStudents),
6196
+ numberOfBeds: ((_data$waterConnection53 = data.waterConnection) === null || _data$waterConnection53 === void 0 ? void 0 : (_data$waterConnection54 = _data$waterConnection53.useDetails) === null || _data$waterConnection54 === void 0 ? void 0 : _data$waterConnection54.numberOfBeds) || ((_data$useDetails22 = data.useDetails) === null || _data$useDetails22 === void 0 ? void 0 : _data$useDetails22.numberOfBeds),
6194
6197
  owners: [...data.owners.map((owner, index) => {
6195
6198
  var _owner$gender6, _owner$ownerType4, _owner$relationship4, _owner$inistitutetype4;
6196
6199
  return _extends({}, owner, {
@@ -15834,8 +15837,10 @@ const InfoDetails = _ref2 => {
15834
15837
  };
15835
15838
 
15836
15839
  const ViewBreakup = _ref => {
15837
- var _wsAdditionalDetails$, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6;
15838
- let wsAdditionalDetails = _ref.wsAdditionalDetails;
15840
+ var _breakUpData$calculat, _breakUpData$calculat2, _breakUpData$calculat3, _wsAdditionalDetails$8, _breakUpData$billSlab4, _breakUpData$billSlab5, _breakUpData$billSlab6, _breakUpData$billSlab7, _breakUpData$billSlab8, _breakUpData$billSlab9;
15841
+ let wsAdditionalDetails = _ref.wsAdditionalDetails,
15842
+ print = _ref.print,
15843
+ download = _ref.download;
15839
15844
  const _useTranslation = reactI18next.useTranslation(),
15840
15845
  t = _useTranslation.t;
15841
15846
  const _useState = React.useState(false),
@@ -15844,6 +15849,44 @@ const ViewBreakup = _ref => {
15844
15849
  const _useState2 = React.useState({}),
15845
15850
  breakUpData = _useState2[0],
15846
15851
  setBreakUpData = _useState2[1];
15852
+ const breakupRef = React.useRef(null);
15853
+ const formatNumber = function (value, maximumFractionDigits) {
15854
+ if (maximumFractionDigits === void 0) {
15855
+ maximumFractionDigits = 2;
15856
+ }
15857
+ return Number(value || 0).toLocaleString("en-IN", {
15858
+ maximumFractionDigits
15859
+ });
15860
+ };
15861
+ const formatCurrency = value => /*#__PURE__*/React__default.createElement("span", null, "\u20B9", formatNumber(value));
15862
+ const DetailRows = _ref2 => {
15863
+ let rows = _ref2.rows;
15864
+ return rows.map(_ref3 => {
15865
+ let label = _ref3.label,
15866
+ value = _ref3.value,
15867
+ _ref3$currency = _ref3.currency,
15868
+ currency = _ref3$currency === void 0 ? false : _ref3$currency,
15869
+ _ref3$unit = _ref3.unit,
15870
+ unit = _ref3$unit === void 0 ? "" : _ref3$unit,
15871
+ _ref3$isText = _ref3.isText,
15872
+ isText = _ref3$isText === void 0 ? false : _ref3$isText;
15873
+ return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
15874
+ className: "border-none",
15875
+ rowContainerStyle: {
15876
+ margin: "0px"
15877
+ },
15878
+ labelStyle: {
15879
+ width: "50%"
15880
+ },
15881
+ key: label,
15882
+ label: label,
15883
+ text: currency ? formatCurrency(value) : isText ? value || "-" : "" + formatNumber(value) + unit,
15884
+ textStyle: {
15885
+ textAlign: "right"
15886
+ }
15887
+ });
15888
+ });
15889
+ };
15847
15890
  const Heading = props => {
15848
15891
  return /*#__PURE__*/React__default.createElement("h1", {
15849
15892
  className: "heading-m"
@@ -15866,21 +15909,244 @@ const ViewBreakup = _ref => {
15866
15909
  }, /*#__PURE__*/React__default.createElement(Close, null));
15867
15910
  };
15868
15911
  const onPopupOpen = () => {
15869
- var _sessionBillFormData$;
15870
- let breakupData = wsAdditionalDetails.additionalDetails.data || {};
15912
+ var _wsAdditionalDetails$, _sessionBillFormData$;
15913
+ let breakupData = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$ = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$ === void 0 ? void 0 : _wsAdditionalDetails$.data) || {};
15871
15914
  const sessionBillData = sessionStorage.getItem("Digit.ADHOC_BILL_ADD_REBATE_DATA");
15872
15915
  const sessionBillFormData = sessionBillData ? JSON.parse(sessionBillData) : {};
15873
15916
  if (sessionBillFormData !== null && sessionBillFormData !== void 0 && (_sessionBillFormData$ = sessionBillFormData.value) !== null && _sessionBillFormData$ !== void 0 && _sessionBillFormData$.totalAmount) breakupData = sessionBillFormData === null || sessionBillFormData === void 0 ? void 0 : sessionBillFormData.value;
15874
15917
  setBreakUpData(breakupData);
15875
15918
  showPopUp(true);
15876
15919
  };
15920
+ const getBreakupReportDetails = () => {
15921
+ var _wsAdditionalDetails$2, _wsAdditionalDetails$3, _wsAdditionalDetails$4, _wsAdditionalDetails$5, _wsAdditionalDetails$6, _wsAdditionalDetails$7, _breakUpData$billSlab, _breakUpData$billSlab2, _breakUpData$billSlab3;
15922
+ const amountRows = function (rows) {
15923
+ if (rows === void 0) {
15924
+ rows = [];
15925
+ }
15926
+ return rows.map(row => ({
15927
+ title: t(row === null || row === void 0 ? void 0 : row.taxHeadCode),
15928
+ value: "\u20B9" + formatNumber(row === null || row === void 0 ? void 0 : row.amount)
15929
+ }));
15930
+ };
15931
+ const connectionHolder = wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$2 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$2 === void 0 ? void 0 : (_wsAdditionalDetails$3 = _wsAdditionalDetails$2.appDetails) === null || _wsAdditionalDetails$3 === void 0 ? void 0 : (_wsAdditionalDetails$4 = _wsAdditionalDetails$3.connectionHolders) === null || _wsAdditionalDetails$4 === void 0 ? void 0 : _wsAdditionalDetails$4[0];
15932
+ const applicantName = [connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.name, connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.middleName, connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.lastName].filter(Boolean).join(" ") || "-";
15933
+ const mobileNumber = (connectionHolder === null || connectionHolder === void 0 ? void 0 : connectionHolder.mobileNumber) || "-";
15934
+ const appNumber = (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$5 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$5 === void 0 ? void 0 : (_wsAdditionalDetails$6 = _wsAdditionalDetails$5.data) === null || _wsAdditionalDetails$6 === void 0 ? void 0 : _wsAdditionalDetails$6.applicationNo) || (wsAdditionalDetails === null || wsAdditionalDetails === void 0 ? void 0 : (_wsAdditionalDetails$7 = wsAdditionalDetails.additionalDetails) === null || _wsAdditionalDetails$7 === void 0 ? void 0 : _wsAdditionalDetails$7.applicationNumber) || "-";
15935
+ return [{
15936
+ title: "Applicant Details",
15937
+ values: [{
15938
+ title: "Application Number",
15939
+ value: appNumber
15940
+ }, {
15941
+ title: "Applicant Name",
15942
+ value: applicantName
15943
+ }, {
15944
+ title: "Mobile Number",
15945
+ value: mobileNumber
15946
+ }]
15947
+ }, {
15948
+ title: t("WS_APPLICATION_FEE_HEADER"),
15949
+ 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) || [])])
15950
+ }, {
15951
+ title: "Property details",
15952
+ values: propertyRows.map(_ref4 => {
15953
+ let label = _ref4.label,
15954
+ value = _ref4.value,
15955
+ currency = _ref4.currency,
15956
+ unit = _ref4.unit,
15957
+ isText = _ref4.isText;
15958
+ return {
15959
+ title: label,
15960
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
15961
+ };
15962
+ })
15963
+ }, {
15964
+ title: "Taxes",
15965
+ values: amountRows(breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : _breakUpData$billSlab3.TAX)
15966
+ }, {
15967
+ title: "Water demand details",
15968
+ values: waterDemandRows.map(_ref5 => {
15969
+ let label = _ref5.label,
15970
+ value = _ref5.value,
15971
+ currency = _ref5.currency,
15972
+ unit = _ref5.unit,
15973
+ isText = _ref5.isText;
15974
+ return {
15975
+ title: label,
15976
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
15977
+ };
15978
+ })
15979
+ }, {
15980
+ title: "Infrastructure charge details",
15981
+ values: infrastructureChargeRows.map(_ref6 => {
15982
+ let label = _ref6.label,
15983
+ value = _ref6.value,
15984
+ currency = _ref6.currency,
15985
+ unit = _ref6.unit,
15986
+ isText = _ref6.isText;
15987
+ return {
15988
+ title: label,
15989
+ value: currency ? "\u20B9" + formatNumber(value) : isText ? value || "-" : "" + formatNumber(value) + unit
15990
+ };
15991
+ })
15992
+ }, {
15993
+ title: "Total",
15994
+ values: [{
15995
+ title: t("PDF_STATIC_LABEL_CONSOLIDATED_TLAPP_TOTAL_AMOUNT"),
15996
+ value: "\u20B9" + formatNumber(breakUpData === null || breakUpData === void 0 ? void 0 : breakUpData.totalAmount)
15997
+ }]
15998
+ }].filter(section => section.values.length > 0);
15999
+ };
16000
+ const generateBreakupReport = mode => {
16001
+ var _Digit$Utils, _Digit$Utils$pdf;
16002
+ const generateReport = (_Digit$Utils = Digit.Utils) === null || _Digit$Utils === void 0 ? void 0 : (_Digit$Utils$pdf = _Digit$Utils.pdf) === null || _Digit$Utils$pdf === void 0 ? void 0 : _Digit$Utils$pdf.generateCalculationBreakupReport;
16003
+ if (typeof generateReport === "function") {
16004
+ return generateReport({
16005
+ tenantId: Digit.ULBService.getCurrentTenantId(),
16006
+ heading: t("WS_CALCULATION_BREAKUP"),
16007
+ details: getBreakupReportDetails(),
16008
+ t,
16009
+ mode
16010
+ });
16011
+ }
16012
+ return mode === "download" ? Digit.Download.PDF(breakupRef, t("WS_CALCULATION_BREAKUP")) : null;
16013
+ };
16014
+ const handleDownload = () => generateBreakupReport("download");
16015
+ const handlePrint = () => {
16016
+ var _Digit$Utils2, _Digit$Utils2$pdf, _breakupRef$current, _window$mSewaApp, _window$mSewaApp$isMs;
16017
+ if ((_Digit$Utils2 = Digit.Utils) !== null && _Digit$Utils2 !== void 0 && (_Digit$Utils2$pdf = _Digit$Utils2.pdf) !== null && _Digit$Utils2$pdf !== void 0 && _Digit$Utils2$pdf.generateCalculationBreakupReport) {
16018
+ return generateBreakupReport("print");
16019
+ }
16020
+ const content = (_breakupRef$current = breakupRef.current) === null || _breakupRef$current === void 0 ? void 0 : _breakupRef$current.innerHTML;
16021
+ if (!content) return;
16022
+ if ((_window$mSewaApp = window.mSewaApp) !== null && _window$mSewaApp !== void 0 && (_window$mSewaApp$isMs = _window$mSewaApp.isMsewaApp) !== null && _window$mSewaApp$isMs !== void 0 && _window$mSewaApp$isMs.call(_window$mSewaApp)) {
16023
+ window.mSewaApp.downloadBase64File(window.btoa(unescape(encodeURIComponent(content))), t("WS_CALCULATION_BREAKUP"));
16024
+ return;
16025
+ }
16026
+ const printWindow = window.open("", "");
16027
+ if (!printWindow) return;
16028
+ printWindow.document.write("<html><body>" + content + "</body></html>");
16029
+ printWindow.document.close();
16030
+ printWindow.focus();
16031
+ printWindow.print();
16032
+ };
16033
+ const propertyDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat = breakUpData.calculationDetail) === null || _breakUpData$calculat === void 0 ? void 0 : _breakUpData$calculat.propertyDetail;
16034
+ const waterDemandDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat2 = breakUpData.calculationDetail) === null || _breakUpData$calculat2 === void 0 ? void 0 : _breakUpData$calculat2.waterDemandDetail;
16035
+ const infrastructureChargeDetail = breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$calculat3 = breakUpData.calculationDetail) === null || _breakUpData$calculat3 === void 0 ? void 0 : _breakUpData$calculat3.infrastructureChargeDetail;
16036
+ const propertyRows = propertyDetail ? [{
16037
+ label: "Property ID",
16038
+ value: propertyDetail.propertyId,
16039
+ isText: true
16040
+ }, {
16041
+ label: "Property type",
16042
+ value: propertyDetail.propertyType,
16043
+ isText: true
16044
+ }, {
16045
+ label: "Plot area",
16046
+ value: propertyDetail.landArea,
16047
+ unit: " (sq. meter.)"
16048
+ }, {
16049
+ label: "Built-up area",
16050
+ value: propertyDetail.superBuiltUpArea,
16051
+ unit: " (sq. meter.)"
16052
+ }, {
16053
+ label: "farArea",
16054
+ value: propertyDetail.farArea,
16055
+ isText: true
16056
+ }, {
16057
+ label: "coveredArea",
16058
+ value: propertyDetail.coveredArea,
16059
+ isText: true
16060
+ }, {
16061
+ label: "numberOfDwellingUnits",
16062
+ value: propertyDetail.numberOfDwellingUnits,
16063
+ isText: true
16064
+ }, {
16065
+ label: "numberOfBeds",
16066
+ value: propertyDetail.numberOfBeds,
16067
+ isText: true
16068
+ }, {
16069
+ label: "numberOfRooms",
16070
+ value: propertyDetail.numberOfRooms,
16071
+ isText: true
16072
+ }, {
16073
+ label: "numberOfStudents",
16074
+ value: propertyDetail.numberOfStudents,
16075
+ isText: true
16076
+ }, {
16077
+ label: "numberOfStaff",
16078
+ value: propertyDetail.numberOfStaff,
16079
+ isText: true
16080
+ }, {
16081
+ label: "Usage category",
16082
+ value: propertyDetail.usageCategory,
16083
+ isText: true
16084
+ }] : [];
16085
+ const waterDemandRows = waterDemandDetail ? [{
16086
+ label: "Calculated occupancy",
16087
+ value: waterDemandDetail.calculatedOccupancy,
16088
+ unit: " person"
16089
+ }, {
16090
+ label: "Applied LPCD",
16091
+ value: waterDemandDetail.chosenLpcd,
16092
+ unit: " LPD"
16093
+ }, {
16094
+ label: "Base demand",
16095
+ value: waterDemandDetail.baseDemand,
16096
+ unit: " LPD"
16097
+ }, {
16098
+ label: "Contingency/Floating Occupancy",
16099
+ value: waterDemandDetail.contingencyPercentage,
16100
+ unit: "%"
16101
+ }, {
16102
+ label: "Total water demand",
16103
+ value: waterDemandDetail.totalWaterDemandLPD,
16104
+ unit: " LPD"
16105
+ }] : [];
16106
+ const infrastructureChargeRows = infrastructureChargeDetail ? [{
16107
+ label: "Colony category",
16108
+ value: infrastructureChargeDetail.colonyCategory,
16109
+ isText: true
16110
+ }, {
16111
+ label: "Plot area",
16112
+ value: infrastructureChargeDetail.plotArea,
16113
+ unit: " (sq. meter.)"
16114
+ }, {
16115
+ label: "Water rate",
16116
+ value: infrastructureChargeDetail.waterRatePerLPD,
16117
+ currency: true
16118
+ }, {
16119
+ label: "Sewer rate",
16120
+ value: infrastructureChargeDetail.sewerRatePerLPD,
16121
+ currency: true
16122
+ }, {
16123
+ label: "Water Infra Charges",
16124
+ value: infrastructureChargeDetail.waterComponentIFC,
16125
+ currency: true
16126
+ }, {
16127
+ label: "Sewer Infra Charges",
16128
+ value: infrastructureChargeDetail.sewerComponentIFC,
16129
+ currency: true
16130
+ }, {
16131
+ label: "Rebate",
16132
+ value: infrastructureChargeDetail.rebatePercentage,
16133
+ unit: "%"
16134
+ }, {
16135
+ label: "Rebate amount",
16136
+ value: infrastructureChargeDetail.rebateAmount,
16137
+ currency: true
16138
+ }, {
16139
+ label: "Net IFC",
16140
+ value: infrastructureChargeDetail.netIFC,
16141
+ currency: true
16142
+ }] : [];
15877
16143
  return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
15878
16144
  style: {
15879
16145
  lineHeight: "19px",
15880
16146
  maxWidth: "950px",
15881
16147
  minWidth: "280px"
15882
16148
  }
15883
- }, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$ = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$ !== void 0 && _wsAdditionalDetails$.isViewBreakup ? /*#__PURE__*/React__default.createElement("div", {
16149
+ }, wsAdditionalDetails !== null && wsAdditionalDetails !== void 0 && (_wsAdditionalDetails$8 = wsAdditionalDetails.additionalDetails) !== null && _wsAdditionalDetails$8 !== void 0 && _wsAdditionalDetails$8.isViewBreakup ? /*#__PURE__*/React__default.createElement("div", {
15884
16150
  onClick: e => onPopupOpen(),
15885
16151
  style: {
15886
16152
  marginTop: "12px"
@@ -15891,6 +16157,9 @@ const ViewBreakup = _ref => {
15891
16157
  headerBarMain: /*#__PURE__*/React__default.createElement(Heading, {
15892
16158
  label: t("WS_CALCULATION_BREAKUP")
15893
16159
  }),
16160
+ width: "950px",
16161
+ print: print || handlePrint,
16162
+ download: download || handleDownload,
15894
16163
  headerBarEnd: /*#__PURE__*/React__default.createElement(CloseBtn, {
15895
16164
  onClick: () => {
15896
16165
  showPopUp(false);
@@ -15906,16 +16175,13 @@ const ViewBreakup = _ref => {
15906
16175
  popupModuleMianStyles: {
15907
16176
  paddingTop: "0px"
15908
16177
  }
15909
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, {
15910
- style: {
15911
- padding: "10px",
15912
- paddingTop: "0px"
15913
- }
15914
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
16178
+ }, /*#__PURE__*/React__default.createElement("div", {
16179
+ ref: breakupRef
16180
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
15915
16181
  style: {
15916
16182
  margin: "10px 0px"
15917
16183
  }
15918
- }, t("WS_APPLICATION_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab = breakUpData.billSlabData) === null || _breakUpData$billSlab === void 0 ? void 0 : (_breakUpData$billSlab2 = _breakUpData$billSlab.FEE) === null || _breakUpData$billSlab2 === void 0 ? void 0 : _breakUpData$billSlab2.map(data => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
16184
+ }, t("WS_APPLICATION_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab4 = breakUpData.billSlabData) === null || _breakUpData$billSlab4 === void 0 ? void 0 : (_breakUpData$billSlab5 = _breakUpData$billSlab4.FEE) === null || _breakUpData$billSlab5 === void 0 ? void 0 : _breakUpData$billSlab5.map(data => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
15919
16185
  className: "border-none",
15920
16186
  rowContainerStyle: {
15921
16187
  margin: "0px"
@@ -15929,11 +16195,7 @@ const ViewBreakup = _ref => {
15929
16195
  textStyle: {
15930
16196
  textAlign: "right"
15931
16197
  }
15932
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
15933
- style: {
15934
- margin: "10px 0px"
15935
- }
15936
- }, t("WS_SERVICE_FEE_HEADER")), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab3 = breakUpData.billSlabData) === null || _breakUpData$billSlab3 === void 0 ? void 0 : (_breakUpData$billSlab4 = _breakUpData$billSlab3.CHARGES) === null || _breakUpData$billSlab4 === void 0 ? void 0 : _breakUpData$billSlab4.map(data => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
16198
+ })), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab6 = breakUpData.billSlabData) === null || _breakUpData$billSlab6 === void 0 ? void 0 : (_breakUpData$billSlab7 = _breakUpData$billSlab6.CHARGES) === null || _breakUpData$billSlab7 === void 0 ? void 0 : _breakUpData$billSlab7.map(data => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
15937
16199
  className: "border-none",
15938
16200
  rowContainerStyle: {
15939
16201
  margin: "0px"
@@ -15947,7 +16209,7 @@ const ViewBreakup = _ref => {
15947
16209
  textStyle: {
15948
16210
  textAlign: "right"
15949
16211
  }
15950
- })), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab5 = breakUpData.billSlabData) === null || _breakUpData$billSlab5 === void 0 ? void 0 : (_breakUpData$billSlab6 = _breakUpData$billSlab5.TAX) === null || _breakUpData$billSlab6 === void 0 ? void 0 : _breakUpData$billSlab6.map(data => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
16212
+ })), breakUpData === null || breakUpData === void 0 ? void 0 : (_breakUpData$billSlab8 = breakUpData.billSlabData) === null || _breakUpData$billSlab8 === void 0 ? void 0 : (_breakUpData$billSlab9 = _breakUpData$billSlab8.TAX) === null || _breakUpData$billSlab9 === void 0 ? void 0 : _breakUpData$billSlab9.map(data => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
15951
16213
  className: "border-none",
15952
16214
  rowContainerStyle: {
15953
16215
  margin: "0px"
@@ -15961,6 +16223,24 @@ const ViewBreakup = _ref => {
15961
16223
  textStyle: {
15962
16224
  textAlign: "right"
15963
16225
  }
16226
+ })), propertyRows.length > 0 && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
16227
+ style: {
16228
+ margin: "10px 0px"
16229
+ }
16230
+ }, "Property details"), /*#__PURE__*/React__default.createElement(DetailRows, {
16231
+ rows: propertyRows
16232
+ })), waterDemandRows.length > 0 && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
16233
+ style: {
16234
+ margin: "10px 0px"
16235
+ }
16236
+ }, "Water demand details"), /*#__PURE__*/React__default.createElement(DetailRows, {
16237
+ rows: waterDemandRows
16238
+ })), infrastructureChargeRows.length > 0 && /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
16239
+ style: {
16240
+ margin: "10px 0px"
16241
+ }
16242
+ }, "Infrastructure charge details"), /*#__PURE__*/React__default.createElement(DetailRows, {
16243
+ rows: infrastructureChargeRows
15964
16244
  })), /*#__PURE__*/React__default.createElement("hr", {
15965
16245
  style: {
15966
16246
  color: "#cccccc",
@@ -15983,7 +16263,7 @@ const ViewBreakup = _ref => {
15983
16263
  fontWeight: "700",
15984
16264
  fontSize: "24px"
15985
16265
  }
15986
- })))));
16266
+ }))))));
15987
16267
  };
15988
16268
 
15989
16269
  const styles = {
@@ -18959,7 +19239,7 @@ const _excluded$4 = ["t", "config", "onSelect", "formData", "formState", "setErr
18959
19239
  const NUMBER_PATTERN = /^\d+$/;
18960
19240
  const DECIMAL_PATTERN = /^\d+(\.\d{1,2})?$/;
18961
19241
  const PropertyWaterConnection = _ref => {
18962
- 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;
19242
+ 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;
18963
19243
  let t = _ref.t,
18964
19244
  config = _ref.config,
18965
19245
  onSelect = _ref.onSelect,
@@ -18981,7 +19261,8 @@ const PropertyWaterConnection = _ref => {
18981
19261
  NumberofDwellingUnits: "",
18982
19262
  NumberofRooms: "",
18983
19263
  numberOfBeds: "",
18984
- numberOfStudents: ""
19264
+ numberOfStudents: "",
19265
+ servantQuarterArea: ""
18985
19266
  }
18986
19267
  }
18987
19268
  }),
@@ -18991,7 +19272,7 @@ const PropertyWaterConnection = _ref => {
18991
19272
  watch = _useForm.watch,
18992
19273
  setValue = _useForm.setValue;
18993
19274
  const tenantId = Digit.ULBService.getCurrentTenantId();
18994
- const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["PropertyCategory", "PropertyType", "NoOfFloors", "PropertyNewUsageType"]),
19275
+ const _Digit$Hooks$pt$usePr = Digit.Hooks.pt.usePropertyMDMS(tenantId, "PropertyTax", ["PropertyCategory", "PropertyType", "NoOfFloors", "PropertyNewUsageType", "PropertyToUsageMapping"]),
18995
19276
  ptServicesMastersData = _Digit$Hooks$pt$usePr.data;
18996
19277
  const _Digit$Hooks$ws$useMD = Digit.Hooks.ws.useMDMS(tenantId, "ws-services-masters", ["WsCategoryType"]),
18997
19278
  wsServicesMastersData = _Digit$Hooks$ws$useMD.data;
@@ -19017,9 +19298,11 @@ const PropertyWaterConnection = _ref => {
19017
19298
  const watchPropertyType = watch("useDetails.propertyType");
19018
19299
  const watchPropertyCategory = watch("useDetails.propertyCategory");
19019
19300
  const watchWaterConnectionUsageType = watch("useDetails.WaterConnectionUsageType");
19020
- const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
19301
+ const isHospitalProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOSPITAL_NURSING_HOME" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "DharamshalasOrHostels" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HospitalNursingHome";
19021
19302
  const isHotelRestaurantProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HOTEL_OR_RESTAURANT" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "HotelOrRestaurant";
19022
19303
  const isSchoolCollegeProperty = (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "School" || (watchPropertyType === null || watchPropertyType === void 0 ? void 0 : watchPropertyType.code) === "College";
19304
+ const isDwellingUnit = (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL" || (watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : watchPropertyCategory.code) === "RESIDENTIAL";
19305
+ 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";
19023
19306
  const yearOptions = React.useMemo(() => {
19024
19307
  const currentYear = new Date().getFullYear();
19025
19308
  const years = [];
@@ -19033,10 +19316,9 @@ const PropertyWaterConnection = _ref => {
19033
19316
  }, []);
19034
19317
  const categoryOptions = React.useMemo(() => {
19035
19318
  var _ptServicesMastersDat, _ptServicesMastersDat2;
19319
+ if (!(watchCategoryType !== null && watchCategoryType !== void 0 && watchCategoryType.code)) return [];
19036
19320
  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)) || [];
19037
- if (watchCategoryType !== null && watchCategoryType !== void 0 && watchCategoryType.code) {
19038
- options = options.filter(item => item.type === watchCategoryType.code);
19039
- }
19321
+ options = options.filter(item => item.type === watchCategoryType.code);
19040
19322
  return options.map(item => ({
19041
19323
  code: item.code,
19042
19324
  name: item.name
@@ -19051,16 +19333,18 @@ const PropertyWaterConnection = _ref => {
19051
19333
  }
19052
19334
  }, [watchCategoryType, categoryOptions, setValue, watchPropertyCategory]);
19053
19335
  const propertyTypeOptions = React.useMemo(() => {
19054
- var _ptServicesMastersDat3, _ptServicesMastersDat4;
19336
+ var _ptServicesMastersDat3, _ptServicesMastersDat4, _ptServicesMastersDat5, _watchPropertyCategor;
19337
+ if (!(watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code)) return [];
19055
19338
  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)) || [];
19056
- if (watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code) {
19057
- var _watchPropertyCategor;
19058
- if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor = watchPropertyCategory.code) === null || _watchPropertyCategor === void 0 ? void 0 : _watchPropertyCategor.toUpperCase()) !== "MIXED") {
19059
- options = options.filter(item => {
19060
- var _item$type, _watchPropertyCategor2;
19061
- 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());
19062
- });
19063
- }
19339
+ let mapping = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat5 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat5 === void 0 ? void 0 : _ptServicesMastersDat5.PropertyToUsageMapping) || [];
19340
+ if (mapping.length > 0) {
19341
+ options = options.filter(item => mapping.some(m => m.propertyTypeCode === item.code));
19342
+ }
19343
+ if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor = watchPropertyCategory.code) === null || _watchPropertyCategor === void 0 ? void 0 : _watchPropertyCategor.toUpperCase()) !== "MIXED") {
19344
+ options = options.filter(item => {
19345
+ var _item$type, _watchPropertyCategor2;
19346
+ 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());
19347
+ });
19064
19348
  }
19065
19349
  return options.map(item => ({
19066
19350
  code: item.code,
@@ -19076,22 +19360,21 @@ const PropertyWaterConnection = _ref => {
19076
19360
  }
19077
19361
  }, [watchPropertyCategory, propertyTypeOptions, setValue, watchPropertyType]);
19078
19362
  const usageTypeOptions = React.useMemo(() => {
19079
- var _ptServicesMastersDat5, _ptServicesMastersDat6;
19080
- 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)) || [];
19081
- if (watchPropertyCategory !== null && watchPropertyCategory !== void 0 && watchPropertyCategory.code) {
19082
- var _watchPropertyCategor3;
19083
- if ((watchPropertyCategory === null || watchPropertyCategory === void 0 ? void 0 : (_watchPropertyCategor3 = watchPropertyCategory.code) === null || _watchPropertyCategor3 === void 0 ? void 0 : _watchPropertyCategor3.toUpperCase()) !== "MIXED") {
19084
- options = options.filter(item => {
19085
- var _item$type2, _watchPropertyCategor4;
19086
- 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());
19087
- });
19088
- }
19363
+ var _ptServicesMastersDat6, _ptServicesMastersDat7, _ptServicesMastersDat8;
19364
+ if (!(watchPropertyType !== null && watchPropertyType !== void 0 && watchPropertyType.code)) return [];
19365
+ let options = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat6 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat6 === void 0 ? void 0 : (_ptServicesMastersDat7 = _ptServicesMastersDat6.PropertyNewUsageType) === null || _ptServicesMastersDat7 === void 0 ? void 0 : _ptServicesMastersDat7.filter(item => item.active)) || [];
19366
+ let mapping = (ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat8 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat8 === void 0 ? void 0 : _ptServicesMastersDat8.PropertyToUsageMapping) || [];
19367
+ const selectedMapping = mapping.find(m => m.propertyTypeCode === watchPropertyType.code);
19368
+ if (selectedMapping && selectedMapping.allowedUsages) {
19369
+ options = options.filter(item => selectedMapping.allowedUsages.includes(item.code));
19370
+ } else {
19371
+ options = [];
19089
19372
  }
19090
19373
  return options.map(item => ({
19091
19374
  code: item.code,
19092
19375
  name: item.name
19093
19376
  }));
19094
- }, [ptServicesMastersData, watchPropertyCategory]);
19377
+ }, [ptServicesMastersData, watchPropertyCategory, watchPropertyType]);
19095
19378
  React.useEffect(() => {
19096
19379
  if (watchPropertyType && watchWaterConnectionUsageType) {
19097
19380
  const isUsageTypeValid = usageTypeOptions.some(opt => opt.code === watchWaterConnectionUsageType.code);
@@ -19101,8 +19384,8 @@ const PropertyWaterConnection = _ref => {
19101
19384
  }
19102
19385
  }, [watchPropertyType, usageTypeOptions, setValue, watchWaterConnectionUsageType]);
19103
19386
  const floorOptions = React.useMemo(() => {
19104
- var _ptServicesMastersDat7, _ptServicesMastersDat8;
19105
- return ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat7 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat7 === void 0 ? void 0 : (_ptServicesMastersDat8 = _ptServicesMastersDat7.NoOfFloors) === null || _ptServicesMastersDat8 === void 0 ? void 0 : _ptServicesMastersDat8.filter(item => item.active).map(item => ({
19387
+ var _ptServicesMastersDat9, _ptServicesMastersDat0;
19388
+ return ptServicesMastersData === null || ptServicesMastersData === void 0 ? void 0 : (_ptServicesMastersDat9 = ptServicesMastersData.PropertyTax) === null || _ptServicesMastersDat9 === void 0 ? void 0 : (_ptServicesMastersDat0 = _ptServicesMastersDat9.NoOfFloors) === null || _ptServicesMastersDat0 === void 0 ? void 0 : _ptServicesMastersDat0.filter(item => item.active).map(item => ({
19106
19389
  code: item.code,
19107
19390
  name: item.name
19108
19391
  }));
@@ -19151,6 +19434,7 @@ const PropertyWaterConnection = _ref => {
19151
19434
  setValue("useDetails.NumberofRooms", "");
19152
19435
  setValue("useDetails.numberOfBeds", "");
19153
19436
  setValue("useDetails.numberOfStudents", "");
19437
+ setValue("useDetails.servantQuarterArea", "");
19154
19438
  }
19155
19439
  }, [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, floorOptions, yearOptions, categoryTypeList, setValue]);
19156
19440
  const lastErrorState = React__default.useRef(null);
@@ -19333,7 +19617,7 @@ const PropertyWaterConnection = _ref => {
19333
19617
  })
19334
19618
  }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails9 = errors.useDetails) === null || _errors$useDetails9 === void 0 ? void 0 : _errors$useDetails9.SelectYearofConstruction) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
19335
19619
  style: errorStyle
19336
- }, errors.useDetails.SelectYearofConstruction.message), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React__default.createElement("div", {
19620
+ }, errors.useDetails.SelectYearofConstruction.message), isDwellingUnit ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_NUMBER_OF_DWELLING_UNITS")), /*#__PURE__*/React__default.createElement("div", {
19337
19621
  className: "form-field"
19338
19622
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
19339
19623
  t: t,
@@ -19345,7 +19629,7 @@ const PropertyWaterConnection = _ref => {
19345
19629
  }),
19346
19630
  name: "useDetails.NumberofDwellingUnits",
19347
19631
  disabled: isPropertyFound
19348
- }))), (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofDwellingUnits) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
19632
+ }))) : null, isDwellingUnit && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails0 = errors.useDetails) === null || _errors$useDetails0 === void 0 ? void 0 : _errors$useDetails0.NumberofDwellingUnits) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
19349
19633
  style: errorStyle
19350
19634
  }, errors.useDetails.NumberofDwellingUnits.message), isHotelRestaurantProperty ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, t("WS_NUMBER_OF_ROOMS") + "*"), /*#__PURE__*/React__default.createElement("div", {
19351
19635
  className: "form-field"
@@ -19391,7 +19675,21 @@ const PropertyWaterConnection = _ref => {
19391
19675
  disabled: isPropertyFound
19392
19676
  }))) : null, isSchoolCollegeProperty && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails11 = errors.useDetails) === null || _errors$useDetails11 === void 0 ? void 0 : _errors$useDetails11.numberOfStudents) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
19393
19677
  style: errorStyle
19394
- }, errors.useDetails.numberOfStudents.message)));
19678
+ }, errors.useDetails.numberOfStudents.message), isServentHouse ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("WS_SERVENT_HOUSE")), /*#__PURE__*/React__default.createElement("div", {
19679
+ className: "form-field"
19680
+ }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
19681
+ t: t,
19682
+ inputRef: register({
19683
+ pattern: {
19684
+ value: NUMBER_PATTERN,
19685
+ message: t("ERR_INVALID_NUMBER")
19686
+ }
19687
+ }),
19688
+ name: "useDetails.servantQuarterArea",
19689
+ disabled: isPropertyFound
19690
+ }))) : null, isServentHouse && (errors === null || errors === void 0 ? void 0 : (_errors$useDetails12 = errors.useDetails) === null || _errors$useDetails12 === void 0 ? void 0 : _errors$useDetails12.servantQuarterArea) && /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabelError, {
19691
+ style: errorStyle
19692
+ }, errors.useDetails.servantQuarterArea.message)));
19395
19693
  };
19396
19694
 
19397
19695
  const SwitchComponent = props => {