Update src/Pages/BookingScreen/Components/BSBillingTables/ComboSalesBillTable/ComboSalesBillTable.jsx

This commit is contained in:
karthikalakshmi 2026-03-03 10:05:13 +05:30
parent acd9e74185
commit 7f817033b8
1 changed files with 61 additions and 56 deletions

View File

@ -106,6 +106,11 @@ const ComboSalesBillTable = () => {
setting?.SettingIdName?.toLowerCase() === 'decimal' &&
setting?.SettingValue === 'Y'
);
const imeiModal = preferenceDatas?.[0]?.SettingDtlDetails?.some(
(setting) =>
setting?.SettingIdName?.toLowerCase() === 'imeidetails' &&
setting?.SettingValue === 'Y'
);
const SessionData = useSelector(StoredSessionData);
const BranchId = SessionData?.BranchId;
const AppId = SessionData?.AppId;
@ -159,13 +164,13 @@ const ComboSalesBillTable = () => {
OrderType === 'Hold'
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
: tableData?.filter(
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
);
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
);
const OldtableDataTakeAway =
OrderType != 'Hold'
? tableData?.filter(
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
)
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
)
: [];
const [EditQuantity, setEditQuantity] = useState(false);
@ -1233,9 +1238,9 @@ const ComboSalesBillTable = () => {
)?.map((item, idx) =>
idx === 0
? {
...item,
FreeQty,
}
...item,
FreeQty,
}
: item
),
};
@ -2480,11 +2485,11 @@ const ComboSalesBillTable = () => {
tableDataDinein?.length >= PreviousdataLength
? 'wheat'
: BookingType !== 'Dine In' &&
triggerAnimation &&
OldtableDataTakeAway?.length + index === 0 &&
tableDataDinein?.length >= PreviousdataLength &&
!HoldOrderDtl &&
!UnpaidData
triggerAnimation &&
OldtableDataTakeAway?.length + index === 0 &&
tableDataDinein?.length >= PreviousdataLength &&
!HoldOrderDtl &&
!UnpaidData
? 'wheat'
: 'inherit'
: 'none',
@ -2492,9 +2497,9 @@ const ComboSalesBillTable = () => {
row?.SalesId && OrderType !== 'Hold'
? 'rgb(243, 248, 213)'
: GlobEstBooking === 'ParEst' &&
GlobProdwisedata?.includes(
row?.InwardDtlId + ' ' + row?.BookingTypeName
)
GlobProdwisedata?.includes(
row?.InwardDtlId + ' ' + row?.BookingTypeName
)
? '#b2d1f7'
: (OldtableDataTakeAway?.length + index) % 2 === 0
? 'white'
@ -2537,45 +2542,45 @@ const ComboSalesBillTable = () => {
{/* Product Name / Item */}
{(item.OptionName === 'Item' ||
item.OptionName === 'Product Name') && (
<td
key={`prod-${index}`}
className={`productNameTd ${isActiveCell ? 'active-cell' : ''}`}
<td
key={`prod-${index}`}
className={`productNameTd ${isActiveCell ? 'active-cell' : ''}`}
onClick={() => {
dispatch(changeCombofocus(true));
row.FullProductIdentifierDtls?.length > 0 ||
row.ProductIdentifierDtls?.length > 0
? handleImeiDetails(row)
? handleImeiDetails(row)
: editField && handleEditQuantity(row);
}}
>
{row?.Type !== 'OS' ? row.ProdName : row.ServiceName}
{row?.BrandName ? ` ${row.BrandName}` : ''}
{row?.Type !== 'C' && (
<p
// className="Tbl3-Variant"
className={
isActiveCell
? 'Tbl3VariantActve'
: 'Tbl3-Variant'
}
>
{/* {row?.ProdVariantName} {row?.Size} {row?.UomName} */}
(
{!row?.ProdVariantName?.toLowerCase()?.includes(
'variant'
) && <span>{row?.ProdVariantName} </span>}
{row?.Size}
{row?.SinglePc == 'Y' ? 'PCS' : row?.UomName})
</p>
)}
{row?.Type === 'C' &&
row.ProdDetail?.map((prod, idx) => (
<p key={idx}>
{prod.ProdName} - {prod.Size} {prod.UomName}
>
{row?.Type !== 'OS' ? row.ProdName : row.ServiceName}
{row?.BrandName ? ` ${row.BrandName}` : ''}
{row?.Type !== 'C' && (
<p
// className="Tbl3-Variant"
className={
isActiveCell
? 'Tbl3VariantActve'
: 'Tbl3-Variant'
}
>
{/* {row?.ProdVariantName} {row?.Size} {row?.UomName} */}
(
{!row?.ProdVariantName?.toLowerCase()?.includes(
'variant'
) && <span>{row?.ProdVariantName} </span>}
{row?.Size}
{row?.SinglePc == 'Y' ? 'PCS' : row?.UomName})
</p>
))}
</td>
)}
)}
{row?.Type === 'C' &&
row.ProdDetail?.map((prod, idx) => (
<p key={idx}>
{prod.ProdName} - {prod.Size} {prod.UomName}
</p>
))}
</td>
)}
{/* Barcode */}
{item.OptionName === 'Barcode' && (
@ -2604,9 +2609,9 @@ const ComboSalesBillTable = () => {
tabIndex={0}
className={`${
EditQtyCombo && row?.localId === Index
? 'EditQTYcomboTD'
: 'qtyTd'
} ${isActiveCell ? 'active-cell' : ''}`}
? 'EditQTYcomboTD'
: 'qtyTd'
} ${isActiveCell ? 'active-cell' : ''}`}
onClick={() => {
dispatch(changeCombofocus(true));
editField && handleEditQuantityCombo(row);
@ -2670,9 +2675,9 @@ const ComboSalesBillTable = () => {
>
{row?.Offer > 0
? `${(
(row.Offer / (row?.OrderQty * row?.OrderRate)) *
100
).toFixed(2)}%`
(row.Offer / (row?.OrderQty * row?.OrderRate)) *
100
).toFixed(2)}%`
: '-'}
</td>
)}
@ -2704,8 +2709,8 @@ const ComboSalesBillTable = () => {
>
{allowDecimal
? Number(row.TotalAmt - (row?.Offer || 0)).toFixed(
2
)
2
)
: Number(row.TotalAmt - (row?.Offer || 0))}
</td>
)}
@ -2748,7 +2753,7 @@ const ComboSalesBillTable = () => {
<td
key={`delete-${index}`}
className={`deleteTd ${isActiveCell ? 'active-cell' : ''}`}
// className=""
// className=""
>
<AiOutlineClose
onClick={() => removeFromCart(row)}