This commit is contained in:
ROSHAN GARG 2024-10-14 10:07:49 +05:30
commit bcd73e2bad
4 changed files with 41 additions and 38 deletions

View File

@ -33,15 +33,12 @@ const Inventory = () => {
name: nameRef.current?.value || "",
},
});
// console.log("response", response);
const transformedData =
response.data?.inventories?.map((entry) => ({
id: entry._id,
uniqueId: entry.uniqueId,
tradeName:
entry.addedForData?.shippingAddress?.tradeName ||
entry.addedForData?.trade_name ||
"N/A",
tradeName: entry.tradeName || "N/A",
designation: entry.addedFor === "PrincipalDistributor" ? "PD" : "RD",
products: entry.products.map((product) => ({
SKU: product.SKU,

View File

@ -140,7 +140,7 @@ const SingleInventory = () => {
</Typography>
<Typography>
<strong>Trade Name:</strong>{" "}
{inventoryDetails.addedForData.shippingAddress?.tradeName||inventoryDetails.addedForData.trade_name}
{inventoryDetails.addedForData.shippingAddress?.tradeName||inventoryDetails.addedForData.kyc.trade_name}
</Typography>
</Grid>
</Grid>

View File

@ -208,24 +208,28 @@ const principalDistributor = () => {
<div className="table-responsive table-shoot mt-3">
<table
className="table table-centered table-nowrap"
style={{ border: "1px solid" }}
style={{
border: "1px solid",
tableLayout: "fixed",
width: "100%",
}}
>
<thead
className="thead-info"
style={{ background: "rgb(140, 213, 213)" }}
>
<tr>
<th>Unique Id </th>
<th>SBU</th>
<th>Name</th>
<th>Email</th>
{/* <th>Profile Image</th> */}
<th>Date Registered</th>
<th>Last Purchase</th>
<th>Orders</th>
<th>Mapping</th>
<th className="text-center">Action</th>
<th style={{ width: "10%" }}>Unique Id</th>
<th style={{ width: "7%" }}>SBU</th>
<th style={{ width: "15%" }}>Name</th>
<th style={{ width: "17%" }}>Email</th>
<th style={{ width: "12%" }}>Date Registered</th>
<th style={{ width: "12%" }}>Last Purchase</th>
<th style={{ width: "7%" }}>Orders</th>
<th style={{ width: "8%" }}>Mapping</th>
<th className="text-center" style={{ width: "12%" }}>
Action
</th>
</tr>
</thead>
<tbody>
@ -241,8 +245,8 @@ const principalDistributor = () => {
<td>{user.uniqueId}</td>
<td>{user.SBU ? user.SBU : "N/A"}</td>
<td className="text-start">{user.name}</td>
<td>{user.email}</td>
<td className="text-start">
<td className="text-start">{user.email}</td>
<td className="text-center">
{new Date(user.createdAt).toLocaleString(
"en-IN",
{
@ -268,17 +272,18 @@ const principalDistributor = () => {
)
: "No purchase"}
</td>
<td className="text-center">
<td className="text-start">
<Link
to={`/principaldistributor/orders/${user?._id}`}
>
<button
style={{
color: "black",
marginRight: "1rem",
width: "50px",
textAlign: "center",
}}
type="button"
className="btn btn-warning btn-sm waves-effect waves-light btn-table ml-2"
className="btn btn-warning btn-sm waves-effect waves-light btn-table"
>
{user.totalOrders}
</button>
@ -295,7 +300,7 @@ const principalDistributor = () => {
_id={user?._id}
setLoading1={setLoading1}
/> */}
<td className="text-start">
<td className="text-center">
<Link
to={`/view/mappedretaildistributor/${user?._id}`}
>
@ -311,7 +316,7 @@ const principalDistributor = () => {
</button>
</Link>
</td>
<td className="text-start">
<td className="text-end">
{/* <Link
to={`/users-address/view/${userAddress._id}`}
>
@ -381,7 +386,7 @@ const principalDistributor = () => {
>
<button
type="button"
className=" btn btn-info btn-sm waves-effect waves-light btn-table ml-2"
className=" btn btn-info btn-sm waves-effect waves-light btn-table"
>
View
</button>
@ -392,14 +397,15 @@ const principalDistributor = () => {
<button
style={{
color: "white",
marginRight: "1rem",
}}
type="button"
className="
btn btn-info btn-sm
waves-effect waves-light
btn-table
mx-1
ml-1
md-mt-1
md-ml-0
"
>
Stock

View File

@ -129,7 +129,7 @@ const SalesCoOrdinator = () => {
>
Add Sales Coordinator
</Button>
{/* <Button
<Button
variant="contained"
color="primary"
className="font-bold mb-2 capitalize"
@ -140,7 +140,7 @@ const SalesCoOrdinator = () => {
}
>
Upload Spreadsheet
</Button> */}
</Button>
</div>
</div>
</div>