diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx
index 02f93fb..cc2e55b 100644
--- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx
+++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingTable3/BSBillingTable3pay.jsx
@@ -141,6 +141,7 @@ import {
changePreviousOrderOfferDetail,
GlobalAllBookingType,
changeSearchedData,
+ PostCancelPayment,
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
import { PrintStyleFunction } from '../../../../paymentpdfPage/PrintStyleFunction.js';
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
@@ -1035,7 +1036,7 @@ const BSBillingTable3Pay = () => {
const selectedStyle =
stylesMap[
- printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
+ printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
];
if (selectedStyle) {
@@ -1574,7 +1575,15 @@ const BSBillingTable3Pay = () => {
: 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 () => {
setMessageType('error');
setMessageData('Financial Year-Based Sales Not Yet Started');
@@ -2261,15 +2270,15 @@ const BSBillingTable3Pay = () => {
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',
@@ -2364,7 +2373,7 @@ const BSBillingTable3Pay = () => {
: Paybtnnameselected?.toLowerCase() === 'credit'
? 'S'
: Paybtnnameselected?.toLowerCase() === 'upi' &&
- SelectedUPIPayOption?.toLowerCase() === 'default'
+ SelectedUPIPayOption?.toLowerCase() === 'default'
? 'S'
: 'P',
OrderDtlDetails:
@@ -2381,9 +2390,9 @@ const BSBillingTable3Pay = () => {
? globalTipAmount === 0
? SelectedTableDetails
: SelectedTableDetails?.map((item) => ({
- ...item,
- TipsAmount: globalTipAmount,
- }))
+ ...item,
+ TipsAmount: globalTipAmount,
+ }))
: null,
SalesPaymentType: 'normal',
PaymentDetail: [
@@ -2398,8 +2407,8 @@ const BSBillingTable3Pay = () => {
? PaymentgatewayUPI?.[0]?.ModeId
: SelectedUPIPayOption?.toLowerCase() === 'business'
? BusinessPayOption?.find(
- (busupi) => busupi?.ModeId === UpiId
- )?.ModeId
+ (busupi) => busupi?.ModeId === UpiId
+ )?.ModeId
: paybtnselected
: paybtnselected
? paybtnselected
@@ -2412,15 +2421,15 @@ const BSBillingTable3Pay = () => {
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'
@@ -2440,29 +2449,29 @@ const BSBillingTable3Pay = () => {
? 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:
@@ -2473,13 +2482,13 @@ const BSBillingTable3Pay = () => {
: 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
@@ -2557,14 +2566,14 @@ const BSBillingTable3Pay = () => {
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]);
@@ -2724,14 +2733,14 @@ const BSBillingTable3Pay = () => {
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]);
@@ -2834,14 +2843,14 @@ const BSBillingTable3Pay = () => {
}
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]);
@@ -3018,14 +3027,14 @@ const BSBillingTable3Pay = () => {
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]);
@@ -3044,7 +3053,7 @@ const BSBillingTable3Pay = () => {
if (
Date.now() - startTime >
useOptions?.[0]?.PDConfigDetails?.[0]?.AutoCancelDurationInMinutes *
- 60000
+ 60000
) {
// 60,000 ms = 1 minute
@@ -3751,9 +3760,9 @@ const BSBillingTable3Pay = () => {
'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',
@@ -3775,16 +3784,16 @@ const BSBillingTable3Pay = () => {
(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',
@@ -3807,14 +3816,14 @@ const BSBillingTable3Pay = () => {
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',
@@ -3850,8 +3859,8 @@ const BSBillingTable3Pay = () => {
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
color:
OrderCardDetail?.length > 0 ||
- (OrderCardDetail?.length > 0 &&
- GetCustId?.CustMobile === undefined)
+ (OrderCardDetail?.length > 0 &&
+ GetCustId?.CustMobile === undefined)
? 'gray'
: 'rgb(18, 146, 238)',
fontSize: '25px',
@@ -3938,65 +3947,65 @@ const BSBillingTable3Pay = () => {
<>
{unpaidFlow == false
? item?.OptionName == 'Hold' &&
- BookingType !== 'Dine In' &&
- !BookingTypeBoth &&
- OrderCardDetail?.length != 0 &&
- CheckOrderType?.length === 0 &&
- OrderType != 'Failed' &&
- CheckBookingStatus != 'Close' &&
- paybtns?.length > 0 &&
- !addnewAccess && (
-