You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

670 lines
34 KiB

  1. // material-ui
  2. import {
  3. Grid, Button, Checkbox, FormControlLabel, Typography,
  4. Dialog, DialogTitle, DialogContent, DialogActions,
  5. FormHelperText, TextField,
  6. } from '@mui/material';
  7. // import { FormControlLabel } from '@material-ui/core';
  8. import MainCard from "components/MainCard";
  9. import * as React from "react";
  10. import { useFormik } from 'formik';
  11. import { useForm } from "react-hook-form";
  12. import * as yup from 'yup';
  13. import { useEffect, useState, lazy } from "react";
  14. import * as DateUtils from 'utils/DateUtils';
  15. import * as HttpUtils from 'utils/HttpUtils';
  16. import * as UrlUtils from "utils/ApiPathConst";
  17. import {checkMarkAsCreditClient} from 'utils/Utils';
  18. import * as FieldUtils from "utils/FieldUtils";
  19. import * as ComboData from "utils/ComboData";
  20. const LoadingComponent = Loadable(lazy(() => import('../../extra-pages/LoadingComponent')));
  21. import Loadable from 'components/Loadable';
  22. import { notifySaveSuccess } from 'utils/CommonFunction';
  23. import { useIntl } from "react-intl";
  24. import { PNSPS_BUTTON_THEME } from "themes/buttonConst";
  25. import { ThemeProvider } from "@emotion/react";
  26. import { isGrantedAny } from "auth/utils";
  27. import { DatePicker } from "@mui/x-date-pickers/DatePicker";
  28. import dayjs from "dayjs";
  29. import { DemoItem } from "@mui/x-date-pickers/internals/demo";
  30. import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
  31. import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
  32. // ==============================|| DASHBOARD - DEFAULT ||============================== //
  33. const OrganizationCard = ({ userData, loadDataFun, id, setEditModeFun }) => {
  34. const intl = useIntl();
  35. const [creditorConfirmPopUp, setCreditorConfirmPopUp] = React.useState(false);
  36. const [nonCreditorConfirmPopUp, setNonCreditorConfirmPopUp] = React.useState(false);
  37. const [afterSendPopUp, setAfterSendPopUp] = React.useState(false);
  38. const [currentUserData, setCurrentUserData] = useState({});
  39. const [overduePublicNotice, setOverduePublicNotice] = useState(0);
  40. const [editMode, setEditMode] = useState(false);
  41. const [createMode, setCreateMode] = useState(false);
  42. const [onReady, setOnReady] = useState(false);
  43. const [errorMsg, setErrorMsg] = useState("");
  44. const [minDate] = React.useState(new Date().setDate(new Date().getDate() + 1));
  45. const [fromDate, setFromDate] = React.useState(null);
  46. const [currentFromDate, setCurrentFromDate] = React.useState(null);
  47. const [fromDateValue, setFromDateValue] = React.useState(null);
  48. const { register, handleSubmit, reset } = useForm()
  49. React.useEffect(() => {
  50. setFromDateValue(fromDate);
  51. }, [fromDate]);
  52. useEffect(() => {
  53. //if state data are ready and assign to different field
  54. // console.log(currentApplicationDetailData)
  55. if (Object.keys(currentUserData).length > 0) {
  56. // console.log(currentUserData)
  57. if (DateUtils.dateValue(currentUserData.brExpiryDate) > DateUtils.dateValue(minDate)) {
  58. setFromDate(currentUserData.brExpiryDate);
  59. } else {
  60. setCurrentFromDate(currentUserData.brExpiryDate);
  61. // setErrorMsg("Please select a date after today.")
  62. }
  63. setOnReady(true);
  64. }
  65. }, [currentUserData]);
  66. function displayErrorMsg(errorMsg) {
  67. return <Typography variant="errorMessage1">{errorMsg}</Typography>
  68. }
  69. function getMaxErrStr(num, fieldname) {
  70. return displayErrorMsg(intl.formatMessage({ id: 'noMoreThenNWords' }, { num: num, fieldname: fieldname ? intl.formatMessage({ id: fieldname }) + ": " : "" }));
  71. }
  72. function getRequiredErrStr(fieldname) {
  73. return displayErrorMsg(intl.formatMessage({ id: 'require' }, { fieldname: fieldname ? intl.formatMessage({ id: fieldname }) : "" }));
  74. }
  75. const formik = useFormik({
  76. enableReinitialize: true,
  77. initialValues: currentUserData,
  78. validationSchema: yup.object().shape({
  79. enCompanyName: yup.string().max(255, getMaxErrStr(255)).required(displayErrorMsg(intl.formatMessage({ id: 'userRequireEnglishName' }))),
  80. chCompanyName: yup.string().max(255, displayErrorMsg(intl.formatMessage({ id: 'userRequireChineseName' }))).nullable(),
  81. orgShortName: yup.string().max(24, getMaxErrStr(24)).required(getRequiredErrStr("orgShortName")),
  82. addressLine1: yup.string().max(40, getMaxErrStr(40)).required(displayErrorMsg(intl.formatMessage({ id: 'validateAddressLine1' }))),
  83. addressLine2: yup.string().max(40, getMaxErrStr(40)),
  84. addressLine3: yup.string().max(40, getMaxErrStr(40)),
  85. contactPerson: yup.string().max(60, getMaxErrStr(60)).required(getRequiredErrStr("contactPerson")),
  86. fax_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({ id: 'requireDialingCode' }))).nullable(),
  87. tel_countryCode: yup.string().min(3, displayErrorMsg(intl.formatMessage({ id: 'requireDialingCode' }))),
  88. phoneNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'requiredValidNumber' }))).required(displayErrorMsg(intl.formatMessage({ id: 'requireContactNumber' }))),
  89. faxNumber: yup.string().min(8, displayErrorMsg(intl.formatMessage({ id: 'require8Number' }))).nullable(),
  90. brExpiryDate: yup.string().min(8).required(displayErrorMsg(intl.formatMessage({ id: 'pleaseFillInBusinessRegCertValidityDate' }))),
  91. brNo: yup.string().required(displayErrorMsg(intl.formatMessage({ id: 'pleaseFillInBusinessRegCertNumber' }))).test('checkBrNoFormat', displayErrorMsg(displayErrorMsg(intl.formatMessage({ id: 'pleaseFillInValidBusinessRegCertNumber' }))), function (value) {
  92. var brNo_pattern = /[0-9]{8}/
  93. if (value !== undefined) {
  94. if (value.match(brNo_pattern)) {
  95. return true
  96. } else {
  97. return false
  98. }
  99. }
  100. }),
  101. }),
  102. onSubmit: (values) => {
  103. if (values.country == null) {
  104. setErrorMsg(intl.formatMessage({ id: 'pleaseFillInCountry' }))
  105. } else {
  106. if (values.country.type == "hongKong" && values.district == null) {
  107. setErrorMsg(intl.formatMessage({ id: 'pleaseFillInDistrict' }))
  108. } else {
  109. let sentDateFrom = "";
  110. if (fromDateValue == null) {
  111. setErrorMsg(intl.formatMessage({ id: 'pleaseFillInBusinessRegCertValidityDate' }))
  112. } else {
  113. sentDateFrom = DateUtils.dateValue(fromDateValue)
  114. HttpUtils.post({
  115. url: UrlUtils.POST_ORG_SAVE_PATH,
  116. params: {
  117. id: id > 0 ? id : null,
  118. enCompanyName: values.enCompanyName,
  119. chCompanyName: values.chCompanyName,
  120. orgShortName: values.orgShortName === "N/A" ? "" : values.orgShortName,
  121. brNo: values.brNo,
  122. // brExpiryDate: values.brExpiryDate,
  123. brExpiryDate: sentDateFrom,
  124. enCompanyNameTemp: values.enCompanyNameTemp,
  125. chCompanyNameTemp: values.chCompanyNameTemp,
  126. brExpiryDateTemp: values.brExpiryDateTemp,
  127. contactPerson: values.contactPerson,
  128. contactTel: {
  129. countryCode: values.tel_countryCode,
  130. phoneNumber: values.phoneNumber
  131. },
  132. faxNo: {
  133. countryCode: values.fax_countryCode,
  134. faxNumber: values.faxNumber
  135. },
  136. addressTemp: {
  137. country: values.country.type,
  138. district: values.district?.type,
  139. addressLine1: values.addressLine1,
  140. addressLine2: values.addressLine2,
  141. addressLine3: values.addressLine3,
  142. },
  143. creditor: values.creditor,
  144. },
  145. onSuccess: function () {
  146. notifySaveSuccess()
  147. loadDataFun();
  148. setEditMode(false);
  149. }
  150. });
  151. }
  152. }
  153. }
  154. }
  155. });
  156. useEffect(() => {
  157. setEditModeFun(editMode);
  158. }, [editMode]);
  159. useEffect(() => {
  160. if (Object.keys(userData).length > 0) {
  161. setCreateMode(id <= 0);
  162. setEditMode(id <= 0);
  163. setCurrentUserData(userData);
  164. }
  165. }, [userData]);
  166. // useEffect(() => {
  167. // if (Object.keys(userData).length > 0) {
  168. // if(userData.creditor === undefined||userData.creditor === null){
  169. // userData.creditor = false
  170. // }
  171. // setCurrentUserData(userData);
  172. // }
  173. // }, []);
  174. const onEditClick = () => {
  175. setEditMode(true);
  176. };
  177. const onSubmit = (data) => {
  178. let sentOrgShortName = "";
  179. if (data.orgShortName != null && data.orgShortName != "" && data.orgShortName != "N/A") {
  180. sentOrgShortName = data.orgShortName
  181. if (sentOrgShortName.length <= 24) {
  182. const temp = {
  183. orgShortName: sentOrgShortName,
  184. };
  185. markAsCreditor(temp);
  186. } else {
  187. alert("Organisation Short Name must not exceed 24 characters.")
  188. }
  189. } else {
  190. alert("Please enter Organisation Short Name for Demand Note.")
  191. }
  192. };
  193. function resetForm() {
  194. reset();
  195. }
  196. const markAsCreditor = (temp) => {
  197. setCreditorConfirmPopUp(false);
  198. HttpUtils.post({
  199. url: UrlUtils.GET_ORG_MARK_AS_CREDITOR + "/" + id,
  200. params: temp,
  201. onSuccess: () => {
  202. resetForm();
  203. loadDataFun();
  204. }
  205. });
  206. }
  207. const markAsNonCreditor = () => {
  208. setNonCreditorConfirmPopUp(false);
  209. HttpUtils.get({
  210. url: UrlUtils.GET_ORG_MARK_AS_NON_CREDITOR + "/" + id,
  211. onSuccess: () => {
  212. loadDataFun();
  213. }
  214. });
  215. }
  216. const sendDn_Overdue = () => {
  217. setNonCreditorConfirmPopUp(false);
  218. HttpUtils.get({
  219. url: UrlUtils.GET_SEND_OVERDUE_CREDITOR_LIST + "/" + id,
  220. onSuccess: (responseData) => {
  221. setOverduePublicNotice(responseData.overduePublicNotice);
  222. setAfterSendPopUp(true);
  223. }
  224. });
  225. }
  226. return (
  227. <MainCard elevation={0}
  228. border={false}
  229. content={false}
  230. >
  231. <form onSubmit={formik.handleSubmit} style={{ padding: 24 }}>
  232. {/*top*/}
  233. {isGrantedAny("MAINTAIN_ORG") ?
  234. <Grid item s={12} md={12} lg={12} sx={{ mb: 3 }} alignItems={"start"} justifyContent="center">
  235. <Grid container maxWidth justifyContent="flex-start">
  236. {editMode ?
  237. <>
  238. {createMode ?
  239. <>
  240. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  241. <Grid item sx={{ ml: 0, mr: 3 }}>
  242. <Button
  243. variant="contained"
  244. type="submit"
  245. color="success"
  246. >
  247. Create
  248. </Button>
  249. </Grid>
  250. </ThemeProvider>
  251. </> :
  252. <>
  253. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  254. <Grid item sx={{ ml: 0, mr: 3 }}>
  255. <Button
  256. variant="contained"
  257. onClick={loadDataFun}
  258. color="cancel"
  259. >
  260. Reset & Back
  261. </Button>
  262. </Grid>
  263. <Grid item sx={{ ml: 3, mr: 3 }}>
  264. <Button
  265. variant="contained"
  266. type="submit"
  267. color="success"
  268. >
  269. Save
  270. </Button>
  271. </Grid>
  272. </ThemeProvider>
  273. </>
  274. }
  275. </>
  276. :
  277. <>
  278. <Grid item sx={{ ml: 0, mr: 3 }}>
  279. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  280. <Button
  281. variant="contained"
  282. onClick={onEditClick}
  283. color="success"
  284. >
  285. Edit
  286. </Button>
  287. </ThemeProvider>
  288. </Grid>
  289. {
  290. currentUserData.creditor ?
  291. !checkMarkAsCreditClient()?
  292. <Grid item sx={{ ml: 3, mr: 3 }}>
  293. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  294. <Button
  295. variant="contained"
  296. color="error"
  297. onClick={() => setNonCreditorConfirmPopUp(true)}
  298. >
  299. Mark as Non-Credit Client
  300. </Button>
  301. </ThemeProvider>
  302. </Grid>:null
  303. :
  304. <>
  305. {!checkMarkAsCreditClient()?
  306. <Grid item sx={{ ml: 3, mr: 3 }}>
  307. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  308. <Button
  309. variant="contained"
  310. color="orange"
  311. onClick={() => setCreditorConfirmPopUp(true)}
  312. >
  313. Mark as Credit Client
  314. </Button>
  315. </ThemeProvider>
  316. </Grid>:null
  317. }
  318. { isGrantedAny("MAINTAIN_DEMANDNOTE")?
  319. <Grid item sx={{ ml: 3, mr: 3 }}>
  320. <ThemeProvider theme={PNSPS_BUTTON_THEME}>
  321. <Button
  322. variant="contained"
  323. color="primary"
  324. onClick={() => sendDn_Overdue(true)}
  325. >
  326. Generate O&#47;S DN List
  327. </Button>
  328. </ThemeProvider>
  329. </Grid> : null
  330. }
  331. </>
  332. }
  333. </>
  334. }
  335. </Grid>
  336. </Grid>
  337. : <></>
  338. }
  339. {/*top*/}
  340. {!onReady ?
  341. <LoadingComponent />
  342. :
  343. <Grid container spacing={1}>
  344. <Grid item xs={12}>
  345. <Typography variant="h4" sx={{ mb: 2, mr: 3, borderBottom: "1px solid black" }}>
  346. Organisation Details
  347. </Typography>
  348. </Grid>
  349. <Grid item xs={12}>
  350. <FormHelperText error id="helper-text-address1-signup">
  351. <Typography variant="errorMessage1">
  352. {errorMsg}
  353. </Typography>
  354. </FormHelperText>
  355. </Grid>
  356. <Grid item xs={12} lg={4} >
  357. {FieldUtils.getTextField({
  358. label: FieldUtils.notNullFieldLabel("BR No.:"),
  359. valueName: "brNo",
  360. disabled: (!editMode && !createMode),
  361. form: formik
  362. })}
  363. </Grid>
  364. {!checkMarkAsCreditClient()?
  365. <Grid item xs={12} lg={4} >
  366. <FormControlLabel
  367. control={<Checkbox checked={formik.values.creditor} />}
  368. label="is Credit Client"
  369. name="creditor"
  370. onChange={() => {
  371. formik.setFieldValue("creditor", !formik.values.creditor);
  372. }}
  373. disabled={true}
  374. //disabled={!editMode && !createMode}
  375. />
  376. </Grid>:null
  377. }
  378. <Grid item xs={12} lg={4} ></Grid>
  379. <Grid item xs={12} lg={4} >
  380. {FieldUtils.getTextField({
  381. label: FieldUtils.notNullFieldLabel("Name (Eng):"),
  382. valueName: "enCompanyName",
  383. disabled: (!editMode && !createMode),
  384. form: formik
  385. })}
  386. </Grid>
  387. <Grid item xs={12} lg={4} >
  388. {FieldUtils.getTextField({
  389. label: "Name (Ch):",
  390. valueName: "chCompanyName",
  391. disabled: (!editMode && !createMode),
  392. form: formik
  393. })}
  394. </Grid>
  395. <Grid item xs={12} lg={4} >
  396. <Grid container alignItems={"center"}>
  397. <Grid item xs={12} md={3} lg={3} sx={{ display: 'flex', alignItems: 'center' }}>
  398. <Typography variant="pnspsFormParagraphBold">{FieldUtils.notNullFieldLabel("Expiry Date:")}</Typography>
  399. </Grid>
  400. <Grid item xs={12} md={6} lg={6}>
  401. {(!editMode && !createMode) ?
  402. <TextField
  403. fullWidth
  404. id="currentExDate"
  405. // error={(fromDate===null)}
  406. // type="date"
  407. name="currentExDate"
  408. value={fromDate != null ? DateUtils.dateStr(fromDate) : DateUtils.dateStr(currentFromDate)}
  409. disabled={true}
  410. /> :
  411. <LocalizationProvider dateAdapter={AdapterDayjs}>
  412. <DemoItem components={['DatePicker']}>
  413. <DatePicker
  414. id="brExpiryDate"
  415. name="brExpiryDate"
  416. // error={fromDate===null}
  417. slotProps={{
  418. field: { readOnly: true, },
  419. // textField: {
  420. // helperText:fromDate == null ? intl.formatMessage({ id: 'pleaseFillInBusinessRegCertValidityDate' }):""
  421. // },
  422. }}
  423. format="DD/MM/YYYY"
  424. // label={"Submit Date (From)"}
  425. value={fromDate == null ? null : dayjs(fromDate)}
  426. minDate={minDate == null ? null : dayjs(minDate)}
  427. disabled={(!editMode && !createMode)}
  428. onChange={(newValue) => {
  429. // console.log(newValue)
  430. // setErrorMsg("")
  431. if (DateUtils.dateValue(newValue) > DateUtils.dateValue(new Date())) {
  432. setFromDate(newValue);
  433. } else {
  434. // setErrorMsg("Please select a date after today.")
  435. }
  436. }}
  437. />
  438. </DemoItem >
  439. </LocalizationProvider>
  440. }
  441. </Grid>
  442. {
  443. fromDate == null ?
  444. (!editMode && !createMode) ?
  445. // <FormHelperText error id="helper-text-date">
  446. // Please select a date after today.
  447. // </FormHelperText>
  448. null
  449. :
  450. <FormHelperText error id="helper-text-date">
  451. {intl.formatMessage({ id: 'pleaseFillInBusinessRegCertValidityDate' })}
  452. </FormHelperText>
  453. :
  454. null
  455. }
  456. </Grid>
  457. </Grid>
  458. <Grid item xs={12} lg={4} >
  459. {FieldUtils.getTextField({
  460. label: FieldUtils.notNullFieldLabel("Contact Person:"),
  461. valueName: "contactPerson",
  462. disabled: (!editMode && !createMode),
  463. form: formik
  464. })}
  465. </Grid>
  466. <Grid item xs={12} lg={4} >
  467. {FieldUtils.getPhoneField({
  468. label: FieldUtils.notNullFieldLabel("Contact Tel:"),
  469. valueName: {
  470. code: "tel_countryCode",
  471. num: "phoneNumber"
  472. },
  473. disabled: (!editMode && !createMode),
  474. form: formik
  475. })}
  476. </Grid>
  477. <Grid item xs={12} lg={4} >
  478. {FieldUtils.getPhoneField({
  479. label: "Fax No:",
  480. valueName: {
  481. code: "fax_countryCode",
  482. num: "faxNumber"
  483. },
  484. disabled: (!editMode && !createMode),
  485. form: formik
  486. })}
  487. </Grid>
  488. {
  489. currentUserData.creditor ?
  490. <Grid item xs={12} lg={4} >
  491. {FieldUtils.getTextField({
  492. label: FieldUtils.notNullFieldLabel("Org. Short Name:"),
  493. valueName: "orgShortName",
  494. disabled: (!editMode && !createMode),
  495. form: formik
  496. })}
  497. </Grid>
  498. :
  499. null
  500. }
  501. <Grid item xs={12} lg={12} >
  502. {FieldUtils.getAddressField({
  503. label: FieldUtils.notNullFieldLabel("Address:"),
  504. valueName: ["addressLine1", "addressLine2", "addressLine3"],
  505. disabled: (!editMode && !createMode),
  506. form: formik
  507. })}
  508. </Grid>
  509. <Grid item xs={12} lg={12} >
  510. {FieldUtils.getProfileComboField({
  511. label: "",
  512. valueName: "district",
  513. disabled: (!editMode && !createMode),
  514. dataList: ComboData.district,
  515. getOptionLabel: (option) => option.type ? intl.formatMessage({ id: option.type }) : "",
  516. form: formik
  517. })}
  518. </Grid>
  519. <Grid item xs={12} lg={12} >
  520. {FieldUtils.getProfileComboField({
  521. label: "",
  522. valueName: "country",
  523. disabled: true,
  524. dataList: ComboData.country,
  525. getOptionLabel: (option) => option.type ? intl.formatMessage({ id: option.type }) : "",
  526. form: formik
  527. })}
  528. </Grid>
  529. <Grid item lg={12} ></Grid>
  530. </Grid>
  531. }
  532. </form>
  533. <div>
  534. <Dialog
  535. open={creditorConfirmPopUp}
  536. onClose={() => setCreditorConfirmPopUp(false)}
  537. PaperProps={{
  538. sx: {
  539. minWidth: '40vw',
  540. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  541. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  542. }
  543. }}
  544. >
  545. <form onSubmit={handleSubmit(onSubmit)}>
  546. <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle>
  547. <DialogContent style={{ display: 'flex', }}>
  548. <Grid container direction="column">
  549. <Grid item>
  550. <Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Credit Client?</Typography>
  551. </Grid>
  552. <Grid item>
  553. <Typography variant="h6" style={{ padding: '16px' }}>Please Enter Organisation Short Name for Credit Client (Used for Demand Note)</Typography>
  554. </Grid>
  555. <Grid item sx={{ padding: '16px' }}>
  556. <TextField
  557. fullWidth
  558. {...register("orgShortName")}
  559. id='orgShortName'
  560. label="Organisation Short Name"
  561. defaultValue={currentUserData.orgShortName != "N/A" ? currentUserData.orgShortName : ""}
  562. InputLabelProps={{
  563. shrink: true
  564. }}
  565. />
  566. </Grid>
  567. </Grid>
  568. </DialogContent>
  569. <DialogActions>
  570. <Button onClick={() => setCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button>
  571. <Button type="submit"><Typography variant="h5">Confirm</Typography></Button>
  572. {/* <Button onClick={() => markAsCreditor()}><Typography variant="h5">Confirm</Typography></Button> */}
  573. </DialogActions>
  574. </form>
  575. </Dialog>
  576. </div>
  577. <div>
  578. <Dialog
  579. open={nonCreditorConfirmPopUp}
  580. onClose={() => setNonCreditorConfirmPopUp(false)}
  581. PaperProps={{
  582. sx: {
  583. minWidth: '40vw',
  584. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  585. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  586. }
  587. }}
  588. >
  589. <DialogTitle><Typography variant="h3">Confirm</Typography></DialogTitle>
  590. <DialogContent style={{ display: 'flex', }}>
  591. <Typography variant="h4" style={{ padding: '16px' }}>Are you sure mark as Non-Credit Client?</Typography>
  592. </DialogContent>
  593. <DialogActions>
  594. <Button onClick={() => setNonCreditorConfirmPopUp(false)}><Typography variant="h5">Cancel</Typography></Button>
  595. <Button onClick={() => markAsNonCreditor()}><Typography variant="h5">Confirm</Typography></Button>
  596. </DialogActions>
  597. </Dialog>
  598. </div>
  599. <div>
  600. <Dialog
  601. open={afterSendPopUp}
  602. onClose={() => setAfterSendPopUp(false)}
  603. PaperProps={{
  604. sx: {
  605. minWidth: '40vw',
  606. maxWidth: { xs: '90vw', s: '90vw', m: '70vw', lg: '70vw' },
  607. maxHeight: { xs: '90vh', s: '70vh', m: '70vh', lg: '60vh' }
  608. }
  609. }}
  610. >
  611. <DialogTitle><Typography variant="h3">Info</Typography></DialogTitle>
  612. <DialogContent style={{ display: 'flex', }}>
  613. <Typography variant="h4" style={{ padding: '16px' }}>Overdue Public Notice count: {overduePublicNotice}</Typography>
  614. </DialogContent>
  615. <DialogActions>
  616. <Button onClick={() => setAfterSendPopUp(false)}><Typography variant="h5">OK</Typography></Button>
  617. </DialogActions>
  618. </Dialog>
  619. </div>
  620. </MainCard>
  621. );
  622. };
  623. export default OrganizationCard;