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