Search issue fixing
This commit is contained in:
parent
383106d3ed
commit
602dfa2ffb
|
|
@ -35,23 +35,17 @@ const RevenueItemWiseReport = () => {
|
||||||
const formattedToday = today.toISOString()?.split('T')[0];
|
const formattedToday = today.toISOString()?.split('T')[0];
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const formRef = useRef();
|
const formRef = useRef();
|
||||||
// const [filteredInfo, setFilteredInfo] = useState({});
|
|
||||||
const [sortedInfo, setSortedInfo] = useState({});
|
const [sortedInfo, setSortedInfo] = useState({});
|
||||||
// const [sortedInfo2, setSortedInfo2] = useState({});
|
|
||||||
const [searchedText, setSearchedText] = useState('');
|
const [searchedText, setSearchedText] = useState('');
|
||||||
// const [searchedText2, setSearchedText2] = useState("");
|
|
||||||
const [OrderFromDate, setOrderFromDate] = useState(formattedToday);
|
const [OrderFromDate, setOrderFromDate] = useState(formattedToday);
|
||||||
const [OrderToDate, setOrderToDate] = useState(formattedToday);
|
const [OrderToDate, setOrderToDate] = useState(formattedToday);
|
||||||
const [RevenueData, setRevenueData] = useState();
|
const [RevenueData, setRevenueData] = useState();
|
||||||
// const [CateWiseData, setCateWiseData] = useState();
|
|
||||||
const [userDropDown, setuserDropDown] = useState([]);
|
const [userDropDown, setuserDropDown] = useState([]);
|
||||||
// const [chartData, setchartdata] = useState([]);
|
|
||||||
const [apiCall, setapiCall] = useState(false);
|
const [apiCall, setapiCall] = useState(false);
|
||||||
const [chart, setchart] = useState(false);
|
const [chart, setchart] = useState(false);
|
||||||
|
|
||||||
const [selectedUserData, setSelectedUserData] = useState(null);
|
const [selectedUserData, setSelectedUserData] = useState(null);
|
||||||
const [receiptTextItemWise, setreceiptTextItemWise] = useState();
|
const [receiptTextItemWise, setreceiptTextItemWise] = useState();
|
||||||
// const [receiptTextCatWise, setreceiptTextCatWise] = useState()
|
|
||||||
const SettingDataSelector = useSelector(PreferenceData);
|
const SettingDataSelector = useSelector(PreferenceData);
|
||||||
|
|
||||||
const UomPrint = SettingDataSelector?.[0]?.SettingDtlDetails?.filter(
|
const UomPrint = SettingDataSelector?.[0]?.SettingDtlDetails?.filter(
|
||||||
|
|
@ -174,32 +168,11 @@ const RevenueItemWiseReport = () => {
|
||||||
fetchInitialData();
|
fetchInitialData();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// setchart(false)
|
|
||||||
// }, [apiCall]);
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (UserRole != 'Employee') {
|
if (UserRole != 'Employee') {
|
||||||
userDropData();
|
userDropData();
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
// useEffect(() => {
|
|
||||||
// if (apiCall) {
|
|
||||||
// setSelectedUserData(0);
|
|
||||||
// fetchCatData();
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
|
|
||||||
// setSelectedUserData(0);
|
|
||||||
// fetchInitialData();
|
|
||||||
|
|
||||||
// }
|
|
||||||
// }, [apiCall]);
|
|
||||||
// useEffect(() => {
|
|
||||||
// if (UserId==0){
|
|
||||||
// onFinish();
|
|
||||||
// }
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
function safeRound(amountStr) {
|
function safeRound(amountStr) {
|
||||||
if (amountStr == null) return allowDecimal ? '0.00' : '0';
|
if (amountStr == null) return allowDecimal ? '0.00' : '0';
|
||||||
|
|
||||||
|
|
@ -211,28 +184,6 @@ const RevenueItemWiseReport = () => {
|
||||||
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// const fetchCatData = async () => {
|
|
||||||
// let data1 = {
|
|
||||||
// CompId: CompId,
|
|
||||||
// BranchId: BranchId,
|
|
||||||
// AppId: AppId,
|
|
||||||
// OrderFromDate: OrderFromDate?.split("T")?.[0],
|
|
||||||
// OrderToDate: OrderToDate?.split("T")?.[0],
|
|
||||||
// UserId: 0,
|
|
||||||
// type: 'PE'
|
|
||||||
|
|
||||||
// };
|
|
||||||
|
|
||||||
// let response = await dispatch(getEstimateCatItemWiseReport(data1)).unwrap();
|
|
||||||
// if (response?.data?.statusCode == 1) {
|
|
||||||
// setCateWiseData(response?.data?.data)
|
|
||||||
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
|
|
||||||
// setCateWiseData();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
const userDropData = async () => {
|
const userDropData = async () => {
|
||||||
const gettinguserDropDown = await dispatch(
|
const gettinguserDropDown = await dispatch(
|
||||||
UserDataBasedOnBranchId(BranchId)
|
UserDataBasedOnBranchId(BranchId)
|
||||||
|
|
@ -268,27 +219,14 @@ const RevenueItemWiseReport = () => {
|
||||||
setFilteredInfo(filters);
|
setFilteredInfo(filters);
|
||||||
setSortedInfo(sorter);
|
setSortedInfo(sorter);
|
||||||
};
|
};
|
||||||
// const handleChange2 = (pagination, filters, sorter) => {
|
|
||||||
// setSortedInfo2(sorter);
|
|
||||||
// };
|
|
||||||
|
|
||||||
// const onComplete = useCallback(() => {
|
|
||||||
// setMessageData(null);
|
|
||||||
// setMessageType(null);
|
|
||||||
// }, [])
|
|
||||||
|
|
||||||
const onSearch = (value) => {
|
const onSearch = (value) => {
|
||||||
setSearchedText(value);
|
setSearchedText(typeof value === "string" ? value : "");
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSearchChange = (e) => {
|
const onSearchChange = (e) => {
|
||||||
setSearchedText(e?.target?.value);
|
setSearchedText(e?.target?.value || "");
|
||||||
};
|
};
|
||||||
// const onSearch2 = (value) => {
|
|
||||||
// setSearchedText2(value);
|
|
||||||
// };
|
|
||||||
// const onSearchChange2 = (e) => {
|
|
||||||
// setSearchedText2(e?.target?.value);
|
|
||||||
// };
|
|
||||||
const Print = async () => {
|
const Print = async () => {
|
||||||
if (isMobile) {
|
if (isMobile) {
|
||||||
if (MobileA4Print) {
|
if (MobileA4Print) {
|
||||||
|
|
@ -426,45 +364,7 @@ const RevenueItemWiseReport = () => {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
// const columns2 = [
|
|
||||||
// {
|
|
||||||
// title: "SI NO",
|
|
||||||
// dataIndex: "SINO",
|
|
||||||
// key: "SINO",
|
|
||||||
// align: "center",
|
|
||||||
// render: (text, object, index) => <a style={{ color: "black" }}>{index + 1}</a>,
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "Category",
|
|
||||||
// dataIndex: "ProdCatName",
|
|
||||||
// key: "Category",
|
|
||||||
// filteredValue: [searchedText2],
|
|
||||||
// onFilter: (value, record) => {
|
|
||||||
// return String(record.ProdCatName)
|
|
||||||
// ?.toLowerCase()
|
|
||||||
// ?.includes(value?.toLowerCase());
|
|
||||||
// },
|
|
||||||
// sorter: (a, b) => a?.ProdCatName?.localeCompare(b?.ProdCatName),
|
|
||||||
// sortOrder: sortedInfo2.columnKey === "ItemName" ? sortedInfo2.order : null,
|
|
||||||
// ellipsis: true,
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "Qty",
|
|
||||||
// dataIndex: "SalesQty",
|
|
||||||
// key: "Qty",
|
|
||||||
// align: "right",
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// title: "Amount",
|
|
||||||
// dataIndex: "TotalAmt",
|
|
||||||
// key: "Amount",
|
|
||||||
// align: "right",
|
|
||||||
// render : (text)=> (
|
|
||||||
// <span style={{ color: "black" }}>{safeRound(text)}</span>
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
|
|
||||||
// ];
|
|
||||||
const DateWisTableData = RevenueData?.map((item, index) => ({
|
const DateWisTableData = RevenueData?.map((item, index) => ({
|
||||||
SINO: index + 1,
|
SINO: index + 1,
|
||||||
ItemName:
|
ItemName:
|
||||||
|
|
@ -511,40 +411,16 @@ const RevenueItemWiseReport = () => {
|
||||||
UserId: UserId,
|
UserId: UserId,
|
||||||
type: 'E',
|
type: 'E',
|
||||||
};
|
};
|
||||||
// let data1 = {
|
|
||||||
// CompId: CompId,
|
|
||||||
// BranchId: BranchId,
|
|
||||||
// AppId: AppId,
|
|
||||||
// OrderFromDate: OrderFromDate?.split("T")?.[0],
|
|
||||||
// OrderToDate: OrderToDate?.split("T")?.[0],
|
|
||||||
// UserId: UserId,
|
|
||||||
// type: 'E'
|
|
||||||
// };
|
|
||||||
if (!apiCall) {
|
if (!apiCall) {
|
||||||
let Response = await dispatch(getRevenueItemWiseReport(data)).unwrap();
|
let Response = await dispatch(getRevenueItemWiseReport(data)).unwrap();
|
||||||
setRevenueData(Response?.data?.data);
|
setRevenueData(Response?.data?.data);
|
||||||
}
|
}
|
||||||
// else {
|
|
||||||
// let response = await dispatch(getEstimateCatItemWiseReport(data1)).unwrap();
|
|
||||||
// if (response?.data?.statusCode === 1) {
|
|
||||||
// setCateWiseData(response?.data?.data)
|
|
||||||
// } else {
|
|
||||||
// // setMessageType("warning");
|
|
||||||
// // setMessageData("No Data Found");
|
|
||||||
// setCateWiseData();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('An error occurred:', error);
|
console.error('An error occurred:', error);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// let filterRate1 = CateWiseData?.map((item) => item.TotalAmt);
|
|
||||||
// const TotalAmount2 = filterRate1?.reduce(
|
|
||||||
// (accumulator, currentValue) => accumulator + currentValue,
|
|
||||||
// 0
|
|
||||||
// );
|
|
||||||
|
|
||||||
|
|
||||||
let filterPurchaseRate = RevenueData?.map((item) => item.ProductPurchaseRate);
|
let filterPurchaseRate = RevenueData?.map((item) => item.ProductPurchaseRate);
|
||||||
const PurchaseRate = filterPurchaseRate?.reduce(
|
const PurchaseRate = filterPurchaseRate?.reduce(
|
||||||
|
|
@ -562,10 +438,6 @@ const RevenueItemWiseReport = () => {
|
||||||
|
|
||||||
const TotalSalesAmt = salesRate - PurchaseRate;
|
const TotalSalesAmt = salesRate - PurchaseRate;
|
||||||
|
|
||||||
// const onChange = (checked) => {
|
|
||||||
// setapiCall(checked);
|
|
||||||
// };
|
|
||||||
|
|
||||||
const reprintDate = (date) => {
|
const reprintDate = (date) => {
|
||||||
const salesDate = new Date(date);
|
const salesDate = new Date(date);
|
||||||
const formattedDate = salesDate.toLocaleDateString('en-GB', {
|
const formattedDate = salesDate.toLocaleDateString('en-GB', {
|
||||||
|
|
@ -582,58 +454,6 @@ const RevenueItemWiseReport = () => {
|
||||||
}
|
}
|
||||||
}, [itemData]);
|
}, [itemData]);
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// if (CateWiseData?.length > 0) {
|
|
||||||
// mobileCatWisePrintFun(CateWiseData)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }, [CateWiseData])
|
|
||||||
|
|
||||||
// const mobileCatWisePrintFun = async (printdata) => {
|
|
||||||
|
|
||||||
// let Tabledata = printdata?.map((data, index) => {
|
|
||||||
|
|
||||||
// const snoSpacing = Math.max(0, 3 - String(index + 1).length);
|
|
||||||
// // Calculate dynamic spacing for Rate
|
|
||||||
// const QtySpacing = Math.max(0, 5 - String(data?.SalesQty).length);
|
|
||||||
// const rateSpacing = Math.max(0, 7 - String(data?.TotalAmt).length);
|
|
||||||
|
|
||||||
// // Calculate dynamic spacing for TotalAmt
|
|
||||||
|
|
||||||
// // Generate formatted string with dynamic spacings
|
|
||||||
// const formattedString =
|
|
||||||
// " ".repeat(snoSpacing) +
|
|
||||||
// parseInt(index + 1) +
|
|
||||||
// " " +
|
|
||||||
// (data?.ProdCatName + " ".repeat(20)).substring(0, 20) +
|
|
||||||
|
|
||||||
// " " +
|
|
||||||
// " ".repeat(QtySpacing) + String(data?.SalesQty) +
|
|
||||||
// " " +
|
|
||||||
// " ".repeat(rateSpacing) + String(data?.TotalAmt) +
|
|
||||||
// " " + "\n";
|
|
||||||
|
|
||||||
// return formattedString;
|
|
||||||
// });
|
|
||||||
|
|
||||||
// var receiptTextdata =
|
|
||||||
|
|
||||||
// "[C]<b><font size='big'>" + "Category Wise Sales" + "</font></b>\n" +
|
|
||||||
// "[L]<b>From Date :" + reprintDate(OrderFromDate) +
|
|
||||||
// "[L]<b>" + " " + "To Date :" + reprintDate(OrderToDate) +
|
|
||||||
// "</b>\n" +
|
|
||||||
// "[C]------------------------------------------------\n" +
|
|
||||||
|
|
||||||
// "[L]<b>" + "" + "S.No" + " " + " Category " + " " + "Quantity " + " " + "Amount " + "" + "</b>" +
|
|
||||||
// "[L]\n" +
|
|
||||||
// "[C]------------------------------------------------\n" +
|
|
||||||
// Tabledata.join("") +
|
|
||||||
// "[C]<b>------------------------------------------------</b>\n" +
|
|
||||||
// "[R]<b>" + "TotalAmount:" + parseFloat(TotalAmount).toFixed(2) + "</b>\n" +
|
|
||||||
// "[L]<b>------------------------------------------------</b>\n"
|
|
||||||
|
|
||||||
// setreceiptTextCatWise(receiptTextdata)
|
|
||||||
// }
|
|
||||||
|
|
||||||
const mobileItemWisePrintFun = async (printdata) => {
|
const mobileItemWisePrintFun = async (printdata) => {
|
||||||
let Tabledata = printdata?.map((data, index) => {
|
let Tabledata = printdata?.map((data, index) => {
|
||||||
|
|
@ -701,7 +521,7 @@ const RevenueItemWiseReport = () => {
|
||||||
return allowDecimal ? parseFloat(value || 0).toFixed(2) : Math.round(value || 0);
|
return allowDecimal ? parseFloat(value || 0).toFixed(2) : Math.round(value || 0);
|
||||||
};
|
};
|
||||||
const getPreference = async () => {
|
const getPreference = async () => {
|
||||||
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId,UserId: UserId };
|
const data = { AppId: AppId, CompId: CompId, BranchId: BranchId, UserId: UserId };
|
||||||
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
const { data: res } = await dispatch(getPreferenceData(data)).unwrap()
|
||||||
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
const decimalSetting = res?.data?.[0]?.SettingDtlDetails?.find((setting) => setting?.SettingIdName?.toLowerCase() === "decimal" && setting?.SettingValue === 'Y');
|
||||||
if (decimalSetting) {
|
if (decimalSetting) {
|
||||||
|
|
@ -721,12 +541,6 @@ const RevenueItemWiseReport = () => {
|
||||||
TotalSalesAmt={TotalSalesAmt}
|
TotalSalesAmt={TotalSalesAmt}
|
||||||
RevenueData={RevenueData}
|
RevenueData={RevenueData}
|
||||||
/>
|
/>
|
||||||
{/* <CategoryWiseReportPdf
|
|
||||||
OrderFromDate={OrderFromDate?.split("T")?.[0]}
|
|
||||||
OrderToDate={OrderToDate?.split("T")?.[0]}
|
|
||||||
TotalAmount={TotalAmount2}
|
|
||||||
itemData={CateWiseData}
|
|
||||||
/> */}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ overflow: "auto" }}>
|
<div style={{ overflow: "auto" }}>
|
||||||
|
|
@ -735,57 +549,6 @@ const RevenueItemWiseReport = () => {
|
||||||
<p className="ItemWiseReport-heading">Gross Margin</p>
|
<p className="ItemWiseReport-heading">Gross Margin</p>
|
||||||
<div className="ItemWiseReport-dateaAnd-buttons">
|
<div className="ItemWiseReport-dateaAnd-buttons">
|
||||||
<div className="ItemWiseReport-Date-picker">
|
<div className="ItemWiseReport-Date-picker">
|
||||||
{/* <div className="ItemWiseReport-DateFrom">
|
|
||||||
<div className="ItemWiseReport-Date">
|
|
||||||
<p className="ItemWiseReport-Date-from-heading required">
|
|
||||||
From Date
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Form.Item
|
|
||||||
name="Fromdate"
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
pattern: /^(?!\s*$).+/,
|
|
||||||
message: 'Please Enter the From Date ',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<DatePicProd
|
|
||||||
onChange={OrderFromDatefetch}
|
|
||||||
// style={{ width: "24vw", height: "2.6rem" }}
|
|
||||||
valueData={OrderFromDate}
|
|
||||||
canSelectPast={true}
|
|
||||||
cancelFuture={true}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="ItemWiseReport-DateTo">
|
|
||||||
<div className="ItemWiseReport-Date">
|
|
||||||
<p className="required">To Date</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<Form.Item
|
|
||||||
name="Todate"
|
|
||||||
rules={[
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
pattern: /^(?!\s*$).+/,
|
|
||||||
message: 'Please Enter the To Date ',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
>
|
|
||||||
<DatePicProd
|
|
||||||
onChange={OrderToDatefetch}
|
|
||||||
// style={{ width: "24vw", height: "2.6rem" }}
|
|
||||||
valueData={OrderToDate}
|
|
||||||
canSelectPast={true}
|
|
||||||
cancelFuture={true}
|
|
||||||
minDate={OrderFromDate}
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
</div> */}
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="dateRange"
|
name="dateRange"
|
||||||
>
|
>
|
||||||
|
|
@ -863,59 +626,20 @@ const RevenueItemWiseReport = () => {
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="ItemWiseReport-PrinterIcon-Container">
|
|
||||||
<Tooltip title="Print">
|
|
||||||
{!apiCall ? <BiSolidPrinter
|
|
||||||
onClick={Print}
|
|
||||||
className={
|
|
||||||
itemData?.length > 0
|
|
||||||
? "ItemWiseReport-printerIcon"
|
|
||||||
: "ItemWiseReport-printerIcon-disabled"
|
|
||||||
}
|
|
||||||
/> :
|
|
||||||
<BiSolidPrinter
|
|
||||||
onClick={Print2}
|
|
||||||
className={
|
|
||||||
CateWiseData?.length > 0
|
|
||||||
? "ItemWiseReport-printerIcon"
|
|
||||||
: "ItemWiseReport-printerIcon-disabled"
|
|
||||||
}
|
|
||||||
/>}
|
|
||||||
</Tooltip>
|
|
||||||
</div> */}
|
|
||||||
<div className="ItemWiseReport-search">
|
<div className="ItemWiseReport-search">
|
||||||
{!apiCall ? (
|
<Search
|
||||||
<Search
|
placeholder="Search by Item Name"
|
||||||
placeholder="Search by Item Name"
|
onSearch={onSearch}
|
||||||
onSearch={onSearch}
|
onSearchChange={onSearchChange}
|
||||||
onSearchChange={onSearchChange}
|
/>
|
||||||
/>
|
|
||||||
) : !chart ? (
|
|
||||||
<Search
|
|
||||||
placeholder="Search"
|
|
||||||
onSearch={onSearch2}
|
|
||||||
onSearchChange={onSearchChange2}
|
|
||||||
/>
|
|
||||||
) : (
|
|
||||||
''
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* {apiCall && <div className="toggle">
|
|
||||||
<p> PieChart</p> <Switch onChange={openChart} /> <p> TableData</p>
|
|
||||||
</div>} */}
|
|
||||||
|
|
||||||
<div className="ItemWiseReport-table1">
|
<div className="ItemWiseReport-table1">
|
||||||
{/* <Tables
|
|
||||||
columns={columns}
|
|
||||||
data={itemData}
|
|
||||||
dataSource={itemData}
|
|
||||||
onChange={handleChange}
|
|
||||||
/> */}
|
|
||||||
|
|
||||||
<table className="custom-table">
|
<table className="custom-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -929,16 +653,17 @@ const RevenueItemWiseReport = () => {
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{itemData &&
|
{itemData &&
|
||||||
itemData
|
(itemData || [])
|
||||||
.filter(
|
.filter((row) => {
|
||||||
(row) =>
|
const search = (searchedText || "").toLowerCase();
|
||||||
!searchedText ||
|
|
||||||
|
return (
|
||||||
|
!search ||
|
||||||
(row.ItemName &&
|
(row.ItemName &&
|
||||||
row.ItemName?.toLowerCase()?.includes(
|
row.ItemName.toLowerCase().includes(search))
|
||||||
searchedText?.toLowerCase()
|
);
|
||||||
))
|
})
|
||||||
)
|
?.sort((a, b) => {
|
||||||
.sort((a, b) => {
|
|
||||||
if (sortedInfo.columnKey === 'ItemName') {
|
if (sortedInfo.columnKey === 'ItemName') {
|
||||||
return sortedInfo.order === 'ascend'
|
return sortedInfo.order === 'ascend'
|
||||||
? a.ItemName?.localeCompare(b.ItemName)
|
? a.ItemName?.localeCompare(b.ItemName)
|
||||||
|
|
@ -946,7 +671,7 @@ const RevenueItemWiseReport = () => {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
})
|
})
|
||||||
.map((row, idx) => (
|
?.map((row, idx) => (
|
||||||
<tr key={idx}>
|
<tr key={idx}>
|
||||||
<td style={{ textAlign: 'center' }}>{idx + 1}</td>
|
<td style={{ textAlign: 'center' }}>{idx + 1}</td>
|
||||||
<td style={{ textAlign: 'left' }}>{row.ItemName}</td>
|
<td style={{ textAlign: 'left' }}>{row.ItemName}</td>
|
||||||
|
|
@ -994,30 +719,10 @@ const RevenueItemWiseReport = () => {
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="ItemWiseReport-table">
|
|
||||||
{!apiCall ? <Tables
|
|
||||||
columns={columns}
|
|
||||||
data={itemData}
|
|
||||||
// dataSource={itemData}
|
|
||||||
onChange={handleChange}
|
|
||||||
/> : !chart ? (<Tables
|
|
||||||
columns={columns2}
|
|
||||||
data={chartData}
|
|
||||||
// dataSource={itemData}
|
|
||||||
onChange={handleChange2}
|
|
||||||
/>
|
|
||||||
|
|
||||||
) : (<DynamicPieChart chartData={chartData} />)
|
|
||||||
}
|
|
||||||
</div> */}
|
|
||||||
<div
|
<div
|
||||||
className="ItemWiseReport-netAmount"
|
className="ItemWiseReport-netAmount"
|
||||||
style={{ margin: '2rem 1.5rem' }}
|
style={{ margin: '2rem 1.5rem' }}
|
||||||
>
|
>
|
||||||
{/* {apiCall && chart ? null : (
|
|
||||||
<h3> Net Amount: {!apiCall ? TotalAmount : (!chart ? TotalAmount2 : "")}</h3>
|
|
||||||
)} */}
|
|
||||||
|
|
||||||
{!apiCall ? (
|
{!apiCall ? (
|
||||||
<div className="ItemWiseReport-Amount-Collected-table">
|
<div className="ItemWiseReport-Amount-Collected-table">
|
||||||
<table className="ItemWiseReport-Amount-Collected-table-div">
|
<table className="ItemWiseReport-Amount-Collected-table-div">
|
||||||
|
|
@ -1030,15 +735,6 @@ const RevenueItemWiseReport = () => {
|
||||||
<td>Sales Rate</td>
|
<td>Sales Rate</td>
|
||||||
<td>{safeRound(salesRate)}</td>
|
<td>{safeRound(salesRate)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/* {RevenueData?.[0]?.OverallDisc > 0 && <tr>
|
|
||||||
<td>Discount Amount</td>
|
|
||||||
<td>{RevenueData?.[0]?.OverallDisc}</td>
|
|
||||||
</tr>}
|
|
||||||
|
|
||||||
{RevenueData?.[0]?.TaxAmt > 0 && <tr>
|
|
||||||
<td>Total Tax</td>
|
|
||||||
<td>{RevenueData?.[0]?.TaxAmt}</td>
|
|
||||||
</tr>} */}
|
|
||||||
<p className="ItemWiseReport-border-dashed"></p>
|
<p className="ItemWiseReport-border-dashed"></p>
|
||||||
<tr>
|
<tr>
|
||||||
<th className="ItemWiseReport-netAmount">
|
<th className="ItemWiseReport-netAmount">
|
||||||
|
|
@ -1093,11 +789,6 @@ const RevenueItemWiseReport = () => {
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="ItemWiseReport-netAmount">
|
|
||||||
{apiCall && chart ? null : (
|
|
||||||
<h3> Net Amount: {!apiCall ? TotalAmount : (!chart ? TotalAmount2 : "")}</h3>
|
|
||||||
)}
|
|
||||||
</div> */}
|
|
||||||
</Form>
|
</Form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue