diff --git a/.env b/.env
index e90bde3..9face82 100644
--- a/.env
+++ b/.env
@@ -6,7 +6,7 @@ REACT_APP_API_URL=https://mock-data-api-nextjs.vercel.app/
## Google Map Key
-REACT_APP_GOOGLE_MAPS_API_KEY=
+REACT_APP_GOOGLE_MAPS_API_KEY=AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8
## Firebase - Google Auth
diff --git a/.env.staging b/.env.staging
index e5978c2..9afabf2 100644
--- a/.env.staging
+++ b/.env.staging
@@ -1,3 +1,3 @@
-REACT_APP_URL=''
+REACT_APP_URL='https://jupiter.nearle.app/live/api/v1'
REACT_APP_URL2=''
REACT_APP_STAFF_TOKEN=''
\ No newline at end of file
diff --git a/nearlexpressbuild b/nearlexpressbuild
index dcb5535..97d9155 160000
--- a/nearlexpressbuild
+++ b/nearlexpressbuild
@@ -1 +1 @@
-Subproject commit dcb55352601dd6cbb3d677cce70b45e3fba5df55
+Subproject commit 97d9155b79317a1cef6ddd1e7dfc0b566371aec8
diff --git a/package-lock.json b/package-lock.json
index 228e548..9e24b46 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14,20 +14,24 @@
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@mui/base": "^5.0.0-alpha.126",
+ "@mui/icons-material": "^5.14.19",
"@mui/lab": "^5.0.0-alpha.127",
"@mui/material": "^5.12.1",
+ "@mui/x-date-pickers": "^6.18.2",
"@reduxjs/toolkit": "^1.9.5",
"@svgr/webpack": "^7.0.0",
"axios": "^1.3.5",
"buffer": "^6.0.3",
"chance": "^1.1.11",
"crypto-browserify": "^3.12.0",
+ "dayjs": "^1.11.10",
"env-cmd": "^10.1.0",
"formik": "^2.2.9",
"framer-motion": "^10.12.4",
"jsonwebtoken": "^9.0.0",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
+ "mui-daterange-picker": "^1.0.5",
"notistack": "^3.0.1",
"process": "^0.11.10",
"prop-types": "^15.8.1",
@@ -35,6 +39,8 @@
"react-app-rewired": "^2.2.1",
"react-device-detect": "^2.2.3",
"react-dom": "^18.2.0",
+ "react-geocode": "^0.2.3",
+ "react-google-autocomplete": "^2.7.3",
"react-intl": "^6.4.1",
"react-redux": "^8.0.5",
"react-router": "^6.10.0",
@@ -1859,16 +1865,21 @@
"integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA=="
},
"node_modules/@babel/runtime": {
- "version": "7.21.0",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.0.tgz",
- "integrity": "sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==",
+ "version": "7.23.5",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.5.tgz",
+ "integrity": "sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w==",
"dependencies": {
- "regenerator-runtime": "^0.13.11"
+ "regenerator-runtime": "^0.14.0"
},
"engines": {
"node": ">=6.9.0"
}
},
+ "node_modules/@babel/runtime/node_modules/regenerator-runtime": {
+ "version": "0.14.0",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz",
+ "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA=="
+ },
"node_modules/@babel/template": {
"version": "7.20.7",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz",
@@ -2436,6 +2447,40 @@
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
}
},
+ "node_modules/@floating-ui/core": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.1.tgz",
+ "integrity": "sha512-QgcKYwzcc8vvZ4n/5uklchy8KVdjJwcOeI+HnnTNclJjs2nYsy23DOCf+sSV1kBwD9yDAoVKCkv/gEPzgQU3Pw==",
+ "dependencies": {
+ "@floating-ui/utils": "^0.1.3"
+ }
+ },
+ "node_modules/@floating-ui/dom": {
+ "version": "1.5.3",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz",
+ "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==",
+ "dependencies": {
+ "@floating-ui/core": "^1.4.2",
+ "@floating-ui/utils": "^0.1.3"
+ }
+ },
+ "node_modules/@floating-ui/react-dom": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.4.tgz",
+ "integrity": "sha512-CF8k2rgKeh/49UrnIBs4BdxPUV6vize/Db1d/YbCLyp9GiVZ0BEwf5AiDSxJRCr6yOkGqTFHtmrULxkEfYZ7dQ==",
+ "dependencies": {
+ "@floating-ui/dom": "^1.5.1"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0",
+ "react-dom": ">=16.8.0"
+ }
+ },
+ "node_modules/@floating-ui/utils": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz",
+ "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A=="
+ },
"node_modules/@formatjs/ecma402-abstract": {
"version": "1.14.3",
"resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.14.3.tgz",
@@ -3346,6 +3391,31 @@
"url": "https://opencollective.com/mui"
}
},
+ "node_modules/@mui/icons-material": {
+ "version": "5.14.19",
+ "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.14.19.tgz",
+ "integrity": "sha512-yjP8nluXxZGe3Y7pS+yxBV+hWZSsSBampCxkZwaw+1l+feL+rfP74vbEFbMrX/Kil9I/Y1tWfy5bs/eNvwNpWw==",
+ "dependencies": {
+ "@babel/runtime": "^7.23.4"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/mui-org"
+ },
+ "peerDependencies": {
+ "@mui/material": "^5.0.0",
+ "@types/react": "^17.0.0 || ^18.0.0",
+ "react": "^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
"node_modules/@mui/lab": {
"version": "5.0.0-alpha.127",
"resolved": "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.127.tgz",
@@ -3538,11 +3608,11 @@
}
},
"node_modules/@mui/types": {
- "version": "7.2.4",
- "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.4.tgz",
- "integrity": "sha512-LBcwa8rN84bKF+f5sDyku42w1NTxaPgPyYKODsh01U1fVstTClbUoSA96oyRBnSNyEiAVjKm6Gwx9vjR+xyqHA==",
+ "version": "7.2.10",
+ "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.10.tgz",
+ "integrity": "sha512-wX1vbDC+lzF7FlhT6A3ffRZgEoKWPF8VqRoTu4lZwouFX2t90KyCMsgepMw5DxLak1BSp/KP86CmtZttikb/gQ==",
"peerDependencies": {
- "@types/react": "*"
+ "@types/react": "^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"@types/react": {
@@ -3551,13 +3621,12 @@
}
},
"node_modules/@mui/utils": {
- "version": "5.12.0",
- "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.12.0.tgz",
- "integrity": "sha512-RmQwgzF72p7Yr4+AAUO6j1v2uzt6wr7SWXn68KBsnfVpdOHyclCzH2lr/Xu6YOw9su4JRtdAIYfJFXsS6Cjkmw==",
+ "version": "5.14.19",
+ "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.19.tgz",
+ "integrity": "sha512-qAHvTXzk7basbyqPvhgWqN6JbmI2wLB/mf97GkSlz5c76MiKYV6Ffjvw9BjKZQ1YRb8rDX9kgdjRezOcoB91oQ==",
"dependencies": {
- "@babel/runtime": "^7.21.0",
- "@types/prop-types": "^15.7.5",
- "@types/react-is": "^16.7.1 || ^17.0.0",
+ "@babel/runtime": "^7.23.4",
+ "@types/prop-types": "^15.7.11",
"prop-types": "^15.8.1",
"react-is": "^18.2.0"
},
@@ -3566,10 +3635,16 @@
},
"funding": {
"type": "opencollective",
- "url": "https://opencollective.com/mui"
+ "url": "https://opencollective.com/mui-org"
},
"peerDependencies": {
+ "@types/react": "^17.0.0 || ^18.0.0",
"react": "^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
}
},
"node_modules/@mui/utils/node_modules/react-is": {
@@ -3577,6 +3652,110 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz",
"integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w=="
},
+ "node_modules/@mui/x-date-pickers": {
+ "version": "6.18.2",
+ "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-6.18.2.tgz",
+ "integrity": "sha512-HJq4uoFQSu5isa/mesWw2BKh8KBRYUQb+KaSlVlWfJNgP3YhPvWZ6yqCNYyxOAiPMxb0n3nBjS9ErO27OHjFMA==",
+ "dependencies": {
+ "@babel/runtime": "^7.23.2",
+ "@mui/base": "^5.0.0-beta.22",
+ "@mui/utils": "^5.14.16",
+ "@types/react-transition-group": "^4.4.8",
+ "clsx": "^2.0.0",
+ "prop-types": "^15.8.1",
+ "react-transition-group": "^4.4.5"
+ },
+ "engines": {
+ "node": ">=14.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/mui"
+ },
+ "peerDependencies": {
+ "@emotion/react": "^11.9.0",
+ "@emotion/styled": "^11.8.1",
+ "@mui/material": "^5.8.6",
+ "@mui/system": "^5.8.0",
+ "date-fns": "^2.25.0",
+ "date-fns-jalali": "^2.13.0-0",
+ "dayjs": "^1.10.7",
+ "luxon": "^3.0.2",
+ "moment": "^2.29.4",
+ "moment-hijri": "^2.1.2",
+ "moment-jalaali": "^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0",
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@emotion/react": {
+ "optional": true
+ },
+ "@emotion/styled": {
+ "optional": true
+ },
+ "date-fns": {
+ "optional": true
+ },
+ "date-fns-jalali": {
+ "optional": true
+ },
+ "dayjs": {
+ "optional": true
+ },
+ "luxon": {
+ "optional": true
+ },
+ "moment": {
+ "optional": true
+ },
+ "moment-hijri": {
+ "optional": true
+ },
+ "moment-jalaali": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@mui/x-date-pickers/node_modules/@mui/base": {
+ "version": "5.0.0-beta.25",
+ "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.25.tgz",
+ "integrity": "sha512-Iiv+IcappRRv6IBlknIVmLkXxfp51NEX1+l9f+dIbBuPU4PaRULegr1lCeHKsC45KU5ruxM5xMg4R/de03aJQg==",
+ "dependencies": {
+ "@babel/runtime": "^7.23.4",
+ "@floating-ui/react-dom": "^2.0.4",
+ "@mui/types": "^7.2.10",
+ "@mui/utils": "^5.14.19",
+ "@popperjs/core": "^2.11.8",
+ "clsx": "^2.0.0",
+ "prop-types": "^15.8.1"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/mui-org"
+ },
+ "peerDependencies": {
+ "@types/react": "^17.0.0 || ^18.0.0",
+ "react": "^17.0.0 || ^18.0.0",
+ "react-dom": "^17.0.0 || ^18.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@types/react": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/@mui/x-date-pickers/node_modules/clsx": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz",
+ "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/@nicolo-ribaudo/eslint-scope-5-internals": {
"version": "5.1.1-v1",
"resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz",
@@ -3740,9 +3919,9 @@
}
},
"node_modules/@popperjs/core": {
- "version": "2.11.7",
- "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz",
- "integrity": "sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==",
+ "version": "2.11.8",
+ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
+ "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/popperjs"
@@ -4603,9 +4782,9 @@
"integrity": "sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow=="
},
"node_modules/@types/prop-types": {
- "version": "15.7.5",
- "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz",
- "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w=="
+ "version": "15.7.11",
+ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz",
+ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng=="
},
"node_modules/@types/q": {
"version": "1.5.5",
@@ -4632,18 +4811,10 @@
"csstype": "^3.0.2"
}
},
- "node_modules/@types/react-is": {
- "version": "17.0.3",
- "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-17.0.3.tgz",
- "integrity": "sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==",
- "dependencies": {
- "@types/react": "*"
- }
- },
"node_modules/@types/react-transition-group": {
- "version": "4.4.5",
- "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.5.tgz",
- "integrity": "sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==",
+ "version": "4.4.9",
+ "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.9.tgz",
+ "integrity": "sha512-ZVNmWumUIh5NhH8aMD9CR2hdW0fNuYInlocZHaZ+dgk/1K49j1w/HoAuK1ki+pgscQrOFRTlXeoURtuzEkV3dg==",
"dependencies": {
"@types/react": "*"
}
@@ -7195,6 +7366,27 @@
"node": ">=10"
}
},
+ "node_modules/date-fns": {
+ "version": "2.30.0",
+ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz",
+ "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==",
+ "peer": true,
+ "dependencies": {
+ "@babel/runtime": "^7.21.0"
+ },
+ "engines": {
+ "node": ">=0.11"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/date-fns"
+ }
+ },
+ "node_modules/dayjs": {
+ "version": "1.11.10",
+ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz",
+ "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ=="
+ },
"node_modules/debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@@ -13315,6 +13507,29 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
+ "node_modules/mui-daterange-picker": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/mui-daterange-picker/-/mui-daterange-picker-1.0.5.tgz",
+ "integrity": "sha512-+7Mp9DXQw6iLGotwp1rKfMV8sJxtaEto0IVId54orkvrCdqTgn167nzLBz6hd34tJLftg6DKAygkUom7tmg5Bw==",
+ "dependencies": {
+ "@babel/runtime": "^7.16.7"
+ },
+ "engines": {
+ "node": ">=8",
+ "npm": ">=5"
+ },
+ "peerDependencies": {
+ "@babel/runtime": "^7.16.7",
+ "@emotion/react": "^11.7.1",
+ "@emotion/styled": "^11.6.0",
+ "@mui/icons-material": "^5.0.4",
+ "@mui/material": "^5.2.6",
+ "@mui/system": "^5.0.6",
+ "date-fns": "^2.28.0",
+ "react": "^17.0.2",
+ "react-dom": "^17.0.2"
+ }
+ },
"node_modules/multicast-dns": {
"version": "7.2.5",
"resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz",
@@ -15723,6 +15938,26 @@
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz",
"integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw=="
},
+ "node_modules/react-geocode": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/react-geocode/-/react-geocode-0.2.3.tgz",
+ "integrity": "sha512-sIpbgmn1IUzAxO4haOZ6jeeFnMD8ya9PC38yiNrmJ9vPWbvAO2D/2yfCBzZjGZVUm4PRzKAc0KghXfaEnug0TQ==",
+ "dependencies": {
+ "regenerator-runtime": "^0.13.3"
+ }
+ },
+ "node_modules/react-google-autocomplete": {
+ "version": "2.7.3",
+ "resolved": "https://registry.npmjs.org/react-google-autocomplete/-/react-google-autocomplete-2.7.3.tgz",
+ "integrity": "sha512-Nm+7/VDe7/NDWb8p/a39is7ktNqt5bNqAOoQv2Ev/XkuEvjsRk08VAPFmXUH03xKuM8IUuDrk2Lwfge44YEj6Q==",
+ "dependencies": {
+ "lodash.debounce": "^4.0.8",
+ "prop-types": "^15.5.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.8.0"
+ }
+ },
"node_modules/react-intl": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/react-intl/-/react-intl-6.4.1.tgz",
@@ -20480,11 +20715,18 @@
"integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA=="
},
"@babel/runtime": {
- "version": "7.21.0",
- "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.0.tgz",
- "integrity": "sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==",
+ "version": "7.23.5",
+ "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.5.tgz",
+ "integrity": "sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w==",
"requires": {
- "regenerator-runtime": "^0.13.11"
+ "regenerator-runtime": "^0.14.0"
+ },
+ "dependencies": {
+ "regenerator-runtime": {
+ "version": "0.14.0",
+ "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz",
+ "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA=="
+ }
}
},
"@babel/template": {
@@ -20843,6 +21085,36 @@
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.38.0.tgz",
"integrity": "sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g=="
},
+ "@floating-ui/core": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.1.tgz",
+ "integrity": "sha512-QgcKYwzcc8vvZ4n/5uklchy8KVdjJwcOeI+HnnTNclJjs2nYsy23DOCf+sSV1kBwD9yDAoVKCkv/gEPzgQU3Pw==",
+ "requires": {
+ "@floating-ui/utils": "^0.1.3"
+ }
+ },
+ "@floating-ui/dom": {
+ "version": "1.5.3",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz",
+ "integrity": "sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==",
+ "requires": {
+ "@floating-ui/core": "^1.4.2",
+ "@floating-ui/utils": "^0.1.3"
+ }
+ },
+ "@floating-ui/react-dom": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.4.tgz",
+ "integrity": "sha512-CF8k2rgKeh/49UrnIBs4BdxPUV6vize/Db1d/YbCLyp9GiVZ0BEwf5AiDSxJRCr6yOkGqTFHtmrULxkEfYZ7dQ==",
+ "requires": {
+ "@floating-ui/dom": "^1.5.1"
+ }
+ },
+ "@floating-ui/utils": {
+ "version": "0.1.6",
+ "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz",
+ "integrity": "sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A=="
+ },
"@formatjs/ecma402-abstract": {
"version": "1.14.3",
"resolved": "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.14.3.tgz",
@@ -21524,6 +21796,14 @@
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.12.1.tgz",
"integrity": "sha512-rNiQYHtkXljcvCEnhWrJzie1ifff5O98j3uW7ZlchFgD8HWxEcz/QoxZvo+sCKC9aayAgxi9RsVn2VjCyp5CrA=="
},
+ "@mui/icons-material": {
+ "version": "5.14.19",
+ "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.14.19.tgz",
+ "integrity": "sha512-yjP8nluXxZGe3Y7pS+yxBV+hWZSsSBampCxkZwaw+1l+feL+rfP74vbEFbMrX/Kil9I/Y1tWfy5bs/eNvwNpWw==",
+ "requires": {
+ "@babel/runtime": "^7.23.4"
+ }
+ },
"@mui/lab": {
"version": "5.0.0-alpha.127",
"resolved": "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.127.tgz",
@@ -21609,19 +21889,18 @@
}
},
"@mui/types": {
- "version": "7.2.4",
- "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.4.tgz",
- "integrity": "sha512-LBcwa8rN84bKF+f5sDyku42w1NTxaPgPyYKODsh01U1fVstTClbUoSA96oyRBnSNyEiAVjKm6Gwx9vjR+xyqHA==",
+ "version": "7.2.10",
+ "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.10.tgz",
+ "integrity": "sha512-wX1vbDC+lzF7FlhT6A3ffRZgEoKWPF8VqRoTu4lZwouFX2t90KyCMsgepMw5DxLak1BSp/KP86CmtZttikb/gQ==",
"requires": {}
},
"@mui/utils": {
- "version": "5.12.0",
- "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.12.0.tgz",
- "integrity": "sha512-RmQwgzF72p7Yr4+AAUO6j1v2uzt6wr7SWXn68KBsnfVpdOHyclCzH2lr/Xu6YOw9su4JRtdAIYfJFXsS6Cjkmw==",
+ "version": "5.14.19",
+ "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.14.19.tgz",
+ "integrity": "sha512-qAHvTXzk7basbyqPvhgWqN6JbmI2wLB/mf97GkSlz5c76MiKYV6Ffjvw9BjKZQ1YRb8rDX9kgdjRezOcoB91oQ==",
"requires": {
- "@babel/runtime": "^7.21.0",
- "@types/prop-types": "^15.7.5",
- "@types/react-is": "^16.7.1 || ^17.0.0",
+ "@babel/runtime": "^7.23.4",
+ "@types/prop-types": "^15.7.11",
"prop-types": "^15.8.1",
"react-is": "^18.2.0"
},
@@ -21633,6 +21912,41 @@
}
}
},
+ "@mui/x-date-pickers": {
+ "version": "6.18.2",
+ "resolved": "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-6.18.2.tgz",
+ "integrity": "sha512-HJq4uoFQSu5isa/mesWw2BKh8KBRYUQb+KaSlVlWfJNgP3YhPvWZ6yqCNYyxOAiPMxb0n3nBjS9ErO27OHjFMA==",
+ "requires": {
+ "@babel/runtime": "^7.23.2",
+ "@mui/base": "^5.0.0-beta.22",
+ "@mui/utils": "^5.14.16",
+ "@types/react-transition-group": "^4.4.8",
+ "clsx": "^2.0.0",
+ "prop-types": "^15.8.1",
+ "react-transition-group": "^4.4.5"
+ },
+ "dependencies": {
+ "@mui/base": {
+ "version": "5.0.0-beta.25",
+ "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.25.tgz",
+ "integrity": "sha512-Iiv+IcappRRv6IBlknIVmLkXxfp51NEX1+l9f+dIbBuPU4PaRULegr1lCeHKsC45KU5ruxM5xMg4R/de03aJQg==",
+ "requires": {
+ "@babel/runtime": "^7.23.4",
+ "@floating-ui/react-dom": "^2.0.4",
+ "@mui/types": "^7.2.10",
+ "@mui/utils": "^5.14.19",
+ "@popperjs/core": "^2.11.8",
+ "clsx": "^2.0.0",
+ "prop-types": "^15.8.1"
+ }
+ },
+ "clsx": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz",
+ "integrity": "sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q=="
+ }
+ }
+ },
"@nicolo-ribaudo/eslint-scope-5-internals": {
"version": "5.1.1-v1",
"resolved": "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz",
@@ -21726,9 +22040,9 @@
}
},
"@popperjs/core": {
- "version": "2.11.7",
- "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz",
- "integrity": "sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw=="
+ "version": "2.11.8",
+ "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz",
+ "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A=="
},
"@reduxjs/toolkit": {
"version": "1.9.5",
@@ -22347,9 +22661,9 @@
"integrity": "sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow=="
},
"@types/prop-types": {
- "version": "15.7.5",
- "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz",
- "integrity": "sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w=="
+ "version": "15.7.11",
+ "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz",
+ "integrity": "sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng=="
},
"@types/q": {
"version": "1.5.5",
@@ -22376,18 +22690,10 @@
"csstype": "^3.0.2"
}
},
- "@types/react-is": {
- "version": "17.0.3",
- "resolved": "https://registry.npmjs.org/@types/react-is/-/react-is-17.0.3.tgz",
- "integrity": "sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==",
- "requires": {
- "@types/react": "*"
- }
- },
"@types/react-transition-group": {
- "version": "4.4.5",
- "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.5.tgz",
- "integrity": "sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==",
+ "version": "4.4.9",
+ "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.9.tgz",
+ "integrity": "sha512-ZVNmWumUIh5NhH8aMD9CR2hdW0fNuYInlocZHaZ+dgk/1K49j1w/HoAuK1ki+pgscQrOFRTlXeoURtuzEkV3dg==",
"requires": {
"@types/react": "*"
}
@@ -24284,6 +24590,20 @@
}
}
},
+ "date-fns": {
+ "version": "2.30.0",
+ "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz",
+ "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==",
+ "peer": true,
+ "requires": {
+ "@babel/runtime": "^7.21.0"
+ }
+ },
+ "dayjs": {
+ "version": "1.11.10",
+ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz",
+ "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ=="
+ },
"debug": {
"version": "4.3.4",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
@@ -28719,6 +29039,14 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
+ "mui-daterange-picker": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/mui-daterange-picker/-/mui-daterange-picker-1.0.5.tgz",
+ "integrity": "sha512-+7Mp9DXQw6iLGotwp1rKfMV8sJxtaEto0IVId54orkvrCdqTgn167nzLBz6hd34tJLftg6DKAygkUom7tmg5Bw==",
+ "requires": {
+ "@babel/runtime": "^7.16.7"
+ }
+ },
"multicast-dns": {
"version": "7.2.5",
"resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz",
@@ -30276,6 +30604,23 @@
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz",
"integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw=="
},
+ "react-geocode": {
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/react-geocode/-/react-geocode-0.2.3.tgz",
+ "integrity": "sha512-sIpbgmn1IUzAxO4haOZ6jeeFnMD8ya9PC38yiNrmJ9vPWbvAO2D/2yfCBzZjGZVUm4PRzKAc0KghXfaEnug0TQ==",
+ "requires": {
+ "regenerator-runtime": "^0.13.3"
+ }
+ },
+ "react-google-autocomplete": {
+ "version": "2.7.3",
+ "resolved": "https://registry.npmjs.org/react-google-autocomplete/-/react-google-autocomplete-2.7.3.tgz",
+ "integrity": "sha512-Nm+7/VDe7/NDWb8p/a39is7ktNqt5bNqAOoQv2Ev/XkuEvjsRk08VAPFmXUH03xKuM8IUuDrk2Lwfge44YEj6Q==",
+ "requires": {
+ "lodash.debounce": "^4.0.8",
+ "prop-types": "^15.5.0"
+ }
+ },
"react-intl": {
"version": "6.4.1",
"resolved": "https://registry.npmjs.org/react-intl/-/react-intl-6.4.1.tgz",
diff --git a/package.json b/package.json
index fe64672..7a35d8a 100644
--- a/package.json
+++ b/package.json
@@ -9,20 +9,24 @@
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@mui/base": "^5.0.0-alpha.126",
+ "@mui/icons-material": "^5.14.19",
"@mui/lab": "^5.0.0-alpha.127",
"@mui/material": "^5.12.1",
+ "@mui/x-date-pickers": "^6.18.2",
"@reduxjs/toolkit": "^1.9.5",
"@svgr/webpack": "^7.0.0",
"axios": "^1.3.5",
"buffer": "^6.0.3",
"chance": "^1.1.11",
"crypto-browserify": "^3.12.0",
+ "dayjs": "^1.11.10",
"env-cmd": "^10.1.0",
"formik": "^2.2.9",
"framer-motion": "^10.12.4",
"jsonwebtoken": "^9.0.0",
"jwt-decode": "^3.1.2",
"lodash": "^4.17.21",
+ "mui-daterange-picker": "^1.0.5",
"notistack": "^3.0.1",
"process": "^0.11.10",
"prop-types": "^15.8.1",
@@ -30,6 +34,8 @@
"react-app-rewired": "^2.2.1",
"react-device-detect": "^2.2.3",
"react-dom": "^18.2.0",
+ "react-geocode": "^0.2.3",
+ "react-google-autocomplete": "^2.7.3",
"react-intl": "^6.4.1",
"react-redux": "^8.0.5",
"react-router": "^6.10.0",
diff --git a/src/components/cards/statistics/HoverSocialCard.js b/src/components/cards/statistics/HoverSocialCard.js
new file mode 100644
index 0000000..d79b7e8
--- /dev/null
+++ b/src/components/cards/statistics/HoverSocialCard.js
@@ -0,0 +1,74 @@
+import PropTypes from 'prop-types';
+
+// material-ui
+import { Box, Card, CardContent, Grid, Typography } from '@mui/material';
+
+// ===========================|| HOVER SOCIAL CARD ||=========================== //
+
+const HoverSocialCard = ({ primary, secondary,
+ percentage,
+ // iconPrimary,
+ color
+ }) => {
+ // const IconPrimary = iconPrimary;
+ // const primaryIcon = iconPrimary ? : null;
+
+ return (
+
+
+
+
+ {percentage.toString()} %
+
+ {/* {primaryIcon} */}
+
+
+
+
+ {secondary}
+
+
+
+
+ {primary}
+
+
+
+
+
+ );
+};
+
+HoverSocialCard.propTypes = {
+ primary: PropTypes.string,
+ secondary: PropTypes.string,
+ // iconPrimary: PropTypes.object,
+ percentage:PropTypes.string,
+ color: PropTypes.string
+};
+
+export default HoverSocialCard;
diff --git a/src/layout/MainLayout/Drawer/DrawerHeader/index.js b/src/layout/MainLayout/Drawer/DrawerHeader/index.js
index ffda97d..093873e 100644
--- a/src/layout/MainLayout/Drawer/DrawerHeader/index.js
+++ b/src/layout/MainLayout/Drawer/DrawerHeader/index.js
@@ -37,7 +37,11 @@ const DrawerHeader = ({ open }) => {
{/* */}
{(open) &&
-
+
}
{(!open) &&
diff --git a/src/layout/MainLayout/Header/HeaderContent/MegaMenuSection.js b/src/layout/MainLayout/Header/HeaderContent/MegaMenuSection.js
index fedb9f9..6614494 100644
--- a/src/layout/MainLayout/Header/HeaderContent/MegaMenuSection.js
+++ b/src/layout/MainLayout/Header/HeaderContent/MegaMenuSection.js
@@ -64,7 +64,7 @@ const MegaMenuSection = () => {
ref={anchorRef}
aria-controls={open ? 'profile-grow' : undefined}
aria-haspopup="true"
- onClick={handleToggle}
+ // onClick={handleToggle}
>
diff --git a/src/layout/MainLayout/Header/HeaderContent/Profile/ProfileTab.js b/src/layout/MainLayout/Header/HeaderContent/Profile/ProfileTab.js
index dde1857..4c571b7 100644
--- a/src/layout/MainLayout/Header/HeaderContent/Profile/ProfileTab.js
+++ b/src/layout/MainLayout/Header/HeaderContent/Profile/ProfileTab.js
@@ -5,7 +5,7 @@ import { useState } from 'react';
import { List, ListItemButton, ListItemIcon, ListItemText } from '@mui/material';
// assets
-import { EditOutlined, ProfileOutlined, LogoutOutlined, UserOutlined, WalletOutlined } from '@ant-design/icons';
+import { EditOutlined, ProfileOutlined, LogoutOutlined, UserOutlined, WalletOutlined,CommentOutlined } from '@ant-design/icons';
import { useNavigate } from 'react-router';
// ==============================|| HEADER PROFILE - PROFILE TAB ||============================== //
@@ -32,11 +32,11 @@ const ProfileTab = ({ handleLogout }) => {
- handleListItemClick(event, 3)}>
+ handleListItemClick(event, 2)}>
-
+
-
+
{/* handleListItemClick(event, 4)}>
@@ -44,7 +44,7 @@ const ProfileTab = ({ handleLogout }) => {
*/}
- {
// navigate('/login')
diff --git a/src/layout/MainLayout/Header/HeaderContent/Profile/index.js b/src/layout/MainLayout/Header/HeaderContent/Profile/index.js
index b3aea5e..06edae8 100644
--- a/src/layout/MainLayout/Header/HeaderContent/Profile/index.js
+++ b/src/layout/MainLayout/Header/HeaderContent/Profile/index.js
@@ -63,6 +63,8 @@ const Profile = () => {
localStorage.removeItem('appuserid');
localStorage.removeItem('authname');
localStorage.removeItem('roleid');
+ localStorage.removeItem('tenantid');
+
navigate('/login')
diff --git a/src/layout/MainLayout/Header/HeaderContent/index.js b/src/layout/MainLayout/Header/HeaderContent/index.js
index 3a11e98..5579d0b 100644
--- a/src/layout/MainLayout/Header/HeaderContent/index.js
+++ b/src/layout/MainLayout/Header/HeaderContent/index.js
@@ -1,7 +1,12 @@
-import { useMemo } from 'react';
+import { useMemo ,useState} from 'react';
// material-ui
-import { Box, useMediaQuery ,Stack} from '@mui/material';
+import { Box, useMediaQuery ,Stack,Tooltip,IconButton,Popper,
+ ClickAwayListener,List,ListItem,ListItemButton,ListItemText,
+ Grid,ListItemIcon,Typography
+} from '@mui/material';
+
+import Transitions from 'components/@extended/Transitions';
// project import
import Search from './Search';
@@ -10,6 +15,15 @@ import Profile from './Profile';
import Notification from './Notification';
import MobileSection from './MobileSection';
import MegaMenuSection from './MegaMenuSection';
+import { useNavigate } from 'react-router';
+import {
+ MailOutlined,
+ // DashboardOutlined,
+ UserOutlined,
+ CustomerServiceOutlined,
+ WindowsOutlined
+} from '@ant-design/icons';
+import { useTheme } from '@mui/material/styles';
// ==============================|| HEADER - CONTENT ||============================== //
@@ -19,14 +33,200 @@ const HeaderContent = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
const megaMenu = useMemo(() => , []);
+ const [open, setOpen] = useState(false)
+ const [anchorEl, setAnchorEl] = useState(null);
+ const theme = useTheme();
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ // const megaMenu = useMemo(() => , []);
+ const iconBackColorOpen = 'grey.300';
+ const iconBackColor = 'grey.100';
+const navigate = useNavigate()
+
+ const handleToggle = (e) => {
+ setOpen(!open);
+ setAnchorEl(e.currentTarget);
+ }
+ const handleClickAway = () => {
+ setOpen(false);
+ };
+
return (
<>
{/* {!matchesXs && } */}
- {!matchesXs && megaMenu}
+ {/* {!matchesXs && megaMenu} */}
{matchesXs && }
+
+
+
+
+
+
+
+
+ {/* */}
+
+
+
+ {/* */}
+
+
+ {
+ // console.log(const location = useLocation();)
+ navigate('/orders/create')
+ handleClickAway()
+ }} >
+
+
+
+
+ Create Order
+
+
+ }
+ />
+
+ {/* {
+ navigate('/clients/create')
+ handleClickAway()
+ }} >
+
+
+
+
+ Create Client
+
+
+ }
+ />
+ */}
+ {
+ navigate('/clients/create')
+ handleClickAway()
+ }} >
+
+
+
+
+ Create Client
+
+
+ }
+ />
+
+
+ {/*
+ {
+ navigate('/create_order')
+ handleClickAway()
+ }}>
+
+
+
+
+
+
+
+
+ {
+ navigate('/create_client')
+ handleClickAway()
+ }}>
+
+
+
+
+
+
+
+
+ {
+ navigate('/create_staff')
+ handleClickAway()
+ }}>
+
+
+
+
+
+ */}
+
+
+ {/* */}
+
+
+
+
+
+
{/* */}
diff --git a/src/layout/MainLayout/index.js b/src/layout/MainLayout/index.js
index e906f57..8c0bf2c 100644
--- a/src/layout/MainLayout/index.js
+++ b/src/layout/MainLayout/index.js
@@ -53,7 +53,7 @@ const MainLayout = () => {
flexDirection: 'column'
}}
>
-
+ {/* */}
diff --git a/src/menu-items/other.js b/src/menu-items/other.js
index 8046ae1..c157be0 100644
--- a/src/menu-items/other.js
+++ b/src/menu-items/other.js
@@ -11,7 +11,11 @@ import {
MenuUnfoldOutlined,
QuestionOutlined,
SmileOutlined,
- StopOutlined
+ StopOutlined,
+ DashboardOutlined,
+ ClockCircleOutlined,
+ UserOutlined,
+ SettingOutlined
} from '@ant-design/icons';
// icons
@@ -24,14 +28,18 @@ const icons = {
SmileOutlined,
GatewayOutlined,
QuestionOutlined,
- DeploymentUnitOutlined
+ DeploymentUnitOutlined,
+ DashboardOutlined,
+ ClockCircleOutlined,
+ UserOutlined,
+ SettingOutlined
};
// ==============================|| MENU ITEMS - SUPPORT ||============================== //
const other = {
id: 'other',
- title: ,
+ title: ,
type: 'group',
children: [
{
@@ -39,7 +47,28 @@ const other = {
title: ,
type: 'item',
url: '/dashboard',
- icon: icons.ChromeOutlined
+ icon: icons.DashboardOutlined
+ },
+ {
+ id: 'orders',
+ title: ,
+ type: 'item',
+ url: '/orders',
+ icon: icons.ClockCircleOutlined
+ },
+ {
+ id: 'clients',
+ title: ,
+ type: 'item',
+ url: '/clients',
+ icon: icons.UserOutlined
+ },
+ {
+ id: 'account',
+ title: ,
+ type: 'item',
+ url: '/accountsettings',
+ icon: icons.SettingOutlined
},
// {
// id: 'documentation',
diff --git a/src/pages/nearle/accountsettings.js b/src/pages/nearle/accountsettings.js
new file mode 100644
index 0000000..acb1533
--- /dev/null
+++ b/src/pages/nearle/accountsettings.js
@@ -0,0 +1,409 @@
+import {
+ Box, Tab, Tabs,
+ Chip,
+ Divider,
+ Grid,
+ Link,
+ List,
+ ListItem,
+ ListItemIcon,
+ ListItemSecondaryAction,
+ Stack,
+ Typography,
+ useMediaQuery,
+ Avatar,
+
+} from '@mui/material';
+import LinearWithLabel from 'components/@extended/progress/LinearWithLabel';
+// import { PatternFormat } from 'react-number-format';
+import axios from 'axios';
+// project import
+import MainCard from 'components/MainCard';
+import { AimOutlined, EnvironmentOutlined, MailOutlined, PhoneOutlined } from '@ant-design/icons';
+import { useEffect ,useState} from 'react';
+
+
+const Accountsettings = () => {
+ const matchDownMD = useMediaQuery((theme) => theme.breakpoints.down('md'));
+ const [info, setInfo] = useState({})
+
+ useEffect(() => {
+ if (localStorage.getItem('tenantid')) {
+ fetchaccount(localStorage.getItem('tenantid'));
+
+ }
+ }, []);
+
+ const fetchaccount = async (tid) => {
+ await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`)
+ .then((res) => {
+ console.log(res)
+ if (res.data.status) {
+ setInfo(res.data.details);
+ }
+ }).catch((err) => {
+ console.log(err)
+ })
+
+
+ }
+
+ return <>
+
+
+
+
+ Account Settings
+
+
+
+
+
+
+
+ } iconPosition="start"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/* */}
+
+
+
+
+ {info.companyname || ''}
+ {info.registrationno || ''}
+
+
+
+ {/*
+
+
+
+
+
+ 86
+ Post
+
+
+
+ 40
+ Project
+
+
+
+ 4.5K
+ Members
+
+
+ */}
+
+
+
+
+
+
+
+
+
+
+ {info.primaryemail || ''}
+
+
+
+
+
+
+
+
+ {/* (+1-876) 8654 239 581 */}
+ {info.primarycontact || ''}
+
+
+
+
+
+
+
+
+
+ {/* New York */}
+ {info.city}
+
+
+
+
+
+
+
+
+ {/*
+ https://anshan.dh.url
+ */}
+ {info.state}
+
+
+
+
+
+
+
+ {/*
+
+
+
+ Junior
+
+
+
+
+
+ UX Reseacher
+
+
+
+
+
+ Wordpress
+
+
+
+
+
+ HTML
+
+
+
+
+
+ Graphic Design
+
+
+
+
+
+ Code Style
+
+
+
+
+
+
+ */}
+
+
+
+
+
+
+
+
+
+
+
+
+ Name
+ {info.tenantname || ''}
+
+
+
+
+ Registration No
+ {info.registrationno || ''}
+
+
+
+
+
+
+
+
+ Phone
+
+ {/* (+1-876) */}
+ {info.primarycontact || ''}
+
+
+
+
+
+ State
+ {info.state || ''}
+
+
+
+
+
+
+
+
+
+ Email
+ {info.primaryemail || ''}
+
+
+
+
+ City
+ {info.city || ''}
+
+
+
+
+
+
+
+
+ Suburb
+ {info.suburb || ''}
+
+
+
+
+ Zip Code
+ {info.postcode || ''}
+
+
+
+
+
+
+ Address
+ {info.address || ''}
+
+
+
+
+
+
+
+
+ {info.info || ''}
+
+
+
+ {/*
+
+
+
+
+
+
+ Master Degree (Year)
+ 2014-2017
+
+
+
+
+ Institute
+ -
+
+
+
+
+
+
+
+
+ Bachelor (Year)
+ 2011-2013
+
+
+
+
+ Institute
+ Imperial College London
+
+
+
+
+
+
+
+
+ School (Year)
+ 2009-2011
+
+
+
+
+ Institute
+ School of London, England
+
+
+
+
+
+
+ */}
+ {/*
+
+
+
+
+
+
+ Senior
+ Senior UI/UX designer (Year)
+
+
+
+
+ Job Responsibility
+
+ Perform task related to project manager with the 100+ team under my observation. Team management is key role in
+ this company.
+
+
+
+ f
+
+
+
+
+
+ Trainee cum Project Manager (Year)
+ 2017-2019
+
+
+
+
+ Job Responsibility
+ Team management is key role in this company.
+
+
+
+
+
+
+ */}
+
+
+
+
+
+
+
+ >
+}
+
+export default Accountsettings;
\ No newline at end of file
diff --git a/src/pages/nearle/clients/client.js b/src/pages/nearle/clients/client.js
new file mode 100644
index 0000000..a5a9618
--- /dev/null
+++ b/src/pages/nearle/clients/client.js
@@ -0,0 +1,1444 @@
+import * as React from 'react';
+// import AlertCustomerDelete from 'sections/apps/customer/AlertCustomerDelete';
+// import { useNavigate } from 'react-router';
+import Loader from 'components/Loader'
+// import AddCustomer from 'sections/apps/customer/AddCustomer';
+import { useState, Fragment } from 'react';
+// import PlaceOutlinedIcon from '@mui/icons-material/PlaceOutlined';
+// import EmailOutlinedIcon from '@mui/icons-material/EmailOutlined';
+// import LocalPhoneOutlinedIcon from '@mui/icons-material/LocalPhoneOutlined';
+// import AccessTimeOutlinedIcon from '@mui/icons-material/AccessTimeOutlined';
+// import CustomerCard from 'sections/apps/customer/CustomerCard';
+// import CustomerCardPage from 'pages/apps/customer/card';
+import { DeleteFilled, NotificationOutlined } from '@ant-design/icons';
+
+import {
+ Avatar,
+ // AvatarGroup,
+ Button,
+ Box,
+ // Button,
+ Grid,
+ Skeleton,
+
+ Stack,
+ // TextField,
+ Chip,
+ // TableSortLabel,
+ Typography,
+ // Divider,
+ Table, TableCell,
+ TableBody,
+ TableHead,
+ IconButton,
+ Collapse,
+ // Tabs,
+ // Tab,
+ Dialog,
+ // DialogActions,
+ DialogTitle,
+ DialogContent,
+ CircularProgress,
+ // TableSortLabel,
+ TableRow,
+ Tooltip,
+ // List,
+ // ListItem,
+ // ListItemIcon,
+ FormControl,
+ OutlinedInput,
+ InputAdornment,
+ Popper,
+ ClickAwayListener,
+ // Tooltip,
+ // Badge,
+ // Avatar
+} from '@mui/material';
+// import { PopupTransition } from 'components/@extended/Transitions';
+import { SearchOutlined } from '@ant-design/icons';
+
+import { enqueueSnackbar } from 'notistack';
+var utc = require('dayjs/plugin/utc')
+
+// import { useEffect, useState } from 'react';
+import axios from 'axios';
+import { useTheme } from '@mui/material/styles';
+
+// import ListIcon from '@mui/icons-material/List';
+// import CheckIcon from '@mui/icons-material/Check';
+// import CloseIcon from '@mui/icons-material/Close';
+// import TwoWheelerIcon from '@mui/icons-material/TwoWheeler';
+import {
+ // CloseOutlined,
+ // // PlusOutlined,
+ // ContactsOutlined,
+ // EyeTwoTone,
+ // MailOutlined,
+ // PhoneOutlined,
+ // // EditTwoTone,
+ DeleteTwoTone,
+ CheckCircleOutlined,
+ MoreOutlined
+
+} from '@ant-design/icons';
+import dayjs from 'dayjs';
+dayjs.extend(utc)
+import { KeyboardArrowUp, KeyboardArrowDown } from '@mui/icons-material'
+
+
+import PropTypes from 'prop-types';
+import TableContainer from '@mui/material/TableContainer';
+import TablePagination from '@mui/material/TablePagination';
+import TableSortLabel from '@mui/material/TableSortLabel';
+import { visuallyHidden } from '@mui/utils';
+import { useEffect } from 'react';
+import MainCard from 'components/MainCard';
+
+
+
+
+const Client = () => {
+ let theme = useTheme();
+ const [rows, setRows] = useState([]);
+ const [loading, setLoading] = useState(false);
+
+ const [searchword, setSearchword] = useState('');
+ const [stafflist, setStafflist] = useState([]);
+
+
+
+ useEffect(() => {
+ if (localStorage.getItem('tenantid')) {
+ fetchtable(localStorage.getItem('tenantid'))
+
+ }
+ }, [])
+
+
+ useEffect(() => {
+ if (searchword) {
+ let arr = stafflist.filter((val) => {
+
+ return (val.firstname.toLowerCase().includes(searchword.toLowerCase())
+ // || val.locationaddress.toLowerCase().includes(searchword.toLowerCase())
+ || val.contactno.toLowerCase().includes(searchword.toLowerCase())
+ // || val.productname.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.address.toString().toLowerCase().includes(searchword.toLowerCase())
+ // || val.staffname.toString().toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+ } else {
+ setRows([...stafflist])
+ }
+ }, [searchword])
+
+ const fetchtable = async (tid) => {
+ setLoading(true)
+ try {
+ // await axios.get(`${process.env.REACT_APP_URL2}/orders/getordershiftsbystatus`)
+ await axios.get(`${process.env.REACT_APP_URL}/customers/getbytid/?tenantid=${tid}`)
+
+ .then((res) => {
+ if (res.data.message === "Successful") {
+ let arr = []
+ res.data.details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ // setArr(arr)
+ setRows([...arr])
+ setStafflist([...arr])
+ console.log(res.data.Details)
+ console.log(arr)
+ setLoading(false)
+ }
+
+ }).catch((err) => {
+ console.log(err)
+ setLoading(false)
+ })
+
+ } catch (err) {
+ console.log(err);
+ setLoading(false)
+
+ }
+ }
+
+
+
+
+
+ function descendingComparator(a, b, orderBy) {
+ if (b[orderBy] < a[orderBy]) {
+ return -1;
+ }
+ if (b[orderBy] > a[orderBy]) {
+ return 1;
+ }
+ return 0;
+ }
+
+ function getComparator(order, orderBy) {
+ return order === 'desc'
+ ? (a, b) => descendingComparator(a, b, orderBy)
+ : (a, b) => -descendingComparator(a, b, orderBy);
+ }
+
+ // Since 2020 all major browsers ensure sort stability with Array.prototype.sort().
+ // stableSort() brings sort stability to non-modern browsers (notably IE11). If you
+ // only support modern browsers you can replace stableSort(exampleArray, exampleComparator)
+ // with exampleArray.slice().sort(exampleComparator)
+ function stableSort(array, comparator) {
+ const stabilizedThis = array.map((el, index) => [el, index]);
+ stabilizedThis.sort((a, b) => {
+ const order = comparator(a[0], b[0]);
+ if (order !== 0) {
+ return order;
+ }
+ return a[1] - b[1];
+ });
+ return stabilizedThis.map((el) => el[0]);
+ }
+
+
+
+
+
+ const headCells = [
+ {
+ id: 'sno',
+ disablePadding: true,
+ label: '#',
+
+ },
+ {
+ id: 'tenantname',
+ numeric: false,
+ disablePadding: false,
+ label: 'CLIENT',
+ },
+ // {
+ // id: 'orderid',
+ // numeric: false,
+ // disablePadding: false,
+ // label: 'CONTACT',
+ // },
+ {
+ id: 'eventname',
+ disablePadding: false,
+ label: 'ADDRESS',
+ },
+ {
+ id: 'starttime1',
+ disablePadding: false,
+ label: 'LANDMARK',
+ },
+ {
+ id: 'starttime',
+ disablePadding: false,
+ label: 'CITY',
+ },
+ // {
+ // id: 'endtime',
+ // disablePadding: false,
+ // label: 'END TIME',
+ // },
+ // {
+ // id: 'staff',
+ // numeric: false,
+ // disablePadding: false,
+ // label: 'STAFF',
+ // },
+
+ // {
+ // id: 'orderstatus',
+ // disablePadding: false,
+ // label: 'STATUS',
+ // },
+ // {
+ // id: 'orderstatus',
+ // disablePadding: false,
+ // label: 'Details',
+ // }
+ {
+ id: 'orderstatus1',
+ disablePadding: false,
+ label: 'ACTION',
+ }
+ ];
+
+
+ function EnhancedTableHead(props) {
+ const {
+ // onSelectAllClick,
+ order, orderBy,
+ // numSelected, rowCount,
+ onRequestSort } =
+ props;
+ const createSortHandler = (property) => (event) => {
+ onRequestSort(event, property);
+ };
+
+ return (
+
+
+ {/*
+ 0 && numSelected < rowCount}
+ checked={rowCount > 0 && numSelected === rowCount}
+ onChange={onSelectAllClick}
+ inputProps={{
+ 'aria-label': 'select all desserts',
+ }}
+ />
+ */}
+ {headCells.map((headCell) => (
+
+
+ {headCell.label}
+ {orderBy === headCell.id ? (
+
+ {order === 'desc' ? 'sorted descending' : 'sorted ascending'}
+
+ ) : null}
+
+
+ ))}
+
+
+ );
+ }
+
+ EnhancedTableHead.propTypes = {
+ numSelected: PropTypes.number.isRequired,
+ onRequestSort: PropTypes.func.isRequired,
+ onSelectAllClick: PropTypes.func.isRequired,
+ order: PropTypes.oneOf(['asc', 'desc']).isRequired,
+ orderBy: PropTypes.string.isRequired,
+ rowCount: PropTypes.number.isRequired,
+ };
+
+
+
+ function EnhancedTable() {
+ const [order, setOrder] = React.useState('asc');
+ const [orderBy, setOrderBy] = React.useState('calories');
+ const [selected, setSelected] = React.useState([]);
+ const [page, setPage] = React.useState(0);
+ // const [dense, setDense] = React.useState(false);
+ const [rowsPerPage, setRowsPerPage] = React.useState(10);
+ const [expandopen, setExpandopen] = useState('');
+ const [open, setOpen] = useState('');
+ // const [stafflog, setStafflog] = useState([]);
+ // const [loading1, setLoading1] = useState(false);
+ // const [currentshiftobj, setCurrentshiftobj] = useState({});
+ const [loading1, setLoading1] = useState(false);
+ const [staffdetaillist, setStaffdetaillist] = useState([]);
+ const [anchorEl, setAnchorEl] = React.useState(null);
+ const [currentcustomerid,setCurrentcustomerid]=useState('')
+
+ const handleClickAway = () => {
+ setOpen('');
+ };
+ // const fetchstafflog = async (uid, sid) => {
+ // setLoading1(true)
+ // try {
+ // await axios.get(`${process.env.REACT_APP_URL2}/staffs/get/stafflogbytid/?userid=${uid}&shiftid=${sid}`)
+ // .then((res) => {
+ // if (res.data.message === "Success") {
+
+ // console.log(res.data.details)
+ // setStafflog(res.data.details);
+ // setLoading1(false)
+ // }
+
+ // }).catch((err) => {
+ // console.log(err)
+ // setLoading1(false)
+ // })
+
+ // } catch (err) {
+ // console.log(err);
+ // setLoading1(false)
+
+ // }
+ // }
+ const removeclient = async () => {
+ setLoading(true)
+ try {
+ await axios.delete(`${process.env.REACT_APP_URL}/customers/delete/?customerid=${currentcustomerid}`)
+
+ .then((res) => {
+ if (res.data.status) {
+ enqueueSnackbar("Deleted Successfully", {
+ variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
+ autoHideDuration: 2000
+ })
+ setCurrentcustomerid('')
+ fetchtable(localStorage.getItem('tenantid'))
+ }
+ setLoading(false)
+
+ }).catch((err) => {
+ console.log(err)
+ setLoading(false)
+ })
+
+ } catch (err) {
+ console.log(err);
+ setLoading(false)
+
+ }
+ }
+
+ const fetchstafflist = async (oid) => {
+ setLoading1(true)
+ try {
+ // await axios.get(`${process.env.REACT_APP_URL2}/orders/getorderprocessbyid?orderheaderid=${oid}`)
+ await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getorderprocessbyid?orderheaderid=${oid}`)
+
+ .then((res) => {
+ console.log(res)
+ if (res.data.message === "Successful") {
+
+ let arr = []
+ res.data.details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ // setRows([...arr])
+ setStaffdetaillist([...arr])
+ // console.log(res.data.Details)
+ // console.log(arr)
+ // setLoading(false)
+ }
+ setLoading1(false)
+
+ }).catch((err) => {
+ console.log(err)
+ setLoading1(false)
+ })
+
+ } catch (err) {
+ console.log(err);
+ setLoading1(false)
+
+ }
+ }
+
+
+ const staffearningsverify = async (sid) => {
+ setLoading(true)
+ try {
+ // await axios.get(`${process.env.REACT_APP_URL2}/orders/getorderprocessbystatus`)
+ await axios.put(`${process.env.REACT_APP_URL2}/staffs/earnings/update`,
+ {
+ "staffearningsid": sid,
+ "verified":1
+ })
+ // await axios.get(`${process.env.REACT_APP_URL2}/staffs/earnings/?fromdate=2023-09-07&todate=2023-09-09`)
+
+
+ .then((res) => {
+ console.log(res)
+ if (res.data.status) {
+ // let arr = []
+ // res.data.Details.map((val, i) => {
+ // arr = [...arr, { ...val, sno: i + 1 }];
+ // })
+ // // setArr(arr)
+ // setRows(arr)
+ // console.log(res.data.Details)
+ // console.log(arr)
+ // setLoading(false)
+ enqueueSnackbar("Updated Successfully", {
+ variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
+ autoHideDuration: 2000
+ })
+ // setTimeout(() => {
+
+ if (localStorage.getItem('appuserid')) {
+ fetchtable(localStorage.getItem('appuserid'))
+
+ }
+
+ // }, 2000)
+ }
+
+ }).catch((err) => {
+ console.log(err)
+ setLoading(false)
+ })
+
+ } catch (err) {
+ console.log(err);
+ setLoading(false)
+
+ }
+ }
+
+
+ const handleRequestSort = (event, property) => {
+ const isAsc = orderBy === property && order === 'asc';
+ setOrder(isAsc ? 'desc' : 'asc');
+ setOrderBy(property);
+ };
+
+ const handleSelectAllClick = (event) => {
+ if (event.target.checked) {
+ const newSelected = rows.map((n) => n.name);
+ setSelected(newSelected);
+ return;
+ }
+ setSelected([]);
+ };
+
+ const handleClick = (event, name) => {
+ const selectedIndex = selected.indexOf(name);
+ let newSelected = [];
+
+ if (selectedIndex === -1) {
+ newSelected = newSelected.concat(selected, name);
+ } else if (selectedIndex === 0) {
+ newSelected = newSelected.concat(selected.slice(1));
+ } else if (selectedIndex === selected.length - 1) {
+ newSelected = newSelected.concat(selected.slice(0, -1));
+ } else if (selectedIndex > 0) {
+ newSelected = newSelected.concat(
+ selected.slice(0, selectedIndex),
+ selected.slice(selectedIndex + 1),
+ );
+ }
+
+ setSelected(newSelected);
+ };
+
+ const handleChangePage = (event, newPage) => {
+ setPage(newPage);
+ };
+
+ const handleChangeRowsPerPage = (event) => {
+ setRowsPerPage(parseInt(event.target.value, 10));
+ setPage(0);
+ };
+
+ // const handleChangeDense = (event) => {
+ // setDense(event.target.checked);
+ // };
+
+ const isSelected = (name) => selected.indexOf(name) !== -1;
+
+ // Avoid a layout jump when reaching the last page with empty rows.
+ const emptyRows =
+ page > 0 ? Math.max(0, (1 + page) * rowsPerPage - rows.length) : 0;
+
+ const visibleRows = React.useMemo(
+ () =>
+ stableSort(rows, getComparator(order, orderBy)).slice(
+ page * rowsPerPage,
+ page * rowsPerPage + rowsPerPage,
+ ),
+ [order, orderBy, page, rowsPerPage],
+ );
+
+ const handleClose = () => {
+ setOpen(false);
+ };
+
+ function AlertCustomerDelete({
+ // title,
+ open, handleClose }) {
+ // const [deletepassword, setDeletepassword] = useState('');
+
+ return (
+
+ );
+ }
+
+
+
+
+
+ return (
+ <>
+ {loading && }
+
+
+ {/* */}
+
+
+
+
+
+
+ {(loading) &&
+ <>
+
+ {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((item) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+
+ >
+ }
+
+
+
+
+ {visibleRows.map((row, index) => {
+ const isItemSelected = isSelected(row.sno);
+ const labelId = `enhanced-table-checkbox-${index}`;
+
+ return (
+ <>
+ handleClick(event, row.sno)}
+ role="checkbox"
+ aria-checked={isItemSelected}
+ tabIndex={-1}
+ key={row.sno}
+ sx={{ cursor: 'pointer' }}
+ >
+
+
+ {/* */}
+ {row.sno}
+ {/*
+ {
+ if(!expandopen){
+ fetchstafflist(row.orderheaderid)
+ }
+ setExpandopen((expandopen === row.sno) ? '' : row.sno)
+
+ }}>
+ {(expandopen === row.sno) ?
+
+ :
+
+
+ }
+
+ */}
+ {/* */}
+
+
+
+
+
+
+
+
+
+ {`${row.firstname} ${row.lastname}`}
+
+
+ {/* {row.identification}*/}
+ {row.contactno}
+
+
+
+
+ {/*
+
+
+ {row.contactno}
+
+
+
+
+ */}
+
+
+ {row.address}
+ {/*
+ {`${row.locationaddress.slice(0, 25)}${(row.locationaddress.length > 25)?'...':''}`}
+ */}
+
+
+
+ {row.landmark}
+
+ {/*
+
+ {dayjs(row.Endtime)
+ // .utc()
+ .format('MM/DD/YYYY')}
+ {dayjs(row.Endtime)
+ // .utc()
+ .format('hh:mm A')}
+
+ */}
+ {/*
+
+
+ {row.staffname}
+
+
+
+
+
+ */}
+
+ {row.city}
+
+
+
+ {/*
+ {
+ fetchstafflist(row.orderheaderid)
+ setExpandopen((expandopen === row.sno) ? '' : row.sno)
+
+ }}>
+ {(expandopen === row.sno) ?
+
+ :
+
+
+ }
+
+ */}
+ {/* */}
+
+ {/*
+
+
+ {(row.orderstatus === 'pending'
+ ) &&
+
+ {
+
+
+ }}>
+
+
+
+ }
+
+
+ {
+
+ setCurrentshiftobj({ ...row })
+ console.log(row)
+ setStafflog([])
+ fetchstafflog(row.Userid, row.shiftid)
+ setOpen(true)
+
+ }}>
+
+
+
+ */}
+
+ {
+ setOpen(true)
+ setCurrentcustomerid(row.customerid)
+ }}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
+
+
+
+ Contact Name
+ Contact No
+
+
+
+
+
+ {(row.ordercontacts.map((val) => {
+ return <>
+
+ {val.contactname}
+ {val.contactno}
+
+ >
+ }))
+
+ }
+
+
+
+
+ */}
+
+ {(loading1) ?
+ <>
+
+
+
+
+
+
+ >
+
+ :
+
+
+
+
+
+ #
+ Staff
+ Start Time
+ End Time
+ {/* Pay Rate */}
+
+ {/* Category */}
+ Clockin
+ Clockout
+ Actual Hrs
+
+ Hrs Worked
+
+ OT
+
+Deficit
+
+ {/* Experience */}
+
+ {/* Level */}
+ {/* City */}
+ Status
+ Action
+
+
+
+
+ {/* {row.ordeprocessInfo.map((val, i) => { */}
+ {staffdetaillist.map((val, i) => {
+
+ return
+
+
+ res.userid == val.userid)) ? '#f5f5f5' : '', ':hover': {
+ // backgroundColor: (staffarr.find((res) => res.userid == val.userid)) ? '#f5f5f5 !important' : ''
+ // }
+ }}>
+
+ {i + 1}
+
+
+
+
+
+ {val.staffname}
+
+
+
+
+
+
+
+
+ {dayjs(val.starttime)
+ // .utc()
+ .format('MM/DD/YYYY')}
+ {dayjs(val.starttime)
+ // .utc()
+ .format('hh:mm A')}
+
+
+
+
+ {dayjs(val.endtime)
+ // .utc()
+ .format('MM/DD/YYYY')}
+ {dayjs(val.endtime)
+ // .utc()
+ .format('hh:mm A')}
+
+
+ {/* {val.rolecost} */}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {val.workhours}
+
+ {val.hoursworked}
+
+{val.overtime}
+{val.shorttime}
+
+
+
+
+
+
+ {(val.orderstatus === 'pending') &&
+
+
+ }
+ {(val.orderstatus === 'cancelled') &&
+
+
+
+ }
+ {(val.orderstatus === 'completed') &&
+
+
+ }
+ {(val.orderstatus === 'processing') &&
+
+ }
+ {(val.orderstatus === 'assigned') &&
+
+ }
+ {(val.orderstatus === 'confirmed') &&
+
+ }
+
+ {(val.orderstatus === 'active') &&
+
+ }
+ {(val.orderstatus === 'closed') &&
+
+ }
+
+
+
+
+
+
+
+ {((val.verified == 0)&&(val.orderstatus === 'completed'))&&
+ <>
+
+
+ handleClick1(e, row.sno)}
+ onClick={(e)=>{
+ setOpen(i+1)
+ setAnchorEl(e.currentTarget);
+ }}
+ aria-describedby={`aria-${row.sno}`}
+ >
+
+
+
+
+
+ {
+
+ // setApproveid(true)
+ // setDisableid(false)
+
+ // setExpandopen('')
+ // setRolestab(0)
+ staffearningsverify(val.staffearningsid)
+ // fetchclientbyid(row.tenantid, row.sno);
+ // fetchclientpricing(row.tenantid)
+ // setEditexpandopen(row.sno)
+
+ handleClickAway()
+ }}
+ >
+
+
+ Verify
+
+
+
+
+
+
+ >
+ }
+
+ {(val.verified == 1)&&
+
+ <>
+
+
+
+
+
+
+
+ >
+
+ }
+
+
+
+
+
+
+ })
+ }
+
+
+
+ }
+
+
+
+
+
+ >
+ );
+ })}
+ {emptyRows > 0 && (
+
+
+
+ )}
+
+
+
+
+
+
+
+ >
+ );
+ }
+
+
+
+ return <>
+
+
+
+ Clients
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+}
+
+export default Client;
\ No newline at end of file
diff --git a/src/pages/nearle/clients/createclient.js b/src/pages/nearle/clients/createclient.js
new file mode 100644
index 0000000..6f0b651
--- /dev/null
+++ b/src/pages/nearle/clients/createclient.js
@@ -0,0 +1,602 @@
+import { useEffect, useState } from 'react';
+
+// material-ui
+import { useTheme } from '@mui/material/styles';
+import {
+ Box, Button, FormLabel, Grid, InputLabel,
+ MenuItem,
+ Select, Stack, TextField, Typography
+} from '@mui/material';
+
+// third-party
+// import { PatternFormat } from 'react-number-format';
+
+// project import
+import Avatar from 'components/@extended/Avatar';
+import MainCard from 'components/MainCard';
+import {
+ // facebookColor, linkedInColor, twitterColor
+ ThemeMode
+} from 'config';
+import axios from 'axios';
+// assets
+import {
+ // FacebookFilled, LinkedinFilled, TwitterSquareFilled,
+ CameraOutlined
+} from '@ant-design/icons';
+import { usePlacesWidget } from "react-google-autocomplete";
+import Loader from 'components/Loader';
+import Geocode from "react-geocode";
+import { enqueueSnackbar } from 'notistack';
+import { useNavigate } from 'react-router';
+// import { setLocationType } from 'react-geocode';
+
+// const avatarImage = require.context('assets/images/users', true);
+
+// styles & constant
+// const ITEM_HEIGHT = 48;
+// const ITEM_PADDING_TOP = 8;
+// const MenuProps = {
+// PaperProps: {
+// style: {
+// maxHeight: ITEM_HEIGHT * 4.5 + ITEM_PADDING_TOP
+// }
+// }
+// };
+
+const Createclient = () => {
+ const theme = useTheme();
+ const [selectedImage, setSelectedImage] = useState(undefined);
+ const [avatar, setAvatar] = useState(
+ // avatarImage(`./default.png`)
+ );
+ const [businessname, setBusinessname] = useState('');
+ const [businessno, setBusinessno] = useState('');
+ // const [role, setRole] = useState('');
+ const [mobilenumber, setMobilenumber] = useState('')
+ const [emailaddress, setEmailaddress] = useState('')
+ const [city, setCity] = useState('')
+ const [zipcode, setZipcode] = useState('');
+ const [address, setAddress] = useState('');
+ const [state, setState] = useState('');
+ const [suburb, setSuburb] = useState('');
+ const [latlong, setLatlong] = useState({});
+ const [profiledetails, setProfiledetails] = useState({});
+ const [primarycontact,setPrimarycontact]=useState('')
+ const [firstname,setFirstname]=useState('');
+ const [doorno,setDoorno]=useState('');
+ const [landmark,setLandmark]=useState('')
+
+ const navigate = useNavigate();
+
+ Geocode.setApiKey(process.env.REACT_APP_GOOGLE_MAPS_API_KEY);
+ // Geocode.setApiKey('AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8');
+
+
+ const [loading, setLoading] = useState(false)
+
+ useEffect(() => {
+ // fetchprofiledetails(localStorage.getItem('appuserid'));
+ // fetchprofiledetails(181);
+
+ }, [])
+
+ useEffect(() => {
+ try {
+ Geocode.fromAddress(address).then(
+ (response) => {
+ if (response.status == 'OK') {
+
+
+ const { lat, lng } = response.results[0].geometry.location;
+ setLatlong({
+ lat, lng
+ })
+ console.log(response);
+
+
+ }
+
+ }, (error) => {
+ console.log(error)
+ }
+ );
+
+ } catch (err) {
+ console.log(err)
+
+ }
+
+ }, [address])
+
+ const opentoast = (message) => {
+
+ enqueueSnackbar(message, {
+ variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
+ autoHideDuration: 2000
+ })
+ // console.log(alertmessage)
+ }
+
+ const fetchprofiledetails = async (userid) => {
+ if (userid) {
+ setLoading(true)
+ try {
+ await axios.get(`${process.env.REACT_APP_URL2}/tenants/getclient?id=${userid}`)
+ .then((res) => {
+ console.log(res)
+ if (res.data.message === 'Successful') {
+ let res1 = res.data.details;
+ setProfiledetails(res1)
+ setBusinessname(res1.tenantname)
+ setBusinessno(res1.registrationno);
+ setMobilenumber(res1.contactno);
+ setPrimarycontact(res1.primarycontact)
+ setEmailaddress(res1.primaryemail);
+ setAddress(res1.address);
+ setCity(res1.city);
+ setZipcode(res1.postcode);
+ setState(res1.state);
+ setSuburb(res1.suburb);
+ setLatlong({
+ lat: res1.latitude,
+ lng: res1.longitude
+ })
+ }
+ setLoading(false)
+ }).catch((err) => {
+ console.log(err)
+ setLoading(false)
+
+ })
+
+ } catch (err) {
+ console.log(err)
+ setLoading(false)
+
+ }
+ }
+ }
+
+ useEffect(() => {
+ if (selectedImage) {
+ setAvatar(URL.createObjectURL(selectedImage));
+ }
+ }, [selectedImage]);
+
+
+
+ const { ref: materialRef } = usePlacesWidget({
+ apiKey: process.env.REACT_APP_GOOGLE_MAPS_API_KEY,
+ onPlaceSelected: (place) => {
+
+ console.log(place)
+
+ setAddress(place.formatted_address)
+ let city1, zipcode1, state1,suburb1;
+ for (let i = 0; i < place.address_components.length; i++) {
+ for (let j = 0; j < place.address_components[i].types.length; j++) {
+ switch (place.address_components[i].types[j]) {
+ case "locality":
+ city1 = place.address_components[i].long_name;
+ break;
+ case "administrative_area_level_1":
+ state1 = place.address_components[i].long_name;
+ break;
+ case "postal_code":
+ zipcode1 = place.address_components[i].long_name;
+ break;
+ case "sublocality":
+ suburb1 = place.address_components[i].long_name;
+ break;
+ }
+ }
+ }
+ setCity(city1 || '')
+ setState(state1 || '');
+ setZipcode(zipcode1 || '');
+ setSuburb(suburb1 || '')
+
+ // setAddress(place.formatted_address)
+ },
+ // inputAutocompleteValue: "country",
+ options: {
+ // componentRestrictions: 'us',
+ // types: ["establishment"]
+ types: ['address' || 'geocode']
+ },
+ });
+
+
+
+ const createprofile = async () => {
+ console.log('res', businessname, businessno, mobilenumber, emailaddress, address, city, zipcode)
+
+ if (!businessname) {
+ opentoast('Fill Business name')
+ } else if (!businessno) {
+ opentoast('Fill Registration No')
+ } else if (!businessno) {
+ opentoast('Fill Registration No')
+ } else if (!firstname) {
+ opentoast('Fill Full name')
+ } else if (!mobilenumber) {
+ opentoast('Fill Mobile Number')
+ }else if (!emailaddress) {
+ opentoast('Fill emailaddress')
+ } else if (!address) {
+ opentoast('Fill Address')
+ } else if (!city) {
+ opentoast('Fill City')
+ } else if (!zipcode) {
+ opentoast('Fill post code')
+ } else if (!suburb) {
+ opentoast('Fill suburb')
+ } else if (!emailaddress) {
+ opentoast('Fill emailaddress')
+ } else if (!latlong.lat || !latlong.lng) {
+ opentoast('Choose valid address')
+ } else {
+ let obj={
+ "customerid":0,
+ "configid":1,
+ "firstname":firstname,
+ "applocationid":3,
+ "profileimage":"",
+ "dialcode":"+91",
+ "contactno":mobilenumber,
+ "devicetype":"",
+ "deviceid":"",
+ "customertoken":"",
+ "address":address,
+ "suburb":suburb,
+ "city":city,
+ "state":state,
+ "postcode":zipcode,
+ "landmark":landmark,
+ "doorno":doorno,
+ "latitude":latlong.lat.toString(),
+ "longitude":latlong.lng.toString(),
+ "tenantid":parseInt(localStorage.getItem('tenantid'))
+ }
+
+ console.log(obj)
+
+ setLoading(true)
+ try {
+ await axios.post(`${process.env.REACT_APP_URL}/customers/create`,obj)
+ .then((res) => {
+ console.log(res)
+ if (res.data.status) {
+
+ enqueueSnackbar(' Created Successfully ', {
+ variant: 'success', anchorOrigin: { vertical: 'top', horizontal: 'right' },
+ autoHideDuration: 2000
+ })
+ navigate('/clients')
+ // setTimeout(()=>{
+ // fetchprofiledetails(localStorage.getItem('appuserid'));
+
+ // },2000)
+ }else if(res.data.message == "Customer Already available"){
+ enqueueSnackbar("Customer Already available", {
+ variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
+ autoHideDuration: 2000
+ })
+ }
+ setLoading(false)
+ }).catch((err) => {
+ console.log(err)
+
+ setLoading(false)
+
+
+ })
+
+ } catch (err) {
+ console.log(err)
+ setLoading(false)
+
+ }
+ }
+ }
+
+ // const [experience, setExperience] = useState('0');
+
+ // const handleChange = (event) => {
+ // setExperience(event.target.value);
+ // };
+ return <>
+ {(loading) && }
+
+
+
+ Create Client
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Upload
+
+
+
+
+ setSelectedImage(e.target.files?.[0])}
+ />
+
+
+
+
+
+
+
+ Business Name
+ setBusinessname(e.target.value)}
+ value={businessname}
+ autoComplete='off'
+ />
+
+
+
+
+ Registration No
+ setBusinessno(e.target.value)}
+ value={businessno}
+ autoComplete='off'
+
+ />
+
+
+
+
+ Name
+ setFirstname(e.target.value)}
+ value={firstname}
+ autoComplete='off'
+
+ />
+
+
+
+ {/*
+
+ Role
+ setRole(e.target.value)}
+ value={role}
+ autoComplete='off'
+
+ />
+
+ */}
+
+
+
+
+
+
+
+
+
+
+ Phone Number
+
+
+ { }}
+ onChange={(e) => {
+ if(e.target.value.toString().length <= 10){
+ setMobilenumber(e.target.value)
+ }
+ }}
+ value={mobilenumber}
+ autoComplete='off'
+ // disabled
+ sx={{cursor: 'not-allowed'}}
+ />
+
+
+
+
+
+ Email Address
+ setEmailaddress(e.target.value)}
+ value={emailaddress}
+ autoComplete='off'
+
+ />
+
+
+
+
+
+
+ Address
+ setAddress(e.target.value)}
+ inputRef={materialRef}
+ />
+
+
+
+
+
+ Suburb
+ setSuburb(e.target.value)}
+ value={suburb}
+ autoComplete='off'
+
+ />
+
+
+
+
+ City
+ setCity(e.target.value)}
+ value={city}
+ autoComplete='off'
+
+ />
+
+
+
+
+
+ State
+ setState(e.target.value)}
+ value={state}
+ autoComplete='off'
+
+ />
+
+
+
+
+ Post Code
+ setZipcode(e.target.value)}
+ value={zipcode}
+ autoComplete='off'
+
+ />
+
+
+
+
+
+ Door No
+ setDoorno(e.target.value)}
+ value={doorno}
+ autoComplete='off'
+
+ />
+
+
+
+
+ Landmark
+ setLandmark(e.target.value)}
+ value={landmark}
+ autoComplete='off'
+
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+}
+
+export default Createclient;
\ No newline at end of file
diff --git a/src/pages/nearle/login.js b/src/pages/nearle/login.js
index 9330a8c..3f81c41 100644
--- a/src/pages/nearle/login.js
+++ b/src/pages/nearle/login.js
@@ -64,7 +64,7 @@ const Login = () => {
useEffect(() => {
if (localStorage.getItem("authname")
- // || localStorage.getItem("appuserid")
+ // || localStorage.getItem("appuserid")
) {
navigate('/dashboard')
}
@@ -82,30 +82,30 @@ const Login = () => {
// })
await axios.post(`${process.env.REACT_APP_URL}/users/login`, {
"authname": e.target.value,
- "configid":1,
- "password":'admin'
+ "configid": 1,
+ "password": 'admin'
})
- .then((res) => {
- console.log(res.data)
- if (res.data.details.authname === e.target.value) {
+ .then((res) => {
+ console.log(res.data)
+ if (res.data.details.authname === e.target.value) {
- setUsername(e.target.value);
- setCheckusername(false);
- }else{
- setCheckusername(true);
+ setUsername(e.target.value);
+ setCheckusername(false);
+ } else {
+ setCheckusername(true);
- }
- // if (res.data.authname === e.target.value) {
+ }
+ // if (res.data.authname === e.target.value) {
- // setUsername(e.target.value);
- // setCheckusername(false);
- // }
- }).catch((err) => {
- // if (err.response.data.message === 'No user found') {
+ // setUsername(e.target.value);
+ // setCheckusername(false);
+ // }
+ }).catch((err) => {
+ // if (err.response.data.message === 'No user found') {
setCheckusername(true);
- // }
- })
+ // }
+ })
} catch (err) {
console.log(err)
@@ -122,7 +122,7 @@ const Login = () => {
try {
await axios.post(`${process.env.REACT_APP_URL}/users/login`, {
"authname": username,
- "configid":1,
+ "configid": 1,
"password": password
}).then((res) => {
console.log(res.data)
@@ -151,6 +151,7 @@ const Login = () => {
localStorage.setItem("appuserid", res.data.details.userid);
localStorage.setItem("roleid", res.data.details.roleid);
+ localStorage.setItem("tenantid", res.data.details.tenantid);
navigate('/dashboard');
@@ -218,7 +219,8 @@ const Login = () => {
}}
>
@@ -234,7 +236,7 @@ const Login = () => {
justifyContent="center"
alignItems="center"
// sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 112px)' } }}
- sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 132px)' } }}
+ sx={{ minHeight: { xs: 'calc(100vh - 210px)', sm: 'calc(100vh - 134px)', md: 'calc(100vh - 140px)' } }}
>
@@ -406,7 +408,7 @@ const Login = () => {
{/* */}
diff --git a/src/pages/nearle/orders/createorder.js b/src/pages/nearle/orders/createorder.js
new file mode 100644
index 0000000..542fa5c
--- /dev/null
+++ b/src/pages/nearle/orders/createorder.js
@@ -0,0 +1,2022 @@
+import {
+ FormControl,
+ InputAdornment,
+ Grid,
+ Typography,
+ Stack,
+ Box,
+ // Autocomplete,
+ Button,
+ // Stepper,
+ // Step,
+ // StepLabel,
+ TextField,
+ Autocomplete,
+ CardActions,
+ // CardActions,
+ Chip,
+ // AvatarGroup,
+ // RadioGroup,
+ // Radio
+ Avatar,
+ // List,
+ // ListItem,
+ // IconButton,
+ // ListItemAvatar,
+ // ListItemText,
+ // Menu,
+ // MenuItem,
+ // ListItemIcon,
+ // Link,
+ Divider,
+ Table,
+ TableContainer,
+ TableRow,
+ TableCell,
+ TableHead,
+ TableBody,
+ // FormLabel,
+ Tooltip,
+ DialogTitle,
+ DialogContent,
+ Checkbox,
+ DialogActions,
+ CircularProgress,
+ ButtonGroup
+ // LinkOutlined
+} from '@mui/material';
+import { useNavigate } from 'react-router';
+import { PopupTransition } from 'components/@extended/Transitions';
+// var utc = require('dayjs/plugin/utc')
+
+import axios from 'axios';
+import { useTheme } from '@mui/material/styles';
+// import { usePlacesWidget } from "react-google-autocomplete";
+import Geocode from "react-geocode";
+// import {setApi} from "react-geocode";
+import Autocomplete1 from "react-google-autocomplete";
+// import logo from 'assets/images/location.png'
+
+import {
+ // EditOutlined,
+ PlusOutlined,
+ SearchOutlined
+} from '@ant-design/icons';
+
+import { DeleteOutlined } from '@ant-design/icons';
+
+import MainCard from 'components/MainCard';
+import {
+ EnvironmentOutlined,
+ // LinkOutlined,
+ // MailOutlined,
+ // MoreOutlined,
+ // PhoneOutlined
+} from '@ant-design/icons';
+import CheckCircleRoundedIcon from '@mui/icons-material/CheckCircleRounded';
+// import VisibilityIcon from '@mui/icons-material/Visibility';
+// import AccessTimeFilledIcon from '@mui/icons-material/AccessTimeFilled';
+// import EditCalendarIcon from '@mui/icons-material/EditCalendar';
+import AccessibilityNewIcon from '@mui/icons-material/AccessibilityNew';
+
+// import { PatternFormat } from 'react-number-format';
+import { DatePicker } from '@mui/x-date-pickers/DatePicker';
+import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
+import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
+import { TimePicker } from '@mui/x-date-pickers/TimePicker';
+
+// import DialogTitle from '@mui/material/DialogTitle';
+import Dialog from '@mui/material/Dialog';
+import {
+ useEffect, useState, Fragment
+ // useReducer
+} from 'react';
+// import { Label } from '@mui/icons-material';
+import dayjs from 'dayjs';
+// import { useDispatch } from 'react-redux';
+// import { openSnackbar, closeSnackbar } from 'store/reducers/snackbar';
+// import {Autocompletemap} from 'pages/autocompletemap'
+import { enqueueSnackbar } from 'notistack';
+// import { CheckBox } from '@mui/icons-material';
+// dayjs.extend(utc)
+
+
+
+
+const Createorder = () => {
+
+
+
+
+
+ const generatenumbers = (n) => {
+ let arr = []
+ for (let i = 1; i <= n; i++) {
+ arr.push({ label: i.toString() });
+ }
+ return arr;
+ }
+ // console.log(process.env.REACT_APP_GOOGLE_MAPS_API_KEY)
+ Geocode.setApiKey(process.env.REACT_APP_GOOGLE_MAPS_API_KEY)
+
+
+
+ const navigate = useNavigate();
+ const [open, setOpen] = useState({});
+ const [open1, setOpen1] = useState('')
+ const [open2, setOpen2] = useState(false)
+ const [shift, setShift] = useState(1);
+ const [clientlist, setClientlist] = useState([])
+ const [clientdetail, setClientdetail] = useState([]);
+ const [eventname, setEventname] = useState('');
+
+ const [startdate, setStartdate] = useState(dayjs().add(1, 'day').format('MM-DD-YYYY'));
+ const [enddate, setEnddate] = useState(dayjs().add(1, 'day').format('MM-DD-YYYY'));
+
+
+ const [positionoptions] = useState(generatenumbers(25));
+
+
+
+ const [roleoptions, setRoleoptions] = useState([]);
+
+ const theme = useTheme();
+
+ const [otherinstructions, setOtherinstructions] = useState('');
+
+ const [attireslist, setAttireslist] = useState([]);
+ const [serviceaddonslist, setServiceaddonslist] = useState([]);
+ const [orderaddonobj, setOrderaddonobj] = useState([]);
+
+ const [stafflist, setStafflist] = useState([]);
+ const [loading2, setLoading2] = useState(false);
+
+
+
+ const [shiftarr, setShiftarr] = useState([]);
+ const [shiftarr1, setShiftarr1] = useState([]);
+
+ const [orderarr, setOrderarr] = useState([]);
+
+
+ const [alertmessage, setAlertmessage] = useState('');
+ const [tabstatus, setTabstatus] = useState('')
+ const [tenantinfo, setTenantinfo] = useState({})
+
+
+ useEffect(() => {
+ if (localStorage.getItem('tenantid')) {
+ setOrderarr([{
+ sno: 1,
+ address: ''
+ }])
+ }
+ }, [clientdetail])
+
+ const fetchtenantinfo = async (tid) => {
+ await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`)
+ .then((res) => {
+ console.log(res)
+ if (res.data.status) {
+ setTenantinfo(res.data.details);
+ }
+ }).catch((err) => {
+ console.log(err)
+ })
+ }
+
+ const opentoast = (message) => {
+
+ enqueueSnackbar(message, {
+ variant: 'error', anchorOrigin: { vertical: 'top', horizontal: 'right' },
+ autoHideDuration: 2000
+ })
+ console.log(alertmessage)
+
+
+ }
+
+ function closeAddressModal() {
+ setOpen2(false);
+ }
+ const createsubmitobj1 = () => {
+
+
+ let orderdetailtemp = []
+ let orderdetailtemp1 = []
+
+ let orderamount1 = 0;
+ let ordervalue1 = 0;
+ let taxamount1 = 0;
+ let itemcount1 = 0;
+ let shiftcount = 0;
+
+ let datecheck = false;
+ let shiftcheck = false;
+ let timeupcomingcheck = false;
+ let shiftcontactcheck = false;
+
+
+ let loweststarttime = shiftarr1[0].details[0].starttime;
+
+
+ let dateres11 = dayjs().diff(dayjs(`${dayjs(startdate).format('YYYY-MM-DD')}`), 'd');
+
+
+ let temp = shiftarr1[shiftarr1.length - 1].details;
+
+ console.log(temp.length, shiftarr1[shiftarr1.length - 1].orderattires.length)
+
+
+ console.log('shiftarr1')
+ console.log(shiftarr1)
+ shiftarr1.map((val3) => {
+ shiftcount = shiftcount + 1;
+
+ console.log("val3");
+ console.log(val3)
+ if (val3.clientstaff.length === 0) {
+ shiftcontactcheck = true;
+ }
+ val3.details.map((val1) => {
+ console.log('leasttime', (val1.starttime.$d > val1.endtime.$d))
+ if (val1.starttime.$d < loweststarttime.$d) {
+ loweststarttime = val1.starttime
+ }
+ let dateres22 = dayjs().diff(dayjs(`${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val1.starttime).format('HH:mm:ss')}`), 'm');
+ if (dateres22 > 0 || isNaN(dateres22)) {
+ timeupcomingcheck = true;
+
+ }
+ console.log('timeupcomingcheck')
+ console.log(timeupcomingcheck, dateres22)
+
+ console.log(val1)
+ let dateres = dayjs(`${dayjs(enddate).format('YYYY-MM-DD')} ${dayjs(val1.endtime).format('HH:mm:ss')}`)
+ .diff(dayjs(`${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val1.starttime).format('HH:mm:ss')}`), 'm');
+
+
+ if (dateres < 240) {
+ datecheck = true;
+ }
+ console.log("val1")
+ console.log(val1)
+ console.log(shiftcheck)
+
+ if (!val1.role || !val1.starttime || !val1.endtime || !val1.orderqty) {
+ shiftcheck = true
+ }
+ })
+
+ let tempobj1 = [];
+ let temptenantstaffobj1 = [];
+ let tempattire1 = [];
+
+ val3.details.map((val) => {
+
+ orderamount1 = orderamount1 + parseFloat(val.landingamount);
+ ordervalue1 = ordervalue1 + parseFloat(val.productsumprice);
+ taxamount1 = taxamount1 + val.taxamount;
+ itemcount1 = itemcount1 + val.orderqty;
+ console.log('val.productsumprice')
+ console.log(val.productsumprice)
+ console.log(ordervalue1)
+
+
+
+
+
+ let tempobj = {
+ "orderdetailid": val.orderdetailid,
+ "orderheaderid": val.orderheaderid,
+ "tenantid": val.tenantid,
+ "locationid": val.locationid,
+ "shiftid": val3.sno,
+ "locationaddress": val3.address,
+ "locationcity": val3.city,
+ "locationstate": val3.state,
+ "locationlat": val3.latitude.toString(),
+ "locationlong": val3.longitude.toString(),
+ "productid": val.productid,
+ "productname": val.productname,
+ "productdescription": val.productdescription,
+ "starttime": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.starttime).format('HH:mm:ss')}`,
+ "endtime": `${dayjs(enddate).format('YYYY-MM-DD')} ${dayjs(val.endtime).format('HH:mm:ss')}`,
+ "unpaidbreak": val.unpaidbreak,
+ "orderqty": val.orderqty,
+ "price": val.price,
+ "unitid": val.unitid,
+ "unitname": val.unitname,
+ "landingamount": parseFloat(parseFloat(val.landingamount.toString()).toFixed(2)),
+ "taxamount": parseFloat(parseFloat(val.taxamount.toString()).toFixed(2)),
+ "productsumprice": parseFloat(parseFloat(val.productsumprice.toString()).toFixed(2)),
+ "workhours": parseFloat(val.workhours),
+ "orderattires": []
+ }
+
+ tempobj1.push({
+ "shiftid": 0,
+ "orderdetailid": val.orderdetailid,
+ "orderheaderid": val.orderheaderid,
+ "tenantid": clientdetail.tenantid,
+ "productid": val.productid,
+ "productname": val.productname,
+ "productdescription": val.productdescription,
+ "starttime": dayjs(`${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(val.starttime).format('HH:mm:ss')}`)
+ .format('YYYY-MM-DD HH:mm:ss'),
+ "endtime": dayjs(`${dayjs(enddate).format('YYYY-MM-DD')} ${dayjs(val.endtime).format('HH:mm:ss')}`)
+ .format('YYYY-MM-DD HH:mm:ss'),
+ "workhours": `${Math.floor(val.workhours)}.${Math.floor((val.workhours * 60) - (Math.floor(val.workhours) * 60))}`,
+ "unpaidbreak": val.unpaidbreak,
+ "price": val.price,
+ "orderqty": val.orderqty,
+ "unitid": val.unitid,
+ "unitname": val.unitname,
+ "taxpercent": 0.00,
+ "landingamount": parseFloat(parseFloat(val.landingamount.toString()).toFixed(2)),
+ "taxamount": parseFloat(parseFloat(val.taxamount.toString()).toFixed(2)),
+ "productsumprice": parseFloat(parseFloat(val.productsumprice.toString()).toFixed(2)),
+ "orderattires": []
+ })
+
+
+
+ console.log("val3")
+
+ console.log(val3)
+ val3.orderattires.map((val2) => {
+ if (val.sno === val2.ordersno) {
+
+
+ tempobj.orderattires.push({
+ "orderattireid": val2.orderattireid,
+ "orderdetailid": val2.orderdetailid,
+ "apptypeid": val2.apptypeid,
+ "attireid": val2.attireid,
+ "attirename": val2.attirename,
+ "Status": val2.Status
+ })
+
+ tempattire1.push({
+ "orderattireid": val2.orderattireid,
+ "orderdetailid": val2.orderdetailid,
+ "apptypeid": val2.apptypeid,
+ "attireid": val2.attireid,
+ "attirename": val2.attirename,
+ "Status": val2.Status
+ })
+ }
+ })
+
+
+
+ orderdetailtemp.push(tempobj)
+
+
+
+
+ })
+
+ val3.clientstaff.map((val11) => {
+ temptenantstaffobj1.push({
+ "ordercontactid": 0,
+ "shiftid": 0,
+ "orderheaderid": 0,
+ "tenantid": clientdetail.tenantid,
+ "userid": val11.userid,
+ "tenantstaffid": 12,
+ "contactname": val11.contactname,
+ "contactno": val11.contactno,
+ "shift": val11.shift
+ })
+
+ })
+
+
+
+
+ orderdetailtemp1.push({
+ "shiftid": 0,
+ "orderheaderid": 0,
+ "tenantid": clientdetail.tenantid,
+ "locationid": 0,
+ "locationaddress": val3.address,
+ "locationcity": val3.city,
+ "locationstate": val3.state,
+ "locationlat": val3.latitude.toString(),
+ "locationlong": val3.longitude.toString(),
+ "orderdetails": tempobj1,
+ "ordercontacts": temptenantstaffobj1
+ })
+
+ })
+
+ let addonobj = [];
+ orderaddonobj.map((val) => {
+ addonobj.push({
+ "orderaddonid": val.orderaddonid,
+ "orderheaderid": val.orderheaderid,
+ "tenantid": clientdetail.tenantid,
+ "addonid": val.addonid,
+ "addon": val.addon,
+ "status": val.status
+ })
+
+
+
+ })
+
+
+ if (!clientdetail.tenantname) {
+ setAlertmessage('choose client name');
+ opentoast('choose client name');
+ } else if (!eventname) {
+ setAlertmessage('choose Event name');
+ opentoast('choose Event name');
+ } else if (!startdate || !enddate) {
+ setAlertmessage('choose shift Date');
+ opentoast('choose shift Date');
+ } else if (datecheck) {
+ setAlertmessage('Shift time should be greater than 4 hours');
+ opentoast('Shift time should be greater than 4 hours');
+ } else if (dateres11 > 0 || timeupcomingcheck) {
+ setAlertmessage('choose upcoming date and time');
+ opentoast('choose upcoming date and time');
+ } else if (shiftarr1.length <= 0) {
+ setAlertmessage('Add shift');
+ opentoast('Add shift');
+ }
+ else if (shiftcheck) {
+ setAlertmessage('choose all shift details');
+ opentoast('choose all shift details');
+ }
+ else if (shiftcontactcheck) {
+ opentoast('choose shift contacts');
+ }
+ else {
+
+
+
+ let obj =
+ {
+ "orderheaderid": 0,
+ "tenantid": clientdetail.tenantid,
+ "locationid": 0,
+ "customerid": 0,
+ "configid": 4,
+ "orderid": "",
+ "orderdate": dayjs()
+ .format('YYYY-MM-DD HH:mm:ss'),
+ "orderstatus": "pending",
+ "pending": dayjs()
+ .format('YYYY-MM-DD HH:mm:ss'),
+
+ "orderamount": parseFloat(parseFloat(orderamount1).toFixed(2)),
+ "taxpercent": 0.0,
+ "taxamount": parseFloat(parseFloat(taxamount1).toFixed(2)),
+ "ordercharges": 0,
+ "ordervalue": parseFloat(parseFloat(ordervalue1).toFixed(2)),
+ "itemcount": itemcount1,
+ "refundvalue": 0,
+ "unserviceableitems": 0,
+ "paymenttype": 0,
+ "paymentstatus": 0,
+ "startdate": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(startdate).format('HH:mm:ss')}`,
+ "enddate": `${dayjs(enddate).format('YYYY-MM-DD')} ${dayjs(enddate).format('HH:mm:ss')}`,
+ "deliveryaddress": "",
+ "deliverylocationid": 0,
+ "deliverylat": "",
+ "deliverylong": "",
+ "ordernotes": eventname,
+ "remarks": otherinstructions,
+ "primarycontact": '',
+ "primarycontactno": '',
+ "seccontact": '',
+ "seccontactno": '',
+ "tenantuserid": clientdetail.tenantid,
+ "orderdetails": orderdetailtemp,
+ "orderaddons": addonobj
+ }
+ console.log(obj)
+
+
+
+ let obj1 = {
+
+ "orderheaderid": 0,
+ "tenantid": clientdetail.tenantid,
+ "locationid": 0,
+ "customerid": 0,
+ "configid": 4,
+ "orderid": "",
+ "orderdate": dayjs()
+ .format('YYYY-MM-DD HH:mm:ss'),
+ "orderstatus": "pending",
+ "pending": dayjs()
+ .format('YYYY-MM-DD HH:mm:ss'),
+ "orderamount": parseFloat(parseFloat(orderamount1).toFixed(2)),
+ "taxpercent": 0.0,
+ "taxamount": parseFloat(parseFloat(taxamount1).toFixed(2)),
+ "ordercharges": 0,
+ "ordervalue": parseFloat(parseFloat(ordervalue1).toFixed(2)),
+ "itemcount": shiftcount,
+ "startdate": `${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(loweststarttime.$d).format('HH:mm:ss')}`,
+ "enddate": `${dayjs(enddate).format('YYYY-MM-DD')} ${dayjs(enddate).format('HH:mm:ss')}`,
+ "ordernotes": eventname,
+ "remarks": otherinstructions,
+ "primarycontact": '',
+ "primarycontactno": '',
+ "seccontact": '',
+ "seccontactno": '',
+ "tenantuserid": 0,
+ "ordershifts": orderdetailtemp1,
+ "orderaddons": addonobj
+ }
+ console.log("obj1,orderdetailtemp1")
+ console.log(obj1, orderdetailtemp1)
+
+
+
+
+
+
+ navigate('/orders/create/review', {
+ state: {
+ obj: obj, client: clientdetail,
+ obj1: obj1
+
+ }
+ })
+
+ }
+
+ }
+
+
+ useEffect(() => {
+ if (localStorage.getItem('tenantid')) {
+ clientdetails(localStorage.getItem('tenantid'));
+ fetchtenantinfo(localStorage.getItem('tenantid'))
+ }
+
+ // fetchattires();
+ // fetchserviceaddons();
+ let arr = [];
+ arr.push({
+ sno: arr.length + 1,
+ address: "",
+ starttime: "",
+ endtime: "",
+ latitude: '',
+ longitude: '',
+ state: "",
+ city: "",
+ orderattires: [],
+ details: [{
+ sno: 1,
+ role: '',
+ position: '',
+ uniform: '',
+ cost: 0,
+
+ "orderdetailid": 0,
+ "orderheaderid": 0,
+ "tenantid": '',
+ "locationid": 0,
+ "productid": 1,
+ "productname": "",
+ "productdescription": "description1",
+ "starttime": '',
+ "endtime": '',
+ "unpaidbreak": 0,
+ "orderqty": 0,
+ "price": 0,
+ "unitid": 1,
+ "unitname": "",
+ "landingamount": 0,
+ "taxamount": 0,
+ "productsumprice": 0,
+ "workhours": ''
+ }],
+ "clientstaff": []
+
+ })
+ setShiftarr1(arr)
+ setShiftarr([])
+ }, [clientdetail.tenantname])
+
+
+
+
+
+
+
+
+ useEffect(() => {
+ console.log('shiftarr')
+ console.log(shiftarr)
+
+ }, [shiftarr])
+
+ const clicked1 = (e) => {
+ setShift(e);
+ }
+
+ const dialogopen = (i, result) => {
+ console.log(i, result)
+ setOpen({ shiftsno: result.sno, sno: i.sno })
+ }
+ const dialogclose = () => {
+
+ setOpen('')
+ }
+
+
+ const roleedit = (i, e, roleamount, result, result1) => {
+ let res1 = shiftarr1[result1.sno - 1].details.find((val) => val.productid === result.serviceid)
+
+
+ if (!res1) {
+
+
+ let arr = shiftarr1;
+ arr[result1.sno - 1].details[i.sno - 1].role = e.target.textContent;
+ arr[result1.sno - 1].details[i.sno - 1].cost = roleamount;
+ arr[result1.sno - 1].details[i.sno - 1].tenantid = result.tenantid;
+ arr[result1.sno - 1].details[i.sno - 1].productname = result.servicename;
+ arr[result1.sno - 1].details[i.sno - 1].productdescription = result.servicename;
+ arr[result1.sno - 1].details[i.sno - 1].unitname = result.unitname;
+ arr[result1.sno - 1].details[i.sno - 1].unitid = result.unitid;
+ arr[result1.sno - 1].details[i.sno - 1].price = roleamount;
+ arr[result1.sno - 1].details[i.sno - 1].taxamount = result.taxamount;
+ arr[result1.sno - 1].details[i.sno - 1].productid = result.serviceid;
+
+ console.log('result sum amount')
+ console.log(result)
+ console.log(shiftarr1[result1.sno - 1].details)
+ if (arr[result1.sno - 1].details[i.sno - 1].orderqty && arr[result1.sno - 1].details[i.sno - 1].price) {
+ arr[result1.sno - 1].details[i.sno - 1].landingamount = arr[result1.sno - 1].details[i.sno - 1].orderqty * arr[result1.sno - 1].details[i.sno - 1].price;
+
+ if (arr[result1.sno - 1].details[i.sno - 1].starttime && arr[result1.sno - 1].details[i.sno - 1].endtime) {
+ let dateres = dayjs(arr[result1.sno - 1].details[i.sno - 1].endtime).diff(dayjs(arr[result1.sno - 1].details[i.sno - 1].starttime), 'm');
+
+ console.log(dateres)
+ if (dateres >= 240) {
+ console.log("dateres")
+ arr[result1.sno - 1].details[i.sno - 1].landingamount = (arr[result1.sno - 1].details[i.sno - 1].orderqty * (dateres * (arr[result1.sno - 1].details[i.sno - 1].price / 60))).toFixed(2);
+ arr[result1.sno - 1].details[i.sno - 1].workhours = (dateres / 60).toFixed(2)
+ }
+
+ console.log(arr[result1.sno - 1].details[i.sno - 1].orderqty * (dateres * (arr[result1.sno - 1].details[i.sno - 1].price / 60)))
+ }
+ arr[result1.sno - 1].details[i.sno - 1].productsumprice = arr[result1.sno - 1].details[i.sno - 1].landingamount + arr[result1.sno - 1].details[i.sno - 1].taxamount;
+ }
+ console.log(arr)
+ setShiftarr1([...arr])
+ } else {
+ setAlertmessage('Selected role Already chosen');
+ opentoast('Selected role Already chosen')
+ }
+ }
+ const positionedit = (i, e, result, result1) => {
+
+
+ let arr = shiftarr1;
+ arr[result1.sno - 1].details[i.sno - 1].position = e.target.textContent;
+ arr[result1.sno - 1].details[i.sno - 1].orderqty = parseInt(e.target.textContent);
+ if (arr[result1.sno - 1].details[i.sno - 1].orderqty && arr[result1.sno - 1].details[i.sno - 1].price) {
+ arr[result1.sno - 1].details[i.sno - 1].landingamount = arr[result1.sno - 1].details[i.sno - 1].orderqty * arr[result1.sno - 1].details[i.sno - 1].price;
+ arr[result1.sno - 1].details[i.sno - 1].productsumprice = arr[result1.sno - 1].details[i.sno - 1].landingamount + arr[result1.sno - 1].details[i.sno - 1].taxamount;
+
+ if (arr[result1.sno - 1].details[i.sno - 1].starttime && arr[result1.sno - 1].details[i.sno - 1].endtime) {
+ let dateres = dayjs(arr[result1.sno - 1].details[i.sno - 1].endtime).diff(dayjs(arr[result1.sno - 1].details[i.sno - 1].starttime), 'm');
+
+ console.log(dateres)
+ if (dateres >= 240) {
+ console.log("dateres")
+ arr[result1.sno - 1].details[i.sno - 1].landingamount = (arr[result1.sno - 1].details[i.sno - 1].orderqty * (dateres * (arr[result1.sno - 1].details[i.sno - 1].price / 60))).toFixed(2)
+ arr[result1.sno - 1].details[i.sno - 1].workhours = (dateres / 60).toFixed(2)
+ }
+
+ console.log(arr[result1.sno - 1].details[i.sno - 1].orderqty * (dateres * (arr[result1.sno - 1].details[i.sno - 1].price / 60)))
+ }
+ arr[result1.sno - 1].details[i.sno - 1].productsumprice = arr[result1.sno - 1].details[i.sno - 1].landingamount + arr[result1.sno - 1].details[i.sno - 1].taxamount;
+ }
+
+ setShiftarr1([...arr])
+ console.log(arr)
+ }
+
+ const unpaidbreakedit = (i, e, result1) => {
+
+
+ let arr = shiftarr1;
+ arr[result1.sno - 1].details[i.sno - 1].unpaidbreak = parseInt(e.target.textContent.slice(0, 2));
+ console.log(parseInt(e.target.textContent.slice(0, 2)))
+ setShiftarr1([...arr])
+
+ }
+
+ const addshiftarr1 = () => {
+ let temp = shiftarr1[shiftarr1.length - 1].details;
+ console.log("temp")
+ console.log(temp.length, shiftarr1[shiftarr1.length - 1].orderattires.length)
+
+ if (temp[temp.length - 1].role && temp[temp.length - 1].position &&
+ temp[temp.length - 1].starttime && temp[temp.length - 1].endtime
+ ) {
+
+
+ let arr = shiftarr1;
+ arr.push({
+ sno: arr.length + 1,
+ address: "",
+ starttime: "",
+ endtime: "",
+ latitude: '',
+ longitude: '',
+ state: "",
+ city: "",
+ orderattires: [],
+ details: [{
+ sno: 1,
+ role: '',
+ position: '',
+ uniform: '',
+ cost: 0,
+ "orderdetailid": 0,
+ "orderheaderid": 0,
+ "tenantid": '',
+ "locationid": 0,
+ "productid": 1,
+ "productname": "",
+ "productdescription": "description1",
+ "starttime": '',
+ "endtime": '',
+ "unpaidbreak": 0,
+ "orderqty": 0,
+ "price": 0,
+ "unitid": 1,
+ "unitname": "",
+ "landingamount": 0,
+ "taxamount": 0,
+ "productsumprice": 0,
+ "workhours": ''
+
+ }],
+ "clientstaff": []
+
+ })
+ setShiftarr1([...arr])
+ console.log(arr)
+ } else {
+
+ if (!temp[temp.length - 1].role) {
+ setAlertmessage('choose Previous shift role')
+ opentoast('choose Previous shift role');
+ } else if (!temp[temp.length - 1].position) {
+ setAlertmessage('choose Previous shift Count')
+ opentoast('choose Previous shift Count');
+ } else if (!temp[temp.length - 1].starttime) {
+ setAlertmessage('choose Previous shift Start time')
+ opentoast('choose Previous shift Start time');
+ } else if (!temp[temp.length - 1].endtime) {
+ setAlertmessage('choose Previous shift End time')
+ opentoast('choose Previous shift End time');
+ }
+ }
+
+
+ }
+
+ const deleteshiftarr1 = (i) => {
+ let arr = shiftarr1;
+ console.log(i.sno)
+ if (arr.length > 1) {
+
+
+ arr.splice(i.sno - 1, 1);
+ arr.map((val, i) => {
+ val.sno = i + 1
+ })
+ setShiftarr1([...arr])
+ }
+ }
+
+
+
+ const addarr = (result) => {
+ if (clientdetail.tenantname
+ && result.details[result.details.length - 1].role
+ && result.details[result.details.length - 1].position
+ && result.details[result.details.length - 1].starttime
+ && result.details[result.details.length - 1].endtime
+
+
+
+ ) {
+
+
+
+ let arr = shiftarr1;
+ arr[result.sno - 1].details.push({
+ sno: arr[result.sno - 1].details.length + 1,
+ role: '',
+ position: '',
+ uniform: '',
+ cost: 0,
+
+ "orderdetailid": 0,
+ "orderheaderid": 0,
+ "tenantid": '',
+ "locationid": 0,
+ "productid": 1,
+ "productname": "",
+ "productdescription": "description1",
+
+ "starttime": '',
+ "endtime": '',
+ "unpaidbreak": 0,
+ "orderqty": 0,
+ "price": 0,
+ "unitid": 1,
+ "unitname": "",
+ "landingamount": 0,
+ "taxamount": 0,
+ "productsumprice": 0,
+ "workhours": ''
+
+ })
+ setShiftarr1([...arr])
+ } else {
+ if (!clientdetail.tenantname) {
+ setAlertmessage('choose client')
+ opentoast('choose client')
+ } else if (!result.details[result.details.length - 1].role) {
+ setAlertmessage('choose Role')
+ opentoast('choose Role')
+ } else if (!result.details[result.details.length - 1].position) {
+ setAlertmessage('choose Position')
+ opentoast('choose Position')
+ } else if (!result.details[result.details.length - 1].starttime) {
+ setAlertmessage('choose starttime')
+ opentoast('choose starttime')
+ } else if (!result.details[result.details.length - 1].endtime) {
+ setAlertmessage('choose endtime')
+ opentoast('choose endtime')
+ }
+ }
+ console.log(result)
+ }
+
+ const deletearr = (i, result) => {
+ if (result.details.length > 1) {
+ let arr = shiftarr1;
+ console.log('result')
+ arr[result.sno - 1].details.splice(i.sno - 1, 1);
+
+ arr[result.sno - 1].details.map((val, i) => {
+ val.sno = i + 1
+ })
+ let res = arr[result.sno - 1].orderattires.find((val) => val.ordersno === i.sno);
+ console.log('res')
+ console.log(res)
+ if (res) {
+ arr[result.sno - 1].orderattires.splice(res.sno - 1, 1);
+ arr[result.sno - 1].orderattires.map((val, i) => {
+ val.sno = i + 1;
+ if (res.ordersno <= val.sno) {
+ val.ordersno = val.ordersno - 1;
+ }
+ })
+ }
+ setShiftarr1([...arr]);
+ } else {
+ let arr = shiftarr1;
+ arr[result.sno - 1].details[0] =
+ {
+ sno: 1,
+ role: '',
+ position: '',
+ uniform: '',
+ cost: 0,
+
+ "orderdetailid": 0,
+ "orderheaderid": 0,
+ "tenantid": '',
+ "locationid": 0,
+ "productid": 1,
+ "productname": "",
+ "productdescription": "description1",
+
+ "starttime": '',
+ "endtime": '',
+ "unpaidbreak": 0,
+ "orderqty": 0,
+ "price": 0,
+ "unitid": 1,
+ "unitname": "",
+ "landingamount": 0,
+ "taxamount": 0,
+ "productsumprice": 0,
+ "workhours": ''
+
+ }
+ setShiftarr1([...arr]);
+ }
+ }
+
+ const editorderattire = (e, val2, val1, sno, result) => {
+ let arr = shiftarr1[result.sno - 1].orderattires;
+ console.log(shiftarr1, result)
+ console.log("sno", sno)
+ console.log("result", result)
+ let arr1 = shiftarr1;
+ let res2 = arr.find((val) => (val.ordersno === sno));
+ let res1 = arr.find((val) => (val.apptypeid === val2.apptypeid));
+
+ if (res2) {
+ if (!res1) {
+ arr.push({
+ "orderattireid": 0,
+ "orderdetailid": 0,
+ "apptypeid": val2.apptypeid,
+ "attireid": val2.attireid,
+ "attirename": val2.attirename,
+ "Status": val2.status,
+ "sno": arr.length + 1,
+ 'ordersno': sno
+
+ })
+ } else {
+ arr[res2.sno - 1] = {
+ "orderattireid": 0,
+ "orderdetailid": 0,
+ "apptypeid": val2.apptypeid,
+ "attireid": val2.attireid,
+ "attirename": val2.attirename,
+ "Status": val2.status,
+ "sno": res2.sno,
+ 'ordersno': sno
+
+ }
+ }
+
+
+ } else {
+ arr.push({
+ "orderattireid": 0,
+ "orderdetailid": 0,
+ "apptypeid": val2.apptypeid,
+ "attireid": val2.attireid,
+ "attirename": val2.attirename,
+ "Status": val2.status,
+ "sno": arr.length + 1,
+ 'ordersno': sno
+
+ })
+ }
+ arr1[result.sno - 1].orderattires = arr;
+ setShiftarr1([...arr1])
+
+
+ console.log('attireobj')
+ console.log(arr)
+ console.log(arr1)
+
+
+
+
+ }
+
+ const editorderaddonobj = (e, val2) => {
+ let arr = orderaddonobj;
+ let res = arr.find((val) => (val.addon === val2.addon));
+ if (!res
+ ) {
+ let res1 = arr.find((val) => (val.apptypeid === val2.apptypeid));
+ if (!res1) {
+ arr.push({
+ "orderaddonid": 0,
+ "orderheaderid": 0,
+ "tenantid": clientdetail.tenantid,
+ "addonid": val2.addonid,
+ "addon": val2.addon,
+ "status": val2.status,
+ "apptypeid": val2.apptypeid,
+ "sno": arr.length + 1
+ })
+ setOrderaddonobj([...arr])
+ } else {
+ console.log(res1)
+ arr[res1.sno - 1] = {
+ "orderaddonid": 0,
+ "orderheaderid": 0,
+ "tenantid": clientdetail.tenantid,
+ "addonid": val2.addonid,
+ "addon": val2.addon,
+ "status": val2.status,
+ "apptypeid": val2.apptypeid,
+ "sno": res1.sno
+ }
+ setOrderaddonobj([...arr])
+
+ }
+
+
+ }
+
+
+ console.log(arr)
+
+
+ }
+
+ const clientdetails = async (tid) => {
+
+ try {
+
+ await axios.get(`${process.env.REACT_APP_URL}/customers/getbytid/?tenantid=${tid}`)
+
+ .then((res) => {
+ if (res.data.status) {
+
+ setClientdetail(res.data.details)
+
+
+ }
+
+
+ }).catch((err) => {
+ console.log(err)
+
+ })
+
+ } catch (err) {
+ console.log(err);
+
+ }
+ }
+
+ const fetchroles = async (tenid) => {
+
+ try {
+
+ await axios.get(`${process.env.REACT_APP_URL2}/tenants/getservices/?tenantid=${tenid}`)
+
+ .then((res) => {
+ if (res.data.message === "Successful") {
+ let arr = []
+ res.data.details.map((val) => {
+
+ arr = [...arr, {
+ ...val, label: `${val.servicename}`
+ }];
+ })
+
+ setRoleoptions(arr)
+ console.log(res.data.details)
+
+ }
+
+ }).catch((err) => {
+ console.log(err)
+
+ })
+
+ } catch (err) {
+ console.log(err);
+
+ }
+ }
+
+
+
+ const fetchtenantstaffs = async (tenid) => {
+ setLoading2(true);
+ try {
+ await axios.get(`${process.env.REACT_APP_URL2}/tenantstaff/get?tenantid=${tenid}`)
+ .then((res) => {
+ console.log(res)
+ if (res.data.message === "Successful") {
+
+ setStafflist(res.data.details);
+ }
+ setLoading2(false);
+
+
+ }).catch((err) => {
+ console.log(err)
+ setLoading2(false);
+
+ })
+
+ } catch (err) {
+ console.log(err);
+ setLoading2(false);
+
+ }
+ }
+
+ const fetchattires = async () => {
+
+ try {
+ await axios.get(`${process.env.REACT_APP_URL2}/orders/getattires`)
+ .then((res) => {
+ if (res.data.message === "Success") {
+
+ setAttireslist(res.data.details)
+
+ }
+
+ }).catch((err) => {
+ console.log(err)
+
+ })
+
+ } catch (err) {
+ console.log(err);
+
+ }
+ }
+
+ const fetchserviceaddons = async () => {
+
+ try {
+ await axios.get(`${process.env.REACT_APP_URL2}/orders/getserviceaddons`)
+ .then((res) => {
+ if (res.data.message === "Success") {
+
+ console.log(res.data)
+ setServiceaddonslist(res.data.Details)
+
+ }
+
+ }).catch((err) => {
+ console.log(err)
+
+ })
+
+ } catch (err) {
+ console.log(err);
+
+ }
+ }
+
+
+
+
+ return <>
+
+
+
+
+
+ Create Order
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
+ Event
+
+
+
+
+
+
+ {
+ if (clientdetail.tenantname) {
+
+
+ if (e.target.value.length <= 50) {
+ setEventname(e.target.value);
+ }
+ } else {
+ setAlertmessage('choose client');
+ opentoast('choose client');
+ }
+ }}
+ sx={{ m: 0 }}
+ />
+
+ {`${eventname.length}/50`}
+
+ */}
+
+
+
+
+ {' '}{tenantinfo.address1 || ''}
+
+
+
+
+
+
+
+ {
+ let dateres11 = dayjs().diff(dayjs(`${dayjs(e).format('YYYY-MM-DD')}`), 'd');
+ console.log('dateres11')
+ console.log(dateres11)
+ if (dateres11 <= 0) {
+ setStartdate(e);
+ setEnddate(e);
+
+ } else {
+ setAlertmessage('choose Upcoming Date');
+ opentoast('choose Upcoming Date')
+ setStartdate(NaN)
+ }
+
+ }}
+ value={dayjs(startdate)}
+ sx={{ width: '100%' }}
+ disablePast
+ minDate={dayjs().add(1, 'day')}
+
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {shiftarr1.map((result) => {
+
+ return <>
+
+
+
+
+
+
+
+
+
+
+ {/* Shift {result.sno} */}
+
+
+
+ {/* */}
+
+
+
+
+
+ {/*
+
+ {
+ let city1, state, zipcode1, suburb1;
+ for (let i = 0; i < place.address_components.length; i++) {
+ for (let j = 0; j < place.address_components[i].types.length; j++) {
+ switch (place.address_components[i].types[j]) {
+ case "locality":
+ city1 = place.address_components[i].long_name;
+ break;
+ case "administrative_area_level_1":
+ state = place.address_components[i].long_name;
+ break;
+ case "postal_code":
+ zipcode1 = place.address_components[i].long_name;
+ break;
+ case "sublocality":
+ suburb1 = place.address_components[i].long_name;
+ break;
+ }
+ }
+ }
+ console.log(city1, state, zipcode1, suburb1)
+ let arr = shiftarr1;
+ try {
+ Geocode.fromAddress(place.formatted_address).then(
+ (response) => {
+ const { lat, lng } = response.results[0].geometry.location;
+ arr[result.sno - 1].latitude = lat;
+ arr[result.sno - 1].longitude = lng;
+
+ console.log(lat, lng);
+ },
+ (error) => {
+ console.error(error);
+ }
+ );
+ } catch (err) {
+ console.log(err)
+ }
+ arr[result.sno - 1].city = city1 || '';
+ arr[result.sno - 1].state = state || '';
+
+ arr[result.sno - 1].address = place.formatted_address;
+ setShiftarr1([...arr]);
+
+ }}
+ options={{
+
+ types: ['address' || 'geocode']
+
+ }}
+ placeholder='Shift Location'
+
+ onChange={() => {
+ if (!eventname) {
+ setAlertmessage('Fill Event name');
+ opentoast('Fill Event name');
+ }
+ }}
+
+ />
+
+ */}
+
+
+
+ {/*
+
+
+
+ {result.clientstaff.map((val11) => {
+
+ return <>
+
+ {val11.firstname.charAt(0).toUpperCase()}
+
+ >
+ })
+
+ }
+
+
+ */}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ #
+ {/* Role */}
+ {/* Count */}
+ Schedule Time
+ {/* End Time */}
+ {/* Pickup Location */}
+ {/* Break */}
+ Drop Location
+ Value
+ {/* Action */}
+
+
+
+
+
+ {orderarr.map((val) => {
+ return <>
+
+
+
+ {val.sno}
+ {/* option.serviceid === value.productid}
+
+ options={roleoptions.sort((a, b) => -b.categoryname.localeCompare(a.categoryname))}
+ groupBy={(option) => option.categoryname}
+ getOptionLabel={(option) => option.subcategoryname}
+
+ value={
+ {
+ subcategoryname: val.role,
+ productid: val.productid
+ }}
+ onChange={(e, result1) => {
+
+
+
+ if (result1) {
+ roleedit({ sno: val.sno }, e, result1.serviceamount, result1, result);
+ } else {
+ roleedit({ sno: val.sno }, e, 0, result);
+ }
+
+
+ }}
+
+ renderInput={(params) => { return <>> }}
+
+ disabled={(result.address) ? false : true}
+
+
+
+ />
+
+
+
+ option.label === value}
+
+ onChange={(e, result1) => {
+ if (result1) {
+ positionedit({ sno: val.sno }, e, result1, result);
+ } else {
+ positionedit({ sno: val.sno }, e, result)
+ }
+ }}
+ renderInput={(params) => {
+ return (
+ <>
+
+ >
+ );
+ }}
+ options={positionoptions}
+ disabled={(result.address) ? false : true}
+
+ /> */}
+
+ {
+ console.log(e)
+
+ let arr = shiftarr1;
+ let dateres11 = dayjs().diff(dayjs(`${dayjs(startdate).format('YYYY-MM-DD')} ${dayjs(e).format('HH:mm:ss')}`), 'm');
+ console.log('dateres11')
+ console.log(dateres11)
+ if (dateres11 < 0) {
+
+
+ arr[result.sno - 1].details[val.sno - 1].starttime = dayjs(e.$d);
+
+ arr[result.sno - 1].details[val.sno - 1].endtime = dayjs(dayjs(e.$d).add(4, 'hours').$d);
+
+
+ if (arr[result.sno - 1].details[val.sno - 1].orderqty && arr[result.sno - 1].details[val.sno - 1].price) {
+ arr[result.sno - 1].details[val.sno - 1].landingamount = arr[result.sno - 1].details[val.sno - 1].orderqty * arr[result.sno - 1].details[val.sno - 1].price;
+ arr[result.sno - 1].details[val.sno - 1].productsumprice = arr[result.sno - 1].details[val.sno - 1].landingamount + arr[result.sno - 1].details[val.sno - 1].taxamount;
+
+ if (arr[result.sno - 1].details[val.sno - 1].starttime && arr[result.sno - 1].details[val.sno - 1].endtime) {
+ let dateres = dayjs(arr[result.sno - 1].details[val.sno - 1].endtime).diff(dayjs(arr[result.sno - 1].details[val.sno - 1].starttime), 'm');
+
+ console.log(dateres)
+ if (dateres >= 240) {
+ console.log("dateres")
+ arr[result.sno - 1].details[val.sno - 1].landingamount = (arr[result.sno - 1].details[val.sno - 1].orderqty * (dateres * (arr[result.sno - 1].details[val.sno - 1].price / 60))).toFixed(2)
+ arr[result.sno - 1].details[val.sno - 1].workhours = (dateres / 60).toFixed(2)
+ }
+
+ }
+ arr[result.sno - 1].details[val.sno - 1].productsumprice = arr[result.sno - 1].details[val.sno - 1].landingamount + arr[result.sno - 1].details[val.sno - 1].taxamount;
+ }
+
+
+
+
+
+
+
+ setShiftarr1([...arr])
+
+ } else {
+ setAlertmessage('choose upcoming Time');
+ opentoast('choose upcoming Time');
+ }
+ }
+ }
+
+ sx={{ width: '150px' }}
+ value={val.starttime || null}
+
+
+ />
+
+ {val.address}
+ {/*
+ {
+ console.log(e)
+ let arr = shiftarr1;
+
+ arr[result.sno - 1].details[val.sno - 1].endtime = dayjs(e.$d);
+ if (arr[result.sno - 1].details[val.sno - 1].orderqty && arr[result.sno - 1].details[val.sno - 1].price) {
+ arr[result.sno - 1].details[val.sno - 1].landingamount = arr[result.sno - 1].details[val.sno - 1].orderqty * arr[result.sno - 1].details[val.sno - 1].price;
+ arr[result.sno - 1].details[val.sno - 1].productsumprice = arr[result.sno - 1].details[val.sno - 1].landingamount + arr[result.sno - 1].details[val.sno - 1].taxamount;
+
+ if (arr[result.sno - 1].details[val.sno - 1].starttime && arr[result.sno - 1].details[val.sno - 1].endtime) {
+ let dateres = dayjs(arr[result.sno - 1].details[val.sno - 1].endtime).diff(dayjs(arr[result.sno - 1].details[val.sno - 1].starttime), 'm');
+
+ console.log(dateres)
+ if (dateres >= 240) {
+ console.log("dateres")
+ arr[result.sno - 1].details[val.sno - 1].landingamount = (arr[result.sno - 1].details[val.sno - 1].orderqty * (dateres * (arr[result.sno - 1].details[val.sno - 1].price / 60))).toFixed(2)
+ arr[result.sno - 1].details[val.sno - 1].workhours = (dateres / 60).toFixed(2)
+ }
+
+ }
+ arr[result.sno - 1].details[val.sno - 1].productsumprice = arr[result.sno - 1].details[val.sno - 1].landingamount + arr[result.sno - 1].details[val.sno - 1].taxamount;
+ }
+ setShiftarr1([...arr])
+
+ }
+ }
+
+ sx={{ width: '150px' }}
+ value={val.endtime || null}
+ />
+ */}
+ {/*
+ {(val.starttime && val.endtime) &&
+ <>
+ {Math.floor(dayjs(val.endtime).diff(dayjs(val.starttime), 'm') / 60)}H:
+ {dayjs(val.endtime).diff(dayjs(val.starttime), 'm') - (Math.floor(dayjs(val.endtime).diff(dayjs(val.starttime), 'm') / 60) * 60)}m
+
+ >
+ }
+ */}
+ {/* unpaidbreakedit({ sno: val.sno }, e, result)}
+ freeSolo
+ renderInput={(params) => }
+ options={[{ label: '10 min' }, { label: '20 min' }, { label: '30 min' },
+ { label: '40 min' }, { label: '50 min' }, { label: '60 min' }
+ ]}
+ sx={{ width: '100px' }}
+ />
+ */}
+
+ {/*
+ {(val.cost) &&
+ <>
+ {`${val.cost}/hr`}
+ >
+ }
+
+ */}
+
+
+ {/* {(val.role && val.position) &&
+ <>
+ {val.landingamount}
+ >
+ }
+ {(!val.position || !val.role) &&
+ 0
+ }
+ */}
+
+
+
+
+
+
+ {(open.shiftsno === result.sno && open.sno === val.sno) &&
+
+ <>
+
+ >
+ }
+
+ {(val.role && val.position && val.starttime && val.endtime && false) &&
+
+ <>
+
+
+
+ >
+ }
+
+
+
+
+
+
+ >
+ })
+
+ }
+
+
+
+
+ {/*
+ }
+
+ onClick={() => addarr(result)}
+
+ sx={{ m: 2 }}
+ variant="dashed"
+
+ >
+
+ ADD
+
+ */}
+
+
+
+
+
+
+
+
+
+ >
+ })
+
+ }
+ {/*
+ }
+
+ onClick={addshiftarr1}
+
+ variant="dashed"
+
+
+
+ >
+
+ ADD SHIFTS
+
+ */}
+
+
+
+
+
+
+
+ setOtherinstructions(e.target.value)} />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+}
+
+export default Createorder;
\ No newline at end of file
diff --git a/src/pages/nearle/orders/orders.js b/src/pages/nearle/orders/orders.js
new file mode 100644
index 0000000..dc293fd
--- /dev/null
+++ b/src/pages/nearle/orders/orders.js
@@ -0,0 +1,2085 @@
+// import React from 'react';
+// import Createstaff from 'pages/createstaff'
+import {
+ useState,
+ useEffect,
+ Fragment
+ } from 'react';
+ import { DatePicker } from '@mui/x-date-pickers/DatePicker';
+ import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
+ import dayjs from 'dayjs';
+ var utc = require('dayjs/plugin/utc')
+ dayjs.extend(utc)
+ import axios from 'axios';
+ import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
+ // import { DataGrid } from '@mui/x-data-grid'
+ // material-ui
+ import HoverSocialCard from 'components/cards/statistics/HoverSocialCard';
+ // import {FacebookOutlined} from '@ant-design/icons';
+ import { useTheme } from '@mui/material/styles';
+ // import { edittabstatus1 } from 'store/reducers/dashboard1';
+ import {
+ Avatar,
+ // AvatarGroup,
+ // Button as Button1,
+ Box,
+ // DateRangePicker,
+ Button,
+ Grid,
+ Tabs,
+ Tab,
+ IconButton,
+ Stack,
+ // TextField,
+ Chip,
+ // TableSortLabel,
+ Typography,
+ // Divider,
+ Table, TableCell, TableBody, TableHead,
+ // TableSortLabel,
+ Collapse,
+ Dialog,
+ TableRow,
+ DialogContent,
+ DialogTitle,
+ Tooltip,
+ FormControl,
+ OutlinedInput,
+ InputAdornment,
+ Skeleton,
+ CircularProgress,
+ DialogActions,
+ // Popper,
+ // ClickAwayListener
+
+ // Checkbox
+ } from '@mui/material';
+ import MainCard from 'components/MainCard';
+
+ // import { useSelector } from 'store';
+ // import { useDispatch } from 'react-redux';
+
+
+ import {
+ SearchOutlined, EnvironmentOutlined, UserOutlined,
+ // MoreOutlined
+ } from '@ant-design/icons';
+ import { PopupTransition } from 'components/@extended/Transitions';
+
+ // import FilterList from '@mui/icons-material/FilterList';
+ import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
+ import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
+
+ import {
+ addDays,
+ addMonths,
+ addWeeks,
+ // addYears,
+ endOfMonth,
+ endOfWeek,
+ // endOfYear,
+ startOfMonth,
+ startOfWeek,
+ // startOfYear,
+ } from 'date-fns';
+
+ // import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';
+ // import { DesktopDateRangePicker } from '@mui/x-date-pickers-pro/DesktopDateRangePicker';
+ // import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns';
+ // import { DateRangePicker } from "mui-daterange-picker-orient";
+ import { DateRangePicker } from "mui-daterange-picker";
+
+
+
+ // import EnhancedTable from 'components/tablemuiedit'
+ import {
+ // CloseOutlined,
+ // PlusOutlined,
+ EyeTwoTone,
+ // EditTwoTone,
+ // DeleteTwoTone
+ } from '@ant-design/icons';
+
+ import { useNavigate } from 'react-router';
+
+
+ import * as React from 'react';
+ import PropTypes from 'prop-types';
+ // import { alpha } from '@mui/material/styles';
+ // import Box from '@mui/material/Box';
+ // import Table from '@mui/material/Table';
+ // import TableBody from '@mui/material/TableBody';
+ // import TableCell from '@mui/material/TableCell';
+ import TableContainer from '@mui/material/TableContainer';
+ // import TableHead from '@mui/material/TableHead';
+ import TablePagination from '@mui/material/TablePagination';
+ // import TableRow from '@mui/material/TableRow';
+ // import TablePagination from '@mui/material/TablePagination';
+ import TableSortLabel from '@mui/material/TableSortLabel';
+ // import Toolbar from '@mui/material/Toolbar';
+ // import Typography from '@mui/material/Typography';
+ // import Paper from '@mui/material/Paper';
+ // import Checkbox from '@mui/material/Checkbox';
+ // import IconButton from '@mui/material/IconButton';
+ // import Tooltip from '@mui/material/Tooltip';
+ // import FormControlLabel from '@mui/material/FormControlLabel';
+ // // import Switch from '@mui/material/Switch';
+ // import DeleteIcon from '@mui/icons-material/Delete';
+ // import FilterListIcon from '@mui/icons-material/FilterList';
+ import { visuallyHidden } from '@mui/utils';
+ import Loader from 'components/Loader'
+ import { FilterList } from '@mui/icons-material';
+ // import MainCard from 'components/MainCard';
+ // import DialogTitle from 'themes/overrides/DialogTitle';
+ // import MainCard from 'components/MainCard';
+
+
+
+
+
+
+
+ const Orders = () => {
+
+
+ function descendingComparator(a, b, orderBy) {
+ if (b[orderBy] < a[orderBy]) {
+ return -1;
+ }
+ if (b[orderBy] > a[orderBy]) {
+ return 1;
+ }
+ return 0;
+ }
+
+ function getComparator(order, orderBy) {
+ return order === 'desc'
+ ? (a, b) => descendingComparator(a, b, orderBy)
+ : (a, b) => -descendingComparator(a, b, orderBy);
+ }
+
+ // Since 2020 all major browsers ensure sort stability with Array.prototype.sort().
+ // stableSort() brings sort stability to non-modern browsers (notably IE11). If you
+ // only support modern browsers you can replace stableSort(exampleArray, exampleComparator)
+ // with exampleArray.slice().sort(exampleComparator)
+ function stableSort(array, comparator) {
+ const stabilizedThis = array.map((el, index) => [el, index]);
+ stabilizedThis.sort((a, b) => {
+ const order = comparator(a[0], b[0]);
+ if (order !== 0) {
+ return order;
+ }
+ return a[1] - b[1];
+ });
+ return stabilizedThis.map((el) => el[0]);
+ }
+
+
+
+
+
+ const headCells = [
+ {
+ id: 'sno',
+ disablePadding: true,
+ label: 'S NO',
+
+ },
+ {
+ id: 'tenantname',
+ numeric: false,
+ disablePadding: false,
+ label: 'CUSTOMER',
+ },
+ {
+ id: 'orderid',
+ numeric: false,
+ disablePadding: false,
+ label: 'ORDER ID',
+ },
+ {
+ id: 'eventname',
+ disablePadding: false,
+ label: 'Pickup Location',
+ },
+ {
+ id: 'eventname4',
+ disablePadding: false,
+ label: 'Delivery Location',
+ },
+ // {
+ // id: 'ordervalue',
+ // disablePadding: false,
+ // label: 'VALUE $',
+ // },
+ {
+ id: 'itemcount',
+ disablePadding: false,
+ label: 'NOTES',
+ },
+ {
+ id: 'orderstatus',
+ disablePadding: false,
+ label: 'STATUS',
+ },
+ // {
+ // id: 'action',
+ // disablePadding: false,
+ // label: 'ACTION',
+ // }
+ ];
+
+
+ function EnhancedTableHead(props) {
+ const {
+ order, orderBy,
+ onRequestSort } =
+ props;
+ const createSortHandler = (property) => (event) => {
+ onRequestSort(event, property);
+ };
+
+ return (
+
+
+
+ {headCells.map((headCell) => (
+
+
+ {headCell.label}
+ {orderBy === headCell.id ? (
+
+ {order === 'desc' ? 'sorted descending' : 'sorted ascending'}
+
+ ) : null}
+
+
+ ))}
+
+
+ );
+ }
+
+ EnhancedTableHead.propTypes = {
+ numSelected: PropTypes.number.isRequired,
+ onRequestSort: PropTypes.func.isRequired,
+ onSelectAllClick: PropTypes.func.isRequired,
+ order: PropTypes.oneOf(['asc', 'desc']).isRequired,
+ orderBy: PropTypes.string.isRequired,
+ rowCount: PropTypes.number.isRequired,
+ };
+
+
+
+ function EnhancedTable() {
+ const [order, setOrder] = React.useState('asc');
+ const [orderBy, setOrderBy] = React.useState('calories');
+ const [selected, setSelected] = React.useState([]);
+ const [page, setPage] = React.useState(0);
+ const [rowsPerPage, setRowsPerPage] = React.useState(10);
+ const [expandopen, setExpandopen] = React.useState('');
+
+
+ const [dialogopen, setDialogopen] = useState(false);
+ const [stafflist, setStafflist] = useState([])
+ const [loading1, setLoading1] = useState(false)
+
+
+ const fetchstafflist = async (odid) => {
+ setLoading1(true)
+ try {
+ await axios.get(`${process.env.REACT_APP_URL2}/orders/getassignedinfo?orderdetailid=${odid}`)
+
+ .then((res) => {
+ console.log(res)
+ if (res.data.status) {
+ setStafflist(res.data.Details)
+ }
+
+ setLoading1(false)
+ }).catch((err) => {
+ console.log(err)
+ setLoading1(false)
+ })
+
+ } catch (err) {
+ console.log(err);
+ setLoading1(false)
+ }
+
+ }
+
+
+
+
+
+ const dialogclose = () => {
+ setDialogopen(false);
+ };
+
+ const handleRequestSort = (event, property) => {
+ const isAsc = orderBy === property && order === 'asc';
+ setOrder(isAsc ? 'desc' : 'asc');
+ setOrderBy(property);
+ };
+
+ const handleSelectAllClick = (event) => {
+ if (event.target.checked) {
+ const newSelected = rows.map((n) => n.name);
+ setSelected(newSelected);
+ return;
+ }
+ setSelected([]);
+ };
+
+
+
+ const handleChangePage = (event, newPage) => {
+ setPage(newPage);
+ };
+
+ const handleChangeRowsPerPage = (event) => {
+ setRowsPerPage(parseInt(event.target.value, 10));
+ setPage(0);
+ };
+
+
+
+ const isSelected = (name) => selected.indexOf(name) !== -1;
+
+ // Avoid a layout jump when reaching the last page with empty rows.
+ const emptyRows =
+ page > 0 ? Math.max(0, (1 + page) * rowsPerPage - rows.length) : 0;
+
+ const visibleRows = React.useMemo(
+ () =>
+ stableSort(rows, getComparator(order, orderBy)).slice(
+ page * rowsPerPage,
+ page * rowsPerPage + rowsPerPage,
+ ),
+ [order, orderBy, page, rowsPerPage],
+ );
+
+
+
+ return (
+
+
+
+
+
+
+
+ {(loading) &&
+ <>
+
+ {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((item) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ))}
+
+ >
+ }
+
+
+
+ {visibleRows.map((row, index) => {
+ const isItemSelected = isSelected(row.sno);
+ const labelId = `enhanced-table-checkbox-${index}`;
+
+
+
+
+
+
+
+ return (
+ <>
+
+
+
+
+ {row.sno}
+
+
+
+
+
+
+
+
+
+
+ {row.firstname}
+
+
+ {/* {row.identification}*/}
+ {row.contactno}
+
+
+
+
+
+ {row.orderid}
+
+ {dayjs(row.orderdate).utc().format('MM/DD/YYYY')}
+
+
+
+
+
+ {/* {row.eventname} */}
+
+
+ {row.pickupaddress.slice(0,20)}
+
+
+
+
+
+
+
+ {/* {row.eventname} */}
+
+
+ {row.delivceryaddress.slice(0,20)}
+
+
+
+
+
+ {row.ordernotes}
+ {/* */}
+
+
+
+ {(row.orderstatus === 'pending') &&
+
+
+ }
+ {(row.orderstatus === 'modified') &&
+
+ }
+ {(row.orderstatus === 'cancelled') &&
+
+
+
+ }
+ {(row.orderstatus === 'delivered') &&
+
+
+ }
+ {(row.orderstatus === 'processing') &&
+
+ }
+ {(row.orderstatus === 'ready') &&
+
+ }
+ {(row.orderstatus === 'confirmed') &&
+
+ }
+
+ {(row.orderstatus === 'active') &&
+
+ }
+ {(row.orderstatus === 'closed') &&
+
+ }
+ {(row.orderstatus === 'created') &&
+
+ }
+
+
+ {/* {(row.clientstatus === 'pending') &&
+
+
+ }
+ {(row.clientstatus === 'cancelled') &&
+
+
+
+ }
+ {(row.clientstatus === 'completed') &&
+
+
+ }
+ {(row.clientstatus === 'processing') &&
+
+ }
+ {(row.clientstatus === 'assigned') &&
+
+ }
+ {(row.clientstatus === 'confirmed') &&
+
+ }
+
+ {(row.clientstatus === 'active') &&
+
+ }
+ {(row.clientstatus === 'closed') &&
+
+ }
+
+ {(row.clientstatus === 'modified') &&
+
+ } */}
+
+
+
+ {/* */}
+
+ {/*
+
+ {
+ setExpandopen((expandopen === row.sno) ? '' : row.sno)
+
+ }
+ }
+ >
+ {(expandopen === row.sno) ?
+
+ :
+ }
+
+ */}
+
+
+
+
+ {/*
+ {
+ e.stopPropagation();
+
+ navigate(`/details`, {
+ state: {
+ orderheaderid: row.orderheaderid,
+ tenantid: row.tenantid
+ }
+ })
+ }}>
+
+
+
+
+ */}
+
+
+
+
+
+ {/*
+ {(row.ordershifts).map((val5, k) => {
+ return <>
+
+
+
+
+ Shift {k + 1}
+
+
+ {''}{val5.locationaddress}
+
+
+ {((val5.shiftstatus == 1) || (val5.status == 1)) &&
+
+ }
+
+
+
+
+
+
+
+
+
+ #
+ Role
+ Start Date
+ End Date
+ Unpaid break
+ Count
+ Assigned
+ Price
+ Amount
+ Assigned Roles
+
+
+
+
+
+
+ {((val5.orderdetails) ? val5.orderdetails : []).map((val, i) => {
+
+ return <>
+
+
+
+ {i + 1}
+
+ {val.productname}
+
+
+
+
+
+ {dayjs(val.starttime).format('MM/DD/YYYY')}
+
+
+ {dayjs(val.starttime).format('hh:mm A')}
+
+
+
+
+ {' '}
+
+
+ {dayjs(val.endtime).format('MM/DD/YYYY')}
+
+
+ {dayjs(val.endtime).format('hh:mm A')}
+
+
+
+
+ {val.unpaidbreak || 0}
+
+
+
+
+
+
+ 0) ? "warning" : "error"} variant="light" size="small" />
+
+ ${val.price}
+ ${val.landingamount}
+
+
+
+
+
+
+
+
+ >
+
+ })}
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ })
+
+
+ }
+
+
+ */}
+
+
+ >
+ );
+ })}
+ {emptyRows > 0 && (
+
+
+
+ )}
+
+
+
+
+
+
+ );
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ const [startdate, setStartdate] = useState(''
+ // dayjs().format('YYYY-MM-DD')
+ );
+ const [enddate, setEnddate] = useState(''
+ // dayjs().format('YYYY-MM-DD')
+ );
+
+ const [tenantid, setTenantid] = useState('')
+
+
+ const [percentage1, setPercentage1] = useState('0')
+ const [percentage2, setPercentage2] = useState('0')
+ const [percentage3, setPercentage3] = useState('0')
+ const [percentage4, setPercentage4] = useState('0');
+ let [orderarr, setArr] = useState([]);
+ let [orderarrcovered, setArrcovered] = useState([]);
+ let [orderarractive, setArractive] = useState([]);
+ let [orderarruncovered, setArruncovered] = useState([]);
+ let [orderarrcancelled, setArrcancelled] = useState([]);
+ let [orderarrassigned, setArrassigned] = useState([]);
+ let [orderarrconfirmed, setArrconfirmed] = useState([]);
+ let [orderarrmodified, setArrmodified] = useState([]);
+ let [orderarrclosed, setArrclosed] = useState([]);
+ let [orderarrpicked, setArrpicked] = useState([]);
+
+
+
+
+
+
+ const [allorders, setAllorders] = useState('')
+ const [activeorders, setActiveorders] = useState('')
+ const [coveredorders, setCoveredorders] = useState('')
+ const [uncoveredorders, setUncoveredorders] = useState('');
+ const [cancelled, setCancelled] = useState('');
+
+ const [assigned, setAssigned] = useState('');
+ const [confirmed, setConfirmed] = useState('');
+ const [modified, setModified] = useState('');
+ const [completed, setCompleted] = useState('');
+ const [closed, setClosed] = useState('');
+ const [picked,setPicked] = useState('')
+
+
+
+ const [tabstatus, setTabstatus] = useState('All Orders');
+ const [loading, setLoading] = useState(true)
+ const theme = useTheme();
+ let [rows, setRows] = useState([])
+ const [tabvalue, setTabvalue] = useState(0);
+ let navigate = useNavigate();
+ const [open, setOpen] = useState(false);
+ const [dateselect, setDateselect] = useState('select');
+
+ const [tabstatus1, setTabstatus1] = useState('All');
+
+ const [datestatus, setDatestatus] = useState('All');
+ const [searchword, setSearchword] = useState('')
+
+
+
+
+ const handleChangetab = (e, i) => {
+
+ setTabvalue(i);
+
+ if (i === 0) setTabstatus('All orders')
+ if (i === 1) setTabstatus('Pending')
+ // if (i === 2) setTabstatus('Modified')
+
+ if (i === 2) setTabstatus('Assigned')
+ if (i === 3) setTabstatus('Picked')
+ if (i === 4) setTabstatus('Delivered')
+ if (i === 5) setTabstatus('Cancelled')
+
+ // if (i === 0) setTabstatus('All orders')
+ // if (i === 1) setTabstatus('Pending')
+ // if (i === 1) setTabstatus('Modified')
+
+ // if (i === 3) setTabstatus('Assigned')
+ // if (i === 0) setTabstatus('Confirmed')
+ // if (i === 2) setTabstatus('Completed')
+ // if (i === 3) setTabstatus('Closed')
+
+
+ console.log(i)
+
+ }
+
+
+
+ useEffect(() => {
+ console.log(localStorage.getItem('appuserid'))
+
+ if (localStorage.getItem('tenantid')) {
+ setTenantid(localStorage.getItem('tenantid'))
+ let val = localStorage.getItem('tenantid')
+
+ fetchtable(val);
+ fetchpercentage(val);
+ // fetchtableactive();
+ fetchtableuncovered(val);
+ fetchtablecovered(val);
+ fetchtablecancelled(val);
+ fetchtableassigned(val);
+ fetchtablepicked(val);
+ // fetchtableconfirmed(val);
+ // fetchtablemodified(val);
+ // fetchtableclosed(val)
+ // fetchtable(val)
+ // console.log(activeorders);
+ }
+ }, [])
+
+
+
+ useEffect(() => {
+
+ if (localStorage.getItem('tenantid')) {
+
+ let val = localStorage.getItem('tenantid')
+
+ // fetchtable();
+ fetchpercentage(val);
+ // fetchtableactive();
+ fetchtableuncovered();
+ fetchtablecovered(val);
+ fetchtablecancelled(val);
+ fetchtableassigned(val);
+ fetchtablepicked(val);
+ // fetchtableconfirmed(val);
+ // fetchtablemodified(val);
+ // fetchtableclosed(val)
+ fetchtable(val)
+
+ console.log(activeorders);
+ }
+
+
+ }, [startdate, enddate])
+
+ useEffect(() => {
+ // if (tabstatus === 'All orders') setRows(orderarr)
+ // if (tabstatus === 'Completed') setRows(orderarrcovered)
+ // if (tabstatus === 'Active') setRows(orderarractive)
+ if (tabstatus === 'Pending') setRows(orderarruncovered)
+ // if (tabstatus === 'Cancelled') setRows(orderarrcancelled)
+ // if (tabstatus === 'Assigned') setRows(orderarrassigned)
+ // if (tabstatus === 'Confirmed') setRows(orderarrconfirmed)
+ // if (tabstatus === 'Modified') setRows(orderarrmodified)
+
+ if (tabstatus === 'All orders') setRows(orderarr)
+ if (tabstatus === 'Delivered') setRows(orderarrcovered)
+ // if (tabstatus === 'Active') setRows(orderarractive)
+ // if (tabstatus === 'Pending') setRows(orderarruncovered)
+ if (tabstatus === 'Cancelled') setRows(orderarrcancelled)
+ if (tabstatus === 'Assigned') setRows(orderarrassigned)
+ // if (tabstatus === 'Confirmed') setRows(orderarrconfirmed)
+ // if (tabstatus === 'Modified') setRows(orderarrmodified)
+ // if (tabstatus === 'Closed') setRows(orderarrclosed)
+ if (tabstatus === 'Picked') setRows(orderarrpicked)
+ }, [tabstatus])
+
+ const okclicked = () => {
+
+ setOpen(false);
+
+ }
+
+ useEffect(() => {
+ var day = 60 * 60 * 24 * 1000;
+ var startDate = new Date();
+ if (tabstatus1 === 'Tomorrow') {
+ setEnddate(new Date(startDate.getTime() + day).toISOString().substring(0, 10));
+ setStartdate(new Date(startDate.getTime() + day).toISOString().substring(0, 10));
+ setDateselect('select');
+
+ } else if (tabstatus1 === 'Today') {
+ setEnddate(new Date().toISOString().substring(0, 10));
+ setStartdate(new Date().toISOString().substring(0, 10));
+ setDateselect('select');
+ } else if (tabstatus1 === 'Week') {
+ setStartdate(new Date(startDate.getTime() - (day * 7)).toISOString().substring(0, 10));
+ setEnddate(new Date().toISOString().substring(0, 10));
+ setDateselect('select');
+ }
+ else if (tabstatus1 === 'All') {
+ setEnddate('');
+ setStartdate('');
+
+ setDateselect('all');
+ }
+ }, [tabstatus1]);
+
+ const choosedate = (date) => {
+
+ setStartdate(date.$d.toISOString().substring(0, 10));
+ setEnddate(date.$d.toISOString().substring(0, 10));
+ setTabstatus1('')
+
+ }
+ useEffect(() => {
+ if (tabstatus === 'All Orders') {
+ if (searchword) {
+ let arr = orderarr.filter((val) => {
+
+ return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
+ || val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
+ // || val.tenantname.toLowerCase().includes(searchword.toLowerCase())
+ || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+ } else {
+ setRows([...orderarr])
+ }
+
+
+ } else if (tabstatus === 'Delivered') {
+ if (searchword) {
+ let arr = orderarrcovered.filter((val) => {
+
+ return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
+ || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+ } else {
+ setRows([...orderarrcovered])
+ }
+
+ } else if (tabstatus === 'Active') {
+ if (searchword) {
+ let arr = orderarractive.filter((val) => {
+
+ return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
+ || val.eventname.toLowerCase().includes(searchword.toLowerCase())
+ || val.tenantname.toLowerCase().includes(searchword.toLowerCase())
+ || val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+ } else {
+ setRows([...orderarractive])
+ }
+
+ } else if (tabstatus === 'Pending') {
+ if (searchword) {
+ let arr = orderarruncovered.filter((val) => {
+
+ return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
+ || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+ } else {
+ setRows([...orderarruncovered])
+ }
+
+ } else if (tabstatus === 'Cancelled') {
+ if (searchword) {
+ let arr = orderarrcancelled.filter((val) => {
+
+ return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
+ || val.eventname.toLowerCase().includes(searchword.toLowerCase())
+ || val.tenantname.toLowerCase().includes(searchword.toLowerCase())
+ || val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+ } else {
+ setRows([...orderarrcancelled])
+ }
+
+ } else if (tabstatus === 'Assigned') {
+ if (searchword) {
+ let arr = orderarrassigned.filter((val) => {
+
+ return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
+ || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+ } else {
+ setRows([...orderarrassigned])
+ }
+
+ } else if (tabstatus === 'Confirmed') {
+ if (searchword) {
+ let arr = orderarrconfirmed.filter((val) => {
+
+ return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
+ || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+
+ } else {
+ setRows([...orderarrconfirmed])
+
+ }
+ } else if (tabstatus === 'Modified') {
+ if (searchword) {
+ let arr = orderarrmodified.filter((val) => {
+
+ return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
+ || val.eventname.toLowerCase().includes(searchword.toLowerCase())
+ || val.tenantname.toLowerCase().includes(searchword.toLowerCase())
+ || val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+ }
+ else {
+ setRows([...orderarrmodified])
+ }
+
+ } else if (tabstatus === 'Closed') {
+ if (searchword) {
+ let arr = orderarrclosed.filter((val) => {
+
+ return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
+ || val.eventname.toLowerCase().includes(searchword.toLowerCase())
+ || val.tenantname.toLowerCase().includes(searchword.toLowerCase())
+ || val.ordervalue.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+ }
+ }else if (tabstatus === 'Picked') {
+ if (searchword) {
+ let arr = orderarrpicked.filter((val) => {
+
+ return (val.orderid.toLowerCase().includes(searchword.toLowerCase())
+ || val.pickupaddress.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.ordernotes.toString().toLowerCase().includes(searchword.toLowerCase())
+ || val.delivceryaddress.toLowerCase().includes(searchword.toLowerCase())
+
+ )
+ })
+ console.log(arr)
+ setRows([...arr])
+ }
+ else {
+ setRows([...orderarrpicked])
+ }
+
+ }
+ }, [orderarr, searchword])
+
+
+
+ const handleChange1 = (e) => {
+
+
+ setTabstatus1(e.target.innerText)
+ setDatestatus(e.target.innerText)
+ }
+
+ const fetchtable = async (tid) => {
+
+ try {
+ // await axios.get(`${process.env.REACT_APP_URL2}/orders/getordersbystatus?tenantid=${tenantid}&clientstatus=true`)
+ await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}`)
+
+
+ .then((res) => {
+ // if (res.data.message === "Success") {
+ let arr = []
+ res.data.details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ setArr(arr)
+ console.log(res.data.Details)
+ if (tabstatus == 'All Orders') {
+ setRows(arr)
+ }
+ // }
+
+ }).catch((err) => {
+ console.log(err)
+ })
+
+ } catch (err) {
+ console.log(err);
+ }
+ }
+
+
+ const fetchtablecovered = async (tid) => {
+
+ try {
+ // await axios.get(`${process.env.REACT_APP_URL2}/orders/orderliststatus?fromdate=${startdate}&todate=${enddate}&type=${dateselect}&status=completed&sort=desc`)
+ await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=completed`)
+
+ .then((res) => {
+ // if (res.data.message === "Success") {
+ let arr = []
+ res.data.details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ setArrcovered(arr)
+ // }
+ }).catch((err) => {
+ console.log(err)
+ })
+
+ } catch (err) {
+ console.log(err);
+ }
+
+ }
+
+
+ const fetchtableactive = async () => {
+
+ try {
+ await axios.get(`${process.env.REACT_APP_URL2}/orders/orderliststatus?fromdate=${startdate}&todate=${enddate}&type=${dateselect}&status=processing&sort=desc`)
+ .then((res) => {
+ if (res.data.message === "Success") {
+ let arr = []
+ res.data.Details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ setArractive(arr)
+ }
+ }).catch((err) => {
+ console.log(err)
+ })
+
+ } catch (err) {
+ console.log(err);
+ }
+
+ }
+
+
+ const fetchtableuncovered = async (tid) => {
+
+ try {
+ await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=pending`)
+ .then((res) => {
+ if (res.data.message === "Success") {
+ let arr = []
+ res.data.details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ setArruncovered(arr)
+ }
+
+ }).catch((err) => {
+ console.log(err)
+ })
+
+ } catch (err) {
+ console.log(err);
+ }
+
+ }
+
+ const fetchtablecancelled = async (tid) => {
+
+ try {
+ await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=cancelled}`)
+ // await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=cancelled`)
+
+ .then((res) => {
+ // if (res.data.message === "Success") {
+ let arr = [];
+ console.log(res.data.details)
+ res.data.details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ setArrcancelled(arr)
+ // }
+
+ }).catch((err) => {
+ console.log(err)
+ })
+
+ } catch (err) {
+ console.log(err);
+ }
+
+ }
+
+ const fetchtableassigned = async (tid) => {
+
+ try {
+ await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=processing`)
+ .then((res) => {
+ // if (res.data.message === "Success") {
+ let arr = [];
+ console.log(res.data.details)
+ res.data.details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ setArrassigned(arr)
+ // }
+
+ }).catch((err) => {
+ console.log(err)
+ })
+
+ } catch (err) {
+ console.log(err);
+ }
+
+ }
+
+ const fetchtablepicked = async (tid) => {
+
+ try {
+ await axios.get(`${process.env.REACT_APP_URL}/orders/getorders/?tenantid=${tid}&status=ready`)
+ .then((res) => {
+ // if (res.data.message === "Success") {
+ let arr = [];
+ console.log(res.data.details)
+ res.data.details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ setArrpicked(arr)
+ // }
+
+ }).catch((err) => {
+ console.log(err)
+ })
+
+ } catch (err) {
+ console.log(err);
+ }
+
+ }
+
+ const fetchtableconfirmed = async (tid) => {
+
+ try {
+ // await axios.get(`${process.env.REACT_APP_URL2}/orders/orderliststatus?fromdate=${startdate}&todate=${enddate}&type=${dateselect}&status=confirmed&sort=desc`)
+ await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=confirmed&fromdate=${startdate}&todate=${enddate}`)
+
+ .then((res) => {
+ if (res.data.message === "Success") {
+ let arr = [];
+ console.log(res.data.Details)
+ res.data.Details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ setArrconfirmed(arr)
+
+ }
+
+ }).catch((err) => {
+ console.log(err)
+ })
+
+ } catch (err) {
+ console.log(err);
+ }
+
+ }
+
+ const fetchtablemodified = async (tid) => {
+
+ try {
+ // await axios.get(`${process.env.REACT_APP_URL2}/orders/orderliststatus?fromdate=${startdate}&todate=${enddate}&type=${dateselect}&status=modified&sort=desc`)
+ await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=modified&fromdate=${startdate}&todate=${enddate}`)
+
+ .then((res) => {
+ if (res.data.message === "Success") {
+ let arr = [];
+ console.log(res.data.Details)
+ res.data.Details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ setArrmodified(arr)
+ }
+
+ }).catch((err) => {
+ console.log(err)
+ })
+
+ } catch (err) {
+ console.log(err);
+ }
+
+ }
+
+ const fetchtableclosed = async (tid) => {
+
+ try {
+ // await axios.get(`${process.env.REACT_APP_URL2}/orders/orderliststatus?fromdate=${startdate}&todate=${enddate}&type=${dateselect}&status=modified&sort=desc`)
+ await axios.get(`${process.env.REACT_APP_URL2}/client/orders/getordersbystatus?tenantid=${tid}&status=closed&fromdate=${startdate}&todate=${enddate}`)
+ .then((res) => {
+
+ if (res.data.message === "Success") {
+ let arr = [];
+ console.log(res.data.Details)
+ res.data.Details.map((val, i) => {
+ arr = [...arr, { ...val, sno: i + 1 }];
+ })
+ setArrclosed(arr)
+ }
+
+ }).catch((err) => {
+ console.log(err)
+ })
+
+ } catch (err) {
+ console.log(err);
+ }
+
+ }
+
+ const fetchpercentage = async (tid) => {
+ setLoading(true)
+ try {
+ // await axios.get(`${process.env.REACT_APP_URL2}/orders/orderlistsummary?fromdate=${startdate}&todate=${enddate}`)
+ await axios.get(`${process.env.REACT_APP_URL}/orders/getordersummary/?tenantid=${tid}`)
+
+ .then((res) => {
+ console.log(res)
+
+ setAllorders(res.data.details.total.toString())
+ setCoveredorders(res.data.details.delivered.toString())
+
+ setCancelled(res.data.details.cancelled.toString())
+ setUncoveredorders(res.data.details.pending.toString())
+ setActiveorders(res.data.details.assigned.toString());
+ setAssigned(res.data.details.assigned.toString());
+ // setConfirmed(res.data.details.confirmed.toString());
+ // setModified(res.data.details.modified.toString());
+ setClosed(res.data.details.delivered.toString());
+ setPicked(res.data.details.picked.toString())
+ setPercentage1((Math.round((res.data.details.pending/ res.data.details.total) * 100) || 0).toString())
+ setPercentage3((Math.round((res.data.details.picked / res.data.details.total) * 100) || 0).toString())
+
+ setPercentage4((Math.round((res.data.details.delivered / res.data.details.total) * 100) || 0).toString())
+
+ setPercentage2((Math.round((res.data.details.assigned / res.data.details.total) * 100) || 0).toString())
+
+
+ setLoading(false)
+ }).catch((err) => {
+ console.log(err)
+ setLoading(false)
+ })
+
+ } catch (err) {
+ console.log(err);
+ setLoading(false)
+ }
+
+ }
+
+
+
+
+ return <>
+
+ {(loading) &&
+
+
+ }
+
+
+
+
+ Orders
+ {(startdate && enddate) &&
+
+
+ {dayjs(startdate).format('MM/DD/YYYY')} - {dayjs(enddate).format('MM/DD/YYYY')}} variant="combined" color='warning' size='small' />
+
+
+
+ }
+ {(!startdate || !enddate) &&
+ <>
+
+
+
+ >
+ }
+
+ {/* */}
+ {/*
+
+
+ */}
+
+
+
+ {/*
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ */}
+
+ {/*
+ setOpen(true)} >
+
+
+ */}
+
+
+
+ {/*
+
+
+ : confirmed} percentage={percentage1.toString()} color={theme.palette.success.main} />
+ */}
+
+
+ {/*
+
+
+ : modified} percentage={percentage2.toString()} color={theme.palette.secondary[600]} />
+ */}
+
+
+
+ : uncoveredorders} percentage={percentage1.toString()} color={theme.palette.warning.main} />
+
+
+
+
+ : assigned} percentage={percentage2.toString()} color={theme.palette.info.main} />
+
+
+
+
+ : picked} percentage={percentage3.toString()} color={theme.palette.primary.main} />
+
+
+
+
+ : coveredorders} percentage={percentage4.toString()} color={theme.palette.success.main} />
+
+{/*
+
+
+
+ : closed} percentage={percentage4.toString()} color={theme.palette.warning.main} />
+
+
+
+
+ : cancelled} percentage={percentage2.toString()} color={theme.palette.secondary[600]} />
+ */}
+
+
+
+
+
+
+
+
+
+
+
+ }
+ />
+
+ }
+ iconPosition="end"
+ />
+ }
+ iconPosition="end"
+ />
+ {/* }
+ iconPosition="end"
+ /> */}
+ {/* }
+ iconPosition="end"
+ /> */}
+ }
+ iconPosition="end"
+ />
+
+ }
+ iconPosition="end"
+ />
+
+
+ {/* }
+ iconPosition="end"
+ /> */}
+ }
+ iconPosition="end"
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ }
+
+ export default Orders;
\ No newline at end of file
diff --git a/src/routes/MainRoutes.js b/src/routes/MainRoutes.js
index ca79e6e..826ca42 100644
--- a/src/routes/MainRoutes.js
+++ b/src/routes/MainRoutes.js
@@ -17,6 +17,14 @@ const SamplePage = Loadable(lazy(() => import('pages/extra-pages/sample-page')))
const Login = Loadable(lazy(() => import('pages/nearle/login')));
const Dashboard = Loadable(lazy(() => import('pages/nearle/dashboard')));
+const Client = Loadable(lazy(() => import('pages/nearle/clients/client')));
+const Orders = Loadable(lazy(() => import('pages/nearle/orders/orders')));
+const Accountsettings = Loadable(lazy(() => import('pages/nearle/accountsettings')));
+
+const Createorder = Loadable(lazy(() => import('pages/nearle/orders/createorder')));
+const Createclient = Loadable(lazy(() => import('pages/nearle/clients/createclient')));
+
+
// ==============================|| MAIN ROUTING ||============================== //
@@ -40,6 +48,26 @@ const MainRoutes = {
path: 'dashboard',
element:
},
+ {
+ path: 'clients',
+ element:
+ },
+ {
+ path: 'orders',
+ element:
+ },
+ {
+ path: 'accountsettings',
+ element:
+ },
+ {
+ path: 'orders/create',
+ element:
+ },
+ {
+ path: 'clients/create',
+ element:
+ },
]
},
diff --git a/yarn.lock b/yarn.lock
index 87c61ab..9fa803e 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1057,12 +1057,12 @@
resolved "https://registry.npmjs.org/@babel/regjsgen/-/regjsgen-0.8.0.tgz"
integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==
-"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.7", "@babel/runtime@^7.21.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
- version "7.21.0"
- resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.0.tgz"
- integrity sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==
+"@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.16.7", "@babel/runtime@^7.18.3", "@babel/runtime@^7.20.7", "@babel/runtime@^7.21.0", "@babel/runtime@^7.23.2", "@babel/runtime@^7.23.4", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2":
+ version "7.23.5"
+ resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.5.tgz"
+ integrity sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w==
dependencies:
- regenerator-runtime "^0.13.11"
+ regenerator-runtime "^0.14.0"
"@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3":
version "7.20.7"
@@ -1276,7 +1276,7 @@
resolved "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.7.4.tgz"
integrity sha512-Ja/Vfqe3HpuzRsG1oBtWTHk2PGZ7GR+2Vz5iYGelAw8dx32K0y7PjVuxK6z1nMpZOqAFsRUPCkK1YjJ56qJlgw==
-"@emotion/react@^11.0.0-rc.0", "@emotion/react@^11.10.6", "@emotion/react@^11.4.1", "@emotion/react@^11.5.0":
+"@emotion/react@^11.0.0-rc.0", "@emotion/react@^11.10.6", "@emotion/react@^11.4.1", "@emotion/react@^11.5.0", "@emotion/react@^11.7.1", "@emotion/react@^11.9.0":
version "11.10.6"
resolved "https://registry.npmjs.org/@emotion/react/-/react-11.10.6.tgz"
integrity sha512-6HT8jBmcSkfzO7mc+N1L9uwvOnlcGoix8Zn7srt+9ga0MjREo6lRpuVX0kzo6Jp6oTqDhREOFsygN6Ew4fEQbw==
@@ -1306,7 +1306,7 @@
resolved "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.2.1.tgz"
integrity sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA==
-"@emotion/styled@^11.10.6", "@emotion/styled@^11.3.0":
+"@emotion/styled@^11.10.6", "@emotion/styled@^11.3.0", "@emotion/styled@^11.6.0", "@emotion/styled@^11.8.1":
version "11.10.6"
resolved "https://registry.npmjs.org/@emotion/styled/-/styled-11.10.6.tgz"
integrity sha512-OXtBzOmDSJo5Q0AFemHCfl+bUueT8BIcPSxu0EGTpGk6DmI5dnhSzQANm1e1ze0YZL7TDyAyy6s/b/zmGOS3Og==
@@ -1370,6 +1370,33 @@
resolved "https://registry.npmjs.org/@eslint/js/-/js-8.38.0.tgz"
integrity sha512-IoD2MfUnOV58ghIHCiil01PcohxjbYR/qCxsoC+xNgUwh1EY8jOOrYmu3d3a71+tJJ23uscEV4X2HJWMsPJu4g==
+"@floating-ui/core@^1.4.2":
+ version "1.5.1"
+ resolved "https://registry.npmjs.org/@floating-ui/core/-/core-1.5.1.tgz"
+ integrity sha512-QgcKYwzcc8vvZ4n/5uklchy8KVdjJwcOeI+HnnTNclJjs2nYsy23DOCf+sSV1kBwD9yDAoVKCkv/gEPzgQU3Pw==
+ dependencies:
+ "@floating-ui/utils" "^0.1.3"
+
+"@floating-ui/dom@^1.5.1":
+ version "1.5.3"
+ resolved "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.5.3.tgz"
+ integrity sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==
+ dependencies:
+ "@floating-ui/core" "^1.4.2"
+ "@floating-ui/utils" "^0.1.3"
+
+"@floating-ui/react-dom@^2.0.4":
+ version "2.0.4"
+ resolved "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.0.4.tgz"
+ integrity sha512-CF8k2rgKeh/49UrnIBs4BdxPUV6vize/Db1d/YbCLyp9GiVZ0BEwf5AiDSxJRCr6yOkGqTFHtmrULxkEfYZ7dQ==
+ dependencies:
+ "@floating-ui/dom" "^1.5.1"
+
+"@floating-ui/utils@^0.1.3":
+ version "0.1.6"
+ resolved "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.1.6.tgz"
+ integrity sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==
+
"@formatjs/ecma402-abstract@1.14.3":
version "1.14.3"
resolved "https://registry.npmjs.org/@formatjs/ecma402-abstract/-/ecma402-abstract-1.14.3.tgz"
@@ -1761,11 +1788,31 @@
prop-types "^15.8.1"
react-is "^18.2.0"
+"@mui/base@^5.0.0-beta.22":
+ version "5.0.0-beta.25"
+ resolved "https://registry.npmjs.org/@mui/base/-/base-5.0.0-beta.25.tgz"
+ integrity sha512-Iiv+IcappRRv6IBlknIVmLkXxfp51NEX1+l9f+dIbBuPU4PaRULegr1lCeHKsC45KU5ruxM5xMg4R/de03aJQg==
+ dependencies:
+ "@babel/runtime" "^7.23.4"
+ "@floating-ui/react-dom" "^2.0.4"
+ "@mui/types" "^7.2.10"
+ "@mui/utils" "^5.14.19"
+ "@popperjs/core" "^2.11.8"
+ clsx "^2.0.0"
+ prop-types "^15.8.1"
+
"@mui/core-downloads-tracker@^5.12.1":
version "5.12.1"
resolved "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.12.1.tgz"
integrity sha512-rNiQYHtkXljcvCEnhWrJzie1ifff5O98j3uW7ZlchFgD8HWxEcz/QoxZvo+sCKC9aayAgxi9RsVn2VjCyp5CrA==
+"@mui/icons-material@^5.0.4", "@mui/icons-material@^5.14.19":
+ version "5.14.19"
+ resolved "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.14.19.tgz"
+ integrity sha512-yjP8nluXxZGe3Y7pS+yxBV+hWZSsSBampCxkZwaw+1l+feL+rfP74vbEFbMrX/Kil9I/Y1tWfy5bs/eNvwNpWw==
+ dependencies:
+ "@babel/runtime" "^7.23.4"
+
"@mui/lab@^5.0.0-alpha.127":
version "5.0.0-alpha.127"
resolved "https://registry.npmjs.org/@mui/lab/-/lab-5.0.0-alpha.127.tgz"
@@ -1780,7 +1827,7 @@
prop-types "^15.8.1"
react-is "^18.2.0"
-"@mui/material@^5.0.0", "@mui/material@^5.12.1":
+"@mui/material@^5.0.0", "@mui/material@^5.12.1", "@mui/material@^5.2.6", "@mui/material@^5.8.6":
version "5.12.1"
resolved "https://registry.npmjs.org/@mui/material/-/material-5.12.1.tgz"
integrity sha512-m+G9J6+FzIMhRqKV2y30yONH97wX107z9EWgiNCeS1/+y1CnytFZNG1ENdOuaJo1NimCRnmB/iXPvoOaSo6dOg==
@@ -1817,7 +1864,7 @@
csstype "^3.1.2"
prop-types "^15.8.1"
-"@mui/system@^5.12.1":
+"@mui/system@^5.0.6", "@mui/system@^5.12.1", "@mui/system@^5.8.0":
version "5.12.1"
resolved "https://registry.npmjs.org/@mui/system/-/system-5.12.1.tgz"
integrity sha512-Po+sicdV3bbRYXdU29XZaHPZrW7HUYUqU1qCu77GCCEMbahC756YpeyefdIYuPMUg0OdO3gKIUfDISBrkjJL+w==
@@ -1831,22 +1878,34 @@
csstype "^3.1.2"
prop-types "^15.8.1"
-"@mui/types@^7.2.4":
- version "7.2.4"
- resolved "https://registry.npmjs.org/@mui/types/-/types-7.2.4.tgz"
- integrity sha512-LBcwa8rN84bKF+f5sDyku42w1NTxaPgPyYKODsh01U1fVstTClbUoSA96oyRBnSNyEiAVjKm6Gwx9vjR+xyqHA==
+"@mui/types@^7.2.10", "@mui/types@^7.2.4":
+ version "7.2.10"
+ resolved "https://registry.npmjs.org/@mui/types/-/types-7.2.10.tgz"
+ integrity sha512-wX1vbDC+lzF7FlhT6A3ffRZgEoKWPF8VqRoTu4lZwouFX2t90KyCMsgepMw5DxLak1BSp/KP86CmtZttikb/gQ==
-"@mui/utils@^5.12.0":
- version "5.12.0"
- resolved "https://registry.npmjs.org/@mui/utils/-/utils-5.12.0.tgz"
- integrity sha512-RmQwgzF72p7Yr4+AAUO6j1v2uzt6wr7SWXn68KBsnfVpdOHyclCzH2lr/Xu6YOw9su4JRtdAIYfJFXsS6Cjkmw==
+"@mui/utils@^5.12.0", "@mui/utils@^5.14.16", "@mui/utils@^5.14.19":
+ version "5.14.19"
+ resolved "https://registry.npmjs.org/@mui/utils/-/utils-5.14.19.tgz"
+ integrity sha512-qAHvTXzk7basbyqPvhgWqN6JbmI2wLB/mf97GkSlz5c76MiKYV6Ffjvw9BjKZQ1YRb8rDX9kgdjRezOcoB91oQ==
dependencies:
- "@babel/runtime" "^7.21.0"
- "@types/prop-types" "^15.7.5"
- "@types/react-is" "^16.7.1 || ^17.0.0"
+ "@babel/runtime" "^7.23.4"
+ "@types/prop-types" "^15.7.11"
prop-types "^15.8.1"
react-is "^18.2.0"
+"@mui/x-date-pickers@^6.18.2":
+ version "6.18.2"
+ resolved "https://registry.npmjs.org/@mui/x-date-pickers/-/x-date-pickers-6.18.2.tgz"
+ integrity sha512-HJq4uoFQSu5isa/mesWw2BKh8KBRYUQb+KaSlVlWfJNgP3YhPvWZ6yqCNYyxOAiPMxb0n3nBjS9ErO27OHjFMA==
+ dependencies:
+ "@babel/runtime" "^7.23.2"
+ "@mui/base" "^5.0.0-beta.22"
+ "@mui/utils" "^5.14.16"
+ "@types/react-transition-group" "^4.4.8"
+ clsx "^2.0.0"
+ prop-types "^15.8.1"
+ react-transition-group "^4.4.5"
+
"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1":
version "5.1.1-v1"
resolved "https://registry.npmjs.org/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz"
@@ -1890,10 +1949,10 @@
schema-utils "^3.0.0"
source-map "^0.7.3"
-"@popperjs/core@^2.11.7":
- version "2.11.7"
- resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.11.7.tgz"
- integrity sha512-Cr4OjIkipTtcXKjAsm8agyleBuDHvxzeBoa1v543lbv1YaIwQjESsVcmjiWiPEbC1FIeHOG/Op9kdCmAmiS3Kw==
+"@popperjs/core@^2.11.7", "@popperjs/core@^2.11.8":
+ version "2.11.8"
+ resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz"
+ integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==
"@reduxjs/toolkit@^1.9.5":
version "1.9.5"
@@ -2400,10 +2459,10 @@
resolved "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.1.tgz"
integrity sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow==
-"@types/prop-types@*", "@types/prop-types@^15.7.5":
- version "15.7.5"
- resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz"
- integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==
+"@types/prop-types@*", "@types/prop-types@^15.7.11":
+ version "15.7.11"
+ resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.11.tgz"
+ integrity sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==
"@types/q@^1.5.1":
version "1.5.5"
@@ -2420,17 +2479,10 @@
resolved "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz"
integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==
-"@types/react-is@^16.7.1 || ^17.0.0":
- version "17.0.3"
- resolved "https://registry.npmjs.org/@types/react-is/-/react-is-17.0.3.tgz"
- integrity sha512-aBTIWg1emtu95bLTLx0cpkxwGW3ueZv71nE2YFBpL8k/z5czEW8yYpOo8Dp+UUAFAtKwNaOsh/ioSeQnWlZcfw==
- dependencies:
- "@types/react" "*"
-
-"@types/react-transition-group@^4.4.5":
- version "4.4.5"
- resolved "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.5.tgz"
- integrity sha512-juKD/eiSM3/xZYzjuzH6ZwpP+/lejltmiS3QEzV/vmb/Q8+HfDmxu+Baga8UEMGBqV88Nbg4l2hY/K2DkyaLLA==
+"@types/react-transition-group@^4.4.5", "@types/react-transition-group@^4.4.8":
+ version "4.4.9"
+ resolved "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.9.tgz"
+ integrity sha512-ZVNmWumUIh5NhH8aMD9CR2hdW0fNuYInlocZHaZ+dgk/1K49j1w/HoAuK1ki+pgscQrOFRTlXeoURtuzEkV3dg==
dependencies:
"@types/react" "*"
@@ -3688,6 +3740,11 @@ clsx@^1.1.0, clsx@^1.2.1:
resolved "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz"
integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==
+clsx@^2.0.0:
+ version "2.0.0"
+ resolved "https://registry.npmjs.org/clsx/-/clsx-2.0.0.tgz"
+ integrity sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==
+
co@^4.6.0:
version "4.6.0"
resolved "https://registry.npmjs.org/co/-/co-4.6.0.tgz"
@@ -4211,6 +4268,18 @@ data-urls@^2.0.0:
whatwg-mimetype "^2.3.0"
whatwg-url "^8.0.0"
+date-fns@^2.25.0, date-fns@^2.28.0:
+ version "2.30.0"
+ resolved "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz"
+ integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==
+ dependencies:
+ "@babel/runtime" "^7.21.0"
+
+dayjs@^1.10.7, dayjs@^1.11.10:
+ version "1.11.10"
+ resolved "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz"
+ integrity sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==
+
debug@^2.6.0:
version "2.6.9"
resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz"
@@ -7224,6 +7293,13 @@ ms@2.1.3:
resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
+mui-daterange-picker@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.npmjs.org/mui-daterange-picker/-/mui-daterange-picker-1.0.5.tgz"
+ integrity sha512-+7Mp9DXQw6iLGotwp1rKfMV8sJxtaEto0IVId54orkvrCdqTgn167nzLBz6hd34tJLftg6DKAygkUom7tmg5Bw==
+ dependencies:
+ "@babel/runtime" "^7.16.7"
+
multicast-dns@^7.2.5:
version "7.2.5"
resolved "https://registry.npmjs.org/multicast-dns/-/multicast-dns-7.2.5.tgz"
@@ -8301,7 +8377,7 @@ prompts@^2.0.1, prompts@^2.4.2:
kleur "^3.0.3"
sisteransi "^1.0.5"
-prop-types@^15.6.2, prop-types@^15.8.1:
+prop-types@^15.5.0, prop-types@^15.6.2, prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
@@ -8479,7 +8555,7 @@ react-device-detect@^2.2.3:
dependencies:
ua-parser-js "^1.0.33"
-"react-dom@^16.8 || ^17.0 || ^18.0", "react-dom@^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom@^17.0.0 || ^18.0.0", react-dom@^18.0.0, react-dom@^18.2.0, "react-dom@>= 0.14.0", react-dom@>=16.0.0, react-dom@>=16.6.0, react-dom@>=16.8, react-dom@>=16.8.0, react-dom@>=16.9.0, "react-dom@16.2.0 - 18":
+"react-dom@^16.8 || ^17.0 || ^18.0", "react-dom@^16.8.0 || ^17.0.0 || ^18.0.0", "react-dom@^17.0.0 || ^18.0.0", react-dom@^17.0.2, react-dom@^18.0.0, react-dom@^18.2.0, "react-dom@>= 0.14.0", react-dom@>=16.0.0, react-dom@>=16.6.0, react-dom@>=16.8, react-dom@>=16.8.0, react-dom@>=16.9.0, "react-dom@16.2.0 - 18":
version "18.2.0"
resolved "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
@@ -8497,6 +8573,21 @@ react-fast-compare@^2.0.1:
resolved "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-2.0.4.tgz"
integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==
+react-geocode@^0.2.3:
+ version "0.2.3"
+ resolved "https://registry.npmjs.org/react-geocode/-/react-geocode-0.2.3.tgz"
+ integrity sha512-sIpbgmn1IUzAxO4haOZ6jeeFnMD8ya9PC38yiNrmJ9vPWbvAO2D/2yfCBzZjGZVUm4PRzKAc0KghXfaEnug0TQ==
+ dependencies:
+ regenerator-runtime "^0.13.3"
+
+react-google-autocomplete@^2.7.3:
+ version "2.7.3"
+ resolved "https://registry.npmjs.org/react-google-autocomplete/-/react-google-autocomplete-2.7.3.tgz"
+ integrity sha512-Nm+7/VDe7/NDWb8p/a39is7ktNqt5bNqAOoQv2Ev/XkuEvjsRk08VAPFmXUH03xKuM8IUuDrk2Lwfge44YEj6Q==
+ dependencies:
+ lodash.debounce "^4.0.8"
+ prop-types "^15.5.0"
+
react-intl@^6.4.1:
version "6.4.1"
resolved "https://registry.npmjs.org/react-intl/-/react-intl-6.4.1.tgz"
@@ -8645,7 +8736,7 @@ react-transition-group@^4.4.5:
loose-envify "^1.4.0"
prop-types "^15.6.2"
-"react@^16.6.0 || 17 || 18", "react@^16.8 || ^17.0 || ^18.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^16.9.0 || ^17.0.0 || ^18", "react@^17.0.0 || ^18.0.0", react@^18.0.0, react@^18.2.0, "react@>= 0.14.0", "react@>= 16", react@>=16.0.0, react@>=16.6.0, react@>=16.8, react@>=16.8.0, react@>=16.9.0, "react@16.2.0 - 18":
+"react@^16.6.0 || 17 || 18", "react@^16.8 || ^17.0 || ^18.0", "react@^16.8.0 || ^17.0.0 || ^18.0.0", "react@^16.9.0 || ^17.0.0 || ^18", "react@^17.0.0 || ^18.0.0", react@^17.0.2, react@^18.0.0, react@^18.2.0, "react@>= 0.14.0", "react@>= 16", react@>=16.0.0, react@>=16.6.0, react@>=16.8, react@>=16.8.0, react@>=16.9.0, "react@16.2.0 - 18":
version "18.2.0"
resolved "https://registry.npmjs.org/react/-/react-18.2.0.tgz"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
@@ -8742,11 +8833,16 @@ regenerate@^1.4.2:
resolved "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz"
integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==
-regenerator-runtime@^0.13.11, regenerator-runtime@^0.13.9:
+regenerator-runtime@^0.13.3, regenerator-runtime@^0.13.9:
version "0.13.11"
resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
+regenerator-runtime@^0.14.0:
+ version "0.14.0"
+ resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz"
+ integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==
+
regenerator-transform@^0.15.1:
version "0.15.1"
resolved "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.15.1.tgz"