Merge pull request 'added sorting in product receipt name' (#187) from temp/added-sorter-product-receipt into main

Reviewed-on: Pozomind/pozo-retail-app#187
This commit is contained in:
karthikalakshmi 2026-02-26 14:47:58 +05:30
commit 6d848890a0
8 changed files with 1136 additions and 1422 deletions

View File

@ -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 };

View File

@ -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 }) => {
@ -540,9 +541,9 @@ const SalesCountComponent = React.memo(
<div>
{safeRound(
TakeAwayAmount +
SelfTakeAwayAmount +
PreOrderAmount -
OverAllTakeAwayOfferAmount
SelfTakeAwayAmount +
PreOrderAmount -
OverAllTakeAwayOfferAmount
)}
</div>
</div>
@ -615,8 +616,8 @@ const SalesCountComponent = React.memo(
<div>
{safeRound(
DineInAmount +
SelfDineInAmount -
OverAllDineInOfferAmount
SelfDineInAmount -
OverAllDineInOfferAmount
)}
</div>
</div>
@ -628,8 +629,8 @@ const SalesCountComponent = React.memo(
<span>
{safeRound(
DineInAmount +
SelfDineInAmount -
OverAllDineInOfferAmount
SelfDineInAmount -
OverAllDineInOfferAmount
)}
</span>
</p>
@ -647,7 +648,7 @@ const SalesCountComponent = React.memo(
SelfTakeAwayAmount +
PreOrderAmount -
OverAllTakeAwayOfferAmount || 0) +
(DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount)
(DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount)
) > 0 && setIsNetAmtModalOpen(true)
}
>
@ -658,428 +659,28 @@ const SalesCountComponent = React.memo(
SelfTakeAwayAmount +
PreOrderAmount -
OverAllTakeAwayOfferAmount || 0) +
(DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount)
(DineInAmount + SelfDineInAmount - OverAllDineInOfferAmount)
)}
</span>
</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

View File

@ -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();
@ -483,10 +484,10 @@ const SalesCountForStandard = React.memo(() => {
return (
DineInAccess?.SettingValue === 'Y' &&
DineInOrderCount +
TakeAwayOrderCount +
SelfTakeAwayOrderCount +
SelfDineInOrderCount >
0 &&
TakeAwayOrderCount +
SelfTakeAwayOrderCount +
SelfDineInOrderCount >
0 &&
(takeAwayPreference || dinePreference)
);
}, [DineInAccess, sales, dinePreference, takeAwayPreference]);
@ -643,7 +644,7 @@ const SalesCountForStandard = React.memo(() => {
{DineInAccess?.SettingValue === 'Y' &&
takeAwayPreference &&
(TakeAwayOrderCount || SelfTakeAwayOrderCount || PreOrderAmount) >
0 && (
0 && (
<Tooltip
className="standardTooltipDineIN"
title={renderBreakdown([
@ -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}

View File

@ -15,8 +15,8 @@ const AddAllProductsButton = ({
}) => {
// This function just returns a prepared product object, no state changes
const [messageType, setMessageType] = useState(null);
const [messageData, setMessageData] = useState(null);
const [messageType, setMessageType] = useState(null);
const [messageData, setMessageData] = useState(null);
const ProductDropDownChange = async (
VariantName,
@ -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,
@ -89,7 +90,7 @@ const AddAllProductsButton = ({
if (productsToAdd.length === 0) {
setMessageData('All products are already added');
setMessageType('warning');
setMessageType('warning');
return;
}
@ -149,18 +150,18 @@ const AddAllProductsButton = ({
setLoadingText('');
}
};
const onComplete = useCallback(() => {
setMessageData(null);
setMessageType(null);
}, []);
const onComplete = useCallback(() => {
setMessageData(null);
setMessageType(null);
}, []);
return (
<Tooltip title="Add All Products" placement="top">
<Messages
messageType={messageType}
messageData={messageData}
onComplete={onComplete}
/>
<Messages
messageType={messageType}
messageData={messageData}
onComplete={onComplete}
/>
<button type="button" className="addallProductTBN" onClick={handleAddAll}>
Add All
</button>

View File

@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Tooltip } from '@mui/material';
import { Tooltip } from 'antd';
import { IoSettingsOutline } from 'react-icons/io5';
import { DefaultModal } from '../../Components/Modal/DefaultModal.jsx';
@ -45,9 +45,9 @@ const SettingsIconWithModal = ({
return (
<>
{/* ⚙️ ICON ONLY */}
<Tooltip title={tooltipTitle} placement="left">
<Tooltip title={tooltipTitle} placement="top">
<IoSettingsOutline
style={{ cursor: 'pointer', fontSize: '20px' }}
style={{ cursor: 'pointer', fontSize: '15px' }}
onClick={handleIconClick}
/>
</Tooltip>

File diff suppressed because it is too large Load Diff

View File

@ -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>

View File

@ -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;