@mseva/upyog-ui-module-chb 1.1.62 → 1.1.63

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.
@@ -41885,20 +41885,13 @@ const CHBApplicationDetails = () => {
41885
41885
  return /*#__PURE__*/React.createElement(Loader$1, null);
41886
41886
  }
41887
41887
  const getChbAcknowledgement = async () => {
41888
- try {
41889
- setLoading(true);
41890
- const applications = application || {};
41891
- console.log("applications for chbb", applications);
41892
- const tenantInfo = tenants.find(tenant => tenant.code === applications.tenantId);
41893
- const acknowldgementDataAPI = await getChbAcknowledgementData({
41894
- ...applications
41895
- }, tenantInfo, t);
41896
- Digit.Utils.pdf.generate(acknowldgementDataAPI);
41897
- } catch (err) {
41898
- console.error(err);
41899
- } finally {
41900
- setLoading(false);
41901
- }
41888
+ const applications = application || {};
41889
+ console.log('applications for chbb', applications);
41890
+ const tenantInfo = tenants.find(tenant => tenant.code === applications.tenantId);
41891
+ const acknowldgementDataAPI = await getChbAcknowledgementData({
41892
+ ...applications
41893
+ }, tenantInfo, t);
41894
+ Digit.Utils.pdf.generate(acknowldgementDataAPI);
41902
41895
  };
41903
41896
  let documentDate = t("CS_NA");
41904
41897
  if (chb_details !== null && chb_details !== void 0 && (_chb_details$addition = chb_details.additionalDetails) !== null && _chb_details$addition !== void 0 && _chb_details$addition.documentDate) {
@@ -41912,78 +41905,64 @@ const CHBApplicationDetails = () => {
41912
41905
  payments,
41913
41906
  ...params
41914
41907
  }) {
41915
- try {
41916
- var _data$hallsBookingApp;
41917
- setLoading(true);
41918
- let application = data === null || data === void 0 ? void 0 : (_data$hallsBookingApp = data.hallsBookingApplication) === null || _data$hallsBookingApp === void 0 ? void 0 : _data$hallsBookingApp[0];
41919
- let fileStoreId = application === null || application === void 0 ? void 0 : application.paymentReceiptFilestoreId;
41920
- if (!fileStoreId) {
41921
- var _response, _response2;
41922
- let response = {
41923
- filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
41924
- };
41925
- response = await Digit.PaymentService.generatePdf(tenantId, {
41926
- Payments: [{
41927
- ...payments,
41928
- ...application
41929
- }]
41930
- }, "chbservice-receipt");
41931
- const updatedApplication = {
41932
- ...application,
41933
- paymentReceiptFilestoreId: (_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]
41934
- };
41935
- await mutation.mutateAsync({
41936
- hallsBookingApplication: updatedApplication
41937
- });
41938
- fileStoreId = (_response2 = response) === null || _response2 === void 0 ? void 0 : _response2.filestoreIds[0];
41939
- refetch();
41940
- }
41941
- const fileStore = await Digit.PaymentService.printReciept(tenantId, {
41942
- fileStoreIds: fileStoreId
41908
+ var _data$hallsBookingApp;
41909
+ let application = data === null || data === void 0 ? void 0 : (_data$hallsBookingApp = data.hallsBookingApplication) === null || _data$hallsBookingApp === void 0 ? void 0 : _data$hallsBookingApp[0];
41910
+ let fileStoreId = application === null || application === void 0 ? void 0 : application.paymentReceiptFilestoreId;
41911
+ if (!fileStoreId) {
41912
+ var _response, _response2;
41913
+ let response = {
41914
+ filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
41915
+ };
41916
+ response = await Digit.PaymentService.generatePdf(tenantId, {
41917
+ Payments: [{
41918
+ ...payments,
41919
+ ...application
41920
+ }]
41921
+ }, "chbservice-receipt");
41922
+ const updatedApplication = {
41923
+ ...application,
41924
+ paymentReceiptFilestoreId: (_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]
41925
+ };
41926
+ await mutation.mutateAsync({
41927
+ hallsBookingApplication: updatedApplication
41943
41928
  });
41944
- window.open(fileStore[fileStoreId], "_blank");
41945
- } catch (error) {
41946
- console.error("Sanction Letter download error:", error);
41947
- } finally {
41948
- setLoading(false);
41929
+ fileStoreId = (_response2 = response) === null || _response2 === void 0 ? void 0 : _response2.filestoreIds[0];
41930
+ refetch();
41949
41931
  }
41932
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
41933
+ fileStoreIds: fileStoreId
41934
+ });
41935
+ window.open(fileStore[fileStoreId], "_blank");
41950
41936
  }
41951
41937
  async function getPermissionLetter({
41952
41938
  tenantId,
41953
41939
  payments,
41954
41940
  ...params
41955
41941
  }) {
41956
- try {
41957
- setLoading(true);
41958
- let application = {
41959
- hallsBookingApplication: ((data === null || data === void 0 ? void 0 : data.hallsBookingApplication) || []).map(app => {
41960
- return {
41961
- ...app,
41962
- bookingSlotDetails: [...(app.bookingSlotDetails || [])].sort((a, b) => {
41963
- return new Date(a.bookingDate) - new Date(b.bookingDate);
41964
- })
41965
- };
41966
- })
41967
- };
41968
- let fileStoreId = payments === null || payments === void 0 ? void 0 : payments.fileStoreId;
41969
- if (!fileStoreId) {
41970
- const response = await Digit.PaymentService.generatePdf(tenantId, {
41971
- Payments: [{
41972
- ...payments,
41973
- ...application
41974
- }]
41975
- }, "chb-permissionletter");
41976
- fileStoreId = response === null || response === void 0 ? void 0 : response.filestoreIds[0];
41977
- }
41978
- const fileStore = await Digit.PaymentService.printReciept(tenantId, {
41979
- fileStoreIds: fileStoreId
41980
- });
41981
- window.open(fileStore[fileStoreId], "_blank");
41982
- } catch (error) {
41983
- console.error("Sanction Letter download error:", error);
41984
- } finally {
41985
- setLoading(false);
41942
+ let application = {
41943
+ hallsBookingApplication: ((data === null || data === void 0 ? void 0 : data.hallsBookingApplication) || []).map(app => {
41944
+ return {
41945
+ ...app,
41946
+ bookingSlotDetails: [...(app.bookingSlotDetails || [])].sort((a, b) => {
41947
+ return new Date(a.bookingDate) - new Date(b.bookingDate);
41948
+ })
41949
+ };
41950
+ })
41951
+ };
41952
+ let fileStoreId = application === null || application === void 0 ? void 0 : application.permissionLetterFilestoreId;
41953
+ if (!fileStoreId) {
41954
+ const response = await Digit.PaymentService.generatePdf(tenantId, {
41955
+ Payments: [{
41956
+ ...payments,
41957
+ ...application
41958
+ }]
41959
+ }, "chb-permissionletter");
41960
+ fileStoreId = response === null || response === void 0 ? void 0 : response.filestoreIds[0];
41986
41961
  }
41962
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
41963
+ fileStoreIds: fileStoreId
41964
+ });
41965
+ window.open(fileStore[fileStoreId], "_blank");
41987
41966
  }
41988
41967
  let dowloadOptions = [];
41989
41968
  dowloadOptions.push({
@@ -42045,7 +42024,7 @@ const CHBApplicationDetails = () => {
42045
42024
  styles: {
42046
42025
  fontSize: "32px"
42047
42026
  }
42048
- }, t("CHB_BOOKING_DETAILS")), loading && /*#__PURE__*/React.createElement(Loader$1, null), dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
42027
+ }, t("CHB_BOOKING_DETAILS")), dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
42049
42028
  className: "multilinkWrapper",
42050
42029
  onHeadClick: () => setShowOptions(!showOptions),
42051
42030
  displayOptions: showOptions,