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
|
// Scss
|
||||||
import './SalesCountComponent.scss';
|
import './SalesCountComponent.scss';
|
||||||
|
import { SalesDetailsModal, SalesNetAmountModal } from '../Components/UtillComponents/SalesDetailsNetAmountModal.jsx';
|
||||||
|
|
||||||
const SalesCountComponent = React.memo(
|
const SalesCountComponent = React.memo(
|
||||||
({ DineInAccess, GlobalsalesDetailData }) => {
|
({ DineInAccess, GlobalsalesDetailData }) => {
|
||||||
|
|
@ -540,9 +541,9 @@ const SalesCountComponent = React.memo(
|
||||||
<div>
|
<div>
|
||||||
{safeRound(
|
{safeRound(
|
||||||
TakeAwayAmount +
|
TakeAwayAmount +
|
||||||
SelfTakeAwayAmount +
|
SelfTakeAwayAmount +
|
||||||
PreOrderAmount -
|
PreOrderAmount -
|
||||||
OverAllTakeAwayOfferAmount
|
OverAllTakeAwayOfferAmount
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -615,8 +616,8 @@ const SalesCountComponent = React.memo(
|
||||||
<div>
|
<div>
|
||||||
{safeRound(
|
{safeRound(
|
||||||
DineInAmount +
|
DineInAmount +
|
||||||
SelfDineInAmount -
|
SelfDineInAmount -
|
||||||
OverAllDineInOfferAmount
|
OverAllDineInOfferAmount
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -628,8 +629,8 @@ const SalesCountComponent = React.memo(
|
||||||
<span>
|
<span>
|
||||||
{safeRound(
|
{safeRound(
|
||||||
DineInAmount +
|
DineInAmount +
|
||||||
SelfDineInAmount -
|
SelfDineInAmount -
|
||||||
OverAllDineInOfferAmount
|
OverAllDineInOfferAmount
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -647,7 +648,7 @@ const SalesCountComponent = React.memo(
|
||||||
SelfTakeAwayAmount +
|
SelfTakeAwayAmount +
|
||||||
PreOrderAmount -
|
PreOrderAmount -
|
||||||
OverAllTakeAwayOfferAmount || 0) +
|
OverAllTakeAwayOfferAmount || 0) +
|
||||||
(DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount)
|
(DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount)
|
||||||
) > 0 && setIsNetAmtModalOpen(true)
|
) > 0 && setIsNetAmtModalOpen(true)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|
@ -658,428 +659,28 @@ const SalesCountComponent = React.memo(
|
||||||
SelfTakeAwayAmount +
|
SelfTakeAwayAmount +
|
||||||
PreOrderAmount -
|
PreOrderAmount -
|
||||||
OverAllTakeAwayOfferAmount || 0) +
|
OverAllTakeAwayOfferAmount || 0) +
|
||||||
(DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount)
|
(DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount)
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
{Customisebillno && <CustomisedInvoiceChange />}
|
{Customisebillno && <CustomisedInvoiceChange />}
|
||||||
{/* Modal with table for multiple bookings */}
|
{/* Modal with table for multiple bookings */}
|
||||||
<DefaultModal
|
<SalesDetailsModal
|
||||||
open={isModalOpen}
|
isModalOpen={isModalOpen}
|
||||||
title="Sales Details"
|
setIsModalOpen={setIsModalOpen}
|
||||||
handleCancel={() => setIsModalOpen(false)}
|
currentData={currentData}
|
||||||
handleSubmit={() => setIsModalOpen(false)}
|
currentPage={currentPage}
|
||||||
width={700}
|
totalPages={totalPages}
|
||||||
footer={false}
|
setCurrentPage={setCurrentPage}
|
||||||
>
|
startIndex={startIndex}
|
||||||
<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>
|
|
||||||
|
|
||||||
{/* Modal with table for multiple Net Amt */}
|
{/* Modal with table for multiple Net Amt */}
|
||||||
<DefaultModal
|
<SalesNetAmountModal
|
||||||
open={isNetAmtModalOpen}
|
isNetAmtModalOpen={isNetAmtModalOpen}
|
||||||
title="Sales Net Amount"
|
setIsNetAmtModalOpen={setIsNetAmtModalOpen}
|
||||||
handleCancel={() => setIsNetAmtModalOpen(false)}
|
orderDetails={orderDetails}
|
||||||
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>
|
|
||||||
<Tooltip title="Receive Stock">
|
<Tooltip title="Receive Stock">
|
||||||
{TableData?.length > 0 && AutoReceiveStock && (
|
{TableData?.length > 0 && AutoReceiveStock && (
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ const AllSalesPageSettings = lazy(
|
||||||
import '../../../Styles/BookingScreen/Template/BSLayout2/BSLayout2.scss';
|
import '../../../Styles/BookingScreen/Template/BSLayout2/BSLayout2.scss';
|
||||||
import useWhyDidYouUpdate from '../../../Services/findrerender.js';
|
import useWhyDidYouUpdate from '../../../Services/findrerender.js';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { SalesDetailsModal, SalesNetAmountModal } from '../Components/UtillComponents/SalesDetailsNetAmountModal.jsx';
|
||||||
|
|
||||||
const SalesCountForStandard = React.memo(() => {
|
const SalesCountForStandard = React.memo(() => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
@ -483,10 +484,10 @@ const SalesCountForStandard = React.memo(() => {
|
||||||
return (
|
return (
|
||||||
DineInAccess?.SettingValue === 'Y' &&
|
DineInAccess?.SettingValue === 'Y' &&
|
||||||
DineInOrderCount +
|
DineInOrderCount +
|
||||||
TakeAwayOrderCount +
|
TakeAwayOrderCount +
|
||||||
SelfTakeAwayOrderCount +
|
SelfTakeAwayOrderCount +
|
||||||
SelfDineInOrderCount >
|
SelfDineInOrderCount >
|
||||||
0 &&
|
0 &&
|
||||||
(takeAwayPreference || dinePreference)
|
(takeAwayPreference || dinePreference)
|
||||||
);
|
);
|
||||||
}, [DineInAccess, sales, dinePreference, takeAwayPreference]);
|
}, [DineInAccess, sales, dinePreference, takeAwayPreference]);
|
||||||
|
|
@ -643,7 +644,7 @@ const SalesCountForStandard = React.memo(() => {
|
||||||
{DineInAccess?.SettingValue === 'Y' &&
|
{DineInAccess?.SettingValue === 'Y' &&
|
||||||
takeAwayPreference &&
|
takeAwayPreference &&
|
||||||
(TakeAwayOrderCount || SelfTakeAwayOrderCount || PreOrderAmount) >
|
(TakeAwayOrderCount || SelfTakeAwayOrderCount || PreOrderAmount) >
|
||||||
0 && (
|
0 && (
|
||||||
<Tooltip
|
<Tooltip
|
||||||
className="standardTooltipDineIN"
|
className="standardTooltipDineIN"
|
||||||
title={renderBreakdown([
|
title={renderBreakdown([
|
||||||
|
|
@ -862,408 +863,23 @@ const SalesCountForStandard = React.memo(() => {
|
||||||
|
|
||||||
{/* Modal with table for multiple bookings */}
|
{/* Modal with table for multiple bookings */}
|
||||||
|
|
||||||
<DefaultModal
|
<SalesDetailsModal
|
||||||
open={isModalOpen}
|
isModalOpen={isModalOpen}
|
||||||
title="Sales Details"
|
setIsModalOpen={setIsModalOpen}
|
||||||
handleCancel={() => setIsModalOpen(false)}
|
currentData={currentData}
|
||||||
handleSubmit={() => setIsModalOpen(false)}
|
currentPage={currentPage}
|
||||||
width={700}
|
totalPages={totalPages}
|
||||||
footer={false}
|
setCurrentPage={setCurrentPage}
|
||||||
>
|
startIndex={startIndex}
|
||||||
<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>
|
|
||||||
|
|
||||||
{/* Modal with table for multiple Net Amt */}
|
{/* Modal with table for multiple Net Amt */}
|
||||||
|
|
||||||
<DefaultModal
|
<SalesNetAmountModal
|
||||||
open={isNetAmtModalOpen}
|
isNetAmtModalOpen={isNetAmtModalOpen}
|
||||||
title="Sales Net Amount"
|
setIsNetAmtModalOpen={setIsNetAmtModalOpen}
|
||||||
handleCancel={() => setIsNetAmtModalOpen(false)}
|
orderDetails={orderDetails}
|
||||||
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>
|
|
||||||
|
|
||||||
<ReceivedStocksModal
|
<ReceivedStocksModal
|
||||||
open={isReceivedModelOpen}
|
open={isReceivedModelOpen}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ const AddAllProductsButton = ({
|
||||||
}) => {
|
}) => {
|
||||||
// This function just returns a prepared product object, no state changes
|
// This function just returns a prepared product object, no state changes
|
||||||
|
|
||||||
const [messageType, setMessageType] = useState(null);
|
const [messageType, setMessageType] = useState(null);
|
||||||
const [messageData, setMessageData] = useState(null);
|
const [messageData, setMessageData] = useState(null);
|
||||||
|
|
||||||
const ProductDropDownChange = async (
|
const ProductDropDownChange = async (
|
||||||
VariantName,
|
VariantName,
|
||||||
|
|
@ -51,6 +51,7 @@ const AddAllProductsButton = ({
|
||||||
MRP: ProductData1.MRP,
|
MRP: ProductData1.MRP,
|
||||||
ProdName: ProductData1.ProdName,
|
ProdName: ProductData1.ProdName,
|
||||||
UomName: ProductData1.UomName,
|
UomName: ProductData1.UomName,
|
||||||
|
Size: ProductData1.Size,
|
||||||
SellPrice: ProductData1.SellPrice,
|
SellPrice: ProductData1.SellPrice,
|
||||||
StockAvailable: ProductData1.StockAvailable,
|
StockAvailable: ProductData1.StockAvailable,
|
||||||
OnePcsAvailable: ProductData1.OnePcsAvailable,
|
OnePcsAvailable: ProductData1.OnePcsAvailable,
|
||||||
|
|
@ -89,7 +90,7 @@ const AddAllProductsButton = ({
|
||||||
|
|
||||||
if (productsToAdd.length === 0) {
|
if (productsToAdd.length === 0) {
|
||||||
setMessageData('All products are already added');
|
setMessageData('All products are already added');
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -149,18 +150,18 @@ const AddAllProductsButton = ({
|
||||||
setLoadingText('');
|
setLoadingText('');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const onComplete = useCallback(() => {
|
const onComplete = useCallback(() => {
|
||||||
setMessageData(null);
|
setMessageData(null);
|
||||||
setMessageType(null);
|
setMessageType(null);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip title="Add All Products" placement="top">
|
<Tooltip title="Add All Products" placement="top">
|
||||||
<Messages
|
<Messages
|
||||||
messageType={messageType}
|
messageType={messageType}
|
||||||
messageData={messageData}
|
messageData={messageData}
|
||||||
onComplete={onComplete}
|
onComplete={onComplete}
|
||||||
/>
|
/>
|
||||||
<button type="button" className="addallProductTBN" onClick={handleAddAll}>
|
<button type="button" className="addallProductTBN" onClick={handleAddAll}>
|
||||||
Add All
|
Add All
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -502,7 +502,7 @@ const StockInhand = () => {
|
||||||
<th>Sl.No</th>
|
<th>Sl.No</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Variant</th>
|
<th>Variant</th>
|
||||||
<th>Qty</th>
|
<th>Balance Qty</th>
|
||||||
<th>Batch</th>
|
<th>Batch</th>
|
||||||
<th>Barcode</th>
|
<th>Barcode</th>
|
||||||
<th>IMEI 1</th>
|
<th>IMEI 1</th>
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,7 @@
|
||||||
color: var(--SELECTED_COLOR);
|
color: var(--SELECTED_COLOR);
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.BSBillingNav-icon-table-inner {
|
.BSBillingNav-icon-table-inner {
|
||||||
height: 35px;
|
height: 35px;
|
||||||
width: 23px;
|
width: 23px;
|
||||||
|
|
@ -295,7 +296,7 @@
|
||||||
font-size: 25px;
|
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;
|
color: rgb(255, 255, 255) !important;
|
||||||
font-weight: 600 !important;
|
font-weight: 600 !important;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
|
|
@ -378,6 +379,8 @@
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
font-family: 'Poppins', sans-serif;
|
||||||
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.EstPopupContent {
|
.EstPopupContent {
|
||||||
|
|
@ -400,8 +403,10 @@
|
||||||
.barcode-container {
|
.barcode-container {
|
||||||
width: 90vw;
|
width: 90vw;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center; /* Center horizontally */
|
justify-content: center;
|
||||||
align-items: center; /* Center vertically */
|
/* Center horizontally */
|
||||||
|
align-items: center;
|
||||||
|
/* Center vertically */
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
height: 200px;
|
height: 200px;
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
|
|
@ -411,14 +416,18 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background-color 0.3s ease;
|
transition: background-color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.barcode-icon1 {
|
.barcode-icon1 {
|
||||||
// width: 90vw;
|
// width: 90vw;
|
||||||
font-size: 100px; /* size of the icon */
|
font-size: 100px;
|
||||||
color: #52c41a; /* blue color */
|
/* size of the icon */
|
||||||
|
color: #52c41a;
|
||||||
|
/* blue color */
|
||||||
transition:
|
transition:
|
||||||
transform 0.2s ease,
|
transform 0.2s ease,
|
||||||
color 0.2s ease;
|
color 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
////
|
////
|
||||||
.search-container-code {
|
.search-container-code {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue