diff --git a/src/_nav.js b/src/_nav.js index 45a90f4..58396fc 100644 --- a/src/_nav.js +++ b/src/_nav.js @@ -121,9 +121,9 @@ const _nav = [ }, { component: CNavItem, - name: "GST Rate", + name: "VAT", icon: , - to: "/tax", + to: "/vat", group: "Product Management", }, ], diff --git a/src/routes.js b/src/routes.js index 4d7ccb6..0ac335e 100644 --- a/src/routes.js +++ b/src/routes.js @@ -238,7 +238,7 @@ const routes = [ }, //Gst tax { - path: "/tax", + path: "/vat", name: "Tax Rates", element: Tax, navName: "Product Management", diff --git a/src/views/Products/Productcomponents/ProductDetails.js b/src/views/Products/Productcomponents/ProductDetails.js index 2672694..be051da 100644 --- a/src/views/Products/Productcomponents/ProductDetails.js +++ b/src/views/Products/Productcomponents/ProductDetails.js @@ -155,7 +155,7 @@ const ProductDetails = (props) => { {
-
@@ -137,7 +155,10 @@ function Addtax() {
-
@@ -158,8 +182,11 @@ function Addtax() {
-
@@ -185,7 +215,7 @@ function Addtax() {
- ) + ); } -export default Addtax +export default Addtax; diff --git a/src/views/configuration/tax/Edittax.js b/src/views/configuration/tax/Edittax.js index f5186e7..13a77b3 100644 --- a/src/views/configuration/tax/Edittax.js +++ b/src/views/configuration/tax/Edittax.js @@ -1,19 +1,18 @@ -import axios from 'axios' -import React, { useEffect, useState } from 'react' -import { Link, useParams, useNavigate } from 'react-router-dom' -import { isAutheticated } from 'src/auth' - +import axios from "axios"; +import React, { useEffect, useState } from "react"; +import { Link, useParams, useNavigate } from "react-router-dom"; +import { isAutheticated } from "src/auth"; function Edittax() { - const { id } = useParams() - const token = isAutheticated() - const navigate = useNavigate() - const [loading, setLoading] = useState(false) + const { id } = useParams(); + const token = isAutheticated(); + const navigate = useNavigate(); + const [loading, setLoading] = useState(false); const [data, setData] = useState({ - name: '', - tax: '', - hsn_code: '', - }) + name: "", + tax: "", + hsn_code: "", + }); const [limiter, setLimiter] = useState({ name: 50, namehas: 50, @@ -21,11 +20,11 @@ function Edittax() { taxhas: 2, hsn_code: 10, hsn_codehas: 10, - }) + }); useEffect(() => { function getTax() { - setLoading(true) + setLoading(true); axios .get(`/api/tax/view_tax/${id}`, { headers: { @@ -33,43 +32,49 @@ function Edittax() { }, }) .then((res) => { - setLoading(false) + setLoading(false); setData((prev) => ({ ...prev, name: res.data?.name, tax: res.data?.tax?.toString(), hsn_code: res.data?.hsn_code?.toString(), - })) + })); setLimiter((prev) => ({ ...prev, namehas: prev.name - res.data?.name.length, taxhas: prev.tax - res.data?.tax?.toString().length, hsn_codehas: prev.hsn_code - res.data?.hsn_code.toString()?.length, - })) + })); }) .catch((res) => { - setLoading(false) - navigate('/tax', { replace: true }) - }) + setLoading(false); + navigate("/tax", { replace: true }); + }); } - getTax() - }, []) + getTax(); + }, []); const handleChange = (e) => { - if ((e.target.name === 'tax' || e.target.name === 'hsn_code') && /^\D+$/.test(e.target.value)) - return - setData((prev) => ({ ...prev, [e.target.name]: e.target.value })) + if ( + (e.target.name === "tax" || e.target.name === "hsn_code") && + /^\D+$/.test(e.target.value) + ) + return; + setData((prev) => ({ ...prev, [e.target.name]: e.target.value })); setLimiter((prev) => ({ ...prev, - [e.target.name + 'has']: prev[e.target.name] - e.target.value.length, - })) - } + [e.target.name + "has"]: prev[e.target.name] - e.target.value.length, + })); + }; function handleSubmit() { - if ((data.name.trim() === '' || data.tax.trim() === '', data.hsn_code.trim() === '')) { - return swal('Error', 'All fields are required!', 'error') + if ( + (data.name.trim() === "" || data.tax.trim() === "", + data.hsn_code.trim() === "") + ) { + return swal("Error", "All fields are required!", "error"); } - setLoading(true) + setLoading(true); axios .patch(`/api/tax/update_tax/${id}`, data, { headers: { @@ -77,14 +82,14 @@ function Edittax() { }, }) .then((res) => { - setLoading(false) - swal('Success', 'Tax updated successfully', 'success') - navigate('/tax', { replace: true }) + setLoading(false); + swal("Success", "Tax updated successfully", "success"); + navigate("/tax", { replace: true }); }) .catch((err) => { - swal('Error', 'Something went wrong!', 'error') - setLoading(false) - }) + swal("Error", "Something went wrong!", "error"); + setLoading(false); + }); } return ( @@ -107,7 +112,7 @@ function Edittax() { Save - +
@@ -69,10 +73,13 @@ function Tax() {
- + - + @@ -113,7 +120,7 @@ function Tax() { - ) + ); })}
NameTax RateVAT Rate Action
@@ -211,7 +218,7 @@ function Tax() {
- ) + ); } -export default Tax +export default Tax; diff --git a/src/views/orders/PrintOrderDetails.js b/src/views/orders/PrintOrderDetails.js index 6de0179..4c1c18f 100644 --- a/src/views/orders/PrintOrderDetails.js +++ b/src/views/orders/PrintOrderDetails.js @@ -1,13 +1,12 @@ -import React, { useEffect, useState } from 'react' -import QRCode from 'react-qr-code' -import axios from 'axios' -import { isAutheticated } from 'src/auth' - +import React, { useEffect, useState } from "react"; +import QRCode from "react-qr-code"; +import axios from "axios"; +import { isAutheticated } from "src/auth"; const PrintOrderDetails = React.forwardRef(({ orderData }, ref) => { - const token = isAutheticated() - const [company, setCompany] = useState({}) - const [logo, setLogo] = useState('') + const token = isAutheticated(); + const [company, setCompany] = useState({}); + const [logo, setLogo] = useState(""); useEffect(() => { function getConfig() { @@ -18,34 +17,47 @@ const PrintOrderDetails = React.forwardRef(({ orderData }, ref) => { }, }) .then((res) => { - setCompany(res.data?.result[0]?.address[0]) - setLogo(res.data?.result[0]?.logo[0]?.Headerlogo) - }) + setCompany(res.data?.result[0]?.address[0]); + setLogo(res.data?.result[0]?.logo[0]?.Headerlogo); + }); } - getConfig() - }, []) + getConfig(); + }, []); return (
-
+

Order Confirmation


- +
- @@ -53,7 +65,7 @@ const PrintOrderDetails = React.forwardRef(({ orderData }, ref) => {
{logo && (
- {company?.company} + {company?.company}
)}
+ {company?.company}
{company?.address}
- {company?.city + ' ' + company?.state + ' ' + company?.pincode} + {company?.city + " " + company?.state + " " + company?.pincode}
{company?.country}
@@ -63,32 +75,36 @@ const PrintOrderDetails = React.forwardRef(({ orderData }, ref) => {

-
+
- +
@@ -118,7 +134,7 @@ const PrintOrderDetails = React.forwardRef(({ orderData }, ref) => { )} {orderData.address?.city}
- {orderData.address?.pincode + ' ' + orderData.address?.state} + {orderData.address?.pincode + " " + orderData.address?.state}
Bill To {orderData?.address?.full_name} @@ -141,17 +157,17 @@ const PrintOrderDetails = React.forwardRef(({ orderData }, ref) => { )} {orderData.address?.city}
- {orderData.address?.pincode + ' ' + orderData.address?.state} + {orderData.address?.pincode + " " + orderData.address?.state}
-
- ) -}) + ); +}); -export default PrintOrderDetails +export default PrintOrderDetails;