From a123ddfe5ef214b171112644bfba2d0086b80861 Mon Sep 17 00:00:00 2001 From: Tamilselvan Date: Thu, 5 Mar 2026 11:30:24 +0530 Subject: [PATCH] priceoveride --- .../BSBillingTable1/BSBillingTable1.jsx | 25 +- .../BSBillingTable1/BST1Payment.jsx | 389 ++++++++-------- .../BSBillingTable2/BSBillingTable2.jsx | 404 +++++++++-------- .../BSBillingTable3/BSBillingTable3.jsx | 12 +- .../BSBillingTable4/BSBilling4Payment.jsx | 429 +++++++++--------- .../BSBillingTable4/BSBillingTable4.jsx | 16 +- .../BSBillingTable5/BSBillingTable5.jsx | 369 +++++++-------- .../BSBillingTable6/BSBillingTable6.jsx | 29 +- .../BSBillingTable6/BST6Payment.jsx | 401 ++++++++-------- .../BSBillingTable7/BSBilling7Payment.jsx | 103 ++--- .../BSBillingTable7/BSBillingTable7.jsx | 62 +-- .../StandardTable/StandardTable.jsx | 70 +-- .../StandardTable/StandardTablePayment.jsx | 271 +++++------ 13 files changed, 1300 insertions(+), 1280 deletions(-) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx index e83c74b..667a927 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BSBillingTable1.jsx @@ -2454,12 +2454,12 @@ const BSBillingTable1 = () => { {item?.Type != 'C' ? item.Offer && item.Offer > 0 ? item.Offer - : '-' + : item.DiscountAmt ? item.DiscountAmt : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' - ? `₹${item.OfferPrice}` + ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( @@ -2745,12 +2745,12 @@ const BSBillingTable1 = () => { {item?.Type != 'C' ? item.Offer && item.Offer > 0 ? item.Offer - : '-' + : item.DiscountAmt ? item.DiscountAmt : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' - ? `₹${item.OfferPrice}` + ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( @@ -3090,12 +3090,12 @@ const BSBillingTable1 = () => { {item?.Type != 'C' ? item.Offer && item.Offer > 0 ? item.Offer - : '-' + : item.DiscountAmt ? item.DiscountAmt : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' - ? `₹${item.OfferPrice}` + ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( @@ -3413,15 +3413,16 @@ const BSBillingTable1 = () => { } }} > + {item?.Type != 'C' ? item.Offer && item.Offer > 0 ? item.Offer - : '-' + : item.DiscountAmt ? item.DiscountAmt : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' - ? `₹${item.OfferPrice}` + ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BST1Payment.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BST1Payment.jsx index 8a51da2..b1b3f14 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BST1Payment.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable1/BST1Payment.jsx @@ -260,7 +260,7 @@ export default function BST1Payment() { const RetailWSSalesType = useSelector(GlobalRetailWSSalesType); const SelCustId = useSelector(GlobalSelCustId); const selOption = useSelector(GlobalSelOption); - console.log(selOption, 'selOptionbst234343',GetCustId); + console.log(selOption, 'selOptionbst234343', GetCustId); const SelectedTableDetails = useSelector(GlobalSelectedTableDetails); const GlobalAddCustomerDetails1 = useSelector(GlobalAddCustomerDetails); @@ -728,7 +728,7 @@ export default function BST1Payment() { setEmpData(datas?.[0]); }; const getCustomerData = async () => { - await dispatch( + await dispatch( getAddCustomerDetails({ CompId: CompId, AppId: AppId, @@ -905,7 +905,7 @@ export default function BST1Payment() { const selectedStyle = stylesMap[ - printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle + printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle ]; if (selectedStyle) { @@ -2026,15 +2026,15 @@ export default function BST1Payment() { OrderStatus: 'O', OrderType: BookingType === 'Dine In' || - BookingTypeBoth || - Estimation?.SettingValue == 'N' + BookingTypeBoth || + Estimation?.SettingValue == 'N' ? 'S' : GlobEstBooking === 'OvrAllEst' ? 'E' : GlobEstBooking === 'ParEst' ? GlobProdwisedata?.includes( - a.InwardDtlId + ' ' + a?.BookingTypeName - ) + a.InwardDtlId + ' ' + a?.BookingTypeName + ) ? 'E' : 'S' : 'S', @@ -2051,6 +2051,9 @@ export default function BST1Payment() { BatchRef: a.BatchRef, PackageDtl: a.PackageDtl, SetCount: a.SetCount, + ...(a?.DiscountValue && { DiscountValue: a.DiscountValue }), + ...(a?.DiscountType && { DiscountType: a.DiscountType }), + ...(a?.DiscountAmt && { DiscountAmt: a.DiscountAmt }) })); const NotSlectedTypeFind = temporderdetail?.find( (a) => a?.BookingType != SelectedBookingType @@ -2124,7 +2127,7 @@ export default function BST1Payment() { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', OrderDtlDetails: @@ -2141,9 +2144,9 @@ export default function BST1Payment() { ? globalTipAmount === 0 ? SelectedTableDetails : SelectedTableDetails?.map((item) => ({ - ...item, - TipsAmount: globalTipAmount, - })) + ...item, + TipsAmount: globalTipAmount, + })) : null, SalesPaymentType: 'normal', @@ -2159,8 +2162,8 @@ export default function BST1Payment() { ? PaymentgatewayUPI?.[0]?.ModeId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.ModeId + (busupi) => busupi?.ModeId === UpiId + )?.ModeId : paybtnselected : paybtnselected ? paybtnselected @@ -2173,15 +2176,15 @@ export default function BST1Payment() { salesBillEdit && currentOrderNetAmount < previousNetAmount ? null : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'business' + SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantId + ?.MerchantId : null, PaymentOptionType: salesBillEdit && - currentOrderNetAmount < previousNetAmount && - (refundPaySelectedName?.toLowerCase() === 'cash' || - refundPaySelectedName?.toLowerCase() === 'credit') + currentOrderNetAmount < previousNetAmount && + (refundPaySelectedName?.toLowerCase() === 'cash' || + refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' : Paybtnnameselected?.toLowerCase() === 'cash' ? 'PC' @@ -2201,29 +2204,29 @@ export default function BST1Payment() { ? null : SelectedUPIPayOption?.toLowerCase() === 'default' ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) - ?.UPIDetailId + ?.UPIDetailId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.MerchantUPIId + (busupi) => busupi?.ModeId === UpiId + )?.MerchantUPIId : null, AccountDtl: salesBillEdit && currentOrderNetAmount < previousNetAmount ? [] : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( - (upipay) => upipay?.UPIId === UpiId - ) + (upipay) => upipay?.UPIId === UpiId + ) : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pd') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pd') + SelectedUPIPayOption?.toLowerCase() === 'pd') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pd') ? useOptions?.[0]?.PaymentDetails?.PaymentDevice : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pg') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pg') + SelectedUPIPayOption?.toLowerCase() === 'pg') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pg') ? useOptions?.[0]?.PaymentDetails?.PaymentGateway : [], PaymentStatus: @@ -2234,13 +2237,13 @@ export default function BST1Payment() { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', Debit: salesBillEdit && - currentOrderNetAmount < previousNetAmount && - refundPaySelectedName?.toLowerCase() === 'credit' + currentOrderNetAmount < previousNetAmount && + refundPaySelectedName?.toLowerCase() === 'credit' ? Math.round(previousNetAmount - currentOrderNetAmount) : 0, Credit: salesBillEdit @@ -2316,14 +2319,14 @@ export default function BST1Payment() { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2480,14 +2483,14 @@ export default function BST1Payment() { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2588,14 +2591,14 @@ export default function BST1Payment() { } setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); if (response?.data?.OrderDetails?.length > 0) { setPrintOrderDetails([response?.data]); @@ -2770,14 +2773,14 @@ export default function BST1Payment() { setMessageType('success'); setMessageData( bookingpaymentupdate?.data?.response + - ' ' + - (bookingpaymentupdate?.data?.OrderDetails?.length > 0 - ? bookingpaymentupdate?.data?.OrderId && - extractLastNumberOrderId( - bookingpaymentupdate?.data?.OrderId, - bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus - ) - : '') + ' ' + + (bookingpaymentupdate?.data?.OrderDetails?.length > 0 + ? bookingpaymentupdate?.data?.OrderId && + extractLastNumberOrderId( + bookingpaymentupdate?.data?.OrderId, + bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus + ) + : '') ); bookingpaymentupdate?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([bookingpaymentupdate?.data]); @@ -2795,7 +2798,7 @@ export default function BST1Payment() { if ( Date.now() - startTime > useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * - 60000 + 60000 ) { // 60,000 ms = 1 minute @@ -3575,31 +3578,31 @@ export default function BST1Payment() { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, }} > {paybtns?.length > 0 && - currentOrderNetAmount >= previousNetAmount ? ( + currentOrderNetAmount >= previousNetAmount ? ( paybtns?.map((payment) => (
- - - ) + Hold +

+ + + + ) : ''} {unpaidFlow == false ? item?.OptionName == 'Hold' && - BookingType !== 'Dine In' && - !BookingTypeBoth && - Holddata?.length > 0 && - OrderCardDetail?.length == 0 && - CheckBookingStatus != 'Close' && - paybtns?.length > 0 && - !addnewAccess && ( - - {' '} - - HandleholdModelOpen()} - style={{ - fontSize: '28px', - cursor: 'pointer', - color: Holddata ? '#52c41a' : 'default', - pointerEvents: - OrderType === 'Failed' ? 'none' : 'auto', - }} - /> - - - ) + BookingType !== 'Dine In' && + !BookingTypeBoth && + Holddata?.length > 0 && + OrderCardDetail?.length == 0 && + CheckBookingStatus != 'Close' && + paybtns?.length > 0 && + !addnewAccess && ( + + {' '} + + HandleholdModelOpen()} + style={{ + fontSize: '28px', + cursor: 'pointer', + color: Holddata ? '#52c41a' : 'default', + pointerEvents: + OrderType === 'Failed' ? 'none' : 'auto', + }} + /> + + + ) : ''} ))} @@ -4357,9 +4359,9 @@ const BSBillingTable2 = () => { addnewAccess ? 'billing-btn-deactive' : FirstPaymentclick === false && - OrderCardDetail?.length > 0 && - paybtnselected && - CheckBookingStatus != 'Close' + OrderCardDetail?.length > 0 && + paybtnselected && + CheckBookingStatus != 'Close' ? salesBillEdit && currentOrderNetAmount < previousNetAmount ? 'billing-btn' @@ -4610,14 +4612,14 @@ const BSBillingTable2 = () => { OrderType === 'Failed' ? FailedTotalAmt : Math.round( - OrderCardDetail?.reduce( - (acc, data) => data?.TotalAmt + acc, - 0 - ) - - ((OverAllSales > 0 ? OverAllSales : 0) + - (OverAllEstimate > 0 ? OverAllEstimate : 0) + - (Discount > 0 ? Discount : 0)) - ) + OrderCardDetail?.reduce( + (acc, data) => data?.TotalAmt + acc, + 0 + ) - + ((OverAllSales > 0 ? OverAllSales : 0) + + (OverAllEstimate > 0 ? OverAllEstimate : 0) + + (Discount > 0 ? Discount : 0)) + ) } failedOrderData={failedOrderData} /> @@ -4752,9 +4754,9 @@ const BSBillingTable2 = () => { const qty = isGroup ? OrderCardDetail.filter((o) => o.id === groupKey).reduce( - (sum, o) => sum + (o.OrderQty || 1), - 0 - ) + (sum, o) => sum + (o.OrderQty || 1), + 0 + ) : item.OrderQty || 1; return ( diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3.jsx index 400438c..be268ef 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3.jsx @@ -2596,15 +2596,15 @@ const BSBillingTable3 = () => { } }} > - {item?.Type != 'C' + {item?.Type != 'C' ? item.Offer && item.Offer > 0 ? item.Offer - :item.DiscountAmt ? item.DiscountAmt : '-' + : item.DiscountAmt ? item.DiscountAmt : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( @@ -2881,7 +2881,7 @@ const BSBillingTable3 = () => { ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( @@ -3206,7 +3206,7 @@ const BSBillingTable3 = () => { ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} @@ -3516,7 +3516,7 @@ const BSBillingTable3 = () => { ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBilling4Payment.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBilling4Payment.jsx index 0bc7c84..908c4a1 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBilling4Payment.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable4/BSBilling4Payment.jsx @@ -881,7 +881,7 @@ const BSBilling4Payment = () => { const selectedStyle = stylesMap[ - printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle + printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle ]; console.log(selectedStyle, style, 'style'); if (selectedStyle) { @@ -2128,15 +2128,15 @@ const BSBilling4Payment = () => { OrderStatus: 'O', OrderType: BookingType === 'Dine In' || - BookingTypeBoth || - Estimation?.SettingValue == 'N' + BookingTypeBoth || + Estimation?.SettingValue == 'N' ? 'S' : GlobEstBooking === 'OvrAllEst' ? 'E' : GlobEstBooking === 'ParEst' ? GlobProdwisedata?.includes( - a.InwardDtlId + ' ' + a?.BookingTypeName - ) + a.InwardDtlId + ' ' + a?.BookingTypeName + ) ? 'E' : 'S' : 'S', @@ -2154,6 +2154,9 @@ const BSBilling4Payment = () => { PackageDtl: a.PackageDtl, SetCount: a.SetCount, BookingDate: AvailableDate ? a.BookedDate : null, + ...(a?.DiscountValue && { DiscountValue: a.DiscountValue }), + ...(a?.DiscountType && { DiscountType: a.DiscountType }), + ...(a?.DiscountAmt && { DiscountAmt: a.DiscountAmt }) })); const NotSlectedTypeFind = temporderdetail?.find( (a) => a?.BookingType != SelectedBookingType @@ -2229,7 +2232,7 @@ const BSBilling4Payment = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', OrderDtlDetails: @@ -2246,9 +2249,9 @@ const BSBilling4Payment = () => { ? globalTipAmount === 0 ? SelectedTableDetails : SelectedTableDetails?.map((item) => ({ - ...item, - TipsAmount: globalTipAmount, - })) + ...item, + TipsAmount: globalTipAmount, + })) : null, SalesPaymentType: 'normal', PaymentDetail: [ @@ -2263,8 +2266,8 @@ const BSBilling4Payment = () => { ? PaymentgatewayUPI?.[0]?.ModeId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.ModeId + (busupi) => busupi?.ModeId === UpiId + )?.ModeId : paybtnselected : paybtnselected ? paybtnselected @@ -2277,15 +2280,15 @@ const BSBilling4Payment = () => { salesBillEdit && currentOrderNetAmount < previousNetAmount ? null : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'business' + SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantId + ?.MerchantId : null, PaymentOptionType: salesBillEdit && - currentOrderNetAmount < previousNetAmount && - (refundPaySelectedName?.toLowerCase() === 'cash' || - refundPaySelectedName?.toLowerCase() === 'credit') + currentOrderNetAmount < previousNetAmount && + (refundPaySelectedName?.toLowerCase() === 'cash' || + refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' : Paybtnnameselected?.toLowerCase() === 'cash' ? 'PC' @@ -2305,29 +2308,29 @@ const BSBilling4Payment = () => { ? null : SelectedUPIPayOption?.toLowerCase() === 'default' ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) - ?.UPIDetailId + ?.UPIDetailId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.MerchantUPIId + (busupi) => busupi?.ModeId === UpiId + )?.MerchantUPIId : null, AccountDtl: salesBillEdit && currentOrderNetAmount < previousNetAmount ? [] : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( - (upipay) => upipay?.UPIId === UpiId - ) + (upipay) => upipay?.UPIId === UpiId + ) : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pd') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pd') + SelectedUPIPayOption?.toLowerCase() === 'pd') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pd') ? useOptions?.[0]?.PaymentDetails?.PaymentDevice : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pg') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pg') + SelectedUPIPayOption?.toLowerCase() === 'pg') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pg') ? useOptions?.[0]?.PaymentDetails?.PaymentGateway : [], PaymentStatus: @@ -2338,13 +2341,13 @@ const BSBilling4Payment = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', Debit: salesBillEdit && - currentOrderNetAmount < previousNetAmount && - refundPaySelectedName?.toLowerCase() === 'credit' + currentOrderNetAmount < previousNetAmount && + refundPaySelectedName?.toLowerCase() === 'credit' ? Math.round(previousNetAmount - currentOrderNetAmount) : 0, Credit: salesBillEdit @@ -2422,14 +2425,14 @@ const BSBilling4Payment = () => { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2590,14 +2593,14 @@ const BSBilling4Payment = () => { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2704,14 +2707,14 @@ const BSBilling4Payment = () => { } setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); if (response?.data?.OrderDetails?.length > 0) { setPrintOrderDetails([response?.data]); @@ -2887,14 +2890,14 @@ const BSBilling4Payment = () => { setMessageType('success'); setMessageData( bookingpaymentupdate?.data?.response + - ' ' + - (bookingpaymentupdate?.data?.OrderDetails?.length > 0 - ? bookingpaymentupdate?.data?.OrderId && - extractLastNumberOrderId( - bookingpaymentupdate?.data?.OrderId, - bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus - ) - : '') + ' ' + + (bookingpaymentupdate?.data?.OrderDetails?.length > 0 + ? bookingpaymentupdate?.data?.OrderId && + extractLastNumberOrderId( + bookingpaymentupdate?.data?.OrderId, + bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus + ) + : '') ); bookingpaymentupdate?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([bookingpaymentupdate?.data]); @@ -2913,7 +2916,7 @@ const BSBilling4Payment = () => { if ( Date.now() - startTime > useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * - 60000 + 60000 ) { // 60,000 ms = 1 minute @@ -3150,9 +3153,9 @@ const BSBilling4Payment = () => { AppId: AppId, ...(AvailableDate && selectedDate ? { - fromDate: selectedDate?.[0], - toDate: selectedDate?.[1], - } + fromDate: selectedDate?.[0], + toDate: selectedDate?.[1], + } : {}), }; await dispatch(getSelectedFavItems(data)).unwrap(); @@ -3164,9 +3167,9 @@ const BSBilling4Payment = () => { ProdSubCat: ProdSubCat, ...(AvailableDate && selectedDate ? { - fromDate: selectedDate?.[0], - toDate: selectedDate?.[1], - } + fromDate: selectedDate?.[0], + toDate: selectedDate?.[1], + } : {}), }; @@ -3177,9 +3180,9 @@ const BSBilling4Payment = () => { prodCat: prodCat, ...(AvailableDate && selectedDate ? { - fromDate: selectedDate?.[0], - toDate: selectedDate?.[1], - } + fromDate: selectedDate?.[0], + toDate: selectedDate?.[1], + } : {}), }; @@ -3806,9 +3809,9 @@ const BSBilling4Payment = () => { 'not-allowed', color: OrderCardDetail?.length > 0 || - (selOption?.value === undefined && - GlobalAddCustomerDetails1?.length === 0 && - GetCustId?.CustMobile === undefined) + (selOption?.value === undefined && + GlobalAddCustomerDetails1?.length === 0 && + GetCustId?.CustMobile === undefined) ? 'gray' : 'rgb(18, 146, 238)', fontSize: '28px', @@ -3829,16 +3832,16 @@ const BSBilling4Payment = () => { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, width: '2rem', @@ -3859,14 +3862,14 @@ const BSBilling4Payment = () => { width: '1.5rem', cursor: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'not-allowed' : 'pointer', color: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'gray' : 'rgb(18, 146, 238)', display: 'flex', @@ -3896,14 +3899,14 @@ const BSBilling4Payment = () => { width: '1.5rem', cursor: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'not-allowed' : 'pointer', color: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'gray' : 'rgb(18, 146, 238)', display: 'flex', @@ -3921,39 +3924,39 @@ const BSBilling4Payment = () => { {/* Customer Orders */} {(SelCustId && tableOptions?.filter((item) => item.OptionName === 'PreviousBillFetch') - .length === 1) && ( - - {' '} -
{ - if ( - CheckBookingStatus !== 'Close' && - !addnewAccess && - !(OrderCardDetail?.length > 0) - ) { - setCustomerPreviesOrders(true); - } - }} - style={{ - cursor: OrderCardDetail?.length > 0 && 'not-allowed', - color: - OrderCardDetail?.length > 0 || - (OrderCardDetail?.length > 0 && - GetCustId?.CustMobile === undefined) - ? 'gray' - : 'rgb(18, 146, 238)', - fontSize: '25px', - display: 'flex', - alignItems: 'center', - height: '2.46rem', - width: '1.5rem', - }} - > - -
-
- )} + .length === 1) && ( + + {' '} +
{ + if ( + CheckBookingStatus !== 'Close' && + !addnewAccess && + !(OrderCardDetail?.length > 0) + ) { + setCustomerPreviesOrders(true); + } + }} + style={{ + cursor: OrderCardDetail?.length > 0 && 'not-allowed', + color: + OrderCardDetail?.length > 0 || + (OrderCardDetail?.length > 0 && + GetCustId?.CustMobile === undefined) + ? 'gray' + : 'rgb(18, 146, 238)', + fontSize: '25px', + display: 'flex', + alignItems: 'center', + height: '2.46rem', + width: '1.5rem', + }} + > + +
+
+ )} {tabledata?.length > 0 && (
{tableOptions @@ -4021,66 +4024,66 @@ const BSBilling4Payment = () => { <> {unpaidFlow == false ? item?.OptionName == 'Hold' && - BookingType !== 'Dine In' && - !BookingTypeBoth && - OrderCardDetail?.length != 0 && - CheckOrderType?.length === 0 && - OrderType != 'Failed' && - paybtns?.length > 0 && - CheckBookingStatus != 'Close' && - !addnewAccess && ( - - {' '} - AddBookingDetails('Hold')} - style={{ - fontSize: '30px', - cursor: 'pointer', - color: '' ? '#52c41a' : '#1292EE', - }} - /> - - ) + BookingType !== 'Dine In' && + !BookingTypeBoth && + OrderCardDetail?.length != 0 && + CheckOrderType?.length === 0 && + OrderType != 'Failed' && + paybtns?.length > 0 && + CheckBookingStatus != 'Close' && + !addnewAccess && ( + + {' '} + AddBookingDetails('Hold')} + style={{ + fontSize: '30px', + cursor: 'pointer', + color: '' ? '#52c41a' : '#1292EE', + }} + /> + + ) : ''} {unpaidFlow == false ? item?.OptionName == 'Hold' && - BookingType !== 'Dine In' && - !BookingTypeBoth && - Holddata?.length > 0 && - OrderCardDetail?.length == 0 && - paybtns?.length > 0 && - CheckBookingStatus != 'Close' && - !addnewAccess && ( - 0 && + OrderCardDetail?.length == 0 && + paybtns?.length > 0 && + CheckBookingStatus != 'Close' && + !addnewAccess && ( + + {' '} + - {' '} - - HandleholdModelOpen()} - style={{ - fontSize: '28px', - cursor: 'pointer', - color: Holddata ? '#52c41a' : 'default', - pointerEvents: - OrderType === 'Failed' - ? 'none' - : 'auto', - }} - /> - - - ) + HandleholdModelOpen()} + style={{ + fontSize: '28px', + cursor: 'pointer', + color: Holddata ? '#52c41a' : 'default', + pointerEvents: + OrderType === 'Failed' + ? 'none' + : 'auto', + }} + /> + + + ) : ''} ))} @@ -4106,31 +4109,31 @@ const BSBilling4Payment = () => { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, }} > {paybtns?.length > 0 && - currentOrderNetAmount >= previousNetAmount ? ( + currentOrderNetAmount >= previousNetAmount ? ( paybtns?.map((payment) => (
- - ) + !BookingTypeBoth && + BookingType !== 'Dine In' && + OrderCardDetail?.length != 0 && + CheckOrderType?.length === 0 && + OrderType != 'Failed' && + paybtns?.length > 0 && + CheckBookingStatus != 'Close' && + !addnewAccess && ( + + + + ) : ''} {unpaidFlow === false && item?.OptionName === 'Hold' && @@ -4357,9 +4360,9 @@ const BSBillingTable5 = () => { addnewAccess ? 'BSBIllingTable5-paybtn-noitems-disable' : FirstPaymentclick === false && - OrderCardDetail?.length > 0 && - paybtnselected && - CheckBookingStatus != 'Close' + OrderCardDetail?.length > 0 && + paybtnselected && + CheckBookingStatus != 'Close' ? !OrderStatus ? salesBillEdit && currentOrderNetAmount < previousNetAmount @@ -4378,7 +4381,7 @@ const BSBillingTable5 = () => { > {!OrderStatus ? ( salesBillEdit && - currentOrderNetAmount < previousNetAmount ? ( + currentOrderNetAmount < previousNetAmount ? (
Refund: ₹ {(previousNetAmount || 0) - @@ -4601,14 +4604,14 @@ const BSBillingTable5 = () => { OrderType === 'Failed' ? FailedTotalAmt : Math.round( - OrderCardDetail?.reduce( - (acc, data) => data?.TotalAmt + acc, - 0 - ) - - ((OverAllSales > 0 ? OverAllSales : 0) + - (OverAllEstimate > 0 ? OverAllEstimate : 0) + - (Discount > 0 ? Discount : 0)) - ) + OrderCardDetail?.reduce( + (acc, data) => data?.TotalAmt + acc, + 0 + ) - + ((OverAllSales > 0 ? OverAllSales : 0) + + (OverAllEstimate > 0 ? OverAllEstimate : 0) + + (Discount > 0 ? Discount : 0)) + ) } failedOrderData={failedOrderData} /> @@ -4636,14 +4639,14 @@ const BSBillingTable5 = () => { {(filteredSettingNames?.includes('Print') || !MobileNoWhatsApp || !MobileNoWhatsApp.value) && ( - - )} + + )} {filteredSettingNames?.includes('SMS') && isMobile && ( { const qty = isGroup ? OrderCardDetail.filter((o) => o.id === groupKey).reduce( - (sum, o) => sum + (o.OrderQty || 1), - 0 - ) + (sum, o) => sum + (o.OrderQty || 1), + 0 + ) : item.OrderQty || 1; return ( diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx index ba0b56a..2f75fe7 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BSBillingTable6.jsx @@ -2397,15 +2397,15 @@ const BSBillingTable6 = () => { } }} > - {item?.Type != 'C' - ? item.Offer + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 ? item.Offer - : '-' + : item.DiscountAmt ? item.DiscountAmt : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( @@ -2652,15 +2652,15 @@ const BSBillingTable6 = () => { } }} > - {item?.Type != 'C' - ? item.Offer + {item?.Type != 'C' + ? item.Offer && item.Offer > 0 ? item.Offer - : '-' + : item.DiscountAmt ? item.DiscountAmt : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( @@ -2954,14 +2954,14 @@ const BSBillingTable6 = () => { }} > {item?.Type != 'C' - ? item.Offer + ? item.Offer && item.Offer > 0 ? item.Offer - : '-' + : item.DiscountAmt ? item.DiscountAmt : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( @@ -3237,15 +3237,16 @@ const BSBillingTable6 = () => { } }} > + {item?.Type != 'C' - ? item.Offer + ? item.Offer && item.Offer > 0 ? item.Offer - : '-' + : item.DiscountAmt ? item.DiscountAmt : '-' : item?.OfferPrice && item?.OfferPrice > 0 ? item?.OfferType === 'F' ? `₹${safeRound(item.OfferPrice)}` : `${item.OfferPrice}%` - : '-'} + : item.DiscountAmt ? item.DiscountAmt : '-'} )} {tableitem.OptionName == 'Quantity' && ( diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BST6Payment.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BST6Payment.jsx index bf21da6..adaf9e1 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BST6Payment.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable6/BST6Payment.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState, useRef, lazy ,Suspense } from 'react'; +import React, { useEffect, useState, useRef, lazy, Suspense } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { useNavigate } from 'react-router-dom'; import moment from 'moment'; @@ -469,7 +469,7 @@ const BST6Payment = () => { // for customised invoice number const { invoiceDate, clearInvoiceDate } = useDateStore(); const CurrentOrderId = useSelector(GlobalCurrentOrderId); - const holdCheckedSalesSetup = tableOptions?.some( + const holdCheckedSalesSetup = tableOptions?.some( (item) => item?.OptionName === 'Hold' ); @@ -759,7 +759,7 @@ const BST6Payment = () => { const selectedStyle = stylesMap[ - printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle + printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle ]; if (selectedStyle) { @@ -2112,15 +2112,15 @@ const BST6Payment = () => { OrderStatus: 'O', OrderType: BookingType === 'Dine In' || - BookingTypeBoth || - Estimation?.SettingValue == 'N' + BookingTypeBoth || + Estimation?.SettingValue == 'N' ? 'S' : GlobEstBooking === 'OvrAllEst' ? 'E' : GlobEstBooking === 'ParEst' ? GlobProdwisedata?.includes( - a.InwardDtlId + ' ' + a?.BookingTypeName - ) + a.InwardDtlId + ' ' + a?.BookingTypeName + ) ? 'E' : 'S' : 'S', @@ -2137,6 +2137,9 @@ const BST6Payment = () => { BatchRef: a.BatchRef, PackageDtl: a.PackageDtl, SetCount: a.SetCount, + ...(a?.DiscountValue && { DiscountValue: a.DiscountValue }), + ...(a?.DiscountType && { DiscountType: a.DiscountType }), + ...(a?.DiscountAmt && { DiscountAmt: a.DiscountAmt }) })); const NotSlectedTypeFind = temporderdetail?.find( (a) => a?.BookingType != SelectedBookingType @@ -2210,7 +2213,7 @@ const BST6Payment = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', OrderDtlDetails: @@ -2227,9 +2230,9 @@ const BST6Payment = () => { ? globalTipAmount === 0 ? SelectedTableDetails : SelectedTableDetails?.map((item) => ({ - ...item, - TipsAmount: globalTipAmount, - })) + ...item, + TipsAmount: globalTipAmount, + })) : null, SalesPaymentType: 'normal', PaymentDetail: [ @@ -2244,8 +2247,8 @@ const BST6Payment = () => { ? PaymentgatewayUPI?.[0]?.ModeId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.ModeId + (busupi) => busupi?.ModeId === UpiId + )?.ModeId : paybtnselected : paybtnselected ? paybtnselected @@ -2258,15 +2261,15 @@ const BST6Payment = () => { salesBillEdit && currentOrderNetAmount < previousNetAmount ? null : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'business' + SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) - ?.MerchantId + ?.MerchantId : null, PaymentOptionType: salesBillEdit && - currentOrderNetAmount < previousNetAmount && - (refundPaySelectedName?.toLowerCase() === 'cash' || - refundPaySelectedName?.toLowerCase() === 'credit') + currentOrderNetAmount < previousNetAmount && + (refundPaySelectedName?.toLowerCase() === 'cash' || + refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' : Paybtnnameselected?.toLowerCase() === 'cash' ? 'PC' @@ -2286,29 +2289,29 @@ const BST6Payment = () => { ? null : SelectedUPIPayOption?.toLowerCase() === 'default' ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) - ?.UPIDetailId + ?.UPIDetailId : SelectedUPIPayOption?.toLowerCase() === 'business' ? BusinessPayOption?.find( - (busupi) => busupi?.ModeId === UpiId - )?.MerchantUPIId + (busupi) => busupi?.ModeId === UpiId + )?.MerchantUPIId : null, AccountDtl: salesBillEdit && currentOrderNetAmount < previousNetAmount ? [] : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( - (upipay) => upipay?.UPIId === UpiId - ) + (upipay) => upipay?.UPIId === UpiId + ) : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pd') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pd') + SelectedUPIPayOption?.toLowerCase() === 'pd') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pd') ? useOptions?.[0]?.PaymentDetails?.PaymentDevice : (Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'pg') || - (Paybtnnameselected?.toLowerCase() === 'card' && - SelectedCardOption?.toLowerCase() === 'pg') + SelectedUPIPayOption?.toLowerCase() === 'pg') || + (Paybtnnameselected?.toLowerCase() === 'card' && + SelectedCardOption?.toLowerCase() === 'pg') ? useOptions?.[0]?.PaymentDetails?.PaymentGateway : [], PaymentStatus: @@ -2319,13 +2322,13 @@ const BST6Payment = () => { : Paybtnnameselected?.toLowerCase() === 'credit' ? 'S' : Paybtnnameselected?.toLowerCase() === 'upi' && - SelectedUPIPayOption?.toLowerCase() === 'default' + SelectedUPIPayOption?.toLowerCase() === 'default' ? 'S' : 'P', Debit: salesBillEdit && - currentOrderNetAmount < previousNetAmount && - refundPaySelectedName?.toLowerCase() === 'credit' + currentOrderNetAmount < previousNetAmount && + refundPaySelectedName?.toLowerCase() === 'credit' ? Math.round(previousNetAmount - currentOrderNetAmount) : 0, Credit: salesBillEdit @@ -2402,14 +2405,14 @@ const BST6Payment = () => { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2570,14 +2573,14 @@ const BST6Payment = () => { setMessageType('success'); setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); response?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([response?.data]); @@ -2684,14 +2687,14 @@ const BST6Payment = () => { } setMessageData( response?.data?.response + - ' ' + - (response?.data?.OrderDetails?.length > 0 - ? response?.data?.OrderId && - extractLastNumberOrderId( - response?.data?.OrderId, - response?.data?.OrderDetails?.[0]?.FYStatus - ) - : '') + ' ' + + (response?.data?.OrderDetails?.length > 0 + ? response?.data?.OrderId && + extractLastNumberOrderId( + response?.data?.OrderId, + response?.data?.OrderDetails?.[0]?.FYStatus + ) + : '') ); if (response?.data?.OrderDetails?.length > 0) { setPrintOrderDetails([response?.data]); @@ -2867,14 +2870,14 @@ const BST6Payment = () => { setMessageType('success'); setMessageData( bookingpaymentupdate?.data?.response + - ' ' + - (bookingpaymentupdate?.data?.OrderDetails?.length > 0 - ? bookingpaymentupdate?.data?.OrderId && - extractLastNumberOrderId( - bookingpaymentupdate?.data?.OrderId, - bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus - ) - : '') + ' ' + + (bookingpaymentupdate?.data?.OrderDetails?.length > 0 + ? bookingpaymentupdate?.data?.OrderId && + extractLastNumberOrderId( + bookingpaymentupdate?.data?.OrderId, + bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus + ) + : '') ); bookingpaymentupdate?.data?.OrderDetails?.length > 0 && setPrintOrderDetails([bookingpaymentupdate?.data]); @@ -2893,7 +2896,7 @@ const BST6Payment = () => { if ( Date.now() - startTime > useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * - 60000 + 60000 ) { // 60,000 ms = 1 minute @@ -3596,59 +3599,59 @@ const BST6Payment = () => { <> {unpaidFlow == false ? item?.OptionName == 'Hold' && - BookingType !== 'Dine In' && - !BookingTypeBoth && - OrderCardDetail?.length != 0 && - CheckOrderType?.length === 0 && - OrderType != 'Failed' && - CheckBookingStatus != 'Close' && - paybtns?.length > 0 && - !addnewAccess && ( - - {' '} - AddBookingDetails('Hold')} - style={{ - fontSize: '30px', - cursor: 'pointer', - color: '' ? '#52c41a' : '#1292EE', - }} - /> - - ) + BookingType !== 'Dine In' && + !BookingTypeBoth && + OrderCardDetail?.length != 0 && + CheckOrderType?.length === 0 && + OrderType != 'Failed' && + CheckBookingStatus != 'Close' && + paybtns?.length > 0 && + !addnewAccess && ( + + {' '} + AddBookingDetails('Hold')} + style={{ + fontSize: '30px', + cursor: 'pointer', + color: '' ? '#52c41a' : '#1292EE', + }} + /> + + ) : ''} {unpaidFlow == false ? item?.OptionName == 'Hold' && - BookingType !== 'Dine In' && - !BookingTypeBoth && - Holddata?.length > 0 && - OrderCardDetail?.length == 0 && - CheckBookingStatus != 'Close' && - !addnewAccess && - paybtns?.length > 0 && - !OtherServicesglobal && ( - - {' '} - - HandleholdModelOpen()} - style={{ - fontSize: '28px', - cursor: 'pointer', - color: Holddata ? '#52c41a' : 'default', - pointerEvents: - OrderType === 'Failed' ? 'none' : 'auto', - }} - /> - - - ) + BookingType !== 'Dine In' && + !BookingTypeBoth && + Holddata?.length > 0 && + OrderCardDetail?.length == 0 && + CheckBookingStatus != 'Close' && + !addnewAccess && + paybtns?.length > 0 && + !OtherServicesglobal && ( + + {' '} + + HandleholdModelOpen()} + style={{ + fontSize: '28px', + cursor: 'pointer', + color: Holddata ? '#52c41a' : 'default', + pointerEvents: + OrderType === 'Failed' ? 'none' : 'auto', + }} + /> + + + ) : ''} ))} @@ -3659,16 +3662,16 @@ const BST6Payment = () => { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, width: '2rem', @@ -3688,14 +3691,14 @@ const BST6Payment = () => { width: '1.5rem', cursor: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'not-allowed' : 'pointer', color: OrderCardDetail?.length === 0 || - CheckBookingStatus == 'Close' || - addnewAccess + CheckBookingStatus == 'Close' || + addnewAccess ? 'gray' : 'rgb(18, 146, 238)', display: 'flex', @@ -3761,31 +3764,31 @@ const BST6Payment = () => { (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 'none' : 'auto', opacity: (BookingType === 'Dine In' || BookingTypeBoth || CheckOrderType?.length > 0) && - !unpaidFlow && - OrderStatus + !unpaidFlow && + OrderStatus ? 0.5 : 1, }} > {paybtns?.length > 0 && - currentOrderNetAmount >= previousNetAmount ? ( + currentOrderNetAmount >= previousNetAmount ? ( paybtns?.map((payment) => (