added sorting in product receipt name
This commit is contained in:
parent
bc8dafa167
commit
0d6b950a99
|
|
@ -0,0 +1,427 @@
|
|||
import { DefaultModal } from "../../../../Components/Modal/DefaultModal"
|
||||
import { extractLastNumberOrderId } from "../../../../Services/Others"
|
||||
import '../../../../Styles/BookingScreen/Template/BSLayout2/BSLayout2.scss';
|
||||
|
||||
const SalesDetailsModal = ({ isModalOpen = false,
|
||||
setIsModalOpen = () => { },
|
||||
currentData = [],
|
||||
currentPage,
|
||||
totalPages,
|
||||
setCurrentPage = () => { },
|
||||
startIndex
|
||||
}) => {
|
||||
|
||||
return (
|
||||
<DefaultModal
|
||||
open={isModalOpen}
|
||||
title="Sales Details"
|
||||
handleCancel={() => setIsModalOpen(false)}
|
||||
handleSubmit={() => setIsModalOpen(false)}
|
||||
width={700}
|
||||
footer={false}
|
||||
>
|
||||
<div style={{ overflowX: 'auto' }}>
|
||||
<table
|
||||
style={{
|
||||
width: '100%',
|
||||
borderCollapse: 'collapse',
|
||||
fontFamily: "'Segoe UI', Roboto, sans-serif",
|
||||
fontSize: '14px',
|
||||
borderRadius: '8px',
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
||||
}}
|
||||
className='SCTableInPageSales'
|
||||
>
|
||||
<thead>
|
||||
<tr style={{ backgroundColor: '#2c88ee', color: '#fff' }}>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
S.No
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Order ID
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Customer
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Mobile
|
||||
</th>
|
||||
{/* <th style={{ border: "1px solid #ddd", padding: "10px" }}>Booked By</th> */}
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Payment Type
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px', backgroundColor: '#055ec0' }}>
|
||||
Amount (₹)
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{currentData?.length > 0 ? (
|
||||
currentData?.map((item, index) => (
|
||||
<tr
|
||||
key={item.OrderId}
|
||||
style={{
|
||||
backgroundColor: index % 2 === 0 ? '#f7faff' : '#e9f1ff',
|
||||
textAlign: 'center',
|
||||
transition: 'background 0.3s',
|
||||
}}
|
||||
onMouseEnter={(e) =>
|
||||
(e.currentTarget.style.backgroundColor = '#d6e4ff')
|
||||
}
|
||||
onMouseLeave={(e) =>
|
||||
(e.currentTarget.style.backgroundColor =
|
||||
index % 2 === 0 ? '#f7faff' : '#e9f1ff')
|
||||
}
|
||||
>
|
||||
<td style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
{startIndex + index + 1}
|
||||
</td>
|
||||
<td style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
{extractLastNumberOrderId(item.OrderId)}
|
||||
</td>
|
||||
<td style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
{item.CustName || '—'}
|
||||
</td>
|
||||
<td style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
{item.CustMobile || '—'}
|
||||
</td>
|
||||
{/* <td style={{ border: "1px solid #ddd", padding: "8px" }}>
|
||||
{item.BookedBy || "—"}
|
||||
</td> */}
|
||||
<td style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
{item.PaymentTypeName || '—'}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
padding: '8px',
|
||||
fontWeight: '600',
|
||||
color: '#2e7d32',
|
||||
backgroundColor: '#eaf6ea',
|
||||
}}
|
||||
>
|
||||
₹{item.Amount?.toLocaleString()}
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
) : (
|
||||
<tr>
|
||||
<td
|
||||
colSpan="7"
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
padding: '12px',
|
||||
border: '1px solid #ddd',
|
||||
color: '#888',
|
||||
}}
|
||||
>
|
||||
No booking data available
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{/* Pagination */}
|
||||
{totalPages > 1 && (
|
||||
<div
|
||||
style={{
|
||||
marginTop: '12px',
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
gap: '8px',
|
||||
}}
|
||||
>
|
||||
{currentPage == 1 ? (
|
||||
''
|
||||
) : (
|
||||
<button
|
||||
onClick={() => setCurrentPage((p) => Math.max(p - 1, 1))}
|
||||
disabled={currentPage === 1}
|
||||
style={{
|
||||
padding: '5px 10px',
|
||||
backgroundColor: '#003366',
|
||||
color: '#fff',
|
||||
border: 'none',
|
||||
borderRadius: '4px',
|
||||
cursor: currentPage === 1 ? 'not-allowed' : 'pointer',
|
||||
opacity: currentPage === 1 ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
Prev
|
||||
</button>
|
||||
)}
|
||||
|
||||
<span style={{ fontWeight: '600' }}>
|
||||
Page {currentPage} of {totalPages}
|
||||
</span>
|
||||
|
||||
<button
|
||||
onClick={() =>
|
||||
setCurrentPage((p) => Math.min(p + 1, totalPages))
|
||||
}
|
||||
disabled={currentPage === totalPages}
|
||||
style={{
|
||||
padding: '5px 10px',
|
||||
backgroundColor: '#003366',
|
||||
color: '#fff',
|
||||
border: 'none',
|
||||
borderRadius: '4px',
|
||||
cursor:
|
||||
currentPage === totalPages ? 'not-allowed' : 'pointer',
|
||||
opacity: currentPage === totalPages ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</DefaultModal>
|
||||
)
|
||||
}
|
||||
|
||||
const SalesNetAmountModal = ({
|
||||
isNetAmtModalOpen = false,
|
||||
setIsNetAmtModalOpen = () => { },
|
||||
orderDetails = []
|
||||
}) => {
|
||||
return (
|
||||
<DefaultModal
|
||||
open={isNetAmtModalOpen}
|
||||
title="Sales Net Amount"
|
||||
handleCancel={() => setIsNetAmtModalOpen(false)}
|
||||
handleSubmit={() => setIsNetAmtModalOpen(false)}
|
||||
width={800}
|
||||
footer={false}
|
||||
>
|
||||
<div style={{ overflowX: 'auto' }}>
|
||||
<table
|
||||
style={{
|
||||
width: '100%',
|
||||
borderCollapse: 'collapse',
|
||||
textAlign: 'center',
|
||||
fontFamily: "'Segoe UI', Roboto, sans-serif",
|
||||
fontSize: '14px',
|
||||
borderRadius: '8px',
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
||||
}}
|
||||
className='SCTableInPageSales'
|
||||
>
|
||||
<thead>
|
||||
<tr style={{ backgroundColor: '#2c88ee', color: '#fff' }}>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Cash
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
UPI
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Card
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Credit
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Business UPI
|
||||
</th>
|
||||
<th
|
||||
rowSpan="2"
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
padding: '10px',
|
||||
backgroundColor: '#055ec0',
|
||||
color: '#fff',
|
||||
}}
|
||||
>
|
||||
Total
|
||||
</th>
|
||||
</tr>
|
||||
<tr style={{ backgroundColor: '#2c88ee', color: '#fff' }}>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{orderDetails?.map((item, index) => {
|
||||
const total =
|
||||
(item.CashAmount || 0) +
|
||||
(item.UpiAmount || 0) +
|
||||
(item.CardAmount || 0) +
|
||||
(item.CreditAmount || 0);
|
||||
|
||||
return (
|
||||
<tr
|
||||
key={index}
|
||||
style={{
|
||||
backgroundColor: index % 2 === 0 ? '#f7faff' : '#ffffff',
|
||||
transition: 'background 0.3s',
|
||||
}}
|
||||
onMouseEnter={(e) =>
|
||||
(e.currentTarget.style.backgroundColor = '#e6f2ff')
|
||||
}
|
||||
onMouseLeave={(e) =>
|
||||
(e.currentTarget.style.backgroundColor =
|
||||
index % 2 === 0 ? '#f7faff' : '#ffffff')
|
||||
}
|
||||
>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CashCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CashAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.UpiCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.UpiAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CardCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CardAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CreditCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CreditAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.BusinessUpiCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.BusinessUpiAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
padding: '8px',
|
||||
fontWeight: '700',
|
||||
backgroundColor: '#eaf6ea',
|
||||
color: '#2e7d32',
|
||||
}}
|
||||
>
|
||||
{total}
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</DefaultModal>
|
||||
)
|
||||
}
|
||||
|
||||
export { SalesDetailsModal, SalesNetAmountModal };
|
||||
|
|
@ -56,6 +56,7 @@ const ShortcutKeyHelper = lazy(
|
|||
);
|
||||
// Scss
|
||||
import './SalesCountComponent.scss';
|
||||
import { SalesDetailsModal, SalesNetAmountModal } from '../Components/UtillComponents/SalesDetailsNetAmountModal.jsx';
|
||||
|
||||
const SalesCountComponent = React.memo(
|
||||
({ DineInAccess, GlobalsalesDetailData }) => {
|
||||
|
|
@ -664,422 +665,22 @@ const SalesCountComponent = React.memo(
|
|||
</p>
|
||||
{Customisebillno && <CustomisedInvoiceChange />}
|
||||
{/* Modal with table for multiple bookings */}
|
||||
<DefaultModal
|
||||
open={isModalOpen}
|
||||
title="Sales Details"
|
||||
handleCancel={() => setIsModalOpen(false)}
|
||||
handleSubmit={() => setIsModalOpen(false)}
|
||||
width={700}
|
||||
footer={false}
|
||||
>
|
||||
<div style={{ overflowX: 'auto' }}>
|
||||
<table
|
||||
style={{
|
||||
width: '100%',
|
||||
borderCollapse: 'collapse',
|
||||
fontFamily: "'Segoe UI', Roboto, sans-serif",
|
||||
fontSize: '14px',
|
||||
borderRadius: '8px',
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
||||
}}
|
||||
>
|
||||
<thead>
|
||||
<tr style={{ backgroundColor: '#003366', color: '#fff' }}>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
S.No
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Order ID
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Customer
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Mobile
|
||||
</th>
|
||||
{/* <th style={{ border: "1px solid #ddd", padding: "10px" }}>Booked By</th> */}
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Payment Type
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Amount (₹)
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{currentData?.length > 0 ? (
|
||||
currentData?.map((item, index) => (
|
||||
<tr
|
||||
key={item.OrderId}
|
||||
style={{
|
||||
backgroundColor:
|
||||
index % 2 === 0 ? '#f7faff' : '#e9f1ff',
|
||||
textAlign: 'center',
|
||||
transition: 'background 0.3s',
|
||||
}}
|
||||
onMouseEnter={(e) =>
|
||||
(e.currentTarget.style.backgroundColor = '#d6e4ff')
|
||||
}
|
||||
onMouseLeave={(e) =>
|
||||
(e.currentTarget.style.backgroundColor =
|
||||
index % 2 === 0 ? '#f7faff' : '#e9f1ff')
|
||||
}
|
||||
>
|
||||
<td
|
||||
style={{ border: '1px solid #ddd', padding: '8px' }}
|
||||
>
|
||||
{startIndex + index + 1}
|
||||
</td>
|
||||
<td
|
||||
style={{ border: '1px solid #ddd', padding: '8px' }}
|
||||
>
|
||||
{extractLastNumberOrderId(item.OrderId)}
|
||||
</td>
|
||||
<td
|
||||
style={{ border: '1px solid #ddd', padding: '8px' }}
|
||||
>
|
||||
{item.CustName || '—'}
|
||||
</td>
|
||||
<td
|
||||
style={{ border: '1px solid #ddd', padding: '8px' }}
|
||||
>
|
||||
{item.CustMobile || '—'}
|
||||
</td>
|
||||
{/* <td style={{ border: "1px solid #ddd", padding: "8px" }}>
|
||||
{item.BookedBy || "—"}
|
||||
</td> */}
|
||||
<td
|
||||
style={{ border: '1px solid #ddd', padding: '8px' }}
|
||||
>
|
||||
{item.PaymentTypeName || '—'}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
padding: '8px',
|
||||
fontWeight: '600',
|
||||
color: '#2e7d32',
|
||||
backgroundColor: '#eaf6ea',
|
||||
}}
|
||||
>
|
||||
₹{item.Amount?.toLocaleString()}
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
) : (
|
||||
<tr>
|
||||
<td
|
||||
colSpan="7"
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
padding: '12px',
|
||||
border: '1px solid #ddd',
|
||||
color: '#888',
|
||||
}}
|
||||
>
|
||||
No booking data available
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{/* Pagination */}
|
||||
{totalPages > 1 && (
|
||||
<div
|
||||
style={{
|
||||
marginTop: '12px',
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
gap: '8px',
|
||||
}}
|
||||
>
|
||||
{currentPage == 1 ? (
|
||||
''
|
||||
) : (
|
||||
<button
|
||||
onClick={() =>
|
||||
setCurrentPage((p) => Math.max(p - 1, 1))
|
||||
}
|
||||
disabled={currentPage === 1}
|
||||
style={{
|
||||
padding: '5px 10px',
|
||||
backgroundColor: '#003366',
|
||||
color: '#fff',
|
||||
border: 'none',
|
||||
borderRadius: '4px',
|
||||
cursor: currentPage === 1 ? 'not-allowed' : 'pointer',
|
||||
opacity: currentPage === 1 ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
Prev
|
||||
</button>
|
||||
)}
|
||||
|
||||
<span style={{ fontWeight: '600' }}>
|
||||
Page {currentPage} of {totalPages}
|
||||
</span>
|
||||
|
||||
<button
|
||||
onClick={() =>
|
||||
setCurrentPage((p) => Math.min(p + 1, totalPages))
|
||||
}
|
||||
disabled={currentPage === totalPages}
|
||||
style={{
|
||||
padding: '5px 10px',
|
||||
backgroundColor: '#003366',
|
||||
color: '#fff',
|
||||
border: 'none',
|
||||
borderRadius: '4px',
|
||||
cursor:
|
||||
currentPage === totalPages
|
||||
? 'not-allowed'
|
||||
: 'pointer',
|
||||
opacity: currentPage === totalPages ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</DefaultModal>
|
||||
<SalesDetailsModal
|
||||
isModalOpen={isModalOpen}
|
||||
setIsModalOpen={setIsModalOpen}
|
||||
currentData={currentData}
|
||||
currentPage={currentPage}
|
||||
totalPages={totalPages}
|
||||
setCurrentPage={setCurrentPage}
|
||||
startIndex={startIndex}
|
||||
/>
|
||||
|
||||
{/* Modal with table for multiple Net Amt */}
|
||||
<DefaultModal
|
||||
open={isNetAmtModalOpen}
|
||||
title="Sales Net Amount"
|
||||
handleCancel={() => setIsNetAmtModalOpen(false)}
|
||||
handleSubmit={() => setIsNetAmtModalOpen(false)}
|
||||
width={800}
|
||||
footer={false}
|
||||
>
|
||||
<div style={{ overflowX: 'auto' }}>
|
||||
<table
|
||||
style={{
|
||||
width: '100%',
|
||||
borderCollapse: 'collapse',
|
||||
textAlign: 'center',
|
||||
fontFamily: "'Segoe UI', Roboto, sans-serif",
|
||||
fontSize: '14px',
|
||||
borderRadius: '8px',
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
||||
}}
|
||||
>
|
||||
<thead>
|
||||
<tr style={{ backgroundColor: '#003366', color: '#fff' }}>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Cash
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
UPI
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Card
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Credit
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Business UPI
|
||||
</th>
|
||||
<th
|
||||
rowSpan="2"
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
padding: '10px',
|
||||
backgroundColor: '#002244',
|
||||
color: '#fff',
|
||||
}}
|
||||
>
|
||||
Total
|
||||
</th>
|
||||
</tr>
|
||||
<tr style={{ backgroundColor: '#004080', color: '#fff' }}>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{orderDetails?.map((item, index) => {
|
||||
const total =
|
||||
(item.CashAmount || 0) +
|
||||
(item.UpiAmount || 0) +
|
||||
(item.CardAmount || 0) +
|
||||
(item.CreditAmount || 0);
|
||||
|
||||
return (
|
||||
<tr
|
||||
key={index}
|
||||
style={{
|
||||
backgroundColor:
|
||||
index % 2 === 0 ? '#f7faff' : '#ffffff',
|
||||
transition: 'background 0.3s',
|
||||
}}
|
||||
onMouseEnter={(e) =>
|
||||
(e.currentTarget.style.backgroundColor = '#e6f2ff')
|
||||
}
|
||||
onMouseLeave={(e) =>
|
||||
(e.currentTarget.style.backgroundColor =
|
||||
index % 2 === 0 ? '#f7faff' : '#ffffff')
|
||||
}
|
||||
>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CashCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CashAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.UpiCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.UpiAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CardCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CardAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CreditCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CreditAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.BusinessUpiCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.BusinessUpiAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
padding: '8px',
|
||||
fontWeight: '700',
|
||||
backgroundColor: '#eaf6ea',
|
||||
color: '#2e7d32',
|
||||
}}
|
||||
>
|
||||
{total}
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</DefaultModal>
|
||||
<SalesNetAmountModal
|
||||
isNetAmtModalOpen={isNetAmtModalOpen}
|
||||
setIsNetAmtModalOpen={setIsNetAmtModalOpen}
|
||||
orderDetails={orderDetails}
|
||||
/>
|
||||
<Tooltip title="Receive Stock">
|
||||
{TableData?.length > 0 && AutoReceiveStock && (
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -87,6 +87,7 @@ const AllSalesPageSettings = lazy(
|
|||
import '../../../Styles/BookingScreen/Template/BSLayout2/BSLayout2.scss';
|
||||
import useWhyDidYouUpdate from '../../../Services/findrerender.js';
|
||||
import React from 'react';
|
||||
import { SalesDetailsModal, SalesNetAmountModal } from '../Components/UtillComponents/SalesDetailsNetAmountModal.jsx';
|
||||
|
||||
const SalesCountForStandard = React.memo(() => {
|
||||
const dispatch = useDispatch();
|
||||
|
|
@ -862,408 +863,23 @@ const SalesCountForStandard = React.memo(() => {
|
|||
|
||||
{/* Modal with table for multiple bookings */}
|
||||
|
||||
<DefaultModal
|
||||
open={isModalOpen}
|
||||
title="Sales Details"
|
||||
handleCancel={() => setIsModalOpen(false)}
|
||||
handleSubmit={() => setIsModalOpen(false)}
|
||||
width={700}
|
||||
footer={false}
|
||||
>
|
||||
<div style={{ overflowX: 'auto' }}>
|
||||
<table
|
||||
style={{
|
||||
width: '100%',
|
||||
borderCollapse: 'collapse',
|
||||
fontFamily: "'Segoe UI', Roboto, sans-serif",
|
||||
fontSize: '14px',
|
||||
borderRadius: '8px',
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
||||
}}
|
||||
>
|
||||
<thead>
|
||||
<tr style={{ backgroundColor: '#003366', color: '#fff' }}>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
S.No
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Order ID
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Customer
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Mobile
|
||||
</th>
|
||||
{/* <th style={{ border: "1px solid #ddd", padding: "10px" }}>Booked By</th> */}
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Payment Type
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '10px' }}>
|
||||
Amount (₹)
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{currentData?.length > 0 ? (
|
||||
currentData?.map((item, index) => (
|
||||
<tr
|
||||
key={item.OrderId}
|
||||
style={{
|
||||
backgroundColor: index % 2 === 0 ? '#f7faff' : '#e9f1ff',
|
||||
textAlign: 'center',
|
||||
transition: 'background 0.3s',
|
||||
}}
|
||||
onMouseEnter={(e) =>
|
||||
(e.currentTarget.style.backgroundColor = '#d6e4ff')
|
||||
}
|
||||
onMouseLeave={(e) =>
|
||||
(e.currentTarget.style.backgroundColor =
|
||||
index % 2 === 0 ? '#f7faff' : '#e9f1ff')
|
||||
}
|
||||
>
|
||||
<td style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
{startIndex + index + 1}
|
||||
</td>
|
||||
<td style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
{extractLastNumberOrderId(item.OrderId)}
|
||||
</td>
|
||||
<td style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
{item.CustName || '—'}
|
||||
</td>
|
||||
<td style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
{item.CustMobile || '—'}
|
||||
</td>
|
||||
{/* <td style={{ border: "1px solid #ddd", padding: "8px" }}>
|
||||
{item.BookedBy || "—"}
|
||||
</td> */}
|
||||
<td style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
{item.PaymentTypeName || '—'}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
padding: '8px',
|
||||
fontWeight: '600',
|
||||
color: '#2e7d32',
|
||||
backgroundColor: '#eaf6ea',
|
||||
}}
|
||||
>
|
||||
₹{item.Amount?.toLocaleString()}
|
||||
</td>
|
||||
</tr>
|
||||
))
|
||||
) : (
|
||||
<tr>
|
||||
<td
|
||||
colSpan="7"
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
padding: '12px',
|
||||
border: '1px solid #ddd',
|
||||
color: '#888',
|
||||
}}
|
||||
>
|
||||
No booking data available
|
||||
</td>
|
||||
</tr>
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{/* Pagination */}
|
||||
{totalPages > 1 && (
|
||||
<div
|
||||
style={{
|
||||
marginTop: '12px',
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
gap: '8px',
|
||||
}}
|
||||
>
|
||||
{currentPage == 1 ? (
|
||||
''
|
||||
) : (
|
||||
<button
|
||||
onClick={() => setCurrentPage((p) => Math.max(p - 1, 1))}
|
||||
disabled={currentPage === 1}
|
||||
style={{
|
||||
padding: '5px 10px',
|
||||
backgroundColor: '#003366',
|
||||
color: '#fff',
|
||||
border: 'none',
|
||||
borderRadius: '4px',
|
||||
cursor: currentPage === 1 ? 'not-allowed' : 'pointer',
|
||||
opacity: currentPage === 1 ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
Prev
|
||||
</button>
|
||||
)}
|
||||
|
||||
<span style={{ fontWeight: '600' }}>
|
||||
Page {currentPage} of {totalPages}
|
||||
</span>
|
||||
|
||||
<button
|
||||
onClick={() =>
|
||||
setCurrentPage((p) => Math.min(p + 1, totalPages))
|
||||
}
|
||||
disabled={currentPage === totalPages}
|
||||
style={{
|
||||
padding: '5px 10px',
|
||||
backgroundColor: '#003366',
|
||||
color: '#fff',
|
||||
border: 'none',
|
||||
borderRadius: '4px',
|
||||
cursor:
|
||||
currentPage === totalPages ? 'not-allowed' : 'pointer',
|
||||
opacity: currentPage === totalPages ? 0.5 : 1,
|
||||
}}
|
||||
>
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</DefaultModal>
|
||||
<SalesDetailsModal
|
||||
isModalOpen={isModalOpen}
|
||||
setIsModalOpen={setIsModalOpen}
|
||||
currentData={currentData}
|
||||
currentPage={currentPage}
|
||||
totalPages={totalPages}
|
||||
setCurrentPage={setCurrentPage}
|
||||
startIndex={startIndex}
|
||||
/>
|
||||
|
||||
{/* Modal with table for multiple Net Amt */}
|
||||
|
||||
<DefaultModal
|
||||
open={isNetAmtModalOpen}
|
||||
title="Sales Net Amount"
|
||||
handleCancel={() => setIsNetAmtModalOpen(false)}
|
||||
handleSubmit={() => setIsNetAmtModalOpen(false)}
|
||||
width={800}
|
||||
footer={false}
|
||||
>
|
||||
<div style={{ overflowX: 'auto' }}>
|
||||
<table
|
||||
style={{
|
||||
width: '100%',
|
||||
borderCollapse: 'collapse',
|
||||
textAlign: 'center',
|
||||
fontFamily: "'Segoe UI', Roboto, sans-serif",
|
||||
fontSize: '14px',
|
||||
borderRadius: '8px',
|
||||
overflow: 'hidden',
|
||||
boxShadow: '0 2px 8px rgba(0,0,0,0.1)',
|
||||
}}
|
||||
className='SCTableInPageSales'
|
||||
>
|
||||
<thead>
|
||||
<tr style={{ backgroundColor: '#2c88ee', color: '#fff' }}>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Cash
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
UPI
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Card
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Credit
|
||||
</th>
|
||||
<th
|
||||
colSpan="2"
|
||||
style={{ border: '1px solid #ddd', padding: '10px' }}
|
||||
>
|
||||
Business UPI
|
||||
</th>
|
||||
<th
|
||||
rowSpan="2"
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
padding: '10px',
|
||||
backgroundColor: '#055ec0',
|
||||
color: '#fff',
|
||||
}}
|
||||
>
|
||||
Total
|
||||
</th>
|
||||
</tr>
|
||||
<tr style={{ backgroundColor: '#2c88ee', color: '#fff' }}>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Count
|
||||
</th>
|
||||
<th style={{ border: '1px solid #ddd', padding: '8px' }}>
|
||||
Amt
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{orderDetails?.map((item, index) => {
|
||||
const total =
|
||||
(item.CashAmount || 0) +
|
||||
(item.UpiAmount || 0) +
|
||||
(item.CardAmount || 0) +
|
||||
(item.CreditAmount || 0);
|
||||
|
||||
return (
|
||||
<tr
|
||||
key={index}
|
||||
style={{
|
||||
backgroundColor: index % 2 === 0 ? '#f7faff' : '#ffffff',
|
||||
transition: 'background 0.3s',
|
||||
}}
|
||||
onMouseEnter={(e) =>
|
||||
(e.currentTarget.style.backgroundColor = '#e6f2ff')
|
||||
}
|
||||
onMouseLeave={(e) =>
|
||||
(e.currentTarget.style.backgroundColor =
|
||||
index % 2 === 0 ? '#f7faff' : '#ffffff')
|
||||
}
|
||||
>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CashCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CashAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.UpiCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.UpiAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CardCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CardAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CreditCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.CreditAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.BusinessUpiCount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
fontWeight: '700',
|
||||
padding: '8px',
|
||||
}}
|
||||
>
|
||||
{item.BusinessUpiAmount}
|
||||
</td>
|
||||
<td
|
||||
style={{
|
||||
border: '1px solid #ddd',
|
||||
padding: '8px',
|
||||
fontWeight: '700',
|
||||
backgroundColor: '#eaf6ea',
|
||||
color: '#2e7d32',
|
||||
}}
|
||||
>
|
||||
{total}
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</DefaultModal>
|
||||
<SalesNetAmountModal
|
||||
isNetAmtModalOpen={isNetAmtModalOpen}
|
||||
setIsNetAmtModalOpen={setIsNetAmtModalOpen}
|
||||
orderDetails={orderDetails}
|
||||
/>
|
||||
|
||||
<ReceivedStocksModal
|
||||
open={isReceivedModelOpen}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ const AddAllProductsButton = ({
|
|||
MRP: ProductData1.MRP,
|
||||
ProdName: ProductData1.ProdName,
|
||||
UomName: ProductData1.UomName,
|
||||
Size: ProductData1.Size,
|
||||
SellPrice: ProductData1.SellPrice,
|
||||
StockAvailable: ProductData1.StockAvailable,
|
||||
OnePcsAvailable: ProductData1.OnePcsAvailable,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import {
|
|||
ArrowRightOutlined,
|
||||
PlusCircleOutlined,
|
||||
SearchOutlined,
|
||||
SortAscendingOutlined,
|
||||
SortDescendingOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import {
|
||||
Form,
|
||||
|
|
@ -230,6 +232,7 @@ const StockForm = ({ formType }) => {
|
|||
const [SelectedPurchaseType, setSelectedPurchaseType] = useState(null);
|
||||
const [SelectedPurcTaxType, setSelectedPurcTaxType] = useState(null);
|
||||
const [PurchaseData, setPurchaseData] = useState([]);
|
||||
console.log(PurchaseData, "PurchaseData")
|
||||
const [additionalInfoModal, setAdditionalInfoModal] = useState(false);
|
||||
const [selectedRowIndex, setSelectedRowIndex] = useState(null);
|
||||
const [selectedRowRecord, setSelectedRowRecord] = useState({});
|
||||
|
|
@ -280,6 +283,7 @@ const StockForm = ({ formType }) => {
|
|||
const [searchValue, setSearchValue] = useState('');
|
||||
const isSearching = Boolean(searchValue?.trim());
|
||||
const [showAllSuppliers, setShowAllSuppliers] = useState(false);
|
||||
const [nameSortOrder, setNameSortOrder] = useState(null);
|
||||
|
||||
const SelInvoiceAmount = useMemo(() => {
|
||||
const total = PurchaseData?.reduce(
|
||||
|
|
@ -1137,6 +1141,7 @@ const StockForm = ({ formType }) => {
|
|||
extractedItem,
|
||||
existingProducts
|
||||
) => {
|
||||
|
||||
setProductSearchText('');
|
||||
setSelectedProductName(option?.label ? option?.label : '');
|
||||
formRef?.current?.resetFields(['VarProdId']);
|
||||
|
|
@ -1172,6 +1177,7 @@ const StockForm = ({ formType }) => {
|
|||
MRP: ProductData1?.MRP,
|
||||
ProdName: ProductData1?.ProdName,
|
||||
UomName: ProductData1?.UomName,
|
||||
Size: ProductData1?.Size,
|
||||
SellPrice: ProductData1?.SellPrice,
|
||||
StockAvailable: ProductData1?.StockAvailable,
|
||||
OnePcsAvailable: ProductData1?.OnePcsAvailable,
|
||||
|
|
@ -1253,6 +1259,7 @@ const StockForm = ({ formType }) => {
|
|||
ProdName: product.ProdName,
|
||||
ProdVariantName: product.ProdVariantName,
|
||||
UomName: product.UomName,
|
||||
Size: product.Size,
|
||||
MRP: product.MRP,
|
||||
SellPrice: product.SellPrice,
|
||||
OnePcsPrice: product.OnePcsPrice,
|
||||
|
|
@ -1547,6 +1554,23 @@ const StockForm = ({ formType }) => {
|
|||
[`${key}${localId}`]: value,
|
||||
});
|
||||
};
|
||||
|
||||
const handleNameSort = () => {
|
||||
const newOrder = nameSortOrder === 'asc' ? 'desc' : 'asc';
|
||||
|
||||
const sorted = [...PurchaseData].sort((a, b) => {
|
||||
const nameA = a.ProdName?.trim() || '';
|
||||
const nameB = b.ProdName?.trim() || '';
|
||||
|
||||
return newOrder === 'asc'
|
||||
? nameA.localeCompare(nameB)
|
||||
: nameB.localeCompare(nameA);
|
||||
});
|
||||
|
||||
setPurchaseData(sorted);
|
||||
setNameSortOrder(newOrder);
|
||||
};
|
||||
|
||||
const columns = useMemo(() => {
|
||||
const baseColumns = [
|
||||
{
|
||||
|
|
@ -1559,7 +1583,33 @@ const StockForm = ({ formType }) => {
|
|||
),
|
||||
},
|
||||
{
|
||||
title: 'Name',
|
||||
title: (
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
gap: '4px',
|
||||
justifyContent: 'space-between'
|
||||
}}
|
||||
>
|
||||
Name
|
||||
<Tooltip
|
||||
title={nameSortOrder === 'asc' ? 'Sort Descending' : 'Sort Ascending'}
|
||||
>
|
||||
{nameSortOrder === 'asc' ? (
|
||||
<SortAscendingOutlined
|
||||
style={{ cursor: 'pointer', fontSize: '14px' }}
|
||||
onClick={handleNameSort}
|
||||
/>
|
||||
) : (
|
||||
<SortDescendingOutlined
|
||||
style={{ cursor: 'pointer', fontSize: '14px' }}
|
||||
onClick={handleNameSort}
|
||||
/>
|
||||
)}
|
||||
</Tooltip>
|
||||
</div>
|
||||
),
|
||||
dataIndex: 'ProdName',
|
||||
key: 'ProdName',
|
||||
align: 'left',
|
||||
|
|
@ -1584,6 +1634,9 @@ const StockForm = ({ formType }) => {
|
|||
key: 'UOMName',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
render: (text, record, index) => (
|
||||
<a style={{ color: 'black' }}>{record?.Size + ' ' + record?.UomName}</a>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: 'Qty',
|
||||
|
|
@ -2144,7 +2197,7 @@ const StockForm = ({ formType }) => {
|
|||
},
|
||||
];
|
||||
return baseColumns;
|
||||
}, [editingKey, editingQty, selectedAdditionalColumn]);
|
||||
}, [editingKey, editingQty, selectedAdditionalColumn, PurchaseData]);
|
||||
|
||||
const statusFormatters = (record) => {
|
||||
const localId = record?.localId;
|
||||
|
|
@ -2674,7 +2727,7 @@ const StockForm = ({ formType }) => {
|
|||
// ===============================
|
||||
if (invalidRowNumbers.length > 0) {
|
||||
Modal.confirm({
|
||||
title: '⚠️ Incomplete Product Rows',
|
||||
title: 'Incomplete Product Rows',
|
||||
width: 520,
|
||||
centered: true,
|
||||
content: (
|
||||
|
|
@ -2891,6 +2944,7 @@ const StockForm = ({ formType }) => {
|
|||
};
|
||||
|
||||
const handleInvoiceSelect = async (value) => {
|
||||
|
||||
if (value === selectedInvoice) return;
|
||||
|
||||
const invoiceParts = value?.split('-');
|
||||
|
|
@ -2955,6 +3009,7 @@ const StockForm = ({ formType }) => {
|
|||
MRP: orderedProduct?.MRP,
|
||||
ProdName: orderedProduct?.ProdName,
|
||||
UomName: orderedProduct?.UomName,
|
||||
Size: orderedProduct?.Size,
|
||||
SellPrice: orderedProduct?.SellPrice,
|
||||
StockAvailable: orderedProduct?.StockAvailable,
|
||||
OnePcsAvailable: orderedProduct?.OnePcsAvailable,
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ const StockInhand = () => {
|
|||
<th>Sl.No</th>
|
||||
<th>Name</th>
|
||||
<th>Variant</th>
|
||||
<th>Qty</th>
|
||||
<th>Balance Qty</th>
|
||||
<th>Batch</th>
|
||||
<th>Barcode</th>
|
||||
<th>IMEI 1</th>
|
||||
|
|
|
|||
|
|
@ -159,6 +159,7 @@
|
|||
color: var(--SELECTED_COLOR);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.BSBillingNav-icon-table-inner {
|
||||
height: 35px;
|
||||
width: 23px;
|
||||
|
|
@ -295,7 +296,7 @@
|
|||
font-size: 25px;
|
||||
}
|
||||
|
||||
.BSC1Payment-Tablediv .ant-table-wrapper .ant-table-thead > tr > th {
|
||||
.BSC1Payment-Tablediv .ant-table-wrapper .ant-table-thead>tr>th {
|
||||
color: rgb(255, 255, 255) !important;
|
||||
font-weight: 600 !important;
|
||||
font-size: 14px;
|
||||
|
|
@ -378,6 +379,8 @@
|
|||
padding: 4px;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.EstPopupContent {
|
||||
|
|
@ -400,8 +403,10 @@
|
|||
.barcode-container {
|
||||
width: 90vw;
|
||||
display: flex;
|
||||
justify-content: center; /* Center horizontally */
|
||||
align-items: center; /* Center vertically */
|
||||
justify-content: center;
|
||||
/* Center horizontally */
|
||||
align-items: center;
|
||||
/* Center vertically */
|
||||
padding: 12px;
|
||||
height: 200px;
|
||||
background-color: #f9f9f9;
|
||||
|
|
@ -411,14 +416,18 @@
|
|||
cursor: pointer;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.barcode-icon1 {
|
||||
// width: 90vw;
|
||||
font-size: 100px; /* size of the icon */
|
||||
color: #52c41a; /* blue color */
|
||||
font-size: 100px;
|
||||
/* size of the icon */
|
||||
color: #52c41a;
|
||||
/* blue color */
|
||||
transition:
|
||||
transform 0.2s ease,
|
||||
color 0.2s ease;
|
||||
}
|
||||
|
||||
////
|
||||
.search-container-code {
|
||||
display: flex;
|
||||
|
|
|
|||
Loading…
Reference in New Issue