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