Merge pull request 'priceoveride' (#233) from priceoverride into main
Reviewed-on: Pozomind/pozo-retail-app#233
This commit is contained in:
commit
18121bc48b
File diff suppressed because it is too large
Load Diff
|
|
@ -2599,7 +2599,7 @@ const BSBillingTable3 = () => {
|
||||||
{item?.Type != 'C'
|
{item?.Type != 'C'
|
||||||
? item.Offer && item.Offer > 0
|
? item.Offer && item.Offer > 0
|
||||||
? item.Offer
|
? item.Offer
|
||||||
: '-'
|
:item.DiscountAmt ? item.DiscountAmt : '-'
|
||||||
: item?.OfferPrice && item?.OfferPrice > 0
|
: item?.OfferPrice && item?.OfferPrice > 0
|
||||||
? item?.OfferType === 'F'
|
? item?.OfferType === 'F'
|
||||||
? `₹${safeRound(item.OfferPrice)}`
|
? `₹${safeRound(item.OfferPrice)}`
|
||||||
|
|
@ -2876,7 +2876,7 @@ const BSBillingTable3 = () => {
|
||||||
{item?.Type != 'C'
|
{item?.Type != 'C'
|
||||||
? item.Offer && item.Offer > 0
|
? item.Offer && item.Offer > 0
|
||||||
? item.Offer
|
? item.Offer
|
||||||
: '-'
|
: item.DiscountAmt ? item.DiscountAmt : '-'
|
||||||
: item?.OfferPrice && item?.OfferPrice > 0
|
: item?.OfferPrice && item?.OfferPrice > 0
|
||||||
? item?.OfferType === 'F'
|
? item?.OfferType === 'F'
|
||||||
? `₹${safeRound(item.OfferPrice)}`
|
? `₹${safeRound(item.OfferPrice)}`
|
||||||
|
|
@ -3201,7 +3201,7 @@ const BSBillingTable3 = () => {
|
||||||
{item?.Type != 'C'
|
{item?.Type != 'C'
|
||||||
? item.Offer && item.Offer > 0
|
? item.Offer && item.Offer > 0
|
||||||
? item.Offer
|
? item.Offer
|
||||||
: '-'
|
: item.DiscountAmt ? item.DiscountAmt : '-'
|
||||||
: item?.OfferPrice && item?.OfferPrice > 0
|
: item?.OfferPrice && item?.OfferPrice > 0
|
||||||
? item?.OfferType === 'F'
|
? item?.OfferType === 'F'
|
||||||
? `₹${safeRound(item.OfferPrice)}`
|
? `₹${safeRound(item.OfferPrice)}`
|
||||||
|
|
@ -3511,7 +3511,7 @@ const BSBillingTable3 = () => {
|
||||||
{item?.Type != 'C'
|
{item?.Type != 'C'
|
||||||
? item.Offer && item.Offer > 0
|
? item.Offer && item.Offer > 0
|
||||||
? item.Offer
|
? item.Offer
|
||||||
: '-'
|
: item.DiscountAmt ? item.DiscountAmt : '-'
|
||||||
: item?.OfferPrice && item?.OfferPrice > 0
|
: item?.OfferPrice && item?.OfferPrice > 0
|
||||||
? item?.OfferType === 'F'
|
? item?.OfferType === 'F'
|
||||||
? `₹${safeRound(item.OfferPrice)}`
|
? `₹${safeRound(item.OfferPrice)}`
|
||||||
|
|
|
||||||
|
|
@ -324,7 +324,7 @@ const BSBillingTable3Pay = () => {
|
||||||
const ProdSubCat = useSelector(GlobalProductSubCategorie);
|
const ProdSubCat = useSelector(GlobalProductSubCategorie);
|
||||||
const BSLayoutData = useSelector(getTemplateData);
|
const BSLayoutData = useSelector(getTemplateData);
|
||||||
const Combodata = useSelector(GlobalCombocarddata, shallowEqual);
|
const Combodata = useSelector(GlobalCombocarddata, shallowEqual);
|
||||||
|
console.log(PaymentOptions, "PaymentOptions")
|
||||||
const Custdisable = useSelector(GlobalSelectedCustDisable);
|
const Custdisable = useSelector(GlobalSelectedCustDisable);
|
||||||
const SettingDataSelector = useSelector(PreferenceData);
|
const SettingDataSelector = useSelector(PreferenceData);
|
||||||
|
|
||||||
|
|
@ -394,7 +394,6 @@ const BSBillingTable3Pay = () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(OrderCardDetail, 'OrderCardDetail');
|
console.log(OrderCardDetail, 'OrderCardDetail');
|
||||||
//Total calculation
|
|
||||||
const TotalItems = OrderCardDetail?.length;
|
const TotalItems = OrderCardDetail?.length;
|
||||||
const [formattedDate, setFormattedDate] = useState('');
|
const [formattedDate, setFormattedDate] = useState('');
|
||||||
const [UpiOptionOpen, setUpiOptionOpen] = useState(false);
|
const [UpiOptionOpen, setUpiOptionOpen] = useState(false);
|
||||||
|
|
@ -437,6 +436,7 @@ const BSBillingTable3Pay = () => {
|
||||||
const [PaymentgatewayUPI, setPaymentgatewayUPI] = useState([]);
|
const [PaymentgatewayUPI, setPaymentgatewayUPI] = useState([]);
|
||||||
const [PaymentDeviceUPI, setPaymentDeviceUPI] = useState([]);
|
const [PaymentDeviceUPI, setPaymentDeviceUPI] = useState([]);
|
||||||
const [UpiPayOption, setUpiPayOption] = useState([]);
|
const [UpiPayOption, setUpiPayOption] = useState([]);
|
||||||
|
console.log(UpiPayOption, "UpiPayOption")
|
||||||
const [BusinessPayOption, setBusinessPayoption] = useState([]);
|
const [BusinessPayOption, setBusinessPayoption] = useState([]);
|
||||||
const [CardPayOption, setCardPayOption] = useState([]);
|
const [CardPayOption, setCardPayOption] = useState([]);
|
||||||
const [Splitpayment, setSplitpayment] = useState(false);
|
const [Splitpayment, setSplitpayment] = useState(false);
|
||||||
|
|
@ -483,6 +483,7 @@ const BSBillingTable3Pay = () => {
|
||||||
|
|
||||||
const [OrderStatus, setOrderStatus] = useState(true);
|
const [OrderStatus, setOrderStatus] = useState(true);
|
||||||
const GlobaluseOptions = useSelector(GlobalCommonPaymentOptions);
|
const GlobaluseOptions = useSelector(GlobalCommonPaymentOptions);
|
||||||
|
console.log(GlobaluseOptions, "GlobaluseOptions")
|
||||||
const [useOptions, setuseOptions] = useState([]);
|
const [useOptions, setuseOptions] = useState([]);
|
||||||
const paymentloader = useSelector(GlobalPayementloader);
|
const paymentloader = useSelector(GlobalPayementloader);
|
||||||
const [UnpaidConfirmation, setUnpaidConfirmation] = useState(false);
|
const [UnpaidConfirmation, setUnpaidConfirmation] = useState(false);
|
||||||
|
|
@ -1011,7 +1012,7 @@ const BSBillingTable3Pay = () => {
|
||||||
|
|
||||||
const selectedStyle =
|
const selectedStyle =
|
||||||
stylesMap[
|
stylesMap[
|
||||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||||
];
|
];
|
||||||
|
|
||||||
if (selectedStyle) {
|
if (selectedStyle) {
|
||||||
|
|
@ -1091,8 +1092,8 @@ const BSBillingTable3Pay = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// if (salesBillEdit) {
|
// if (salesBillEdit) {
|
||||||
setDefaultPaymentOption();
|
setDefaultPaymentOption();
|
||||||
// }
|
// }
|
||||||
}, [defaultPaymentTrigger, salesBillEdit]);
|
}, [defaultPaymentTrigger, salesBillEdit]);
|
||||||
|
|
||||||
const TokenPrint = async (index) => {
|
const TokenPrint = async (index) => {
|
||||||
|
|
@ -1632,6 +1633,7 @@ const BSBillingTable3Pay = () => {
|
||||||
//dhana
|
//dhana
|
||||||
|
|
||||||
const getPaymentOptionFeature = async () => {
|
const getPaymentOptionFeature = async () => {
|
||||||
|
|
||||||
const FiltersalesPayment = GlobaluseOptions?.filter(
|
const FiltersalesPayment = GlobaluseOptions?.filter(
|
||||||
(item) => item.FlowName?.toLowerCase() === 'sales'
|
(item) => item.FlowName?.toLowerCase() === 'sales'
|
||||||
);
|
);
|
||||||
|
|
@ -1666,6 +1668,7 @@ const BSBillingTable3Pay = () => {
|
||||||
filterpaymentdevice?.[0]?.ModeDetails?.filter((item) =>
|
filterpaymentdevice?.[0]?.ModeDetails?.filter((item) =>
|
||||||
item?.ModeName?.toLowerCase()?.includes('upi')
|
item?.ModeName?.toLowerCase()?.includes('upi')
|
||||||
) || [];
|
) || [];
|
||||||
|
|
||||||
setPaymentOptions(filterpaycounter?.[0]?.ModeDetails);
|
setPaymentOptions(filterpaycounter?.[0]?.ModeDetails);
|
||||||
setPaymentUpiOptions(
|
setPaymentUpiOptions(
|
||||||
FiltersalesPayment?.[0]?.PaymentDetails?.Payatthecounter
|
FiltersalesPayment?.[0]?.PaymentDetails?.Payatthecounter
|
||||||
|
|
@ -2207,6 +2210,7 @@ const BSBillingTable3Pay = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const Booking = async (value, pay) => {
|
const Booking = async (value, pay) => {
|
||||||
|
|
||||||
const TakAwayId = ConfigDataList?.find(
|
const TakAwayId = ConfigDataList?.find(
|
||||||
(a) => a?.ConfigName === 'TakeAway'
|
(a) => a?.ConfigName === 'TakeAway'
|
||||||
)?.ConfigId;
|
)?.ConfigId;
|
||||||
|
|
@ -2232,15 +2236,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',
|
||||||
|
|
@ -2257,6 +2261,10 @@ const BSBillingTable3Pay = () => {
|
||||||
BatchRef: a.BatchRef,
|
BatchRef: a.BatchRef,
|
||||||
PackageDtl: a.PackageDtl,
|
PackageDtl: a.PackageDtl,
|
||||||
SetCount: a.SetCount,
|
SetCount: a.SetCount,
|
||||||
|
...(a?.DiscountValue && { DiscountValue: a.DiscountValue }),
|
||||||
|
...(a?.DiscountType && { DiscountType: a.DiscountType }),
|
||||||
|
...(a?.DiscountAmt && { DiscountAmt: a.DiscountAmt })
|
||||||
|
|
||||||
}));
|
}));
|
||||||
const NotSlectedTypeFind = temporderdetail?.find(
|
const NotSlectedTypeFind = temporderdetail?.find(
|
||||||
(a) => a?.BookingType != SelectedBookingType
|
(a) => a?.BookingType != SelectedBookingType
|
||||||
|
|
@ -2332,7 +2340,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:
|
||||||
|
|
@ -2349,9 +2357,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: [
|
||||||
|
|
@ -2366,8 +2374,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
|
||||||
|
|
@ -2380,15 +2388,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'
|
||||||
|
|
@ -2408,29 +2416,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:
|
||||||
|
|
@ -2441,13 +2449,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
|
||||||
|
|
@ -2525,14 +2533,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]);
|
||||||
|
|
@ -2692,14 +2700,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]);
|
||||||
|
|
@ -2802,14 +2810,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]);
|
||||||
|
|
@ -2986,14 +2994,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]);
|
||||||
|
|
@ -3012,7 +3020,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
|
||||||
|
|
||||||
|
|
@ -3731,9 +3739,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',
|
||||||
|
|
@ -3755,16 +3763,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',
|
||||||
|
|
@ -3787,14 +3795,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',
|
||||||
|
|
@ -3811,38 +3819,38 @@ const BSBillingTable3Pay = () => {
|
||||||
{/* Customer Orders */}
|
{/* Customer Orders */}
|
||||||
{(SelCustId && tableOptions?.filter((item) => item.OptionName === 'PreviousBillFetch')
|
{(SelCustId && tableOptions?.filter((item) => item.OptionName === 'PreviousBillFetch')
|
||||||
.length === 1) && (
|
.length === 1) && (
|
||||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||||
{' '}
|
{' '}
|
||||||
<div
|
<div
|
||||||
className="BSBillingNav-icon-table-icon"
|
className="BSBillingNav-icon-table-icon"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (
|
if (
|
||||||
CheckBookingStatus !== 'Close' &&
|
CheckBookingStatus !== 'Close' &&
|
||||||
!addnewAccess &&
|
!addnewAccess &&
|
||||||
!(OrderCardDetail?.length > 0)
|
!(OrderCardDetail?.length > 0)
|
||||||
) {
|
) {
|
||||||
setCustomerPreviesOrders(true);
|
setCustomerPreviesOrders(true);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
style={{
|
style={{
|
||||||
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',
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
height: '2.46rem',
|
height: '2.46rem',
|
||||||
width: '1.5rem',
|
width: '1.5rem',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FaCartPlus />
|
<FaCartPlus />
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
{tabledata?.length > 0 && (
|
{tabledata?.length > 0 && (
|
||||||
<>
|
<>
|
||||||
{tableOptions
|
{tableOptions
|
||||||
|
|
@ -3916,65 +3924,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>
|
|
||||||
)
|
|
||||||
: ''}
|
: ''}
|
||||||
</>
|
</>
|
||||||
))}
|
))}
|
||||||
|
|
@ -4020,14 +4028,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',
|
||||||
|
|
@ -4089,31 +4097,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'
|
||||||
}
|
}
|
||||||
|
|
@ -4127,13 +4135,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>} */}
|
||||||
|
|
@ -4193,10 +4201,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'
|
||||||
}
|
}
|
||||||
|
|
@ -4468,9 +4476,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
|
||||||
|
|
@ -4488,7 +4496,7 @@ const BSBillingTable3Pay = () => {
|
||||||
// financialYearError:
|
// financialYearError:
|
||||||
handleButtonClick
|
handleButtonClick
|
||||||
}
|
}
|
||||||
//dhana
|
//dhana
|
||||||
>
|
>
|
||||||
{!OrderStatus ? (
|
{!OrderStatus ? (
|
||||||
salesBillEdit && currentOrderNetAmount < previousNetAmount ? (
|
salesBillEdit && currentOrderNetAmount < previousNetAmount ? (
|
||||||
|
|
@ -4717,14 +4725,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}
|
||||||
/>
|
/>
|
||||||
|
|
@ -4800,9 +4808,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 (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue