customer price history modal added
This commit is contained in:
parent
ea144ce81b
commit
1ef3aa23b4
|
|
@ -11,6 +11,30 @@ const formatDate = (date) => {
|
||||||
return `${year}-${month}-${day}`;
|
return `${year}-${month}-${day}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const formatDateShort = (dateStr) => {
|
||||||
|
if (!dateStr) return '';
|
||||||
|
const date = new Date(dateStr);
|
||||||
|
const day = String(date.getDate()).padStart(2, '0');
|
||||||
|
const month = date.toLocaleString('en-US', { month: 'short' });
|
||||||
|
const year = date.getFullYear();
|
||||||
|
return `${day} ${month} ${year}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const formatTime12 = (dateString = '') => {
|
||||||
|
if (!dateString) return '-';
|
||||||
|
|
||||||
|
const date = new Date(dateString);
|
||||||
|
if (isNaN(date)) return '-';
|
||||||
|
|
||||||
|
let hours = date.getHours();
|
||||||
|
const minutes = date.getMinutes().toString().padStart(2, '0');
|
||||||
|
const ampm = hours >= 12 ? 'PM' : 'AM';
|
||||||
|
|
||||||
|
hours = hours % 12 || 12;
|
||||||
|
|
||||||
|
return `${hours}:${minutes} ${ampm}`;
|
||||||
|
};
|
||||||
|
|
||||||
// Utility: get today's and tomorrow's date
|
// Utility: get today's and tomorrow's date
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const tomorrow = new Date();
|
const tomorrow = new Date();
|
||||||
|
|
@ -26,7 +50,7 @@ export const useDateStore = create((set) => ({
|
||||||
set({ selectedDate: formattedDates });
|
set({ selectedDate: formattedDates });
|
||||||
},
|
},
|
||||||
invoiceDate: formatDate(today), // single date instead of array
|
invoiceDate: formatDate(today), // single date instead of array
|
||||||
|
|
||||||
setInvoiceDate: (date) => {
|
setInvoiceDate: (date) => {
|
||||||
// Store as single date in YYYY-MM-DD format
|
// Store as single date in YYYY-MM-DD format
|
||||||
const formattedDate = formatDate(date);
|
const formattedDate = formatDate(date);
|
||||||
|
|
|
||||||
|
|
@ -57,3 +57,16 @@ export const delCust = createAsyncThunk('Cust/delcust', async (deleteData) => {
|
||||||
export const putCust = createAsyncThunk('putCust/putCust', async (putData) => {
|
export const putCust = createAsyncThunk('putCust/putCust', async (putData) => {
|
||||||
return await axiosRetailInstanceData.put(`/customer`, putData);
|
return await axiosRetailInstanceData.put(`/customer`, putData);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const getCustomerProductPriceHistory = createAsyncThunk('GET/getCustomerProductPriceHistory', async (data) => {
|
||||||
|
const { AppId, CompId, BranchId, CustId, ProdId } = data;
|
||||||
|
|
||||||
|
if (CustId != null && CustId != undefined && ProdId != null &&
|
||||||
|
ProdId != undefined && AppId != null && AppId != undefined &&
|
||||||
|
CompId != null && CompId != undefined && BranchId != null &&
|
||||||
|
BranchId != undefined) {
|
||||||
|
|
||||||
|
return await axiosRetailInstanceData.get(`/CustomerLastProdRate?CustId=${CustId}&ProdId=${ProdId}&AppId=${AppId}&CompId=${CompId}&BranchId=${BranchId}`);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -69,11 +69,14 @@ import {
|
||||||
changeSelProdWiseEst,
|
changeSelProdWiseEst,
|
||||||
GlobalOtherSevices,
|
GlobalOtherSevices,
|
||||||
GlobalDefaultBookingType,
|
GlobalDefaultBookingType,
|
||||||
|
GlobalSelOption,
|
||||||
|
GlobalCustId,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import BSEditTotalAmt from '../BSEditTotalAmount/BSEditTotalAmt.jsx';
|
import BSEditTotalAmt from '../BSEditTotalAmount/BSEditTotalAmt.jsx';
|
||||||
import BSImeiDetails from '../BSImeiDetails/BSImeiDetails.jsx';
|
import BSImeiDetails from '../BSImeiDetails/BSImeiDetails.jsx';
|
||||||
import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.scss';
|
import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.scss';
|
||||||
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
||||||
|
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
||||||
|
|
||||||
const BSBillingTable1 = () => {
|
const BSBillingTable1 = () => {
|
||||||
const { removeExtraCharge } = useUtilsComponent();
|
const { removeExtraCharge } = useUtilsComponent();
|
||||||
|
|
@ -131,6 +134,11 @@ const BSBillingTable1 = () => {
|
||||||
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
||||||
|
|
||||||
const OtherServicesglobal = useSelector(GlobalOtherSevices);
|
const OtherServicesglobal = useSelector(GlobalOtherSevices);
|
||||||
|
const GetCustId = useSelector(GlobalCustId);
|
||||||
|
const selectedCustomer = useSelector(GlobalSelOption);
|
||||||
|
|
||||||
|
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] = useState(false);
|
||||||
|
const [customerProduct, setCustomerProduct] = useState(null);
|
||||||
|
|
||||||
const tableDataDinein = tableData?.filter(
|
const tableDataDinein = tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'Dine In' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'Dine In' && !a?.SalesId
|
||||||
|
|
@ -139,8 +147,8 @@ const BSBillingTable1 = () => {
|
||||||
OrderType === 'Hold'
|
OrderType === 'Hold'
|
||||||
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
||||||
: tableData?.filter(
|
: tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
||||||
);
|
);
|
||||||
|
|
||||||
const OldtableDataDinein = tableData?.filter(
|
const OldtableDataDinein = tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
||||||
|
|
@ -148,8 +156,8 @@ const BSBillingTable1 = () => {
|
||||||
const OldtableDataTakeAway =
|
const OldtableDataTakeAway =
|
||||||
OrderType != 'Hold'
|
OrderType != 'Hold'
|
||||||
? tableData?.filter(
|
? tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
const [OpenEditTotalAmt, setOpenEditTotalAmt] = useState(false);
|
const [OpenEditTotalAmt, setOpenEditTotalAmt] = useState(false);
|
||||||
const [OpenImeiDetail, setOpenImeiDetail] = useState(false);
|
const [OpenImeiDetail, setOpenImeiDetail] = useState(false);
|
||||||
|
|
@ -174,6 +182,27 @@ const BSBillingTable1 = () => {
|
||||||
}
|
}
|
||||||
}, [SelectedFont]);
|
}, [SelectedFont]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleKeyDown = (e) => {
|
||||||
|
if (e.ctrlKey && e.key.toLowerCase() === 'i') {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const prodId = tableData?.[0]?.ProdId;
|
||||||
|
|
||||||
|
if (GetCustId && prodId) {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(prodId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
};
|
||||||
|
}, [GetCustId, tableData]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (tableData?.length === 0) {
|
if (tableData?.length === 0) {
|
||||||
dispatch(ClearOfferAppliedProducts());
|
dispatch(ClearOfferAppliedProducts());
|
||||||
|
|
@ -282,6 +311,10 @@ const BSBillingTable1 = () => {
|
||||||
|
|
||||||
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
||||||
}
|
}
|
||||||
|
const handleCustomerProductPriceHistory = (item) => {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(item?.ProdId);
|
||||||
|
}
|
||||||
|
|
||||||
const getstockbadge = async () => {
|
const getstockbadge = async () => {
|
||||||
let data = {
|
let data = {
|
||||||
|
|
@ -1059,9 +1092,9 @@ const BSBillingTable1 = () => {
|
||||||
)?.map((item, idx) =>
|
)?.map((item, idx) =>
|
||||||
idx === 0
|
idx === 0
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
FreeQty,
|
FreeQty,
|
||||||
}
|
}
|
||||||
: item
|
: item
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
@ -2216,7 +2249,7 @@ const BSBillingTable1 = () => {
|
||||||
OpenEditTotalAmount();
|
OpenEditTotalAmount();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
// onClick={tableData?.length>0? OpenEditTotalAmount :""}
|
// onClick={tableData?.length>0? OpenEditTotalAmount :""}
|
||||||
>
|
>
|
||||||
{!isMobile ? (
|
{!isMobile ? (
|
||||||
<Tooltip title="Quantity">Qty</Tooltip>
|
<Tooltip title="Quantity">Qty</Tooltip>
|
||||||
|
|
@ -2324,11 +2357,10 @@ const BSBillingTable1 = () => {
|
||||||
{OldtableDataTakeAway?.map((item, index) => (
|
{OldtableDataTakeAway?.map((item, index) => (
|
||||||
<tr
|
<tr
|
||||||
key={index}
|
key={index}
|
||||||
className={`${
|
className={`${item?.SalesId && OrderType !== 'Hold'
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
? 'Billing-Table1-row-disabled'
|
||||||
? 'Billing-Table1-row-disabled'
|
: 'Billing-Table1-row'
|
||||||
: 'Billing-Table1-row'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -2339,16 +2371,16 @@ const BSBillingTable1 = () => {
|
||||||
? item?.SalesId && OrderType !== 'Hold'
|
? item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: triggerAnimation &&
|
: triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: triggerAnimation &&
|
: triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
tableDataTakeAway?.length >=
|
tableDataTakeAway?.length >=
|
||||||
PreviousdataLength &&
|
PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
|
|
@ -2356,9 +2388,9 @@ const BSBillingTable1 = () => {
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: index % 2 === 0
|
: index % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2413,7 +2445,7 @@ const BSBillingTable1 = () => {
|
||||||
style={{ fontFamily: 'Poppins', textAlign: 'left' }}
|
style={{ fontFamily: 'Poppins', textAlign: 'left' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0
|
item.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item)
|
: editField && handleEditQuantity(item)
|
||||||
}
|
}
|
||||||
|
|
@ -2463,21 +2495,21 @@ const BSBillingTable1 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -2562,18 +2594,21 @@ const BSBillingTable1 = () => {
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{allowDecimal
|
||||||
? Number(
|
? Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
).toFixed(2)
|
).toFixed(2)
|
||||||
: Number(
|
: Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -2608,11 +2643,10 @@ const BSBillingTable1 = () => {
|
||||||
{OldtableDataDinein?.map((item, index) => (
|
{OldtableDataDinein?.map((item, index) => (
|
||||||
<tr
|
<tr
|
||||||
key={OldtableDataTakeAway?.length + index}
|
key={OldtableDataTakeAway?.length + index}
|
||||||
className={`${
|
className={`${item?.SalesId
|
||||||
item?.SalesId
|
? 'Billing-Table1-row-disabled'
|
||||||
? 'Billing-Table1-row-disabled'
|
: 'Billing-Table1-row'
|
||||||
: 'Billing-Table1-row'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -2623,27 +2657,27 @@ const BSBillingTable1 = () => {
|
||||||
? item?.SalesId
|
? item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
tableDataDinein?.length >=
|
tableDataDinein?.length >=
|
||||||
PreviousdataLength &&
|
PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background: item?.SalesId
|
background: item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2747,21 +2781,21 @@ const BSBillingTable1 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -2846,18 +2880,21 @@ const BSBillingTable1 = () => {
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{allowDecimal
|
||||||
? Number(
|
? Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
).toFixed(2)
|
).toFixed(2)
|
||||||
: Number(
|
: Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -2897,11 +2934,10 @@ const BSBillingTable1 = () => {
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index
|
index
|
||||||
}
|
}
|
||||||
className={`${
|
className={`${BookingType === 'Dine In' && item?.SalesId
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
? 'Billing-Table1-row-disabled'
|
||||||
? 'Billing-Table1-row-disabled'
|
: 'Billing-Table1-row'
|
||||||
: 'Billing-Table1-row'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -2912,43 +2948,43 @@ const BSBillingTable1 = () => {
|
||||||
? BookingType === 'Dine In' && item?.SalesId
|
? BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataTakeAway?.length >=
|
tableDataTakeAway?.length >=
|
||||||
PreviousdataLength &&
|
PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.[
|
: SelectedBillColor?.[
|
||||||
'OverallBackgroundColor'
|
'OverallBackgroundColor'
|
||||||
]
|
]
|
||||||
? SelectedBillColor?.[
|
? SelectedBillColor?.[
|
||||||
'OverallBackgroundColor'
|
'OverallBackgroundColor'
|
||||||
]
|
]
|
||||||
: '#d6d6d6'
|
: '#d6d6d6'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -2957,15 +2993,15 @@ const BSBillingTable1 = () => {
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -2974,9 +3010,9 @@ const BSBillingTable1 = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -3024,7 +3060,7 @@ const BSBillingTable1 = () => {
|
||||||
style={{ fontFamily: 'Poppins', textAlign: 'left' }}
|
style={{ fontFamily: 'Poppins', textAlign: 'left' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0
|
item.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item)
|
: editField && handleEditQuantity(item)
|
||||||
}
|
}
|
||||||
|
|
@ -3045,8 +3081,8 @@ const BSBillingTable1 = () => {
|
||||||
{!item?.ProdVariantName?.toLowerCase()?.includes(
|
{!item?.ProdVariantName?.toLowerCase()?.includes(
|
||||||
'variant'
|
'variant'
|
||||||
) && (
|
) && (
|
||||||
<span>{item?.ProdVariantName} </span>
|
<span>{item?.ProdVariantName} </span>
|
||||||
)}
|
)}
|
||||||
{item?.Size}
|
{item?.Size}
|
||||||
{item?.SinglePc == 'Y'
|
{item?.SinglePc == 'Y'
|
||||||
? 'PCS'
|
? 'PCS'
|
||||||
|
|
@ -3080,21 +3116,21 @@ const BSBillingTable1 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -3179,18 +3215,21 @@ const BSBillingTable1 = () => {
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{allowDecimal
|
||||||
? Number(
|
? Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
).toFixed(2)
|
).toFixed(2)
|
||||||
: Number(
|
: Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -3231,11 +3270,10 @@ const BSBillingTable1 = () => {
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index
|
index
|
||||||
}
|
}
|
||||||
className={`${
|
className={`${BookingType === 'Dine In' && item?.SalesId
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
? 'Billing-Table1-row-disabled'
|
||||||
? 'Billing-Table1-row-disabled'
|
: 'Billing-Table1-row'
|
||||||
: 'Billing-Table1-row'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -3248,45 +3286,45 @@ const BSBillingTable1 = () => {
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataDinein?.length >=
|
tableDataDinein?.length >=
|
||||||
PreviousdataLength &&
|
PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background:
|
background:
|
||||||
BookingType === 'Dine In' &&
|
BookingType === 'Dine In' &&
|
||||||
item?.SalesId &&
|
item?.SalesId &&
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length +
|
: (OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -3295,10 +3333,10 @@ const BSBillingTable1 = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -3396,21 +3434,21 @@ const BSBillingTable1 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -3495,18 +3533,21 @@ const BSBillingTable1 = () => {
|
||||||
textAlign: 'right',
|
textAlign: 'right',
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{allowDecimal
|
||||||
? Number(
|
? Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
).toFixed(2)
|
).toFixed(2)
|
||||||
: Number(
|
: Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -3551,6 +3592,16 @@ const BSBillingTable1 = () => {
|
||||||
ProductDetail={Modaldata}
|
ProductDetail={Modaldata}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{(customerPriceHistoryOpen && GetCustId) &&
|
||||||
|
<CustomerPriceHistory
|
||||||
|
open={customerPriceHistoryOpen}
|
||||||
|
custId={GetCustId}
|
||||||
|
setCustomerPriceHistoryOpen={setCustomerPriceHistoryOpen}
|
||||||
|
customerProduct={customerProduct}
|
||||||
|
setCustomerProduct={setCustomerProduct}
|
||||||
|
selectedCustomer={selectedCustomer}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -59,6 +59,8 @@ import {
|
||||||
changeSelProdWiseEst,
|
changeSelProdWiseEst,
|
||||||
GlobalOtherSevices,
|
GlobalOtherSevices,
|
||||||
GlobalDefaultBookingType,
|
GlobalDefaultBookingType,
|
||||||
|
GlobalSelOption,
|
||||||
|
GlobalCustId,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTables3/BSBillingTable3.scss';
|
import '../../../../../Styles/BookingScreen/Components/BSBillingTables/BSBillingTables3/BSBillingTable3.scss';
|
||||||
import {
|
import {
|
||||||
|
|
@ -73,6 +75,7 @@ import {
|
||||||
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
||||||
import { useRemoveProducts } from './RemoveCartWithOffer.jsx';
|
import { useRemoveProducts } from './RemoveCartWithOffer.jsx';
|
||||||
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
||||||
|
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
||||||
|
|
||||||
const BSBillingTable3 = () => {
|
const BSBillingTable3 = () => {
|
||||||
const { removeExtraCharge } = useUtilsComponent();
|
const { removeExtraCharge } = useUtilsComponent();
|
||||||
|
|
@ -126,6 +129,11 @@ const BSBillingTable3 = () => {
|
||||||
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
||||||
const OfferFreeProduct = useSelector(GlobalFreeProdList, shallowEqual);
|
const OfferFreeProduct = useSelector(GlobalFreeProdList, shallowEqual);
|
||||||
const OtherServicesglobal = useSelector(GlobalOtherSevices);
|
const OtherServicesglobal = useSelector(GlobalOtherSevices);
|
||||||
|
const GetCustId = useSelector(GlobalCustId);
|
||||||
|
const selectedCustomer = useSelector(GlobalSelOption);
|
||||||
|
|
||||||
|
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] = useState(false);
|
||||||
|
const [customerProduct, setCustomerProduct] = useState(null);
|
||||||
const preferenceshortcutkey = preferenceDatas?.[0]?.[
|
const preferenceshortcutkey = preferenceDatas?.[0]?.[
|
||||||
'SettingDtlDetails'
|
'SettingDtlDetails'
|
||||||
]?.some(
|
]?.some(
|
||||||
|
|
@ -141,16 +149,16 @@ const BSBillingTable3 = () => {
|
||||||
OrderType === 'Hold'
|
OrderType === 'Hold'
|
||||||
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
||||||
: tableData?.filter(
|
: tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataDinein = tableData?.filter(
|
const OldtableDataDinein = tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataTakeAway =
|
const OldtableDataTakeAway =
|
||||||
OrderType != 'Hold'
|
OrderType != 'Hold'
|
||||||
? tableData?.filter(
|
? tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
const [EditQuantity, setEditQuantity] = useState(false);
|
const [EditQuantity, setEditQuantity] = useState(false);
|
||||||
const [Modaldata, setModaldata] = useState([]);
|
const [Modaldata, setModaldata] = useState([]);
|
||||||
|
|
@ -174,6 +182,27 @@ const BSBillingTable3 = () => {
|
||||||
}
|
}
|
||||||
}, [SelectedFont]);
|
}, [SelectedFont]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleKeyDown = (e) => {
|
||||||
|
if (e.ctrlKey && e.key.toLowerCase() === 'i') {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const prodId = tableData?.[0]?.ProdId;
|
||||||
|
|
||||||
|
if (GetCustId && prodId) {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(prodId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
};
|
||||||
|
}, [GetCustId, tableData]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!preferenceshortcutkey) return;
|
if (!preferenceshortcutkey) return;
|
||||||
|
|
||||||
|
|
@ -334,6 +363,11 @@ const BSBillingTable3 = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleCustomerProductPriceHistory = (item) => {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(item?.ProdId);
|
||||||
|
}
|
||||||
|
|
||||||
function safeRound(amountStr) {
|
function safeRound(amountStr) {
|
||||||
if (amountStr == null) return allowDecimal ? '0.00' : '0';
|
if (amountStr == null) return allowDecimal ? '0.00' : '0';
|
||||||
|
|
||||||
|
|
@ -1000,9 +1034,9 @@ const BSBillingTable3 = () => {
|
||||||
)?.map((item, idx) =>
|
)?.map((item, idx) =>
|
||||||
idx === 0
|
idx === 0
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
FreeQty,
|
FreeQty,
|
||||||
}
|
}
|
||||||
: item
|
: item
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
@ -2321,11 +2355,10 @@ const BSBillingTable3 = () => {
|
||||||
{OldtableDataTakeAway?.map((item, index) => (
|
{OldtableDataTakeAway?.map((item, index) => (
|
||||||
<tr
|
<tr
|
||||||
key={index}
|
key={index}
|
||||||
className={`${
|
className={`${item?.SalesId && OrderType !== 'Hold'
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
? 'BSBill-Table3-content-Disabled'
|
||||||
? 'BSBill-Table3-content-Disabled'
|
: 'BSBill-Table3-content'
|
||||||
: 'BSBill-Table3-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -2336,15 +2369,15 @@ const BSBillingTable3 = () => {
|
||||||
? item?.SalesId && OrderType !== 'Hold'
|
? item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: triggerAnimation &&
|
: triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: triggerAnimation &&
|
: triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
|
|
@ -2352,9 +2385,9 @@ const BSBillingTable3 = () => {
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: index % 2 === 0
|
: index % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2410,7 +2443,7 @@ const BSBillingTable3 = () => {
|
||||||
style={{ fontFamily: 'Poppins' }}
|
style={{ fontFamily: 'Poppins' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0
|
item.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item)
|
: editField && handleEditQuantity(item)
|
||||||
}
|
}
|
||||||
|
|
@ -2457,21 +2490,21 @@ const BSBillingTable3 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2554,15 +2587,18 @@ const BSBillingTable3 = () => {
|
||||||
className="Table3-item-price"
|
className="Table3-item-price"
|
||||||
style={{ width: '60px', fontFamily: 'Poppins' }}
|
style={{ width: '60px', fontFamily: 'Poppins' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{allowDecimal
|
||||||
? Number(
|
? Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
).toFixed(2)
|
).toFixed(2)
|
||||||
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2597,11 +2633,10 @@ const BSBillingTable3 = () => {
|
||||||
{OldtableDataDinein?.map((item, index) => (
|
{OldtableDataDinein?.map((item, index) => (
|
||||||
<tr
|
<tr
|
||||||
key={OldtableDataTakeAway?.length + index}
|
key={OldtableDataTakeAway?.length + index}
|
||||||
className={`${
|
className={`${item?.SalesId
|
||||||
item?.SalesId
|
? 'BSBill-Table3-content-Disabled'
|
||||||
? 'BSBill-Table3-content-Disabled'
|
: 'BSBill-Table3-content'
|
||||||
: 'BSBill-Table3-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -2612,26 +2647,26 @@ const BSBillingTable3 = () => {
|
||||||
? item?.SalesId
|
? item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background: item?.SalesId
|
background: item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2732,21 +2767,21 @@ const BSBillingTable3 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2829,15 +2864,18 @@ const BSBillingTable3 = () => {
|
||||||
className="Table3-item-price"
|
className="Table3-item-price"
|
||||||
style={{ width: '60px', fontFamily: 'Poppins' }}
|
style={{ width: '60px', fontFamily: 'Poppins' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{allowDecimal
|
||||||
? Number(
|
? Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
).toFixed(2)
|
).toFixed(2)
|
||||||
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2877,11 +2915,10 @@ const BSBillingTable3 = () => {
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index
|
index
|
||||||
}
|
}
|
||||||
className={`${
|
className={`${BookingType === 'Dine In' && item?.SalesId
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
? 'BSBill-Table3-content-Disabled'
|
||||||
? 'BSBill-Table3-content-Disabled'
|
: 'BSBill-Table3-content'
|
||||||
: 'BSBill-Table3-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -2892,38 +2929,38 @@ const BSBillingTable3 = () => {
|
||||||
? BookingType === 'Dine In' && item?.SalesId
|
? BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
: '#d6d6d6'
|
: '#d6d6d6'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -2932,15 +2969,15 @@ const BSBillingTable3 = () => {
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -2949,9 +2986,9 @@ const BSBillingTable3 = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -3000,7 +3037,7 @@ const BSBillingTable3 = () => {
|
||||||
style={{ fontFamily: 'Poppins' }}
|
style={{ fontFamily: 'Poppins' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0
|
item.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item, index)
|
: editField && handleEditQuantity(item, index)
|
||||||
}
|
}
|
||||||
|
|
@ -3054,21 +3091,21 @@ const BSBillingTable3 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3152,15 +3189,18 @@ const BSBillingTable3 = () => {
|
||||||
className="Table3-item-price"
|
className="Table3-item-price"
|
||||||
style={{ width: '60px', fontFamily: 'Poppins' }}
|
style={{ width: '60px', fontFamily: 'Poppins' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item, index);
|
// handleEditQuantity(item, index);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{allowDecimal
|
||||||
? Number(
|
? Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
).toFixed(2)
|
).toFixed(2)
|
||||||
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3200,11 +3240,10 @@ const BSBillingTable3 = () => {
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index
|
index
|
||||||
}
|
}
|
||||||
className={`${
|
className={`${BookingType === 'Dine In' && item?.SalesId
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
? 'BSBill-Table3-content-Disabled'
|
||||||
? 'BSBill-Table3-content-Disabled'
|
: 'BSBill-Table3-content'
|
||||||
: 'BSBill-Table3-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -3217,44 +3256,44 @@ const BSBillingTable3 = () => {
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background:
|
background:
|
||||||
BookingType === 'Dine In' &&
|
BookingType === 'Dine In' &&
|
||||||
item?.SalesId &&
|
item?.SalesId &&
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length +
|
: (OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -3263,10 +3302,10 @@ const BSBillingTable3 = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -3362,21 +3401,21 @@ const BSBillingTable3 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3459,15 +3498,18 @@ const BSBillingTable3 = () => {
|
||||||
className="Table3-item-price"
|
className="Table3-item-price"
|
||||||
style={{ width: '60px', fontFamily: 'Poppins' }}
|
style={{ width: '60px', fontFamily: 'Poppins' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{allowDecimal
|
||||||
? Number(
|
? Number(
|
||||||
item?.TotalAmt - (item?.Offer || 0) || 0
|
item?.TotalAmt - (item?.Offer || 0) || 0
|
||||||
).toFixed(2)
|
).toFixed(2)
|
||||||
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
: Number(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3510,6 +3552,16 @@ const BSBillingTable3 = () => {
|
||||||
ProductDetail={Modaldata}
|
ProductDetail={Modaldata}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{(customerPriceHistoryOpen && GetCustId) &&
|
||||||
|
<CustomerPriceHistory
|
||||||
|
open={customerPriceHistoryOpen}
|
||||||
|
custId={GetCustId}
|
||||||
|
setCustomerPriceHistoryOpen={setCustomerPriceHistoryOpen}
|
||||||
|
customerProduct={customerProduct}
|
||||||
|
setCustomerProduct={setCustomerProduct}
|
||||||
|
selectedCustomer={selectedCustomer}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ import {
|
||||||
GlobalOtherSevices,
|
GlobalOtherSevices,
|
||||||
GlobalDefaultBookingType,
|
GlobalDefaultBookingType,
|
||||||
PostBlockSlots,
|
PostBlockSlots,
|
||||||
|
GlobalSelOption,
|
||||||
|
GlobalCustId,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import {
|
import {
|
||||||
ChangeTotalAmount,
|
ChangeTotalAmount,
|
||||||
|
|
@ -72,6 +74,7 @@ import {
|
||||||
import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js';
|
import { ApplicationPreferences } from '../../../../../Features/BrachLogin/BranchLogin.js';
|
||||||
import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js';
|
import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||||
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
||||||
|
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
||||||
|
|
||||||
const BSBillingTable4 = () => {
|
const BSBillingTable4 = () => {
|
||||||
const { removeExtraCharge } = useUtilsComponent();
|
const { removeExtraCharge } = useUtilsComponent();
|
||||||
|
|
@ -135,6 +138,11 @@ const BSBillingTable4 = () => {
|
||||||
const BookingTypeBoth = useSelector(GlobalBookingTypeBoth);
|
const BookingTypeBoth = useSelector(GlobalBookingTypeBoth);
|
||||||
const OrderType = useSelector(GlobalOrderType);
|
const OrderType = useSelector(GlobalOrderType);
|
||||||
const GlobEstBooking = useSelector(GlobalEstimateBooking);
|
const GlobEstBooking = useSelector(GlobalEstimateBooking);
|
||||||
|
const GetCustId = useSelector(GlobalCustId);
|
||||||
|
const selectedCustomer = useSelector(GlobalSelOption);
|
||||||
|
|
||||||
|
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] = useState(false);
|
||||||
|
const [customerProduct, setCustomerProduct] = useState(null);
|
||||||
const [OpenEditTotalAmt, setOpenEditTotalAmt] = useState(false);
|
const [OpenEditTotalAmt, setOpenEditTotalAmt] = useState(false);
|
||||||
const [OpenImeiDetail, setOpenImeiDetail] = useState(false);
|
const [OpenImeiDetail, setOpenImeiDetail] = useState(false);
|
||||||
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
||||||
|
|
@ -170,16 +178,16 @@ const BSBillingTable4 = () => {
|
||||||
OrderType === 'Hold'
|
OrderType === 'Hold'
|
||||||
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
||||||
: tableData?.filter(
|
: tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataDinein = tableData?.filter(
|
const OldtableDataDinein = tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataTakeAway =
|
const OldtableDataTakeAway =
|
||||||
OrderType != 'Hold'
|
OrderType != 'Hold'
|
||||||
? tableData?.filter(
|
? tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -191,6 +199,26 @@ const BSBillingTable4 = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [SelectedFont]);
|
}, [SelectedFont]);
|
||||||
|
useEffect(() => {
|
||||||
|
const handleKeyDown = (e) => {
|
||||||
|
if (e.ctrlKey && e.key.toLowerCase() === 'i') {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const prodId = tableData?.[0]?.ProdId;
|
||||||
|
|
||||||
|
if (GetCustId && prodId) {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(prodId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
};
|
||||||
|
}, [GetCustId, tableData]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (tableData?.length === 0) {
|
if (tableData?.length === 0) {
|
||||||
dispatch(ClearOfferAppliedProducts());
|
dispatch(ClearOfferAppliedProducts());
|
||||||
|
|
@ -1088,9 +1116,9 @@ const BSBillingTable4 = () => {
|
||||||
)?.map((item, idx) =>
|
)?.map((item, idx) =>
|
||||||
idx === 0
|
idx === 0
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
FreeQty,
|
FreeQty,
|
||||||
}
|
}
|
||||||
: item
|
: item
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
@ -2080,6 +2108,10 @@ const BSBillingTable4 = () => {
|
||||||
|
|
||||||
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
||||||
}
|
}
|
||||||
|
const handleCustomerProductPriceHistory = (item) => {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(item?.ProdId);
|
||||||
|
}
|
||||||
|
|
||||||
const getstockbadge = async () => {
|
const getstockbadge = async () => {
|
||||||
let data = {
|
let data = {
|
||||||
|
|
@ -2088,9 +2120,9 @@ const BSBillingTable4 = () => {
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
await dispatch(getSelectedFavItems(data)).unwrap();
|
await dispatch(getSelectedFavItems(data)).unwrap();
|
||||||
|
|
@ -2102,9 +2134,9 @@ const BSBillingTable4 = () => {
|
||||||
ProdSubCat: ProdSubCat,
|
ProdSubCat: ProdSubCat,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2115,9 +2147,9 @@ const BSBillingTable4 = () => {
|
||||||
prodCat: prodCat,
|
prodCat: prodCat,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2343,7 +2375,7 @@ const BSBillingTable4 = () => {
|
||||||
OpenEditTotalAmount();
|
OpenEditTotalAmount();
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
// onClick={tableData?.length>0? OpenEditTotalAmount :""}
|
// onClick={tableData?.length>0? OpenEditTotalAmount :""}
|
||||||
>
|
>
|
||||||
{!isMobile ? (
|
{!isMobile ? (
|
||||||
<Tooltip title="Quantity">Qty</Tooltip>
|
<Tooltip title="Quantity">Qty</Tooltip>
|
||||||
|
|
@ -2447,11 +2479,10 @@ const BSBillingTable4 = () => {
|
||||||
{OldtableDataTakeAway?.map((item, index) => (
|
{OldtableDataTakeAway?.map((item, index) => (
|
||||||
<tr
|
<tr
|
||||||
key={index}
|
key={index}
|
||||||
className={`${
|
className={`${item?.SalesId && OrderType !== 'Hold'
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
? 'BSBill-Table3-content-Disabled'
|
||||||
? 'BSBill-Table3-content-Disabled'
|
: 'BSBill-Table3-content'
|
||||||
: 'BSBill-Table3-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -2461,17 +2492,17 @@ const BSBillingTable4 = () => {
|
||||||
? item?.SalesId && OrderType !== 'Hold'
|
? item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
|
|
@ -2479,9 +2510,9 @@ const BSBillingTable4 = () => {
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: index % 2 === 0
|
: index % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2532,7 +2563,7 @@ const BSBillingTable4 = () => {
|
||||||
style={{ fontFamily: 'Poppins' }}
|
style={{ fontFamily: 'Poppins' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0
|
item.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item)
|
: editField && handleEditQuantity(item)
|
||||||
}
|
}
|
||||||
|
|
@ -2593,21 +2624,21 @@ const BSBillingTable4 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -2674,8 +2705,11 @@ const BSBillingTable4 = () => {
|
||||||
className="Table4-item-price"
|
className="Table4-item-price"
|
||||||
style={{ width: '30px', fontFamily: 'Poppins' }}
|
style={{ width: '30px', fontFamily: 'Poppins' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -2717,11 +2751,10 @@ const BSBillingTable4 = () => {
|
||||||
{OldtableDataDinein?.map((item, index) => (
|
{OldtableDataDinein?.map((item, index) => (
|
||||||
<tr
|
<tr
|
||||||
key={OldtableDataTakeAway?.length + index}
|
key={OldtableDataTakeAway?.length + index}
|
||||||
className={`${
|
className={`${item?.SalesId
|
||||||
item?.SalesId
|
? 'BSBill-Table3-content-Disabled'
|
||||||
? 'BSBill-Table3-content-Disabled'
|
: 'BSBill-Table3-content'
|
||||||
: 'BSBill-Table3-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -2731,26 +2764,26 @@ const BSBillingTable4 = () => {
|
||||||
? item?.SalesId
|
? item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background: item?.SalesId
|
background: item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2861,21 +2894,21 @@ const BSBillingTable4 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -2942,8 +2975,11 @@ const BSBillingTable4 = () => {
|
||||||
className="Table4-item-price"
|
className="Table4-item-price"
|
||||||
style={{ width: '30px', fontFamily: 'Poppins' }}
|
style={{ width: '30px', fontFamily: 'Poppins' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -2989,11 +3025,10 @@ const BSBillingTable4 = () => {
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index
|
index
|
||||||
}
|
}
|
||||||
className={`${
|
className={`${BookingType === 'Dine In' && item?.SalesId
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
? 'BSBill-Table3-content-Disabled'
|
||||||
? 'BSBill-Table3-content-Disabled'
|
: 'BSBill-Table3-content'
|
||||||
: 'BSBill-Table3-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -3003,38 +3038,38 @@ const BSBillingTable4 = () => {
|
||||||
? BookingType === 'Dine In' && item?.SalesId
|
? BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
: '#d6d6d6'
|
: '#d6d6d6'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -3044,15 +3079,15 @@ const BSBillingTable4 = () => {
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -3061,9 +3096,9 @@ const BSBillingTable4 = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -3107,7 +3142,7 @@ const BSBillingTable4 = () => {
|
||||||
style={{ fontFamily: 'Poppins' }}
|
style={{ fontFamily: 'Poppins' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0
|
item.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item, index)
|
: editField && handleEditQuantity(item, index)
|
||||||
}
|
}
|
||||||
|
|
@ -3177,21 +3212,21 @@ const BSBillingTable4 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -3258,8 +3293,11 @@ const BSBillingTable4 = () => {
|
||||||
className="Table4-item-price"
|
className="Table4-item-price"
|
||||||
style={{ width: '30px', fontFamily: 'Poppins' }}
|
style={{ width: '30px', fontFamily: 'Poppins' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item, index);
|
// handleEditQuantity(item, index);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -3306,11 +3344,10 @@ const BSBillingTable4 = () => {
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index
|
index
|
||||||
}
|
}
|
||||||
className={`${
|
className={`${item?.SalesId && OrderType !== 'Hold'
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
? 'BSBill-Table3-content-Disabled'
|
||||||
? 'BSBill-Table3-content-Disabled'
|
: 'BSBill-Table3-content'
|
||||||
: 'BSBill-Table3-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -3322,44 +3359,44 @@ const BSBillingTable4 = () => {
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background:
|
background:
|
||||||
BookingType === 'Dine In' &&
|
BookingType === 'Dine In' &&
|
||||||
item?.SalesId &&
|
item?.SalesId &&
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length +
|
: (OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -3368,10 +3405,10 @@ const BSBillingTable4 = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -3476,21 +3513,21 @@ const BSBillingTable4 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -3557,8 +3594,11 @@ const BSBillingTable4 = () => {
|
||||||
className="Table4-item-price"
|
className="Table4-item-price"
|
||||||
style={{ width: '30px', fontFamily: 'Poppins' }}
|
style={{ width: '30px', fontFamily: 'Poppins' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -3609,6 +3649,16 @@ const BSBillingTable4 = () => {
|
||||||
ProductDetail={Modaldata}
|
ProductDetail={Modaldata}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{(customerPriceHistoryOpen && GetCustId) &&
|
||||||
|
<CustomerPriceHistory
|
||||||
|
open={customerPriceHistoryOpen}
|
||||||
|
custId={GetCustId}
|
||||||
|
setCustomerPriceHistoryOpen={setCustomerPriceHistoryOpen}
|
||||||
|
customerProduct={customerProduct}
|
||||||
|
setCustomerProduct={setCustomerProduct}
|
||||||
|
selectedCustomer={selectedCustomer}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -45,6 +45,8 @@ import {
|
||||||
changeSelProdWiseEst,
|
changeSelProdWiseEst,
|
||||||
GlobalOtherSevices,
|
GlobalOtherSevices,
|
||||||
GlobalDefaultBookingType,
|
GlobalDefaultBookingType,
|
||||||
|
GlobalSelOption,
|
||||||
|
GlobalCustId,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import {
|
import {
|
||||||
ChangeFullFreeProductList,
|
ChangeFullFreeProductList,
|
||||||
|
|
@ -69,6 +71,7 @@ import BSEditTotalAmt from '../BSEditTotalAmount/BSEditTotalAmt.jsx';
|
||||||
import BSImeiDetails from '../BSImeiDetails/BSImeiDetails.jsx';
|
import BSImeiDetails from '../BSImeiDetails/BSImeiDetails.jsx';
|
||||||
import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
|
import { useApplyOfferto_CardDetail } from '../../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
|
||||||
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
||||||
|
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
||||||
|
|
||||||
const BSBillingTable6 = () => {
|
const BSBillingTable6 = () => {
|
||||||
const { removeExtraCharge } = useUtilsComponent();
|
const { removeExtraCharge } = useUtilsComponent();
|
||||||
|
|
@ -123,6 +126,11 @@ const BSBillingTable6 = () => {
|
||||||
const BookingTypeBoth = useSelector(GlobalBookingTypeBoth);
|
const BookingTypeBoth = useSelector(GlobalBookingTypeBoth);
|
||||||
const OrderType = useSelector(GlobalOrderType);
|
const OrderType = useSelector(GlobalOrderType);
|
||||||
const GlobEstBooking = useSelector(GlobalEstimateBooking);
|
const GlobEstBooking = useSelector(GlobalEstimateBooking);
|
||||||
|
const GetCustId = useSelector(GlobalCustId);
|
||||||
|
const selectedCustomer = useSelector(GlobalSelOption);
|
||||||
|
|
||||||
|
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] = useState(false);
|
||||||
|
const [customerProduct, setCustomerProduct] = useState(null);
|
||||||
const [OpenImeiDetail, setOpenImeiDetail] = useState(false);
|
const [OpenImeiDetail, setOpenImeiDetail] = useState(false);
|
||||||
const [shortKeyMethod, setshortKeyMethod] = useState(null);
|
const [shortKeyMethod, setshortKeyMethod] = useState(null);
|
||||||
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
||||||
|
|
@ -144,16 +152,16 @@ const BSBillingTable6 = () => {
|
||||||
OrderType === 'Hold'
|
OrderType === 'Hold'
|
||||||
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
||||||
: tableData?.filter(
|
: tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataDinein = tableData?.filter(
|
const OldtableDataDinein = tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataTakeAway =
|
const OldtableDataTakeAway =
|
||||||
OrderType != 'Hold'
|
OrderType != 'Hold'
|
||||||
? tableData?.filter(
|
? tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
const [OpenEditTotalAmt, setOpenEditTotalAmt] = useState(false);
|
const [OpenEditTotalAmt, setOpenEditTotalAmt] = useState(false);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -165,6 +173,26 @@ const BSBillingTable6 = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [SelectedFont]);
|
}, [SelectedFont]);
|
||||||
|
useEffect(() => {
|
||||||
|
const handleKeyDown = (e) => {
|
||||||
|
if (e.ctrlKey && e.key.toLowerCase() === 'i') {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const prodId = tableData?.[0]?.ProdId;
|
||||||
|
|
||||||
|
if (GetCustId && prodId) {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(prodId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
};
|
||||||
|
}, [GetCustId, tableData]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (tableData?.length === 0) {
|
if (tableData?.length === 0) {
|
||||||
dispatch(ClearOfferAppliedProducts());
|
dispatch(ClearOfferAppliedProducts());
|
||||||
|
|
@ -1006,9 +1034,9 @@ const BSBillingTable6 = () => {
|
||||||
)?.map((item, idx) =>
|
)?.map((item, idx) =>
|
||||||
idx === 0
|
idx === 0
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
FreeQty,
|
FreeQty,
|
||||||
}
|
}
|
||||||
: item
|
: item
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
@ -2049,6 +2077,11 @@ const BSBillingTable6 = () => {
|
||||||
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleCustomerProductPriceHistory = (item) => {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(item?.ProdId);
|
||||||
|
}
|
||||||
|
|
||||||
const OpenEditTotalAmount = () => {
|
const OpenEditTotalAmount = () => {
|
||||||
setOpenEditTotalAmt(true);
|
setOpenEditTotalAmt(true);
|
||||||
};
|
};
|
||||||
|
|
@ -2307,15 +2340,15 @@ const BSBillingTable6 = () => {
|
||||||
? item?.SalesId && OrderType !== 'Hold'
|
? item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: triggerAnimation &&
|
: triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: triggerAnimation &&
|
: triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
|
|
@ -2323,9 +2356,9 @@ const BSBillingTable6 = () => {
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: index % 2 === 0
|
: index % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2377,7 +2410,7 @@ const BSBillingTable6 = () => {
|
||||||
style={{ fontFamily: 'Poppins', textAlign: 'left' }}
|
style={{ fontFamily: 'Poppins', textAlign: 'left' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0
|
item.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item)
|
: editField && handleEditQuantity(item)
|
||||||
}
|
}
|
||||||
|
|
@ -2423,21 +2456,21 @@ const BSBillingTable6 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -2505,8 +2538,11 @@ const BSBillingTable6 = () => {
|
||||||
className="BillingTable6-table-td"
|
className="BillingTable6-table-td"
|
||||||
style={{ fontFamily: 'Poppins', textAlign: 'center' }}
|
style={{ fontFamily: 'Poppins', textAlign: 'center' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -2559,26 +2595,26 @@ const BSBillingTable6 = () => {
|
||||||
? item?.SalesId
|
? item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background: item?.SalesId
|
background: item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2674,21 +2710,21 @@ const BSBillingTable6 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -2756,8 +2792,11 @@ const BSBillingTable6 = () => {
|
||||||
className="BillingTable6-table-td"
|
className="BillingTable6-table-td"
|
||||||
style={{ fontFamily: 'Poppins', textAlign: 'center' }}
|
style={{ fontFamily: 'Poppins', textAlign: 'center' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -2814,38 +2853,38 @@ const BSBillingTable6 = () => {
|
||||||
? BookingType === 'Dine In' && item?.SalesId
|
? BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
: '#d6d6d6'
|
: '#d6d6d6'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -2854,15 +2893,15 @@ const BSBillingTable6 = () => {
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -2871,9 +2910,9 @@ const BSBillingTable6 = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -2917,7 +2956,7 @@ const BSBillingTable6 = () => {
|
||||||
style={{ fontFamily: 'Poppins', textAlign: 'left' }}
|
style={{ fontFamily: 'Poppins', textAlign: 'left' }}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0
|
item.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item)
|
: editField && handleEditQuantity(item)
|
||||||
}
|
}
|
||||||
|
|
@ -2968,21 +3007,21 @@ const BSBillingTable6 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -3050,8 +3089,11 @@ const BSBillingTable6 = () => {
|
||||||
className="BillingTable6-table-td"
|
className="BillingTable6-table-td"
|
||||||
style={{ fontFamily: 'Poppins', textAlign: 'center' }}
|
style={{ fontFamily: 'Poppins', textAlign: 'center' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -3110,44 +3152,44 @@ const BSBillingTable6 = () => {
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background:
|
background:
|
||||||
BookingType === 'Dine In' &&
|
BookingType === 'Dine In' &&
|
||||||
item?.SalesId &&
|
item?.SalesId &&
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length +
|
: (OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -3156,10 +3198,10 @@ const BSBillingTable6 = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -3248,21 +3290,21 @@ const BSBillingTable6 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -3330,8 +3372,11 @@ const BSBillingTable6 = () => {
|
||||||
className="BillingTable6-table-td"
|
className="BillingTable6-table-td"
|
||||||
style={{ fontFamily: 'Poppins', textAlign: 'center' }}
|
style={{ fontFamily: 'Poppins', textAlign: 'center' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -3379,6 +3424,16 @@ const BSBillingTable6 = () => {
|
||||||
ProductDetail={Modaldata}
|
ProductDetail={Modaldata}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{(customerPriceHistoryOpen && GetCustId) &&
|
||||||
|
<CustomerPriceHistory
|
||||||
|
open={customerPriceHistoryOpen}
|
||||||
|
custId={GetCustId}
|
||||||
|
setCustomerPriceHistoryOpen={setCustomerPriceHistoryOpen}
|
||||||
|
customerProduct={customerProduct}
|
||||||
|
setCustomerProduct={setCustomerProduct}
|
||||||
|
selectedCustomer={selectedCustomer}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ import {
|
||||||
changeUnpaidData,
|
changeUnpaidData,
|
||||||
GlobalOtherSevices,
|
GlobalOtherSevices,
|
||||||
GlobalDefaultBookingType,
|
GlobalDefaultBookingType,
|
||||||
|
GlobalCustId,
|
||||||
|
GlobalSelOption,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import {
|
import {
|
||||||
ChangeFullFreeProductList,
|
ChangeFullFreeProductList,
|
||||||
|
|
@ -60,6 +62,7 @@ import BSEditTotalAmt from '../BSEditTotalAmount/BSEditTotalAmt.jsx';
|
||||||
import BSImeiDetails from '../BSImeiDetails/BSImeiDetails.jsx';
|
import BSImeiDetails from '../BSImeiDetails/BSImeiDetails.jsx';
|
||||||
import { getSession } from '../../../../../Services/Others.js';
|
import { getSession } from '../../../../../Services/Others.js';
|
||||||
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
||||||
|
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
||||||
|
|
||||||
const BSBillingTable7 = () => {
|
const BSBillingTable7 = () => {
|
||||||
const { removeExtraCharge } = useUtilsComponent();
|
const { removeExtraCharge } = useUtilsComponent();
|
||||||
|
|
@ -90,7 +93,11 @@ const BSBillingTable7 = () => {
|
||||||
);
|
);
|
||||||
const BookingType = useSelector(GlobalBookingType);
|
const BookingType = useSelector(GlobalBookingType);
|
||||||
const defaultBookingType = useSelector(GlobalDefaultBookingType);
|
const defaultBookingType = useSelector(GlobalDefaultBookingType);
|
||||||
|
const GetCustId = useSelector(GlobalCustId);
|
||||||
|
const selectedCustomer = useSelector(GlobalSelOption);
|
||||||
|
|
||||||
|
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] = useState(false);
|
||||||
|
const [customerProduct, setCustomerProduct] = useState(null);
|
||||||
const [EditQuantity, setEditQuantity] = useState(false);
|
const [EditQuantity, setEditQuantity] = useState(false);
|
||||||
const [Modaldata, setModaldata] = useState([]);
|
const [Modaldata, setModaldata] = useState([]);
|
||||||
const [editdelete, seteditdelete] = useState('');
|
const [editdelete, seteditdelete] = useState('');
|
||||||
|
|
@ -123,16 +130,16 @@ const BSBillingTable7 = () => {
|
||||||
OrderType === 'Hold'
|
OrderType === 'Hold'
|
||||||
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
||||||
: tableData?.filter(
|
: tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataDinein = tableData?.filter(
|
const OldtableDataDinein = tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataTakeAway =
|
const OldtableDataTakeAway =
|
||||||
OrderType != 'Hold'
|
OrderType != 'Hold'
|
||||||
? tableData?.filter(
|
? tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
const productBasedExtraCharges = GlobalExtraCharge.filter(
|
const productBasedExtraCharges = GlobalExtraCharge.filter(
|
||||||
(obj) => 'ProdName' in obj
|
(obj) => 'ProdName' in obj
|
||||||
|
|
@ -151,6 +158,26 @@ const BSBillingTable7 = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [SelectedFont]);
|
}, [SelectedFont]);
|
||||||
|
useEffect(() => {
|
||||||
|
const handleKeyDown = (e) => {
|
||||||
|
if (e.ctrlKey && e.key.toLowerCase() === 'i') {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const prodId = tableData?.[0]?.ProdId;
|
||||||
|
|
||||||
|
if (GetCustId && prodId) {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(prodId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
};
|
||||||
|
}, [GetCustId, tableData]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (tableData?.length === 0) {
|
if (tableData?.length === 0) {
|
||||||
dispatch(ClearOfferAppliedProducts());
|
dispatch(ClearOfferAppliedProducts());
|
||||||
|
|
@ -925,9 +952,9 @@ const BSBillingTable7 = () => {
|
||||||
)?.map((item, idx) =>
|
)?.map((item, idx) =>
|
||||||
idx === 0
|
idx === 0
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
FreeQty,
|
FreeQty,
|
||||||
}
|
}
|
||||||
: item
|
: item
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
@ -1970,6 +1997,13 @@ const BSBillingTable7 = () => {
|
||||||
|
|
||||||
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const handleCustomerProductPriceHistory = (item) => {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(item?.ProdId);
|
||||||
|
}
|
||||||
|
|
||||||
const handlechange33 = () => {
|
const handlechange33 = () => {
|
||||||
if (editdelete === 'Edit') {
|
if (editdelete === 'Edit') {
|
||||||
seteditdelete('');
|
seteditdelete('');
|
||||||
|
|
@ -2256,16 +2290,16 @@ const BSBillingTable7 = () => {
|
||||||
? item?.SalesId && OrderType !== 'Hold'
|
? item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: triggerAnimation &&
|
: triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: triggerAnimation &&
|
: triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
tableDataTakeAway?.length >=
|
tableDataTakeAway?.length >=
|
||||||
PreviousdataLength &&
|
PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
|
|
@ -2273,9 +2307,9 @@ const BSBillingTable7 = () => {
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: index % 2 === 0
|
: index % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2300,15 +2334,14 @@ const BSBillingTable7 = () => {
|
||||||
? () => handleEditQuantity(item)
|
? () => handleEditQuantity(item)
|
||||||
: editdelete === 'Delete'
|
: editdelete === 'Delete'
|
||||||
? () => removeFromCart(item)
|
? () => removeFromCart(item)
|
||||||
: () => {}
|
: () => { }
|
||||||
}
|
}
|
||||||
// onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""}
|
// onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""}
|
||||||
|
|
||||||
className={`${
|
className={`${item?.SalesId && OrderType !== 'Hold'
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
? 'BSBill-Table7-content-disabled'
|
||||||
? 'BSBill-Table7-content-disabled'
|
: 'BSBill-Table7-content'
|
||||||
: 'BSBill-Table7-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
|
|
@ -2389,21 +2422,21 @@ const BSBillingTable7 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -2451,7 +2484,14 @@ const BSBillingTable7 = () => {
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'Amount' && (
|
{tableitem.OptionName == 'Amount' && (
|
||||||
<td style={{ fontFamily: 'Poppins' }}>
|
<td
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
style={{ fontFamily: 'Poppins' }}>
|
||||||
{safeRound(item?.TotalAmt)}
|
{safeRound(item?.TotalAmt)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2474,26 +2514,26 @@ const BSBillingTable7 = () => {
|
||||||
? item?.SalesId
|
? item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background: item?.SalesId
|
background: item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2518,15 +2558,14 @@ const BSBillingTable7 = () => {
|
||||||
? () => handleEditQuantity(item)
|
? () => handleEditQuantity(item)
|
||||||
: editdelete === 'Delete'
|
: editdelete === 'Delete'
|
||||||
? () => removeFromCart(item)
|
? () => removeFromCart(item)
|
||||||
: () => {}
|
: () => { }
|
||||||
}
|
}
|
||||||
// onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""}
|
// onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""}
|
||||||
|
|
||||||
className={`${
|
className={`${item?.SalesId
|
||||||
item?.SalesId
|
? 'BSBill-Table7-content-disabled'
|
||||||
? 'BSBill-Table7-content-disabled'
|
: 'BSBill-Table7-content'
|
||||||
: 'BSBill-Table7-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
|
|
@ -2603,21 +2642,21 @@ const BSBillingTable7 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -2665,7 +2704,12 @@ const BSBillingTable7 = () => {
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'Amount' && (
|
{tableitem.OptionName == 'Amount' && (
|
||||||
<td style={{ fontFamily: 'Poppins' }}>
|
<td onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
|
}
|
||||||
|
}} style={{ fontFamily: 'Poppins' }}>
|
||||||
{safeRound(item?.TotalAmt)}
|
{safeRound(item?.TotalAmt)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2688,41 +2732,41 @@ const BSBillingTable7 = () => {
|
||||||
? BookingType === 'Dine In' && item?.SalesId
|
? BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataTakeAway?.length >=
|
tableDataTakeAway?.length >=
|
||||||
PreviousdataLength &&
|
PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.[
|
? SelectedBillColor?.[
|
||||||
'OverallBackgroundColor'
|
'OverallBackgroundColor'
|
||||||
]
|
]
|
||||||
: '#d6d6d6'
|
: '#d6d6d6'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -2731,15 +2775,15 @@ const BSBillingTable7 = () => {
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -2748,9 +2792,9 @@ const BSBillingTable7 = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -2767,22 +2811,21 @@ const BSBillingTable7 = () => {
|
||||||
onClick={
|
onClick={
|
||||||
editdelete === 'Edit'
|
editdelete === 'Edit'
|
||||||
? () =>
|
? () =>
|
||||||
item.Type == 'P' || item.Type == 'C'
|
item.Type == 'P' || item.Type == 'C'
|
||||||
|
? handleEditQuantity(item)
|
||||||
|
: item.ServiceType == 'G'
|
||||||
? handleEditQuantity(item)
|
? handleEditQuantity(item)
|
||||||
: item.ServiceType == 'G'
|
: ''
|
||||||
? handleEditQuantity(item)
|
|
||||||
: ''
|
|
||||||
: editdelete === 'Delete'
|
: editdelete === 'Delete'
|
||||||
? () => removeFromCart(item)
|
? () => removeFromCart(item)
|
||||||
: () => {}
|
: () => { }
|
||||||
}
|
}
|
||||||
// onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""}
|
// onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""}
|
||||||
|
|
||||||
className={`${
|
className={`${BookingType === 'Dine In' && item?.SalesId
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
? 'BSBill-Table7-content-disabled'
|
||||||
? 'BSBill-Table7-content-disabled'
|
: 'BSBill-Table7-content'
|
||||||
: 'BSBill-Table7-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
|
|
@ -2880,21 +2923,21 @@ const BSBillingTable7 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -2942,7 +2985,12 @@ const BSBillingTable7 = () => {
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'Amount' && (
|
{tableitem.OptionName == 'Amount' && (
|
||||||
<td style={{ fontFamily: 'Poppins' }}>
|
<td onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
|
}
|
||||||
|
}} style={{ fontFamily: 'Poppins' }}>
|
||||||
{item?.TotalAmt}
|
{item?.TotalAmt}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2967,44 +3015,44 @@ const BSBillingTable7 = () => {
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background:
|
background:
|
||||||
BookingType === 'Dine In' &&
|
BookingType === 'Dine In' &&
|
||||||
item?.SalesId &&
|
item?.SalesId &&
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length +
|
: (OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -3013,10 +3061,10 @@ const BSBillingTable7 = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -3036,15 +3084,14 @@ const BSBillingTable7 = () => {
|
||||||
? () => handleEditQuantity(item)
|
? () => handleEditQuantity(item)
|
||||||
: editdelete === 'Delete'
|
: editdelete === 'Delete'
|
||||||
? () => removeFromCart(item)
|
? () => removeFromCart(item)
|
||||||
: () => {}
|
: () => { }
|
||||||
}
|
}
|
||||||
// onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""}
|
// onClick={editdelete === "Edit" ? () => handleEditQuantity(item) : editdelete === "Delete" ? () => removeFromCart(item) : ""}
|
||||||
|
|
||||||
className={`${
|
className={`${BookingType === 'Dine In' && item?.SalesId
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
? 'BSBill-Table7-content-disabled'
|
||||||
? 'BSBill-Table7-content-disabled'
|
: 'BSBill-Table7-content'
|
||||||
: 'BSBill-Table7-content'
|
}
|
||||||
}
|
|
||||||
|
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
|
|
@ -3125,21 +3172,21 @@ const BSBillingTable7 = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'MRP' && (
|
{tableitem.OptionName == 'MRP' && (
|
||||||
|
|
@ -3187,7 +3234,14 @@ const BSBillingTable7 = () => {
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'Amount' && (
|
{tableitem.OptionName == 'Amount' && (
|
||||||
<td style={{ fontFamily: 'Poppins' }}>
|
<td
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
style={{ fontFamily: 'Poppins' }}>
|
||||||
{safeRound(item?.TotalAmt)}
|
{safeRound(item?.TotalAmt)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3221,6 +3275,16 @@ const BSBillingTable7 = () => {
|
||||||
ProductDetail={Modaldata}
|
ProductDetail={Modaldata}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{(customerPriceHistoryOpen && GetCustId) &&
|
||||||
|
<CustomerPriceHistory
|
||||||
|
open={customerPriceHistoryOpen}
|
||||||
|
custId={GetCustId}
|
||||||
|
setCustomerPriceHistoryOpen={setCustomerPriceHistoryOpen}
|
||||||
|
customerProduct={customerProduct}
|
||||||
|
setCustomerProduct={setCustomerProduct}
|
||||||
|
selectedCustomer={selectedCustomer}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,8 @@ import {
|
||||||
changeSelProdWiseEst,
|
changeSelProdWiseEst,
|
||||||
GlobalOtherSevices,
|
GlobalOtherSevices,
|
||||||
GlobalDefaultBookingType,
|
GlobalDefaultBookingType,
|
||||||
|
GlobalCustId,
|
||||||
|
GlobalSelOption,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import {
|
import {
|
||||||
ChangeOfferAppliedProducts,
|
ChangeOfferAppliedProducts,
|
||||||
|
|
@ -71,6 +73,7 @@ import {
|
||||||
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
||||||
import { useRemoveProducts } from '../BSBillingTable3/RemoveCartWithOffer.jsx';
|
import { useRemoveProducts } from '../BSBillingTable3/RemoveCartWithOffer.jsx';
|
||||||
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
||||||
|
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
||||||
|
|
||||||
const ComboSalesBillTable = () => {
|
const ComboSalesBillTable = () => {
|
||||||
const { removeExtraCharge } = useUtilsComponent();
|
const { removeExtraCharge } = useUtilsComponent();
|
||||||
|
|
@ -125,6 +128,11 @@ const ComboSalesBillTable = () => {
|
||||||
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
||||||
const OfferFreeProduct = useSelector(GlobalFreeProdList, shallowEqual);
|
const OfferFreeProduct = useSelector(GlobalFreeProdList, shallowEqual);
|
||||||
const OtherServicesglobal = useSelector(GlobalOtherSevices);
|
const OtherServicesglobal = useSelector(GlobalOtherSevices);
|
||||||
|
const GetCustId = useSelector(GlobalCustId);
|
||||||
|
const selectedCustomer = useSelector(GlobalSelOption);
|
||||||
|
|
||||||
|
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] = useState(false);
|
||||||
|
const [customerProduct, setCustomerProduct] = useState(null);
|
||||||
|
|
||||||
const tableDataDinein = tableData?.filter(
|
const tableDataDinein = tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'Dine In' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'Dine In' && !a?.SalesId
|
||||||
|
|
@ -183,6 +191,27 @@ const ComboSalesBillTable = () => {
|
||||||
}
|
}
|
||||||
}, [SelectedFont]);
|
}, [SelectedFont]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleKeyDown = (e) => {
|
||||||
|
if (e.ctrlKey && e.key.toLowerCase() === 'i') {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const prodId = tableData?.[0]?.ProdId;
|
||||||
|
|
||||||
|
if (GetCustId && prodId) {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(prodId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
};
|
||||||
|
}, [GetCustId, tableData]);
|
||||||
|
|
||||||
// useEffect(() => {
|
// useEffect(() => {
|
||||||
// const BillOrder = preferenceDatas?.[0]?.SettingDtlDetails?.find(
|
// const BillOrder = preferenceDatas?.[0]?.SettingDtlDetails?.find(
|
||||||
// (item) => item.SettingIdName === 'BillItemsOrder'
|
// (item) => item.SettingIdName === 'BillItemsOrder'
|
||||||
|
|
@ -223,6 +252,12 @@ const ComboSalesBillTable = () => {
|
||||||
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
return allowDecimal ? num.toFixed(2) : Math.round(num).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleCustomerProductPriceHistory = (item) => {
|
||||||
|
debugger
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(item?.ProdId);
|
||||||
|
}
|
||||||
|
|
||||||
const handleEditQuantity = (value) => {
|
const handleEditQuantity = (value) => {
|
||||||
if (OtherServicesglobal && value.Type == 'OS' && value.ServiceType == 'I') {
|
if (OtherServicesglobal && value.Type == 'OS' && value.ServiceType == 'I') {
|
||||||
setEditQuantity(false);
|
setEditQuantity(false);
|
||||||
|
|
@ -2295,7 +2330,14 @@ const ComboSalesBillTable = () => {
|
||||||
<td
|
<td
|
||||||
key={`total-${index}`}
|
key={`total-${index}`}
|
||||||
className="totalTd"
|
className="totalTd"
|
||||||
onClick={() => editField && handleEditQuantity(row)}
|
onClick={() => {
|
||||||
|
// if (editField) {
|
||||||
|
// handleEditQuantity(row)
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(row);
|
||||||
|
}
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{allowDecimal
|
||||||
? Number(row.TotalAmt - (row?.Offer || 0)).toFixed(2)
|
? Number(row.TotalAmt - (row?.Offer || 0)).toFixed(2)
|
||||||
|
|
@ -2372,6 +2414,16 @@ const ComboSalesBillTable = () => {
|
||||||
Index={Index}
|
Index={Index}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{(customerPriceHistoryOpen && GetCustId) &&
|
||||||
|
<CustomerPriceHistory
|
||||||
|
open={customerPriceHistoryOpen}
|
||||||
|
custId={GetCustId}
|
||||||
|
setCustomerPriceHistoryOpen={setCustomerPriceHistoryOpen}
|
||||||
|
customerProduct={customerProduct}
|
||||||
|
setCustomerProduct={setCustomerProduct}
|
||||||
|
selectedCustomer={selectedCustomer}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -66,6 +66,8 @@ import {
|
||||||
changeBillEditingMode,
|
changeBillEditingMode,
|
||||||
changePreviousOrderPayment,
|
changePreviousOrderPayment,
|
||||||
changePreviousOrderOfferDetail,
|
changePreviousOrderOfferDetail,
|
||||||
|
GlobalCustId,
|
||||||
|
GlobalSelOption,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import './StandardTable.scss';
|
import './StandardTable.scss';
|
||||||
import { IoClose } from 'react-icons/io5';
|
import { IoClose } from 'react-icons/io5';
|
||||||
|
|
@ -82,6 +84,7 @@ import { useDateStore } from '../../../../../Features/BookingScreen/BookingData/
|
||||||
import { CiShop } from 'react-icons/ci';
|
import { CiShop } from 'react-icons/ci';
|
||||||
import BranchName from '../../../Template/BranchName.jsx';
|
import BranchName from '../../../Template/BranchName.jsx';
|
||||||
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
||||||
|
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
||||||
|
|
||||||
const StandardTable = () => {
|
const StandardTable = () => {
|
||||||
const { removeExtraCharge } = useUtilsComponent();
|
const { removeExtraCharge } = useUtilsComponent();
|
||||||
|
|
@ -135,6 +138,10 @@ const StandardTable = () => {
|
||||||
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
||||||
const OtherServicesglobal = useSelector(GlobalOtherSevices);
|
const OtherServicesglobal = useSelector(GlobalOtherSevices);
|
||||||
const totalItems = useSelector(GlobalSummeryTotalItems);
|
const totalItems = useSelector(GlobalSummeryTotalItems);
|
||||||
|
const GetCustId = useSelector(GlobalCustId);
|
||||||
|
const selectedCustomer = useSelector(GlobalSelOption);
|
||||||
|
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] = useState(false);
|
||||||
|
const [customerProduct, setCustomerProduct] = useState(null);
|
||||||
const [tableCollapse, setTableCollapse] = useState(false);
|
const [tableCollapse, setTableCollapse] = useState(false);
|
||||||
const [shortKeyMethod, setshortKeyMethod] = useState(null);
|
const [shortKeyMethod, setshortKeyMethod] = useState(null);
|
||||||
|
|
||||||
|
|
@ -209,6 +216,28 @@ const StandardTable = () => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, [SelectedFont]);
|
}, [SelectedFont]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleKeyDown = (e) => {
|
||||||
|
if (e.ctrlKey && e.key.toLowerCase() === 'i') {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
const prodId = OrderCardDetail?.[0]?.ProdId;
|
||||||
|
|
||||||
|
if (GetCustId && prodId) {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(prodId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener('keydown', handleKeyDown);
|
||||||
|
};
|
||||||
|
}, [GetCustId, OrderCardDetail]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!preferenceshortcutkey) return;
|
if (!preferenceshortcutkey) return;
|
||||||
|
|
||||||
|
|
@ -2223,6 +2252,11 @@ const StandardTable = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleCustomerProductPriceHistory = (item) => {
|
||||||
|
setCustomerPriceHistoryOpen(true);
|
||||||
|
setCustomerProduct(item?.ProdId);
|
||||||
|
}
|
||||||
|
|
||||||
const handleEditQuantityCancel = () => {
|
const handleEditQuantityCancel = () => {
|
||||||
setEditQuantity(false);
|
setEditQuantity(false);
|
||||||
};
|
};
|
||||||
|
|
@ -2787,8 +2821,11 @@ const StandardTable = () => {
|
||||||
"'Inter', ui-sans-serif, system-ui, sans-serif",
|
"'Inter', ui-sans-serif, system-ui, sans-serif",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -3101,8 +3138,11 @@ const StandardTable = () => {
|
||||||
"'Inter', ui-sans-serif, system-ui, sans-serif",
|
"'Inter', ui-sans-serif, system-ui, sans-serif",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -3463,8 +3503,11 @@ const StandardTable = () => {
|
||||||
"'Inter', ui-sans-serif, system-ui, sans-serif",
|
"'Inter', ui-sans-serif, system-ui, sans-serif",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -3806,8 +3849,11 @@ const StandardTable = () => {
|
||||||
"'Inter', ui-sans-serif, system-ui, sans-serif",
|
"'Inter', ui-sans-serif, system-ui, sans-serif",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (editField) {
|
// if (editField) {
|
||||||
handleEditQuantity(item);
|
// handleEditQuantity(item);
|
||||||
|
// }
|
||||||
|
if (GetCustId) {
|
||||||
|
handleCustomerProductPriceHistory(item);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
@ -3855,6 +3901,17 @@ const StandardTable = () => {
|
||||||
ProductDetail={Modaldata}
|
ProductDetail={Modaldata}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{(customerPriceHistoryOpen && GetCustId) &&
|
||||||
|
<CustomerPriceHistory
|
||||||
|
open={customerPriceHistoryOpen}
|
||||||
|
custId={GetCustId}
|
||||||
|
setCustomerPriceHistoryOpen={setCustomerPriceHistoryOpen}
|
||||||
|
customerProduct={customerProduct}
|
||||||
|
setCustomerProduct={setCustomerProduct}
|
||||||
|
selectedCustomer={selectedCustomer}
|
||||||
|
OrderCardDetail={OrderCardDetail}
|
||||||
|
/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div className="booking-table-footer">
|
<div className="booking-table-footer">
|
||||||
<StandardTablePayment />
|
<StandardTablePayment />
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,161 @@
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { DefaultModal } from "../../../../Components/Modal/DefaultModal"
|
||||||
|
import { Tables } from "../../../../Components/Tables/Table"
|
||||||
|
import { useDispatch } from "react-redux";
|
||||||
|
import { getCustomerProductPriceHistory } from "../../../../Features/CustMaster/CustMaster";
|
||||||
|
import { getSession } from "../../../../Services/Others";
|
||||||
|
import { formatDateShort, formatTime12 } from "../../../../Features/BookingScreen/BookingData/DateStore";
|
||||||
|
|
||||||
|
const CustomerPriceHistory = ({
|
||||||
|
open = false,
|
||||||
|
custId = null,
|
||||||
|
setCustomerPriceHistoryOpen = () => { },
|
||||||
|
customerProduct = null,
|
||||||
|
setCustomerProduct = () => { },
|
||||||
|
selectedCustomer = null,
|
||||||
|
OrderCardDetail = [],
|
||||||
|
}
|
||||||
|
) => {
|
||||||
|
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
const AppId = getSession('AppId');
|
||||||
|
const CompId = getSession('CompId');
|
||||||
|
const BranchId = getSession('BranchId');
|
||||||
|
const [priceHistory, setPriceHistory] = useState([]);
|
||||||
|
const [page, setPage] = useState(1);
|
||||||
|
|
||||||
|
console.log(selectedCustomer, "selectedCustomer")
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: 'SL NO',
|
||||||
|
key: 'slno',
|
||||||
|
align: 'center',
|
||||||
|
width: '60px',
|
||||||
|
render: (_, __, index) => (page - 1) * 10 + index + 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Product',
|
||||||
|
key: 'product',
|
||||||
|
render: (_, record) =>
|
||||||
|
`${record?.ProdName || '-'} (${record?.UOMName || ''})`.trim(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Variant',
|
||||||
|
dataIndex: 'ProdVariantName',
|
||||||
|
key: 'ProdVariantName',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Qty',
|
||||||
|
dataIndex: 'Qty',
|
||||||
|
key: 'Qty',
|
||||||
|
align: 'center',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Rate ( ₹ )',
|
||||||
|
dataIndex: 'Rate',
|
||||||
|
key: 'Rate',
|
||||||
|
align: 'right',
|
||||||
|
width: '80px',
|
||||||
|
render: value => <div style={{ color: 'green' }}>{value}</div>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'MRP ( ₹ )',
|
||||||
|
dataIndex: 'MRP',
|
||||||
|
key: 'MRP',
|
||||||
|
align: 'right',
|
||||||
|
width: '80px',
|
||||||
|
render: value => `${value}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Offer Price',
|
||||||
|
dataIndex: 'OfferPrice',
|
||||||
|
key: 'OfferPrice',
|
||||||
|
align: 'right',
|
||||||
|
width: '100px',
|
||||||
|
render: value => value > 0 ? `₹ ${value}` : '-',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Date',
|
||||||
|
key: 'SalesDate',
|
||||||
|
align: 'center',
|
||||||
|
width: '110px',
|
||||||
|
render: (_, record) => formatDateShort(record?.SalesDate),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: 'Time',
|
||||||
|
key: 'SalesTime',
|
||||||
|
align: 'center',
|
||||||
|
width: '80px',
|
||||||
|
render: (_, record) => formatTime12(record?.SalesDate),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const fetchCustomerPriceHistory = async () => {
|
||||||
|
const response = await dispatch(getCustomerProductPriceHistory({
|
||||||
|
CustId: custId,
|
||||||
|
ProdId: customerProduct,
|
||||||
|
AppId,
|
||||||
|
CompId,
|
||||||
|
BranchId
|
||||||
|
}))?.unwrap();
|
||||||
|
if (response?.data?.data?.length > 0 && response?.data?.statusCode === 1) {
|
||||||
|
setPriceHistory(response?.data?.data);
|
||||||
|
} else {
|
||||||
|
setPriceHistory([]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (open && customerProduct) {
|
||||||
|
fetchCustomerPriceHistory();
|
||||||
|
}
|
||||||
|
}, [open, customerProduct]);
|
||||||
|
|
||||||
|
const handlePageChange = (current) => {
|
||||||
|
setPage(current);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handlePriceHistoryClose = () => {
|
||||||
|
setCustomerPriceHistoryOpen(false);
|
||||||
|
setCustomerProduct(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<DefaultModal
|
||||||
|
width={1000}
|
||||||
|
title="Customer Price History"
|
||||||
|
open={open}
|
||||||
|
handleCancel={handlePriceHistoryClose}
|
||||||
|
footer={false}
|
||||||
|
children={<>
|
||||||
|
<div style={{ fontFamily: 'Poppins', display: 'flex', alignItems: 'center', gap: '1rem', marginBottom: '1rem', fontSize: '14px' }}>
|
||||||
|
{selectedCustomer?.CustName && <div>
|
||||||
|
<span style={{ fontWeight: '500' }}>Customer Name: </span>{selectedCustomer?.CustName}
|
||||||
|
</div>}
|
||||||
|
{selectedCustomer?.value && <div>
|
||||||
|
<span style={{ fontWeight: '500' }}>Customer Mobile: </span>{selectedCustomer?.value}
|
||||||
|
</div>}
|
||||||
|
</div>
|
||||||
|
<Tables
|
||||||
|
columns={columns}
|
||||||
|
data={priceHistory}
|
||||||
|
dataSource={priceHistory}
|
||||||
|
ownPagination={true}
|
||||||
|
pagination={{
|
||||||
|
current: page,
|
||||||
|
onChange: handlePageChange,
|
||||||
|
defaultPageSize: 10,
|
||||||
|
showSizeChanger: false,
|
||||||
|
hideOnSinglePage: true,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</>}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default CustomerPriceHistory
|
||||||
|
|
@ -18,6 +18,7 @@ const ShortcutKeyHelper = ({}) => {
|
||||||
{ key: 'Alt + W', description: 'Hold and Recall' },
|
{ key: 'Alt + W', description: 'Hold and Recall' },
|
||||||
{ key: 'Ctrl + Q', description: 'Qty Change' },
|
{ key: 'Ctrl + Q', description: 'Qty Change' },
|
||||||
{ key: 'Ctrl + E', description: 'Price Change' },
|
{ key: 'Ctrl + E', description: 'Price Change' },
|
||||||
|
{ key: 'Ctrl + I', description: 'Customer Rate History' },
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue