Merge pull request 'srinath' (#313) from srinath into main

Reviewed-on: Pozomind/pozo-retail-app#313
This commit is contained in:
karthikalakshmi 2026-03-26 12:07:43 +05:30
commit 286fefede5
8 changed files with 557 additions and 402 deletions

View File

@ -1416,6 +1416,13 @@ export const getOtherServiceTicket = createAsyncThunk(
} }
} }
); );
// post /cancelPayment
export const PostCancelPayment = createAsyncThunk(
'BookingData/cancelPayment',
async (postData) => {
return await axiosRetailInstanceData.post(`/cancelPayment`, postData);
}
);
export const PostBlockSlots = createAsyncThunk( export const PostBlockSlots = createAsyncThunk(
'BookingData/PostBlockSlots', 'BookingData/PostBlockSlots',
async (postData) => { async (postData) => {
@ -1444,6 +1451,7 @@ export const getPaymentStatusForBusinessUPI = createAsyncThunk(
} }
); );
export const getCurrentOrderid = createAsyncThunk( export const getCurrentOrderid = createAsyncThunk(
'BookingData/getcurrentorderid', 'BookingData/getcurrentorderid',

View File

@ -127,6 +127,7 @@ import {
changeSearchedData, changeSearchedData,
GlobalSelectedCustDisable, GlobalSelectedCustDisable,
GlobalOrderStatus, GlobalOrderStatus,
PostCancelPayment,
} from '../../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../../Features/BookingScreen/BookingData/BookingData';
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities'; import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
import { import {
@ -944,7 +945,7 @@ export default function BST1Payment() {
const selectedStyle = const selectedStyle =
stylesMap[ stylesMap[
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
]; ];
if (selectedStyle) { if (selectedStyle) {
@ -1392,6 +1393,15 @@ export default function BST1Payment() {
: AddBookingDetails(BookingType, true); : AddBookingDetails(BookingType, true);
} }
}; };
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
if (response?.data?.statusCode) {
ClearAllGlobalStateDatas();
CustomerDisplay();
setBusinessUPI(false);
}
}
const financialYearError = async () => { const financialYearError = async () => {
setMessageType('error'); setMessageType('error');
setMessageData('Financial Year-Based Sales Not Yet Started'); setMessageData('Financial Year-Based Sales Not Yet Started');
@ -2069,15 +2079,15 @@ export default function BST1Payment() {
OrderStatus: 'O', OrderStatus: 'O',
OrderType: OrderType:
BookingType === 'Dine In' || BookingType === 'Dine In' ||
BookingTypeBoth || BookingTypeBoth ||
Estimation?.SettingValue == 'N' Estimation?.SettingValue == 'N'
? 'S' ? 'S'
: GlobEstBooking === 'OvrAllEst' : GlobEstBooking === 'OvrAllEst'
? 'E' ? 'E'
: GlobEstBooking === 'ParEst' : GlobEstBooking === 'ParEst'
? GlobProdwisedata?.includes( ? GlobProdwisedata?.includes(
a.InwardDtlId + ' ' + a?.BookingTypeName a.InwardDtlId + ' ' + a?.BookingTypeName
) )
? 'E' ? 'E'
: 'S' : 'S'
: 'S', : 'S',
@ -2170,7 +2180,7 @@ export default function BST1Payment() {
: Paybtnnameselected?.toLowerCase() === 'credit' : Paybtnnameselected?.toLowerCase() === 'credit'
? 'S' ? 'S'
: Paybtnnameselected?.toLowerCase() === 'upi' && : Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'default' SelectedUPIPayOption?.toLowerCase() === 'default'
? 'S' ? 'S'
: 'P', : 'P',
OrderDtlDetails: OrderDtlDetails:
@ -2187,9 +2197,9 @@ export default function BST1Payment() {
? globalTipAmount === 0 ? globalTipAmount === 0
? SelectedTableDetails ? SelectedTableDetails
: SelectedTableDetails?.map((item) => ({ : SelectedTableDetails?.map((item) => ({
...item, ...item,
TipsAmount: globalTipAmount, TipsAmount: globalTipAmount,
})) }))
: null, : null,
SalesPaymentType: 'normal', SalesPaymentType: 'normal',
@ -2205,8 +2215,8 @@ export default function BST1Payment() {
? PaymentgatewayUPI?.[0]?.ModeId ? PaymentgatewayUPI?.[0]?.ModeId
: SelectedUPIPayOption?.toLowerCase() === 'business' : SelectedUPIPayOption?.toLowerCase() === 'business'
? BusinessPayOption?.find( ? BusinessPayOption?.find(
(busupi) => busupi?.ModeId === UpiId (busupi) => busupi?.ModeId === UpiId
)?.ModeId )?.ModeId
: paybtnselected : paybtnselected
: paybtnselected : paybtnselected
? paybtnselected ? paybtnselected
@ -2219,15 +2229,15 @@ export default function BST1Payment() {
salesBillEdit && currentOrderNetAmount < previousNetAmount salesBillEdit && currentOrderNetAmount < previousNetAmount
? null ? null
: Paybtnnameselected?.toLowerCase() === 'upi' && : Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'business' SelectedUPIPayOption?.toLowerCase() === 'business'
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
?.MerchantId ?.MerchantId
: null, : null,
PaymentOptionType: PaymentOptionType:
salesBillEdit && salesBillEdit &&
currentOrderNetAmount < previousNetAmount && currentOrderNetAmount < previousNetAmount &&
(refundPaySelectedName?.toLowerCase() === 'cash' || (refundPaySelectedName?.toLowerCase() === 'cash' ||
refundPaySelectedName?.toLowerCase() === 'credit') refundPaySelectedName?.toLowerCase() === 'credit')
? 'PC' ? 'PC'
: Paybtnnameselected?.toLowerCase() === 'cash' : Paybtnnameselected?.toLowerCase() === 'cash'
? 'PC' ? 'PC'
@ -2247,29 +2257,29 @@ export default function BST1Payment() {
? null ? null
: SelectedUPIPayOption?.toLowerCase() === 'default' : SelectedUPIPayOption?.toLowerCase() === 'default'
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
?.UPIDetailId ?.UPIDetailId
: SelectedUPIPayOption?.toLowerCase() === 'business' : SelectedUPIPayOption?.toLowerCase() === 'business'
? BusinessPayOption?.find( ? BusinessPayOption?.find(
(busupi) => busupi?.ModeId === UpiId (busupi) => busupi?.ModeId === UpiId
)?.MerchantUPIId )?.MerchantUPIId
: null, : null,
AccountDtl: AccountDtl:
salesBillEdit && currentOrderNetAmount < previousNetAmount salesBillEdit && currentOrderNetAmount < previousNetAmount
? [] ? []
: Paybtnnameselected?.toLowerCase() === 'upi' && : Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'default' SelectedUPIPayOption?.toLowerCase() === 'default'
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
(upipay) => upipay?.UPIId === UpiId (upipay) => upipay?.UPIId === UpiId
) )
: (Paybtnnameselected?.toLowerCase() === 'upi' && : (Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'pd') || SelectedUPIPayOption?.toLowerCase() === 'pd') ||
(Paybtnnameselected?.toLowerCase() === 'card' && (Paybtnnameselected?.toLowerCase() === 'card' &&
SelectedCardOption?.toLowerCase() === 'pd') SelectedCardOption?.toLowerCase() === 'pd')
? useOptions?.[0]?.PaymentDetails?.PaymentDevice ? useOptions?.[0]?.PaymentDetails?.PaymentDevice
: (Paybtnnameselected?.toLowerCase() === 'upi' && : (Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'pg') || SelectedUPIPayOption?.toLowerCase() === 'pg') ||
(Paybtnnameselected?.toLowerCase() === 'card' && (Paybtnnameselected?.toLowerCase() === 'card' &&
SelectedCardOption?.toLowerCase() === 'pg') SelectedCardOption?.toLowerCase() === 'pg')
? useOptions?.[0]?.PaymentDetails?.PaymentGateway ? useOptions?.[0]?.PaymentDetails?.PaymentGateway
: [], : [],
PaymentStatus: PaymentStatus:
@ -2280,13 +2290,13 @@ export default function BST1Payment() {
: Paybtnnameselected?.toLowerCase() === 'credit' : Paybtnnameselected?.toLowerCase() === 'credit'
? 'S' ? 'S'
: Paybtnnameselected?.toLowerCase() === 'upi' && : Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'default' SelectedUPIPayOption?.toLowerCase() === 'default'
? 'S' ? 'S'
: 'P', : 'P',
Debit: Debit:
salesBillEdit && salesBillEdit &&
currentOrderNetAmount < previousNetAmount && currentOrderNetAmount < previousNetAmount &&
refundPaySelectedName?.toLowerCase() === 'credit' refundPaySelectedName?.toLowerCase() === 'credit'
? Math.round(previousNetAmount - currentOrderNetAmount) ? Math.round(previousNetAmount - currentOrderNetAmount)
: 0, : 0,
Credit: salesBillEdit Credit: salesBillEdit
@ -2362,14 +2372,14 @@ export default function BST1Payment() {
setMessageType('success'); setMessageType('success');
setMessageData( setMessageData(
response?.data?.response + response?.data?.response +
' ' + ' ' +
(response?.data?.OrderDetails?.length > 0 (response?.data?.OrderDetails?.length > 0
? response?.data?.OrderId && ? response?.data?.OrderId &&
extractLastNumberOrderId( extractLastNumberOrderId(
response?.data?.OrderId, response?.data?.OrderId,
response?.data?.OrderDetails?.[0]?.FYStatus response?.data?.OrderDetails?.[0]?.FYStatus
) )
: '') : '')
); );
response?.data?.OrderDetails?.length > 0 && response?.data?.OrderDetails?.length > 0 &&
setPrintOrderDetails([response?.data]); setPrintOrderDetails([response?.data]);
@ -2526,14 +2536,14 @@ export default function BST1Payment() {
setMessageType('success'); setMessageType('success');
setMessageData( setMessageData(
response?.data?.response + response?.data?.response +
' ' + ' ' +
(response?.data?.OrderDetails?.length > 0 (response?.data?.OrderDetails?.length > 0
? response?.data?.OrderId && ? response?.data?.OrderId &&
extractLastNumberOrderId( extractLastNumberOrderId(
response?.data?.OrderId, response?.data?.OrderId,
response?.data?.OrderDetails?.[0]?.FYStatus response?.data?.OrderDetails?.[0]?.FYStatus
) )
: '') : '')
); );
response?.data?.OrderDetails?.length > 0 && response?.data?.OrderDetails?.length > 0 &&
setPrintOrderDetails([response?.data]); setPrintOrderDetails([response?.data]);
@ -2634,14 +2644,14 @@ export default function BST1Payment() {
} }
setMessageData( setMessageData(
response?.data?.response + response?.data?.response +
' ' + ' ' +
(response?.data?.OrderDetails?.length > 0 (response?.data?.OrderDetails?.length > 0
? response?.data?.OrderId && ? response?.data?.OrderId &&
extractLastNumberOrderId( extractLastNumberOrderId(
response?.data?.OrderId, response?.data?.OrderId,
response?.data?.OrderDetails?.[0]?.FYStatus response?.data?.OrderDetails?.[0]?.FYStatus
) )
: '') : '')
); );
if (response?.data?.OrderDetails?.length > 0) { if (response?.data?.OrderDetails?.length > 0) {
setPrintOrderDetails([response?.data]); setPrintOrderDetails([response?.data]);
@ -2816,14 +2826,14 @@ export default function BST1Payment() {
setMessageType('success'); setMessageType('success');
setMessageData( setMessageData(
bookingpaymentupdate?.data?.response + bookingpaymentupdate?.data?.response +
' ' + ' ' +
(bookingpaymentupdate?.data?.OrderDetails?.length > 0 (bookingpaymentupdate?.data?.OrderDetails?.length > 0
? bookingpaymentupdate?.data?.OrderId && ? bookingpaymentupdate?.data?.OrderId &&
extractLastNumberOrderId( extractLastNumberOrderId(
bookingpaymentupdate?.data?.OrderId, bookingpaymentupdate?.data?.OrderId,
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
) )
: '') : '')
); );
bookingpaymentupdate?.data?.OrderDetails?.length > 0 && bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
setPrintOrderDetails([bookingpaymentupdate?.data]); setPrintOrderDetails([bookingpaymentupdate?.data]);
@ -2841,7 +2851,7 @@ export default function BST1Payment() {
if ( if (
Date.now() - startTime > Date.now() - startTime >
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
60000 60000
) { ) {
// 60,000 ms = 1 minute // 60,000 ms = 1 minute
@ -3650,29 +3660,29 @@ export default function BST1Payment() {
{tableOptions.find( {tableOptions.find(
(item) => item.OptionName === 'AddCustomer' (item) => item.OptionName === 'AddCustomer'
) && ( ) && (
<div <div
style={{ style={{
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
columnGap: '0.5rem', columnGap: '0.5rem',
}} }}
> >
<BSCustomerSelect /> <BSCustomerSelect />
<TooltipWrapper title={'Add Customer'} isMobile={isMobile}> <TooltipWrapper title={'Add Customer'} isMobile={isMobile}>
{' '} {' '}
<PozoAddCustomerIcon <PozoAddCustomerIcon
className="BSBillingNav-icon-table-icon" className="BSBillingNav-icon-table-icon"
onClick={handleAddCustomer} onClick={handleAddCustomer}
style={{ style={{
fontSize: '25px', fontSize: '25px',
color: selOption || GetCustId ? '#52c41a' : '#1292EE', color: selOption || GetCustId ? '#52c41a' : '#1292EE',
cursor: Custdisable ? 'not-allowed' : 'pointer', cursor: Custdisable ? 'not-allowed' : 'pointer',
}} }}
/> />
</TooltipWrapper> </TooltipWrapper>
</div> </div>
)} )}
</div> </div>
</div> </div>
</div> </div>
@ -3735,31 +3745,31 @@ export default function BST1Payment() {
(BookingType === 'Dine In' || (BookingType === 'Dine In' ||
BookingTypeBoth || BookingTypeBoth ||
CheckOrderType?.length > 0) && CheckOrderType?.length > 0) &&
!unpaidFlow && !unpaidFlow &&
OrderStatus OrderStatus
? 'none' ? 'none'
: 'auto', : 'auto',
opacity: opacity:
(BookingType === 'Dine In' || (BookingType === 'Dine In' ||
BookingTypeBoth || BookingTypeBoth ||
CheckOrderType?.length > 0) && CheckOrderType?.length > 0) &&
!unpaidFlow && !unpaidFlow &&
OrderStatus OrderStatus
? 0.5 ? 0.5
: 1, : 1,
}} }}
> >
{paybtns?.length > 0 && {paybtns?.length > 0 &&
currentOrderNetAmount >= previousNetAmount ? ( currentOrderNetAmount >= previousNetAmount ? (
paybtns?.map((payment) => ( paybtns?.map((payment) => (
<div className="Table3-cash"> <div className="Table3-cash">
<button <button
className={ className={
paybtnselected === payment.ModeId && paybtnselected === payment.ModeId &&
(UpinotSelected || CardoptionnotSelected) (UpinotSelected || CardoptionnotSelected)
? 'Btn-payment-mode-notupisel' ? 'Btn-payment-mode-notupisel'
: paybtnselected === payment.ModeId && : paybtnselected === payment.ModeId &&
(!UpinotSelected || !CardoptionnotSelected) (!UpinotSelected || !CardoptionnotSelected)
? 'Btn-payment-mode' ? 'Btn-payment-mode'
: 'Btn-payment-mode-sel' : 'Btn-payment-mode-sel'
} }
@ -3773,13 +3783,13 @@ export default function BST1Payment() {
onClick={() => onClick={() =>
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
? handleUPIButtonClick( ? handleUPIButtonClick(
payment.ModeId, payment.ModeId,
payment.ModeName payment.ModeName
) )
: handlePaymentMode( : handlePaymentMode(
payment.ModeId, payment.ModeId,
payment.ModeName payment.ModeName
) )
} }
> >
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */} {/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
@ -3838,10 +3848,10 @@ export default function BST1Payment() {
<button <button
className={ className={
refundPaySelected === payment.ConfigId && refundPaySelected === payment.ConfigId &&
(UpinotSelected || CardoptionnotSelected) (UpinotSelected || CardoptionnotSelected)
? 'Btn-payment-mode-notupisel' ? 'Btn-payment-mode-notupisel'
: refundPaySelected === payment.ConfigId && : refundPaySelected === payment.ConfigId &&
(!UpinotSelected || !CardoptionnotSelected) (!UpinotSelected || !CardoptionnotSelected)
? 'Btn-payment-mode' ? 'Btn-payment-mode'
: 'Btn-payment-mode-sel' : 'Btn-payment-mode-sel'
} }
@ -3916,9 +3926,9 @@ export default function BST1Payment() {
OrderCardDetail?.length > 0 && 'not-allowed', OrderCardDetail?.length > 0 && 'not-allowed',
color: color:
OrderCardDetail?.length > 0 || OrderCardDetail?.length > 0 ||
(selOption?.value === undefined && (selOption?.value === undefined &&
GlobalAddCustomerDetails1?.length === 0 && GlobalAddCustomerDetails1?.length === 0 &&
GetCustId?.CustMobile === undefined) GetCustId?.CustMobile === undefined)
? 'gray' ? 'gray'
: 'rgb(18, 146, 238)', : 'rgb(18, 146, 238)',
fontSize: '28px', fontSize: '28px',
@ -3968,16 +3978,16 @@ export default function BST1Payment() {
(BookingType === 'Dine In' || (BookingType === 'Dine In' ||
BookingTypeBoth || BookingTypeBoth ||
CheckOrderType?.length > 0) && CheckOrderType?.length > 0) &&
!unpaidFlow && !unpaidFlow &&
OrderStatus OrderStatus
? 'none' ? 'none'
: 'auto', : 'auto',
opacity: opacity:
(BookingType === 'Dine In' || (BookingType === 'Dine In' ||
BookingTypeBoth || BookingTypeBoth ||
CheckOrderType?.length > 0) && CheckOrderType?.length > 0) &&
!unpaidFlow && !unpaidFlow &&
OrderStatus OrderStatus
? 0.5 ? 0.5
: 1, : 1,
}} }}
@ -3996,14 +4006,14 @@ export default function BST1Payment() {
width: '1.5rem', width: '1.5rem',
cursor: cursor:
OrderCardDetail?.length === 0 || OrderCardDetail?.length === 0 ||
CheckBookingStatus == 'Close' || CheckBookingStatus == 'Close' ||
addnewAccess addnewAccess
? 'not-allowed' ? 'not-allowed'
: 'pointer', : 'pointer',
color: color:
OrderCardDetail?.length === 0 || OrderCardDetail?.length === 0 ||
CheckBookingStatus == 'Close' || CheckBookingStatus == 'Close' ||
addnewAccess addnewAccess
? 'gray' ? 'gray'
: 'rgb(18, 146, 238)', : 'rgb(18, 146, 238)',
display: 'flex', display: 'flex',
@ -4040,8 +4050,8 @@ export default function BST1Payment() {
cursor: OrderCardDetail?.length > 0 && 'not-allowed', cursor: OrderCardDetail?.length > 0 && 'not-allowed',
color: color:
OrderCardDetail?.length > 0 || OrderCardDetail?.length > 0 ||
(OrderCardDetail?.length > 0 && (OrderCardDetail?.length > 0 &&
GetCustId?.CustMobile === undefined) GetCustId?.CustMobile === undefined)
? 'gray' ? 'gray'
: 'rgb(18, 146, 238)', : 'rgb(18, 146, 238)',
fontSize: '25px', fontSize: '25px',
@ -4070,14 +4080,14 @@ export default function BST1Payment() {
width: '1.5rem', width: '1.5rem',
cursor: cursor:
OrderCardDetail?.length === 0 || OrderCardDetail?.length === 0 ||
CheckBookingStatus == 'Close' || CheckBookingStatus == 'Close' ||
addnewAccess addnewAccess
? 'not-allowed' ? 'not-allowed'
: 'pointer', : 'pointer',
color: color:
OrderCardDetail?.length === 0 || OrderCardDetail?.length === 0 ||
CheckBookingStatus == 'Close' || CheckBookingStatus == 'Close' ||
addnewAccess addnewAccess
? 'gray' ? 'gray'
: 'rgb(18, 146, 238)', : 'rgb(18, 146, 238)',
display: 'flex', display: 'flex',
@ -4159,58 +4169,58 @@ export default function BST1Payment() {
<div> <div>
{unpaidFlow == false {unpaidFlow == false
? holdCheckedSalesSetup && ? holdCheckedSalesSetup &&
BookingType !== 'Dine In' && BookingType !== 'Dine In' &&
!BookingTypeBoth && !BookingTypeBoth &&
OrderCardDetail?.length != 0 && OrderCardDetail?.length != 0 &&
CheckOrderType?.length === 0 && CheckOrderType?.length === 0 &&
OrderType != 'Failed' && OrderType != 'Failed' &&
CheckBookingStatus != 'Close' && CheckBookingStatus != 'Close' &&
paybtns?.length > 0 && paybtns?.length > 0 &&
!addnewAccess && ( !addnewAccess && (
<TooltipWrapper title={'Hold'} isMobile={isMobile}> <TooltipWrapper title={'Hold'} isMobile={isMobile}>
{' '} {' '}
<PozoHoldIcon <PozoHoldIcon
className="BSBillingNav-icon-table-icon" className="BSBillingNav-icon-table-icon"
onClick={() => AddBookingDetails('Hold')} onClick={() => AddBookingDetails('Hold')}
style={{ style={{
fontSize: '30px', fontSize: '30px',
cursor: 'pointer', cursor: 'pointer',
color: '' ? '#52c41a' : '#1292EE', color: '' ? '#52c41a' : '#1292EE',
}} }}
/> />
</TooltipWrapper> </TooltipWrapper>
) )
: ''} : ''}
{unpaidFlow == false {unpaidFlow == false
? holdCheckedSalesSetup && ? holdCheckedSalesSetup &&
paybtns?.length > 0 && paybtns?.length > 0 &&
BookingType !== 'Dine In' && BookingType !== 'Dine In' &&
!BookingTypeBoth && !BookingTypeBoth &&
Holddata?.length > 0 && Holddata?.length > 0 &&
OrderCardDetail?.length == 0 && OrderCardDetail?.length == 0 &&
CheckBookingStatus != 'Close' && CheckBookingStatus != 'Close' &&
!addnewAccess && ( !addnewAccess && (
<TooltipWrapper title={'Recall'} isMobile={isMobile}> <TooltipWrapper title={'Recall'} isMobile={isMobile}>
{' '} {' '}
<Badge <Badge
count={Holddata?.length} count={Holddata?.length}
size={'small'} size={'small'}
offset={[0, 7]} offset={[0, 7]}
> >
<PozoHoldIcon <PozoHoldIcon
className="BSBillingNav-icon-table-icon" className="BSBillingNav-icon-table-icon"
onClick={() => HandleholdModelOpen()} onClick={() => HandleholdModelOpen()}
style={{ style={{
fontSize: '28px', fontSize: '28px',
cursor: 'pointer', cursor: 'pointer',
color: Holddata ? '#52c41a' : 'default', color: Holddata ? '#52c41a' : 'default',
pointerEvents: pointerEvents:
OrderType === 'Failed' ? 'none' : 'auto', OrderType === 'Failed' ? 'none' : 'auto',
}} }}
/> />
</Badge> </Badge>
</TooltipWrapper> </TooltipWrapper>
) )
: ''} : ''}
</div> </div>
)} )}
@ -4253,9 +4263,9 @@ export default function BST1Payment() {
addnewAccess addnewAccess
? 'price-button-disabled' ? 'price-button-disabled'
: FirstPaymentclick === false && : FirstPaymentclick === false &&
OrderCardDetail?.length > 0 && OrderCardDetail?.length > 0 &&
paybtnselected && paybtnselected &&
CheckBookingStatus != 'Close' CheckBookingStatus != 'Close'
? !OrderStatus ? !OrderStatus
? salesBillEdit && ? salesBillEdit &&
currentOrderNetAmount < previousNetAmount currentOrderNetAmount < previousNetAmount
@ -4277,7 +4287,7 @@ export default function BST1Payment() {
{isMobile ? ( {isMobile ? (
!OrderStatus ? ( !OrderStatus ? (
salesBillEdit && salesBillEdit &&
currentOrderNetAmount < previousNetAmount ? ( currentOrderNetAmount < previousNetAmount ? (
<div> <div>
Refund: Refund:
{(previousNetAmount || 0) - {(previousNetAmount || 0) -
@ -4503,14 +4513,14 @@ export default function BST1Payment() {
OrderType === 'Failed' OrderType === 'Failed'
? FailedTotalAmt ? FailedTotalAmt
: Math.round( : Math.round(
OrderCardDetail?.reduce( OrderCardDetail?.reduce(
(acc, data) => data?.TotalAmt + acc, (acc, data) => data?.TotalAmt + acc,
0 0
) - ) -
((OverAllSales > 0 ? OverAllSales : 0) + ((OverAllSales > 0 ? OverAllSales : 0) +
(OverAllEstimate > 0 ? OverAllEstimate : 0) + (OverAllEstimate > 0 ? OverAllEstimate : 0) +
(Discount > 0 ? Discount : 0)) (Discount > 0 ? Discount : 0))
) )
} }
failedOrderData={failedOrderData} failedOrderData={failedOrderData}
/> />
@ -4643,9 +4653,9 @@ export default function BST1Payment() {
const qty = isGroup const qty = isGroup
? OrderCardDetail.filter((o) => o.id === groupKey).reduce( ? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
(sum, o) => sum + (o.OrderQty || 1), (sum, o) => sum + (o.OrderQty || 1),
0 0
) )
: item.OrderQty || 1; : item.OrderQty || 1;
return ( return (
@ -4728,6 +4738,7 @@ export default function BST1Payment() {
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
width={500} width={500}
destroyOnClose={true}
children={ children={
<> <>
<PaymentGatewayEmbedded <PaymentGatewayEmbedded
@ -4744,14 +4755,27 @@ export default function BST1Payment() {
} }
/> />
{showCancelConfirm && ( {showCancelConfirm && (
// <Modal
// open={showCancelConfirm}
// title="Cancel Payment"
// onOk={() => {
// setBusinessUPI(false);
// setShowCancelConfirm(false);
// ClearAllGlobalStateDatas();
// CustomerDisplay();
// }}
// onCancel={() => setShowCancelConfirm(false)}
// okText="Yes"
// cancelText="No"
// >
// Do you want to cancel the payment?
// </Modal>
<Modal <Modal
open={showCancelConfirm} open={showCancelConfirm}
title="Cancel Payment" title="Cancel Payment"
onOk={() => { onOk={() => {
setBusinessUPI(false);
setShowCancelConfirm(false); setShowCancelConfirm(false);
ClearAllGlobalStateDatas(); CancelPayment()
CustomerDisplay();
}} }}
onCancel={() => setShowCancelConfirm(false)} onCancel={() => setShowCancelConfirm(false)}
okText="Yes" okText="Yes"

View File

@ -141,6 +141,7 @@ import {
changePreviousOrderOfferDetail, changePreviousOrderOfferDetail,
GlobalAllBookingType, GlobalAllBookingType,
changeSearchedData, changeSearchedData,
PostCancelPayment,
} from '../../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../../Features/BookingScreen/BookingData/BookingData';
import { PrintStyleFunction } from '../../../../paymentpdfPage/PrintStyleFunction.js'; import { PrintStyleFunction } from '../../../../paymentpdfPage/PrintStyleFunction.js';
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities'; import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
@ -1035,7 +1036,7 @@ const BSBillingTable3Pay = () => {
const selectedStyle = const selectedStyle =
stylesMap[ stylesMap[
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
]; ];
if (selectedStyle) { if (selectedStyle) {
@ -1574,7 +1575,15 @@ const BSBillingTable3Pay = () => {
: AddBookingDetails(BookingType, true); : AddBookingDetails(BookingType, true);
} }
}; };
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
if (response?.data?.statusCode) {
ClearAllGlobalStateDatas();
CustomerDisplay();
setBusinessUPI(false);
}
}
const financialYearError = async () => { const financialYearError = async () => {
setMessageType('error'); setMessageType('error');
setMessageData('Financial Year-Based Sales Not Yet Started'); setMessageData('Financial Year-Based Sales Not Yet Started');
@ -2261,15 +2270,15 @@ const BSBillingTable3Pay = () => {
OrderStatus: 'O', OrderStatus: 'O',
OrderType: OrderType:
BookingType === 'Dine In' || BookingType === 'Dine In' ||
BookingTypeBoth || BookingTypeBoth ||
Estimation?.SettingValue == 'N' Estimation?.SettingValue == 'N'
? 'S' ? 'S'
: GlobEstBooking === 'OvrAllEst' : GlobEstBooking === 'OvrAllEst'
? 'E' ? 'E'
: GlobEstBooking === 'ParEst' : GlobEstBooking === 'ParEst'
? GlobProdwisedata?.includes( ? GlobProdwisedata?.includes(
a.InwardDtlId + ' ' + a?.BookingTypeName a.InwardDtlId + ' ' + a?.BookingTypeName
) )
? 'E' ? 'E'
: 'S' : 'S'
: 'S', : 'S',
@ -2364,7 +2373,7 @@ const BSBillingTable3Pay = () => {
: Paybtnnameselected?.toLowerCase() === 'credit' : Paybtnnameselected?.toLowerCase() === 'credit'
? 'S' ? 'S'
: Paybtnnameselected?.toLowerCase() === 'upi' && : Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'default' SelectedUPIPayOption?.toLowerCase() === 'default'
? 'S' ? 'S'
: 'P', : 'P',
OrderDtlDetails: OrderDtlDetails:
@ -2381,9 +2390,9 @@ const BSBillingTable3Pay = () => {
? globalTipAmount === 0 ? globalTipAmount === 0
? SelectedTableDetails ? SelectedTableDetails
: SelectedTableDetails?.map((item) => ({ : SelectedTableDetails?.map((item) => ({
...item, ...item,
TipsAmount: globalTipAmount, TipsAmount: globalTipAmount,
})) }))
: null, : null,
SalesPaymentType: 'normal', SalesPaymentType: 'normal',
PaymentDetail: [ PaymentDetail: [
@ -2398,8 +2407,8 @@ const BSBillingTable3Pay = () => {
? PaymentgatewayUPI?.[0]?.ModeId ? PaymentgatewayUPI?.[0]?.ModeId
: SelectedUPIPayOption?.toLowerCase() === 'business' : SelectedUPIPayOption?.toLowerCase() === 'business'
? BusinessPayOption?.find( ? BusinessPayOption?.find(
(busupi) => busupi?.ModeId === UpiId (busupi) => busupi?.ModeId === UpiId
)?.ModeId )?.ModeId
: paybtnselected : paybtnselected
: paybtnselected : paybtnselected
? paybtnselected ? paybtnselected
@ -2412,15 +2421,15 @@ const BSBillingTable3Pay = () => {
salesBillEdit && currentOrderNetAmount < previousNetAmount salesBillEdit && currentOrderNetAmount < previousNetAmount
? null ? null
: Paybtnnameselected?.toLowerCase() === 'upi' && : Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'business' SelectedUPIPayOption?.toLowerCase() === 'business'
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId) ? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
?.MerchantId ?.MerchantId
: null, : null,
PaymentOptionType: PaymentOptionType:
salesBillEdit && salesBillEdit &&
currentOrderNetAmount < previousNetAmount && currentOrderNetAmount < previousNetAmount &&
(refundPaySelectedName?.toLowerCase() === 'cash' || (refundPaySelectedName?.toLowerCase() === 'cash' ||
refundPaySelectedName?.toLowerCase() === 'credit') refundPaySelectedName?.toLowerCase() === 'credit')
? 'PC' ? 'PC'
: Paybtnnameselected?.toLowerCase() === 'cash' : Paybtnnameselected?.toLowerCase() === 'cash'
? 'PC' ? 'PC'
@ -2440,29 +2449,29 @@ const BSBillingTable3Pay = () => {
? null ? null
: SelectedUPIPayOption?.toLowerCase() === 'default' : SelectedUPIPayOption?.toLowerCase() === 'default'
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId) ? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
?.UPIDetailId ?.UPIDetailId
: SelectedUPIPayOption?.toLowerCase() === 'business' : SelectedUPIPayOption?.toLowerCase() === 'business'
? BusinessPayOption?.find( ? BusinessPayOption?.find(
(busupi) => busupi?.ModeId === UpiId (busupi) => busupi?.ModeId === UpiId
)?.MerchantUPIId )?.MerchantUPIId
: null, : null,
AccountDtl: AccountDtl:
salesBillEdit && currentOrderNetAmount < previousNetAmount salesBillEdit && currentOrderNetAmount < previousNetAmount
? [] ? []
: Paybtnnameselected?.toLowerCase() === 'upi' && : Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'default' SelectedUPIPayOption?.toLowerCase() === 'default'
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find( ? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
(upipay) => upipay?.UPIId === UpiId (upipay) => upipay?.UPIId === UpiId
) )
: (Paybtnnameselected?.toLowerCase() === 'upi' && : (Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'pd') || SelectedUPIPayOption?.toLowerCase() === 'pd') ||
(Paybtnnameselected?.toLowerCase() === 'card' && (Paybtnnameselected?.toLowerCase() === 'card' &&
SelectedCardOption?.toLowerCase() === 'pd') SelectedCardOption?.toLowerCase() === 'pd')
? useOptions?.[0]?.PaymentDetails?.PaymentDevice ? useOptions?.[0]?.PaymentDetails?.PaymentDevice
: (Paybtnnameselected?.toLowerCase() === 'upi' && : (Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'pg') || SelectedUPIPayOption?.toLowerCase() === 'pg') ||
(Paybtnnameselected?.toLowerCase() === 'card' && (Paybtnnameselected?.toLowerCase() === 'card' &&
SelectedCardOption?.toLowerCase() === 'pg') SelectedCardOption?.toLowerCase() === 'pg')
? useOptions?.[0]?.PaymentDetails?.PaymentGateway ? useOptions?.[0]?.PaymentDetails?.PaymentGateway
: [], : [],
PaymentStatus: PaymentStatus:
@ -2473,13 +2482,13 @@ const BSBillingTable3Pay = () => {
: Paybtnnameselected?.toLowerCase() === 'credit' : Paybtnnameselected?.toLowerCase() === 'credit'
? 'S' ? 'S'
: Paybtnnameselected?.toLowerCase() === 'upi' && : Paybtnnameselected?.toLowerCase() === 'upi' &&
SelectedUPIPayOption?.toLowerCase() === 'default' SelectedUPIPayOption?.toLowerCase() === 'default'
? 'S' ? 'S'
: 'P', : 'P',
Debit: Debit:
salesBillEdit && salesBillEdit &&
currentOrderNetAmount < previousNetAmount && currentOrderNetAmount < previousNetAmount &&
refundPaySelectedName?.toLowerCase() === 'credit' refundPaySelectedName?.toLowerCase() === 'credit'
? Math.round(previousNetAmount - currentOrderNetAmount) ? Math.round(previousNetAmount - currentOrderNetAmount)
: 0, : 0,
Credit: salesBillEdit Credit: salesBillEdit
@ -2557,14 +2566,14 @@ const BSBillingTable3Pay = () => {
setMessageType('success'); setMessageType('success');
setMessageData( setMessageData(
response?.data?.response + response?.data?.response +
' ' + ' ' +
(response?.data?.OrderDetails?.length > 0 (response?.data?.OrderDetails?.length > 0
? response?.data?.OrderId && ? response?.data?.OrderId &&
extractLastNumberOrderId( extractLastNumberOrderId(
response?.data?.OrderId, response?.data?.OrderId,
response?.data?.OrderDetails?.[0]?.FYStatus response?.data?.OrderDetails?.[0]?.FYStatus
) )
: '') : '')
); );
response?.data?.OrderDetails?.length > 0 && response?.data?.OrderDetails?.length > 0 &&
setPrintOrderDetails([response?.data]); setPrintOrderDetails([response?.data]);
@ -2724,14 +2733,14 @@ const BSBillingTable3Pay = () => {
setMessageType('success'); setMessageType('success');
setMessageData( setMessageData(
response?.data?.response + response?.data?.response +
' ' + ' ' +
(response?.data?.OrderDetails?.length > 0 (response?.data?.OrderDetails?.length > 0
? response?.data?.OrderId && ? response?.data?.OrderId &&
extractLastNumberOrderId( extractLastNumberOrderId(
response?.data?.OrderId, response?.data?.OrderId,
response?.data?.OrderDetails?.[0]?.FYStatus response?.data?.OrderDetails?.[0]?.FYStatus
) )
: '') : '')
); );
response?.data?.OrderDetails?.length > 0 && response?.data?.OrderDetails?.length > 0 &&
setPrintOrderDetails([response?.data]); setPrintOrderDetails([response?.data]);
@ -2834,14 +2843,14 @@ const BSBillingTable3Pay = () => {
} }
setMessageData( setMessageData(
response?.data?.response + response?.data?.response +
' ' + ' ' +
(response?.data?.OrderDetails?.length > 0 (response?.data?.OrderDetails?.length > 0
? response?.data?.OrderId && ? response?.data?.OrderId &&
extractLastNumberOrderId( extractLastNumberOrderId(
response?.data?.OrderId, response?.data?.OrderId,
response?.data?.OrderDetails?.[0]?.FYStatus response?.data?.OrderDetails?.[0]?.FYStatus
) )
: '') : '')
); );
if (response?.data?.OrderDetails?.length > 0) { if (response?.data?.OrderDetails?.length > 0) {
setPrintOrderDetails([response?.data]); setPrintOrderDetails([response?.data]);
@ -3018,14 +3027,14 @@ const BSBillingTable3Pay = () => {
setMessageType('success'); setMessageType('success');
setMessageData( setMessageData(
bookingpaymentupdate?.data?.response + bookingpaymentupdate?.data?.response +
' ' + ' ' +
(bookingpaymentupdate?.data?.OrderDetails?.length > 0 (bookingpaymentupdate?.data?.OrderDetails?.length > 0
? bookingpaymentupdate?.data?.OrderId && ? bookingpaymentupdate?.data?.OrderId &&
extractLastNumberOrderId( extractLastNumberOrderId(
bookingpaymentupdate?.data?.OrderId, bookingpaymentupdate?.data?.OrderId,
bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus bookingpaymentupdate?.data?.OrderDetail?.[0]?.FYStatus
) )
: '') : '')
); );
bookingpaymentupdate?.data?.OrderDetails?.length > 0 && bookingpaymentupdate?.data?.OrderDetails?.length > 0 &&
setPrintOrderDetails([bookingpaymentupdate?.data]); setPrintOrderDetails([bookingpaymentupdate?.data]);
@ -3044,7 +3053,7 @@ const BSBillingTable3Pay = () => {
if ( if (
Date.now() - startTime > Date.now() - startTime >
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes * useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
60000 60000
) { ) {
// 60,000 ms = 1 minute // 60,000 ms = 1 minute
@ -3751,9 +3760,9 @@ const BSBillingTable3Pay = () => {
'not-allowed', 'not-allowed',
color: color:
OrderCardDetail?.length > 0 || OrderCardDetail?.length > 0 ||
(selOption?.value === undefined && (selOption?.value === undefined &&
GlobalAddCustomerDetails1?.length === 0 && GlobalAddCustomerDetails1?.length === 0 &&
GetCustId?.CustMobile === undefined) GetCustId?.CustMobile === undefined)
? 'gray' ? 'gray'
: 'rgb(18, 146, 238)', : 'rgb(18, 146, 238)',
fontSize: '28px', fontSize: '28px',
@ -3775,16 +3784,16 @@ const BSBillingTable3Pay = () => {
(BookingType === 'Dine In' || (BookingType === 'Dine In' ||
BookingTypeBoth || BookingTypeBoth ||
CheckOrderType?.length > 0) && CheckOrderType?.length > 0) &&
!unpaidFlow && !unpaidFlow &&
OrderStatus OrderStatus
? 'none' ? 'none'
: 'auto', : 'auto',
opacity: opacity:
(BookingType === 'Dine In' || (BookingType === 'Dine In' ||
BookingTypeBoth || BookingTypeBoth ||
CheckOrderType?.length > 0) && CheckOrderType?.length > 0) &&
!unpaidFlow && !unpaidFlow &&
OrderStatus OrderStatus
? 0.5 ? 0.5
: 1, : 1,
width: '2rem', width: '2rem',
@ -3807,14 +3816,14 @@ const BSBillingTable3Pay = () => {
width: '1.5rem', width: '1.5rem',
cursor: cursor:
OrderCardDetail?.length === 0 || OrderCardDetail?.length === 0 ||
CheckBookingStatus == 'Close' || CheckBookingStatus == 'Close' ||
addnewAccess addnewAccess
? 'not-allowed' ? 'not-allowed'
: 'pointer', : 'pointer',
color: color:
OrderCardDetail?.length === 0 || OrderCardDetail?.length === 0 ||
CheckBookingStatus == 'Close' || CheckBookingStatus == 'Close' ||
addnewAccess addnewAccess
? 'gray' ? 'gray'
: 'rgb(18, 146, 238)', : 'rgb(18, 146, 238)',
display: 'flex', display: 'flex',
@ -3850,8 +3859,8 @@ const BSBillingTable3Pay = () => {
cursor: OrderCardDetail?.length > 0 && 'not-allowed', cursor: OrderCardDetail?.length > 0 && 'not-allowed',
color: color:
OrderCardDetail?.length > 0 || OrderCardDetail?.length > 0 ||
(OrderCardDetail?.length > 0 && (OrderCardDetail?.length > 0 &&
GetCustId?.CustMobile === undefined) GetCustId?.CustMobile === undefined)
? 'gray' ? 'gray'
: 'rgb(18, 146, 238)', : 'rgb(18, 146, 238)',
fontSize: '25px', fontSize: '25px',
@ -3938,65 +3947,65 @@ const BSBillingTable3Pay = () => {
<> <>
{unpaidFlow == false {unpaidFlow == false
? item?.OptionName == 'Hold' && ? item?.OptionName == 'Hold' &&
BookingType !== 'Dine In' && BookingType !== 'Dine In' &&
!BookingTypeBoth && !BookingTypeBoth &&
OrderCardDetail?.length != 0 && OrderCardDetail?.length != 0 &&
CheckOrderType?.length === 0 && CheckOrderType?.length === 0 &&
OrderType != 'Failed' && OrderType != 'Failed' &&
CheckBookingStatus != 'Close' && CheckBookingStatus != 'Close' &&
paybtns?.length > 0 && paybtns?.length > 0 &&
!addnewAccess && ( !addnewAccess && (
<TooltipWrapper <TooltipWrapper
title={'Hold (Alt+W)'} title={'Hold (Alt+W)'}
isMobile={isMobile} isMobile={isMobile}
> >
{' '} {' '}
<PozoHoldIcon <PozoHoldIcon
className="BSBillingNav-icon-table-icon" className="BSBillingNav-icon-table-icon"
onClick={() => AddBookingDetails('Hold', false)} onClick={() => AddBookingDetails('Hold', false)}
style={{ style={{
fontSize: '30px', fontSize: '30px',
cursor: 'pointer', cursor: 'pointer',
color: '' ? '#52c41a' : '#1292EE', color: '' ? '#52c41a' : '#1292EE',
}} }}
/> />
</TooltipWrapper> </TooltipWrapper>
) )
: ''} : ''}
{unpaidFlow == false {unpaidFlow == false
? item?.OptionName == 'Hold' && ? item?.OptionName == 'Hold' &&
paybtns?.length > 0 && paybtns?.length > 0 &&
BookingType !== 'Dine In' && BookingType !== 'Dine In' &&
!BookingTypeBoth && !BookingTypeBoth &&
Holddata?.length > 0 && Holddata?.length > 0 &&
OrderCardDetail?.length == 0 && OrderCardDetail?.length == 0 &&
CheckBookingStatus != 'Close' && CheckBookingStatus != 'Close' &&
!addnewAccess && ( !addnewAccess && (
<TooltipWrapper <TooltipWrapper
title={'Recall (Alt+W)'} title={'Recall (Alt+W)'}
isMobile={isMobile} isMobile={isMobile}
>
{' '}
<Badge
count={Holddata?.length}
size={'small'}
offset={[0, 7]}
> >
{' '} <PozoHoldIcon
<Badge className="BSBillingNav-icon-table-icon"
count={Holddata?.length} onClick={() => HandleholdModelOpen()}
size={'small'} style={{
offset={[0, 7]} fontSize: '28px',
> cursor: 'pointer',
<PozoHoldIcon color: Holddata ? '#52c41a' : 'default',
className="BSBillingNav-icon-table-icon" pointerEvents:
onClick={() => HandleholdModelOpen()} OrderType === 'Failed' ? 'none' : 'auto',
style={{ }}
fontSize: '28px', />
cursor: 'pointer', </Badge>
color: Holddata ? '#52c41a' : 'default', </TooltipWrapper>
pointerEvents: )
OrderType === 'Failed' ? 'none' : 'auto',
}}
/>
</Badge>
</TooltipWrapper>
)
: ''} : ''}
</> </>
))} ))}
@ -4042,14 +4051,14 @@ const BSBillingTable3Pay = () => {
width: '1.5rem', width: '1.5rem',
cursor: cursor:
OrderCardDetail?.length === 0 || OrderCardDetail?.length === 0 ||
CheckBookingStatus == 'Close' || CheckBookingStatus == 'Close' ||
addnewAccess addnewAccess
? 'not-allowed' ? 'not-allowed'
: 'pointer', : 'pointer',
color: color:
OrderCardDetail?.length === 0 || OrderCardDetail?.length === 0 ||
CheckBookingStatus == 'Close' || CheckBookingStatus == 'Close' ||
addnewAccess addnewAccess
? 'gray' ? 'gray'
: 'rgb(18, 146, 238)', : 'rgb(18, 146, 238)',
display: 'flex', display: 'flex',
@ -4148,31 +4157,31 @@ const BSBillingTable3Pay = () => {
(BookingType === 'Dine In' || (BookingType === 'Dine In' ||
BookingTypeBoth || BookingTypeBoth ||
CheckOrderType?.length > 0) && CheckOrderType?.length > 0) &&
!unpaidFlow && !unpaidFlow &&
OrderStatus OrderStatus
? 'none' ? 'none'
: 'auto', : 'auto',
opacity: opacity:
(BookingType === 'Dine In' || (BookingType === 'Dine In' ||
BookingTypeBoth || BookingTypeBoth ||
CheckOrderType?.length > 0) && CheckOrderType?.length > 0) &&
!unpaidFlow && !unpaidFlow &&
OrderStatus OrderStatus
? 0.5 ? 0.5
: 1, : 1,
}} }}
> >
{paybtns?.length > 0 && {paybtns?.length > 0 &&
currentOrderNetAmount >= previousNetAmount ? ( currentOrderNetAmount >= previousNetAmount ? (
paybtns?.map((payment) => ( paybtns?.map((payment) => (
<div className="Table3-cash"> <div className="Table3-cash">
<button <button
className={ className={
paybtnselected === payment.ModeId && paybtnselected === payment.ModeId &&
(UpinotSelected || CardoptionnotSelected) (UpinotSelected || CardoptionnotSelected)
? 'Btn-payment-mode-notupisel' ? 'Btn-payment-mode-notupisel'
: paybtnselected === payment.ModeId && : paybtnselected === payment.ModeId &&
(!UpinotSelected || !CardoptionnotSelected) (!UpinotSelected || !CardoptionnotSelected)
? 'Btn-payment-mode' ? 'Btn-payment-mode'
: 'Btn-payment-mode-sel' : 'Btn-payment-mode-sel'
} }
@ -4186,13 +4195,13 @@ const BSBillingTable3Pay = () => {
onClick={() => onClick={() =>
payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id payment?.ModeName?.toLowerCase() === 'upi' // Change the condition to payment.Id
? handleUPIButtonClick( ? handleUPIButtonClick(
payment.ModeId, payment.ModeId,
payment.ModeName payment.ModeName
) )
: handlePaymentMode( : handlePaymentMode(
payment.ModeId, payment.ModeId,
payment.ModeName payment.ModeName
) )
} }
> >
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */} {/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
@ -4252,10 +4261,10 @@ const BSBillingTable3Pay = () => {
<button <button
className={ className={
refundPaySelected === payment.ConfigId && refundPaySelected === payment.ConfigId &&
(UpinotSelected || CardoptionnotSelected) (UpinotSelected || CardoptionnotSelected)
? 'Btn-payment-mode-notupisel' ? 'Btn-payment-mode-notupisel'
: refundPaySelected === payment.ConfigId && : refundPaySelected === payment.ConfigId &&
(!UpinotSelected || !CardoptionnotSelected) (!UpinotSelected || !CardoptionnotSelected)
? 'Btn-payment-mode' ? 'Btn-payment-mode'
: 'Btn-payment-mode-sel' : 'Btn-payment-mode-sel'
} }
@ -4516,9 +4525,9 @@ const BSBillingTable3Pay = () => {
addnewAccess addnewAccess
? 'BSBillingTable3-paybtn-deactive' ? 'BSBillingTable3-paybtn-deactive'
: FirstPaymentclick === false && : FirstPaymentclick === false &&
OrderCardDetail?.length > 0 && OrderCardDetail?.length > 0 &&
paybtnselected && paybtnselected &&
CheckBookingStatus != 'Close' CheckBookingStatus != 'Close'
? !OrderStatus ? !OrderStatus
? salesBillEdit && ? salesBillEdit &&
currentOrderNetAmount < previousNetAmount currentOrderNetAmount < previousNetAmount
@ -4752,14 +4761,14 @@ const BSBillingTable3Pay = () => {
OrderType === 'Failed' OrderType === 'Failed'
? FailedTotalAmt ? FailedTotalAmt
: Math.round( : Math.round(
OrderCardDetail?.reduce( OrderCardDetail?.reduce(
(acc, data) => data?.TotalAmt + acc, (acc, data) => data?.TotalAmt + acc,
0 0
) - ) -
((OverAllSales > 0 ? OverAllSales : 0) + ((OverAllSales > 0 ? OverAllSales : 0) +
(OverAllEstimate > 0 ? OverAllEstimate : 0) + (OverAllEstimate > 0 ? OverAllEstimate : 0) +
(Discount > 0 ? Discount : 0)) (Discount > 0 ? Discount : 0))
) )
} }
failedOrderData={failedOrderData} failedOrderData={failedOrderData}
/> />
@ -4835,9 +4844,9 @@ const BSBillingTable3Pay = () => {
const qty = isGroup const qty = isGroup
? OrderCardDetail.filter((o) => o.id === groupKey).reduce( ? OrderCardDetail.filter((o) => o.id === groupKey).reduce(
(sum, o) => sum + (o.OrderQty || 1), (sum, o) => sum + (o.OrderQty || 1),
0 0
) )
: item.OrderQty || 1; : item.OrderQty || 1;
return ( return (
@ -4919,6 +4928,7 @@ const BSBillingTable3Pay = () => {
open={businessUPI} open={businessUPI}
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
destroyOnClose={true}
width={500} width={500}
children={ children={
<> <>
@ -4936,14 +4946,27 @@ const BSBillingTable3Pay = () => {
} }
/> />
{showCancelConfirm && ( {showCancelConfirm && (
// <Modal
// open={showCancelConfirm}
// title="Cancel Payment"
// onOk={() => {
// setBusinessUPI(false);
// setShowCancelConfirm(false);
// ClearAllGlobalStateDatas();
// CustomerDisplay();
// }}
// onCancel={() => setShowCancelConfirm(false)}
// okText="Yes"
// cancelText="No"
// >
// Do you want to cancel the payment?
// </Modal>
<Modal <Modal
open={showCancelConfirm} open={showCancelConfirm}
title="Cancel Payment" title="Cancel Payment"
onOk={() => { onOk={() => {
setBusinessUPI(false);
setShowCancelConfirm(false); setShowCancelConfirm(false);
ClearAllGlobalStateDatas(); CancelPayment()
CustomerDisplay();
}} }}
onCancel={() => setShowCancelConfirm(false)} onCancel={() => setShowCancelConfirm(false)}
okText="Yes" okText="Yes"

View File

@ -109,6 +109,7 @@ import {
GlobalUnpaidListData, GlobalUnpaidListData,
PaymentGatewayGetdetail, PaymentGatewayGetdetail,
PostBookingData, PostBookingData,
PostCancelPayment,
PostPaymentdevice, PostPaymentdevice,
PreferenceData, PreferenceData,
PutBookingData, PutBookingData,
@ -1214,6 +1215,15 @@ const StandardTablePayment = () => {
} }
}; };
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
if (response?.data?.statusCode) {
ClearAllGlobalStateDatas();
CustomerDisplay();
setBusinessUPI(false);
}
}
const Otherserviceprint = async () => { const Otherserviceprint = async () => {
if (OtherServicesPrintDetails?.length > 0) { if (OtherServicesPrintDetails?.length > 0) {
const style = await PrintStyleFunction('OtherServices1'); const style = await PrintStyleFunction('OtherServices1');
@ -4191,6 +4201,7 @@ const StandardTablePayment = () => {
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
width={600} width={600}
destroyOnClose={true}
className={'ModalPaymentGatewayEmbedded'} className={'ModalPaymentGatewayEmbedded'}
children={ children={
<> <>
@ -4209,22 +4220,35 @@ const StandardTablePayment = () => {
} }
/> />
{showCancelConfirm && ( {showCancelConfirm && (
<Modal // <Modal
open={showCancelConfirm} // open={showCancelConfirm}
title="Cancel Payment" // title="Cancel Payment"
onOk={() => { // onOk={() => {
paymentGatewayRef.current?.clearPolling(); // paymentGatewayRef.current?.clearPolling();
setBusinessUPI(false); // setBusinessUPI(false);
setShowCancelConfirm(false); // setShowCancelConfirm(false);
ClearAllGlobalStateDatas(); // ClearAllGlobalStateDatas();
CustomerDisplay(); // CustomerDisplay();
}} // }}
onCancel={() => setShowCancelConfirm(false)} // onCancel={() => setShowCancelConfirm(false)}
okText="Yes" // okText="Yes"
cancelText="No" // cancelText="No"
> // >
Do you want to cancel the payment? // Do you want to cancel the payment?
</Modal> // </Modal>
<Modal
open={showCancelConfirm}
title="Cancel Payment"
onOk={() => {
setShowCancelConfirm(false);
CancelPayment()
}}
onCancel={() => setShowCancelConfirm(false)}
okText="Yes"
cancelText="No"
>
Do you want to cancel the payment?
</Modal>
)} )}
{customerPreviesOrders && ( {customerPreviesOrders && (
<DefaultModal <DefaultModal

View File

@ -128,6 +128,7 @@ import {
changePreviousOrderOfferDetail, changePreviousOrderOfferDetail,
GlobalPaymentTrigger, GlobalPaymentTrigger,
changeSearchedData, changeSearchedData,
PostCancelPayment,
} from '../../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../../Features/BookingScreen/BookingData/BookingData';
import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js'; import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js';
import { import {
@ -1294,6 +1295,16 @@ const BSC1Payment = (props) => {
} }
}; };
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
if (response?.data?.statusCode) {
ClearAllGlobalStateDatas();
CustomerDisplay();
setBusinessUPI(false);
}
}
useEffect(() => { useEffect(() => {
const handleKeyPress = (event) => { const handleKeyPress = (event) => {
if (event.key === 'F4' && isButtonActive() && !isF4Pressed.current) { if (event.key === 'F4' && isButtonActive() && !isF4Pressed.current) {
@ -4993,6 +5004,7 @@ const BSC1Payment = (props) => {
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
width={500} width={500}
destroyOnClose={true}
children={ children={
<> <>
<PaymentGatewayEmbedded <PaymentGatewayEmbedded
@ -5009,21 +5021,34 @@ const BSC1Payment = (props) => {
} }
/> />
{showCancelConfirm && ( {showCancelConfirm && (
// <Modal
// open={showCancelConfirm}
// title="Cancel Payment"
// onOk={() => {
// setBusinessUPI(false);
// setShowCancelConfirm(false);
// ClearAllGlobalStateDatas();
// CustomerDisplay();
// }}
// onCancel={() => setShowCancelConfirm(false)}
// okText="Yes"
// cancelText="No"
// >
// Do you want to cancel the payment?
// </Modal>
<Modal <Modal
open={showCancelConfirm} open={showCancelConfirm}
title="Cancel Payment" title="Cancel Payment"
onOk={() => { onOk={() => {
setBusinessUPI(false); setShowCancelConfirm(false);
setShowCancelConfirm(false); CancelPayment()
ClearAllGlobalStateDatas(); }}
CustomerDisplay(); onCancel={() => setShowCancelConfirm(false)}
}} okText="Yes"
onCancel={() => setShowCancelConfirm(false)} cancelText="No"
okText="Yes" >
cancelText="No" Do you want to cancel the payment?
> </Modal>
Do you want to cancel the payment?
</Modal>
)} )}
{customerPreviesOrders && ( {customerPreviesOrders && (

View File

@ -1,6 +1,6 @@
import { useEffect, useRef, useState, useImperativeHandle, forwardRef } from 'react'; import { useEffect, useRef, useState, useImperativeHandle, forwardRef } from 'react';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { getPaymentStatusForBusinessUPI } from '../../../../Features/BookingScreen/BookingData/BookingData'; import { getPaymentStatusForBusinessUPI, PostCancelPayment } from '../../../../Features/BookingScreen/BookingData/BookingData';
const PaymentGatewayEmbedded = forwardRef(({ const PaymentGatewayEmbedded = forwardRef(({
orderId, orderId,
@ -65,6 +65,7 @@ const PaymentGatewayEmbedded = forwardRef(({
if (data.status === 'TIMEOUT') { if (data.status === 'TIMEOUT') {
// Stop polling and mark as timed out // Stop polling and mark as timed out
dispatch(PostCancelPayment({OrderId: orderId})).unwrap()
setTimedOut(true); setTimedOut(true);
setShowTimeout(true); setShowTimeout(true);
if (intervalRef.current) { if (intervalRef.current) {

View File

@ -1,5 +1,5 @@
import React, { useCallback, useEffect, useState } from 'react'; import React, { useCallback, useEffect, useState } from 'react';
import { Popconfirm, Drawer, Badge } from 'antd'; import { Popconfirm, Drawer, Badge, Modal } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons'; import { QuestionCircleOutlined } from '@ant-design/icons';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { IoIosArrowForward } from 'react-icons/io'; import { IoIosArrowForward } from 'react-icons/io';
@ -43,7 +43,7 @@ import KioskPayment from '../Payment/KioskPaymentWithModal';
import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin'; import { ApplicationPreferences } from '../../../Features/BrachLogin/BranchLogin';
import { FaAngleUp, FaCircleCheck } from 'react-icons/fa6'; import { FaAngleUp, FaCircleCheck } from 'react-icons/fa6';
import { FaAngleDown } from 'react-icons/fa'; import { FaAngleDown } from 'react-icons/fa';
import { PostBookingData } from '../../../Features/BookingScreen/BookingData/BookingData'; import { PostBookingData, PostCancelPayment } from '../../../Features/BookingScreen/BookingData/BookingData';
import { import {
generateRandomKey, generateRandomKey,
getSession, getSession,
@ -129,6 +129,7 @@ const selfKioskFooter = (props) => {
const [chairInformation, setChairInformation] = useState(); const [chairInformation, setChairInformation] = useState();
const [TableINformation, setTableINformation] = useState(); const [TableINformation, setTableINformation] = useState();
const [paymentUrl, setpaymentUrl] = useState(null); const [paymentUrl, setpaymentUrl] = useState(null);
const [showCancelConfirm, setShowCancelConfirm] = useState(null);
const [TransctionId, setTransctionId] = useState(null); const [TransctionId, setTransctionId] = useState(null);
const [paymentGatewayAccess, setPaymentGatewayAccess] = useState([]); const [paymentGatewayAccess, setPaymentGatewayAccess] = useState([]);
// let chairInformation = getSession('table'); // let chairInformation = getSession('table');
@ -939,6 +940,15 @@ const selfKioskFooter = (props) => {
setMessageType(null); setMessageType(null);
}, []); }, []);
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: TransctionId})).unwrap()
if (response?.data?.statusCode) {
// setBusinessUPI(false);
setpaymentUrl(null)
}
}
return ( return (
<div> <div>
<Messages <Messages
@ -1462,7 +1472,8 @@ const selfKioskFooter = (props) => {
<button <button
className="paymentclose-btn" className="paymentclose-btn"
onClick={() => { onClick={() => {
setpaymentUrl(null); // setpaymentUrl(null);
setShowCancelConfirm(true);
}} }}
> >
@ -1476,6 +1487,21 @@ const selfKioskFooter = (props) => {
></iframe> ></iframe>
</div> </div>
)} )}
{showCancelConfirm && (
<Modal
open={showCancelConfirm}
title="Cancel Payment"
onOk={() => {
setShowCancelConfirm(false);
CancelPayment()
}}
onCancel={() => setShowCancelConfirm(false)}
okText="Yes"
cancelText="No"
>
Do you want to cancel the payment?
</Modal>
)}
</div> </div>
); );
}; };

View File

@ -61,6 +61,7 @@ import {
import { import {
getConfigType, getConfigType,
getPreferenceData, getPreferenceData,
PostCancelPayment,
PreferenceData, PreferenceData,
PutPendingPaymentList, PutPendingPaymentList,
} from '../../../Features/BookingScreen/BookingData/BookingData'; } from '../../../Features/BookingScreen/BookingData/BookingData';
@ -1092,6 +1093,15 @@ const KioskPayment = (props) => {
}, 2000); }, 2000);
} }
}; };
// PostCancelPayment
const CancelPayment = async () => {
const response = await dispatch(PostCancelPayment({OrderId: businessUPIOrderId})).unwrap()
if (response?.data?.statusCode) {
ClearAllGlobalStateDatas();
CustomerDisplay();
setBusinessUPI(false);
}
}
const handleDevice = async (paymentDetails, option) => { const handleDevice = async (paymentDetails, option) => {
const paymentDeviceDetails = await dispatch( const paymentDeviceDetails = await dispatch(
@ -2342,6 +2352,7 @@ const KioskPayment = (props) => {
handleCancel={() => setShowCancelConfirm(true)} handleCancel={() => setShowCancelConfirm(true)}
footer={false} footer={false}
width={500} width={500}
destroyOnClose={true}
children={ children={
<> <>
<PaymentGatewayEmbedded <PaymentGatewayEmbedded
@ -2359,21 +2370,34 @@ const KioskPayment = (props) => {
} }
/> />
{showCancelConfirm && ( {showCancelConfirm && (
<Modal // <Modal
open={showCancelConfirm} // open={showCancelConfirm}
title="Cancel Payment" // title="Cancel Payment"
onOk={() => { // onOk={() => {
paymentGatewayRef.current?.clearPolling(); // paymentGatewayRef.current?.clearPolling();
setBusinessUPI(false); // setBusinessUPI(false);
setShowCancelConfirm(false); // setShowCancelConfirm(false);
ClearAllGlobalStateDatas(); // ClearAllGlobalStateDatas();
}} // }}
onCancel={() => setShowCancelConfirm(false)} // onCancel={() => setShowCancelConfirm(false)}
okText="Yes" // okText="Yes"
cancelText="No" // cancelText="No"
> // >
Do you want to cancel the payment? // Do you want to cancel the payment?
</Modal> // </Modal>
<Modal
open={showCancelConfirm}
title="Cancel Payment"
onOk={() => {
setShowCancelConfirm(false);
CancelPayment()
}}
onCancel={() => setShowCancelConfirm(false)}
okText="Yes"
cancelText="No"
>
Do you want to cancel the payment?
</Modal>
)} )}
</div> </div>
); );