overall commit
This commit is contained in:
135
.gitignore
vendored
135
.gitignore
vendored
@@ -1,108 +1,105 @@
|
|||||||
|
# Dependencies
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Production build
|
||||||
|
dist/
|
||||||
|
build/
|
||||||
|
|
||||||
|
# Environment variables
|
||||||
|
.env
|
||||||
|
.env.local
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
||||||
|
|
||||||
# Runtime data
|
# Runtime data
|
||||||
pids
|
pids
|
||||||
*.pid
|
*.pid
|
||||||
*.seed
|
*.seed
|
||||||
*.pid.lock
|
*.pid.lock
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
# Diagnostic reports
|
||||||
lib-cov
|
report.*.json
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
# Coverage
|
||||||
coverage
|
coverage/
|
||||||
|
.nyc_output/
|
||||||
*.lcov
|
*.lcov
|
||||||
|
|
||||||
# nyc test coverage
|
# Cache
|
||||||
.nyc_output
|
.cache/
|
||||||
|
.parcel-cache/
|
||||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# Bower dependency directory (https://bower.io/)
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
build
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
node_modules/
|
|
||||||
jspm_packages/
|
|
||||||
|
|
||||||
# TypeScript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# TypeScript cache
|
|
||||||
*.tsbuildinfo
|
|
||||||
|
|
||||||
# Optional npm cache directory
|
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional eslint cache
|
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
.npm
|
||||||
# Microbundle cache
|
|
||||||
.rpt2_cache/
|
.rpt2_cache/
|
||||||
.rts2_cache_cjs/
|
.rts2_cache_cjs/
|
||||||
.rts2_cache_es/
|
.rts2_cache_es/
|
||||||
.rts2_cache_umd/
|
.rts2_cache_umd/
|
||||||
|
|
||||||
|
# TypeScript
|
||||||
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
# IDE / Editor
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
|
# OS files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Package manager
|
||||||
|
.yarn-integrity
|
||||||
|
|
||||||
# Optional REPL history
|
# Optional REPL history
|
||||||
.node_repl_history
|
.node_repl_history
|
||||||
|
|
||||||
# Output of 'npm pack'
|
# Temporary files
|
||||||
*.tgz
|
*.tmp
|
||||||
|
*.temp
|
||||||
|
*.bak
|
||||||
|
|
||||||
# Yarn Integrity file
|
# Next.js
|
||||||
.yarn-integrity
|
.next/
|
||||||
|
|
||||||
# dotenv environment variables file
|
# Nuxt.js
|
||||||
# .env
|
.nuxt/
|
||||||
.env.test
|
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
# Gatsby
|
||||||
.cache
|
|
||||||
|
|
||||||
# Next.js build output
|
|
||||||
.next
|
|
||||||
|
|
||||||
# Nuxt.js build / generate output
|
|
||||||
.nuxt
|
|
||||||
dist
|
|
||||||
|
|
||||||
# Gatsby files
|
|
||||||
.cache/
|
.cache/
|
||||||
# Comment in the public line in if your project uses Gatsby and *not* Next.js
|
public/
|
||||||
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
||||||
# public
|
|
||||||
|
|
||||||
# vuepress build output
|
# VuePress
|
||||||
.vuepress/dist
|
.vuepress/dist
|
||||||
|
|
||||||
# Serverless directories
|
# Serverless
|
||||||
.serverless/
|
.serverless/
|
||||||
|
|
||||||
# FuseBox cache
|
# DynamoDB
|
||||||
.fusebox/
|
|
||||||
|
|
||||||
# DynamoDB Local files
|
|
||||||
.dynamodb/
|
.dynamodb/
|
||||||
|
|
||||||
# TernJS port file
|
# TernJS
|
||||||
.tern-port
|
.tern-port
|
||||||
|
|
||||||
# wincompare file
|
# Bower
|
||||||
*.bak
|
bower_components/
|
||||||
|
|
||||||
|
# JSPM
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# Optional test outputs
|
||||||
|
test-results/
|
||||||
|
playwright-report/
|
||||||
|
|
||||||
|
# Vite
|
||||||
|
vite.svg
|
||||||
177
package-lock.json
generated
177
package-lock.json
generated
@@ -40,6 +40,7 @@
|
|||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mui-daterange-picker": "^1.0.5",
|
"mui-daterange-picker": "^1.0.5",
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
|
"papaparse": "^5.5.3",
|
||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
@@ -71,6 +72,7 @@
|
|||||||
"stylis-plugin-rtl": "^2.1.1",
|
"stylis-plugin-rtl": "^2.1.1",
|
||||||
"util": "^0.12.5",
|
"util": "^0.12.5",
|
||||||
"web-vitals": "^3.3.1",
|
"web-vitals": "^3.3.1",
|
||||||
|
"xlsx": "^0.18.5",
|
||||||
"yup": "^1.1.1"
|
"yup": "^1.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -5648,6 +5650,15 @@
|
|||||||
"node": ">=8.9"
|
"node": ">=8.9"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/adler-32": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/agent-base": {
|
"node_modules/agent-base": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||||
@@ -6825,6 +6836,19 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/cfb": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"adler-32": "~1.3.0",
|
||||||
|
"crc-32": "~1.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/chalk": {
|
"node_modules/chalk": {
|
||||||
"version": "2.4.2",
|
"version": "2.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||||
@@ -6989,6 +7013,15 @@
|
|||||||
"node": ">= 4.0"
|
"node": ">= 4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/codepage": {
|
||||||
|
"version": "1.15.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
|
||||||
|
"integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/collect-v8-coverage": {
|
"node_modules/collect-v8-coverage": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz",
|
||||||
@@ -7242,6 +7275,18 @@
|
|||||||
"resolved": "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.5.10.tgz",
|
"resolved": "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.5.10.tgz",
|
||||||
"integrity": "sha512-x3elaK+ZY23W1YtFsNQknRdURzkV7g3Z93AoA7SHZJUEXbVjRsNh4h9Uf09+OjWF/4u8tXeAt37gezGRdwR/2g=="
|
"integrity": "sha512-x3elaK+ZY23W1YtFsNQknRdURzkV7g3Z93AoA7SHZJUEXbVjRsNh4h9Uf09+OjWF/4u8tXeAt37gezGRdwR/2g=="
|
||||||
},
|
},
|
||||||
|
"node_modules/crc-32": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"bin": {
|
||||||
|
"crc32": "bin/crc32.njs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/create-ecdh": {
|
"node_modules/create-ecdh": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
|
||||||
@@ -9907,6 +9952,15 @@
|
|||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/frac": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/fraction.js": {
|
"node_modules/fraction.js": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz",
|
||||||
@@ -14337,6 +14391,12 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/papaparse": {
|
||||||
|
"version": "5.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.5.3.tgz",
|
||||||
|
"integrity": "sha512-5QvjGxYVjxO59MGU2lHVYpRWBBtKHnlIAcSe1uNFCkkptUh63NFRj0FJQm7nR67puEruUci/ZkjmEFrjCAyP4A==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/param-case": {
|
"node_modules/param-case": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
|
||||||
@@ -18683,6 +18743,18 @@
|
|||||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||||
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
||||||
},
|
},
|
||||||
|
"node_modules/ssf": {
|
||||||
|
"version": "0.11.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz",
|
||||||
|
"integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"frac": "~1.1.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/stable": {
|
"node_modules/stable": {
|
||||||
"version": "0.1.8",
|
"version": "0.1.8",
|
||||||
"resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz",
|
||||||
@@ -20176,6 +20248,24 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/wmf": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/word": {
|
||||||
|
"version": "0.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz",
|
||||||
|
"integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/word-wrap": {
|
"node_modules/word-wrap": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||||
@@ -20560,6 +20650,27 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/xlsx": {
|
||||||
|
"version": "0.18.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz",
|
||||||
|
"integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"dependencies": {
|
||||||
|
"adler-32": "~1.3.0",
|
||||||
|
"cfb": "~1.2.1",
|
||||||
|
"codepage": "~1.15.0",
|
||||||
|
"crc-32": "~1.2.1",
|
||||||
|
"ssf": "~0.11.2",
|
||||||
|
"wmf": "~1.0.1",
|
||||||
|
"word": "~0.3.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"xlsx": "bin/xlsx.njs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/xml-name-validator": {
|
"node_modules/xml-name-validator": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
|
||||||
@@ -24455,6 +24566,11 @@
|
|||||||
"regex-parser": "^2.2.11"
|
"regex-parser": "^2.2.11"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"adler-32": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A=="
|
||||||
|
},
|
||||||
"agent-base": {
|
"agent-base": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
||||||
@@ -25342,6 +25458,15 @@
|
|||||||
"resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz",
|
||||||
"integrity": "sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw=="
|
"integrity": "sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw=="
|
||||||
},
|
},
|
||||||
|
"cfb": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==",
|
||||||
|
"requires": {
|
||||||
|
"adler-32": "~1.3.0",
|
||||||
|
"crc-32": "~1.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"chalk": {
|
"chalk": {
|
||||||
"version": "2.4.2",
|
"version": "2.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||||
@@ -25468,6 +25593,11 @@
|
|||||||
"q": "^1.1.2"
|
"q": "^1.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"codepage": {
|
||||||
|
"version": "1.15.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz",
|
||||||
|
"integrity": "sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA=="
|
||||||
|
},
|
||||||
"collect-v8-coverage": {
|
"collect-v8-coverage": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz",
|
||||||
@@ -25667,6 +25797,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.5.10.tgz",
|
"resolved": "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.5.10.tgz",
|
||||||
"integrity": "sha512-x3elaK+ZY23W1YtFsNQknRdURzkV7g3Z93AoA7SHZJUEXbVjRsNh4h9Uf09+OjWF/4u8tXeAt37gezGRdwR/2g=="
|
"integrity": "sha512-x3elaK+ZY23W1YtFsNQknRdURzkV7g3Z93AoA7SHZJUEXbVjRsNh4h9Uf09+OjWF/4u8tXeAt37gezGRdwR/2g=="
|
||||||
},
|
},
|
||||||
|
"crc-32": {
|
||||||
|
"version": "1.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz",
|
||||||
|
"integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="
|
||||||
|
},
|
||||||
"create-ecdh": {
|
"create-ecdh": {
|
||||||
"version": "4.0.4",
|
"version": "4.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
|
||||||
@@ -27606,6 +27741,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||||
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="
|
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="
|
||||||
},
|
},
|
||||||
|
"frac": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA=="
|
||||||
|
},
|
||||||
"fraction.js": {
|
"fraction.js": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz",
|
||||||
@@ -30787,6 +30927,11 @@
|
|||||||
"retry": "^0.13.1"
|
"retry": "^0.13.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"papaparse": {
|
||||||
|
"version": "5.5.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.5.3.tgz",
|
||||||
|
"integrity": "sha512-5QvjGxYVjxO59MGU2lHVYpRWBBtKHnlIAcSe1uNFCkkptUh63NFRj0FJQm7nR67puEruUci/ZkjmEFrjCAyP4A=="
|
||||||
|
},
|
||||||
"param-case": {
|
"param-case": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz",
|
||||||
@@ -33726,6 +33871,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||||
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
|
||||||
},
|
},
|
||||||
|
"ssf": {
|
||||||
|
"version": "0.11.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz",
|
||||||
|
"integrity": "sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==",
|
||||||
|
"requires": {
|
||||||
|
"frac": "~1.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"stable": {
|
"stable": {
|
||||||
"version": "0.1.8",
|
"version": "0.1.8",
|
||||||
"resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz",
|
||||||
@@ -34810,6 +34963,16 @@
|
|||||||
"is-typed-array": "^1.1.10"
|
"is-typed-array": "^1.1.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"wmf": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw=="
|
||||||
|
},
|
||||||
|
"word": {
|
||||||
|
"version": "0.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/word/-/word-0.3.0.tgz",
|
||||||
|
"integrity": "sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA=="
|
||||||
|
},
|
||||||
"word-wrap": {
|
"word-wrap": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
||||||
@@ -35140,6 +35303,20 @@
|
|||||||
"integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==",
|
"integrity": "sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
|
"xlsx": {
|
||||||
|
"version": "0.18.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz",
|
||||||
|
"integrity": "sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==",
|
||||||
|
"requires": {
|
||||||
|
"adler-32": "~1.3.0",
|
||||||
|
"cfb": "~1.2.1",
|
||||||
|
"codepage": "~1.15.0",
|
||||||
|
"crc-32": "~1.2.1",
|
||||||
|
"ssf": "~0.11.2",
|
||||||
|
"wmf": "~1.0.1",
|
||||||
|
"word": "~0.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"xml-name-validator": {
|
"xml-name-validator": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
|
||||||
|
|||||||
@@ -35,6 +35,7 @@
|
|||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"mui-daterange-picker": "^1.0.5",
|
"mui-daterange-picker": "^1.0.5",
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
|
"papaparse": "^5.5.3",
|
||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"prop-types": "^15.8.1",
|
"prop-types": "^15.8.1",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
@@ -66,6 +67,7 @@
|
|||||||
"stylis-plugin-rtl": "^2.1.1",
|
"stylis-plugin-rtl": "^2.1.1",
|
||||||
"util": "^0.12.5",
|
"util": "^0.12.5",
|
||||||
"web-vitals": "^3.3.1",
|
"web-vitals": "^3.3.1",
|
||||||
|
"xlsx": "^0.18.5",
|
||||||
"yup": "^1.1.1"
|
"yup": "^1.1.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
3
src/components/nearle_components/getValueColor.js
Normal file
3
src/components/nearle_components/getValueColor.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export const getValueColor = (value) => {
|
||||||
|
return Number(value) !== 0 ? 'red' : 'inherit';
|
||||||
|
};
|
||||||
@@ -169,7 +169,7 @@ const HeaderContent = () => {
|
|||||||
<ListItemIcon sx={{ mr: 1, fontSize: '20px' }}>
|
<ListItemIcon sx={{ mr: 1, fontSize: '20px' }}>
|
||||||
<TbBoxMultiple1 />
|
<TbBoxMultiple1 />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<Typography color="textPrimary"> Orders</Typography>
|
<Typography color="textPrimary">Create Orders</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@@ -188,7 +188,7 @@ const HeaderContent = () => {
|
|||||||
<ListItemIcon sx={{ mr: 1, fontSize: '20px' }}>
|
<ListItemIcon sx={{ mr: 1, fontSize: '20px' }}>
|
||||||
<GrMultiple />
|
<GrMultiple />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<Typography color="textPrimary"> Group Orders</Typography>
|
<Typography color="textPrimary">Create Group Orders</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -96,14 +96,14 @@ const nearle = {
|
|||||||
type: 'item',
|
type: 'item',
|
||||||
url: '/nearle/reports/ridersummary',
|
url: '/nearle/reports/ridersummary',
|
||||||
icon: DirectionsBikeOutlinedIcon
|
icon: DirectionsBikeOutlinedIcon
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'RiderLogs',
|
||||||
|
title: <FormattedMessage id="RiderLogs" />,
|
||||||
|
type: 'item',
|
||||||
|
url: '/nearle/reports/riderlogs',
|
||||||
|
icon: DirectionsBikeOutlinedIcon
|
||||||
}
|
}
|
||||||
// {
|
|
||||||
// id: 'RiderLogs',
|
|
||||||
// title: <FormattedMessage id="RiderLogs" />,
|
|
||||||
// type: 'item',
|
|
||||||
// url: '/nearle/reports/riderlogs',
|
|
||||||
// icon: DirectionsBikeOutlinedIcon
|
|
||||||
// }
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -147,9 +147,9 @@ export const fetchOrdersSummary = async ({ queryKey }) => {
|
|||||||
// ==============================|| getreportlocationsummary (orders summary)||============================== //
|
// ==============================|| getreportlocationsummary (orders summary)||============================== //
|
||||||
export const getreportlocationsummary = async ({ queryKey }) => {
|
export const getreportlocationsummary = async ({ queryKey }) => {
|
||||||
console.log('queryKey for getreportlocationsummary', queryKey);
|
console.log('queryKey for getreportlocationsummary', queryKey);
|
||||||
const [startdate, enddate, locationId] = queryKey;
|
const [startdate, enddate, locationId, debouncedSearch] = queryKey;
|
||||||
const response = await axios.get(
|
const response = await axios.get(
|
||||||
`${process.env.REACT_APP_URL}/deliveries/getreportlocationsummary/?tenantid=${tenid}&locationid=${locationId}&fromdate=${startdate}&todate=${enddate}`
|
`${process.env.REACT_APP_URL}/deliveries/getreportlocationsummary/?tenantid=${tenid}&locationid=${locationId}&fromdate=${startdate}&todate=${enddate}&keyword=${debouncedSearch}`
|
||||||
);
|
);
|
||||||
console.log('getreportlocationsummary', response.data.details);
|
console.log('getreportlocationsummary', response.data.details);
|
||||||
|
|
||||||
@@ -292,9 +292,16 @@ export const fetchCount = async ({ queryKey }) => {
|
|||||||
// ==============================|| fetchRidersLogs (RiderLogs)||============================== //
|
// ==============================|| fetchRidersLogs (RiderLogs)||============================== //
|
||||||
|
|
||||||
export const fetchRidersLogs = async ({ queryKey }) => {
|
export const fetchRidersLogs = async ({ queryKey }) => {
|
||||||
const [tenantid, startdate] = queryKey;
|
const [appId, startdate, riderSearch = ''] = queryKey;
|
||||||
|
// const riderLogsResponse = await axios.get(
|
||||||
|
// `${process.env.REACT_APP_URL}/partners/getriderlogs/?applocationid=${appId}&fromdate=${startdate || ''}&todate=${startdate}&keyword=${
|
||||||
|
// riderSearch || ''
|
||||||
|
// }`
|
||||||
|
// );
|
||||||
const riderLogsResponse = await axios.get(
|
const riderLogsResponse = await axios.get(
|
||||||
`${process.env.REACT_APP_URL}/partners/getriderlogs/?tenantid=${tenantid}&fromdate=${startdate || ''}`
|
`https://jupiter.nearle.app/live/api/v2/partners/getriderlogs/?applocationid=${appId}&fromdate=${startdate || ''}&todate=${
|
||||||
|
startdate || ''
|
||||||
|
}&keyword=${riderSearch || ''}`
|
||||||
);
|
);
|
||||||
console.log('fetchRidersLogs', riderLogsResponse.data.details);
|
console.log('fetchRidersLogs', riderLogsResponse.data.details);
|
||||||
return riderLogsResponse.data.details;
|
return riderLogsResponse.data.details;
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ const Invoice = () => {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setIsLoader(false);
|
setIsLoader(false);
|
||||||
// setpredialog(true);
|
// setpredialog(true);
|
||||||
navigate('/invoice/preview', {
|
navigate('/nearle/invoice/preview', {
|
||||||
state: item
|
state: item
|
||||||
});
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|||||||
@@ -118,6 +118,8 @@ const Createorder1 = () => {
|
|||||||
const [isLocation, setIsLocation] = useState(false);
|
const [isLocation, setIsLocation] = useState(false);
|
||||||
const textFieldRef1 = useRef(null);
|
const textFieldRef1 = useRef(null);
|
||||||
const textFieldRef2 = useRef(null);
|
const textFieldRef2 = useRef(null);
|
||||||
|
const [collectionamt, setCollectionamt] = useState(0);
|
||||||
|
const [quantity, setQuantity] = useState(1);
|
||||||
|
|
||||||
const handleOkClick1 = () => {
|
const handleOkClick1 = () => {
|
||||||
// Set focus back to the text field after clicking the "OK" chip
|
// Set focus back to the text field after clicking the "OK" chip
|
||||||
@@ -836,7 +838,9 @@ const Createorder1 = () => {
|
|||||||
subcategoryid: +subCatId,
|
subcategoryid: +subCatId,
|
||||||
taxamount: 0.0,
|
taxamount: 0.0,
|
||||||
tenantid: tenant.tenantid,
|
tenantid: tenant.tenantid,
|
||||||
tenantuserid: parseInt(localStorage.getItem('userid'))
|
tenantuserid: parseInt(localStorage.getItem('userid')),
|
||||||
|
collectionamt: +collectionamt || 0,
|
||||||
|
quantity: +quantity || 1
|
||||||
},
|
},
|
||||||
|
|
||||||
pickup: {
|
pickup: {
|
||||||
@@ -936,8 +940,8 @@ const Createorder1 = () => {
|
|||||||
autoHideDuration: 1000
|
autoHideDuration: 1000
|
||||||
});
|
});
|
||||||
if (admintoken) {
|
if (admintoken) {
|
||||||
// notifyadmin(admintoken);
|
notifyadmin(admintoken);
|
||||||
sendnotifications();
|
// sendnotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
navigate('/nearle/orders');
|
navigate('/nearle/orders');
|
||||||
@@ -2233,6 +2237,37 @@ const Createorder1 = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid container spacing={2} sx={{ mt: 2 }}>
|
||||||
|
<Grid item xs={12} sm={6}>
|
||||||
|
<Stack>
|
||||||
|
<TextField
|
||||||
|
type="number"
|
||||||
|
value={collectionamt}
|
||||||
|
fullWidth
|
||||||
|
label={'Cash Collect'}
|
||||||
|
onChange={(e) => {
|
||||||
|
setCollectionamt(e.target.value);
|
||||||
|
}}
|
||||||
|
inputProps={{ min: 0 }}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} sm={6}>
|
||||||
|
<Stack>
|
||||||
|
<TextField
|
||||||
|
type="number"
|
||||||
|
value={quantity}
|
||||||
|
fullWidth
|
||||||
|
label={'Quantity'}
|
||||||
|
onChange={(e) => {
|
||||||
|
setQuantity(e.target.value);
|
||||||
|
}}
|
||||||
|
inputProps={{ min: 1 }}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
{/* ================================================= || Notes || ================================================= */}
|
{/* ================================================= || Notes || ================================================= */}
|
||||||
<MainCard sx={{ mt: 2 }}>
|
<MainCard sx={{ mt: 2 }}>
|
||||||
<Grid container>
|
<Grid container>
|
||||||
|
|||||||
898
src/pages/nearle/orders/multiOrderBackup.js
Normal file
898
src/pages/nearle/orders/multiOrderBackup.js
Normal file
@@ -0,0 +1,898 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Loader from 'components/Loader';
|
||||||
|
import { useEffect, useState, Fragment } from 'react';
|
||||||
|
import { useTheme } from '@mui/material/styles';
|
||||||
|
import MainCard from 'components/MainCard';
|
||||||
|
import axios from 'axios';
|
||||||
|
import ClearIcon from '@mui/icons-material/Clear';
|
||||||
|
import { SearchOutlined, CloseOutlined } from '@ant-design/icons';
|
||||||
|
import { Empty } from 'antd';
|
||||||
|
import MyLocationIcon from '@mui/icons-material/MyLocation';
|
||||||
|
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 dayjs from 'dayjs';
|
||||||
|
var utc = require('dayjs/plugin/utc');
|
||||||
|
dayjs.extend(utc);
|
||||||
|
import { enqueueSnackbar } from 'notistack';
|
||||||
|
import { useNavigate } from 'react-router';
|
||||||
|
import { GoogleMap, LoadScript, Marker } from '@react-google-maps/api';
|
||||||
|
|
||||||
|
import {
|
||||||
|
FormControl,
|
||||||
|
InputAdornment,
|
||||||
|
Grid,
|
||||||
|
Typography,
|
||||||
|
Stack,
|
||||||
|
Button,
|
||||||
|
TextField,
|
||||||
|
Autocomplete,
|
||||||
|
Divider,
|
||||||
|
Dialog,
|
||||||
|
DialogTitle,
|
||||||
|
DialogContent,
|
||||||
|
Checkbox,
|
||||||
|
DialogActions,
|
||||||
|
CircularProgress,
|
||||||
|
IconButton,
|
||||||
|
OutlinedInput,
|
||||||
|
FormGroup,
|
||||||
|
FormControlLabel,
|
||||||
|
Table,
|
||||||
|
TableContainer,
|
||||||
|
TableCell,
|
||||||
|
TableBody,
|
||||||
|
TableRow,
|
||||||
|
Paper,
|
||||||
|
TableHead,
|
||||||
|
Box
|
||||||
|
} from '@mui/material';
|
||||||
|
import CircularLoader from 'components/nearle_components/CircularLoader';
|
||||||
|
// import RidersPinPointOSM from './RidersPinPointOSM';
|
||||||
|
import RidersPinPoint from './ridersPinPoint';
|
||||||
|
|
||||||
|
const MultipleOrders = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
const theme = useTheme();
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [btnLoading, setBtnLoading] = useState(false);
|
||||||
|
const [appId, setAppId] = useState(0);
|
||||||
|
|
||||||
|
const [tenantLocations, setTenantlocations] = useState([]);
|
||||||
|
const userid = localStorage.getItem('userid');
|
||||||
|
const tenId = localStorage.getItem('tenantid');
|
||||||
|
const [tid, setTid] = useState(0);
|
||||||
|
const [isLocation, setIsLocation] = useState(false);
|
||||||
|
const [basePrice, setBasePrice] = useState(0);
|
||||||
|
const [pricePerKm, setPricePerKm] = useState(0);
|
||||||
|
const [minKm, setMinKm] = useState(0);
|
||||||
|
const [pickCust, setPickCust] = useState(null);
|
||||||
|
const [dropCust, setDropCust] = useState([]);
|
||||||
|
const [isCustomerOpen, setIsCustomerOpen] = useState(false);
|
||||||
|
const [searchCustList, setSearchCustList] = useState('');
|
||||||
|
const [customerlist, setCustomerlist] = useState([]);
|
||||||
|
const [startdate, setStartdate] = useState(dayjs().format('MM-DD-YYYY'));
|
||||||
|
const [timeslotarr, setTimeslotarr] = useState([]);
|
||||||
|
const [starttime, setStatrttime] = useState();
|
||||||
|
const [endtime, setEndtime] = useState();
|
||||||
|
const [alertmessage, setAlertmessage] = useState('');
|
||||||
|
const [otherinstructions, setOtherinstructions] = useState('');
|
||||||
|
const [admintoken, setAdmintoken] = useState();
|
||||||
|
const [totaldist, settotaldist] = useState(0);
|
||||||
|
const [totalAmt, settotalAmt] = useState(0);
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
const [showMap, setShowMap] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
dropCust && console.log('dropCust', dropCust);
|
||||||
|
}, [dropCust]);
|
||||||
|
|
||||||
|
// =============================================== || opentoast || ===============================================
|
||||||
|
const opentoast = (message, variant, time) => {
|
||||||
|
enqueueSnackbar(message, {
|
||||||
|
variant: variant,
|
||||||
|
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||||
|
autoHideDuration: time ? time : 1500
|
||||||
|
});
|
||||||
|
console.log(alertmessage);
|
||||||
|
};
|
||||||
|
// ==============================|| fetchAppLocations ||============================== //
|
||||||
|
const fetchAppLocations = async () => {
|
||||||
|
try {
|
||||||
|
const locationRes = await axios.get(`${process.env.REACT_APP_URL}/partners/getlocations/?userid=${userid}`);
|
||||||
|
console.log('fetchAppLocations', locationRes.data.details);
|
||||||
|
} catch (err) {
|
||||||
|
console.log('locationRes', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
fetchAppLocations();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// ============================================= || fetchTenantPricing || =============================================
|
||||||
|
|
||||||
|
const fetchTenantPricing = async (id) => {
|
||||||
|
try {
|
||||||
|
const pricingResponse = await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantpricing/?tenantid=${tenId}`);
|
||||||
|
console.log('pricingResponse', pricingResponse.data.details);
|
||||||
|
setBasePrice(pricingResponse.data.details.baseprice);
|
||||||
|
setPricePerKm(pricingResponse.data.details.priceperkm);
|
||||||
|
setMinKm(pricingResponse.data.details.minkm);
|
||||||
|
} catch (error) {
|
||||||
|
console.log('fetchTenantPricing error', error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
fetchTenantPricing();
|
||||||
|
}, []);
|
||||||
|
// ============================================= || gettenantlocations (branches) || =============================================
|
||||||
|
const gettenantlocations = async (id) => {
|
||||||
|
try {
|
||||||
|
const res = await axios.get(`${process.env.REACT_APP_URL}/tenants/gettenantlocations/?tenantid=${id}`);
|
||||||
|
console.log('gettenantlocations', res.data.details);
|
||||||
|
if (res.data.details.length == 1) {
|
||||||
|
setIsLocation(true);
|
||||||
|
setTenantlocations(res.data.details);
|
||||||
|
setPickCust(res.data.details[0]);
|
||||||
|
} else {
|
||||||
|
setTenantlocations(res.data.details);
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
|
console.log('gettenantlocations', err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
gettenantlocations(tenId);
|
||||||
|
}, []);
|
||||||
|
// ========================================================= || clientdetails || =========================================================
|
||||||
|
const clientdetails = async () => {
|
||||||
|
try {
|
||||||
|
let url =
|
||||||
|
searchCustList == ''
|
||||||
|
? `${process.env.REACT_APP_URL}/customers/gettenantcustomers/?tenantid=${tenId}&pageno=1&pagesize=10`
|
||||||
|
: `${process.env.REACT_APP_URL}/customers/search/?tenantid=${tenId}&keyword=${searchCustList}`;
|
||||||
|
await axios
|
||||||
|
.get(url)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data.status) {
|
||||||
|
console.log('clientdetails', res.data.details);
|
||||||
|
|
||||||
|
setCustomerlist(res.data.details);
|
||||||
|
let arr = [];
|
||||||
|
res.data.details.map((val) => {
|
||||||
|
arr.push({
|
||||||
|
label: `${val.firstname} | ${val.contactno}`,
|
||||||
|
...val
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
opentoast('server error', 'warning');
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
if (tenId) {
|
||||||
|
clientdetails();
|
||||||
|
}
|
||||||
|
}, [searchCustList.length > 3, searchCustList == '', tenId]);
|
||||||
|
|
||||||
|
// ========================================================= || calculateTotal(dist , charge) || =========================================================
|
||||||
|
const calculateTotal = () => {
|
||||||
|
let a1 = 0;
|
||||||
|
let a2 = 0;
|
||||||
|
dropCust?.map((customer) => {
|
||||||
|
a1 += customer.distance;
|
||||||
|
a2 += customer.totalcharge;
|
||||||
|
});
|
||||||
|
settotaldist(a1);
|
||||||
|
settotalAmt(a2);
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
dropCust && calculateTotal();
|
||||||
|
}, [dropCust]);
|
||||||
|
|
||||||
|
// ========================================================= || handleCheckboxChange || =========================================================
|
||||||
|
const handleCheckboxChange = async (event, customer) => {
|
||||||
|
setIsLoading(true);
|
||||||
|
console.log('event', event.target.checked);
|
||||||
|
console.log('customer', customer);
|
||||||
|
if (event.target.checked) {
|
||||||
|
// If the checkbox is checked, calculate the distance and add the customer
|
||||||
|
try {
|
||||||
|
const obj = await calculateDistance(customer);
|
||||||
|
console.log('return of calculateDistance', obj);
|
||||||
|
|
||||||
|
const { roundedDistance, totalcharge } = obj;
|
||||||
|
// Create a new customer object with the distance property
|
||||||
|
const updatedCustomer = {
|
||||||
|
...customer,
|
||||||
|
distance: roundedDistance,
|
||||||
|
totalcharge: totalcharge
|
||||||
|
};
|
||||||
|
|
||||||
|
// Add the updated customer object to dropCust
|
||||||
|
setDropCust((prevDropCust) => [...prevDropCust, updatedCustomer]);
|
||||||
|
|
||||||
|
// Log the rounded distance
|
||||||
|
console.log(`Rounded Distance: ${roundedDistance} km`);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Failed to calculate distance:', error);
|
||||||
|
}
|
||||||
|
setIsLoading(false);
|
||||||
|
} else {
|
||||||
|
// If the checkbox is unchecked, remove the customer from dropCust
|
||||||
|
setDropCust((prevDropCust) => {
|
||||||
|
return prevDropCust.filter((cust) => cust.customerid !== customer.customerid);
|
||||||
|
});
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// ========================================================= || calculateDistance || =========================================================
|
||||||
|
const calculateDistance = async (customer) => {
|
||||||
|
console.log('Distance calculation starts');
|
||||||
|
const service = new google.maps.DistanceMatrixService();
|
||||||
|
// Helper function to get the distance matrix
|
||||||
|
const getDistanceMatrix = async (origins, destinations) => {
|
||||||
|
console.log('origins', origins);
|
||||||
|
console.log('destinations', destinations);
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
console.log('calculation starts');
|
||||||
|
service.getDistanceMatrix(
|
||||||
|
{
|
||||||
|
origins: [new google.maps.LatLng(origins.latitude, origins.longitude)],
|
||||||
|
destinations: [new google.maps.LatLng(destinations.latitude, destinations.longitude)],
|
||||||
|
travelMode: 'DRIVING',
|
||||||
|
unitSystem: google.maps.UnitSystem.METRIC // Distances in metric units (km)
|
||||||
|
},
|
||||||
|
(response, status) => {
|
||||||
|
console.log('cal response', response);
|
||||||
|
console.log('cal status', status);
|
||||||
|
if (status === 'OK') {
|
||||||
|
console.log('calcualtion resolved');
|
||||||
|
resolve(response);
|
||||||
|
} else {
|
||||||
|
console.log('calcualtion rejected');
|
||||||
|
|
||||||
|
reject(new Error(`Error calculating distance: ${status}`));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
try {
|
||||||
|
// Call getDistanceMatrix and wait for the response
|
||||||
|
const response = await getDistanceMatrix(pickCust, customer);
|
||||||
|
|
||||||
|
// Extract distance from the first result
|
||||||
|
const distanceInMeters = response.rows[0].elements[0].distance.value;
|
||||||
|
|
||||||
|
// Convert distance from meters to kilometers
|
||||||
|
const distanceInKilometers = distanceInMeters / 1000;
|
||||||
|
|
||||||
|
// Round the distance to the nearest integer
|
||||||
|
const roundedDistance = Math.round(distanceInKilometers);
|
||||||
|
let totalcharge;
|
||||||
|
if (roundedDistance < minKm) {
|
||||||
|
console.log('minKm', minKm);
|
||||||
|
console.log('pricePerKm', pricePerKm);
|
||||||
|
console.log('basePrice', basePrice);
|
||||||
|
totalcharge = basePrice;
|
||||||
|
} else {
|
||||||
|
console.log('minKm', minKm);
|
||||||
|
console.log('pricePerKm', pricePerKm);
|
||||||
|
console.log('basePrice', basePrice);
|
||||||
|
totalcharge = (roundedDistance - minKm) * pricePerKm + basePrice;
|
||||||
|
console.log('totalcharge', totalcharge);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return the rounded distance
|
||||||
|
return { roundedDistance, totalcharge };
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error calculating distance:', error);
|
||||||
|
throw error; // Rethrow the error to be handled by the caller
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// ==================================================== || fetchTiming || ====================================================
|
||||||
|
const fetchTiming = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
await axios
|
||||||
|
.get(`${process.env.REACT_APP_URL}/utils/getapplocations/?applocationid=${appId}`)
|
||||||
|
.then((res) => {
|
||||||
|
console.log('fetchTiming', res);
|
||||||
|
const { opentime, closetime, latitude, longitude, radius } = res.data.details[0];
|
||||||
|
if (res.data.status) {
|
||||||
|
setStatrttime(`${dayjs().format('MM-DD-YYYY')} ${opentime}`);
|
||||||
|
setEndtime(`${dayjs().format('MM-DD-YYYY')} ${closetime}`);
|
||||||
|
console.log('starttime', `${dayjs().format('MM-DD-YYYY')} ${opentime}`);
|
||||||
|
console.log('endtime', `${dayjs().format('MM-DD-YYYY')} ${closetime} `);
|
||||||
|
let arr = [];
|
||||||
|
for (
|
||||||
|
let i = `${dayjs().format('MM-DD-YYYY')} ${opentime}`, j = 0;
|
||||||
|
dayjs(`${dayjs().format('MM-DD-YYYY')} ${closetime} `).diff(i, 'm') >= 0;
|
||||||
|
j++, i = dayjs(i).add(30, 'm')
|
||||||
|
) {
|
||||||
|
arr.push(i);
|
||||||
|
}
|
||||||
|
console.log('setTimeslotarr', arr);
|
||||||
|
setTimeslotarr(arr);
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
setLoading(false);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
if (appId) {
|
||||||
|
fetchTiming();
|
||||||
|
}
|
||||||
|
}, [starttime, endtime, appId]);
|
||||||
|
|
||||||
|
const fetchAppAdminTokens = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
await axios
|
||||||
|
.get(`${process.env.REACT_APP_URL}/utils/getapplocationconfig/?applocationid=${appId}`)
|
||||||
|
.then((res) => {
|
||||||
|
const userfcmtokemArray = res.data.details.applocationadmins.map((admin) => admin.userfcmtokem); // fcm => firebase cloud messaging
|
||||||
|
console.log('fetchAppAdminTokens', res);
|
||||||
|
console.log('userfcmtokemArray', userfcmtokemArray);
|
||||||
|
if (res.data.status) {
|
||||||
|
setAdmintoken(userfcmtokemArray);
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
setLoading(false);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (starttime && endtime) {
|
||||||
|
fetchAppAdminTokens();
|
||||||
|
}
|
||||||
|
}, [starttime, endtime]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('pickCust', pickCust);
|
||||||
|
}, [pickCust]);
|
||||||
|
|
||||||
|
// ==================================================== || fetchtenantinfo || ====================================================
|
||||||
|
const fetchtenantinfo = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
console.log('tid', tid);
|
||||||
|
|
||||||
|
await axios
|
||||||
|
.get(`${process.env.REACT_APP_URL}/tenants/gettenantinfo/?tenantid=${tid}`)
|
||||||
|
.then((res) => {
|
||||||
|
console.log('fetchtenantinfo', res);
|
||||||
|
if (res.data.status) {
|
||||||
|
fetchAppAdminTokens();
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
setLoading(false);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
if (tid) {
|
||||||
|
fetchtenantinfo();
|
||||||
|
}
|
||||||
|
}, [tid]);
|
||||||
|
// ================================================== || sendnotifications || ==================================================
|
||||||
|
const sendnotifications = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
await axios
|
||||||
|
.post(`${process.env.REACT_APP_URL}/utils/sendnotifications`, {
|
||||||
|
priority: 'high',
|
||||||
|
registration_ids: admintoken,
|
||||||
|
data: {
|
||||||
|
accessid: process.env.REACT_APP_RIDER_ACCESS_ID
|
||||||
|
},
|
||||||
|
notification: {
|
||||||
|
title: 'Nearle Merchant',
|
||||||
|
body: 'An Order has been placed successfully,kindly process the same',
|
||||||
|
sound: 'ring'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
if (res.data.message == 'Success') {
|
||||||
|
enqueueSnackbar('Notification sent Successfully', {
|
||||||
|
variant: 'success',
|
||||||
|
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||||
|
autoHideDuration: 1000
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
enqueueSnackbar(err.message, {
|
||||||
|
variant: 'error',
|
||||||
|
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||||
|
autoHideDuration: 1000
|
||||||
|
});
|
||||||
|
setLoading(false);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
// =============================================== || creategrouporders || ===============================================
|
||||||
|
const creategrouporders = async () => {
|
||||||
|
const arr = dropCust?.map((customer) => ({
|
||||||
|
applocationid: pickCust.applocationid,
|
||||||
|
cancellled: '',
|
||||||
|
// categoryid: +tenant.categoryid,
|
||||||
|
configid: 9,
|
||||||
|
customerid: customer.customerid,
|
||||||
|
deliveryaddress: customer.address || '',
|
||||||
|
deliverycharge: +customer.totalcharge || 0,
|
||||||
|
deliverycity: customer.city || '',
|
||||||
|
deliverycontactno: customer.contactno || '',
|
||||||
|
deliverycustomer: customer.firstname || '',
|
||||||
|
deliveryid: +customer.customerid,
|
||||||
|
deliverylandmark: customer.landmark || '',
|
||||||
|
deliverylat: customer.latitude,
|
||||||
|
deliverylocation: customer.suburb || '',
|
||||||
|
deliverylocationid: customer.deliverylocationid || 0,
|
||||||
|
deliverylong: customer.longitude,
|
||||||
|
// deliverytime: `${dayjs(startdate).format('YYYY-MM-DD HH:mm:ss')} `,
|
||||||
|
deliverytime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
deliverytype: 'B',
|
||||||
|
delivered: '',
|
||||||
|
itemcount: 1,
|
||||||
|
kms: customer.distance.toString() || 0,
|
||||||
|
locationid: +pickCust.locationid,
|
||||||
|
moduleid: +pickCust.moduleid,
|
||||||
|
orderamount: +customer.totalcharge || 0,
|
||||||
|
ordercharges: 0.0,
|
||||||
|
orderdate: dayjs().format('YYYY-MM-DD HH:mm:ss'),
|
||||||
|
orderheaderid: 0,
|
||||||
|
orderid: '', //
|
||||||
|
ordernotes: otherinstructions,
|
||||||
|
orderstatus: 'created',
|
||||||
|
ordervalue: +customer.totalcharge || 0,
|
||||||
|
partnerid: pickCust.partnerid,
|
||||||
|
partneruserid: +userid,
|
||||||
|
paymentstatus: 1,
|
||||||
|
paymenttype: 42,
|
||||||
|
pending: '',
|
||||||
|
pickupaddress: pickCust.address || '',
|
||||||
|
pickupcity: pickCust.locationcity || '',
|
||||||
|
pickupcontactno: pickCust.contactno || '',
|
||||||
|
pickupcustomer: pickCust.locationname || '',
|
||||||
|
pickuplandmark: pickCust.landmark || '',
|
||||||
|
pickuplat: pickCust.latitude,
|
||||||
|
pickuplocation: pickCust.suburb || '',
|
||||||
|
pickuplocationid: pickCust.locationid || 0,
|
||||||
|
pickuplong: pickCust.longitude,
|
||||||
|
processing: '',
|
||||||
|
ready: '',
|
||||||
|
remarks: '',
|
||||||
|
taxamount: 0.0,
|
||||||
|
tenantid: pickCust.tenantid,
|
||||||
|
tenantuserid: 0
|
||||||
|
}));
|
||||||
|
console.log('arr', arr);
|
||||||
|
|
||||||
|
if (!tenId) {
|
||||||
|
opentoast('Choose Client ', 'warning');
|
||||||
|
} else {
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
await axios
|
||||||
|
.post(`${process.env.REACT_APP_URL}/orders/createorders`, arr)
|
||||||
|
.then((res) => {
|
||||||
|
if (res.data.status) {
|
||||||
|
enqueueSnackbar('Order Created Successfully', {
|
||||||
|
variant: 'success',
|
||||||
|
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||||
|
autoHideDuration: 1000
|
||||||
|
});
|
||||||
|
if (admintoken) {
|
||||||
|
// notifyadmin(admintoken);
|
||||||
|
sendnotifications();
|
||||||
|
}
|
||||||
|
navigate('/nearle/orders');
|
||||||
|
} else {
|
||||||
|
opentoast(res.data.message, 'warning');
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
console.log(res);
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
// opentoast(err.data.message, 'warning');
|
||||||
|
setLoading(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
console.log(arr);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{loading && <Loader />}
|
||||||
|
{/* <RidersPinPointOSM /> */}
|
||||||
|
<Grid container sx={{ mb: 2 }}>
|
||||||
|
<Grid item xs={12} sm={3} md={6}>
|
||||||
|
<Stack>
|
||||||
|
<Typography variant="h3" whiteSpace="nowrap">
|
||||||
|
Multiple Orders
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} sm={9} md={6}>
|
||||||
|
<Stack
|
||||||
|
sx={{}}
|
||||||
|
width={'100%'}
|
||||||
|
direction="row"
|
||||||
|
alignItems="center"
|
||||||
|
spacing={2}
|
||||||
|
justifyContent={'flex-end'}
|
||||||
|
flexWrap={{ xs: 'wrap', custom550: 'nowrap' }}
|
||||||
|
gap={2}
|
||||||
|
>
|
||||||
|
{/* Business Location */}
|
||||||
|
<Stack sx={{ width: '100%' }}>
|
||||||
|
{tenantLocations?.length === 1 ? (
|
||||||
|
<TextField
|
||||||
|
label="Business Location"
|
||||||
|
fullWidth
|
||||||
|
focused
|
||||||
|
value={tenantLocations[0]?.locationname}
|
||||||
|
InputProps={{
|
||||||
|
style: { color: theme.palette.primary.main },
|
||||||
|
startAdornment: (
|
||||||
|
<InputAdornment position="start">
|
||||||
|
<MyLocationIcon color="primary" />
|
||||||
|
</InputAdornment>
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Autocomplete
|
||||||
|
fullWidth
|
||||||
|
options={tenantLocations || []}
|
||||||
|
getOptionLabel={(option) => `${option.locationname} (${option.suburb})`}
|
||||||
|
onChange={(event, value, reason) => {
|
||||||
|
if (value) {
|
||||||
|
setTid(value.tenantid);
|
||||||
|
setIsLocation(true);
|
||||||
|
setPickCust(value);
|
||||||
|
}
|
||||||
|
if (reason === 'clear') setIsLocation(false);
|
||||||
|
}}
|
||||||
|
renderInput={(params) => <TextField {...params} label="Select Business Location" color="primary" fullWidth />}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
{/* Date Picker */}
|
||||||
|
<Stack sx={{ display: 'flex', justifyContent: 'flex-end' }}>
|
||||||
|
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
||||||
|
<DatePicker
|
||||||
|
format="DD-MM-YYYY"
|
||||||
|
disablePast
|
||||||
|
value={dayjs(startdate)}
|
||||||
|
sx={{ width: 150 }}
|
||||||
|
onChange={(e) => {
|
||||||
|
let diff = dayjs().diff(dayjs(dayjs(e).format('YYYY-MM-DD')), 'd');
|
||||||
|
|
||||||
|
if (diff <= 0) {
|
||||||
|
setStartdate(e);
|
||||||
|
|
||||||
|
let arr = [];
|
||||||
|
timeslotarr.forEach((val) => {
|
||||||
|
if (dayjs().diff(dayjs(`${dayjs(e).format('MM-DD-YYYY')} ${dayjs(val).format('HH:mm:ss')}`), 'm') <= 0) {
|
||||||
|
arr.push(val);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (arr[0]) {
|
||||||
|
setOrderarr([
|
||||||
|
{
|
||||||
|
sno: 1,
|
||||||
|
address: '',
|
||||||
|
customerid: '',
|
||||||
|
deliverytime: dayjs(arr[0]),
|
||||||
|
deliverylocationid: '',
|
||||||
|
clientname: '',
|
||||||
|
contactno: '',
|
||||||
|
latitude: '',
|
||||||
|
longitude: ''
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
setOrderarr([]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
opentoast('choose Upcoming Date', 'warning');
|
||||||
|
setStartdate(NaN);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</LocalizationProvider>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
{/* ===================================================== || Pickup || ===================================================== */}
|
||||||
|
{pickCust && (
|
||||||
|
<TableContainer component={Paper} sx={{ mb: 2 }}>
|
||||||
|
<Table sx={{ minWidth: 650 }} aria-label="simple table">
|
||||||
|
<TableHead>
|
||||||
|
<TableRow>
|
||||||
|
<TableCell>Pickup Location</TableCell>
|
||||||
|
<TableCell>Address</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableHead>
|
||||||
|
<TableBody>
|
||||||
|
<TableRow>
|
||||||
|
<TableCell>{pickCust?.locationname}</TableCell>
|
||||||
|
<TableCell>{pickCust?.address}</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
</TableContainer>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* ===================================================== || Drop || ===================================================== */}
|
||||||
|
|
||||||
|
<MainCard
|
||||||
|
sx={{ height: '100%' }}
|
||||||
|
title={`Drop (${dropCust?.length || 0})`}
|
||||||
|
secondary={
|
||||||
|
<Button
|
||||||
|
variant="outlined"
|
||||||
|
size="small"
|
||||||
|
sx={{
|
||||||
|
'&:hover': {
|
||||||
|
bgcolor: theme.palette.primary.main,
|
||||||
|
color: 'white'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onClick={() => {
|
||||||
|
if (!isLocation) {
|
||||||
|
opentoast('Select Business Location', 'warning');
|
||||||
|
} else {
|
||||||
|
setIsCustomerOpen(true);
|
||||||
|
setSearchCustList('');
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Select Customers
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<TableContainer component={Paper}>
|
||||||
|
<Table sx={{ minWidth: 650 }} aria-label="simple table">
|
||||||
|
<TableHead>
|
||||||
|
<TableRow>
|
||||||
|
<TableCell>S.No</TableCell>
|
||||||
|
<TableCell>Customer</TableCell>
|
||||||
|
<TableCell>Address</TableCell>
|
||||||
|
<TableCell>Kms</TableCell>
|
||||||
|
<TableCell align="right">Charge</TableCell>
|
||||||
|
<TableCell>Action</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
</TableHead>
|
||||||
|
<TableBody>
|
||||||
|
{!dropCust && (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={6}>
|
||||||
|
<Empty description={' Drop Customers Not Selected'} />
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
{dropCust?.map((customer, index) => (
|
||||||
|
<TableRow key={index}>
|
||||||
|
<TableCell>{index + 1}</TableCell>
|
||||||
|
<TableCell>{customer.firstname}</TableCell>
|
||||||
|
<TableCell>{customer.address}</TableCell>
|
||||||
|
<TableCell>{customer.distance}</TableCell>
|
||||||
|
<TableCell align="right">{`₹${customer.totalcharge}.00`}</TableCell>
|
||||||
|
<TableCell align="center">
|
||||||
|
{
|
||||||
|
<CloseOutlined
|
||||||
|
style={{ cursor: 'pointer', color: 'red' }}
|
||||||
|
onClick={(event) => handleCheckboxChange(event, customer)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
{dropCust?.length != 0 && (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell>
|
||||||
|
<Typography variant="h5">Total</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell></TableCell>
|
||||||
|
<TableCell></TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<Typography variant="h5">{`${totaldist} `}</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="right">
|
||||||
|
<Typography variant="h5"> {`₹${totalAmt}.00`}</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell></TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
</TableContainer>
|
||||||
|
</MainCard>
|
||||||
|
|
||||||
|
{/* ================================================= || Riders Map || ================================================= */}
|
||||||
|
|
||||||
|
{/* {showMap && dropCust.length >= 1 && <RidersPinPoint pickCust={pickCust} dropCust={dropCust} />} */}
|
||||||
|
|
||||||
|
{/* ================================================= || Notes || ================================================= */}
|
||||||
|
{dropCust && (
|
||||||
|
<MainCard sx={{ mt: 2 }} title={'Notes'}>
|
||||||
|
<Grid container>
|
||||||
|
<Grid item xs={12}>
|
||||||
|
<TextField
|
||||||
|
focused
|
||||||
|
id="outlined-multiline-static"
|
||||||
|
sx={{ width: '100%', height: '100%', mb: 2 }}
|
||||||
|
multiline
|
||||||
|
rows={1}
|
||||||
|
placeholder="Notes"
|
||||||
|
value={otherinstructions}
|
||||||
|
onChange={(e) => setOtherinstructions(e.target.value)}
|
||||||
|
/>
|
||||||
|
</Grid>
|
||||||
|
<Stack direction="row" justifyContent={'end'} sx={{ mt: 2, width: '100%' }}>
|
||||||
|
<Button
|
||||||
|
disabled={dropCust?.length == 0}
|
||||||
|
size="medium"
|
||||||
|
variant="outlined"
|
||||||
|
onClick={() => {
|
||||||
|
setLoading(true);
|
||||||
|
setBtnLoading(true);
|
||||||
|
creategrouporders();
|
||||||
|
setTimeout(() => {
|
||||||
|
setLoading(false);
|
||||||
|
setBtnLoading(false);
|
||||||
|
}, 2000);
|
||||||
|
}}
|
||||||
|
sx={{
|
||||||
|
'&:hover': {
|
||||||
|
transform: 'scale(1.05)',
|
||||||
|
transition: 'transform 0.3s ease'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{btnLoading ? <CircularProgress color="primary" size={20} thickness={10} /> : 'Create'}
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
</Grid>
|
||||||
|
</MainCard>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* ============================================= || saved address Dialog || ============================================= */}
|
||||||
|
<Dialog
|
||||||
|
open={isCustomerOpen}
|
||||||
|
onClose={() => {
|
||||||
|
setIsCustomerOpen(false);
|
||||||
|
}}
|
||||||
|
fullWidth
|
||||||
|
sx={{ minWidth: 'lg' }}
|
||||||
|
>
|
||||||
|
{isLoading && <CircularLoader />}
|
||||||
|
<DialogTitle sx={{ bgcolor: theme.palette.primary.main, color: 'white' }}>
|
||||||
|
<Stack>
|
||||||
|
<Typography variant="h4"> {`Select Drop Customers (${dropCust?.length || 0})`}</Typography>
|
||||||
|
<FormControl
|
||||||
|
sx={{
|
||||||
|
width: '100%',
|
||||||
|
mt: 1
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Stack spacing={2} sx={{ py: 0.2 }}>
|
||||||
|
<OutlinedInput
|
||||||
|
fullWidth
|
||||||
|
id="input-search-header"
|
||||||
|
placeholder="Search"
|
||||||
|
value={searchCustList}
|
||||||
|
onChange={(e) => setSearchCustList(e.target.value)}
|
||||||
|
sx={{
|
||||||
|
'& .MuiOutlinedInput-input': {
|
||||||
|
p: '10.5px 0px 12px'
|
||||||
|
},
|
||||||
|
bgcolor: 'white'
|
||||||
|
}}
|
||||||
|
startAdornment={
|
||||||
|
<InputAdornment position="start">
|
||||||
|
<SearchOutlined style={{ fontSize: 'small' }} />
|
||||||
|
</InputAdornment>
|
||||||
|
}
|
||||||
|
endAdornment={
|
||||||
|
<IconButton
|
||||||
|
sx={{ visibility: searchCustList ? 'visible' : 'hidden' }}
|
||||||
|
onClick={() => {
|
||||||
|
setSearchCustList('');
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ClearIcon />
|
||||||
|
</IconButton>
|
||||||
|
}
|
||||||
|
autoComplete="off"
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</FormControl>
|
||||||
|
</Stack>
|
||||||
|
</DialogTitle>
|
||||||
|
<Divider />
|
||||||
|
<DialogContent sx={{ p: 2.5 }}>
|
||||||
|
{customerlist.length == 0 ? (
|
||||||
|
<Stack spacing={2} direction={'row'} alignItems={'center'} justifyContent={'center'} sx={{ minHeight: 600, maxHeight: 600 }}>
|
||||||
|
<Empty />
|
||||||
|
</Stack>
|
||||||
|
) : (
|
||||||
|
<Stack spacing={2} sx={{ minHeight: 600, maxHeight: 600 }}>
|
||||||
|
{customerlist &&
|
||||||
|
customerlist.map((customer, index) => (
|
||||||
|
<FormGroup key={index}>
|
||||||
|
<FormControlLabel
|
||||||
|
control={
|
||||||
|
<Checkbox
|
||||||
|
checked={dropCust?.some((cust) => cust.customerid === customer.customerid)} // Set the checked state of the checkbox based on whether the customer is in `dropCust`
|
||||||
|
onChange={(event) => handleCheckboxChange(event, customer)}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
label={
|
||||||
|
<div style={{ width: '100%' }}>
|
||||||
|
<Typography variant="subtitle1" sx={{ textAlign: 'left' }}>
|
||||||
|
{`${customer.firstname} (${customer.contactno})`}
|
||||||
|
</Typography>
|
||||||
|
|
||||||
|
<Typography variant="body2" color="secondary" sx={{ textAlign: 'left' }}>
|
||||||
|
{customer.address}
|
||||||
|
</Typography>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</FormGroup>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
|
</DialogContent>
|
||||||
|
<Divider />
|
||||||
|
<DialogActions sx={{ p: 2.5 }}>
|
||||||
|
<Button
|
||||||
|
color={dropCust?.length !== 0 ? 'primary' : 'error'}
|
||||||
|
variant="outlined"
|
||||||
|
sx={{
|
||||||
|
'&:hover': {
|
||||||
|
bgcolor: dropCust?.length !== 0 ? theme.palette.primary.main : theme.palette.error.main,
|
||||||
|
color: 'white'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onClick={() => {
|
||||||
|
setIsCustomerOpen(false);
|
||||||
|
{
|
||||||
|
dropCust?.length !== 0 && setShowMap(true);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{dropCust?.length !== 0 ? 'Continue' : 'Close'}
|
||||||
|
</Button>
|
||||||
|
</DialogActions>
|
||||||
|
</Dialog>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MultipleOrders;
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -89,6 +89,9 @@ const Orders = () => {
|
|||||||
|
|
||||||
const [searchword, setSearchword] = useState('');
|
const [searchword, setSearchword] = useState('');
|
||||||
const [debouncedSearch, setDebouncedSearch] = useState('');
|
const [debouncedSearch, setDebouncedSearch] = useState('');
|
||||||
|
const getValueColor = (value) => {
|
||||||
|
return value !== 0 ? 'red' : 'inherit';
|
||||||
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handler = setTimeout(() => {
|
const handler = setTimeout(() => {
|
||||||
@@ -162,7 +165,7 @@ const Orders = () => {
|
|||||||
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
anchorOrigin: { vertical: 'top', horizontal: 'right' },
|
||||||
autoHideDuration: 2000
|
autoHideDuration: 2000
|
||||||
});
|
});
|
||||||
getOrders();
|
refetchOrders();
|
||||||
fetchorderscount();
|
fetchorderscount();
|
||||||
setCancelOpen(false);
|
setCancelOpen(false);
|
||||||
}
|
}
|
||||||
@@ -215,7 +218,8 @@ const Orders = () => {
|
|||||||
fetchNextPage,
|
fetchNextPage,
|
||||||
isLoading: isLoadingGeyOrders,
|
isLoading: isLoadingGeyOrders,
|
||||||
hasNextPage,
|
hasNextPage,
|
||||||
isFetchingNextPage
|
isFetchingNextPage,
|
||||||
|
refetch: refetchOrders
|
||||||
// status: rowdataStatus
|
// status: rowdataStatus
|
||||||
} = useInfiniteQuery({
|
} = useInfiniteQuery({
|
||||||
queryKey: [tabstatus, startdate, enddate, page, rowsPerPage, debouncedSearch, locationId],
|
queryKey: [tabstatus, startdate, enddate, page, rowsPerPage, debouncedSearch, locationId],
|
||||||
@@ -528,7 +532,7 @@ const Orders = () => {
|
|||||||
sx={{ visibility: searchword ? 'visible' : 'hidden' }}
|
sx={{ visibility: searchword ? 'visible' : 'hidden' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setSearchword('');
|
setSearchword('');
|
||||||
getOrders();
|
refetchOrders();
|
||||||
fetchorderscount();
|
fetchorderscount();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -574,9 +578,16 @@ const Orders = () => {
|
|||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow sx={{}}>
|
<TableRow sx={{}}>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> S.No</TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> S.No</TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Orders</TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}>
|
||||||
|
{' '}
|
||||||
|
Orders Location
|
||||||
|
</TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Pickup</TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Pickup</TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Drop </TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Drop </TableCell>
|
||||||
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Qty </TableCell>
|
||||||
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Cod </TableCell>
|
||||||
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> kms </TableCell>
|
||||||
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Charges </TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Notes</TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Notes</TableCell>
|
||||||
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Status </TableCell>
|
<TableCell sx={{ position: 'sticky !important', backgroundColor: theme.palette.secondary.light }}> Status </TableCell>
|
||||||
{currentStatus == 'created' && (
|
{currentStatus == 'created' && (
|
||||||
@@ -623,9 +634,9 @@ const Orders = () => {
|
|||||||
<TableBody>
|
<TableBody>
|
||||||
{rows?.length == 0 && (
|
{rows?.length == 0 && (
|
||||||
<>
|
<>
|
||||||
<TableCell colSpan={7}>
|
<TableCell colSpan={tabstatus === 'Created' ? 11 : 10}>
|
||||||
<Stack width={'100%'} direction={'row'} justifyContent={'center'}>
|
<Stack width={'100%'} direction={'row'} justifyContent={'center'}>
|
||||||
<Empty />
|
<Empty description={' Orders not found in this status'} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</>
|
</>
|
||||||
@@ -645,72 +656,99 @@ const Orders = () => {
|
|||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
|
<Typography variant="subtitle1" noWrap>
|
||||||
|
{row.locationname} {row.locationsuburb && `- ${row.locationsuburb}`}
|
||||||
|
</Typography>
|
||||||
<Typography variant="body2" noWrap>
|
<Typography variant="body2" noWrap>
|
||||||
{row.orderid}
|
{row.orderid}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography noWrap sx={{ fontSize: '11px' }}>
|
<Stack direction={'row'} spacing={1} alignItems="center">
|
||||||
{dayjs(row.deliverydate).utc().format('DD/MM/YYYY')}
|
<Typography noWrap sx={{ fontSize: '11px' }}>
|
||||||
</Typography>
|
{dayjs(row.pickupslot).format('DD/MM/YYYY')}
|
||||||
<Typography noWrap sx={{ fontSize: '11px' }} variant="h5">
|
</Typography>
|
||||||
{dayjs(row.deliverydate).utc().format('hh:mm A')}
|
<Tooltip title={'Pickup Slot'}>
|
||||||
</Typography>
|
<Typography noWrap sx={{ fontSize: '11px' }} variant="h5">
|
||||||
|
{dayjs(row.pickupslot).format('hh:mm A')}
|
||||||
|
</Typography>
|
||||||
|
</Tooltip>
|
||||||
|
</Stack>{' '}
|
||||||
|
{/* <Stack direction={'row'} spacing={1} alignItems="center">
|
||||||
|
<Stack>
|
||||||
|
<Typography noWrap sx={{ fontSize: '11px' }}>
|
||||||
|
{dayjs(row.orderdate).utc().format('DD/MM/YYYY')}
|
||||||
|
</Typography>
|
||||||
|
<Typography noWrap sx={{ fontSize: '11px' }} variant="h5">
|
||||||
|
{dayjs(row.orderdate).utc().format('hh:mm A')}
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
-
|
||||||
|
<Stack>
|
||||||
|
<Typography noWrap sx={{ fontSize: '11px' }}>
|
||||||
|
{dayjs(row.deliverydate).utc().format('DD/MM/YYYY')}
|
||||||
|
</Typography>
|
||||||
|
<Typography noWrap sx={{ fontSize: '11px' }} variant="h5">
|
||||||
|
{dayjs(row.deliverydate).utc().format('hh:mm A')}
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
</Stack> */}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Stack direction={'row'} spacing={1}>
|
<Stack direction={'row'} spacing={1}>
|
||||||
<Avatar
|
|
||||||
alt=""
|
|
||||||
size="sm"
|
|
||||||
sx={{
|
|
||||||
width: '25px',
|
|
||||||
height: '25px'
|
|
||||||
}}
|
|
||||||
></Avatar>
|
|
||||||
<Stack direction="column">
|
<Stack direction="column">
|
||||||
<Typography variant="caption">{row.pickupcustomer}</Typography>
|
<Typography variant="subtitle2">{row.pickupcustomer}</Typography>
|
||||||
<Typography variant="caption" color="textSecondary">
|
<Typography variant="caption">{row.pickupcontactno}</Typography>
|
||||||
{row.pickupcontactno}
|
|
||||||
</Typography>
|
|
||||||
<Tooltip title={row.pickupaddress}>
|
<Tooltip title={row.pickupaddress}>
|
||||||
<Typography variant="caption" color="textSecondary">
|
<Typography variant="caption">{row.pickupsuburb || row.pickupaddress.slice(0, 20)}</Typography>
|
||||||
{row.pickupsuburb || row.pickupaddress.slice(0, 20)}
|
|
||||||
</Typography>
|
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Stack direction={'row'} spacing={1}>
|
<Stack direction={'row'} spacing={1}>
|
||||||
<Avatar
|
|
||||||
alt=""
|
|
||||||
size="sm"
|
|
||||||
sx={{
|
|
||||||
width: '25px',
|
|
||||||
height: '25px'
|
|
||||||
}}
|
|
||||||
></Avatar>
|
|
||||||
<Stack direction="column">
|
<Stack direction="column">
|
||||||
<Typography variant="caption">{row.deliverycustomer}</Typography>
|
<Typography variant="subtitle2">{row.deliverycustomer}</Typography>
|
||||||
<Typography variant="caption" color="textSecondary">
|
<Typography variant="caption">{row.deliverycontactno}</Typography>
|
||||||
{row.deliverycontactno}
|
|
||||||
</Typography>
|
|
||||||
<Tooltip title={row.deliveryaddress}>
|
<Tooltip title={row.deliveryaddress}>
|
||||||
<Typography variant="caption" color="textSecondary">
|
<Typography variant="caption">
|
||||||
{/* {row.pickupaddress.slice(0, 20)} */}
|
{row.deliverysuburb ||
|
||||||
{row.deliverysuburb || row.deliveryaddress.slice(0, 20)}
|
(row.deliveryaddress?.length > 20 ? `${row.deliveryaddress.slice(0, 20)}...` : row.deliveryaddress)}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">{row.ordernotes}</TableCell>
|
|
||||||
{/* <TableCell align="left"><Chip label={row.itemcount} color="primary" variant="light" size="small" /></TableCell> */}
|
<TableCell align="left">
|
||||||
|
<Typography variant="subtitle1" sx={{ color: getValueColor(row.quantity), textAlign: 'center' }}>
|
||||||
|
{row.quantity}
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="left">
|
||||||
|
<Typography variant="subtitle1" sx={{ color: getValueColor(row.collectionamt), textAlign: 'center' }}>
|
||||||
|
₹{row.collectionamt.toFixed(2)}
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="left">
|
||||||
|
<Typography variant="subtitle1" sx={{ color: getValueColor(row.kms), textAlign: 'center' }}>
|
||||||
|
{row.kms}
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
|
||||||
|
<TableCell align="left">
|
||||||
|
<Typography variant="subtitle1" sx={{ color: getValueColor(row.deliverycharge), textAlign: 'center' }}>
|
||||||
|
₹{row.deliverycharge.toFixed(2)}
|
||||||
|
</Typography>
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="left">
|
||||||
|
<Typography>{row.ordernotes}</Typography>
|
||||||
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Stack direction="row">
|
<Stack direction="row">
|
||||||
{row.orderstatus === 'pending' && <Chip label="Pending" color="warning" size="small" />}
|
{row.orderstatus === 'pending' && <Chip label="Pending" color="warning" size="small" />}
|
||||||
{row.orderstatus === 'modified' && <Chip label="Confirmed" color="success" size="small" />}
|
{row.orderstatus === 'modified' && <Chip label="Confirmed" color="success" size="small" />}
|
||||||
{row.orderstatus === 'cancelled' && <Chip label="Cancelled" color="error" size="small" />}
|
{row.orderstatus === 'cancelled' && <Chip label="Cancelled" color="error" size="small" />}
|
||||||
{row.orderstatus === 'delivered' && <Chip label="Completed" color="primary" size="small" />}
|
{row.orderstatus === 'delivered' && <Chip label="Delivered" color="success" size="small" />}
|
||||||
{row.orderstatus === 'processing' && <Chip label="Processing" color="primary" size="small" />}
|
{row.orderstatus === 'processing' && <Chip label="Processing" color="primary" size="small" />}
|
||||||
{row.orderstatus === 'ready' && <Chip label="Accepted" color="info" size="small" />}
|
{row.orderstatus === 'ready' && <Chip label="Accepted" color="info" size="small" />}
|
||||||
{row.orderstatus === 'confirmed' && <Chip label="Confirmed" color="success" size="small" />}
|
{row.orderstatus === 'confirmed' && <Chip label="Confirmed" color="success" size="small" />}
|
||||||
@@ -777,6 +815,16 @@ const Orders = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="row" spacing={2} sx={{ width: 1 }}>
|
<Stack direction="row" spacing={2} sx={{ width: 1 }}>
|
||||||
|
<Button
|
||||||
|
fullWidth
|
||||||
|
onClick={() => {
|
||||||
|
setCancelOpen(false);
|
||||||
|
}}
|
||||||
|
color="secondary"
|
||||||
|
variant="outlined"
|
||||||
|
>
|
||||||
|
No
|
||||||
|
</Button>{' '}
|
||||||
<Button
|
<Button
|
||||||
fullWidth
|
fullWidth
|
||||||
color="error"
|
color="error"
|
||||||
@@ -788,16 +836,6 @@ const Orders = () => {
|
|||||||
>
|
>
|
||||||
Yes, Cancel
|
Yes, Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
|
||||||
fullWidth
|
|
||||||
onClick={() => {
|
|
||||||
setCancelOpen(false);
|
|
||||||
}}
|
|
||||||
color="secondary"
|
|
||||||
variant="outlined"
|
|
||||||
>
|
|
||||||
No
|
|
||||||
</Button>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|||||||
76
src/pages/nearle/reports/RiderLocationMap.js
Normal file
76
src/pages/nearle/reports/RiderLocationMap.js
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
import { Button } from '@mui/material';
|
||||||
|
import { LoadScriptNext, GoogleMap, Marker, OverlayView } from '@react-google-maps/api';
|
||||||
|
|
||||||
|
const containerStyle = {
|
||||||
|
width: '100%',
|
||||||
|
height: 'calc(100vh - 150px)'
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function RiderLocationMap({ riderLocations }) {
|
||||||
|
console.log('riderLocations', riderLocations);
|
||||||
|
|
||||||
|
const center = {
|
||||||
|
lat: Number(riderLocations?.[0]?.latitude || 11.0056),
|
||||||
|
lng: Number(riderLocations?.[0]?.longitude || 76.9661)
|
||||||
|
};
|
||||||
|
const GreenIcon = {
|
||||||
|
url: 'https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-green.png',
|
||||||
|
scaledSize: new window.google.maps.Size(25, 41),
|
||||||
|
anchor: new window.google.maps.Point(12, 41)
|
||||||
|
};
|
||||||
|
|
||||||
|
const RedIcon = {
|
||||||
|
url: 'https://cdn.rawgit.com/pointhi/leaflet-color-markers/master/img/marker-icon-2x-red.png',
|
||||||
|
scaledSize: new window.google.maps.Size(25, 41),
|
||||||
|
anchor: new window.google.maps.Point(12, 41)
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<LoadScriptNext googleMapsApiKey={process.env.REACT_APP_GOOGLE_MAPS_API_KEY}>
|
||||||
|
<GoogleMap mapContainerStyle={containerStyle} zoom={12} center={center}>
|
||||||
|
{riderLocations &&
|
||||||
|
riderLocations?.map((r, index) => {
|
||||||
|
const lat = Number(r.latitude);
|
||||||
|
const lng = Number(r.longitude);
|
||||||
|
return (
|
||||||
|
<div key={index}>
|
||||||
|
{/* Marker */}
|
||||||
|
<Marker
|
||||||
|
position={{ lat, lng }}
|
||||||
|
icon={r.status == 'active' ? GreenIcon : RedIcon}
|
||||||
|
label={{
|
||||||
|
fontSize: '14px',
|
||||||
|
fontWeight: 'bold'
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<OverlayView position={{ lat, lng }} mapPaneName={OverlayView.OVERLAY_LAYER}>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
background: 'none',
|
||||||
|
color: 'green',
|
||||||
|
padding: '2px 8px',
|
||||||
|
borderRadius: '4px',
|
||||||
|
fontSize: '12px',
|
||||||
|
fontWeight: 600,
|
||||||
|
whiteSpace: 'nowrap',
|
||||||
|
transform: 'translate(-50%, -140%)',
|
||||||
|
pointerEvents: 'none',
|
||||||
|
ml: 20
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Button variant="contained" color="primary" size="small">
|
||||||
|
{` ${r.username} `}
|
||||||
|
{/* <br /> */}
|
||||||
|
{/* {`${r.contactno || '##### ##### '} `} */}
|
||||||
|
<br />
|
||||||
|
{`(${r.orderid || ''}) `}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</OverlayView>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</GoogleMap>
|
||||||
|
</LoadScriptNext>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -32,7 +32,8 @@ import {
|
|||||||
FormControl,
|
FormControl,
|
||||||
OutlinedInput,
|
OutlinedInput,
|
||||||
InputAdornment,
|
InputAdornment,
|
||||||
Collapse
|
Collapse,
|
||||||
|
Badge
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
import ClearIcon from '@mui/icons-material/Clear';
|
import ClearIcon from '@mui/icons-material/Clear';
|
||||||
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
||||||
@@ -64,6 +65,7 @@ import { useTheme } from '@mui/material/styles';
|
|||||||
import TitleCard from '../titleCard';
|
import TitleCard from '../titleCard';
|
||||||
import { getreportlocationsummary, gettenantlocations } from '../api/api';
|
import { getreportlocationsummary, gettenantlocations } from '../api/api';
|
||||||
import CircularLoader from 'components/nearle_components/CircularLoader';
|
import CircularLoader from 'components/nearle_components/CircularLoader';
|
||||||
|
import { getValueColor } from 'components/nearle_components/getValueColor';
|
||||||
|
|
||||||
function formatNumberToRupees(value) {
|
function formatNumberToRupees(value) {
|
||||||
return new Intl.NumberFormat('en-IN', {
|
return new Intl.NumberFormat('en-IN', {
|
||||||
@@ -104,12 +106,20 @@ export default function OrdersReport() {
|
|||||||
const [totalDeliComplete, setTotalDeliComplete] = useState(0);
|
const [totalDeliComplete, setTotalDeliComplete] = useState(0);
|
||||||
const [totalDeliCancel, setTotalDeliCancel] = useState(0);
|
const [totalDeliCancel, setTotalDeliCancel] = useState(0);
|
||||||
const [searchword, setSearchword] = useState('');
|
const [searchword, setSearchword] = useState('');
|
||||||
|
const [debouncedSearch, setDebouncedSearch] = useState('');
|
||||||
const textFieldRef = useRef(null);
|
const textFieldRef = useRef(null);
|
||||||
const [ridersdata, setRidersdata] = useState(null);
|
const [ridersdata, setRidersdata] = useState(null);
|
||||||
const [selectedLocation, setSelectedLocation] = useState(null);
|
const [selectedLocation, setSelectedLocation] = useState(null);
|
||||||
const [locationId, setLocationId] = useState(0);
|
const [locationId, setLocationId] = useState(0);
|
||||||
const [searchLocation, setSearchLocation] = useState('');
|
const [searchLocation, setSearchLocation] = useState('');
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handler = setTimeout(() => {
|
||||||
|
setDebouncedSearch(searchword);
|
||||||
|
}, 400);
|
||||||
|
|
||||||
|
return () => clearTimeout(handler);
|
||||||
|
}, [searchword]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('openRow', openRow);
|
console.log('openRow', openRow);
|
||||||
}, [openRow]);
|
}, [openRow]);
|
||||||
@@ -154,7 +164,7 @@ export default function OrdersReport() {
|
|||||||
data: rows,
|
data: rows,
|
||||||
error: reportsError
|
error: reportsError
|
||||||
} = useQuery({
|
} = useQuery({
|
||||||
queryKey: [startdate, enddate, locationId],
|
queryKey: [startdate, enddate, locationId, debouncedSearch],
|
||||||
queryFn: getreportlocationsummary
|
queryFn: getreportlocationsummary
|
||||||
});
|
});
|
||||||
// ==============================|| getriderlocationsummary by tenid (orders summary)||============================== //
|
// ==============================|| getriderlocationsummary by tenid (orders summary)||============================== //
|
||||||
@@ -230,7 +240,9 @@ export default function OrdersReport() {
|
|||||||
<Stack>
|
<Stack>
|
||||||
{startdate && enddate && (
|
{startdate && enddate && (
|
||||||
<Stack direction="row" spacing={2} flexWrap={'wrap'} gap={1}>
|
<Stack direction="row" spacing={2} flexWrap={'wrap'} gap={1}>
|
||||||
<Chip label={`Orders-${datestatus}`} color="primary" variant="light" size="small" />
|
<Badge badgeContent={rows?.length || 0} color="primary">
|
||||||
|
<Chip label={`Location-${datestatus}`} color="primary" variant="light" size="small" />
|
||||||
|
</Badge>
|
||||||
<Chip
|
<Chip
|
||||||
label={
|
label={
|
||||||
<Typography noWrap color="secondary">
|
<Typography noWrap color="secondary">
|
||||||
@@ -411,22 +423,40 @@ export default function OrdersReport() {
|
|||||||
{index + 1}
|
{index + 1}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Stack direction="row" sx={{ ml: -2 }}>
|
<Stack sx={{ ml: -2 }}>
|
||||||
{row.locationname}
|
<Typography> {row.locationname}</Typography>
|
||||||
|
<Typography variant="body2">Id : {row.locationid}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="center">{row.totalorders}</TableCell>
|
<TableCell align="center" sx={{ color: getValueColor(row.totalorders) }}>
|
||||||
<TableCell align="center">{row.Orderspending}</TableCell>
|
{row.totalorders}
|
||||||
<TableCell align="center">{row.orderscompleted}</TableCell>
|
</TableCell>
|
||||||
<TableCell align="center">{row.orderscancelled}</TableCell>
|
<TableCell align="center" sx={{ color: getValueColor(row.Orderspending) }}>
|
||||||
<TableCell align="center"> {row.deliveriespending}</TableCell>
|
{row.Orderspending}
|
||||||
<TableCell align="center"> {row.deliveriescompleted}</TableCell>
|
</TableCell>
|
||||||
<TableCell align="center"> {row.deliveriescancelled}</TableCell>
|
<TableCell align="center" sx={{ color: getValueColor(row.orderscompleted) }}>
|
||||||
|
{row.orderscompleted}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(row.orderscancelled) }}>
|
||||||
|
{row.orderscancelled}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(row.deliveriespending) }}>
|
||||||
|
{' '}
|
||||||
|
{row.deliveriespending}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(row.deliveriescompleted) }}>
|
||||||
|
{' '}
|
||||||
|
{row.deliveriescompleted}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(row.deliveriescancelled) }}>
|
||||||
|
{' '}
|
||||||
|
{row.deliveriescancelled}
|
||||||
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Tooltip title="kms" placement="top">
|
<Tooltip title="Cumulative Kms" placement="top">
|
||||||
<Chip
|
<Chip
|
||||||
size="small"
|
size="small"
|
||||||
label={parseFloat(row.kms).toFixed(2)}
|
label={parseFloat(row.cumulativekms).toFixed(2)}
|
||||||
sx={{
|
sx={{
|
||||||
color: '#f44336',
|
color: '#f44336',
|
||||||
bgcolor: '#ffcdd2',
|
bgcolor: '#ffcdd2',
|
||||||
@@ -596,19 +626,35 @@ export default function OrdersReport() {
|
|||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="center">{rider?.totalorders}</TableCell>
|
<TableCell align="center" sx={{ color: getValueColor(rider.totalorders) }}>
|
||||||
<TableCell align="center">{rider?.pending}</TableCell>
|
{rider?.totalorders}
|
||||||
<TableCell align="center">{rider?.assigned}</TableCell>
|
</TableCell>
|
||||||
<TableCell align="center">{rider?.accepted}</TableCell>
|
<TableCell align="center" sx={{ color: getValueColor(rider.pending) }}>
|
||||||
<TableCell align="center">{rider?.picked}</TableCell>
|
{rider?.pending}
|
||||||
<TableCell align="center">{rider?.arrived}</TableCell>
|
</TableCell>
|
||||||
<TableCell align="center">{rider?.skipped}</TableCell>
|
<TableCell align="center" sx={{ color: getValueColor(rider.assigned) }}>
|
||||||
<TableCell align="center">{rider?.delivered}</TableCell>
|
{rider?.assigned}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(rider.accepted) }}>
|
||||||
|
{rider?.accepted}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(rider.picked) }}>
|
||||||
|
{rider?.picked}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(rider.arrived) }}>
|
||||||
|
{rider?.arrived}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(rider.skipped) }}>
|
||||||
|
{rider?.skipped}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(rider.delivered) }}>
|
||||||
|
{rider?.delivered}
|
||||||
|
</TableCell>
|
||||||
<TableCell align="center">
|
<TableCell align="center">
|
||||||
{/* <Tooltip title="kms" placement="top"> */}
|
{/* <Tooltip title="kms" placement="top"> */}
|
||||||
<Chip
|
<Chip
|
||||||
size="small"
|
size="small"
|
||||||
label={rider?.kms}
|
label={rider?.cumulativekms}
|
||||||
sx={{
|
sx={{
|
||||||
color: '#1976d2',
|
color: '#1976d2',
|
||||||
bgcolor: '#e3f2fd',
|
bgcolor: '#e3f2fd',
|
||||||
|
|||||||
@@ -1,209 +1,322 @@
|
|||||||
import * as React from 'react';
|
import React, { useState, useEffect, Fragment } from 'react';
|
||||||
import { useState } from 'react';
|
|
||||||
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
|
|
||||||
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
||||||
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
// material-ui
|
|
||||||
import {
|
import {
|
||||||
|
Box,
|
||||||
|
Drawer,
|
||||||
|
IconButton,
|
||||||
|
Toolbar,
|
||||||
|
Typography,
|
||||||
|
AppBar,
|
||||||
|
useMediaQuery,
|
||||||
Divider,
|
Divider,
|
||||||
Table,
|
List,
|
||||||
TableBody,
|
ListItem,
|
||||||
TableCell,
|
ListItemText,
|
||||||
TableContainer,
|
useTheme,
|
||||||
TableHead,
|
ListItemAvatar,
|
||||||
TableRow,
|
Stack,
|
||||||
FormControl,
|
Button,
|
||||||
OutlinedInput,
|
Checkbox,
|
||||||
InputAdornment,
|
Skeleton,
|
||||||
Chip,
|
Backdrop,
|
||||||
Stack
|
Chip
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
|
|
||||||
import dayjs from 'dayjs';
|
import MenuIcon from '@mui/icons-material/Menu';
|
||||||
var utc = require('dayjs/plugin/utc');
|
import SearchBar from 'components/nearle_components/SearchBar';
|
||||||
dayjs.extend(utc);
|
import { useQuery } from '@tanstack/react-query';
|
||||||
import { SearchOutlined, CloseOutlined } from '@ant-design/icons';
|
|
||||||
import Loader from 'components/Loader';
|
import Loader from 'components/Loader';
|
||||||
// project imports
|
|
||||||
|
import RiderLocationMap from './RiderLocationMap';
|
||||||
import MainCard from 'components/MainCard';
|
import MainCard from 'components/MainCard';
|
||||||
import { Empty } from 'antd';
|
import dayjs from 'dayjs';
|
||||||
import TitleCard from '../titleCard';
|
import TaskAltIcon from '@mui/icons-material/TaskAlt';
|
||||||
import { fetchAppLocations, fetchRidersLogs } from '../api/api';
|
|
||||||
|
|
||||||
function formatDate(dateString) {
|
import error500 from 'assets/images/maintenance/Error500.png';
|
||||||
const date = dayjs(dateString);
|
import { fetchRidersLogs } from '../api/api';
|
||||||
const formattedDate = date.format('DD-MM-YYYY ');
|
import CircularLoader from 'components/nearle_components/CircularLoader';
|
||||||
return formattedDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
const formatTime = (timeString) =>
|
const drawerWidth = 350;
|
||||||
new Date('2024-01-01T' + timeString + 'Z').toLocaleTimeString('en-US', {
|
|
||||||
timeZone: 'UTC',
|
|
||||||
hour12: true,
|
|
||||||
hour: '2-digit',
|
|
||||||
minute: '2-digit'
|
|
||||||
});
|
|
||||||
|
|
||||||
// ==============================|| RidersLogs ||============================== //
|
const RidersLogs = () => {
|
||||||
|
const theme = useTheme();
|
||||||
export default function RidersLogs() {
|
const isDesktop = useMediaQuery('(min-width:900px)');
|
||||||
const tenantid = localStorage.getItem('tenantid');
|
const [open, setOpen] = useState(false);
|
||||||
const [rowsPerPage, setRowsPerPage] = useState(10);
|
const [selectedRiders, setSelectedRiders] = useState([]);
|
||||||
const [startdate, setStartdate] = useState(dayjs().format('YYYY-MM-DD'));
|
const [riderSearch, setRiderSearch] = useState('');
|
||||||
const [searchword, setSearchword] = useState('');
|
const appId = 1;
|
||||||
const [showClose, SetShowClose] = useState(false);
|
|
||||||
|
|
||||||
/* ============================================= || fetchRidersLogs| ============================================= */
|
|
||||||
const {
|
const {
|
||||||
data: rows = [], // Default to empty array
|
data: riders,
|
||||||
isLoading: IsRiderLogsLoading,
|
isLoading: ridersIsLoading,
|
||||||
isError: IsRiderLogsError,
|
isFetching: riderIsFetching,
|
||||||
error: RiderLogsError
|
refetch: riderLogsRefetch,
|
||||||
|
error: riderLogsError
|
||||||
} = useQuery({
|
} = useQuery({
|
||||||
queryKey: [tenantid, startdate], // Meaningful query key
|
queryKey: [appId, dayjs().format('YYYY-MM-DD'), riderSearch],
|
||||||
queryFn: fetchRidersLogs,
|
queryFn: fetchRidersLogs,
|
||||||
enabled: !!tenantid && !!startdate, // Fetch only if appId & startdate exist
|
refetchInterval: 5 * 60 * 1000
|
||||||
refetchInterval: 300000 // Auto-fetch every 5 minutes
|
|
||||||
});
|
});
|
||||||
|
|
||||||
React.useEffect(() => {
|
useEffect(() => {
|
||||||
setRowsPerPage(rows?.length + 1);
|
console.log('riders', riders);
|
||||||
}, [rows]);
|
// const sortedRiders = riders?.sort((a, b) => a.firstname.localeCompare(b.firstname));
|
||||||
{
|
setSelectedRiders(riders);
|
||||||
IsRiderLogsError && console.log('RiderLogsError', RiderLogsError);
|
}, [riders]);
|
||||||
}
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('selectedRiders', selectedRiders);
|
||||||
|
}, [selectedRiders]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setOpen(isDesktop);
|
||||||
|
}, [isDesktop]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Fragment>
|
||||||
{IsRiderLogsLoading && <Loader />}
|
{
|
||||||
<TitleCard title="Riders Logs" />
|
<Backdrop
|
||||||
<MainCard
|
sx={{
|
||||||
content={false}
|
color: '#fff',
|
||||||
title={
|
zIndex: (theme) => theme.zIndex.drawer + 1
|
||||||
<Stack display={'flex'} flexDirection={'row'} alignItems={'center'} justifyContent={'space-between'} flexWrap={'wrap'} gap={1}>
|
}}
|
||||||
<Stack>
|
open={ridersIsLoading || riderIsFetching} // when loader = true, backdrop covers the page
|
||||||
<FormControl sx={{ width: 250 }}>
|
>
|
||||||
<OutlinedInput
|
<CircularLoader color="inherit" />
|
||||||
sx={{ background: 'white' }}
|
</Backdrop>
|
||||||
size="medium"
|
}
|
||||||
id="header-search"
|
<MainCard content={false}>
|
||||||
startAdornment={
|
<Box sx={{ display: 'flex', width: '100%', height: '100%', position: 'relative' }}>
|
||||||
<InputAdornment position="start" sx={{ mr: -0.5 }}>
|
{/* Drawer */}
|
||||||
<SearchOutlined />
|
<Drawer
|
||||||
</InputAdornment>
|
variant={isDesktop ? 'persistent' : 'temporary'}
|
||||||
|
open={open}
|
||||||
|
onClose={() => !isDesktop && setOpen(false)}
|
||||||
|
ModalProps={{ keepMounted: true }}
|
||||||
|
sx={{
|
||||||
|
'& .MuiDrawer-paper': {
|
||||||
|
width: drawerWidth,
|
||||||
|
position: 'absolute',
|
||||||
|
left: 0,
|
||||||
|
top: 0,
|
||||||
|
height: '100%',
|
||||||
|
overflowY: 'auto',
|
||||||
|
transition: 'transform 0.35s ease-in-out',
|
||||||
|
zIndex: 13
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{/* Search */}
|
||||||
|
<Box sx={{ position: 'sticky', top: 0, zIndex: 1 }}>
|
||||||
|
<SearchBar
|
||||||
|
value={riderSearch}
|
||||||
|
placeholder="Search Rider"
|
||||||
|
onChange={(e) => setRiderSearch(e.target.value)}
|
||||||
|
sx={{
|
||||||
|
height: 60,
|
||||||
|
bgcolor: 'white',
|
||||||
|
'& .MuiOutlinedInput-notchedOutline': {
|
||||||
|
borderBottom: '1px solid',
|
||||||
|
borderColor: theme.palette.secondary.light
|
||||||
}
|
}
|
||||||
endAdornment={
|
}}
|
||||||
showClose && (
|
/>
|
||||||
<InputAdornment position="end" sx={{ mr: -0.5 }}>
|
<List>
|
||||||
<CloseOutlined
|
<ListItem sx={{ cursor: 'pointer', '&:hover': { bgcolor: theme.palette.secondary.lighter }, bgcolor: 'white', mt: -1 }}>
|
||||||
onClick={() => {
|
<ListItemAvatar>
|
||||||
setSearchword('');
|
<Checkbox
|
||||||
SetShowClose(false);
|
checked={riders?.length == selectedRiders?.length}
|
||||||
}}
|
onChange={(e) => {
|
||||||
|
if (e.target.checked) {
|
||||||
|
setSelectedRiders(riders);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</ListItemAvatar>
|
||||||
|
<ListItemText primary="All" />
|
||||||
|
</ListItem>
|
||||||
|
<Divider />
|
||||||
|
</List>
|
||||||
|
</Box>
|
||||||
|
{/* Rider List */}
|
||||||
|
<List>
|
||||||
|
{/* Individuals */}
|
||||||
|
{ridersIsLoading || riderIsFetching
|
||||||
|
? Array.from({ length: 10 }).map((_, index) => (
|
||||||
|
<Fragment key={index}>
|
||||||
|
<ListItem sx={{ py: 1.5, px: 2 }}>
|
||||||
|
<ListItemAvatar>
|
||||||
|
<Skeleton variant="circular" width={24} height={24} />
|
||||||
|
</ListItemAvatar>
|
||||||
|
|
||||||
|
<ListItemText
|
||||||
|
primary={<Skeleton variant="text" width="60%" height={22} />}
|
||||||
|
secondary={<Skeleton variant="text" width="40%" height={18} />}
|
||||||
/>
|
/>
|
||||||
</InputAdornment>
|
|
||||||
)
|
<Stack spacing={0.5} textAlign="right">
|
||||||
}
|
<Skeleton variant="text" width={50} height={18} />
|
||||||
aria-describedby="header-search-text"
|
<Skeleton variant="text" width={80} height={16} />
|
||||||
inputProps={{
|
</Stack>
|
||||||
'aria-label': 'weight'
|
</ListItem>
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
</Fragment>
|
||||||
|
))
|
||||||
|
: riders?.map((row) => {
|
||||||
|
return (
|
||||||
|
<Fragment key={row.userid}>
|
||||||
|
<ListItem
|
||||||
|
sx={{
|
||||||
|
cursor: 'pointer',
|
||||||
|
py: 1,
|
||||||
|
px: 2,
|
||||||
|
borderRadius: 1,
|
||||||
|
'&:hover': { bgcolor: theme.palette.secondary.lighter }
|
||||||
|
}}
|
||||||
|
secondaryAction={
|
||||||
|
<Stack textAlign="right" spacing={0.5}>
|
||||||
|
<Typography variant="body2" noWrap sx={{ color: row.status == 'active' ? 'success.main' : 'error.main' }}>
|
||||||
|
{row.userid}
|
||||||
|
</Typography>
|
||||||
|
<Typography variant="caption" color="text.secondary" noWrap>
|
||||||
|
{dayjs(row.logdate).format('DD/MM/YYYY hh:mm A')}
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<ListItemAvatar>
|
||||||
|
<Checkbox
|
||||||
|
sx={{
|
||||||
|
color: row.status == 'active' ? 'green' : 'red',
|
||||||
|
'&.Mui-checked': {
|
||||||
|
color: row.status == 'active' ? 'green' : 'red'
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
checked={
|
||||||
|
// INDIVIDUAL CHECKED CONDITION
|
||||||
|
selectedRiders?.length === 1 && selectedRiders[0]?.userid === row?.userid
|
||||||
|
}
|
||||||
|
onChange={(e) => {
|
||||||
|
if (e.target.checked) {
|
||||||
|
// SELECT ONE RIDER
|
||||||
|
setSelectedRiders([row]);
|
||||||
|
} else {
|
||||||
|
// UNCHECK -> SELECT ALL
|
||||||
|
setSelectedRiders(riders);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</ListItemAvatar>
|
||||||
|
|
||||||
|
<ListItemText
|
||||||
|
primary={
|
||||||
|
row.username ? (
|
||||||
|
<Typography noWrap>
|
||||||
|
{row.username?.slice(0, 25) || ''}
|
||||||
|
{row.username?.length > 25 && '...'}
|
||||||
|
{/* {row.status === 'active' && <TaskAltIcon fontSize="small" color="success" sx={{ ml: 1 }} />} */}
|
||||||
|
</Typography>
|
||||||
|
) : (
|
||||||
|
<Typography noWrap>
|
||||||
|
{row.firstname || ''}
|
||||||
|
{row.lastname ? ` ${row.lastname}` : ''}
|
||||||
|
</Typography>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
secondary={
|
||||||
|
<Typography variant="caption" color="text.secondary" noWrap>
|
||||||
|
{row.contactno || '##########'}
|
||||||
|
</Typography>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</ListItem>
|
||||||
|
|
||||||
|
<Divider />
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</List>
|
||||||
|
</Drawer>
|
||||||
|
|
||||||
|
{/* AppBar */}
|
||||||
|
<AppBar
|
||||||
|
elevation={0}
|
||||||
|
position="absolute"
|
||||||
|
sx={{
|
||||||
|
top: 0,
|
||||||
|
left: open && isDesktop ? `${drawerWidth}px` : 0,
|
||||||
|
width: open && isDesktop ? `calc(100% - ${drawerWidth}px)` : '100%',
|
||||||
|
transition: 'left 0.3s ease, width 0.3s ease',
|
||||||
|
backgroundColor: 'white',
|
||||||
|
borderBottom: '1px solid',
|
||||||
|
borderColor: theme.palette.secondary.light
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Toolbar>
|
||||||
|
<Stack direction="row" alignItems="center" justifyContent="space-between" sx={{ width: '100%' }}>
|
||||||
|
<Stack direction="row" alignItems="center">
|
||||||
|
<IconButton color="primary" onClick={() => setOpen(!open)}>
|
||||||
|
<MenuIcon />
|
||||||
|
</IconButton>
|
||||||
|
|
||||||
|
<Typography variant="h5" color="primary" sx={{ ml: 2 }}>
|
||||||
|
Riders Locations
|
||||||
|
</Typography>
|
||||||
|
</Stack>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
variant="outlined"
|
||||||
|
color="primary"
|
||||||
|
onClick={() => {
|
||||||
|
riderLogsRefetch();
|
||||||
}}
|
}}
|
||||||
placeholder="Search"
|
>
|
||||||
value={searchword}
|
Refresh
|
||||||
onChange={(e) => {
|
</Button>
|
||||||
setSearchword(e.target.value);
|
</Stack>
|
||||||
if (e.target.value == '') {
|
</Toolbar>
|
||||||
SetShowClose(false);
|
</AppBar>
|
||||||
} else {
|
|
||||||
SetShowClose(true);
|
{/* Map */}
|
||||||
}
|
<Box
|
||||||
}}
|
sx={{
|
||||||
autoComplete="off"
|
flexGrow: 1,
|
||||||
/>
|
overflow: 'auto',
|
||||||
</FormControl>{' '}
|
pt: '64px',
|
||||||
</Stack>
|
pl: open && isDesktop ? `${drawerWidth}px` : 0,
|
||||||
<Stack flexDirection="row" alignItems="center" gap={2}>
|
transition: 'padding-left 0.3s ease',
|
||||||
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
minHeight: '80vh'
|
||||||
<DatePicker
|
}}
|
||||||
label="Choose Date"
|
>
|
||||||
value={dayjs(startdate)}
|
{(ridersIsLoading || riderIsFetching) && (
|
||||||
format="DD-MM-YYYY"
|
<Box position="relative" width="100%" height="80vh" display="grid" placeItems="center">
|
||||||
onChange={(e) => {
|
{/* <CircularLoader /> */}
|
||||||
if (e) {
|
<Skeleton
|
||||||
setStartdate(dayjs(e.$d).format('YYYY-MM-DD'));
|
variant="rectangular"
|
||||||
}
|
width="100%"
|
||||||
|
height="100%"
|
||||||
|
animation="wave"
|
||||||
|
sx={{
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
borderRadius: 1,
|
||||||
|
zIndex: 1
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</LocalizationProvider>
|
</Box>
|
||||||
</Stack>
|
)}
|
||||||
</Stack>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<TableContainer>
|
|
||||||
<Table>
|
|
||||||
<TableHead>
|
|
||||||
<TableRow>
|
|
||||||
<TableCell>S.No</TableCell>
|
|
||||||
<TableCell>ID</TableCell>
|
|
||||||
<TableCell>Rider</TableCell>
|
|
||||||
<TableCell>LogDate</TableCell>
|
|
||||||
<TableCell>Shift(HRS)</TableCell>
|
|
||||||
<TableCell>Login</TableCell>
|
|
||||||
<TableCell>Logout</TableCell>
|
|
||||||
<TableCell>WRK(HRS)</TableCell>
|
|
||||||
<TableCell>Shift(HRS)</TableCell>
|
|
||||||
<TableCell>BRK(HRS)</TableCell>
|
|
||||||
<TableCell>Status</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
</TableHead>
|
|
||||||
<TableBody>
|
|
||||||
{rows.length == 0 ? (
|
|
||||||
<TableRow>
|
|
||||||
<TableCell colSpan={11}>
|
|
||||||
<Empty />
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
) : (
|
|
||||||
rows.map((row, index) => (
|
|
||||||
<TableRow key={index + 1}>
|
|
||||||
<TableCell align="left">{index + 1}</TableCell>
|
|
||||||
<TableCell align="left">{row.userid}</TableCell>
|
|
||||||
<TableCell align="left">{row.username}</TableCell>
|
|
||||||
<TableCell align="left">
|
|
||||||
{' '}
|
|
||||||
<Chip label={formatDate(row.logdate)} color="warning" variant="outlined" size="small" sx={{ bgcolor: '#fffde7' }} />
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell align="left">{row.shifthours}</TableCell>
|
{selectedRiders?.length > 0 && <RiderLocationMap riderLocations={selectedRiders} />}
|
||||||
<TableCell align="left">
|
{riderLogsError && (
|
||||||
{row.login != '' && (
|
<Box sx={{ width: '100% ', height: '100%' }}>
|
||||||
<Chip label={formatTime(row.login)} color="info" variant="outlined" size="small" sx={{ bgcolor: '#e0f7fa' }} />
|
<img src={error500} alt="mantis" style={{ height: '100%', width: '100%' }} />
|
||||||
)}
|
</Box>
|
||||||
</TableCell>
|
)}
|
||||||
<TableCell align="left">
|
</Box>
|
||||||
{row.logout != '' && (
|
</Box>
|
||||||
<Chip label={formatTime(row.logout)} color="info" variant="outlined" size="small" sx={{ bgcolor: '#e0f7fa' }} />
|
|
||||||
)}
|
|
||||||
</TableCell>
|
|
||||||
|
|
||||||
<TableCell align="left">{row.workhours}</TableCell>
|
|
||||||
<TableCell align="left">{row.shorthours}</TableCell>
|
|
||||||
<TableCell align="left">{row.breakhours}</TableCell>
|
|
||||||
<TableCell align="left">
|
|
||||||
{row.logstatus == 0 ? (
|
|
||||||
<Chip label="Active" color="success" variant="outlined" size="small" sx={{ bgcolor: '#e8f5e9' }} />
|
|
||||||
) : (
|
|
||||||
<Chip label="Inactive" color="error" variant="outlined" size="small" sx={{ bgcolor: '#fce4ec' }} />
|
|
||||||
)}
|
|
||||||
</TableCell>
|
|
||||||
</TableRow>
|
|
||||||
))
|
|
||||||
)}
|
|
||||||
</TableBody>
|
|
||||||
</Table>
|
|
||||||
</TableContainer>
|
|
||||||
</MainCard>
|
</MainCard>
|
||||||
</>
|
</Fragment>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export default RidersLogs;
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ import Loader from 'components/Loader';
|
|||||||
import TitleCard from '../titleCard';
|
import TitleCard from '../titleCard';
|
||||||
import { fetchRidersSummary } from '../api/api';
|
import { fetchRidersSummary } from '../api/api';
|
||||||
import { useTheme } from '@mui/material/styles';
|
import { useTheme } from '@mui/material/styles';
|
||||||
|
import { getValueColor } from 'components/nearle_components/getValueColor';
|
||||||
|
|
||||||
// table filter
|
// table filter
|
||||||
function descendingComparator(a, b, orderBy) {
|
function descendingComparator(a, b, orderBy) {
|
||||||
@@ -222,14 +223,15 @@ export default function RidersSummary() {
|
|||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell># </TableCell>
|
<TableCell># </TableCell>
|
||||||
<TableCell> Rider</TableCell>
|
<TableCell> Rider</TableCell>
|
||||||
<TableCell>Total </TableCell>
|
<TableCell>Deliveries </TableCell>
|
||||||
{/* <TableCell> Pending</TableCell>
|
<TableCell> Pending</TableCell>
|
||||||
<TableCell> Assigned</TableCell>
|
<TableCell> Assigned</TableCell>
|
||||||
<TableCell> Accepted</TableCell>
|
<TableCell> Accepted</TableCell>
|
||||||
<TableCell>Arrived </TableCell>
|
<TableCell>Arrived </TableCell>
|
||||||
<TableCell>Picked </TableCell>
|
<TableCell>Picked </TableCell>
|
||||||
<TableCell>Active </TableCell>
|
<TableCell>Active </TableCell>
|
||||||
<TableCell>Skipped </TableCell> */}
|
<TableCell>Skipped </TableCell>
|
||||||
|
<TableCell>Cancelled </TableCell>
|
||||||
<TableCell>Delivered </TableCell>
|
<TableCell>Delivered </TableCell>
|
||||||
<TableCell>kms </TableCell>
|
<TableCell>kms </TableCell>
|
||||||
<TableCell> COD/PLA</TableCell>
|
<TableCell> COD/PLA</TableCell>
|
||||||
@@ -263,40 +265,45 @@ export default function RidersSummary() {
|
|||||||
{index + 1}
|
{index + 1}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Stack direction="row" sx={{ ml: -2 }}>
|
<Stack sx={{ ml: -2, wrap: 'nowrap' }}>
|
||||||
{row.firstname}
|
<Typography>
|
||||||
{row.status == 'Active' ? (
|
{row.firstname} {row.lastname}
|
||||||
<TaskAltIcon fontSize="small" color="success" sx={{ ml: 1 }} />
|
</Typography>
|
||||||
) : (
|
<Typography variant="body2">Id : {row.userid}</Typography>
|
||||||
<HighlightOffIcon fontSize="small" color="error" sx={{ ml: 1 }} />
|
|
||||||
)}
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
<TableCell align="left">{row.totalorders}</TableCell>
|
<TableCell align="center" sx={{ color: getValueColor(row.totalorders) }}>
|
||||||
{/* <TableCell align="left">
|
{row.totalorders}
|
||||||
{row.pending ? <Chip color="primary" variant="light" label={row.pending} /> : row.pending}
|
</TableCell>
|
||||||
</TableCell>
|
<TableCell align="center">
|
||||||
<TableCell align="left">
|
{row.pending ? <Chip color="primary" variant="light" label={row.pending} /> : row.pending}
|
||||||
{row.assigned ? <Chip color="primary" variant="light" label={row.assigned} /> : row.assigned}
|
</TableCell>
|
||||||
</TableCell>
|
<TableCell align="center">
|
||||||
<TableCell align="left">
|
{row.assigned ? <Chip color="primary" variant="light" label={row.assigned} /> : row.assigned}
|
||||||
{row.accepted ? <Chip color="primary" variant="light" label={row.accepted} /> : row.accepted}
|
</TableCell>
|
||||||
</TableCell>
|
<TableCell align="center">
|
||||||
<TableCell align="left">
|
{row.accepted ? <Chip color="primary" variant="light" label={row.accepted} /> : row.accepted}
|
||||||
{row.arrived ? <Chip color="primary" variant="light" label={row.arrived} /> : row.arrived}
|
</TableCell>
|
||||||
</TableCell>
|
<TableCell align="center">
|
||||||
<TableCell align="left">
|
{row.arrived ? <Chip color="primary" variant="light" label={row.arrived} /> : row.arrived}
|
||||||
{row.picked ? <Chip color="primary" variant="light" label={row.picked} /> : row.picked}
|
</TableCell>
|
||||||
</TableCell>
|
<TableCell align="center">
|
||||||
<TableCell align="left">
|
{row.picked ? <Chip color="primary" variant="light" label={row.picked} /> : row.picked}
|
||||||
{row.active ? <Chip color="primary" variant="light" label={row.active} /> : row.active}
|
</TableCell>
|
||||||
</TableCell>
|
<TableCell align="center">
|
||||||
<TableCell align="left">
|
{row.active ? <Chip color="primary" variant="light" label={row.active} /> : row.active}
|
||||||
{row.skipped ? <Chip color="primary" variant="light" label={row.skipped} /> : row.skipped}
|
</TableCell>
|
||||||
</TableCell> */}
|
<TableCell align="center">
|
||||||
|
{row.skipped ? <Chip color="primary" variant="light" label={row.skipped} /> : row.skipped}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center">
|
||||||
|
{row.cancelled ? <Chip color="primary" variant="light" label={row.cancelled} /> : row.cancelled}
|
||||||
|
</TableCell>
|
||||||
|
|
||||||
<TableCell align="left">{row.delivered}</TableCell>
|
<TableCell align="center" sx={{ color: getValueColor(row.totalorders) }}>
|
||||||
|
{row.delivered}
|
||||||
|
</TableCell>
|
||||||
|
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Stack direction={'row'}>
|
<Stack direction={'row'}>
|
||||||
@@ -314,10 +321,10 @@ export default function RidersSummary() {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Tooltip> */}
|
</Tooltip> */}
|
||||||
<Tooltip title="Actual kms" placement="bottom">
|
<Tooltip title="Cumulative Kms" placement="top">
|
||||||
<Chip
|
<Chip
|
||||||
size="small"
|
size="small"
|
||||||
label={row.actualkms}
|
label={row.cumulativekms ? parseFloat(row.cumulativekms).toFixed(2) : 0}
|
||||||
sx={{
|
sx={{
|
||||||
color: '#ff8f00',
|
color: '#ff8f00',
|
||||||
bgcolor: '#ffecb3',
|
bgcolor: '#ffecb3',
|
||||||
@@ -423,10 +430,10 @@ export default function RidersSummary() {
|
|||||||
<TableCell>#</TableCell>
|
<TableCell>#</TableCell>
|
||||||
<TableCell>Location</TableCell>
|
<TableCell>Location</TableCell>
|
||||||
<TableCell align="left">All</TableCell>
|
<TableCell align="left">All</TableCell>
|
||||||
{/* <TableCell align="left">Pending</TableCell> */}
|
<TableCell align="left">Pending</TableCell>
|
||||||
<TableCell align="left">Completed</TableCell>
|
<TableCell align="left">Completed</TableCell>
|
||||||
{/* <TableCell align="left">Cancelled</TableCell> */}
|
<TableCell align="left">Cancelled</TableCell>
|
||||||
<TableCell align="left">Actual Kms</TableCell>
|
<TableCell align="left"> Kms</TableCell>
|
||||||
<TableCell align="left">COD / PLA</TableCell>
|
<TableCell align="left">COD / PLA</TableCell>
|
||||||
<TableCell align="left">Amount</TableCell>
|
<TableCell align="left">Amount</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
@@ -446,14 +453,23 @@ export default function RidersSummary() {
|
|||||||
{index + 1}
|
{index + 1}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
<Stack direction="row" sx={{ ml: -2 }}>
|
<Stack sx={{ ml: -2 }}>
|
||||||
{row.locationname}
|
<Typography> {row.locationname}</Typography>
|
||||||
|
<Typography variant="body2"> Id: {row.locationid}</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell align="left">{row.totalorders}</TableCell>
|
<TableCell align="center" sx={{ color: getValueColor(row.totalorders) }}>
|
||||||
{/* <TableCell align="left">{row.deliveriespending}</TableCell> */}
|
{row.totalorders}
|
||||||
<TableCell align="left">{row.deliveriescompleted}</TableCell>
|
</TableCell>
|
||||||
{/* <TableCell align="left">{row.deliveriescancelled}</TableCell> */}
|
<TableCell align="center" sx={{ color: getValueColor(row.deliveriespending) }}>
|
||||||
|
{row.deliveriespending}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(row.deliveriescompleted) }}>
|
||||||
|
{row.deliveriescompleted}
|
||||||
|
</TableCell>
|
||||||
|
<TableCell align="center" sx={{ color: getValueColor(row.deliveriescancelled) }}>
|
||||||
|
{row.deliveriescancelled}
|
||||||
|
</TableCell>
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
{/* <Chip
|
{/* <Chip
|
||||||
size="small"
|
size="small"
|
||||||
@@ -466,16 +482,18 @@ export default function RidersSummary() {
|
|||||||
minWidth: 80
|
minWidth: 80
|
||||||
}}
|
}}
|
||||||
/> */}
|
/> */}
|
||||||
<Chip
|
<Tooltip title="Cumulative Kms" placement="top">
|
||||||
size="small"
|
<Chip
|
||||||
label={row.actualkms}
|
size="small"
|
||||||
sx={{
|
label={row.cumulativekms ? parseFloat(row.cumulativekms).toFixed(2) : 0}
|
||||||
color: '#ff8f00',
|
sx={{
|
||||||
bgcolor: '#ffecb3',
|
color: '#ff8f00',
|
||||||
border: '1px solid #ff8f00',
|
bgcolor: '#ffecb3',
|
||||||
minWidth: 80
|
border: '1px solid #ff8f00',
|
||||||
}}
|
minWidth: 80
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
</Tooltip>
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
<TableCell align="left">
|
<TableCell align="left">
|
||||||
|
|||||||
63
yarn.lock
63
yarn.lock
@@ -3054,6 +3054,11 @@ adjust-sourcemap-loader@^4.0.0:
|
|||||||
loader-utils "^2.0.0"
|
loader-utils "^2.0.0"
|
||||||
regex-parser "^2.2.11"
|
regex-parser "^2.2.11"
|
||||||
|
|
||||||
|
adler-32@~1.3.0:
|
||||||
|
version "1.3.1"
|
||||||
|
resolved "https://registry.npmjs.org/adler-32/-/adler-32-1.3.1.tgz"
|
||||||
|
integrity sha512-ynZ4w/nUUv5rrsR8UUGoe1VC9hZj6V5hU9Qw1HlMDJGEJw5S7TfTErWTjMys6M7vr0YWcPqs3qAr4ss0nDfP+A==
|
||||||
|
|
||||||
agent-base@6:
|
agent-base@6:
|
||||||
version "6.0.2"
|
version "6.0.2"
|
||||||
resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz"
|
resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz"
|
||||||
@@ -3858,6 +3863,14 @@ case-sensitive-paths-webpack-plugin@^2.4.0:
|
|||||||
resolved "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz"
|
resolved "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz"
|
||||||
integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==
|
integrity sha512-roIFONhcxog0JSSWbvVAh3OocukmSgpqOH6YpMkCvav/ySIV3JKg4Dc8vYtQjYi/UxpNE36r/9v+VqTQqgkYmw==
|
||||||
|
|
||||||
|
cfb@~1.2.1:
|
||||||
|
version "1.2.2"
|
||||||
|
resolved "https://registry.npmjs.org/cfb/-/cfb-1.2.2.tgz"
|
||||||
|
integrity sha512-KfdUZsSOw19/ObEWasvBP/Ac4reZvAGauZhs6S/gqNhXhI7cKwvlH7ulj+dOEYnca4bm4SGo8C1bTAQvnTjgQA==
|
||||||
|
dependencies:
|
||||||
|
adler-32 "~1.3.0"
|
||||||
|
crc-32 "~1.2.0"
|
||||||
|
|
||||||
chalk@^2.0.0, chalk@^2.4.1:
|
chalk@^2.0.0, chalk@^2.4.1:
|
||||||
version "2.4.2"
|
version "2.4.2"
|
||||||
resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz"
|
resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz"
|
||||||
@@ -4007,6 +4020,11 @@ coa@^2.0.2:
|
|||||||
chalk "^2.4.1"
|
chalk "^2.4.1"
|
||||||
q "^1.1.2"
|
q "^1.1.2"
|
||||||
|
|
||||||
|
codepage@~1.15.0:
|
||||||
|
version "1.15.0"
|
||||||
|
resolved "https://registry.npmjs.org/codepage/-/codepage-1.15.0.tgz"
|
||||||
|
integrity sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==
|
||||||
|
|
||||||
collect-v8-coverage@^1.0.0:
|
collect-v8-coverage@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz"
|
resolved "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz"
|
||||||
@@ -4228,6 +4246,11 @@ country-flag-icons@^1.5.4:
|
|||||||
resolved "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.5.10.tgz"
|
resolved "https://registry.npmjs.org/country-flag-icons/-/country-flag-icons-1.5.10.tgz"
|
||||||
integrity sha512-x3elaK+ZY23W1YtFsNQknRdURzkV7g3Z93AoA7SHZJUEXbVjRsNh4h9Uf09+OjWF/4u8tXeAt37gezGRdwR/2g==
|
integrity sha512-x3elaK+ZY23W1YtFsNQknRdURzkV7g3Z93AoA7SHZJUEXbVjRsNh4h9Uf09+OjWF/4u8tXeAt37gezGRdwR/2g==
|
||||||
|
|
||||||
|
crc-32@~1.2.0, crc-32@~1.2.1:
|
||||||
|
version "1.2.2"
|
||||||
|
resolved "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz"
|
||||||
|
integrity sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==
|
||||||
|
|
||||||
create-ecdh@^4.0.0:
|
create-ecdh@^4.0.0:
|
||||||
version "4.0.4"
|
version "4.0.4"
|
||||||
resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz"
|
resolved "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz"
|
||||||
@@ -5709,6 +5732,11 @@ forwarded@0.2.0:
|
|||||||
resolved "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz"
|
resolved "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz"
|
||||||
integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==
|
integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==
|
||||||
|
|
||||||
|
frac@~1.1.2:
|
||||||
|
version "1.1.2"
|
||||||
|
resolved "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz"
|
||||||
|
integrity sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==
|
||||||
|
|
||||||
fraction.js@^4.2.0:
|
fraction.js@^4.2.0:
|
||||||
version "4.2.0"
|
version "4.2.0"
|
||||||
resolved "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz"
|
resolved "https://registry.npmjs.org/fraction.js/-/fraction.js-4.2.0.tgz"
|
||||||
@@ -7922,6 +7950,11 @@ p-try@^2.0.0:
|
|||||||
resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz"
|
resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz"
|
||||||
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
|
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
|
||||||
|
|
||||||
|
papaparse@^5.5.3:
|
||||||
|
version "5.5.3"
|
||||||
|
resolved "https://registry.npmjs.org/papaparse/-/papaparse-5.5.3.tgz"
|
||||||
|
integrity sha512-5QvjGxYVjxO59MGU2lHVYpRWBBtKHnlIAcSe1uNFCkkptUh63NFRj0FJQm7nR67puEruUci/ZkjmEFrjCAyP4A==
|
||||||
|
|
||||||
param-case@^3.0.4:
|
param-case@^3.0.4:
|
||||||
version "3.0.4"
|
version "3.0.4"
|
||||||
resolved "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz"
|
resolved "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz"
|
||||||
@@ -10161,6 +10194,13 @@ sprintf-js@~1.0.2:
|
|||||||
resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
|
resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
|
||||||
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
||||||
|
|
||||||
|
ssf@~0.11.2:
|
||||||
|
version "0.11.2"
|
||||||
|
resolved "https://registry.npmjs.org/ssf/-/ssf-0.11.2.tgz"
|
||||||
|
integrity sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==
|
||||||
|
dependencies:
|
||||||
|
frac "~1.1.2"
|
||||||
|
|
||||||
stable@^0.1.8:
|
stable@^0.1.8:
|
||||||
version "0.1.8"
|
version "0.1.8"
|
||||||
resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz"
|
resolved "https://registry.npmjs.org/stable/-/stable-0.1.8.tgz"
|
||||||
@@ -11144,11 +11184,21 @@ which@^2.0.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
isexe "^2.0.0"
|
isexe "^2.0.0"
|
||||||
|
|
||||||
|
wmf@~1.0.1:
|
||||||
|
version "1.0.2"
|
||||||
|
resolved "https://registry.npmjs.org/wmf/-/wmf-1.0.2.tgz"
|
||||||
|
integrity sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==
|
||||||
|
|
||||||
word-wrap@^1.2.3, word-wrap@~1.2.3:
|
word-wrap@^1.2.3, word-wrap@~1.2.3:
|
||||||
version "1.2.3"
|
version "1.2.3"
|
||||||
resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz"
|
resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz"
|
||||||
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
|
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==
|
||||||
|
|
||||||
|
word@~0.3.0:
|
||||||
|
version "0.3.0"
|
||||||
|
resolved "https://registry.npmjs.org/word/-/word-0.3.0.tgz"
|
||||||
|
integrity sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==
|
||||||
|
|
||||||
workbox-background-sync@6.5.4:
|
workbox-background-sync@6.5.4:
|
||||||
version "6.5.4"
|
version "6.5.4"
|
||||||
resolved "https://registry.npmjs.org/workbox-background-sync/-/workbox-background-sync-6.5.4.tgz"
|
resolved "https://registry.npmjs.org/workbox-background-sync/-/workbox-background-sync-6.5.4.tgz"
|
||||||
@@ -11352,6 +11402,19 @@ ws@^8.4.2:
|
|||||||
resolved "https://registry.npmjs.org/ws/-/ws-8.9.0.tgz"
|
resolved "https://registry.npmjs.org/ws/-/ws-8.9.0.tgz"
|
||||||
integrity sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==
|
integrity sha512-Ja7nszREasGaYUYCI2k4lCKIRTt+y7XuqVoHR44YpI49TtryyqbqvDMn5eqfW7e6HzTukDRIsXqzVHScqRcafg==
|
||||||
|
|
||||||
|
xlsx@^0.18.5:
|
||||||
|
version "0.18.5"
|
||||||
|
resolved "https://registry.npmjs.org/xlsx/-/xlsx-0.18.5.tgz"
|
||||||
|
integrity sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==
|
||||||
|
dependencies:
|
||||||
|
adler-32 "~1.3.0"
|
||||||
|
cfb "~1.2.1"
|
||||||
|
codepage "~1.15.0"
|
||||||
|
crc-32 "~1.2.1"
|
||||||
|
ssf "~0.11.2"
|
||||||
|
wmf "~1.0.1"
|
||||||
|
word "~0.3.0"
|
||||||
|
|
||||||
xml-name-validator@^3.0.0:
|
xml-name-validator@^3.0.0:
|
||||||
version "3.0.0"
|
version "3.0.0"
|
||||||
resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz"
|
resolved "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz"
|
||||||
|
|||||||
Reference in New Issue
Block a user