diff --git a/src/routes.js b/src/routes.js index 135d7e8..0105581 100644 --- a/src/routes.js +++ b/src/routes.js @@ -156,6 +156,7 @@ import PendingOrders from "./views/orders/pendingOrders"; import ViewInvoices from "./views/orders/viewInoices"; import Stocks from "./views/PrincipalDistributors/Stock"; import SingleDistributorOrder from "./views/RetailDistributors/DistributorOrders"; +import DistributorStocks from "./views/RetailDistributors/DistributorStock"; const routes = [ //dashboard @@ -377,6 +378,12 @@ const routes = [ element: SingleDistributorOrder, navName: "Distributor", }, + { + path: "/:distributortype/stocks/:id", + name: " Distributor Stocks", + element: DistributorStocks, + navName: "Distributor", + }, //----------------------- End Product Management Routes------------------------------------------------ //Departure diff --git a/src/views/PrincipalDistributors/principalDistributor.js b/src/views/PrincipalDistributors/principalDistributor.js index a015d76..5f4ed85 100644 --- a/src/views/PrincipalDistributors/principalDistributor.js +++ b/src/views/PrincipalDistributors/principalDistributor.js @@ -225,13 +225,13 @@ const principalDistributor = () => { Last Purchase Orders Mapping - Action + Action {loading ? ( - +
Loading....
@@ -381,13 +381,13 @@ const principalDistributor = () => { > + + + + {/* Section Heading: Product Stocks */} +
+
+
+ Product Stocks +
+
+
+ + + +
+
+
+
+
+
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+ + + + + + + + + + + + + + + + {loading ? ( + + + + ) : productsData?.length > 0 ? ( + productsData?.map((product, i) => { + return ( + + + + + + + + + + + ); + }) + ) : ( + !loading && + productsData?.length === 0 && ( + + + + ) + )} + +
ImageSKUProductCategory NameBrand NamePriceAdded OnStock
+ Loading... +
+ {product?.image && + product?.image?.length !== 0 ? ( + <> + preview + + ) : ( +
+

No

+

image

+

uploaded!

+
+ )} +
{product.SKU}{product.name} + {product.category !== "" + ? product.category + : "Category Not selected "} + + {product.brand !== "" + ? product.brand + : "Brand Not selected "} + + {currencyDetails?.CurrencySymbol} + {product?.price} + + {new Date(product.createdAt).toLocaleString( + "en-IN", + { + weekday: "short", + month: "short", + day: "numeric", + year: "numeric", + hour: "numeric", + minute: "numeric", + hour12: true, + } + )} + {product.stock}
+
No Product Available...
+
+
+ +
+
+
+ Showing {currentPage * itemPerPage - itemPerPage + 1} to{" "} + {Math.min(currentPage * itemPerPage, totalData)} of{" "} + {totalData} entries +
+
+ +
+
+
    +
  • + setCurrentPage((prev) => prev - 1)} + disabled={loading} + > + Previous + +
  • + + {!(currentPage - 1 < 1) && ( +
  • + + setCurrentPage((prev) => prev - 1) + } + disabled={loading} + > + {currentPage - 1} + +
  • + )} + +
  • + + {currentPage} + +
  • + + {!( + (currentPage + 1) * itemPerPage - itemPerPage > + totalData - 1 + ) && ( +
  • + { + setCurrentPage((prev) => prev + 1); + }} + disabled={loading} + > + {currentPage + 1} + +
  • + )} + +
  • + totalData - 1 + ) + ? "paginate_button page-item next" + : "paginate_button page-item next disabled" + } + > + setCurrentPage((prev) => prev + 1)} + disabled={loading} + > + Next + +
  • +
+
+
+
+
+
+
+
+ + + + ); +}; + +export default DistributorStocks; diff --git a/src/views/RetailDistributors/RetailDistributor.js b/src/views/RetailDistributors/RetailDistributor.js index 2629b85..bee702c 100644 --- a/src/views/RetailDistributors/RetailDistributor.js +++ b/src/views/RetailDistributors/RetailDistributor.js @@ -162,14 +162,14 @@ const RetailDistributor = () => { Sales Coordinator Orders Mapping - Action + Action {loading ? ( - + Loading... @@ -186,13 +186,13 @@ const RetailDistributor = () => { {new Date( retailDistributor.createdAt ).toLocaleString("en-IN", { - weekday: "short", + // weekday: "short", month: "short", day: "numeric", year: "numeric", - hour: "numeric", - minute: "numeric", - hour12: true, + // hour: "numeric", + // minute: "numeric", + // hour12: true, })} @@ -244,16 +244,36 @@ const RetailDistributor = () => { - + + + + )) ) : ( - + No Retail Distributor found!