resolved conflicting files
This commit is contained in:
parent
139789f085
commit
2f4f8d3e5e
|
|
@ -56,9 +56,6 @@ import {
|
||||||
changeBtoBQuickProductTransfer,
|
changeBtoBQuickProductTransfer,
|
||||||
changeTipAmount,
|
changeTipAmount,
|
||||||
GlobalDineinDefault,
|
GlobalDineinDefault,
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changeBillEditingMode,
|
|
||||||
} from '../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import {
|
import {
|
||||||
changeWholeSaleAuctionSelectedData,
|
changeWholeSaleAuctionSelectedData,
|
||||||
|
|
@ -265,9 +262,6 @@ const SideMenuPozo = ({ items = [] }) => {
|
||||||
dispatch(ChangeTotalAmount([]));
|
dispatch(ChangeTotalAmount([]));
|
||||||
dispatch(ChangeFullFreeProductList([]));
|
dispatch(ChangeFullFreeProductList([]));
|
||||||
dispatch(changeFullOfferAppliedProducts([]));
|
dispatch(changeFullOfferAppliedProducts([]));
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
dispatch(changeLoyaltyConsumedQuantities({}));
|
dispatch(changeLoyaltyConsumedQuantities({}));
|
||||||
}
|
}
|
||||||
if (e == `${subDirectory}sales`) {
|
if (e == `${subDirectory}sales`) {
|
||||||
|
|
@ -291,9 +285,6 @@ const SideMenuPozo = ({ items = [] }) => {
|
||||||
dispatch(Offer.changeCoupenCodeAmount(0));
|
dispatch(Offer.changeCoupenCodeAmount(0));
|
||||||
dispatch(ChangeFullFreeProductList([]));
|
dispatch(ChangeFullFreeProductList([]));
|
||||||
dispatch(changeFullOfferAppliedProducts([]));
|
dispatch(changeFullOfferAppliedProducts([]));
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
dispatch(ChangeTotalAmount([]));
|
dispatch(ChangeTotalAmount([]));
|
||||||
dispatch(changeLoyaltyConsumedQuantities({}));
|
dispatch(changeLoyaltyConsumedQuantities({}));
|
||||||
}
|
}
|
||||||
|
|
@ -391,7 +382,7 @@ const SideMenuPozo = ({ items = [] }) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
handleMenuClick(item, parentKeys, e, level);
|
handleMenuClick(item, parentKeys, e, level);
|
||||||
}}
|
}}
|
||||||
// style={{ paddingLeft: `${level * 10 + 1}px` }}
|
// style={{ paddingLeft: `${level * 10 + 1}px` }}
|
||||||
>
|
>
|
||||||
{item.icon && level === 0 && (
|
{item.icon && level === 0 && (
|
||||||
<span
|
<span
|
||||||
|
|
|
||||||
|
|
@ -168,14 +168,6 @@ export const PutBookingData = createAsyncThunk(
|
||||||
return await axiosRetailInstanceData.put(`/Booking`, putData);
|
return await axiosRetailInstanceData.put(`/Booking`, putData);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
export const putSalesBillEdit = createAsyncThunk(
|
|
||||||
'BookingData/putSalesBillEdit',
|
|
||||||
async (putData) => {
|
|
||||||
return await axiosRetailInstanceData.put(`/SalesBillEdit`, putData);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
export const getEstimateDatewiseReport = createAsyncThunk(
|
export const getEstimateDatewiseReport = createAsyncThunk(
|
||||||
'BookingData/getEstimateDatewiseReport',
|
'BookingData/getEstimateDatewiseReport',
|
||||||
async (data) => {
|
async (data) => {
|
||||||
|
|
@ -1440,7 +1432,7 @@ export const getMissedOrderids = createAsyncThunk(
|
||||||
export const CustomerOrderList = createAsyncThunk(
|
export const CustomerOrderList = createAsyncThunk(
|
||||||
'CustomerOrderList/LastBuyProductList',
|
'CustomerOrderList/LastBuyProductList',
|
||||||
async (data) => {
|
async (data) => {
|
||||||
const { AppId, CompId, BranchId, MobileNo, FromDate, ToDate } = data;
|
const { AppId, CompId, BranchId, MobileNo,FromDate,ToDate } = data;
|
||||||
if (
|
if (
|
||||||
AppId != null &&
|
AppId != null &&
|
||||||
AppId != undefined &&
|
AppId != undefined &&
|
||||||
|
|
@ -1612,9 +1604,6 @@ const initialState = {
|
||||||
AddBookingDetailsTrigger: false,
|
AddBookingDetailsTrigger: false,
|
||||||
CurrentOrderId: null,
|
CurrentOrderId: null,
|
||||||
productCardTrigger: 0,
|
productCardTrigger: 0,
|
||||||
salesBillEdit: false,
|
|
||||||
previousOrderPayment: [],
|
|
||||||
previousOrderOfferDetails: [],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const BookingData = createSlice({
|
const BookingData = createSlice({
|
||||||
|
|
@ -1940,15 +1929,6 @@ const BookingData = createSlice({
|
||||||
triggerProductCard: (state) => {
|
triggerProductCard: (state) => {
|
||||||
state.productCardTrigger += 1;
|
state.productCardTrigger += 1;
|
||||||
},
|
},
|
||||||
changeBillEditingMode: (state, action) => {
|
|
||||||
state.salesBillEdit = action?.payload;
|
|
||||||
},
|
|
||||||
changePreviousOrderPayment: (state, action) => {
|
|
||||||
state.previousOrderPayment = action?.payload;
|
|
||||||
},
|
|
||||||
changePreviousOrderOfferDetail: (state, action) => {
|
|
||||||
state.previousOrderOfferDetails = action?.payload;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
extraReducers: (builder) => {
|
extraReducers: (builder) => {
|
||||||
|
|
@ -1996,8 +1976,8 @@ const BookingData = createSlice({
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
||||||
builder.addCase(getProductsearch.fulfilled, (state, action) => {
|
builder.addCase(getProductsearch.fulfilled, (state, action) => {
|
||||||
console.log(action?.payload, "mohanaacacacca")
|
console.log(action?.payload,"mohanaacacacca")
|
||||||
if (action?.payload?.statusCode === 1) {
|
if (action?.payload?.statusCode === 1) {
|
||||||
state.SelectedDatas = action?.payload?.data;
|
state.SelectedDatas = action?.payload?.data;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -2217,9 +2197,6 @@ export const {
|
||||||
changeAddBookingDetailsTrigger,
|
changeAddBookingDetailsTrigger,
|
||||||
changeCurrentOrderId,
|
changeCurrentOrderId,
|
||||||
triggerProductCard,
|
triggerProductCard,
|
||||||
changeBillEditingMode,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changePreviousOrderOfferDetail
|
|
||||||
} = BookingData.actions;
|
} = BookingData.actions;
|
||||||
|
|
||||||
export const GlobalComboRedirectionToDefaultLayoutForParking = (state) =>
|
export const GlobalComboRedirectionToDefaultLayoutForParking = (state) =>
|
||||||
|
|
@ -2388,11 +2365,5 @@ export const GlobalAddBookingDetailsTrigger = (state) =>
|
||||||
state?.BookingData?.AddBookingDetailsTrigger;
|
state?.BookingData?.AddBookingDetailsTrigger;
|
||||||
export const GlobalCurrentOrderId = (state) =>
|
export const GlobalCurrentOrderId = (state) =>
|
||||||
state?.BookingData?.CurrentOrderId;
|
state?.BookingData?.CurrentOrderId;
|
||||||
export const GlobalSalesBillEdit = (state) =>
|
|
||||||
state?.BookingData?.salesBillEdit;
|
|
||||||
export const GlobalPreviousOrderPayment = (state) =>
|
|
||||||
state?.BookingData?.previousOrderPayment;
|
|
||||||
export const GlobalPreviousOrderOfferDetails = (state) =>
|
|
||||||
state?.BookingData?.previousOrderOfferDetails;
|
|
||||||
|
|
||||||
export default BookingData.reducer;
|
export default BookingData.reducer;
|
||||||
|
|
|
||||||
|
|
@ -117,15 +117,6 @@ import {
|
||||||
changeCurrentOrderId,
|
changeCurrentOrderId,
|
||||||
GlobalCombocarddata,
|
GlobalCombocarddata,
|
||||||
getCreditCustomer,
|
getCreditCustomer,
|
||||||
GlobalSalesBillEdit,
|
|
||||||
GlobalPreviousOrderPayment,
|
|
||||||
GlobalPreviousOrderOfferDetails,
|
|
||||||
GlobalpaymentOptionData,
|
|
||||||
getPaymentOptions,
|
|
||||||
putSalesBillEdit,
|
|
||||||
changeBillEditingMode,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
|
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
|
||||||
import {
|
import {
|
||||||
|
|
@ -244,10 +235,6 @@ export default function BST1Payment() {
|
||||||
);
|
);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
|
||||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
|
||||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
|
||||||
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
|
||||||
const Discount = useSelector(GlobalOverAllOfferAmt);
|
const Discount = useSelector(GlobalOverAllOfferAmt);
|
||||||
const defaultBookingType = useSelector(GlobalDefaultBookingType);
|
const defaultBookingType = useSelector(GlobalDefaultBookingType);
|
||||||
const globalTipAmount = useSelector(GlobaltipAmount);
|
const globalTipAmount = useSelector(GlobaltipAmount);
|
||||||
|
|
@ -336,12 +323,6 @@ export default function BST1Payment() {
|
||||||
const [defaultEnabled, setDefaultEnabled] = useState(false);
|
const [defaultEnabled, setDefaultEnabled] = useState(false);
|
||||||
const [SelectedUpiOption, setSelectedUpiOption] = useState();
|
const [SelectedUpiOption, setSelectedUpiOption] = useState();
|
||||||
const [hold, setHold] = useState(false);
|
const [hold, setHold] = useState(false);
|
||||||
const [refundPayBtns, setRefundPayBtns] = useState([]);
|
|
||||||
const [refundPaySelected, setRefundPaySelected] = useState();
|
|
||||||
const [refundPaySelectedName, setRefundPaySelectedName] = useState(null);
|
|
||||||
const [currentOrderNetAmount, setCurrentOrderNetAmount] = useState(0);
|
|
||||||
const [previousNetAmount, setPreviousNetAmount] = useState(0);
|
|
||||||
console.log(currentOrderNetAmount, 'currentOrderNetAmount', previousNetAmount, salesBillEdit);
|
|
||||||
const [addcustomer, setAddCustomer] = useState(false);
|
const [addcustomer, setAddCustomer] = useState(false);
|
||||||
const [PrintOrderDetails, setPrintOrderDetails] = useState([]);
|
const [PrintOrderDetails, setPrintOrderDetails] = useState([]);
|
||||||
//Total calculation
|
//Total calculation
|
||||||
|
|
@ -559,27 +540,6 @@ export default function BST1Payment() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredPayments =
|
|
||||||
previousOrderPayment?.filter(
|
|
||||||
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment
|
|
||||||
) || [];
|
|
||||||
|
|
||||||
const paymentsToUse =
|
|
||||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
|
||||||
|
|
||||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
|
||||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const totalPreviousOfferAmount = previousOrderOfferDetails?.reduce(
|
|
||||||
(acc, offer) => acc + parseFloat(offer.OfferAmount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const previousNetAmount =
|
|
||||||
(totalPreviouspayment) || 0;
|
|
||||||
|
|
||||||
// let withdiscTotal = Total - ((OverAllSales || 0) + (OverAllEstimate || 0));
|
// let withdiscTotal = Total - ((OverAllSales || 0) + (OverAllEstimate || 0));
|
||||||
let withdiscTotal =
|
let withdiscTotal =
|
||||||
Total -
|
Total -
|
||||||
|
|
@ -587,17 +547,19 @@ export default function BST1Payment() {
|
||||||
(OverAllEstimate || 0) +
|
(OverAllEstimate || 0) +
|
||||||
(Discount > 0 ? Discount : 0));
|
(Discount > 0 ? Discount : 0));
|
||||||
|
|
||||||
const currentOrderNetAmount = formatAmount(
|
setTotalAmount(
|
||||||
withdiscTotal >= 0
|
formatAmount(
|
||||||
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
withdiscTotal >= 0
|
||||||
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
||||||
)
|
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
||||||
|
)
|
||||||
setTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount);
|
);
|
||||||
setCurrentOrderNetAmount(currentOrderNetAmount);
|
|
||||||
setPreviousNetAmount(previousNetAmount);
|
|
||||||
dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount));
|
|
||||||
|
|
||||||
|
dispatch(
|
||||||
|
changeSummeryTotalAmount(
|
||||||
|
formatAmount(withdiscTotal > 0 ? withdiscTotal : Number(Total))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
||||||
|
|
||||||
|
|
@ -659,31 +621,6 @@ export default function BST1Payment() {
|
||||||
fetchApi();
|
fetchApi();
|
||||||
}
|
}
|
||||||
}, [UserType]);
|
}, [UserType]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (salesBillEdit) {
|
|
||||||
dispatch(getPaymentOptions()).unwrap();
|
|
||||||
}
|
|
||||||
}, [salesBillEdit]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
|
|
||||||
if (salesBillEdit) {
|
|
||||||
if (SelCustId) {
|
|
||||||
setRefundPayBtns(AllPaymentOptions);
|
|
||||||
setRefundPaySelected(AllPaymentOptions?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(AllPaymentOptions?.[0]?.ConfigName);
|
|
||||||
} else {
|
|
||||||
const withoutCustomer = AllPaymentOptions?.filter?.(
|
|
||||||
(item) => item?.ConfigName?.toLowerCase() !== 'credit'
|
|
||||||
);
|
|
||||||
setRefundPaySelected(withoutCustomer?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(withoutCustomer?.[0]?.ConfigName);
|
|
||||||
setRefundPayBtns(withoutCustomer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, [AllPaymentOptions, SelCustId, salesBillEdit])
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let hasAccess = false;
|
let hasAccess = false;
|
||||||
|
|
||||||
|
|
@ -891,7 +828,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) {
|
||||||
|
|
@ -1245,7 +1182,7 @@ export default function BST1Payment() {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
PrintOrderDetails?.[0]?.OrderDetails?.map(
|
PrintOrderDetails?.[0]?.OrderDetails?.map(
|
||||||
async (orderDetail, index) => {
|
async (orderDetail, index) => {
|
||||||
const groupedTokens = orderDetail?.productDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.reduce(
|
const groupedTokens = orderDetail?.productDetails?.reduce(
|
||||||
(acc, item, idx) => {
|
(acc, item, idx) => {
|
||||||
if (item.TokenAvailable === 'Y') {
|
if (item.TokenAvailable === 'Y') {
|
||||||
if (!item.CounterName) {
|
if (!item.CounterName) {
|
||||||
|
|
@ -1326,10 +1263,6 @@ export default function BST1Payment() {
|
||||||
const handleButtonClick = () => {
|
const handleButtonClick = () => {
|
||||||
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
||||||
UpiPayment();
|
UpiPayment();
|
||||||
} else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Please Select Refund Payment Method');
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? AddBookingDetails('Dine-In', false)
|
? AddBookingDetails('Dine-In', false)
|
||||||
|
|
@ -1602,12 +1535,6 @@ export default function BST1Payment() {
|
||||||
setCardoptionnotSelected(false);
|
setCardoptionnotSelected(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRefundPaymentMode = (id, name) => {
|
|
||||||
setRefundPaySelected(id);
|
|
||||||
setRefundPaySelectedName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
const addUpiOption = async (id, name, UPIId) => {
|
const addUpiOption = async (id, name, UPIId) => {
|
||||||
await dispatch(changeUpiIDprint(UPIId));
|
await dispatch(changeUpiIDprint(UPIId));
|
||||||
await dispatch(changeUpiIDName(name));
|
await dispatch(changeUpiIDName(name));
|
||||||
|
|
@ -1809,9 +1736,6 @@ export default function BST1Payment() {
|
||||||
ParkingClaimed: false,
|
ParkingClaimed: false,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
dispatch(changeTipAmount(0));
|
dispatch(changeTipAmount(0));
|
||||||
dispatch(changeLoyaltyConsumedQuantities({}));
|
dispatch(changeLoyaltyConsumedQuantities({}));
|
||||||
dispatch(changeFullOfferAppliedProducts([]));
|
dispatch(changeFullOfferAppliedProducts([]));
|
||||||
|
|
@ -1828,8 +1752,6 @@ export default function BST1Payment() {
|
||||||
setPaybtnselected(PaymentOptionsModeId);
|
setPaybtnselected(PaymentOptionsModeId);
|
||||||
setQrCode(false);
|
setQrCode(false);
|
||||||
setUpinotSelected(false);
|
setUpinotSelected(false);
|
||||||
setCurrentOrderNetAmount(0);
|
|
||||||
setPreviousNetAmount(0);
|
|
||||||
getHolddata();
|
getHolddata();
|
||||||
if (defaultBookingType === 'Both') {
|
if (defaultBookingType === 'Both') {
|
||||||
await dispatch(changeBookingType('TakeAway'));
|
await dispatch(changeBookingType('TakeAway'));
|
||||||
|
|
@ -2006,15 +1928,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',
|
||||||
|
|
@ -2104,7 +2026,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:
|
||||||
|
|
@ -2121,15 +2043,15 @@ 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',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
{
|
{
|
||||||
PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected :
|
PaymentType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi'
|
Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
||||||
? PaymentDeviceUPI?.[0]?.ModeId
|
? PaymentDeviceUPI?.[0]?.ModeId
|
||||||
|
|
@ -2137,20 +2059,20 @@ 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
|
||||||
: null,
|
: null,
|
||||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
Amount: Math.round(TotalAmount),
|
||||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
MerchantId:
|
||||||
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: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
PaymentOptionType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2164,42 +2086,42 @@ export default function BST1Payment() {
|
||||||
? 'BU'
|
? 'BU'
|
||||||
: SelectedUPIPayOption
|
: SelectedUPIPayOption
|
||||||
: null,
|
: null,
|
||||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
ModeOfPayment:
|
||||||
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((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantUPIId
|
?.MerchantUPIId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
AccountDtl:
|
||||||
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: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
PaymentStatus:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 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: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
Debit: 0,
|
||||||
Credit: salesBillEdit ? (currentOrderNetAmount > previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(TotalAmount) : 0 :
|
Credit:
|
||||||
Paybtnnameselected?.toLowerCase() === 'credit'
|
Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? Math.round(TotalAmount)
|
? Math.round(TotalAmount)
|
||||||
: 0,
|
: 0,
|
||||||
|
|
@ -2268,14 +2190,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]);
|
||||||
|
|
@ -2404,12 +2326,7 @@ export default function BST1Payment() {
|
||||||
putdata['PaymentType'] = !pay && '';
|
putdata['PaymentType'] = !pay && '';
|
||||||
putdata['PrintType'] = 'Y';
|
putdata['PrintType'] = 'Y';
|
||||||
}
|
}
|
||||||
let response = null;
|
let response = await dispatch(PutBookingData(putdata)).unwrap();
|
||||||
if (salesBillEdit) {
|
|
||||||
response = await dispatch(putSalesBillEdit(putdata)).unwrap();
|
|
||||||
} else {
|
|
||||||
response = await dispatch(PutBookingData(putdata)).unwrap();
|
|
||||||
}
|
|
||||||
if (value !== 'Unpaid') {
|
if (value !== 'Unpaid') {
|
||||||
if (response?.data?.statusCode == 1) {
|
if (response?.data?.statusCode == 1) {
|
||||||
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
|
|
@ -2432,14 +2349,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]);
|
||||||
|
|
@ -2540,14 +2457,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]);
|
||||||
|
|
@ -2722,14 +2639,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]);
|
||||||
|
|
@ -2747,7 +2664,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
|
||||||
|
|
||||||
|
|
@ -3181,7 +3098,7 @@ export default function BST1Payment() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const SplitPaymentOpen = () => {
|
const SplitPaymentOpen = () => {
|
||||||
if (OrderCardDetail?.length > 0 && TotalAmount > 0) {
|
if (OrderCardDetail?.length > 0) {
|
||||||
const updatedData = {
|
const updatedData = {
|
||||||
userData: OrderCardDetail,
|
userData: OrderCardDetail,
|
||||||
ExtraCharges: GlobalExtraCharge,
|
ExtraCharges: GlobalExtraCharge,
|
||||||
|
|
@ -3191,11 +3108,6 @@ export default function BST1Payment() {
|
||||||
setFailedOrderData(updatedData);
|
setFailedOrderData(updatedData);
|
||||||
setSplitpayment(true);
|
setSplitpayment(true);
|
||||||
} else {
|
} else {
|
||||||
if (TotalAmount <= 0) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Cannot split when total amount is zero or less');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
setMessageData('Please Select the Product');
|
setMessageData('Please Select the Product');
|
||||||
}
|
}
|
||||||
|
|
@ -3525,30 +3437,30 @@ 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 && (currentOrderNetAmount >= previousNetAmount) ? (
|
{paybtns?.length > 0 ? (
|
||||||
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'
|
||||||
}
|
}
|
||||||
|
|
@ -3562,13 +3474,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>} */}
|
||||||
|
|
@ -3619,42 +3531,6 @@ export default function BST1Payment() {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? (
|
|
||||||
refundPayBtns.map((payment) => (
|
|
||||||
<div className="Table3-cash">
|
|
||||||
<button
|
|
||||||
className={
|
|
||||||
refundPaySelected === payment.ConfigId &&
|
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode-notupisel'
|
|
||||||
: refundPaySelected === payment.ConfigId &&
|
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode'
|
|
||||||
: 'Btn-payment-mode-sel'
|
|
||||||
}
|
|
||||||
style={{
|
|
||||||
fontFamily: FontFamily['para'],
|
|
||||||
position: 'relative',
|
|
||||||
animation: blink
|
|
||||||
? 'blink-animation 0.5s infinite alternate'
|
|
||||||
: 'none',
|
|
||||||
}}
|
|
||||||
onClick={() => handleRefundPaymentMode(payment?.ConfigId, payment?.ConfigName)}
|
|
||||||
>
|
|
||||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
|
||||||
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'row',
|
|
||||||
columnGap: '0.5rem',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{payment.ConfigName}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
))
|
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
onClick={handlepaymentoptions}
|
onClick={handlepaymentoptions}
|
||||||
|
|
@ -3698,9 +3574,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',
|
||||||
|
|
@ -3750,16 +3626,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,
|
||||||
}}
|
}}
|
||||||
|
|
@ -3778,14 +3654,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',
|
||||||
|
|
@ -3851,14 +3727,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',
|
||||||
|
|
@ -3940,58 +3816,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>
|
||||||
)}
|
)}
|
||||||
|
|
@ -4020,11 +3896,6 @@ export default function BST1Payment() {
|
||||||
}
|
}
|
||||||
BillingTableName="BillingTable1"
|
BillingTableName="BillingTable1"
|
||||||
CheckBookingStatus={CheckBookingStatus}
|
CheckBookingStatus={CheckBookingStatus}
|
||||||
salesBillEdit={salesBillEdit}
|
|
||||||
currentOrderNetAmount={currentOrderNetAmount}
|
|
||||||
previousNetAmount={previousNetAmount}
|
|
||||||
credit={credit}
|
|
||||||
overAllBal={overAllBal}
|
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<TooltipWrapper title="Create Bill (F4)" isMobile={isMobile}>
|
<TooltipWrapper title="Create Bill (F4)" isMobile={isMobile}>
|
||||||
|
|
@ -4034,12 +3905,11 @@ 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 ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ?
|
? !OrderStatus
|
||||||
'price-button'
|
? 'price-button'
|
||||||
: 'price-button'
|
|
||||||
: 'price-button Order'
|
: 'price-button Order'
|
||||||
: 'price-button-disabled'
|
: 'price-button-disabled'
|
||||||
}
|
}
|
||||||
|
|
@ -4054,7 +3924,7 @@ export default function BST1Payment() {
|
||||||
>
|
>
|
||||||
{' '}
|
{' '}
|
||||||
{isMobile ? (
|
{isMobile ? (
|
||||||
!OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ? <div>Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</div> : (
|
!OrderStatus ? (
|
||||||
`₹ ${Math.round(
|
`₹ ${Math.round(
|
||||||
OrderType === 'Failed'
|
OrderType === 'Failed'
|
||||||
? FailedTotalAmt
|
? FailedTotalAmt
|
||||||
|
|
@ -4065,7 +3935,7 @@ export default function BST1Payment() {
|
||||||
) : (
|
) : (
|
||||||
'ORDER'
|
'ORDER'
|
||||||
)
|
)
|
||||||
) : !OrderStatus ? (salesBillEdit && (currentOrderNetAmount < previousNetAmount)) ? (<div>Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</div>) : (
|
) : !OrderStatus ? (
|
||||||
<div>
|
<div>
|
||||||
₹{' '}
|
₹{' '}
|
||||||
<CountUp
|
<CountUp
|
||||||
|
|
@ -4263,10 +4133,7 @@ export default function BST1Payment() {
|
||||||
SplitPaymentModal={Splitpayment}
|
SplitPaymentModal={Splitpayment}
|
||||||
handlesplitpaymentclose={handlesplitpaymentclose}
|
handlesplitpaymentclose={handlesplitpaymentclose}
|
||||||
TotalNetAmount={
|
TotalNetAmount={
|
||||||
OrderType === 'Failed' ? FailedTotalAmt : Math.round(OrderCardDetail?.reduce((acc, data) => data?.TotalAmt + acc, 0) -
|
OrderType === 'Failed' ? FailedTotalAmt : Math.round(TotalAmount)
|
||||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
|
||||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
|
||||||
(Discount > 0 ? Discount : 0)))
|
|
||||||
}
|
}
|
||||||
failedOrderData={failedOrderData}
|
failedOrderData={failedOrderData}
|
||||||
/>
|
/>
|
||||||
|
|
@ -4399,9 +4266,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 (
|
||||||
|
|
@ -4517,23 +4384,23 @@ export default function BST1Payment() {
|
||||||
</Modal>
|
</Modal>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{customerPreviesOrders && (
|
{customerPreviesOrders && (
|
||||||
<DefaultModal
|
<DefaultModal
|
||||||
open={customerPreviesOrders}
|
open={customerPreviesOrders}
|
||||||
handleCancel={() => setCustomerPreviesOrders(false)}
|
handleCancel={() => setCustomerPreviesOrders(false)}
|
||||||
footer={false}
|
footer={false}
|
||||||
width={700}
|
width={700}
|
||||||
className={'ModalPaymentGatewayEmbedded'}
|
className={'ModalPaymentGatewayEmbedded'}
|
||||||
children={
|
children={
|
||||||
<>
|
<>
|
||||||
<CustomerOrders
|
<CustomerOrders
|
||||||
CustomerDetails={selOption}
|
CustomerDetails={selOption}
|
||||||
close={() => setCustomerPreviesOrders(false)}
|
close={() => setCustomerPreviesOrders(false)}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
</>
|
)}
|
||||||
}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,11 +32,6 @@ const PaymentInput = ({
|
||||||
handleButtonClick,
|
handleButtonClick,
|
||||||
BillingTableName,
|
BillingTableName,
|
||||||
CheckBookingStatus,
|
CheckBookingStatus,
|
||||||
salesBillEdit = false,
|
|
||||||
currentOrderNetAmount = 0,
|
|
||||||
previousNetAmount = 0,
|
|
||||||
credit = false,
|
|
||||||
overAllBal = 0,
|
|
||||||
}) => {
|
}) => {
|
||||||
const { SadminuserAccess } = useAuth();
|
const { SadminuserAccess } = useAuth();
|
||||||
let SAAccessCommonMaster = SadminuserAccess?.find(
|
let SAAccessCommonMaster = SadminuserAccess?.find(
|
||||||
|
|
@ -138,9 +133,9 @@ const PaymentInput = ({
|
||||||
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
|
||||||
? 'price-button'
|
? 'price-button'
|
||||||
: 'price-button Order'
|
: 'price-button Order'
|
||||||
|
|
@ -157,15 +152,13 @@ const PaymentInput = ({
|
||||||
style={{ fontFamily: FontFamily['head'] }}
|
style={{ fontFamily: FontFamily['head'] }}
|
||||||
>
|
>
|
||||||
{isMobile &&
|
{isMobile &&
|
||||||
(!OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ? <div>Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</div> :
|
(!OrderStatus
|
||||||
`₹ ${Math.round(
|
? `₹ ${Math.round(
|
||||||
OrderType === 'Failed' ? failedTotalAmt : credit && overAllBal >= 0
|
OrderType === 'Failed' ? failedTotalAmt : totalAmount
|
||||||
? Math.max(0, totalAmount - overAllBal)
|
)}`
|
||||||
: totalAmount
|
|
||||||
)}`
|
|
||||||
: 'ORDER')}
|
: 'ORDER')}
|
||||||
|
|
||||||
{!isMobile && !OrderStatus && ((salesBillEdit && (currentOrderNetAmount < previousNetAmount)) ? <div>Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</div> : (
|
{!isMobile && !OrderStatus && (
|
||||||
<>
|
<>
|
||||||
₹{' '}
|
₹{' '}
|
||||||
{/* <CountUp
|
{/* <CountUp
|
||||||
|
|
@ -177,11 +170,9 @@ const PaymentInput = ({
|
||||||
/> */}
|
/> */}
|
||||||
{OrderType === 'Failed'
|
{OrderType === 'Failed'
|
||||||
? failedTotalAmt
|
? failedTotalAmt
|
||||||
: safeRound((credit && overAllBal >= 0)
|
: safeRound(totalAmount)}
|
||||||
? Math.max(0, totalAmount - overAllBal)
|
|
||||||
: totalAmount)}
|
|
||||||
</>
|
</>
|
||||||
))}
|
)}
|
||||||
|
|
||||||
{!isMobile && OrderStatus && 'ORDER'}
|
{!isMobile && OrderStatus && 'ORDER'}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -124,15 +124,6 @@ import {
|
||||||
changeCurrentOrderId,
|
changeCurrentOrderId,
|
||||||
GlobalCombocarddata,
|
GlobalCombocarddata,
|
||||||
getCreditCustomer,
|
getCreditCustomer,
|
||||||
GlobalSalesBillEdit,
|
|
||||||
GlobalPreviousOrderPayment,
|
|
||||||
GlobalPreviousOrderOfferDetails,
|
|
||||||
GlobalpaymentOptionData,
|
|
||||||
getPaymentOptions,
|
|
||||||
putSalesBillEdit,
|
|
||||||
changeBillEditingMode,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import {
|
import {
|
||||||
gettinghold,
|
gettinghold,
|
||||||
|
|
@ -251,10 +242,6 @@ const BSBillingTable2 = () => {
|
||||||
const SessionMobileNo = SessionData?.SessionMobileNo;
|
const SessionMobileNo = SessionData?.SessionMobileNo;
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
|
||||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
|
||||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
|
||||||
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
|
||||||
const defaultBookingType = useSelector(GlobalDefaultBookingType);
|
const defaultBookingType = useSelector(GlobalDefaultBookingType);
|
||||||
const globalTipAmount = useSelector(GlobaltipAmount);
|
const globalTipAmount = useSelector(GlobaltipAmount);
|
||||||
const OtherServiceTicketClaim = useSelector(GlobalOtherServiceTicketClaim);
|
const OtherServiceTicketClaim = useSelector(GlobalOtherServiceTicketClaim);
|
||||||
|
|
@ -332,11 +319,6 @@ const BSBillingTable2 = () => {
|
||||||
const [overAllBal, setOverAllBal] = useState(0);
|
const [overAllBal, setOverAllBal] = useState(0);
|
||||||
const [creditCustomerOpen, setcreditCustomerOpen] = useState(false);
|
const [creditCustomerOpen, setcreditCustomerOpen] = useState(false);
|
||||||
const [hold, setHold] = useState(false);
|
const [hold, setHold] = useState(false);
|
||||||
const [refundPayBtns, setRefundPayBtns] = useState([]);
|
|
||||||
const [refundPaySelected, setRefundPaySelected] = useState();
|
|
||||||
const [refundPaySelectedName, setRefundPaySelectedName] = useState(null);
|
|
||||||
const [currentOrderNetAmount, setCurrentOrderNetAmount] = useState(0);
|
|
||||||
const [previousNetAmount, setPreviousNetAmount] = useState(0);
|
|
||||||
const [addcustomer, setAddCustomer] = useState(false);
|
const [addcustomer, setAddCustomer] = useState(false);
|
||||||
const [paybtns, setpaybtns] = useState([]);
|
const [paybtns, setpaybtns] = useState([]);
|
||||||
const tableOptions = templateData?.BookingBilling?.[1];
|
const tableOptions = templateData?.BookingBilling?.[1];
|
||||||
|
|
@ -470,7 +452,6 @@ const BSBillingTable2 = () => {
|
||||||
item.SettingIdName.toLowerCase() === 'shortcutkeys' &&
|
item.SettingIdName.toLowerCase() === 'shortcutkeys' &&
|
||||||
item.SettingValue === 'Y'
|
item.SettingValue === 'Y'
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchCreditCustomer = async () => {
|
const fetchCreditCustomer = async () => {
|
||||||
const selectedMode = paybtns?.find(
|
const selectedMode = paybtns?.find(
|
||||||
|
|
@ -510,31 +491,6 @@ const BSBillingTable2 = () => {
|
||||||
fetchCreditCustomer();
|
fetchCreditCustomer();
|
||||||
}, [paybtnselected, selOption, paybtns]);
|
}, [paybtnselected, selOption, paybtns]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (salesBillEdit) {
|
|
||||||
dispatch(getPaymentOptions()).unwrap();
|
|
||||||
}
|
|
||||||
}, [salesBillEdit]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
|
|
||||||
if (salesBillEdit) {
|
|
||||||
if (SelCustId) {
|
|
||||||
setRefundPayBtns(AllPaymentOptions);
|
|
||||||
setRefundPaySelected(AllPaymentOptions?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(AllPaymentOptions?.[0]?.ConfigName);
|
|
||||||
} else {
|
|
||||||
const withoutCustomer = AllPaymentOptions?.filter?.(
|
|
||||||
(item) => item?.ConfigName?.toLowerCase() !== 'credit'
|
|
||||||
);
|
|
||||||
setRefundPaySelected(withoutCustomer?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(withoutCustomer?.[0]?.ConfigName);
|
|
||||||
setRefundPayBtns(withoutCustomer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, [AllPaymentOptions, SelCustId, salesBillEdit])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!preOrder) {
|
if (!preOrder) {
|
||||||
const totalSum = OrderCardDetail?.reduce(
|
const totalSum = OrderCardDetail?.reduce(
|
||||||
|
|
@ -590,43 +546,23 @@ const BSBillingTable2 = () => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredPayments =
|
|
||||||
previousOrderPayment?.filter(
|
|
||||||
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment
|
|
||||||
) || [];
|
|
||||||
|
|
||||||
const paymentsToUse =
|
|
||||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
|
||||||
|
|
||||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
|
||||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const totalPreviousOfferAmount = previousOrderOfferDetails?.reduce(
|
|
||||||
(acc, offer) => acc + parseFloat(offer.OfferAmount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const previousNetAmount =
|
|
||||||
(totalPreviouspayment) || 0;
|
|
||||||
|
|
||||||
let withdiscTotal =
|
let withdiscTotal =
|
||||||
Total -
|
Total -
|
||||||
((OverAllSales || 0) +
|
((OverAllSales || 0) +
|
||||||
(OverAllEstimate || 0) +
|
(OverAllEstimate || 0) +
|
||||||
(Discount > 0 ? Discount : 0));
|
(Discount > 0 ? Discount : 0));
|
||||||
|
|
||||||
const currentOrderNetAmount = formatAmount(
|
setTotalAmount(
|
||||||
withdiscTotal >= 0
|
withdiscTotal >= 0
|
||||||
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
||||||
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
||||||
)
|
);
|
||||||
|
|
||||||
setTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount);
|
dispatch(
|
||||||
setCurrentOrderNetAmount(currentOrderNetAmount);
|
changeSummeryTotalAmount(
|
||||||
setPreviousNetAmount(previousNetAmount);
|
withdiscTotal > 0 ? withdiscTotal : Number(Total)
|
||||||
dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount));
|
)
|
||||||
|
);
|
||||||
|
|
||||||
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
||||||
|
|
||||||
|
|
@ -831,10 +767,6 @@ const BSBillingTable2 = () => {
|
||||||
const handleButtonClick = () => {
|
const handleButtonClick = () => {
|
||||||
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
||||||
UpiPayment();
|
UpiPayment();
|
||||||
} else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Please Select Refund Payment Method');
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? AddBookingDetails('Dine-In', false)
|
? AddBookingDetails('Dine-In', false)
|
||||||
|
|
@ -1308,11 +1240,6 @@ const BSBillingTable2 = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRefundPaymentMode = (id, name) => {
|
|
||||||
setRefundPaySelected(id);
|
|
||||||
setRefundPaySelectedName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
const addUpiOption = async (id, name, UPIId) => {
|
const addUpiOption = async (id, name, UPIId) => {
|
||||||
await dispatch(changeUpiIDprint(UPIId));
|
await dispatch(changeUpiIDprint(UPIId));
|
||||||
await dispatch(changeUpiIDName(name));
|
await dispatch(changeUpiIDName(name));
|
||||||
|
|
@ -1849,9 +1776,6 @@ const BSBillingTable2 = () => {
|
||||||
} else {
|
} else {
|
||||||
dispatch(changeOrderCardDetails([]));
|
dispatch(changeOrderCardDetails([]));
|
||||||
}
|
}
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
dispatch(changeTipAmount(0));
|
dispatch(changeTipAmount(0));
|
||||||
dispatch(changeFullOfferAppliedProducts([]));
|
dispatch(changeFullOfferAppliedProducts([]));
|
||||||
dispatch(ChangeFullFreeProductList([]));
|
dispatch(ChangeFullFreeProductList([]));
|
||||||
|
|
@ -1868,8 +1792,6 @@ const BSBillingTable2 = () => {
|
||||||
setPaybtnnameselected(PaymentOptionsModeName);
|
setPaybtnnameselected(PaymentOptionsModeName);
|
||||||
setQrCode(false);
|
setQrCode(false);
|
||||||
setUpinotSelected(false);
|
setUpinotSelected(false);
|
||||||
setCurrentOrderNetAmount(0);
|
|
||||||
setPreviousNetAmount(0);
|
|
||||||
getHolddata();
|
getHolddata();
|
||||||
if (defaultBookingType === 'Both') {
|
if (defaultBookingType === 'Both') {
|
||||||
await dispatch(changeBookingType('TakeAway'));
|
await dispatch(changeBookingType('TakeAway'));
|
||||||
|
|
@ -2171,7 +2093,7 @@ const BSBillingTable2 = () => {
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
{
|
{
|
||||||
PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected :
|
PaymentType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi'
|
Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
||||||
? PaymentDeviceUPI?.[0]?.ModeId
|
? PaymentDeviceUPI?.[0]?.ModeId
|
||||||
|
|
@ -2185,14 +2107,15 @@ const BSBillingTable2 = () => {
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
? paybtnselected
|
? paybtnselected
|
||||||
: null,
|
: null,
|
||||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
// SelectedUPIPayOption?.toLowerCase() === "pg" ?
|
||||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
Amount: Math.round(TotalAmount),
|
||||||
|
MerchantId:
|
||||||
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: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
PaymentOptionType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2206,7 +2129,7 @@ const BSBillingTable2 = () => {
|
||||||
? 'BU'
|
? 'BU'
|
||||||
: SelectedUPIPayOption
|
: SelectedUPIPayOption
|
||||||
: null,
|
: null,
|
||||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
ModeOfPayment:
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
|
|
@ -2214,7 +2137,7 @@ const BSBillingTable2 = () => {
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantUPIId
|
?.MerchantUPIId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
AccountDtl:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
|
|
@ -2231,7 +2154,7 @@ const BSBillingTable2 = () => {
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
PaymentStatus:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2240,8 +2163,8 @@ const BSBillingTable2 = () => {
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
Debit: 0,
|
||||||
Credit: salesBillEdit ? (currentOrderNetAmount > previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(TotalAmount) : 0 :
|
Credit:
|
||||||
Paybtnnameselected?.toLowerCase() === 'credit'
|
Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? Math.round(TotalAmount)
|
? Math.round(TotalAmount)
|
||||||
: 0,
|
: 0,
|
||||||
|
|
@ -2449,12 +2372,7 @@ const BSBillingTable2 = () => {
|
||||||
putdata['PaymentType'] = !pay && '';
|
putdata['PaymentType'] = !pay && '';
|
||||||
putdata['PrintType'] = 'Y';
|
putdata['PrintType'] = 'Y';
|
||||||
}
|
}
|
||||||
let response = null;
|
let response = await dispatch(PutBookingData(putdata)).unwrap();
|
||||||
if (salesBillEdit) {
|
|
||||||
response = await dispatch(putSalesBillEdit(putdata)).unwrap();
|
|
||||||
} else {
|
|
||||||
response = await dispatch(PutBookingData(putdata)).unwrap();
|
|
||||||
}
|
|
||||||
if (value !== 'Unpaid') {
|
if (value !== 'Unpaid') {
|
||||||
if (response?.data?.statusCode == 1) {
|
if (response?.data?.statusCode == 1) {
|
||||||
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
|
|
@ -3283,7 +3201,7 @@ const BSBillingTable2 = () => {
|
||||||
|
|
||||||
// split payments
|
// split payments
|
||||||
const SplitPaymentOpen = () => {
|
const SplitPaymentOpen = () => {
|
||||||
if (OrderCardDetail?.length > 0 && TotalAmount > 0) {
|
if (OrderCardDetail?.length > 0) {
|
||||||
const updatedData = {
|
const updatedData = {
|
||||||
userData: OrderCardDetail,
|
userData: OrderCardDetail,
|
||||||
ExtraCharges: GlobalExtraCharge,
|
ExtraCharges: GlobalExtraCharge,
|
||||||
|
|
@ -3293,11 +3211,6 @@ const BSBillingTable2 = () => {
|
||||||
setFailedOrderData(updatedData);
|
setFailedOrderData(updatedData);
|
||||||
setSplitpayment(true);
|
setSplitpayment(true);
|
||||||
} else {
|
} else {
|
||||||
if (TotalAmount <= 0) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Cannot split when total amount is zero or less');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
setMessageData('Please Select the Product');
|
setMessageData('Please Select the Product');
|
||||||
}
|
}
|
||||||
|
|
@ -3907,7 +3820,7 @@ const BSBillingTable2 = () => {
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{paybtns?.length > 0 && (currentOrderNetAmount >= previousNetAmount) ? (
|
{paybtns?.length > 0 ? (
|
||||||
paybtns?.map((payment) => (
|
paybtns?.map((payment) => (
|
||||||
<div className="Table3-cash">
|
<div className="Table3-cash">
|
||||||
<button
|
<button
|
||||||
|
|
@ -3982,42 +3895,6 @@ const BSBillingTable2 = () => {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? (
|
|
||||||
refundPayBtns.map((payment) => (
|
|
||||||
<div className="Table3-cash">
|
|
||||||
<button
|
|
||||||
className={
|
|
||||||
refundPaySelected === payment.ConfigId &&
|
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode-notupisel'
|
|
||||||
: refundPaySelected === payment.ConfigId &&
|
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode'
|
|
||||||
: 'Btn-payment-mode-sel'
|
|
||||||
}
|
|
||||||
style={{
|
|
||||||
fontFamily: FontFamily['para'],
|
|
||||||
position: 'relative',
|
|
||||||
animation: blink
|
|
||||||
? 'blink-animation 0.5s infinite alternate'
|
|
||||||
: 'none',
|
|
||||||
}}
|
|
||||||
onClick={() => handleRefundPaymentMode(payment?.ConfigId, payment?.ConfigName)}
|
|
||||||
>
|
|
||||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
|
||||||
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'row',
|
|
||||||
columnGap: '0.5rem',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{payment.ConfigName}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
))
|
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
onClick={handlepaymentoptions}
|
onClick={handlepaymentoptions}
|
||||||
|
|
@ -4254,9 +4131,7 @@ const BSBillingTable2 = () => {
|
||||||
OrderCardDetail?.length > 0 &&
|
OrderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus != 'Close'
|
CheckBookingStatus != 'Close'
|
||||||
? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ?
|
? 'billing-btn'
|
||||||
'billing-btn'
|
|
||||||
: 'billing-btn'
|
|
||||||
: 'billing-btn-deactive'
|
: 'billing-btn-deactive'
|
||||||
}
|
}
|
||||||
// onClick={() => {
|
// onClick={() => {
|
||||||
|
|
@ -4267,9 +4142,7 @@ const BSBillingTable2 = () => {
|
||||||
handleButtonClick
|
handleButtonClick
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{!OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ? <div
|
{!OrderStatus ? (
|
||||||
className="billing-in-style-Order"
|
|
||||||
style={{ fontFamily: FontFamily['head'] }}>Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</div> : (
|
|
||||||
<>
|
<>
|
||||||
<div className="billing-in-style">
|
<div className="billing-in-style">
|
||||||
<h1 style={{ fontFamily: FontFamily['head'] }}>Total</h1>
|
<h1 style={{ fontFamily: FontFamily['head'] }}>Total</h1>
|
||||||
|
|
@ -4490,10 +4363,7 @@ const BSBillingTable2 = () => {
|
||||||
SplitPaymentModal={Splitpayment}
|
SplitPaymentModal={Splitpayment}
|
||||||
handlesplitpaymentclose={handlesplitpaymentclose}
|
handlesplitpaymentclose={handlesplitpaymentclose}
|
||||||
TotalNetAmount={
|
TotalNetAmount={
|
||||||
OrderType === 'Failed' ? FailedTotalAmt : Math.round(OrderCardDetail?.reduce((acc, data) => data?.TotalAmt + acc, 0) -
|
OrderType === 'Failed' ? FailedTotalAmt : Math.round(TotalAmount)
|
||||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
|
||||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
|
||||||
(Discount > 0 ? Discount : 0)))
|
|
||||||
}
|
}
|
||||||
failedOrderData={failedOrderData}
|
failedOrderData={failedOrderData}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -131,15 +131,6 @@ import {
|
||||||
GlobalCombocarddata,
|
GlobalCombocarddata,
|
||||||
getCreditCustomer,
|
getCreditCustomer,
|
||||||
GlobalSummeryTotalItems,
|
GlobalSummeryTotalItems,
|
||||||
GlobalSalesBillEdit,
|
|
||||||
GlobalPreviousOrderPayment,
|
|
||||||
GlobalPreviousOrderOfferDetails,
|
|
||||||
GlobalpaymentOptionData,
|
|
||||||
getPaymentOptions,
|
|
||||||
putSalesBillEdit,
|
|
||||||
changeBillEditingMode,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
} 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';
|
||||||
|
|
@ -234,10 +225,6 @@ const BSBillingTable3Pay = () => {
|
||||||
);
|
);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
|
||||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
|
||||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
|
||||||
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
|
||||||
const FreeProdList = useSelector(GlobalFreeProdList);
|
const FreeProdList = useSelector(GlobalFreeProdList);
|
||||||
const offerAppliedProducts = useSelector(
|
const offerAppliedProducts = useSelector(
|
||||||
GlobalOfferAppliedProducts,
|
GlobalOfferAppliedProducts,
|
||||||
|
|
@ -345,11 +332,6 @@ const BSBillingTable3Pay = () => {
|
||||||
const [SelectedUPIPayOption, setSelectedUPIPayOption] = useState('Default');
|
const [SelectedUPIPayOption, setSelectedUPIPayOption] = useState('Default');
|
||||||
const [SelectedUpiOption, setSelectedUpiOption] = useState('');
|
const [SelectedUpiOption, setSelectedUpiOption] = useState('');
|
||||||
const [hold, setHold] = useState(false);
|
const [hold, setHold] = useState(false);
|
||||||
const [refundPayBtns, setRefundPayBtns] = useState([]);
|
|
||||||
const [refundPaySelected, setRefundPaySelected] = useState();
|
|
||||||
const [refundPaySelectedName, setRefundPaySelectedName] = useState(null);
|
|
||||||
const [currentOrderNetAmount, setCurrentOrderNetAmount] = useState(0);
|
|
||||||
const [previousNetAmount, setPreviousNetAmount] = useState(0);
|
|
||||||
const [addcustomer, setAddCustomer] = useState(false);
|
const [addcustomer, setAddCustomer] = useState(false);
|
||||||
const [PrintOrderDetails, setPrintOrderDetails] = useState([]);
|
const [PrintOrderDetails, setPrintOrderDetails] = useState([]);
|
||||||
const OrderCardDetail = useSelector(GlobalOrderCardDetails);
|
const OrderCardDetail = useSelector(GlobalOrderCardDetails);
|
||||||
|
|
@ -586,43 +568,23 @@ const BSBillingTable3Pay = () => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredPayments =
|
|
||||||
previousOrderPayment?.filter(
|
|
||||||
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment
|
|
||||||
) || [];
|
|
||||||
|
|
||||||
const paymentsToUse =
|
|
||||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
|
||||||
|
|
||||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
|
||||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const totalPreviousOfferAmount = previousOrderOfferDetails?.reduce(
|
|
||||||
(acc, offer) => acc + parseFloat(offer.OfferAmount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const previousNetAmount =
|
|
||||||
(totalPreviouspayment) || 0;
|
|
||||||
|
|
||||||
let withdiscTotal =
|
let withdiscTotal =
|
||||||
Total -
|
Total -
|
||||||
((OverAllSales || 0) +
|
((OverAllSales || 0) +
|
||||||
(OverAllEstimate || 0) +
|
(OverAllEstimate || 0) +
|
||||||
(Discount > 0 ? Discount : 0));
|
(Discount > 0 ? Discount : 0));
|
||||||
|
|
||||||
const currentOrderNetAmount = formatAmount(
|
setTotalAmount(
|
||||||
withdiscTotal >= 0
|
withdiscTotal >= 0
|
||||||
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
||||||
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
||||||
)
|
);
|
||||||
|
|
||||||
setTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount);
|
dispatch(
|
||||||
setCurrentOrderNetAmount(currentOrderNetAmount);
|
changeSummeryTotalAmount(
|
||||||
setPreviousNetAmount(previousNetAmount);
|
formatAmount(withdiscTotal > 0 ? withdiscTotal : Number(Total))
|
||||||
dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount));
|
)
|
||||||
|
);
|
||||||
|
|
||||||
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
||||||
|
|
||||||
|
|
@ -731,31 +693,6 @@ const BSBillingTable3Pay = () => {
|
||||||
// }
|
// }
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (salesBillEdit) {
|
|
||||||
dispatch(getPaymentOptions()).unwrap();
|
|
||||||
}
|
|
||||||
}, [salesBillEdit]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
|
|
||||||
if (salesBillEdit) {
|
|
||||||
if (SelCustId) {
|
|
||||||
setRefundPayBtns(AllPaymentOptions);
|
|
||||||
setRefundPaySelected(AllPaymentOptions?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(AllPaymentOptions?.[0]?.ConfigName);
|
|
||||||
} else {
|
|
||||||
const withoutCustomer = AllPaymentOptions?.filter?.(
|
|
||||||
(item) => item?.ConfigName?.toLowerCase() !== 'credit'
|
|
||||||
);
|
|
||||||
setRefundPaySelected(withoutCustomer?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(withoutCustomer?.[0]?.ConfigName);
|
|
||||||
setRefundPayBtns(withoutCustomer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, [AllPaymentOptions, SelCustId, salesBillEdit])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (UserType === 'Employee') {
|
if (UserType === 'Employee') {
|
||||||
fetchApi();
|
fetchApi();
|
||||||
|
|
@ -1487,10 +1424,6 @@ const BSBillingTable3Pay = () => {
|
||||||
const handleButtonClick = () => {
|
const handleButtonClick = () => {
|
||||||
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
||||||
UpiPayment();
|
UpiPayment();
|
||||||
} else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Please Select Refund Payment Method');
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? AddBookingDetails('Dine-In', false)
|
? AddBookingDetails('Dine-In', false)
|
||||||
|
|
@ -1772,11 +1705,6 @@ const BSBillingTable3Pay = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRefundPaymentMode = (id, name) => {
|
|
||||||
setRefundPaySelected(id);
|
|
||||||
setRefundPaySelectedName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
const addUpiOption = async (id, name, UPIId) => {
|
const addUpiOption = async (id, name, UPIId) => {
|
||||||
await dispatch(changeUpiIDprint(UPIId));
|
await dispatch(changeUpiIDprint(UPIId));
|
||||||
await dispatch(changeUpiIDName(name));
|
await dispatch(changeUpiIDName(name));
|
||||||
|
|
@ -1984,9 +1912,6 @@ const BSBillingTable3Pay = () => {
|
||||||
// } else {
|
// } else {
|
||||||
dispatch(changeOrderCardDetails([]));
|
dispatch(changeOrderCardDetails([]));
|
||||||
// }
|
// }
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
dispatch(changeLoyaltyConsumedQuantities({}));
|
dispatch(changeLoyaltyConsumedQuantities({}));
|
||||||
dispatch(changeFullOfferAppliedProducts([]));
|
dispatch(changeFullOfferAppliedProducts([]));
|
||||||
dispatch(ChangeFullFreeProductList([]));
|
dispatch(ChangeFullFreeProductList([]));
|
||||||
|
|
@ -2002,8 +1927,6 @@ const BSBillingTable3Pay = () => {
|
||||||
setPaybtnnameselected(PaymentOptionsModeName);
|
setPaybtnnameselected(PaymentOptionsModeName);
|
||||||
setPaybtnselected(PaymentOptionsModeId);
|
setPaybtnselected(PaymentOptionsModeId);
|
||||||
setQrCode(false);
|
setQrCode(false);
|
||||||
setCurrentOrderNetAmount(0);
|
|
||||||
setPreviousNetAmount(0);
|
|
||||||
setUpinotSelected(false);
|
setUpinotSelected(false);
|
||||||
getHolddata();
|
getHolddata();
|
||||||
if (defaultBookingType === 'Both') {
|
if (defaultBookingType === 'Both') {
|
||||||
|
|
@ -2316,7 +2239,7 @@ const BSBillingTable3Pay = () => {
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
{
|
{
|
||||||
PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected :
|
PaymentType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi'
|
Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
||||||
? PaymentDeviceUPI?.[0]?.ModeId
|
? PaymentDeviceUPI?.[0]?.ModeId
|
||||||
|
|
@ -2330,14 +2253,14 @@ const BSBillingTable3Pay = () => {
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
? paybtnselected
|
? paybtnselected
|
||||||
: null,
|
: null,
|
||||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
Amount: Math.round(TotalAmount),
|
||||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
MerchantId:
|
||||||
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: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
PaymentOptionType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2351,7 +2274,7 @@ const BSBillingTable3Pay = () => {
|
||||||
? 'BU'
|
? 'BU'
|
||||||
: SelectedUPIPayOption
|
: SelectedUPIPayOption
|
||||||
: null,
|
: null,
|
||||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
ModeOfPayment:
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
|
|
@ -2359,7 +2282,7 @@ const BSBillingTable3Pay = () => {
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantUPIId
|
?.MerchantUPIId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
AccountDtl:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
|
|
@ -2376,7 +2299,7 @@ const BSBillingTable3Pay = () => {
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
PaymentStatus:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2385,8 +2308,8 @@ const BSBillingTable3Pay = () => {
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
Debit: 0,
|
||||||
Credit: salesBillEdit ? (currentOrderNetAmount > previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(TotalAmount) : 0 :
|
Credit:
|
||||||
Paybtnnameselected?.toLowerCase() === 'credit'
|
Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? Math.round(TotalAmount)
|
? Math.round(TotalAmount)
|
||||||
: 0,
|
: 0,
|
||||||
|
|
@ -2596,12 +2519,7 @@ const BSBillingTable3Pay = () => {
|
||||||
putdata['PaymentType'] = !pay && '';
|
putdata['PaymentType'] = !pay && '';
|
||||||
putdata['PrintType'] = 'Y';
|
putdata['PrintType'] = 'Y';
|
||||||
}
|
}
|
||||||
let response = null;
|
let response = await dispatch(PutBookingData(putdata)).unwrap();
|
||||||
if (salesBillEdit) {
|
|
||||||
response = await dispatch(putSalesBillEdit(putdata)).unwrap();
|
|
||||||
} else {
|
|
||||||
response = await dispatch(PutBookingData(putdata)).unwrap();
|
|
||||||
}
|
|
||||||
if (value !== 'Unpaid') {
|
if (value !== 'Unpaid') {
|
||||||
if (response?.data?.statusCode == 1) {
|
if (response?.data?.statusCode == 1) {
|
||||||
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
|
|
@ -3300,7 +3218,7 @@ const BSBillingTable3Pay = () => {
|
||||||
};
|
};
|
||||||
// split payments
|
// split payments
|
||||||
const SplitPaymentOpen = () => {
|
const SplitPaymentOpen = () => {
|
||||||
if (OrderCardDetail?.length > 0 && TotalAmount > 0) {
|
if (OrderCardDetail?.length > 0) {
|
||||||
const updatedData = {
|
const updatedData = {
|
||||||
userData: OrderCardDetail,
|
userData: OrderCardDetail,
|
||||||
ExtraCharges: GlobalExtraCharge,
|
ExtraCharges: GlobalExtraCharge,
|
||||||
|
|
@ -3310,11 +3228,6 @@ const BSBillingTable3Pay = () => {
|
||||||
setFailedOrderData(updatedData);
|
setFailedOrderData(updatedData);
|
||||||
setSplitpayment(true);
|
setSplitpayment(true);
|
||||||
} else {
|
} else {
|
||||||
if (TotalAmount <= 0) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Cannot split when total amount is zero or less');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
setMessageData('Please Select the Product');
|
setMessageData('Please Select the Product');
|
||||||
}
|
}
|
||||||
|
|
@ -4041,7 +3954,7 @@ const BSBillingTable3Pay = () => {
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{paybtns?.length > 0 && (currentOrderNetAmount >= previousNetAmount) ? (
|
{paybtns?.length > 0 ? (
|
||||||
paybtns?.map((payment) => (
|
paybtns?.map((payment) => (
|
||||||
<div className="Table3-cash">
|
<div className="Table3-cash">
|
||||||
<button
|
<button
|
||||||
|
|
@ -4122,42 +4035,6 @@ const BSBillingTable3Pay = () => {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? (
|
|
||||||
refundPayBtns.map((payment) => (
|
|
||||||
<div className="Table3-cash">
|
|
||||||
<button
|
|
||||||
className={
|
|
||||||
refundPaySelected === payment.ConfigId &&
|
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode-notupisel'
|
|
||||||
: refundPaySelected === payment.ConfigId &&
|
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode'
|
|
||||||
: 'Btn-payment-mode-sel'
|
|
||||||
}
|
|
||||||
style={{
|
|
||||||
fontFamily: FontFamily['para'],
|
|
||||||
position: 'relative',
|
|
||||||
animation: blink
|
|
||||||
? 'blink-animation 0.5s infinite alternate'
|
|
||||||
: 'none',
|
|
||||||
}}
|
|
||||||
onClick={() => handleRefundPaymentMode(payment?.ConfigId, payment?.ConfigName)}
|
|
||||||
>
|
|
||||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
|
||||||
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'row',
|
|
||||||
columnGap: '0.5rem',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{payment.ConfigName}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
))
|
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
onClick={handlepaymentoptions}
|
onClick={handlepaymentoptions}
|
||||||
|
|
@ -4399,9 +4276,8 @@ const BSBillingTable3Pay = () => {
|
||||||
OrderCardDetail?.length > 0 &&
|
OrderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus != 'Close'
|
CheckBookingStatus != 'Close'
|
||||||
? !OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ?
|
? !OrderStatus
|
||||||
'BSBillingTable3-paybtn'
|
? 'BSBillingTable3-paybtn'
|
||||||
: 'BSBillingTable3-paybtn'
|
|
||||||
: 'BSBillingTable3-paybtn Order'
|
: 'BSBillingTable3-paybtn Order'
|
||||||
: 'BSBillingTable3-paybtn-deactive'
|
: 'BSBillingTable3-paybtn-deactive'
|
||||||
}
|
}
|
||||||
|
|
@ -4416,7 +4292,7 @@ const BSBillingTable3Pay = () => {
|
||||||
}
|
}
|
||||||
//dhana
|
//dhana
|
||||||
>
|
>
|
||||||
{!OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ? <p className="Table4-Order">Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</p> : (
|
{!OrderStatus ? (
|
||||||
<>
|
<>
|
||||||
<p style={{ fontFamily: FontFamily['head'] }}>
|
<p style={{ fontFamily: FontFamily['head'] }}>
|
||||||
{' '}
|
{' '}
|
||||||
|
|
@ -4628,10 +4504,7 @@ const BSBillingTable3Pay = () => {
|
||||||
SplitPaymentModal={Splitpayment}
|
SplitPaymentModal={Splitpayment}
|
||||||
handlesplitpaymentclose={handlesplitpaymentclose}
|
handlesplitpaymentclose={handlesplitpaymentclose}
|
||||||
TotalNetAmount={
|
TotalNetAmount={
|
||||||
OrderType === 'Failed' ? FailedTotalAmt : Math.round(OrderCardDetail?.reduce((acc, data) => data?.TotalAmt + acc, 0) -
|
OrderType === 'Failed' ? FailedTotalAmt : Math.round(TotalAmount)
|
||||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
|
||||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
|
||||||
(Discount > 0 ? Discount : 0)))
|
|
||||||
}
|
}
|
||||||
failedOrderData={failedOrderData}
|
failedOrderData={failedOrderData}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -3789,7 +3789,40 @@ const BSBilling4Payment = () => {
|
||||||
</div>
|
</div>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
)}
|
)}
|
||||||
|
{/* Customer Orders */}
|
||||||
|
{GetCustId && (
|
||||||
|
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
||||||
|
{' '}
|
||||||
|
<div
|
||||||
|
className="BSBillingNav-icon-table-icon"
|
||||||
|
onClick={() => {
|
||||||
|
if (
|
||||||
|
CheckBookingStatus !== 'Close' &&
|
||||||
|
!addnewAccess &&
|
||||||
|
!(OrderCardDetail?.length > 0)
|
||||||
|
) {
|
||||||
|
setCustomerPreviesOrders(true);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
style={{
|
||||||
|
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
||||||
|
color:
|
||||||
|
OrderCardDetail?.length > 0 ||
|
||||||
|
(OrderCardDetail?.length > 0 &&
|
||||||
|
GetCustId?.CustMobile === undefined)
|
||||||
|
? 'gray'
|
||||||
|
: 'rgb(18, 146, 238)',
|
||||||
|
fontSize: '25px',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
height: '2.46rem',
|
||||||
|
width: '1.5rem',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<FaCartPlus />
|
||||||
|
</div>
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
{OtherServicesglobal && OrderCardDetail.length >= 1 && (
|
{OtherServicesglobal && OrderCardDetail.length >= 1 && (
|
||||||
<TooltipWrapper title="Vehicle Number" isMobile={isMobile}>
|
<TooltipWrapper title="Vehicle Number" isMobile={isMobile}>
|
||||||
{' '}
|
{' '}
|
||||||
|
|
@ -3826,41 +3859,6 @@ const BSBilling4Payment = () => {
|
||||||
{/* </React.Fragment> */}
|
{/* </React.Fragment> */}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Customer Orders */}
|
|
||||||
{GetCustId && (
|
|
||||||
<Tooltip title="Customer Orders" isMobile={isMobile}>
|
|
||||||
{' '}
|
|
||||||
<div
|
|
||||||
className="BSBillingNav-icon-table-icon"
|
|
||||||
onClick={() => {
|
|
||||||
if (
|
|
||||||
CheckBookingStatus !== 'Close' &&
|
|
||||||
!addnewAccess &&
|
|
||||||
!(OrderCardDetail?.length > 0)
|
|
||||||
) {
|
|
||||||
setCustomerPreviesOrders(true);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
style={{
|
|
||||||
cursor: OrderCardDetail?.length > 0 && 'not-allowed',
|
|
||||||
color:
|
|
||||||
OrderCardDetail?.length > 0 ||
|
|
||||||
(OrderCardDetail?.length > 0 &&
|
|
||||||
GetCustId?.CustMobile === undefined)
|
|
||||||
? 'gray'
|
|
||||||
: 'rgb(18, 146, 238)',
|
|
||||||
fontSize: '25px',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
height: '2.46rem',
|
|
||||||
width: '1.5rem',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<FaCartPlus />
|
|
||||||
</div>
|
|
||||||
</Tooltip>
|
|
||||||
)}
|
|
||||||
{tabledata?.length > 0 && (
|
{tabledata?.length > 0 && (
|
||||||
<div style={{ width: '2rem' }}>
|
<div style={{ width: '2rem' }}>
|
||||||
{tableOptions
|
{tableOptions
|
||||||
|
|
|
||||||
|
|
@ -121,15 +121,6 @@ import {
|
||||||
changeCurrentOrderId,
|
changeCurrentOrderId,
|
||||||
GlobalCombocarddata,
|
GlobalCombocarddata,
|
||||||
getCreditCustomer,
|
getCreditCustomer,
|
||||||
GlobalSalesBillEdit,
|
|
||||||
GlobalPreviousOrderPayment,
|
|
||||||
GlobalPreviousOrderOfferDetails,
|
|
||||||
GlobalpaymentOptionData,
|
|
||||||
getPaymentOptions,
|
|
||||||
putSalesBillEdit,
|
|
||||||
changeBillEditingMode,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import { ChangeTotalAmount } from '../../../../../Features/ExteraCharges/ExtraCharges.js'; //Shifayth Date:27/12/2023
|
import { ChangeTotalAmount } from '../../../../../Features/ExteraCharges/ExtraCharges.js'; //Shifayth Date:27/12/2023
|
||||||
import {
|
import {
|
||||||
|
|
@ -245,10 +236,6 @@ const BSBillingTable5 = () => {
|
||||||
const UserType = SessionData?.UserType;
|
const UserType = SessionData?.UserType;
|
||||||
const AuthToken = SessionData?.AuthToken;
|
const AuthToken = SessionData?.AuthToken;
|
||||||
const SessionMobileNo = SessionData?.SessionMobileNo;
|
const SessionMobileNo = SessionData?.SessionMobileNo;
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
|
||||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
|
||||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
|
||||||
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
|
||||||
const Discount = useSelector(GlobalOverAllOfferAmt);
|
const Discount = useSelector(GlobalOverAllOfferAmt);
|
||||||
const FreeProdList = useSelector(GlobalFreeProdList);
|
const FreeProdList = useSelector(GlobalFreeProdList);
|
||||||
const offerAppliedProducts = useSelector(GlobalOfferAppliedProducts);
|
const offerAppliedProducts = useSelector(GlobalOfferAppliedProducts);
|
||||||
|
|
@ -329,11 +316,6 @@ const BSBillingTable5 = () => {
|
||||||
const printDatas = useSelector(GlobalprintDatas);
|
const printDatas = useSelector(GlobalprintDatas);
|
||||||
const PrinterDetails = useSelector(GlobalPrinterMappingDtls);
|
const PrinterDetails = useSelector(GlobalPrinterMappingDtls);
|
||||||
|
|
||||||
const [refundPayBtns, setRefundPayBtns] = useState([]);
|
|
||||||
const [refundPaySelected, setRefundPaySelected] = useState();
|
|
||||||
const [refundPaySelectedName, setRefundPaySelectedName] = useState(null);
|
|
||||||
const [currentOrderNetAmount, setCurrentOrderNetAmount] = useState(0);
|
|
||||||
const [previousNetAmount, setPreviousNetAmount] = useState(0);
|
|
||||||
const [paybtnselected, setPaybtnselected] = useState();
|
const [paybtnselected, setPaybtnselected] = useState();
|
||||||
const [Paybtnnameselected, setPaybtnnameselected] = useState();
|
const [Paybtnnameselected, setPaybtnnameselected] = useState();
|
||||||
const [SelectedBookingType, setSelectedBookingType] = useState(null);
|
const [SelectedBookingType, setSelectedBookingType] = useState(null);
|
||||||
|
|
@ -484,31 +466,6 @@ const BSBillingTable5 = () => {
|
||||||
// for customised invoice number
|
// for customised invoice number
|
||||||
const { invoiceDate, clearInvoiceDate } = useDateStore();
|
const { invoiceDate, clearInvoiceDate } = useDateStore();
|
||||||
const CurrentOrderId = useSelector(GlobalCurrentOrderId);
|
const CurrentOrderId = useSelector(GlobalCurrentOrderId);
|
||||||
useEffect(() => {
|
|
||||||
if (salesBillEdit) {
|
|
||||||
dispatch(getPaymentOptions()).unwrap();
|
|
||||||
}
|
|
||||||
}, [salesBillEdit]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
|
|
||||||
if (salesBillEdit) {
|
|
||||||
if (SelCustId) {
|
|
||||||
setRefundPayBtns(AllPaymentOptions);
|
|
||||||
setRefundPaySelected(AllPaymentOptions?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(AllPaymentOptions?.[0]?.ConfigName);
|
|
||||||
} else {
|
|
||||||
const withoutCustomer = AllPaymentOptions?.filter?.(
|
|
||||||
(item) => item?.ConfigName?.toLowerCase() !== 'credit'
|
|
||||||
);
|
|
||||||
setRefundPaySelected(withoutCustomer?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(withoutCustomer?.[0]?.ConfigName);
|
|
||||||
setRefundPayBtns(withoutCustomer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, [AllPaymentOptions, SelCustId, salesBillEdit])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
OrderCardDetail?.length === 1 &&
|
OrderCardDetail?.length === 1 &&
|
||||||
|
|
@ -632,44 +589,25 @@ const BSBillingTable5 = () => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const filteredPayments =
|
|
||||||
previousOrderPayment?.filter(
|
|
||||||
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment
|
|
||||||
) || [];
|
|
||||||
|
|
||||||
const paymentsToUse =
|
|
||||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
|
||||||
|
|
||||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
|
||||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const totalPreviousOfferAmount = previousOrderOfferDetails?.reduce(
|
|
||||||
(acc, offer) => acc + parseFloat(offer.OfferAmount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const previousNetAmount =
|
|
||||||
(totalPreviouspayment) || 0;
|
|
||||||
|
|
||||||
let withdiscTotal =
|
let withdiscTotal =
|
||||||
Total -
|
Total -
|
||||||
((OverAllSales || 0) +
|
((OverAllSales || 0) +
|
||||||
(OverAllEstimate || 0) +
|
(OverAllEstimate || 0) +
|
||||||
(Discount > 0 ? Discount : 0));
|
(Discount > 0 ? Discount : 0));
|
||||||
|
|
||||||
const currentOrderNetAmount = formatAmount(
|
setTotalAmount(
|
||||||
withdiscTotal >= 0
|
formatAmount(
|
||||||
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
withdiscTotal >= 0
|
||||||
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
||||||
)
|
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
setTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount);
|
dispatch(
|
||||||
setCurrentOrderNetAmount(currentOrderNetAmount);
|
changeSummeryTotalAmount(
|
||||||
setPreviousNetAmount(previousNetAmount);
|
formatAmount(withdiscTotal > 0 ? withdiscTotal : Number(Total))
|
||||||
dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount));
|
)
|
||||||
|
);
|
||||||
|
|
||||||
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
||||||
|
|
||||||
|
|
@ -906,10 +844,6 @@ const BSBillingTable5 = () => {
|
||||||
const handleButtonClick = () => {
|
const handleButtonClick = () => {
|
||||||
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
||||||
UpiPayment();
|
UpiPayment();
|
||||||
} else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Please Select Refund Payment Method');
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? AddBookingDetails('Dine-In', false)
|
? AddBookingDetails('Dine-In', false)
|
||||||
|
|
@ -1745,12 +1679,6 @@ const BSBillingTable5 = () => {
|
||||||
setCardoptionnotSelected(false);
|
setCardoptionnotSelected(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRefundPaymentMode = (id, name) => {
|
|
||||||
setRefundPaySelected(id);
|
|
||||||
setRefundPaySelectedName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
const addUpiOption = async (id, name, UPIId) => {
|
const addUpiOption = async (id, name, UPIId) => {
|
||||||
await dispatch(changeUpiIDprint(UPIId));
|
await dispatch(changeUpiIDprint(UPIId));
|
||||||
await dispatch(changeUpiIDName(name));
|
await dispatch(changeUpiIDName(name));
|
||||||
|
|
@ -1892,9 +1820,6 @@ const BSBillingTable5 = () => {
|
||||||
} else {
|
} else {
|
||||||
dispatch(changeOrderCardDetails([]));
|
dispatch(changeOrderCardDetails([]));
|
||||||
}
|
}
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
dispatch(changeTipAmount(0));
|
dispatch(changeTipAmount(0));
|
||||||
dispatch(changeLoyaltyConsumedQuantities({}));
|
dispatch(changeLoyaltyConsumedQuantities({}));
|
||||||
await dispatch(ChangeTotalAmount([]));
|
await dispatch(ChangeTotalAmount([]));
|
||||||
|
|
@ -1911,8 +1836,6 @@ const BSBillingTable5 = () => {
|
||||||
setPaybtnselected(PaymentOptionsModeId);
|
setPaybtnselected(PaymentOptionsModeId);
|
||||||
setQrCode(false);
|
setQrCode(false);
|
||||||
setUpinotSelected(false);
|
setUpinotSelected(false);
|
||||||
setCurrentOrderNetAmount(0);
|
|
||||||
setPreviousNetAmount(0);
|
|
||||||
getHolddata();
|
getHolddata();
|
||||||
if (defaultBookingType === 'Both') {
|
if (defaultBookingType === 'Both') {
|
||||||
await dispatch(changeBookingType('TakeAway'));
|
await dispatch(changeBookingType('TakeAway'));
|
||||||
|
|
@ -2211,7 +2134,7 @@ const BSBillingTable5 = () => {
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
{
|
{
|
||||||
PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected :
|
PaymentType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi'
|
Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
||||||
? PaymentDeviceUPI?.[0]?.ModeId
|
? PaymentDeviceUPI?.[0]?.ModeId
|
||||||
|
|
@ -2225,14 +2148,14 @@ const BSBillingTable5 = () => {
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
? paybtnselected
|
? paybtnselected
|
||||||
: null,
|
: null,
|
||||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
Amount: Math.round(TotalAmount),
|
||||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
MerchantId:
|
||||||
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: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
PaymentOptionType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2246,7 +2169,7 @@ const BSBillingTable5 = () => {
|
||||||
? 'BU'
|
? 'BU'
|
||||||
: SelectedUPIPayOption
|
: SelectedUPIPayOption
|
||||||
: null,
|
: null,
|
||||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
ModeOfPayment:
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
|
|
@ -2254,7 +2177,7 @@ const BSBillingTable5 = () => {
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantUPIId
|
?.MerchantUPIId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
AccountDtl:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
|
|
@ -2271,7 +2194,7 @@ const BSBillingTable5 = () => {
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
PaymentStatus:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2280,8 +2203,8 @@ const BSBillingTable5 = () => {
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
Debit: 0,
|
||||||
Credit: salesBillEdit ? (currentOrderNetAmount > previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(TotalAmount) : 0 :
|
Credit:
|
||||||
Paybtnnameselected?.toLowerCase() === 'credit'
|
Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? Math.round(TotalAmount)
|
? Math.round(TotalAmount)
|
||||||
: 0,
|
: 0,
|
||||||
|
|
@ -2487,12 +2410,7 @@ const BSBillingTable5 = () => {
|
||||||
putdata['PaymentType'] = !pay && '';
|
putdata['PaymentType'] = !pay && '';
|
||||||
putdata['PrintType'] = 'Y';
|
putdata['PrintType'] = 'Y';
|
||||||
}
|
}
|
||||||
let response = null;
|
let response = await dispatch(PutBookingData(putdata)).unwrap();
|
||||||
if (salesBillEdit) {
|
|
||||||
response = await dispatch(putSalesBillEdit(putdata)).unwrap();
|
|
||||||
} else {
|
|
||||||
response = await dispatch(PutBookingData(putdata)).unwrap();
|
|
||||||
}
|
|
||||||
if (value !== 'Unpaid') {
|
if (value !== 'Unpaid') {
|
||||||
if (response?.data?.statusCode == 1) {
|
if (response?.data?.statusCode == 1) {
|
||||||
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
|
|
@ -3264,7 +3182,7 @@ const BSBillingTable5 = () => {
|
||||||
|
|
||||||
// split payments
|
// split payments
|
||||||
const SplitPaymentOpen = () => {
|
const SplitPaymentOpen = () => {
|
||||||
if (OrderCardDetail?.length > 0 && TotalAmount > 0) {
|
if (OrderCardDetail?.length > 0) {
|
||||||
const updatedData = {
|
const updatedData = {
|
||||||
userData: OrderCardDetail,
|
userData: OrderCardDetail,
|
||||||
ExtraCharges: GlobalExtraCharge,
|
ExtraCharges: GlobalExtraCharge,
|
||||||
|
|
@ -3274,11 +3192,6 @@ const BSBillingTable5 = () => {
|
||||||
setFailedOrderData(updatedData);
|
setFailedOrderData(updatedData);
|
||||||
setSplitpayment(true);
|
setSplitpayment(true);
|
||||||
} else {
|
} else {
|
||||||
if (TotalAmount <= 0) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Cannot split when total amount is zero or less');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
setMessageData('Please Select the Product');
|
setMessageData('Please Select the Product');
|
||||||
}
|
}
|
||||||
|
|
@ -3692,7 +3605,7 @@ const BSBillingTable5 = () => {
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{paybtns?.length > 0 && (currentOrderNetAmount >= previousNetAmount) ? (
|
{paybtns?.length > 0 ? (
|
||||||
paybtns?.map((payment) => (
|
paybtns?.map((payment) => (
|
||||||
<div className="Table3-cash">
|
<div className="Table3-cash">
|
||||||
<button
|
<button
|
||||||
|
|
@ -3770,42 +3683,6 @@ const BSBillingTable5 = () => {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? (
|
|
||||||
refundPayBtns.map((payment) => (
|
|
||||||
<div className="Table3-cash">
|
|
||||||
<button
|
|
||||||
className={
|
|
||||||
refundPaySelected === payment.ConfigId &&
|
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode-notupisel'
|
|
||||||
: refundPaySelected === payment.ConfigId &&
|
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode'
|
|
||||||
: 'Btn-payment-mode-sel'
|
|
||||||
}
|
|
||||||
style={{
|
|
||||||
fontFamily: FontFamily['para'],
|
|
||||||
position: 'relative',
|
|
||||||
animation: blink
|
|
||||||
? 'blink-animation 0.5s infinite alternate'
|
|
||||||
: 'none',
|
|
||||||
}}
|
|
||||||
onClick={() => handleRefundPaymentMode(payment?.ConfigId, payment?.ConfigName)}
|
|
||||||
>
|
|
||||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
|
||||||
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'row',
|
|
||||||
columnGap: '0.5rem',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{payment.ConfigName}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
))
|
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
onClick={handlepaymentoptions}
|
onClick={handlepaymentoptions}
|
||||||
|
|
@ -4277,9 +4154,8 @@ const BSBillingTable5 = () => {
|
||||||
OrderCardDetail?.length > 0 &&
|
OrderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus != 'Close'
|
CheckBookingStatus != 'Close'
|
||||||
? !OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ?
|
? !OrderStatus
|
||||||
'BSBIllingTable5-paybtn-noitems'
|
? 'BSBIllingTable5-paybtn-noitems'
|
||||||
: 'BSBIllingTable5-paybtn-noitems'
|
|
||||||
: 'BSBIllingTable5-paybtn-noitems Order'
|
: 'BSBIllingTable5-paybtn-noitems Order'
|
||||||
: 'BSBIllingTable5-paybtn-noitems-disable'
|
: 'BSBIllingTable5-paybtn-noitems-disable'
|
||||||
}
|
}
|
||||||
|
|
@ -4291,7 +4167,7 @@ const BSBillingTable5 = () => {
|
||||||
handleButtonClick
|
handleButtonClick
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{!OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ? <div>Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</div> : (
|
{!OrderStatus ? (
|
||||||
<>
|
<>
|
||||||
{/* ₹ {Math.round(TotalAmount)} */}
|
{/* ₹ {Math.round(TotalAmount)} */}
|
||||||
{isMobile ? (
|
{isMobile ? (
|
||||||
|
|
@ -4500,10 +4376,7 @@ const BSBillingTable5 = () => {
|
||||||
SplitPaymentModal={Splitpayment}
|
SplitPaymentModal={Splitpayment}
|
||||||
handlesplitpaymentclose={handlesplitpaymentclose}
|
handlesplitpaymentclose={handlesplitpaymentclose}
|
||||||
TotalNetAmount={
|
TotalNetAmount={
|
||||||
OrderType === 'Failed' ? FailedTotalAmt : Math.round(OrderCardDetail?.reduce((acc, data) => data?.TotalAmt + acc, 0) -
|
OrderType === 'Failed' ? FailedTotalAmt : Math.round(TotalAmount)
|
||||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
|
||||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
|
||||||
(Discount > 0 ? Discount : 0)))
|
|
||||||
}
|
}
|
||||||
failedOrderData={failedOrderData}
|
failedOrderData={failedOrderData}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -120,15 +120,6 @@ import {
|
||||||
changeCurrentOrderId,
|
changeCurrentOrderId,
|
||||||
GlobalCombocarddata,
|
GlobalCombocarddata,
|
||||||
getCreditCustomer,
|
getCreditCustomer,
|
||||||
GlobalSalesBillEdit,
|
|
||||||
GlobalPreviousOrderPayment,
|
|
||||||
GlobalPreviousOrderOfferDetails,
|
|
||||||
GlobalpaymentOptionData,
|
|
||||||
getPaymentOptions,
|
|
||||||
putSalesBillEdit,
|
|
||||||
changeBillEditingMode,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
|
import FeaturesFunctionalities from '../../BookingFunctionality/FeaturesFunctionalities';
|
||||||
import {
|
import {
|
||||||
|
|
@ -249,10 +240,6 @@ const BST6Payment = () => {
|
||||||
type?.PreferredSubCatName?.toLowerCase() === 'dine in' &&
|
type?.PreferredSubCatName?.toLowerCase() === 'dine in' &&
|
||||||
type?.PreferredStatus === 'Y'
|
type?.PreferredStatus === 'Y'
|
||||||
);
|
);
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
|
||||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
|
||||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
|
||||||
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
|
||||||
const screenwidth = useSelector(GlobalScreenSize);
|
const screenwidth = useSelector(GlobalScreenSize);
|
||||||
const printerTemplateStyle = useSelector(SelectedPrintTemplate);
|
const printerTemplateStyle = useSelector(SelectedPrintTemplate);
|
||||||
const RetailWSSalesType = useSelector(GlobalRetailWSSalesType);
|
const RetailWSSalesType = useSelector(GlobalRetailWSSalesType);
|
||||||
|
|
@ -349,11 +336,6 @@ const BST6Payment = () => {
|
||||||
const UserType = SessionData?.UserType;
|
const UserType = SessionData?.UserType;
|
||||||
const AuthToken = SessionData?.AuthToken;
|
const AuthToken = SessionData?.AuthToken;
|
||||||
const SessionMobileNo = SessionData?.SessionMobileNo;
|
const SessionMobileNo = SessionData?.SessionMobileNo;
|
||||||
const [refundPayBtns, setRefundPayBtns] = useState([]);
|
|
||||||
const [refundPaySelected, setRefundPaySelected] = useState();
|
|
||||||
const [refundPaySelectedName, setRefundPaySelectedName] = useState(null);
|
|
||||||
const [currentOrderNetAmount, setCurrentOrderNetAmount] = useState(0);
|
|
||||||
const [previousNetAmount, setPreviousNetAmount] = useState(0);
|
|
||||||
const [FirstPaymentclick, setFirstPaymentclick] = useState(false);
|
const [FirstPaymentclick, setFirstPaymentclick] = useState(false);
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [unpaidopen, setUnpaidOpen] = useState(false);
|
const [unpaidopen, setUnpaidOpen] = useState(false);
|
||||||
|
|
@ -477,30 +459,6 @@ const BST6Payment = () => {
|
||||||
setPrintOrderDetails([]);
|
setPrintOrderDetails([]);
|
||||||
}
|
}
|
||||||
}, [OrderCardDetail]);
|
}, [OrderCardDetail]);
|
||||||
useEffect(() => {
|
|
||||||
if (salesBillEdit) {
|
|
||||||
dispatch(getPaymentOptions()).unwrap();
|
|
||||||
}
|
|
||||||
}, [salesBillEdit]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
|
|
||||||
if (salesBillEdit) {
|
|
||||||
if (SelCustId) {
|
|
||||||
setRefundPayBtns(AllPaymentOptions);
|
|
||||||
setRefundPaySelected(AllPaymentOptions?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(AllPaymentOptions?.[0]?.ConfigName);
|
|
||||||
} else {
|
|
||||||
const withoutCustomer = AllPaymentOptions?.filter?.(
|
|
||||||
(item) => item?.ConfigName?.toLowerCase() !== 'credit'
|
|
||||||
);
|
|
||||||
setRefundPaySelected(withoutCustomer?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(withoutCustomer?.[0]?.ConfigName);
|
|
||||||
setRefundPayBtns(withoutCustomer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, [AllPaymentOptions, SelCustId, salesBillEdit])
|
|
||||||
console.log(PrintOrderDetails, 'PrintOrderDetails');
|
console.log(PrintOrderDetails, 'PrintOrderDetails');
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (selOption) {
|
if (selOption) {
|
||||||
|
|
@ -605,43 +563,25 @@ const BST6Payment = () => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredPayments =
|
|
||||||
previousOrderPayment?.filter(
|
|
||||||
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment
|
|
||||||
) || [];
|
|
||||||
|
|
||||||
const paymentsToUse =
|
|
||||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
|
||||||
|
|
||||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
|
||||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const totalPreviousOfferAmount = previousOrderOfferDetails?.reduce(
|
|
||||||
(acc, offer) => acc + parseFloat(offer.OfferAmount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const previousNetAmount =
|
|
||||||
(totalPreviouspayment) || 0;
|
|
||||||
|
|
||||||
let withdiscTotal =
|
let withdiscTotal =
|
||||||
Total -
|
Total -
|
||||||
((OverAllSales || 0) +
|
((OverAllSales || 0) +
|
||||||
(OverAllEstimate || 0) +
|
(OverAllEstimate || 0) +
|
||||||
(Discount > 0 ? Discount : 0));
|
(Discount > 0 ? Discount : 0));
|
||||||
|
|
||||||
const currentOrderNetAmount = formatAmount(
|
setTotalAmount(
|
||||||
withdiscTotal >= 0
|
formatAmount(
|
||||||
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
withdiscTotal >= 0
|
||||||
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
||||||
)
|
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
setTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount);
|
dispatch(
|
||||||
setCurrentOrderNetAmount(currentOrderNetAmount);
|
changeSummeryTotalAmount(
|
||||||
setPreviousNetAmount(previousNetAmount);
|
formatAmount(withdiscTotal > 0 ? withdiscTotal : Number(Total))
|
||||||
dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount));
|
)
|
||||||
|
);
|
||||||
|
|
||||||
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
||||||
|
|
||||||
|
|
@ -1234,10 +1174,6 @@ const BST6Payment = () => {
|
||||||
const handleButtonClick = () => {
|
const handleButtonClick = () => {
|
||||||
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
||||||
UpiPayment();
|
UpiPayment();
|
||||||
} else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Please Select Refund Payment Method');
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? AddBookingDetails('Dine-In', false)
|
? AddBookingDetails('Dine-In', false)
|
||||||
|
|
@ -1698,11 +1634,6 @@ const BST6Payment = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRefundPaymentMode = (id, name) => {
|
|
||||||
setRefundPaySelected(id);
|
|
||||||
setRefundPaySelectedName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
const addUpiOption = async (id, name, UPIId) => {
|
const addUpiOption = async (id, name, UPIId) => {
|
||||||
await dispatch(changeUpiIDprint(UPIId));
|
await dispatch(changeUpiIDprint(UPIId));
|
||||||
await dispatch(changeUpiIDName(name));
|
await dispatch(changeUpiIDName(name));
|
||||||
|
|
@ -1787,7 +1718,7 @@ const BST6Payment = () => {
|
||||||
setCardOptionOpen(visible);
|
setCardOptionOpen(visible);
|
||||||
};
|
};
|
||||||
const SplitPaymentOpen = () => {
|
const SplitPaymentOpen = () => {
|
||||||
if (OrderCardDetail?.length > 0 && TotalAmount > 0) {
|
if (OrderCardDetail?.length > 0) {
|
||||||
const updatedData = {
|
const updatedData = {
|
||||||
userData: OrderCardDetail,
|
userData: OrderCardDetail,
|
||||||
ExtraCharges: GlobalExtraCharge,
|
ExtraCharges: GlobalExtraCharge,
|
||||||
|
|
@ -1797,11 +1728,6 @@ const BST6Payment = () => {
|
||||||
setFailedOrderData(updatedData);
|
setFailedOrderData(updatedData);
|
||||||
setSplitpayment(true);
|
setSplitpayment(true);
|
||||||
} else {
|
} else {
|
||||||
if (TotalAmount <= 0) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Cannot split when total amount is zero or less');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
setMessageData('Please Select the Product');
|
setMessageData('Please Select the Product');
|
||||||
}
|
}
|
||||||
|
|
@ -1935,9 +1861,6 @@ const BST6Payment = () => {
|
||||||
} else {
|
} else {
|
||||||
dispatch(changeOrderCardDetails([]));
|
dispatch(changeOrderCardDetails([]));
|
||||||
}
|
}
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
dispatch(changeTipAmount(0));
|
dispatch(changeTipAmount(0));
|
||||||
dispatch(changeLoyaltyConsumedQuantities({}));
|
dispatch(changeLoyaltyConsumedQuantities({}));
|
||||||
await dispatch(ChangeTotalAmount([]));
|
await dispatch(ChangeTotalAmount([]));
|
||||||
|
|
@ -1954,8 +1877,6 @@ const BST6Payment = () => {
|
||||||
setPaybtnselected(PaymentOptionsModeId);
|
setPaybtnselected(PaymentOptionsModeId);
|
||||||
setQrCode(false);
|
setQrCode(false);
|
||||||
setUpinotSelected(false);
|
setUpinotSelected(false);
|
||||||
setCurrentOrderNetAmount(0);
|
|
||||||
setPreviousNetAmount(0);
|
|
||||||
getHolddata();
|
getHolddata();
|
||||||
if (defaultBookingType === 'Both') {
|
if (defaultBookingType === 'Both') {
|
||||||
await dispatch(changeBookingType('TakeAway'));
|
await dispatch(changeBookingType('TakeAway'));
|
||||||
|
|
@ -2252,7 +2173,7 @@ const BST6Payment = () => {
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
{
|
{
|
||||||
PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected :
|
PaymentType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi'
|
Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
||||||
? PaymentDeviceUPI?.[0]?.ModeId
|
? PaymentDeviceUPI?.[0]?.ModeId
|
||||||
|
|
@ -2266,14 +2187,14 @@ const BST6Payment = () => {
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
? paybtnselected
|
? paybtnselected
|
||||||
: null,
|
: null,
|
||||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
Amount: Math.round(TotalAmount),
|
||||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
MerchantId:
|
||||||
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: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
PaymentOptionType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2287,7 +2208,7 @@ const BST6Payment = () => {
|
||||||
? 'BU'
|
? 'BU'
|
||||||
: SelectedUPIPayOption
|
: SelectedUPIPayOption
|
||||||
: null,
|
: null,
|
||||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
ModeOfPayment:
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
|
|
@ -2295,7 +2216,7 @@ const BST6Payment = () => {
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantUPIId
|
?.MerchantUPIId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
AccountDtl:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
|
|
@ -2312,7 +2233,7 @@ const BST6Payment = () => {
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
PaymentStatus:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2321,8 +2242,8 @@ const BST6Payment = () => {
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
Debit: 0,
|
||||||
Credit: salesBillEdit ? (currentOrderNetAmount > previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(TotalAmount) : 0 :
|
Credit:
|
||||||
Paybtnnameselected?.toLowerCase() === 'credit'
|
Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? Math.round(TotalAmount)
|
? Math.round(TotalAmount)
|
||||||
: 0,
|
: 0,
|
||||||
|
|
@ -2530,12 +2451,7 @@ const BST6Payment = () => {
|
||||||
putdata['PaymentType'] = !pay && '';
|
putdata['PaymentType'] = !pay && '';
|
||||||
putdata['PrintType'] = 'Y';
|
putdata['PrintType'] = 'Y';
|
||||||
}
|
}
|
||||||
let response = null;
|
let response = await dispatch(PutBookingData(putdata)).unwrap();
|
||||||
if (salesBillEdit) {
|
|
||||||
response = await dispatch(putSalesBillEdit(putdata)).unwrap();
|
|
||||||
} else {
|
|
||||||
response = await dispatch(PutBookingData(putdata)).unwrap();
|
|
||||||
}
|
|
||||||
let PayatCounterfilter = response?.data?.PaymentOrderDtl?.filter(
|
let PayatCounterfilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
(item) => item?.PaymentOptionType?.toLowerCase() === 'pc'
|
(item) => item?.PaymentOptionType?.toLowerCase() === 'pc'
|
||||||
);
|
);
|
||||||
|
|
@ -3762,7 +3678,7 @@ const BST6Payment = () => {
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{paybtns?.length > 0 && (currentOrderNetAmount >= previousNetAmount) ? (
|
{paybtns?.length > 0 ? (
|
||||||
paybtns?.map((payment) => (
|
paybtns?.map((payment) => (
|
||||||
<div className="Table6-cash">
|
<div className="Table6-cash">
|
||||||
<button
|
<button
|
||||||
|
|
@ -3842,40 +3758,6 @@ const BST6Payment = () => {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? (
|
|
||||||
refundPayBtns.map((payment) => (
|
|
||||||
<div className="Table6-cash">
|
|
||||||
<button
|
|
||||||
className={
|
|
||||||
refundPaySelected === payment.ConfigId &&
|
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode-notupisel'
|
|
||||||
: refundPaySelected === payment.ConfigId &&
|
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode'
|
|
||||||
: 'Btn-payment-mode-sel'
|
|
||||||
}
|
|
||||||
style={{
|
|
||||||
fontFamily: FontFamily['para'],
|
|
||||||
position: 'relative',
|
|
||||||
animation: blink
|
|
||||||
? 'blink-animation 0.5s infinite alternate'
|
|
||||||
: 'none',
|
|
||||||
}}
|
|
||||||
onClick={() => handleRefundPaymentMode(payment?.ConfigId, payment?.ConfigName)}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'row',
|
|
||||||
columnGap: '0.5rem',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{payment.ConfigName}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
))
|
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
onClick={handlepaymentoptions}
|
onClick={handlepaymentoptions}
|
||||||
|
|
@ -3900,9 +3782,8 @@ const BST6Payment = () => {
|
||||||
OrderCardDetail?.length > 0 &&
|
OrderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus != 'Close'
|
CheckBookingStatus != 'Close'
|
||||||
? !OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ?
|
? !OrderStatus
|
||||||
'BST6Payment-Button-pay'
|
? 'BST6Payment-Button-pay'
|
||||||
: 'BST6Payment-Button-pay'
|
|
||||||
: 'BST6Payment-Button-pay Order'
|
: 'BST6Payment-Button-pay Order'
|
||||||
: 'BST6Payment-Button-pay-disabled'
|
: 'BST6Payment-Button-pay-disabled'
|
||||||
}
|
}
|
||||||
|
|
@ -3917,7 +3798,7 @@ const BST6Payment = () => {
|
||||||
handleButtonClick
|
handleButtonClick
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{!OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ? <div>Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</div> : (
|
{!OrderStatus ? (
|
||||||
<>
|
<>
|
||||||
<p style={{ fontFamily: FontFamily['head'] }}>
|
<p style={{ fontFamily: FontFamily['head'] }}>
|
||||||
{isMobile ? (
|
{isMobile ? (
|
||||||
|
|
@ -4436,10 +4317,7 @@ const BST6Payment = () => {
|
||||||
SplitPaymentModal={Splitpayment}
|
SplitPaymentModal={Splitpayment}
|
||||||
handlesplitpaymentclose={handlesplitpaymentclose}
|
handlesplitpaymentclose={handlesplitpaymentclose}
|
||||||
TotalNetAmount={
|
TotalNetAmount={
|
||||||
OrderType === 'Failed' ? FailedTotalAmt : Math.round(OrderCardDetail?.reduce((acc, data) => data?.TotalAmt + acc, 0) -
|
OrderType === 'Failed' ? FailedTotalAmt : Math.round(TotalAmount)
|
||||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
|
||||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
|
||||||
(Discount > 0 ? Discount : 0)))
|
|
||||||
}
|
}
|
||||||
failedOrderData={failedOrderData}
|
failedOrderData={failedOrderData}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -110,15 +110,6 @@ import {
|
||||||
changeCurrentOrderId,
|
changeCurrentOrderId,
|
||||||
GlobalCombocarddata,
|
GlobalCombocarddata,
|
||||||
getCreditCustomer,
|
getCreditCustomer,
|
||||||
GlobalSalesBillEdit,
|
|
||||||
GlobalPreviousOrderPayment,
|
|
||||||
GlobalPreviousOrderOfferDetails,
|
|
||||||
GlobalpaymentOptionData,
|
|
||||||
getPaymentOptions,
|
|
||||||
putSalesBillEdit,
|
|
||||||
changeBillEditingMode,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData.js';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData.js';
|
||||||
import {
|
import {
|
||||||
globalExtraTotalAmount,
|
globalExtraTotalAmount,
|
||||||
|
|
@ -234,10 +225,6 @@ const BSBilling7Payment = () => {
|
||||||
);
|
);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
|
||||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
|
||||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
|
||||||
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
|
||||||
const Discount = useSelector(GlobalOverAllOfferAmt);
|
const Discount = useSelector(GlobalOverAllOfferAmt);
|
||||||
const screenwidth = useSelector(GlobalScreenSize);
|
const screenwidth = useSelector(GlobalScreenSize);
|
||||||
const defaultBookingType = useSelector(GlobalDefaultBookingType);
|
const defaultBookingType = useSelector(GlobalDefaultBookingType);
|
||||||
|
|
@ -340,11 +327,6 @@ const BSBilling7Payment = () => {
|
||||||
const [SelectedUPIPayOption, setSelectedUPIPayOption] = useState('Default');
|
const [SelectedUPIPayOption, setSelectedUPIPayOption] = useState('Default');
|
||||||
const [SelectedUpiOption, setSelectedUpiOption] = useState();
|
const [SelectedUpiOption, setSelectedUpiOption] = useState();
|
||||||
const [hold, setHold] = useState(false);
|
const [hold, setHold] = useState(false);
|
||||||
const [refundPayBtns, setRefundPayBtns] = useState([]);
|
|
||||||
const [refundPaySelected, setRefundPaySelected] = useState();
|
|
||||||
const [refundPaySelectedName, setRefundPaySelectedName] = useState(null);
|
|
||||||
const [currentOrderNetAmount, setCurrentOrderNetAmount] = useState(0);
|
|
||||||
const [previousNetAmount, setPreviousNetAmount] = useState(0);
|
|
||||||
const [addcustomer, setAddCustomer] = useState(false);
|
const [addcustomer, setAddCustomer] = useState(false);
|
||||||
const [PrintOrderDetails, setPrintOrderDetails] = useState([]);
|
const [PrintOrderDetails, setPrintOrderDetails] = useState([]);
|
||||||
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false); const OverAllSales = useSelector(GlobalOverAllDiscSales);
|
const [customerPreviesOrders, setCustomerPreviesOrders] = useState(false); const OverAllSales = useSelector(GlobalOverAllDiscSales);
|
||||||
|
|
@ -366,7 +348,7 @@ const BSBilling7Payment = () => {
|
||||||
|
|
||||||
return acc + Math.round(Number(item?.OrderQty || 0));
|
return acc + Math.round(Number(item?.OrderQty || 0));
|
||||||
}, 0);
|
}, 0);
|
||||||
console.log(salesBillEdit, currentOrderNetAmount, previousNetAmount, "previousNetAmount")
|
|
||||||
const [UpiOption, setUpiOption] = useState('');
|
const [UpiOption, setUpiOption] = useState('');
|
||||||
const [BusinessPayOption, setBusinessPayoption] = useState([]);
|
const [BusinessPayOption, setBusinessPayoption] = useState([]);
|
||||||
const [paymentSucess, setPaymentSuccess] = useState(false);
|
const [paymentSucess, setPaymentSuccess] = useState(false);
|
||||||
|
|
@ -500,33 +482,6 @@ const BSBilling7Payment = () => {
|
||||||
setMobileNoWhatsApp(selOption);
|
setMobileNoWhatsApp(selOption);
|
||||||
}
|
}
|
||||||
}, [selOption]);
|
}, [selOption]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (salesBillEdit) {
|
|
||||||
dispatch(getPaymentOptions()).unwrap();
|
|
||||||
}
|
|
||||||
}, [salesBillEdit]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
|
|
||||||
if (salesBillEdit) {
|
|
||||||
if (SelCustId) {
|
|
||||||
setRefundPayBtns(AllPaymentOptions);
|
|
||||||
setRefundPaySelected(AllPaymentOptions?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(AllPaymentOptions?.[0]?.ConfigName);
|
|
||||||
} else {
|
|
||||||
const withoutCustomer = AllPaymentOptions?.filter?.(
|
|
||||||
(item) => item?.ConfigName?.toLowerCase() !== 'credit'
|
|
||||||
);
|
|
||||||
setRefundPaySelected(withoutCustomer?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(withoutCustomer?.[0]?.ConfigName);
|
|
||||||
setRefundPayBtns(withoutCustomer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, [AllPaymentOptions, SelCustId, salesBillEdit])
|
|
||||||
|
|
||||||
|
|
||||||
// Usage
|
// Usage
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchCreditCustomer = async () => {
|
const fetchCreditCustomer = async () => {
|
||||||
|
|
@ -624,44 +579,23 @@ const BSBilling7Payment = () => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredPayments =
|
|
||||||
previousOrderPayment?.filter(
|
|
||||||
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment
|
|
||||||
) || [];
|
|
||||||
|
|
||||||
const paymentsToUse =
|
|
||||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
|
||||||
|
|
||||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
|
||||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const totalPreviousOfferAmount = previousOrderOfferDetails?.reduce(
|
|
||||||
(acc, offer) => acc + parseFloat(offer.OfferAmount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const previousNetAmount =
|
|
||||||
(totalPreviouspayment) || 0;
|
|
||||||
|
|
||||||
let withdiscTotal =
|
let withdiscTotal =
|
||||||
Total -
|
Total -
|
||||||
((OverAllSales || 0) +
|
((OverAllSales || 0) +
|
||||||
(OverAllEstimate || 0) +
|
(OverAllEstimate || 0) +
|
||||||
(Discount > 0 ? Discount : 0));
|
(Discount > 0 ? Discount : 0));
|
||||||
|
|
||||||
const currentOrderNetAmount = formatAmount(
|
setTotalAmount(
|
||||||
withdiscTotal >= 0
|
withdiscTotal >= 0
|
||||||
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
||||||
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
||||||
)
|
);
|
||||||
console.log(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount, "totalPreviouspayment")
|
|
||||||
|
|
||||||
setTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount);
|
dispatch(
|
||||||
setCurrentOrderNetAmount(currentOrderNetAmount);
|
changeSummeryTotalAmount(
|
||||||
setPreviousNetAmount(previousNetAmount);
|
withdiscTotal > 0 ? withdiscTotal : Number(Total)
|
||||||
dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount));
|
)
|
||||||
|
);
|
||||||
|
|
||||||
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
||||||
|
|
||||||
|
|
@ -885,7 +819,7 @@ const BSBilling7Payment = () => {
|
||||||
async (orderDetail, index) => {
|
async (orderDetail, index) => {
|
||||||
await printDiv(`${selectedStyle}-${index}`, style); // Use unique IDs for each print
|
await printDiv(`${selectedStyle}-${index}`, style); // Use unique IDs for each print
|
||||||
if (orderDetail?.BookingTypeName !== 'Dine In') {
|
if (orderDetail?.BookingTypeName !== 'Dine In') {
|
||||||
const groupedTokens = orderDetail?.productDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.reduce(
|
const groupedTokens = orderDetail?.productDetails?.reduce(
|
||||||
(acc, item, idx) => {
|
(acc, item, idx) => {
|
||||||
if (item.TokenAvailable === 'Y') {
|
if (item.TokenAvailable === 'Y') {
|
||||||
if (!item.CounterName) {
|
if (!item.CounterName) {
|
||||||
|
|
@ -965,17 +899,12 @@ const BSBilling7Payment = () => {
|
||||||
const handleButtonClick = () => {
|
const handleButtonClick = () => {
|
||||||
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
||||||
UpiPayment();
|
UpiPayment();
|
||||||
} else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Please Select Refund Payment Method');
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? AddBookingDetails('Dine-In', false)
|
? AddBookingDetails('Dine-In', false)
|
||||||
: AddBookingDetails(BookingType, true);
|
: AddBookingDetails(BookingType, true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
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');
|
||||||
|
|
@ -1708,12 +1637,6 @@ const BSBilling7Payment = () => {
|
||||||
setCardoptionnotSelected(false);
|
setCardoptionnotSelected(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRefundPaymentMode = (id, name) => {
|
|
||||||
setRefundPaySelected(id);
|
|
||||||
setRefundPaySelectedName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
const addUpiOption = async (id, name, UPIId) => {
|
const addUpiOption = async (id, name, UPIId) => {
|
||||||
await dispatch(changeUpiIDprint(UPIId));
|
await dispatch(changeUpiIDprint(UPIId));
|
||||||
await dispatch(changeUpiIDName(name));
|
await dispatch(changeUpiIDName(name));
|
||||||
|
|
@ -1910,9 +1833,6 @@ const BSBilling7Payment = () => {
|
||||||
} else {
|
} else {
|
||||||
dispatch(changeOrderCardDetails([]));
|
dispatch(changeOrderCardDetails([]));
|
||||||
}
|
}
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
dispatch(changeTipAmount(0));
|
dispatch(changeTipAmount(0));
|
||||||
dispatch(changeFullOfferAppliedProducts([]));
|
dispatch(changeFullOfferAppliedProducts([]));
|
||||||
dispatch(changeLoyaltyConsumedQuantities({}));
|
dispatch(changeLoyaltyConsumedQuantities({}));
|
||||||
|
|
@ -1928,8 +1848,6 @@ const BSBilling7Payment = () => {
|
||||||
setPaybtnnameselected(PaymentOptionsModeName);
|
setPaybtnnameselected(PaymentOptionsModeName);
|
||||||
setPaybtnselected(PaymentOptionsModeId);
|
setPaybtnselected(PaymentOptionsModeId);
|
||||||
setQrCode(false);
|
setQrCode(false);
|
||||||
setCurrentOrderNetAmount(0);
|
|
||||||
setPreviousNetAmount(0);
|
|
||||||
setUpinotSelected(false);
|
setUpinotSelected(false);
|
||||||
getHolddata();
|
getHolddata();
|
||||||
if (defaultBookingType === 'Both') {
|
if (defaultBookingType === 'Both') {
|
||||||
|
|
@ -2221,7 +2139,7 @@ const BSBilling7Payment = () => {
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
{
|
{
|
||||||
PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected :
|
PaymentType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi'
|
Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
||||||
? PaymentDeviceUPI?.[0]?.ModeId
|
? PaymentDeviceUPI?.[0]?.ModeId
|
||||||
|
|
@ -2235,14 +2153,14 @@ const BSBilling7Payment = () => {
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
? paybtnselected
|
? paybtnselected
|
||||||
: null,
|
: null,
|
||||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
Amount: Math.round(TotalAmount),
|
||||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
MerchantId:
|
||||||
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: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
PaymentOptionType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2256,7 +2174,7 @@ const BSBilling7Payment = () => {
|
||||||
? 'BU'
|
? 'BU'
|
||||||
: SelectedUPIPayOption
|
: SelectedUPIPayOption
|
||||||
: null,
|
: null,
|
||||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
ModeOfPayment:
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
|
|
@ -2264,7 +2182,7 @@ const BSBilling7Payment = () => {
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantUPIId
|
?.MerchantUPIId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
AccountDtl:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
|
|
@ -2281,7 +2199,7 @@ const BSBilling7Payment = () => {
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
PaymentStatus:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2290,8 +2208,8 @@ const BSBilling7Payment = () => {
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
Debit: 0,
|
||||||
Credit: salesBillEdit ? (currentOrderNetAmount > previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(TotalAmount) : 0 :
|
Credit:
|
||||||
Paybtnnameselected?.toLowerCase() === 'credit'
|
Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? Math.round(TotalAmount)
|
? Math.round(TotalAmount)
|
||||||
: 0,
|
: 0,
|
||||||
|
|
@ -2498,12 +2416,7 @@ const BSBilling7Payment = () => {
|
||||||
putdata['PaymentType'] = !pay && '';
|
putdata['PaymentType'] = !pay && '';
|
||||||
putdata['PrintType'] = 'Y';
|
putdata['PrintType'] = 'Y';
|
||||||
}
|
}
|
||||||
let response = null;
|
let response = await dispatch(PutBookingData(putdata)).unwrap();
|
||||||
if (salesBillEdit) {
|
|
||||||
response = await dispatch(putSalesBillEdit(putdata)).unwrap();
|
|
||||||
} else {
|
|
||||||
response = await dispatch(PutBookingData(putdata)).unwrap();
|
|
||||||
}
|
|
||||||
if (value !== 'Unpaid') {
|
if (value !== 'Unpaid') {
|
||||||
if (response?.data?.statusCode == 1) {
|
if (response?.data?.statusCode == 1) {
|
||||||
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
|
|
@ -3213,7 +3126,7 @@ const BSBilling7Payment = () => {
|
||||||
};
|
};
|
||||||
// split payments
|
// split payments
|
||||||
const SplitPaymentOpen = () => {
|
const SplitPaymentOpen = () => {
|
||||||
if (OrderCardDetail?.length > 0 && TotalAmount > 0) {
|
if (OrderCardDetail?.length > 0) {
|
||||||
const updatedData = {
|
const updatedData = {
|
||||||
userData: OrderCardDetail,
|
userData: OrderCardDetail,
|
||||||
ExtraCharges: GlobalExtraCharge,
|
ExtraCharges: GlobalExtraCharge,
|
||||||
|
|
@ -3223,11 +3136,6 @@ const BSBilling7Payment = () => {
|
||||||
setFailedOrderData(updatedData);
|
setFailedOrderData(updatedData);
|
||||||
setSplitpayment(true);
|
setSplitpayment(true);
|
||||||
} else {
|
} else {
|
||||||
if (TotalAmount <= 0) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Cannot split when total amount is zero or less');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
setMessageData('Please Select the Product');
|
setMessageData('Please Select the Product');
|
||||||
}
|
}
|
||||||
|
|
@ -3932,7 +3840,7 @@ const BSBilling7Payment = () => {
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{paybtns?.length > 0 && (currentOrderNetAmount >= previousNetAmount) ? (
|
{paybtns?.length > 0 ? (
|
||||||
paybtns?.map((payment) => (
|
paybtns?.map((payment) => (
|
||||||
<div className="Table3-cash">
|
<div className="Table3-cash">
|
||||||
<button
|
<button
|
||||||
|
|
@ -4009,42 +3917,6 @@ const BSBilling7Payment = () => {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? (
|
|
||||||
refundPayBtns.map((payment) => (
|
|
||||||
<div className="Table3-cash">
|
|
||||||
<button
|
|
||||||
className={
|
|
||||||
refundPaySelected === payment.ConfigId &&
|
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode-notupisel'
|
|
||||||
: refundPaySelected === payment.ConfigId &&
|
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode'
|
|
||||||
: 'Btn-payment-mode-sel'
|
|
||||||
}
|
|
||||||
style={{
|
|
||||||
fontFamily: FontFamily['para'],
|
|
||||||
position: 'relative',
|
|
||||||
animation: blink
|
|
||||||
? 'blink-animation 0.5s infinite alternate'
|
|
||||||
: 'none',
|
|
||||||
}}
|
|
||||||
onClick={() => handleRefundPaymentMode(payment?.ConfigId, payment?.ConfigName)}
|
|
||||||
>
|
|
||||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
|
||||||
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'row',
|
|
||||||
columnGap: '0.5rem',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{payment.ConfigName}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
))
|
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
onClick={handlepaymentoptions}
|
onClick={handlepaymentoptions}
|
||||||
|
|
@ -4282,9 +4154,8 @@ const BSBilling7Payment = () => {
|
||||||
OrderCardDetail?.length > 0 &&
|
OrderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus != 'Close'
|
CheckBookingStatus != 'Close'
|
||||||
? !OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ?
|
? !OrderStatus
|
||||||
'Table4-Btn-final-price'
|
? 'Table4-Btn-final-price'
|
||||||
: 'Table4-Btn-final-price'
|
|
||||||
: 'Table4-Btn-final-price Order'
|
: 'Table4-Btn-final-price Order'
|
||||||
: 'Table4-Btn-final-price-disabled'
|
: 'Table4-Btn-final-price-disabled'
|
||||||
}
|
}
|
||||||
|
|
@ -4297,7 +4168,7 @@ const BSBilling7Payment = () => {
|
||||||
handleButtonClick
|
handleButtonClick
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{!OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ? <p className="Table4-Order">Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</p> : (
|
{!OrderStatus ? (
|
||||||
<>
|
<>
|
||||||
<div className="Table4-fullrate">
|
<div className="Table4-fullrate">
|
||||||
<div
|
<div
|
||||||
|
|
@ -4630,10 +4501,7 @@ const BSBilling7Payment = () => {
|
||||||
SplitPaymentModal={Splitpayment}
|
SplitPaymentModal={Splitpayment}
|
||||||
handlesplitpaymentclose={handlesplitpaymentclose}
|
handlesplitpaymentclose={handlesplitpaymentclose}
|
||||||
TotalNetAmount={
|
TotalNetAmount={
|
||||||
OrderType === 'Failed' ? FailedTotalAmt : Math.round(OrderCardDetail?.reduce((acc, data) => data?.TotalAmt + acc, 0) -
|
OrderType === 'Failed' ? FailedTotalAmt : Math.round(TotalAmount)
|
||||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
|
||||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
|
||||||
(Discount > 0 ? Discount : 0)))
|
|
||||||
}
|
}
|
||||||
failedOrderData={failedOrderData}
|
failedOrderData={failedOrderData}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,6 @@ import {
|
||||||
PostBlockSlots,
|
PostBlockSlots,
|
||||||
changeCustomerID,
|
changeCustomerID,
|
||||||
changeSelectedCustId,
|
changeSelectedCustId,
|
||||||
changeBillEditingMode,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import './StandardTable.scss';
|
import './StandardTable.scss';
|
||||||
import { IoClose } from 'react-icons/io5';
|
import { IoClose } from 'react-icons/io5';
|
||||||
|
|
@ -151,8 +148,8 @@ const StandardTable = () => {
|
||||||
OrderType === 'Hold'
|
OrderType === 'Hold'
|
||||||
? OrderCardDetail?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
? OrderCardDetail?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
||||||
: OrderCardDetail?.filter(
|
: OrderCardDetail?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
||||||
);
|
);
|
||||||
console.log('HoldOrderDtl', OrderCardDetail);
|
console.log('HoldOrderDtl', OrderCardDetail);
|
||||||
const OldtableDataDinein = OrderCardDetail?.filter(
|
const OldtableDataDinein = OrderCardDetail?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'Dine In' && a?.SalesId
|
||||||
|
|
@ -160,8 +157,8 @@ const StandardTable = () => {
|
||||||
const OldtableDataTakeAway =
|
const OldtableDataTakeAway =
|
||||||
OrderType != 'Hold'
|
OrderType != 'Hold'
|
||||||
? OrderCardDetail?.filter(
|
? OrderCardDetail?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && a?.SalesId
|
||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const [EditQuantity, setEditQuantity] = useState(false);
|
const [EditQuantity, setEditQuantity] = useState(false);
|
||||||
|
|
@ -294,9 +291,9 @@ const StandardTable = () => {
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
await dispatch(getSelectedFavItems(data)).unwrap();
|
await dispatch(getSelectedFavItems(data)).unwrap();
|
||||||
|
|
@ -308,9 +305,9 @@ const StandardTable = () => {
|
||||||
ProdSubCat: ProdSubCat,
|
ProdSubCat: ProdSubCat,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -321,9 +318,9 @@ const StandardTable = () => {
|
||||||
prodCat: prodCat,
|
prodCat: prodCat,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -416,9 +413,6 @@ const StandardTable = () => {
|
||||||
await dispatch(ChangeTotalAmount([]));
|
await dispatch(ChangeTotalAmount([]));
|
||||||
await dispatch(changeOrderType(null));
|
await dispatch(changeOrderType(null));
|
||||||
await dispatch(changeReorderHoldDetails({}));
|
await dispatch(changeReorderHoldDetails({}));
|
||||||
await dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
} else if (OrderType === 'Reorder') {
|
} else if (OrderType === 'Reorder') {
|
||||||
const UpdatedData = OrderCardDetail?.filter(
|
const UpdatedData = OrderCardDetail?.filter(
|
||||||
(cartItem) => cartItem?.SalesId
|
(cartItem) => cartItem?.SalesId
|
||||||
|
|
@ -444,9 +438,6 @@ const StandardTable = () => {
|
||||||
await dispatch(ChangeTotalAmount([]));
|
await dispatch(ChangeTotalAmount([]));
|
||||||
await dispatch(changeUnpaidData(false));
|
await dispatch(changeUnpaidData(false));
|
||||||
await dispatch(changeReorderHoldDetails({}));
|
await dispatch(changeReorderHoldDetails({}));
|
||||||
await dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
await dispatch(changeReorderProductDetails([]));
|
await dispatch(changeReorderProductDetails([]));
|
||||||
await dispatch(ChangeSelectedCustDisable(false));
|
await dispatch(ChangeSelectedCustDisable(false));
|
||||||
|
|
||||||
|
|
@ -1133,9 +1124,9 @@ const StandardTable = () => {
|
||||||
)?.map((item, idx) =>
|
)?.map((item, idx) =>
|
||||||
idx === 0
|
idx === 0
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
FreeQty,
|
FreeQty,
|
||||||
}
|
}
|
||||||
: item
|
: item
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
@ -2519,10 +2510,11 @@ const StandardTable = () => {
|
||||||
{OldtableDataTakeAway?.map((item, index) => (
|
{OldtableDataTakeAway?.map((item, index) => (
|
||||||
<tr
|
<tr
|
||||||
key={index}
|
key={index}
|
||||||
className={`${item?.SalesId && OrderType !== 'Hold'
|
className={`${
|
||||||
? 'booking-billing-table-row-disabled'
|
item?.SalesId && OrderType !== 'Hold'
|
||||||
: 'booking-billing-table-row'
|
? 'booking-billing-table-row-disabled'
|
||||||
}`}
|
: 'booking-billing-table-row'
|
||||||
|
}`}
|
||||||
style={{
|
style={{
|
||||||
fontFamily:
|
fontFamily:
|
||||||
"'Inter', ui-sans-serif, system-ui, sans-serif",
|
"'Inter', ui-sans-serif, system-ui, sans-serif",
|
||||||
|
|
@ -2532,16 +2524,16 @@ const StandardTable = () => {
|
||||||
? item?.SalesId && OrderType !== 'Hold'
|
? item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: triggerAnimation &&
|
: triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: triggerAnimation &&
|
: triggerAnimation &&
|
||||||
index === 0 &&
|
index === 0 &&
|
||||||
tableDataTakeAway?.length >=
|
tableDataTakeAway?.length >=
|
||||||
PreviousdataLength &&
|
PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
|
|
@ -2549,9 +2541,9 @@ const StandardTable = () => {
|
||||||
item?.SalesId && OrderType !== 'Hold'
|
item?.SalesId && OrderType !== 'Hold'
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: index % 2 === 0
|
: index % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2614,7 +2606,7 @@ const StandardTable = () => {
|
||||||
}}
|
}}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0
|
item.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item)
|
: editField && handleEditQuantity(item)
|
||||||
}
|
}
|
||||||
|
|
@ -2683,21 +2675,21 @@ const StandardTable = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2792,7 +2784,7 @@ const StandardTable = () => {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{safeRound(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
{safeRound(item?.TotalAmt)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
{tableitem.OptionName == 'Delete' && (
|
{tableitem.OptionName == 'Delete' && (
|
||||||
|
|
@ -2836,10 +2828,11 @@ const StandardTable = () => {
|
||||||
{OldtableDataDinein?.map((item, index) => (
|
{OldtableDataDinein?.map((item, index) => (
|
||||||
<tr
|
<tr
|
||||||
key={OldtableDataTakeAway?.length + index}
|
key={OldtableDataTakeAway?.length + index}
|
||||||
className={`${item?.SalesId
|
className={`${
|
||||||
? 'booking-billing-table-row-disabled'
|
item?.SalesId
|
||||||
: 'booking-billing-table-row'
|
? 'booking-billing-table-row-disabled'
|
||||||
}
|
: 'booking-billing-table-row'
|
||||||
|
}
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -2851,27 +2844,27 @@ const StandardTable = () => {
|
||||||
? item?.SalesId
|
? item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
|
||||||
!item?.SalesId &&
|
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
|
||||||
? 'wheat'
|
|
||||||
: BookingType !== 'Dine In' &&
|
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
tableDataDinein?.length >=
|
!item?.SalesId &&
|
||||||
PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
!HoldOrderDtl &&
|
? 'wheat'
|
||||||
!UnpaidData
|
: BookingType !== 'Dine In' &&
|
||||||
|
triggerAnimation &&
|
||||||
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
|
tableDataDinein?.length >=
|
||||||
|
PreviousdataLength &&
|
||||||
|
!HoldOrderDtl &&
|
||||||
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background: item?.SalesId
|
background: item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2998,21 +2991,21 @@ const StandardTable = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3106,7 +3099,7 @@ const StandardTable = () => {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{safeRound(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
{safeRound(item?.TotalAmt)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -3155,10 +3148,11 @@ const StandardTable = () => {
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index
|
index
|
||||||
}
|
}
|
||||||
className={`${BookingType === 'Dine In' && item?.SalesId
|
className={`${
|
||||||
? 'booking-billing-table-row-disabled'
|
BookingType === 'Dine In' && item?.SalesId
|
||||||
: 'booking-billing-table-row'
|
? 'booking-billing-table-row-disabled'
|
||||||
}
|
: 'booking-billing-table-row'
|
||||||
|
}
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -3167,43 +3161,43 @@ const StandardTable = () => {
|
||||||
? BookingType === 'Dine In' && item?.SalesId
|
? BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
|
||||||
OldtableDataDinein?.length +
|
|
||||||
OldtableDataTakeAway?.length +
|
|
||||||
index ===
|
|
||||||
0 &&
|
|
||||||
!item?.SalesId &&
|
|
||||||
tableDataTakeAway?.length >= PreviousdataLength
|
|
||||||
? 'wheat'
|
|
||||||
: BookingType !== 'Dine In' &&
|
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataTakeAway?.length >=
|
!item?.SalesId &&
|
||||||
PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength
|
||||||
!HoldOrderDtl &&
|
? 'wheat'
|
||||||
!UnpaidData
|
: BookingType !== 'Dine In' &&
|
||||||
|
triggerAnimation &&
|
||||||
|
OldtableDataDinein?.length +
|
||||||
|
OldtableDataTakeAway?.length +
|
||||||
|
index ===
|
||||||
|
0 &&
|
||||||
|
tableDataTakeAway?.length >=
|
||||||
|
PreviousdataLength &&
|
||||||
|
!HoldOrderDtl &&
|
||||||
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.[
|
: SelectedBillColor?.[
|
||||||
'OverallBackgroundColor'
|
'OverallBackgroundColor'
|
||||||
]
|
]
|
||||||
? SelectedBillColor?.[
|
? SelectedBillColor?.[
|
||||||
'OverallBackgroundColor'
|
'OverallBackgroundColor'
|
||||||
]
|
]
|
||||||
: '#d6d6d6'
|
: '#d6d6d6'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -3212,15 +3206,15 @@ const StandardTable = () => {
|
||||||
BookingType === 'Dine In' && item?.SalesId
|
BookingType === 'Dine In' && item?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataDinein?.length +
|
: (OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -3229,9 +3223,9 @@ const StandardTable = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataTakeAway?.length >= PreviousdataLength &&
|
tableDataTakeAway?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -3284,7 +3278,7 @@ const StandardTable = () => {
|
||||||
}}
|
}}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
item.FullProductIdentifierDtls?.length > 0 ||
|
item.FullProductIdentifierDtls?.length > 0 ||
|
||||||
item.ProductIdentifierDtls?.length > 0
|
item.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(item)
|
? handleImeiDetails(item)
|
||||||
: editField && handleEditQuantity(item)
|
: editField && handleEditQuantity(item)
|
||||||
}
|
}
|
||||||
|
|
@ -3308,8 +3302,8 @@ const StandardTable = () => {
|
||||||
{!item?.ProdVariantName?.toLowerCase()?.includes(
|
{!item?.ProdVariantName?.toLowerCase()?.includes(
|
||||||
'variant'
|
'variant'
|
||||||
) && (
|
) && (
|
||||||
<span>{item?.ProdVariantName} </span>
|
<span>{item?.ProdVariantName} </span>
|
||||||
)}
|
)}
|
||||||
{AvailableDate ? (
|
{AvailableDate ? (
|
||||||
<>
|
<>
|
||||||
{' '}
|
{' '}
|
||||||
|
|
@ -3359,21 +3353,21 @@ const StandardTable = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3468,7 +3462,7 @@ const StandardTable = () => {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{safeRound(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
{safeRound(item?.TotalAmt)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -3517,10 +3511,11 @@ const StandardTable = () => {
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index
|
index
|
||||||
}
|
}
|
||||||
className={`${BookingType === 'Dine In' && item?.SalesId
|
className={`${
|
||||||
? 'booking-billing-table-row-disabled'
|
BookingType === 'Dine In' && item?.SalesId
|
||||||
: 'booking-billing-table-row'
|
? 'booking-billing-table-row-disabled'
|
||||||
}
|
: 'booking-billing-table-row'
|
||||||
|
}
|
||||||
|
|
||||||
`}
|
`}
|
||||||
style={{
|
style={{
|
||||||
|
|
@ -3531,45 +3526,45 @@ const StandardTable = () => {
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: BookingType === 'Dine In' &&
|
: BookingType === 'Dine In' &&
|
||||||
triggerAnimation &&
|
|
||||||
OldtableDataTakeAway?.length +
|
|
||||||
OldtableDataDinein?.length +
|
|
||||||
tableDataTakeAway?.length +
|
|
||||||
index ===
|
|
||||||
0 &&
|
|
||||||
!item?.SalesId &&
|
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
|
||||||
? 'wheat'
|
|
||||||
: BookingType !== 'Dine In' &&
|
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
tableDataDinein?.length >=
|
!item?.SalesId &&
|
||||||
PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
!HoldOrderDtl &&
|
? 'wheat'
|
||||||
!UnpaidData
|
: BookingType !== 'Dine In' &&
|
||||||
|
triggerAnimation &&
|
||||||
|
OldtableDataTakeAway?.length +
|
||||||
|
OldtableDataDinein?.length +
|
||||||
|
tableDataTakeAway?.length +
|
||||||
|
index ===
|
||||||
|
0 &&
|
||||||
|
tableDataDinein?.length >=
|
||||||
|
PreviousdataLength &&
|
||||||
|
!HoldOrderDtl &&
|
||||||
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background:
|
background:
|
||||||
BookingType === 'Dine In' &&
|
BookingType === 'Dine In' &&
|
||||||
item?.SalesId &&
|
item?.SalesId &&
|
||||||
!BookingTypeBoth
|
!BookingTypeBoth
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
item?.InwardDtlId + ' ' + item?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length +
|
: (OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index) %
|
index) %
|
||||||
2 ===
|
2 ===
|
||||||
0
|
0
|
||||||
? 'white'
|
? 'white'
|
||||||
: SelectedBillColor?.['OverallBackgroundColor']
|
: SelectedBillColor?.['OverallBackgroundColor']
|
||||||
? SelectedBillColor?.['OverallBackgroundColor']
|
? SelectedBillColor?.['OverallBackgroundColor']
|
||||||
|
|
@ -3578,10 +3573,10 @@ const StandardTable = () => {
|
||||||
BillOrderPre === 'Y' && !BookingTypeBoth
|
BillOrderPre === 'Y' && !BookingTypeBoth
|
||||||
? triggerAnimation &&
|
? triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length +
|
OldtableDataTakeAway?.length +
|
||||||
OldtableDataDinein?.length +
|
OldtableDataDinein?.length +
|
||||||
tableDataTakeAway?.length +
|
tableDataTakeAway?.length +
|
||||||
index ===
|
index ===
|
||||||
0 &&
|
0 &&
|
||||||
!item?.SalesId &&
|
!item?.SalesId &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
|
|
@ -3703,21 +3698,21 @@ const StandardTable = () => {
|
||||||
{productBasedExtraCharges?.find(
|
{productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
) !== undefined && (
|
) !== undefined && (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
fontSize: '10px',
|
fontSize: '10px',
|
||||||
fontWeight: '500',
|
fontWeight: '500',
|
||||||
whiteSpace: 'nowrap',
|
whiteSpace: 'nowrap',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Extra Charges :{' '}
|
Extra Charges :{' '}
|
||||||
{
|
{
|
||||||
productBasedExtraCharges?.find(
|
productBasedExtraCharges?.find(
|
||||||
(find) => find.ProdId === item.ProdId
|
(find) => find.ProdId === item.ProdId
|
||||||
)?.TotalAmt
|
)?.TotalAmt
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
@ -3811,7 +3806,7 @@ const StandardTable = () => {
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{safeRound(item?.TotalAmt - (item?.Offer || 0) || 0)}
|
{safeRound(item?.TotalAmt)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@
|
||||||
height: 2rem;
|
height: 2rem;
|
||||||
font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
|
font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
|
||||||
|
|
||||||
>th {
|
> th {
|
||||||
font-size: 10px !important;
|
font-size: 10px !important;
|
||||||
font-weight: 400 !important;
|
font-weight: 400 !important;
|
||||||
-webkit-text-stroke-width: 0.2px;
|
-webkit-text-stroke-width: 0.2px;
|
||||||
|
|
@ -1116,20 +1116,19 @@
|
||||||
@media (max-width: 500px) {
|
@media (max-width: 500px) {
|
||||||
padding: 5px 10px;
|
padding: 5px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ShoppingCartMain-left {
|
.ShoppingCartMain-left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
>div {
|
> div {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
|
font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
>p {
|
> p {
|
||||||
background-color: #fff3;
|
background-color: #fff3;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
padding: 1px 6px;
|
padding: 1px 6px;
|
||||||
|
|
@ -1154,9 +1153,11 @@
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
|
||||||
@media (max-width: 768px) {
|
@media (max-width: 768px) {
|
||||||
background-color: linear-gradient(to bottom right,
|
background-color: linear-gradient(
|
||||||
#1e2536,
|
to bottom right,
|
||||||
#2a3447) !important;
|
#1e2536,
|
||||||
|
#2a3447
|
||||||
|
) !important;
|
||||||
background: linear-gradient(to bottom right, #1e2536, #2a3447) !important;
|
background: linear-gradient(to bottom right, #1e2536, #2a3447) !important;
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
}
|
}
|
||||||
|
|
@ -1171,13 +1172,13 @@
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
>div {
|
> div {
|
||||||
font-size: 1.125rem;
|
font-size: 1.125rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
|
font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
>p {
|
> p {
|
||||||
background-color: #fff3;
|
background-color: #fff3;
|
||||||
font-size: small;
|
font-size: small;
|
||||||
padding: 1px 6px;
|
padding: 1px 6px;
|
||||||
|
|
@ -1193,11 +1194,11 @@
|
||||||
padding: 12px 16px;
|
padding: 12px 16px;
|
||||||
|
|
||||||
.ShoppingCartMain-left {
|
.ShoppingCartMain-left {
|
||||||
>div {
|
> div {
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
>p {
|
> p {
|
||||||
font-size: 0.75rem;
|
font-size: 0.75rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1208,11 +1209,11 @@
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
||||||
.ShoppingCartMain-left {
|
.ShoppingCartMain-left {
|
||||||
>div {
|
> div {
|
||||||
font-size: 0.875rem;
|
font-size: 0.875rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
>p {
|
> p {
|
||||||
font-size: 0.7rem;
|
font-size: 0.7rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1268,27 +1269,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.standard-pay-btn-refund {
|
|
||||||
padding: 0.9rem 0.75rem;
|
|
||||||
font-size: 1.125rem;
|
|
||||||
font-family: 'Inter', ui-sans-serif, system-ui, sans-serif !important;
|
|
||||||
border: none;
|
|
||||||
border-radius: 4px;
|
|
||||||
cursor: pointer;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
// justify-content: space-around;
|
|
||||||
gap: 0.5rem;
|
|
||||||
opacity: 1;
|
|
||||||
background-color: #0d9488;
|
|
||||||
color: #fff;
|
|
||||||
|
|
||||||
@media (max-width: 500px) {
|
|
||||||
padding: 0.75rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.standard-pay-btn {
|
.standard-pay-btn {
|
||||||
padding: 0.9rem 0.75rem;
|
padding: 0.9rem 0.75rem;
|
||||||
font-size: 1.125rem;
|
font-size: 1.125rem;
|
||||||
|
|
@ -1558,7 +1538,7 @@
|
||||||
.paybutton {
|
.paybutton {
|
||||||
padding: 10px 12px;
|
padding: 10px 12px;
|
||||||
|
|
||||||
>svg {
|
> svg {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1577,7 +1557,9 @@
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.booking-billing-table-container .shoppingCartLeft .payment-buttons-container {
|
.booking-billing-table-container
|
||||||
|
.shoppingCartLeft
|
||||||
|
.payment-buttons-container {
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
@ -1614,7 +1596,7 @@
|
||||||
.standard-pay-btns {
|
.standard-pay-btns {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
>button {
|
> button {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ import Credit from '../../UtillComponents/Pozo retail icons/credit.svg';
|
||||||
import { FaCreditCard } from 'react-icons/fa6';
|
import { FaCreditCard } from 'react-icons/fa6';
|
||||||
import {
|
import {
|
||||||
changeAddBookingDetailsTrigger,
|
changeAddBookingDetailsTrigger,
|
||||||
changeBillEditingMode,
|
|
||||||
changeBookingType,
|
changeBookingType,
|
||||||
ChangeComboCarddata,
|
ChangeComboCarddata,
|
||||||
changeCurrentOrderId,
|
changeCurrentOrderId,
|
||||||
|
|
@ -26,8 +25,6 @@ import {
|
||||||
ChangeOverAllDiscSales,
|
ChangeOverAllDiscSales,
|
||||||
changePaymentloader,
|
changePaymentloader,
|
||||||
changePaymentTransactionNumber,
|
changePaymentTransactionNumber,
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changeReorderHoldDetails,
|
changeReorderHoldDetails,
|
||||||
changeReorderProductDetails,
|
changeReorderProductDetails,
|
||||||
changeSelectChair,
|
changeSelectChair,
|
||||||
|
|
@ -53,7 +50,6 @@ import {
|
||||||
getCurrentOrderid,
|
getCurrentOrderid,
|
||||||
getLayoutproductCard,
|
getLayoutproductCard,
|
||||||
GetPaymentdeviceResponse,
|
GetPaymentdeviceResponse,
|
||||||
getPaymentOptions,
|
|
||||||
getSalesDetailData,
|
getSalesDetailData,
|
||||||
getSelectedFavItems,
|
getSelectedFavItems,
|
||||||
getUnpaidData,
|
getUnpaidData,
|
||||||
|
|
@ -76,15 +72,11 @@ import {
|
||||||
GlobalOverAllDiscEstimate,
|
GlobalOverAllDiscEstimate,
|
||||||
GlobalOverAllDiscSales,
|
GlobalOverAllDiscSales,
|
||||||
GlobalPayementloader,
|
GlobalPayementloader,
|
||||||
GlobalpaymentOptionData,
|
|
||||||
GlobalPaymentTrigger,
|
GlobalPaymentTrigger,
|
||||||
GlobalPreviousOrderOfferDetails,
|
|
||||||
GlobalPreviousOrderPayment,
|
|
||||||
GlobalProductCategorie,
|
GlobalProductCategorie,
|
||||||
GlobalProductSubCategorie,
|
GlobalProductSubCategorie,
|
||||||
GlobalReorderHoldDetails,
|
GlobalReorderHoldDetails,
|
||||||
GlobalRetailWSSalesType,
|
GlobalRetailWSSalesType,
|
||||||
GlobalSalesBillEdit,
|
|
||||||
GlobalSelCustId,
|
GlobalSelCustId,
|
||||||
GlobalSelectedTableDetails,
|
GlobalSelectedTableDetails,
|
||||||
GlobalSelOption,
|
GlobalSelOption,
|
||||||
|
|
@ -101,7 +93,6 @@ import {
|
||||||
PutBookingData,
|
PutBookingData,
|
||||||
PutBookingPaymentStatusChange,
|
PutBookingPaymentStatusChange,
|
||||||
PutPendingPaymentList,
|
PutPendingPaymentList,
|
||||||
putSalesBillEdit,
|
|
||||||
putSplitpaymentStatus,
|
putSplitpaymentStatus,
|
||||||
SendPaymentLink,
|
SendPaymentLink,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
|
|
@ -276,10 +267,6 @@ const StandardTablePayment = () => {
|
||||||
const GlobProdwisedata = useSelector(GlobalSelProdWiseEst);
|
const GlobProdwisedata = useSelector(GlobalSelProdWiseEst);
|
||||||
const GlobEstBooking = useSelector(GlobalEstimateBooking);
|
const GlobEstBooking = useSelector(GlobalEstimateBooking);
|
||||||
const OtherServicesglobal = useSelector(GlobalOtherSevices);
|
const OtherServicesglobal = useSelector(GlobalOtherSevices);
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
|
||||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
|
||||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
|
||||||
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
|
||||||
const OrderType = useSelector(GlobalOrderType);
|
const OrderType = useSelector(GlobalOrderType);
|
||||||
const unpaidFlow = useSelector(Globalunpaidflow);
|
const unpaidFlow = useSelector(Globalunpaidflow);
|
||||||
const selOption = useSelector(GlobalSelOption);
|
const selOption = useSelector(GlobalSelOption);
|
||||||
|
|
@ -367,11 +354,6 @@ const StandardTablePayment = () => {
|
||||||
const [PaymentDeviceUPI, setPaymentDeviceUPI] = useState([]);
|
const [PaymentDeviceUPI, setPaymentDeviceUPI] = useState([]);
|
||||||
const [ConfigDataList, setConfigDataList] = useState([]);
|
const [ConfigDataList, setConfigDataList] = useState([]);
|
||||||
const [TotalAmount, setTotalAmount] = useState(0);
|
const [TotalAmount, setTotalAmount] = useState(0);
|
||||||
const [refundPayBtns, setRefundPayBtns] = useState([]);
|
|
||||||
const [refundPaySelected, setRefundPaySelected] = useState();
|
|
||||||
const [refundPaySelectedName, setRefundPaySelectedName] = useState(null);
|
|
||||||
const [currentOrderNetAmount, setCurrentOrderNetAmount] = useState(0);
|
|
||||||
const [previousNetAmount, setPreviousNetAmount] = useState(0);
|
|
||||||
const [FirstPaymentclick, setFirstPaymentclick] = useState(false);
|
const [FirstPaymentclick, setFirstPaymentclick] = useState(false);
|
||||||
const [UpinotSelected, setUpinotSelected] = useState(false);
|
const [UpinotSelected, setUpinotSelected] = useState(false);
|
||||||
const [brachName, setbrachName] = useState('');
|
const [brachName, setbrachName] = useState('');
|
||||||
|
|
@ -504,12 +486,6 @@ const StandardTablePayment = () => {
|
||||||
);
|
);
|
||||||
}, [GlobalExtraCharge]);
|
}, [GlobalExtraCharge]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (salesBillEdit) {
|
|
||||||
dispatch(getPaymentOptions()).unwrap();
|
|
||||||
}
|
|
||||||
}, [salesBillEdit]);
|
|
||||||
|
|
||||||
const customerNameOrMobile = MobileNoWhatsApp?.CustName?.trim()
|
const customerNameOrMobile = MobileNoWhatsApp?.CustName?.trim()
|
||||||
? `Dear ${MobileNoWhatsApp?.CustName}`
|
? `Dear ${MobileNoWhatsApp?.CustName}`
|
||||||
: `Dear ${MobileNoWhatsApp?.value}`;
|
: `Dear ${MobileNoWhatsApp?.value}`;
|
||||||
|
|
@ -730,6 +706,7 @@ const StandardTablePayment = () => {
|
||||||
CheckBookingStatus,
|
CheckBookingStatus,
|
||||||
addnewAccess,
|
addnewAccess,
|
||||||
preferenceshortcutkey,
|
preferenceshortcutkey,
|
||||||
|
|
||||||
unpaidFlow,
|
unpaidFlow,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
@ -832,13 +809,7 @@ const StandardTablePayment = () => {
|
||||||
}, [paybtnselected, selOption, payBtns]);
|
}, [paybtnselected, selOption, payBtns]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (orderCardDetail?.length == 0) {
|
orderCardDetail?.length == 0 ? dispatch(changeunpaidflow(false)) : '';
|
||||||
dispatch(changeunpaidflow(false));
|
|
||||||
// dispatch(changePreviousOrderPayment([]));
|
|
||||||
// dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
// dispatch(changeBillEditingMode(false));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!preOrder) {
|
if (!preOrder) {
|
||||||
const totalSum = orderCardDetail?.reduce(
|
const totalSum = orderCardDetail?.reduce(
|
||||||
(acc, card) => acc + parseFloat(card.OrderRate * card.OrderQty || 0),
|
(acc, card) => acc + parseFloat(card.OrderRate * card.OrderQty || 0),
|
||||||
|
|
@ -895,45 +866,29 @@ const StandardTablePayment = () => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredPayments =
|
|
||||||
previousOrderPayment?.filter(
|
|
||||||
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment
|
|
||||||
) || [];
|
|
||||||
|
|
||||||
const paymentsToUse =
|
|
||||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
|
||||||
|
|
||||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
|
||||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const totalPreviousOfferAmount = previousOrderOfferDetails?.reduce(
|
|
||||||
(acc, offer) => acc + parseFloat(offer.OfferAmount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const previousNetAmount =
|
|
||||||
(totalPreviouspayment) || 0;
|
|
||||||
|
|
||||||
|
|
||||||
let withdiscTotal =
|
let withdiscTotal =
|
||||||
Total -
|
Total -
|
||||||
((OverAllSales || 0) +
|
((OverAllSales || 0) +
|
||||||
(OverAllEstimate || 0) +
|
(OverAllEstimate || 0) +
|
||||||
(Discount > 0 ? Discount : 0));
|
(Discount > 0 ? Discount : 0));
|
||||||
|
|
||||||
const currentOrderNetAmount = formatAmount(
|
setTotalAmount(
|
||||||
withdiscTotal >= 0
|
formatAmount(
|
||||||
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
withdiscTotal >= 0
|
||||||
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
||||||
)
|
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
||||||
console.log(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount, "totalPreviouspayment")
|
)
|
||||||
|
);
|
||||||
|
|
||||||
setTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount);
|
dispatch(
|
||||||
setCurrentOrderNetAmount(currentOrderNetAmount);
|
changeSummeryTotalAmount(
|
||||||
setPreviousNetAmount(previousNetAmount);
|
formatAmount(
|
||||||
dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount));
|
withdiscTotal >= 0
|
||||||
|
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
||||||
|
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
// dispatch(
|
// dispatch(
|
||||||
// changeSummeryTotalAmount(withdiscTotal > 0 ? withdiscTotal : Number(Total))
|
// changeSummeryTotalAmount(withdiscTotal > 0 ? withdiscTotal : Number(Total))
|
||||||
// );
|
// );
|
||||||
|
|
@ -1061,25 +1016,6 @@ const StandardTablePayment = () => {
|
||||||
}
|
}
|
||||||
}, [PaymentUpiOptions, PaymentOptions, SelCustId]);
|
}, [PaymentUpiOptions, PaymentOptions, SelCustId]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
|
|
||||||
if (salesBillEdit) {
|
|
||||||
if (SelCustId) {
|
|
||||||
setRefundPayBtns(AllPaymentOptions);
|
|
||||||
setRefundPaySelected(AllPaymentOptions?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(AllPaymentOptions?.[0]?.ConfigName);
|
|
||||||
} else {
|
|
||||||
const withoutCustomer = AllPaymentOptions?.filter?.(
|
|
||||||
(item) => item?.ConfigName?.toLowerCase() !== 'credit'
|
|
||||||
);
|
|
||||||
setRefundPaySelected(withoutCustomer?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(withoutCustomer?.[0]?.ConfigName);
|
|
||||||
setRefundPayBtns(withoutCustomer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, [AllPaymentOptions, SelCustId, salesBillEdit])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
(BookingType === 'Dine In' ||
|
(BookingType === 'Dine In' ||
|
||||||
|
|
@ -1176,10 +1112,6 @@ const StandardTablePayment = () => {
|
||||||
const handleButtonClick = () => {
|
const handleButtonClick = () => {
|
||||||
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
if (qrCode && SelectedUPIPayOption === 'Default' && UpiQRPreference) {
|
||||||
UpiPayment();
|
UpiPayment();
|
||||||
} else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Please Select Refund Payment Method');
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? AddBookingDetails('Dine-In', false)
|
? AddBookingDetails('Dine-In', false)
|
||||||
|
|
@ -1558,7 +1490,7 @@ const StandardTablePayment = () => {
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
{
|
{
|
||||||
PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected :
|
PaymentType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi'
|
Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
||||||
? PaymentDeviceUPI?.[0]?.ModeId
|
? PaymentDeviceUPI?.[0]?.ModeId
|
||||||
|
|
@ -1572,14 +1504,14 @@ const StandardTablePayment = () => {
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
? paybtnselected
|
? paybtnselected
|
||||||
: null,
|
: null,
|
||||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
Amount: Math.round(TotalAmount),
|
||||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
MerchantId:
|
||||||
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: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
PaymentOptionType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -1593,7 +1525,7 @@ const StandardTablePayment = () => {
|
||||||
? 'BU'
|
? 'BU'
|
||||||
: SelectedUPIPayOption
|
: SelectedUPIPayOption
|
||||||
: null,
|
: null,
|
||||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
ModeOfPayment:
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
|
|
@ -1601,7 +1533,7 @@ const StandardTablePayment = () => {
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantUPIId
|
?.MerchantUPIId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
AccountDtl:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
|
|
@ -1618,7 +1550,7 @@ const StandardTablePayment = () => {
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
PaymentStatus:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -1627,8 +1559,8 @@ const StandardTablePayment = () => {
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
Debit: 0,
|
||||||
Credit: salesBillEdit ? (currentOrderNetAmount > previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(TotalAmount) : 0 :
|
Credit:
|
||||||
Paybtnnameselected?.toLowerCase() === 'credit'
|
Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? Math.round(TotalAmount)
|
? Math.round(TotalAmount)
|
||||||
: 0,
|
: 0,
|
||||||
|
|
@ -1861,12 +1793,7 @@ const StandardTablePayment = () => {
|
||||||
putdata['PaymentType'] = !pay && '';
|
putdata['PaymentType'] = !pay && '';
|
||||||
putdata['PrintType'] = 'Y';
|
putdata['PrintType'] = 'Y';
|
||||||
}
|
}
|
||||||
let response = null;
|
let response = await dispatch(PutBookingData(putdata)).unwrap();
|
||||||
if (salesBillEdit) {
|
|
||||||
response = await dispatch(putSalesBillEdit(putdata)).unwrap();
|
|
||||||
} else {
|
|
||||||
response = await dispatch(PutBookingData(putdata)).unwrap();
|
|
||||||
}
|
|
||||||
if (value !== 'Unpaid') {
|
if (value !== 'Unpaid') {
|
||||||
if (response?.data?.statusCode == 1) {
|
if (response?.data?.statusCode == 1) {
|
||||||
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
|
|
@ -1918,7 +1845,6 @@ const StandardTablePayment = () => {
|
||||||
if (response?.data?.OrderDetails?.length > 0) {
|
if (response?.data?.OrderDetails?.length > 0) {
|
||||||
setPrintOrderDetails([response?.data]);
|
setPrintOrderDetails([response?.data]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearAllGlobalStateDatas();
|
ClearAllGlobalStateDatas();
|
||||||
console.log('more pg data');
|
console.log('more pg data');
|
||||||
}
|
}
|
||||||
|
|
@ -1932,7 +1858,6 @@ const StandardTablePayment = () => {
|
||||||
await dispatch(changeOrderCardDetails([]));
|
await dispatch(changeOrderCardDetails([]));
|
||||||
await dispatch(changeReorderHoldDetails({}));
|
await dispatch(changeReorderHoldDetails({}));
|
||||||
await dispatch(changeReorderProductDetails([]));
|
await dispatch(changeReorderProductDetails([]));
|
||||||
|
|
||||||
setFirstPaymentclick(false);
|
setFirstPaymentclick(false);
|
||||||
if (defaultBookingType === 'Both') {
|
if (defaultBookingType === 'Both') {
|
||||||
await dispatch(changeBookingType('TakeAway'));
|
await dispatch(changeBookingType('TakeAway'));
|
||||||
|
|
@ -2034,10 +1959,6 @@ const StandardTablePayment = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSalesBillEdit = async (putdatas, value, pay) => {
|
|
||||||
console.log(putdatas, value, pay, "handleSalesBillEdit")
|
|
||||||
}
|
|
||||||
|
|
||||||
const OtherServicePostBooking = async (PostData, value) => {
|
const OtherServicePostBooking = async (PostData, value) => {
|
||||||
console.log(PostData, value, 'PostData, value');
|
console.log(PostData, value, 'PostData, value');
|
||||||
|
|
||||||
|
|
@ -2782,11 +2703,6 @@ const StandardTablePayment = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRefundPaymentMode = (id, name) => {
|
|
||||||
setRefundPaySelected(id);
|
|
||||||
setRefundPaySelectedName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
const addUpiOption = async (id, name, UPIId) => {
|
const addUpiOption = async (id, name, UPIId) => {
|
||||||
await dispatch(changeUpiIDprint(UPIId));
|
await dispatch(changeUpiIDprint(UPIId));
|
||||||
await dispatch(changeUpiIDName(name));
|
await dispatch(changeUpiIDName(name));
|
||||||
|
|
@ -2817,9 +2733,6 @@ const StandardTablePayment = () => {
|
||||||
ParkingClaimed: false,
|
ParkingClaimed: false,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
dispatch(changeTipAmount(0));
|
dispatch(changeTipAmount(0));
|
||||||
dispatch(changeFullOfferAppliedProducts([]));
|
dispatch(changeFullOfferAppliedProducts([]));
|
||||||
dispatch(ChangeFullFreeProductList([]));
|
dispatch(ChangeFullFreeProductList([]));
|
||||||
|
|
@ -2839,8 +2752,6 @@ const StandardTablePayment = () => {
|
||||||
setQrCode(false);
|
setQrCode(false);
|
||||||
setUpinotSelected(false);
|
setUpinotSelected(false);
|
||||||
getHolddata();
|
getHolddata();
|
||||||
setCurrentOrderNetAmount(0);
|
|
||||||
setPreviousNetAmount(0);
|
|
||||||
if (defaultBookingType === 'Both') {
|
if (defaultBookingType === 'Both') {
|
||||||
await dispatch(changeBookingType('TakeAway'));
|
await dispatch(changeBookingType('TakeAway'));
|
||||||
}
|
}
|
||||||
|
|
@ -2982,7 +2893,7 @@ const StandardTablePayment = () => {
|
||||||
async (orderDetail, index) => {
|
async (orderDetail, index) => {
|
||||||
await printDiv(`${selectedStyle}-${index}`, style); // Use unique IDs for each print
|
await printDiv(`${selectedStyle}-${index}`, style); // Use unique IDs for each print
|
||||||
if (orderDetail?.BookingTypeName !== 'Dine In') {
|
if (orderDetail?.BookingTypeName !== 'Dine In') {
|
||||||
const groupedTokens = orderDetail?.productDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.reduce(
|
const groupedTokens = orderDetail?.productDetails?.reduce(
|
||||||
(acc, item, idx) => {
|
(acc, item, idx) => {
|
||||||
if (item.TokenAvailable === 'Y') {
|
if (item.TokenAvailable === 'Y') {
|
||||||
if (!item.CounterName) {
|
if (!item.CounterName) {
|
||||||
|
|
@ -3027,7 +2938,7 @@ const StandardTablePayment = () => {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
PrintOrderDetails?.[0]?.OrderDetails?.map(
|
PrintOrderDetails?.[0]?.OrderDetails?.map(
|
||||||
async (orderDetail, index) => {
|
async (orderDetail, index) => {
|
||||||
const groupedTokens = orderDetail?.productDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.reduce(
|
const groupedTokens = orderDetail?.productDetails?.reduce(
|
||||||
(acc, item, idx) => {
|
(acc, item, idx) => {
|
||||||
if (item.TokenAvailable === 'Y') {
|
if (item.TokenAvailable === 'Y') {
|
||||||
if (!item.CounterName) {
|
if (!item.CounterName) {
|
||||||
|
|
@ -3063,7 +2974,7 @@ const StandardTablePayment = () => {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
PrintOrderDetails?.[0]?.OrderDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.map(
|
PrintOrderDetails?.[0]?.OrderDetails?.map(
|
||||||
async (orderDetail, index) => {
|
async (orderDetail, index) => {
|
||||||
await TokenPrint(`${index}-${orderDetail?.OrderId}`);
|
await TokenPrint(`${index}-${orderDetail?.OrderId}`);
|
||||||
}
|
}
|
||||||
|
|
@ -3277,7 +3188,7 @@ const StandardTablePayment = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const SplitPaymentOpen = () => {
|
const SplitPaymentOpen = () => {
|
||||||
if (orderCardDetail?.length > 0 && TotalAmount > 0) {
|
if (orderCardDetail?.length > 0) {
|
||||||
// const updatedData = {
|
// const updatedData = {
|
||||||
// userData: OrderCardDetail,
|
// userData: OrderCardDetail,
|
||||||
// ExtraCharges: GlobalExtraCharge,
|
// ExtraCharges: GlobalExtraCharge,
|
||||||
|
|
@ -3287,11 +3198,6 @@ const StandardTablePayment = () => {
|
||||||
// setFailedOrderData(updatedData);
|
// setFailedOrderData(updatedData);
|
||||||
setSplitpayment(true);
|
setSplitpayment(true);
|
||||||
} else {
|
} else {
|
||||||
if (TotalAmount <= 0) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Cannot split when total amount is zero or less');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
setMessageData('Please Select the Product');
|
setMessageData('Please Select the Product');
|
||||||
}
|
}
|
||||||
|
|
@ -3704,7 +3610,7 @@ const StandardTablePayment = () => {
|
||||||
opacity: isDisabled ? 0.5 : 1,
|
opacity: isDisabled ? 0.5 : 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{payBtns?.length > 0 && (currentOrderNetAmount >= previousNetAmount) ? (
|
{payBtns?.length > 0 ? (
|
||||||
payBtns.map((payment) => {
|
payBtns.map((payment) => {
|
||||||
const mode = payment?.ModeName?.toLowerCase();
|
const mode = payment?.ModeName?.toLowerCase();
|
||||||
const isSelected = paybtnselected === payment?.ModeId;
|
const isSelected = paybtnselected === payment?.ModeId;
|
||||||
|
|
@ -3794,55 +3700,6 @@ const StandardTablePayment = () => {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? (
|
|
||||||
refundPayBtns.map((payment) => {
|
|
||||||
const mode = payment?.ConfigName?.toLowerCase();
|
|
||||||
const isSelected = refundPaySelected === payment?.ConfigId;
|
|
||||||
const buttonClass = isSelected
|
|
||||||
? 'paybutton-selected'
|
|
||||||
: 'paybutton';
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="standard-pay-btns" key={payment?.ConfigId}>
|
|
||||||
<button
|
|
||||||
className={buttonClass}
|
|
||||||
style={{
|
|
||||||
// fontFamily: FontFamily['para'],
|
|
||||||
backgroundColor:
|
|
||||||
mode === 'upi'
|
|
||||||
? '#2563eb'
|
|
||||||
: mode === 'card'
|
|
||||||
? '#9333ea'
|
|
||||||
: mode === 'credit'
|
|
||||||
? '#9333ea'
|
|
||||||
: '#16a34a',
|
|
||||||
animation: blink
|
|
||||||
? 'blink-animation 0.5s infinite alternate'
|
|
||||||
: 'none',
|
|
||||||
}}
|
|
||||||
onClick={() => handleRefundPaymentMode(payment?.ConfigId, payment?.ConfigName)}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
gap: '0.5rem',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{mode === 'cash' && <FaMoneyBillWave />}
|
|
||||||
{mode === 'upi' && <FaMobileScreenButton />}
|
|
||||||
|
|
||||||
{mode === 'credit' && (
|
|
||||||
<>
|
|
||||||
<img src={Credit} alt="" width={20} />
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
{payment?.ConfigName}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
})
|
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
onClick={handlePaymentOptions}
|
onClick={handlePaymentOptions}
|
||||||
|
|
@ -3864,15 +3721,14 @@ const StandardTablePayment = () => {
|
||||||
orderCardDetail?.length > 0 &&
|
orderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus !== 'Close'
|
CheckBookingStatus !== 'Close'
|
||||||
? !OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ?
|
? !OrderStatus
|
||||||
'standard-pay-btn-refund'
|
? 'standard-pay-btn'
|
||||||
: 'standard-pay-btn'
|
|
||||||
: 'standard-pay-btn order-complete'
|
: 'standard-pay-btn order-complete'
|
||||||
: 'standard-pay-btn-disabled'
|
: 'standard-pay-btn-disabled'
|
||||||
}
|
}
|
||||||
onClick={handleButtonClick}
|
onClick={handleButtonClick}
|
||||||
>
|
>
|
||||||
{!OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ? <p>Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</p> : (
|
{!OrderStatus ? (
|
||||||
<>
|
<>
|
||||||
<p
|
<p
|
||||||
className="standard-pay-amount"
|
className="standard-pay-amount"
|
||||||
|
|
|
||||||
|
|
@ -124,16 +124,6 @@ import {
|
||||||
changeCurrentOrderId,
|
changeCurrentOrderId,
|
||||||
getCreditCustomer,
|
getCreditCustomer,
|
||||||
ChangeSelectedCustDisable,
|
ChangeSelectedCustDisable,
|
||||||
GlobalSalesBillEdit,
|
|
||||||
GlobalPreviousOrderPayment,
|
|
||||||
GlobalPreviousOrderOfferDetails,
|
|
||||||
GlobalpaymentOptionData,
|
|
||||||
getPaymentOptions,
|
|
||||||
putSalesBillEdit,
|
|
||||||
changeBillEditingMode,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
GlobalPaymentTrigger,
|
|
||||||
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js';
|
import { PrintStyleFunction } from '../../../paymentpdfPage/PrintStyleFunction.js';
|
||||||
import {
|
import {
|
||||||
|
|
@ -158,9 +148,7 @@ import {
|
||||||
} from '../../../../Features/ExteraCharges/ExtraCharges';
|
} from '../../../../Features/ExteraCharges/ExtraCharges';
|
||||||
import {
|
import {
|
||||||
getAddCustomerDetails,
|
getAddCustomerDetails,
|
||||||
getDefaultPaymentOptions,
|
|
||||||
GlobalAddCustomerDetails,
|
GlobalAddCustomerDetails,
|
||||||
ReprintDetails,
|
|
||||||
triggerCustomerRefresh,
|
triggerCustomerRefresh,
|
||||||
} from '../../../../Features/BookingScreen/Customer/addCustomer';
|
} from '../../../../Features/BookingScreen/Customer/addCustomer';
|
||||||
import BSCustomerSelect from '../UtillComponents/BSSelectCustomer.jsx';
|
import BSCustomerSelect from '../UtillComponents/BSSelectCustomer.jsx';
|
||||||
|
|
@ -245,8 +233,6 @@ import { useDateStore } from '../../../../Features/BookingScreen/BookingData/Dat
|
||||||
import { getPaymentOptionsData } from '../../../../Features/BookingScreen/BookingData/KioskBookingData.js';
|
import { getPaymentOptionsData } from '../../../../Features/BookingScreen/BookingData/KioskBookingData.js';
|
||||||
import { GlobalFreeProdList, GlobalOfferAppliedProducts, GlobalOverAllOfferAmt } from '../../../../Features/Offer/Offernew/BookingOffernew.js';
|
import { GlobalFreeProdList, GlobalOfferAppliedProducts, GlobalOverAllOfferAmt } from '../../../../Features/Offer/Offernew/BookingOffernew.js';
|
||||||
import BSNavBarTable from '../UtillComponents/BSNavBarTable.jsx';
|
import BSNavBarTable from '../UtillComponents/BSNavBarTable.jsx';
|
||||||
import pozologoimg from '../../../../Images/pozologoimg.png';
|
|
||||||
import PaymentGatewayEmbedded from '../UtillComponents/PaymentGatewayEmbedded.jsx';
|
|
||||||
|
|
||||||
const subDirectory = import.meta.env.ENV_BASE_URL;
|
const subDirectory = import.meta.env.ENV_BASE_URL;
|
||||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||||
|
|
@ -264,10 +250,6 @@ const BSC1Payment = (props) => {
|
||||||
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
|
||||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
|
||||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
|
||||||
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
|
||||||
const SessionData = useSelector(StoredSessionData);
|
const SessionData = useSelector(StoredSessionData);
|
||||||
const BranchFinancialStatus = useSelector(GlobalBranchFinancialStatus);
|
const BranchFinancialStatus = useSelector(GlobalBranchFinancialStatus);
|
||||||
const globalTipAmount = useSelector(GlobaltipAmount);
|
const globalTipAmount = useSelector(GlobaltipAmount);
|
||||||
|
|
@ -339,11 +321,6 @@ const BSC1Payment = (props) => {
|
||||||
const [UpiOption, setUpiOption] = useState('');
|
const [UpiOption, setUpiOption] = useState('');
|
||||||
const [UpiId, setUpiId] = useState();
|
const [UpiId, setUpiId] = useState();
|
||||||
const [hold, setHold] = useState(false);
|
const [hold, setHold] = useState(false);
|
||||||
const [refundPayBtns, setRefundPayBtns] = useState([]);
|
|
||||||
const [refundPaySelected, setRefundPaySelected] = useState();
|
|
||||||
const [refundPaySelectedName, setRefundPaySelectedName] = useState(null);
|
|
||||||
const [currentOrderNetAmount, setCurrentOrderNetAmount] = useState(0);
|
|
||||||
const [previousNetAmount, setPreviousNetAmount] = useState(0);
|
|
||||||
const appPreferences = useSelector(ApplicationPreferences);
|
const appPreferences = useSelector(ApplicationPreferences);
|
||||||
const commonModulePreference = appPreferences?.find(
|
const commonModulePreference = appPreferences?.find(
|
||||||
(preference) => preference?.PreferredCatName === 'Common Module'
|
(preference) => preference?.PreferredCatName === 'Common Module'
|
||||||
|
|
@ -452,14 +429,6 @@ const BSC1Payment = (props) => {
|
||||||
const [PaymentgatewayUPI, setPaymentgatewayUPI] = useState([]);
|
const [PaymentgatewayUPI, setPaymentgatewayUPI] = useState([]);
|
||||||
const [PaymentDeviceUPI, setPaymentDeviceUPI] = useState([]);
|
const [PaymentDeviceUPI, setPaymentDeviceUPI] = useState([]);
|
||||||
const [UpiPayOption, setUpiPayOption] = useState([]);
|
const [UpiPayOption, setUpiPayOption] = useState([]);
|
||||||
const [BusinessPayOption, setBusinessPayoption] = useState([]);
|
|
||||||
const [paymentSucess, setPaymentSuccess] = useState(false);
|
|
||||||
const [businessUPI, setBusinessUPI] = useState(false);
|
|
||||||
const [businessUPIOrderId, setBusinessUPIOrderId] = useState(null);
|
|
||||||
const [businessUPILink, setBusinessUPILink] = useState(null);
|
|
||||||
const defaultPaymentTrigger = useSelector(GlobalPaymentTrigger);
|
|
||||||
const [defaultPaymentMode, setDefaultPaymentMode] = useState([]);
|
|
||||||
const [defaultEnabled, setDefaultEnabled] = useState(false);
|
|
||||||
const [CardPayOption, setCardPayOption] = useState([]);
|
const [CardPayOption, setCardPayOption] = useState([]);
|
||||||
const [PaymentUpiOptions, setPaymentUpiOptions] = useState([]);
|
const [PaymentUpiOptions, setPaymentUpiOptions] = useState([]);
|
||||||
const GlobaluseOptions = useSelector(GlobalCommonPaymentOptions);
|
const GlobaluseOptions = useSelector(GlobalCommonPaymentOptions);
|
||||||
|
|
@ -492,7 +461,6 @@ const BSC1Payment = (props) => {
|
||||||
const printDatas = useSelector(GlobalprintDatas);
|
const printDatas = useSelector(GlobalprintDatas);
|
||||||
const PrinterDetails = useSelector(GlobalPrinterMappingDtls);
|
const PrinterDetails = useSelector(GlobalPrinterMappingDtls);
|
||||||
const [addnewAccess, setaddnewAccess] = useState(true);
|
const [addnewAccess, setaddnewAccess] = useState(true);
|
||||||
const [showCancelConfirm, setShowCancelConfirm] = useState(false);
|
|
||||||
const BookingStatus = useSelector(GlobalBookingStatus);
|
const BookingStatus = useSelector(GlobalBookingStatus);
|
||||||
|
|
||||||
const PaymentOptionsModeName =
|
const PaymentOptionsModeName =
|
||||||
|
|
@ -561,79 +529,6 @@ const BSC1Payment = (props) => {
|
||||||
'11111111111111'
|
'11111111111111'
|
||||||
);
|
);
|
||||||
// Usage
|
// Usage
|
||||||
useEffect(() => {
|
|
||||||
const setDefaultPaymentOption = async () => {
|
|
||||||
const res = await dispatch(
|
|
||||||
getDefaultPaymentOptions({ AppId, CompId, BranchId })
|
|
||||||
)?.unwrap();
|
|
||||||
const defaultDetail = res?.data?.data?.[0]?.DefaultDetails?.[0];
|
|
||||||
if (res?.data?.data?.length > 0 && defaultDetail) {
|
|
||||||
setDefaultEnabled(true);
|
|
||||||
setDefaultPaymentMode(defaultDetail);
|
|
||||||
const { option, card } = defaultDetail;
|
|
||||||
if (option?.value) setSelectedUPIPayOption(option.value);
|
|
||||||
if (card) {
|
|
||||||
const isDefault =
|
|
||||||
String(option?.value ?? '').toLowerCase() === 'default';
|
|
||||||
const idToUse = isDefault ? card?.UPIId : card?.ModeId;
|
|
||||||
|
|
||||||
if (idToUse) {
|
|
||||||
addUpiOption(card?.Mode, card?.ModeName, idToUse);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setDefaultEnabled(false);
|
|
||||||
setDefaultPaymentMode([]);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
setDefaultPaymentOption();
|
|
||||||
}, [defaultPaymentTrigger]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const getPrintData = async () => {
|
|
||||||
try {
|
|
||||||
const data = {
|
|
||||||
AppId,
|
|
||||||
CompId,
|
|
||||||
BranchId,
|
|
||||||
OrderId: businessUPIOrderId,
|
|
||||||
};
|
|
||||||
|
|
||||||
const res = await dispatch(ReprintDetails(data)).unwrap();
|
|
||||||
|
|
||||||
if (res?.data?.statusCode === 1 && res?.data?.data?.length > 0) {
|
|
||||||
const orderData = [{ OrderDetails: res.data.data }];
|
|
||||||
|
|
||||||
// Reset states first
|
|
||||||
setBusinessUPIOrderId(null);
|
|
||||||
setBusinessUPI(false);
|
|
||||||
setPaymentSuccess(false);
|
|
||||||
|
|
||||||
// Then set new data and trigger side effects
|
|
||||||
setPrintOrderDetails(orderData);
|
|
||||||
CustomerDisplay();
|
|
||||||
ClearAllGlobalStateDatas();
|
|
||||||
filteredSettingNames?.includes('whatsapp') &&
|
|
||||||
MobileNoWhatsApp?.value &&
|
|
||||||
handleURL(orderData);
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Failed to fetch print data:', error);
|
|
||||||
// Reset states even on error
|
|
||||||
setBusinessUPI(false);
|
|
||||||
setPaymentSuccess(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
if (paymentSucess && businessUPIOrderId) {
|
|
||||||
const timer = setTimeout(() => {
|
|
||||||
getPrintData();
|
|
||||||
}, 3000);
|
|
||||||
|
|
||||||
return () => clearTimeout(timer);
|
|
||||||
}
|
|
||||||
}, [paymentSucess, businessUPIOrderId, AppId, CompId, BranchId, dispatch]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchCreditCustomer = async () => {
|
const fetchCreditCustomer = async () => {
|
||||||
const selectedMode = paybtns?.find(
|
const selectedMode = paybtns?.find(
|
||||||
|
|
@ -672,32 +567,6 @@ const BSC1Payment = (props) => {
|
||||||
|
|
||||||
fetchCreditCustomer();
|
fetchCreditCustomer();
|
||||||
}, [paybtnselected, selOption, paybtns]);
|
}, [paybtnselected, selOption, paybtns]);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (salesBillEdit) {
|
|
||||||
dispatch(getPaymentOptions()).unwrap();
|
|
||||||
}
|
|
||||||
}, [salesBillEdit]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
|
|
||||||
if (salesBillEdit) {
|
|
||||||
if (SelCustId) {
|
|
||||||
setRefundPayBtns(AllPaymentOptions);
|
|
||||||
setRefundPaySelected(AllPaymentOptions?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(AllPaymentOptions?.[0]?.ConfigName);
|
|
||||||
} else {
|
|
||||||
const withoutCustomer = AllPaymentOptions?.filter?.(
|
|
||||||
(item) => item?.ConfigName?.toLowerCase() !== 'credit'
|
|
||||||
);
|
|
||||||
setRefundPaySelected(withoutCustomer?.[0]?.ConfigId);
|
|
||||||
setRefundPaySelectedName(withoutCustomer?.[0]?.ConfigName);
|
|
||||||
setRefundPayBtns(withoutCustomer);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}, [AllPaymentOptions, SelCustId, salesBillEdit])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!preOrder) {
|
if (!preOrder) {
|
||||||
const totalSum = OrderCardDetail?.reduce(
|
const totalSum = OrderCardDetail?.reduce(
|
||||||
|
|
@ -755,41 +624,22 @@ const BSC1Payment = (props) => {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredPayments =
|
|
||||||
previousOrderPayment?.filter(
|
|
||||||
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment
|
|
||||||
) || [];
|
|
||||||
|
|
||||||
const paymentsToUse =
|
|
||||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
|
||||||
|
|
||||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
|
||||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const totalPreviousOfferAmount = previousOrderOfferDetails?.reduce(
|
|
||||||
(acc, offer) => acc + parseFloat(offer.OfferAmount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
const previousNetAmount =
|
|
||||||
(totalPreviouspayment) || 0;
|
|
||||||
|
|
||||||
let withdiscTotal =
|
let withdiscTotal =
|
||||||
Total - ((OverAllSales || 0) + (OverAllEstimate || 0) +
|
Total - ((OverAllSales || 0) + (OverAllEstimate || 0) +
|
||||||
(Discount > 0 ? Discount : 0));
|
(Discount > 0 ? Discount : 0));
|
||||||
|
|
||||||
const currentOrderNetAmount = formatAmount(
|
|
||||||
|
setTotalAmount(
|
||||||
withdiscTotal >= 0
|
withdiscTotal >= 0
|
||||||
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
? (Number(withdiscTotal) + Number(globalTipAmount)).toFixed(2)
|
||||||
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
: (Number(Total) + Number(globalTipAmount)).toFixed(2)
|
||||||
)
|
);
|
||||||
|
|
||||||
setTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount);
|
dispatch(
|
||||||
setCurrentOrderNetAmount(currentOrderNetAmount);
|
changeSummeryTotalAmount(
|
||||||
setPreviousNetAmount(previousNetAmount);
|
withdiscTotal > 0 ? withdiscTotal : Number(Total)
|
||||||
dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount));
|
)
|
||||||
|
);
|
||||||
|
|
||||||
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
||||||
|
|
||||||
|
|
@ -1230,10 +1080,6 @@ const BSC1Payment = (props) => {
|
||||||
const handleButtonClick = () => {
|
const handleButtonClick = () => {
|
||||||
if (qrCode && SelectedUPIPayOption === 'Default') {
|
if (qrCode && SelectedUPIPayOption === 'Default') {
|
||||||
UpiPayment();
|
UpiPayment();
|
||||||
} else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Please Select Refund Payment Method');
|
|
||||||
return;
|
|
||||||
} else {
|
} else {
|
||||||
OrderStatus
|
OrderStatus
|
||||||
? AddBookingDetails('Dine-In', false)
|
? AddBookingDetails('Dine-In', false)
|
||||||
|
|
@ -1309,9 +1155,6 @@ const BSC1Payment = (props) => {
|
||||||
const filterpaymentdevice = FiltersalesPayment?.[0]?.OptionDetails?.filter(
|
const filterpaymentdevice = FiltersalesPayment?.[0]?.OptionDetails?.filter(
|
||||||
(item) => item?.OptionName?.toLowerCase() === 'payment device'
|
(item) => item?.OptionName?.toLowerCase() === 'payment device'
|
||||||
);
|
);
|
||||||
const filterBusinessUpi = FiltersalesPayment?.[0]?.OptionDetails?.filter(
|
|
||||||
(item) => item?.OptionName?.toLowerCase() === 'business upi'
|
|
||||||
);
|
|
||||||
const cardinpaymentgateway =
|
const cardinpaymentgateway =
|
||||||
filterpaymentgateway?.[0]?.ModeDetails?.filter((item) =>
|
filterpaymentgateway?.[0]?.ModeDetails?.filter((item) =>
|
||||||
item?.ModeName?.toLowerCase()?.includes('card')
|
item?.ModeName?.toLowerCase()?.includes('card')
|
||||||
|
|
@ -1354,6 +1197,7 @@ const BSC1Payment = (props) => {
|
||||||
}
|
}
|
||||||
setCardPayOption(cardoptions);
|
setCardPayOption(cardoptions);
|
||||||
const options = [];
|
const options = [];
|
||||||
|
|
||||||
if (FiltersalesPayment?.[0]?.PaymentDetails?.Payatthecounter?.length > 0) {
|
if (FiltersalesPayment?.[0]?.PaymentDetails?.Payatthecounter?.length > 0) {
|
||||||
options.push({
|
options.push({
|
||||||
label: 'Personal UPI',
|
label: 'Personal UPI',
|
||||||
|
|
@ -1361,16 +1205,6 @@ const BSC1Payment = (props) => {
|
||||||
imgSrc: defaultupi,
|
imgSrc: defaultupi,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (filterBusinessUpi?.[0]?.ModeDetails?.length > 0) {
|
|
||||||
options.push({
|
|
||||||
label: 'Business UPI',
|
|
||||||
value: 'Business',
|
|
||||||
imgSrc: pozologoimg,
|
|
||||||
PaymentOptionId: filterBusinessUpi?.[0]?.PaymentOptionId,
|
|
||||||
PaymentFlowId: filterBusinessUpi?.[0]?.PaymentFlowId,
|
|
||||||
OptionId: filterBusinessUpi?.[0]?.OptionId,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (upiinpaymentgateway?.length > 0) {
|
if (upiinpaymentgateway?.length > 0) {
|
||||||
options.push({ label: 'Payment Gateway', value: 'PG', imgSrc: paygate });
|
options.push({ label: 'Payment Gateway', value: 'PG', imgSrc: paygate });
|
||||||
|
|
@ -1380,7 +1214,6 @@ const BSC1Payment = (props) => {
|
||||||
options.push({ label: 'Payment Device', value: 'PD', imgSrc: paydevice });
|
options.push({ label: 'Payment Device', value: 'PD', imgSrc: paydevice });
|
||||||
}
|
}
|
||||||
setUpiPayOption(options);
|
setUpiPayOption(options);
|
||||||
setBusinessPayoption(filterBusinessUpi?.[0]?.ModeDetails || []);
|
|
||||||
// }
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1419,17 +1252,12 @@ const BSC1Payment = (props) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleRefundPaymentMode = (id, name) => {
|
|
||||||
setRefundPaySelected(id);
|
|
||||||
setRefundPaySelectedName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
const AddCardOption = (data) => {
|
const AddCardOption = (data) => {
|
||||||
setSelectedCardOption(data);
|
setSelectedCardOption(data);
|
||||||
setCardOptionOpen(false);
|
setCardOptionOpen(false);
|
||||||
setCardoptionnotSelected(false);
|
setCardoptionnotSelected(false);
|
||||||
};
|
};
|
||||||
const AddUPIPaymentOption = async (data, mode = false) => {
|
const AddUPIPaymentOption = async (data) => {
|
||||||
setSelectedUpiOption('');
|
setSelectedUpiOption('');
|
||||||
setUpiOption('');
|
setUpiOption('');
|
||||||
setUpiId('');
|
setUpiId('');
|
||||||
|
|
@ -1439,7 +1267,7 @@ const BSC1Payment = (props) => {
|
||||||
setSelectedUPIPayOption(data);
|
setSelectedUPIPayOption(data);
|
||||||
setUpinotSelected(false);
|
setUpinotSelected(false);
|
||||||
setCardoptionnotSelected(false);
|
setCardoptionnotSelected(false);
|
||||||
if (data !== 'Default' && data !== 'Business' && !mode) {
|
if (data !== 'Default') {
|
||||||
setUpiOptionOpen(false);
|
setUpiOptionOpen(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -1819,18 +1647,6 @@ const BSC1Payment = (props) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const businessUPIFlow = async (
|
|
||||||
businessUPIfilter,
|
|
||||||
OrderId,
|
|
||||||
PaymentStatusLink
|
|
||||||
) => {
|
|
||||||
// Implement your business UPI flow here
|
|
||||||
// You can add similar logic as PaymentDeviceFlow or PaymentGatewayFlow based on your requirements
|
|
||||||
setBusinessUPILink(PaymentStatusLink);
|
|
||||||
setBusinessUPI(true);
|
|
||||||
setBusinessUPIOrderId(OrderId);
|
|
||||||
};
|
|
||||||
|
|
||||||
function safeRound(amountStr) {
|
function safeRound(amountStr) {
|
||||||
if (amountStr == null) return '0.00';
|
if (amountStr == null) return '0.00';
|
||||||
|
|
||||||
|
|
@ -1978,9 +1794,6 @@ const BSC1Payment = (props) => {
|
||||||
} else {
|
} else {
|
||||||
dispatch(changeOrderCardDetails([]));
|
dispatch(changeOrderCardDetails([]));
|
||||||
}
|
}
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
dispatch(changeTipAmount(0));
|
dispatch(changeTipAmount(0));
|
||||||
await dispatch(ChangeTotalAmount([]));
|
await dispatch(ChangeTotalAmount([]));
|
||||||
await dispatch(changeReorderHoldDetails({}));
|
await dispatch(changeReorderHoldDetails({}));
|
||||||
|
|
@ -1994,8 +1807,6 @@ const BSC1Payment = (props) => {
|
||||||
setPaybtnselected(PaymentOptionsModeId);
|
setPaybtnselected(PaymentOptionsModeId);
|
||||||
setQrCode(false);
|
setQrCode(false);
|
||||||
setUpinotSelected(false);
|
setUpinotSelected(false);
|
||||||
setCurrentOrderNetAmount(0);
|
|
||||||
setPreviousNetAmount(0);
|
|
||||||
getHolddata();
|
getHolddata();
|
||||||
getUnpaiddatas();
|
getUnpaiddatas();
|
||||||
await dispatch(changeBookingType('TakeAway'));
|
await dispatch(changeBookingType('TakeAway'));
|
||||||
|
|
@ -2032,8 +1843,7 @@ const BSC1Payment = (props) => {
|
||||||
);
|
);
|
||||||
if (
|
if (
|
||||||
OnUpiSelected?.ModeName?.toLowerCase() === 'upi' &&
|
OnUpiSelected?.ModeName?.toLowerCase() === 'upi' &&
|
||||||
(SelectedUPIPayOption?.toLowerCase() === 'default' ||
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'business')
|
|
||||||
) {
|
) {
|
||||||
SetSuccess(false);
|
SetSuccess(false);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
|
@ -2286,28 +2096,19 @@ const BSC1Payment = (props) => {
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
{
|
{
|
||||||
PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected :
|
PaymentType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi'
|
Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
||||||
? PaymentDeviceUPI?.[0]?.ModeId
|
? PaymentDeviceUPI?.[0]?.ModeId
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'pg'
|
: SelectedUPIPayOption?.toLowerCase() === 'pg'
|
||||||
? PaymentgatewayUPI?.[0]?.ModeId
|
? PaymentgatewayUPI?.[0]?.ModeId
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
: paybtnselected
|
||||||
? BusinessPayOption?.find(
|
|
||||||
(busupi) => busupi?.ModeId === UpiId
|
|
||||||
)?.ModeId
|
|
||||||
: paybtnselected
|
|
||||||
: paybtnselected
|
: paybtnselected
|
||||||
? paybtnselected
|
? paybtnselected
|
||||||
: null,
|
: null,
|
||||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
// SelectedUPIPayOption?.toLowerCase() === "pg" ?
|
||||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
Amount: Math.round(TotalAmount),
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
PaymentOptionType:
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
|
||||||
?.MerchantId
|
|
||||||
: null,
|
|
||||||
PaymentOptionType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2317,19 +2118,14 @@ const BSC1Payment = (props) => {
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi'
|
: Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'default'
|
? SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
: SelectedUPIPayOption
|
||||||
? 'BU'
|
|
||||||
: SelectedUPIPayOption
|
|
||||||
: null,
|
: null,
|
||||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
ModeOfPayment:
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
?.UPIDetailId
|
?.UPIDetailId
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
: null,
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
AccountDtl:
|
||||||
?.MerchantUPIId
|
|
||||||
: null,
|
|
||||||
AccountDtl: (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(
|
||||||
|
|
@ -2346,7 +2142,7 @@ const BSC1Payment = (props) => {
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
PaymentStatus:
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
? 'S'
|
? 'S'
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
|
|
@ -2355,8 +2151,8 @@ const BSC1Payment = (props) => {
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
Debit: 0,
|
||||||
Credit: salesBillEdit ? (currentOrderNetAmount > previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(TotalAmount) : 0 :
|
Credit:
|
||||||
Paybtnnameselected?.toLowerCase() === 'credit'
|
Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? Math.round(TotalAmount)
|
? Math.round(TotalAmount)
|
||||||
: 0,
|
: 0,
|
||||||
|
|
@ -2410,11 +2206,6 @@ const BSC1Payment = (props) => {
|
||||||
let PayatCounterfilter = response?.data?.PaymentOrderDtl?.filter(
|
let PayatCounterfilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
(item) => item?.PaymentOptionType?.toLowerCase() === 'pc'
|
(item) => item?.PaymentOptionType?.toLowerCase() === 'pc'
|
||||||
);
|
);
|
||||||
let businessUPIfilter = response?.data?.PaymentOrderDtl?.filter(
|
|
||||||
(item) =>
|
|
||||||
item?.PaymentOptionType?.toLowerCase() === 'bu' &&
|
|
||||||
item?.PaymentStatus === 'P'
|
|
||||||
);
|
|
||||||
if (
|
if (
|
||||||
PayatCounterfilter?.length === 1 ||
|
PayatCounterfilter?.length === 1 ||
|
||||||
response?.data?.PaymentOrderDtl?.length === 0
|
response?.data?.PaymentOrderDtl?.length === 0
|
||||||
|
|
@ -2519,13 +2310,6 @@ const BSC1Payment = (props) => {
|
||||||
} else {
|
} else {
|
||||||
console.log('more pg data');
|
console.log('more pg data');
|
||||||
}
|
}
|
||||||
if (businessUPIfilter?.length === 1) {
|
|
||||||
businessUPIFlow(
|
|
||||||
businessUPIfilter,
|
|
||||||
response?.data?.OrderId,
|
|
||||||
response?.data?.PaymentPageLink
|
|
||||||
);
|
|
||||||
}
|
|
||||||
dispatch(triggerCustomerRefresh());
|
dispatch(triggerCustomerRefresh());
|
||||||
} else {
|
} else {
|
||||||
setMessageType('error');
|
setMessageType('error');
|
||||||
|
|
@ -2557,16 +2341,10 @@ const BSC1Payment = (props) => {
|
||||||
putdata['PaymentType'] = !pay && '';
|
putdata['PaymentType'] = !pay && '';
|
||||||
putdata['PrintType'] = 'Y';
|
putdata['PrintType'] = 'Y';
|
||||||
}
|
}
|
||||||
let response = null;
|
let response = await dispatch(PutBookingData(putdata)).unwrap();
|
||||||
if (salesBillEdit) {
|
|
||||||
response = await dispatch(putSalesBillEdit(putdata)).unwrap();
|
|
||||||
} else {
|
|
||||||
response = await dispatch(PutBookingData(putdata)).unwrap();
|
|
||||||
}
|
|
||||||
let PayatCounterfilter = response?.data?.PaymentOrderDtl?.filter(
|
let PayatCounterfilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
(item) => item?.PaymentOptionType?.toLowerCase() === 'pc'
|
(item) => item?.PaymentOptionType?.toLowerCase() === 'pc'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (value !== 'Unpaid') {
|
if (value !== 'Unpaid') {
|
||||||
if (response?.data?.statusCode == 1) {
|
if (response?.data?.statusCode == 1) {
|
||||||
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
|
|
@ -2580,7 +2358,8 @@ const BSC1Payment = (props) => {
|
||||||
item?.PaymentStatus === 'P'
|
item?.PaymentStatus === 'P'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (PayatCounterfilter?.length === 1 ||
|
if (
|
||||||
|
PayatCounterfilter?.length === 1 ||
|
||||||
response?.data?.PaymentOrderDtl?.length === 0
|
response?.data?.PaymentOrderDtl?.length === 0
|
||||||
) {
|
) {
|
||||||
setMessageType('success');
|
setMessageType('success');
|
||||||
|
|
@ -2612,8 +2391,6 @@ const BSC1Payment = (props) => {
|
||||||
if (PaymentGatewayfilter?.length === 1) {
|
if (PaymentGatewayfilter?.length === 1) {
|
||||||
await PaymentGatewayFlow(PaymentGatewayfilter);
|
await PaymentGatewayFlow(PaymentGatewayfilter);
|
||||||
} else {
|
} else {
|
||||||
setPrintOrderDetails([response?.data]);
|
|
||||||
ClearAllGlobalStateDatas();
|
|
||||||
console.log('more pg data');
|
console.log('more pg data');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -3307,7 +3084,7 @@ const BSC1Payment = (props) => {
|
||||||
};
|
};
|
||||||
// split payments
|
// split payments
|
||||||
const SplitPaymentOpen = () => {
|
const SplitPaymentOpen = () => {
|
||||||
if (OrderCardDetail?.length > 0 && TotalAmount > 0) {
|
if (OrderCardDetail?.length > 0) {
|
||||||
const updatedData = {
|
const updatedData = {
|
||||||
userData: OrderCardDetail,
|
userData: OrderCardDetail,
|
||||||
ExtraCharges: GlobalExtraCharge,
|
ExtraCharges: GlobalExtraCharge,
|
||||||
|
|
@ -3317,11 +3094,6 @@ const BSC1Payment = (props) => {
|
||||||
setFailedOrderData(updatedData);
|
setFailedOrderData(updatedData);
|
||||||
setSplitpayment(true);
|
setSplitpayment(true);
|
||||||
} else {
|
} else {
|
||||||
if (TotalAmount <= 0) {
|
|
||||||
setMessageType('warning');
|
|
||||||
setMessageData('Cannot split when total amount is zero or less');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
setMessageData('Please Select the Product');
|
setMessageData('Please Select the Product');
|
||||||
}
|
}
|
||||||
|
|
@ -3859,7 +3631,7 @@ const BSC1Payment = (props) => {
|
||||||
: 1,
|
: 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{paybtns?.length > 0 && (currentOrderNetAmount >= previousNetAmount) ? (
|
{paybtns?.length > 0 ? (
|
||||||
paybtns?.map((payment) => (
|
paybtns?.map((payment) => (
|
||||||
<div className="Table3-cash">
|
<div className="Table3-cash">
|
||||||
<button
|
<button
|
||||||
|
|
@ -3908,9 +3680,6 @@ const BSC1Payment = (props) => {
|
||||||
)}
|
)}
|
||||||
{payment?.ModeName?.toLowerCase() === 'upi' && (
|
{payment?.ModeName?.toLowerCase() === 'upi' && (
|
||||||
<UpiPopover
|
<UpiPopover
|
||||||
defaultPaymentMode={defaultPaymentMode}
|
|
||||||
defaultEnabled={defaultEnabled}
|
|
||||||
setDefaultEnabled={setDefaultEnabled}
|
|
||||||
UpiOptionOpen={UpiOptionOpen}
|
UpiOptionOpen={UpiOptionOpen}
|
||||||
UpiPayOption={UpiPayOption}
|
UpiPayOption={UpiPayOption}
|
||||||
SelectedUPIPayOption={SelectedUPIPayOption}
|
SelectedUPIPayOption={SelectedUPIPayOption}
|
||||||
|
|
@ -3918,7 +3687,6 @@ const BSC1Payment = (props) => {
|
||||||
PaymentUpiOptions={PaymentUpiOptions}
|
PaymentUpiOptions={PaymentUpiOptions}
|
||||||
UpiOption={UpiOption}
|
UpiOption={UpiOption}
|
||||||
UpiId={UpiId}
|
UpiId={UpiId}
|
||||||
BusinessPayOption={BusinessPayOption}
|
|
||||||
paygate={paygate}
|
paygate={paygate}
|
||||||
paydevice={paydevice}
|
paydevice={paydevice}
|
||||||
EnableUpiOptions={EnableUpiOptions}
|
EnableUpiOptions={EnableUpiOptions}
|
||||||
|
|
@ -3933,41 +3701,6 @@ const BSC1Payment = (props) => {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? (
|
|
||||||
refundPayBtns.map((payment) => (
|
|
||||||
<div className="Table3-cash">
|
|
||||||
<button
|
|
||||||
className={
|
|
||||||
refundPaySelected === payment.ConfigId &&
|
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode-notupisel'
|
|
||||||
: refundPaySelected === payment.ConfigId &&
|
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
|
||||||
? 'Btn-payment-mode'
|
|
||||||
: 'Btn-payment-mode-sel'
|
|
||||||
}
|
|
||||||
style={{
|
|
||||||
position: 'relative',
|
|
||||||
animation: blink
|
|
||||||
? 'blink-animation 0.5s infinite alternate'
|
|
||||||
: 'none',
|
|
||||||
}}
|
|
||||||
onClick={() => handleRefundPaymentMode(payment?.ConfigId, payment?.ConfigName)}
|
|
||||||
>
|
|
||||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
|
||||||
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
flexDirection: 'row',
|
|
||||||
columnGap: '0.5rem',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{payment.ConfigName}
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
))
|
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
onClick={handlepaymentoptions}
|
onClick={handlepaymentoptions}
|
||||||
|
|
@ -4498,9 +4231,8 @@ const BSC1Payment = (props) => {
|
||||||
OrderCardDetail?.length > 0 &&
|
OrderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus != 'Close'
|
CheckBookingStatus != 'Close'
|
||||||
? !OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ?
|
? !OrderStatus
|
||||||
'BSC1Payment-div4-button'
|
? 'BSC1Payment-div4-button'
|
||||||
: 'BSC1Payment-div4-button'
|
|
||||||
: 'BSC1Payment-div4-button Order'
|
: 'BSC1Payment-div4-button Order'
|
||||||
: 'BSC1Payment-div4-button-disable'
|
: 'BSC1Payment-div4-button-disable'
|
||||||
}
|
}
|
||||||
|
|
@ -4510,7 +4242,7 @@ const BSC1Payment = (props) => {
|
||||||
onClick={handleButtonClick}
|
onClick={handleButtonClick}
|
||||||
style={{ borderRadius: '6px 0 0 6px' }}
|
style={{ borderRadius: '6px 0 0 6px' }}
|
||||||
>
|
>
|
||||||
{!OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ? <div className="Table4-Order">Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</div> : (
|
{!OrderStatus ? (
|
||||||
<>
|
<>
|
||||||
{isMobile ? (
|
{isMobile ? (
|
||||||
`₹ ${safeRound(
|
`₹ ${safeRound(
|
||||||
|
|
@ -4759,10 +4491,7 @@ const BSC1Payment = (props) => {
|
||||||
SplitPaymentModal={Splitpayment}
|
SplitPaymentModal={Splitpayment}
|
||||||
handlesplitpaymentclose={handlesplitpaymentclose}
|
handlesplitpaymentclose={handlesplitpaymentclose}
|
||||||
TotalNetAmount={
|
TotalNetAmount={
|
||||||
OrderType === 'Failed' ? FailedTotalAmt : Math.round(OrderCardDetail?.reduce((acc, data) => data?.TotalAmt + acc, 0) -
|
OrderType === 'Failed' ? FailedTotalAmt : Math.round(TotalAmount)
|
||||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
|
||||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
|
||||||
(Discount > 0 ? Discount : 0)))
|
|
||||||
}
|
}
|
||||||
failedOrderData={failedOrderData}
|
failedOrderData={failedOrderData}
|
||||||
/>
|
/>
|
||||||
|
|
@ -4840,43 +4569,6 @@ const BSC1Payment = (props) => {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<DefaultModal
|
|
||||||
open={businessUPI}
|
|
||||||
handleCancel={() => setShowCancelConfirm(true)}
|
|
||||||
footer={false}
|
|
||||||
width={500}
|
|
||||||
children={
|
|
||||||
<>
|
|
||||||
<PaymentGatewayEmbedded
|
|
||||||
orderId={businessUPIOrderId}
|
|
||||||
setBusinessUPIOrderId={setBusinessUPIOrderId}
|
|
||||||
businessUPILink={businessUPILink}
|
|
||||||
setBusinessUPI={setBusinessUPI}
|
|
||||||
setPaymentSuccess={setPaymentSuccess}
|
|
||||||
paymentSucess={paymentSucess}
|
|
||||||
ClearAllGlobalStateDatas={ClearAllGlobalStateDatas}
|
|
||||||
CustomerDisplay={CustomerDisplay}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
{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>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2432,9 +2432,7 @@ const BSItemCard = (props) => {
|
||||||
const isItemInCartHold = CartOrderDetails?.find(
|
const isItemInCartHold = CartOrderDetails?.find(
|
||||||
(cartItem) =>
|
(cartItem) =>
|
||||||
itemMatchCondition(cartItem) &&
|
itemMatchCondition(cartItem) &&
|
||||||
((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
(cartItem?.OfferMode !== 'B' &&
|
||||||
? true
|
|
||||||
: cartItem?.OfferMode !== 'B') &&
|
|
||||||
cartItem?.OfferMode !== 'P' && cartItem?.OfferMode !== 'C' &&
|
cartItem?.OfferMode !== 'P' && cartItem?.OfferMode !== 'C' &&
|
||||||
cartItem?.OfferMode !== 'O' &&
|
cartItem?.OfferMode !== 'O' &&
|
||||||
cartItem?.OfferMode !== 'L'
|
cartItem?.OfferMode !== 'L'
|
||||||
|
|
@ -2463,9 +2461,7 @@ const BSItemCard = (props) => {
|
||||||
(cartItem) =>
|
(cartItem) =>
|
||||||
!(
|
!(
|
||||||
itemMatchCondition(cartItem) &&
|
itemMatchCondition(cartItem) &&
|
||||||
((cartItem?.OfferModeType && cartItem?.OfferMode === 'B'
|
(cartItem?.OfferMode !== 'B' &&
|
||||||
? true
|
|
||||||
: cartItem?.OfferMode !== 'B') &&
|
|
||||||
cartItem?.OfferMode !== 'P' && cartItem?.OfferMode !== 'C' &&
|
cartItem?.OfferMode !== 'P' && cartItem?.OfferMode !== 'C' &&
|
||||||
cartItem?.OfferMode !== 'O' &&
|
cartItem?.OfferMode !== 'O' &&
|
||||||
cartItem?.OfferMode !== 'L'
|
cartItem?.OfferMode !== 'L'
|
||||||
|
|
@ -2869,6 +2865,7 @@ const BSItemCard = (props) => {
|
||||||
OfferId: offer?.OfferId || '',
|
OfferId: offer?.OfferId || '',
|
||||||
OfferAmount: change?.discount || 0,
|
OfferAmount: change?.discount || 0,
|
||||||
OfferType: offer?.OfferType || '', // I / Q / B
|
OfferType: offer?.OfferType || '', // I / Q / B
|
||||||
|
OfferCode: PromoCodeOffersDatas?.OfferCode,
|
||||||
ActualOfferAmount: offer?.OfferAmt || 0,
|
ActualOfferAmount: offer?.OfferAmt || 0,
|
||||||
OfferValue: offer?.OfferAmt || 0,
|
OfferValue: offer?.OfferAmt || 0,
|
||||||
TableName: change?.TableName || '',
|
TableName: change?.TableName || '',
|
||||||
|
|
@ -2876,7 +2873,7 @@ const BSItemCard = (props) => {
|
||||||
TableUniqueId: change?.TableUniqueId || '',
|
TableUniqueId: change?.TableUniqueId || '',
|
||||||
// OfferType: offer?.ValueType || "", // F / P
|
// OfferType: offer?.ValueType || "", // F / P
|
||||||
Detail: offer?.Detail || [],
|
Detail: offer?.Detail || [],
|
||||||
OfferCode: offer?.OfferCode || PromoCodeOffersDatas?.OfferCode || '',
|
OfferCode: offer?.OfferCode || '',
|
||||||
CustId: offer?.CustId || '',
|
CustId: offer?.CustId || '',
|
||||||
UsedCount: offer?.UsedCount || 0,
|
UsedCount: offer?.UsedCount || 0,
|
||||||
AppliesTo: offer?.AppliesTo || '',
|
AppliesTo: offer?.AppliesTo || '',
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ import { MdHome, MdLocationOn } from 'react-icons/md';
|
||||||
import { RadioGrpButton } from '../../../../Components/Forms/RadioGroup.jsx';
|
import { RadioGrpButton } from '../../../../Components/Forms/RadioGroup.jsx';
|
||||||
|
|
||||||
const FeaturesFunctionalities = (props) => {
|
const FeaturesFunctionalities = (props) => {
|
||||||
const { closeModal = () => { } } = props;
|
const { closeModal = () => {} } = props;
|
||||||
const applyOffer = useApplyOfferto_CardDetail();
|
const applyOffer = useApplyOfferto_CardDetail();
|
||||||
const EditableContext = React.createContext(null);
|
const EditableContext = React.createContext(null);
|
||||||
const EditableContext1 = React.createContext(null);
|
const EditableContext1 = React.createContext(null);
|
||||||
|
|
@ -367,30 +367,30 @@ const FeaturesFunctionalities = (props) => {
|
||||||
|
|
||||||
const options = suggestions
|
const options = suggestions
|
||||||
? suggestions
|
? suggestions
|
||||||
?.filter((item) =>
|
?.filter((item) =>
|
||||||
selectedSearchValue === 'CustName' ? item.CustName !== null : item
|
selectedSearchValue === 'CustName' ? item.CustName !== null : item
|
||||||
)
|
)
|
||||||
.map((item) => ({
|
.map((item) => ({
|
||||||
value: item?.CustMobile,
|
value: item?.CustMobile,
|
||||||
label:
|
label:
|
||||||
selectedSearchValue === 'CustMobile'
|
selectedSearchValue === 'CustMobile'
|
||||||
? `${item?.CustMobile} - ${item?.CustName ? item?.CustName : ''} ${item?.CustName ? ' - ' : ''} ${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}`
|
? `${item?.CustMobile} - ${item?.CustName ? item?.CustName : ''} ${item?.CustName ? ' - ' : ''} ${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}`
|
||||||
: selectedSearchValue === 'CustId'
|
: selectedSearchValue === 'CustId'
|
||||||
? `${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}${item?.CustName ? ' - ' : ''} ${item?.CustName ? item?.CustName : ''} - ${item?.CustMobile}`
|
? `${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}${item?.CustName ? ' - ' : ''} ${item?.CustName ? item?.CustName : ''} - ${item?.CustMobile}`
|
||||||
: selectedSearchValue === 'CustName' &&
|
: selectedSearchValue === 'CustName' &&
|
||||||
item?.CustName !== null &&
|
item?.CustName !== null &&
|
||||||
`${item?.CustName ? item?.CustName : ''} ${item?.CustName ? ' - ' : ''} ${item?.CustMobile} - ${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}`,
|
`${item?.CustName ? item?.CustName : ''} ${item?.CustName ? ' - ' : ''} ${item?.CustMobile} - ${'Id:' + item?.CustId?.match(/-(\d+)$/)?.[1]}`,
|
||||||
CustMobile: item?.CustMobile,
|
CustMobile: item?.CustMobile,
|
||||||
CustId: item?.CustId?.match(/-(\d+)$/)?.[1],
|
CustId: item?.CustId?.match(/-(\d+)$/)?.[1],
|
||||||
CustName: item?.CustName,
|
CustName: item?.CustName,
|
||||||
}))
|
}))
|
||||||
: GlobalAddCustomerDetails1?.map((item) => ({
|
: GlobalAddCustomerDetails1?.map((item) => ({
|
||||||
value: item.CustMobile,
|
value: item.CustMobile,
|
||||||
label: `${item?.CustName} ${item?.CustMobile}`,
|
label: `${item?.CustName} ${item?.CustMobile}`,
|
||||||
CustMobile: item?.CustMobile,
|
CustMobile: item?.CustMobile,
|
||||||
CustId: item?.CustId,
|
CustId: item?.CustId,
|
||||||
CustName: item?.CustName,
|
CustName: item?.CustName,
|
||||||
}));
|
}));
|
||||||
const handleYesOrNoChange = (value) => {
|
const handleYesOrNoChange = (value) => {
|
||||||
setSelectedValue(value);
|
setSelectedValue(value);
|
||||||
formRef.current?.setFieldsValue({ OfferActiveStatus: value });
|
formRef.current?.setFieldsValue({ OfferActiveStatus: value });
|
||||||
|
|
@ -453,34 +453,34 @@ const FeaturesFunctionalities = (props) => {
|
||||||
},
|
},
|
||||||
...(sportsAppPreference
|
...(sportsAppPreference
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
title: 'Subcategory',
|
title: 'Subcategory',
|
||||||
key: 'productDetails',
|
key: 'productDetails',
|
||||||
dataIndex: 'productDetails',
|
dataIndex: 'productDetails',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: '150px',
|
width: '150px',
|
||||||
onCell: (record) => {
|
onCell: (record) => {
|
||||||
const productDetails = record?.productDetails;
|
const productDetails = record?.productDetails;
|
||||||
const Combodtl =
|
const Combodtl =
|
||||||
record?.productDetails?.[0]?.comboDtl?.[0]
|
record?.productDetails?.[0]?.comboDtl?.[0]
|
||||||
?.ComboInwardDetails?.[0]?.ComboDetails;
|
?.ComboInwardDetails?.[0]?.ComboDetails;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
HoldPutfun(productDetails, record, Combodtl);
|
HoldPutfun(productDetails, record, Combodtl);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
},
|
||||||
|
render: (productDetails, record) => (
|
||||||
|
<a
|
||||||
|
style={{ color: 'black' }}
|
||||||
|
onClick={() => HoldPutfun(productDetails, record)}
|
||||||
|
>
|
||||||
|
{record?.productDetails?.[0]?.ProdSubCatName}
|
||||||
|
</a>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
render: (productDetails, record) => (
|
]
|
||||||
<a
|
|
||||||
style={{ color: 'black' }}
|
|
||||||
onClick={() => HoldPutfun(productDetails, record)}
|
|
||||||
>
|
|
||||||
{record?.productDetails?.[0]?.ProdSubCatName}
|
|
||||||
</a>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
: []),
|
||||||
{
|
{
|
||||||
title: 'Orders',
|
title: 'Orders',
|
||||||
|
|
@ -758,7 +758,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
TaxAmt: formatAmount(
|
TaxAmt: formatAmount(
|
||||||
((record.Price * record.TaxPercentage) /
|
((record.Price * record.TaxPercentage) /
|
||||||
(100 + record.TaxPercentage)) *
|
(100 + record.TaxPercentage)) *
|
||||||
record.QTY
|
record.QTY
|
||||||
),
|
),
|
||||||
TaxId: record.TaxId,
|
TaxId: record.TaxId,
|
||||||
TaxPercentage: record.TaxPercentage,
|
TaxPercentage: record.TaxPercentage,
|
||||||
|
|
@ -785,11 +785,11 @@ const FeaturesFunctionalities = (props) => {
|
||||||
const isDuplicate = TableName?.some(
|
const isDuplicate = TableName?.some(
|
||||||
(item) =>
|
(item) =>
|
||||||
item.InwardDtlId +
|
item.InwardDtlId +
|
||||||
' ' +
|
' ' +
|
||||||
item.BookingTypeName +
|
item.BookingTypeName +
|
||||||
' ' +
|
' ' +
|
||||||
item.SinglePc ===
|
item.SinglePc ===
|
||||||
selectedProduct && item.UniqueId === record.UniqueId
|
selectedProduct && item.UniqueId === record.UniqueId
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!isDuplicate) {
|
if (!isDuplicate) {
|
||||||
|
|
@ -807,7 +807,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
TaxAmt: formatAmount(
|
TaxAmt: formatAmount(
|
||||||
((record.Price * record.TaxPercentage) /
|
((record.Price * record.TaxPercentage) /
|
||||||
(100 + record.TaxPercentage)) *
|
(100 + record.TaxPercentage)) *
|
||||||
record.QTY
|
record.QTY
|
||||||
),
|
),
|
||||||
TaxId: record?.TaxId,
|
TaxId: record?.TaxId,
|
||||||
TaxPercentage: record.TaxPercentage,
|
TaxPercentage: record.TaxPercentage,
|
||||||
|
|
@ -1054,7 +1054,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
...record,
|
...record,
|
||||||
...values,
|
...values,
|
||||||
});
|
});
|
||||||
} catch (errInfo) { }
|
} catch (errInfo) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
let childNode = children;
|
let childNode = children;
|
||||||
|
|
@ -1106,7 +1106,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
return (
|
return (
|
||||||
record.Price * record.QTY -
|
record.Price * record.QTY -
|
||||||
((record.Price * record.TaxPercentage) / (100 + record.TaxPercentage)) *
|
((record.Price * record.TaxPercentage) / (100 + record.TaxPercentage)) *
|
||||||
record.QTY
|
record.QTY
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
const WithTaxAmountTaxAmount = (record) => {
|
const WithTaxAmountTaxAmount = (record) => {
|
||||||
|
|
@ -1179,10 +1179,10 @@ const FeaturesFunctionalities = (props) => {
|
||||||
onClick={() => addeddata(record)}
|
onClick={() => addeddata(record)}
|
||||||
disabled={
|
disabled={
|
||||||
Object.keys(ReorderHoldDetails).length !== 0 &&
|
Object.keys(ReorderHoldDetails).length !== 0 &&
|
||||||
BookingType === 'Dine In' &&
|
BookingType === 'Dine In' &&
|
||||||
GlobalExtraCharge.some(
|
GlobalExtraCharge.some(
|
||||||
(item) => item.ExtraChargeId === record.UniqueId
|
(item) => item.ExtraChargeId === record.UniqueId
|
||||||
)
|
)
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
|
|
@ -1278,7 +1278,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
QTY: parseInt(row.QTY),
|
QTY: parseInt(row.QTY),
|
||||||
TaxAmt: formatAmount(
|
TaxAmt: formatAmount(
|
||||||
((row.Price * row.TaxPercentage) / (100 + row.TaxPercentage)) *
|
((row.Price * row.TaxPercentage) / (100 + row.TaxPercentage)) *
|
||||||
row.QTY
|
row.QTY
|
||||||
),
|
),
|
||||||
TotalAmt: row.Price * row.QTY,
|
TotalAmt: row.Price * row.QTY,
|
||||||
// ((row.Price * row.TaxPercentage) / (100 + row.TaxPercentage) *row.QTY ).toFixed(2),
|
// ((row.Price * row.TaxPercentage) / (100 + row.TaxPercentage) *row.QTY ).toFixed(2),
|
||||||
|
|
@ -1427,12 +1427,12 @@ const FeaturesFunctionalities = (props) => {
|
||||||
<Space size="middle">
|
<Space size="middle">
|
||||||
<a>
|
<a>
|
||||||
{Object.keys(ReorderHoldDetails).length !== 0 &&
|
{Object.keys(ReorderHoldDetails).length !== 0 &&
|
||||||
BookingType === 'Dine In' &&
|
BookingType === 'Dine In' &&
|
||||||
GlobalExtraCharge?.some(
|
GlobalExtraCharge?.some(
|
||||||
(item) =>
|
(item) =>
|
||||||
item.ExtraChargeId === record.UniqueId &&
|
item.ExtraChargeId === record.UniqueId &&
|
||||||
item.InwardDtlId === record.InwardDtlId
|
item.InwardDtlId === record.InwardDtlId
|
||||||
) ? (
|
) ? (
|
||||||
<DeleteFilled
|
<DeleteFilled
|
||||||
style={{
|
style={{
|
||||||
color: '#FF4D4F',
|
color: '#FF4D4F',
|
||||||
|
|
@ -1702,7 +1702,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
dispatch(
|
dispatch(
|
||||||
changeCustomerID(
|
changeCustomerID(
|
||||||
response?.data?.CustomerDetails?.[
|
response?.data?.CustomerDetails?.[
|
||||||
response?.data?.CustomerDetails.length - 1
|
response?.data?.CustomerDetails.length - 1
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -2186,9 +2186,9 @@ const FeaturesFunctionalities = (props) => {
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
await dispatch(getSelectedFavItems(data)).unwrap();
|
await dispatch(getSelectedFavItems(data)).unwrap();
|
||||||
|
|
@ -2200,9 +2200,9 @@ const FeaturesFunctionalities = (props) => {
|
||||||
ProdSubCat: ProdSubCat,
|
ProdSubCat: ProdSubCat,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2213,9 +2213,9 @@ const FeaturesFunctionalities = (props) => {
|
||||||
prodCat: prodCat,
|
prodCat: prodCat,
|
||||||
...(AvailableDate && selectedDate
|
...(AvailableDate && selectedDate
|
||||||
? {
|
? {
|
||||||
fromDate: selectedDate?.[0],
|
fromDate: selectedDate?.[0],
|
||||||
toDate: selectedDate?.[1],
|
toDate: selectedDate?.[1],
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2588,7 +2588,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
e?.stopPropagation();
|
e?.stopPropagation();
|
||||||
removeAll();
|
removeAll();
|
||||||
}}
|
}}
|
||||||
// onClick={() => statusFormatter(record,index)}
|
// onClick={() => statusFormatter(record,index)}
|
||||||
>
|
>
|
||||||
Clear All
|
Clear All
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -2715,7 +2715,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
: selectedSearchValue == 'CustName'
|
: selectedSearchValue == 'CustName'
|
||||||
? 'Please Enter Valid Name'
|
? 'Please Enter Valid Name'
|
||||||
: selectedSearchValue == 'CustId' &&
|
: selectedSearchValue == 'CustId' &&
|
||||||
'Please EnterCustomer Id',
|
'Please EnterCustomer Id',
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
|
|
@ -2804,7 +2804,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
: selectedSearchValue == 'CustName'
|
: selectedSearchValue == 'CustName'
|
||||||
? 'Enter Name'
|
? 'Enter Name'
|
||||||
: selectedSearchValue == 'CustId' &&
|
: selectedSearchValue == 'CustId' &&
|
||||||
'Enter Customer Id'
|
'Enter Customer Id'
|
||||||
: ' Mobile Number'}
|
: ' Mobile Number'}
|
||||||
</label>
|
</label>
|
||||||
}
|
}
|
||||||
|
|
@ -2986,7 +2986,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
isOnChange={
|
isOnChange={
|
||||||
formRef.current?.getFieldsValue()?.CustName ||
|
formRef.current?.getFieldsValue()?.CustName ||
|
||||||
inputValue
|
inputValue
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
|
|
@ -3052,9 +3052,9 @@ const FeaturesFunctionalities = (props) => {
|
||||||
<p>Upload Profile</p>
|
<p>Upload Profile</p>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="CustomerProfile"
|
name="CustomerProfile"
|
||||||
// getValueFromEvent={(e) =>
|
// getValueFromEvent={(e) =>
|
||||||
// formType === 'edit' ? editstate?.EmpPhotoLink : e
|
// formType === 'edit' ? editstate?.EmpPhotoLink : e
|
||||||
// }
|
// }
|
||||||
>
|
>
|
||||||
<Imageupload
|
<Imageupload
|
||||||
singleImage={true}
|
singleImage={true}
|
||||||
|
|
@ -3196,133 +3196,133 @@ const FeaturesFunctionalities = (props) => {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="address-type-section">
|
<div className="address-type-section">
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
}}
|
}}
|
||||||
|
>
|
||||||
|
<Checkbox
|
||||||
|
checked={(
|
||||||
|
addressTypes[idx] || []
|
||||||
|
).includes('Delivery Address')}
|
||||||
|
onChange={(e) =>
|
||||||
|
handleAddressTypeChange(
|
||||||
|
idx,
|
||||||
|
'Delivery Address',
|
||||||
|
e.target.checked
|
||||||
|
)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Checkbox
|
Delivery Address
|
||||||
checked={(
|
</Checkbox>
|
||||||
addressTypes[idx] || []
|
<Checkbox
|
||||||
).includes('Delivery Address')}
|
checked={(
|
||||||
onChange={(e) =>
|
addressTypes[idx] || []
|
||||||
handleAddressTypeChange(
|
).includes('Billing Address')}
|
||||||
idx,
|
onChange={(e) =>
|
||||||
'Delivery Address',
|
handleAddressTypeChange(
|
||||||
e.target.checked
|
idx,
|
||||||
)
|
'Billing Address',
|
||||||
}
|
e.target.checked
|
||||||
>
|
)
|
||||||
Delivery Address
|
}
|
||||||
</Checkbox>
|
|
||||||
<Checkbox
|
|
||||||
checked={(
|
|
||||||
addressTypes[idx] || []
|
|
||||||
).includes('Billing Address')}
|
|
||||||
onChange={(e) =>
|
|
||||||
handleAddressTypeChange(
|
|
||||||
idx,
|
|
||||||
'Billing Address',
|
|
||||||
e.target.checked
|
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Billing Address
|
|
||||||
</Checkbox>
|
|
||||||
<Checkbox
|
|
||||||
checked={(
|
|
||||||
addressTypes[idx] || []
|
|
||||||
).includes('Both Address')}
|
|
||||||
onChange={(e) =>
|
|
||||||
handleAddressTypeChange(
|
|
||||||
idx,
|
|
||||||
'Both Address',
|
|
||||||
e.target.checked
|
|
||||||
)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Both Address
|
|
||||||
</Checkbox>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="address-details-grid">
|
|
||||||
<div className="address-detail-item address1">
|
|
||||||
<div className="value">
|
|
||||||
{addr?.Address1 || ''}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="address-detail-item address2">
|
|
||||||
<div className="value">
|
|
||||||
{addr?.Address2 || ''}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="address-detail-item zip">
|
|
||||||
<div className="value">
|
|
||||||
{addr?.Zip || ''}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="address-detail-item city">
|
|
||||||
<div className="value">
|
|
||||||
{addr?.City || ''}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="address-detail-item district">
|
|
||||||
<div className="value">
|
|
||||||
{addr?.Dist || ''}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="address-detail-item state">
|
|
||||||
<div className="value">
|
|
||||||
{addr?.State || ''}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{addr?.Latitude && (
|
|
||||||
<div className="address-detail-item coordinates">
|
|
||||||
<div className="value coordinates">
|
|
||||||
<MdLocationOn />{' '}
|
|
||||||
{addr?.Latitude || ''},{' '}
|
|
||||||
{addr?.Longitude || ''}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
<div className="header-actions">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={() => handleEditAddress(idx)}
|
|
||||||
className="edit-btn"
|
|
||||||
>
|
>
|
||||||
<FaEdit /> Edit
|
Billing Address
|
||||||
</button>
|
</Checkbox>
|
||||||
|
<Checkbox
|
||||||
<Popconfirm
|
checked={(
|
||||||
title="Remove Address"
|
addressTypes[idx] || []
|
||||||
description="Are you sure you want to remove this address?"
|
).includes('Both Address')}
|
||||||
onConfirm={() => handleRemoveAddress(idx)}
|
onChange={(e) =>
|
||||||
okText="Yes, Remove"
|
handleAddressTypeChange(
|
||||||
cancelText="Cancel"
|
idx,
|
||||||
okType="danger"
|
'Both Address',
|
||||||
|
e.target.checked
|
||||||
|
)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<button
|
Both Address
|
||||||
className="remove-btn"
|
</Checkbox>
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<FaTrash /> Remove
|
|
||||||
</button>
|
|
||||||
</Popconfirm>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))
|
|
||||||
|
<div className="address-details-grid">
|
||||||
|
<div className="address-detail-item address1">
|
||||||
|
<div className="value">
|
||||||
|
{addr?.Address1 || ''}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="address-detail-item address2">
|
||||||
|
<div className="value">
|
||||||
|
{addr?.Address2 || ''}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="address-detail-item zip">
|
||||||
|
<div className="value">
|
||||||
|
{addr?.Zip || ''}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="address-detail-item city">
|
||||||
|
<div className="value">
|
||||||
|
{addr?.City || ''}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="address-detail-item district">
|
||||||
|
<div className="value">
|
||||||
|
{addr?.Dist || ''}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="address-detail-item state">
|
||||||
|
<div className="value">
|
||||||
|
{addr?.State || ''}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{addr?.Latitude && (
|
||||||
|
<div className="address-detail-item coordinates">
|
||||||
|
<div className="value coordinates">
|
||||||
|
<MdLocationOn />{' '}
|
||||||
|
{addr?.Latitude || ''},{' '}
|
||||||
|
{addr?.Longitude || ''}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="header-actions">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => handleEditAddress(idx)}
|
||||||
|
className="edit-btn"
|
||||||
|
>
|
||||||
|
<FaEdit /> Edit
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<Popconfirm
|
||||||
|
title="Remove Address"
|
||||||
|
description="Are you sure you want to remove this address?"
|
||||||
|
onConfirm={() => handleRemoveAddress(idx)}
|
||||||
|
okText="Yes, Remove"
|
||||||
|
cancelText="Cancel"
|
||||||
|
okType="danger"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
className="remove-btn"
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<FaTrash /> Remove
|
||||||
|
</button>
|
||||||
|
</Popconfirm>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))
|
||||||
) : (
|
) : (
|
||||||
<div className="empty-state">
|
<div className="empty-state">
|
||||||
<MdHome />
|
<MdHome />
|
||||||
|
|
@ -3484,7 +3484,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="State"
|
name="State"
|
||||||
// rules={[{ required: true }]}
|
// rules={[{ required: true }]}
|
||||||
>
|
>
|
||||||
<InputField
|
<InputField
|
||||||
field="State"
|
field="State"
|
||||||
|
|
@ -3527,13 +3527,13 @@ const FeaturesFunctionalities = (props) => {
|
||||||
style={
|
style={
|
||||||
offerType == 'P'
|
offerType == 'P'
|
||||||
? {
|
? {
|
||||||
opacity: '1',
|
opacity: '1',
|
||||||
boxShadow:
|
boxShadow:
|
||||||
'rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px',
|
'rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px',
|
||||||
margin: '3px',
|
margin: '3px',
|
||||||
padding: '5px',
|
padding: '5px',
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
}
|
}
|
||||||
: { opacity: '0.6', boxShadow: 'none' }
|
: { opacity: '0.6', boxShadow: 'none' }
|
||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
@ -3549,13 +3549,13 @@ const FeaturesFunctionalities = (props) => {
|
||||||
style={
|
style={
|
||||||
offerType == 'F'
|
offerType == 'F'
|
||||||
? {
|
? {
|
||||||
opacity: '1',
|
opacity: '1',
|
||||||
boxShadow:
|
boxShadow:
|
||||||
'rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px',
|
'rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px',
|
||||||
margin: '3px',
|
margin: '3px',
|
||||||
padding: '5px',
|
padding: '5px',
|
||||||
backgroundColor: '#fff',
|
backgroundColor: '#fff',
|
||||||
}
|
}
|
||||||
: { opacity: '0.6', boxShadow: 'none' }
|
: { opacity: '0.6', boxShadow: 'none' }
|
||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
@ -3652,7 +3652,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
}
|
}
|
||||||
isOnChange={
|
isOnChange={
|
||||||
formRef.current?.getFieldsValue()?.CustEmail ||
|
formRef.current?.getFieldsValue()?.CustEmail ||
|
||||||
inputValue
|
inputValue
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
|
|
@ -3680,7 +3680,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
isOnChange={
|
isOnChange={
|
||||||
formRef.current?.getFieldsValue()?.CreditLimit ||
|
formRef.current?.getFieldsValue()?.CreditLimit ||
|
||||||
inputValue
|
inputValue
|
||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
|
|
@ -4027,7 +4027,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
buttonText="SAVE"
|
buttonText="SAVE"
|
||||||
color="901D77"
|
color="901D77"
|
||||||
icon={<ArrowRightOutlined />}
|
icon={<ArrowRightOutlined />}
|
||||||
// handleSubmit={() => { globalamount1() }}
|
// handleSubmit={() => { globalamount1() }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -4041,7 +4041,7 @@ const FeaturesFunctionalities = (props) => {
|
||||||
bordered
|
bordered
|
||||||
dataSource={TableName}
|
dataSource={TableName}
|
||||||
width={'120px'}
|
width={'120px'}
|
||||||
//pagination={column2?.length < "11" ? false : true}
|
//pagination={column2?.length < "11" ? false : true}
|
||||||
></Table>
|
></Table>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -51,14 +51,7 @@ import {
|
||||||
GlobalOverAllDiscSales,
|
GlobalOverAllDiscSales,
|
||||||
GlobalOverAllDiscEstimate,
|
GlobalOverAllDiscEstimate,
|
||||||
GlobaltipAmount,
|
GlobaltipAmount,
|
||||||
GlobalRetailWSSalesType,
|
GlobalRetailWSSalesType
|
||||||
GlobalPreviousOrderPayment,
|
|
||||||
GlobalPreviousOrderOfferDetails,
|
|
||||||
GlobalSalesBillEdit,
|
|
||||||
putSalesBillEdit,
|
|
||||||
changeBillEditingMode,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changePreviousOrderOfferDetail
|
|
||||||
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
} from '../../../../Features/BookingScreen/BookingData/BookingData';
|
||||||
import { Form, Radio } from 'antd';
|
import { Form, Radio } from 'antd';
|
||||||
import {
|
import {
|
||||||
|
|
@ -105,7 +98,6 @@ import { gettinghold } from '../../../../Features/BookingScreen/HoldOption/HoldO
|
||||||
import { Global_OrderOfferDetail } from '../../../../Features/Offer/Offer.js';
|
import { Global_OrderOfferDetail } from '../../../../Features/Offer/Offer.js';
|
||||||
import { useApplyOfferto_CardDetail } from '../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
|
import { useApplyOfferto_CardDetail } from '../UtillComponents/BSNavBarOffer/BSNavBarOffer_CustomHooks.jsx';
|
||||||
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js';
|
import { ApplicationPreferences } from '../../../../Features/BrachLogin/BranchLogin.js';
|
||||||
import { ChangeFullFreeProductList, changeFullOfferAppliedProducts, GlobalOfferAppliedProducts } from '../../../../Features/Offer/Offernew/BookingOffernew.js';
|
|
||||||
|
|
||||||
const subDirectory = import.meta.env.BASE_URL;
|
const subDirectory = import.meta.env.BASE_URL;
|
||||||
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
const MainHomeUrl = import.meta.env.ENV_MAIN_BASE_URL;
|
||||||
|
|
@ -122,7 +114,7 @@ const SplitPayment = (props) => {
|
||||||
|
|
||||||
const applyOffer = useApplyOfferto_CardDetail();
|
const applyOffer = useApplyOfferto_CardDetail();
|
||||||
const globalTipAmount = useSelector(GlobaltipAmount);
|
const globalTipAmount = useSelector(GlobaltipAmount);
|
||||||
const TotalNetAmount = (props.hasOwnProperty('TotalNetAmount')
|
const TotalAmount = (props.hasOwnProperty('TotalNetAmount')
|
||||||
? props['TotalNetAmount']
|
? props['TotalNetAmount']
|
||||||
: null);
|
: null);
|
||||||
const TableOrderId = props.hasOwnProperty('TableBookingOrderId')
|
const TableOrderId = props.hasOwnProperty('TableBookingOrderId')
|
||||||
|
|
@ -136,23 +128,7 @@ const SplitPayment = (props) => {
|
||||||
: null;
|
: null;
|
||||||
const OrderCardDetail = useSelector(GlobalOrderCardDetails);
|
const OrderCardDetail = useSelector(GlobalOrderCardDetails);
|
||||||
const SelCustId = useSelector(GlobalSelCustId);
|
const SelCustId = useSelector(GlobalSelCustId);
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
|
||||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
|
||||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
|
||||||
const filteredPayments =
|
|
||||||
previousOrderPayment?.filter(
|
|
||||||
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment
|
|
||||||
) || [];
|
|
||||||
const paymentsToUse =
|
|
||||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
|
||||||
const totalPreviousOfferAmount = previousOrderOfferDetails?.reduce(
|
|
||||||
(acc, offer) => acc + parseFloat(offer.OfferAmount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
|
||||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
const [paybtns, setpaybtns] = useState([]);
|
const [paybtns, setpaybtns] = useState([]);
|
||||||
const [PaymentOptions, setPaymentOptions] = useState([]);
|
const [PaymentOptions, setPaymentOptions] = useState([]);
|
||||||
const [PaymentUpiOptions, setPaymentUpiOptions] = useState([]);
|
const [PaymentUpiOptions, setPaymentUpiOptions] = useState([]);
|
||||||
|
|
@ -164,9 +140,6 @@ const SplitPayment = (props) => {
|
||||||
const [SplitSelPayMode, setSplitSelPayMode] = useState({});
|
const [SplitSelPayMode, setSplitSelPayMode] = useState({});
|
||||||
const [TotalSplitAmount, setTotalSplitAmount] = useState(0);
|
const [TotalSplitAmount, setTotalSplitAmount] = useState(0);
|
||||||
const [SalesOrderId, setSalesOrderId] = useState();
|
const [SalesOrderId, setSalesOrderId] = useState();
|
||||||
const [beforeAdjAmount, setBeforeAdjAmount] = useState(null);
|
|
||||||
const [afterAdjAmount, setAfterAdjAmount] = useState(null);
|
|
||||||
const [adjustmentType, setAdjustmentType] = useState(null);
|
|
||||||
const [PaymentgatewayCard, setPaymentgatewayCard] = useState([]);
|
const [PaymentgatewayCard, setPaymentgatewayCard] = useState([]);
|
||||||
const [PaymentDeviceCard, setPaymentDeviceCard] = useState([]);
|
const [PaymentDeviceCard, setPaymentDeviceCard] = useState([]);
|
||||||
const [PaymentgatewayUPI, setPaymentgatewayUPI] = useState([]);
|
const [PaymentgatewayUPI, setPaymentgatewayUPI] = useState([]);
|
||||||
|
|
@ -181,7 +154,7 @@ const SplitPayment = (props) => {
|
||||||
const GlobProdwisedata = useSelector(GlobalSelProdWiseEst);
|
const GlobProdwisedata = useSelector(GlobalSelProdWiseEst);
|
||||||
const prodCat = useSelector(GlobalProductCategorie);
|
const prodCat = useSelector(GlobalProductCategorie);
|
||||||
const ProdSubCat = useSelector(GlobalProductSubCategorie);
|
const ProdSubCat = useSelector(GlobalProductSubCategorie);
|
||||||
const RetailWSSalesType = useSelector(GlobalRetailWSSalesType, shallowEqual);
|
const RetailWSSalesType= useSelector(GlobalRetailWSSalesType, shallowEqual);
|
||||||
const selOption = useSelector(GlobalSelOption);
|
const selOption = useSelector(GlobalSelOption);
|
||||||
const ReportholdData = useSelector(GlobalReorderHoldDetails);
|
const ReportholdData = useSelector(GlobalReorderHoldDetails);
|
||||||
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
const GlobalExtraCharge = useSelector(globalExtraTotalAmount);
|
||||||
|
|
@ -204,7 +177,6 @@ const SplitPayment = (props) => {
|
||||||
(i) => i.SettingIdName === 'AllProductindividualToken'
|
(i) => i.SettingIdName === 'AllProductindividualToken'
|
||||||
)?.[0];
|
)?.[0];
|
||||||
const OrderOfferDetail = useSelector(Global_OrderOfferDetail, shallowEqual);
|
const OrderOfferDetail = useSelector(Global_OrderOfferDetail, shallowEqual);
|
||||||
const offerAppliedProducts = useSelector(GlobalOfferAppliedProducts);
|
|
||||||
const [SelectedBookingType, setSelectedBookingType] = useState(null);
|
const [SelectedBookingType, setSelectedBookingType] = useState(null);
|
||||||
const [ConfigDataList, setConfigDataList] = useState([]);
|
const [ConfigDataList, setConfigDataList] = useState([]);
|
||||||
const [formattedDate, setFormattedDate] = useState('');
|
const [formattedDate, setFormattedDate] = useState('');
|
||||||
|
|
@ -222,8 +194,6 @@ const SplitPayment = (props) => {
|
||||||
const OfferCheckedInSetup = templateData?.BookingNavbar?.[1].some(
|
const OfferCheckedInSetup = templateData?.BookingNavbar?.[1].some(
|
||||||
(item) => item?.OptionName == 'Offer'
|
(item) => item?.OptionName == 'Offer'
|
||||||
);
|
);
|
||||||
const [TotalAmount, setTotalAmount] = useState(0);
|
|
||||||
console.log(TotalAmount, "TotalSplitAmount", TotalSplitAmount)
|
|
||||||
const preferenceOffer =
|
const preferenceOffer =
|
||||||
SettingDataSelector?.[0]?.['SettingDtlDetails']?.find(
|
SettingDataSelector?.[0]?.['SettingDtlDetails']?.find(
|
||||||
(item) => item.SettingIdName === 'Offer'
|
(item) => item.SettingIdName === 'Offer'
|
||||||
|
|
@ -236,21 +206,6 @@ const SplitPayment = (props) => {
|
||||||
getPaymentOptionFeature();
|
getPaymentOptionFeature();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
|
|
||||||
if (salesBillEdit) {
|
|
||||||
const previousNetAmount = (totalPreviouspayment || 0);
|
|
||||||
if (TotalNetAmount > previousNetAmount) {
|
|
||||||
setTotalAmount(TotalNetAmount - previousNetAmount);
|
|
||||||
} else {
|
|
||||||
setTotalAmount(0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setTotalAmount(TotalNetAmount);
|
|
||||||
}
|
|
||||||
|
|
||||||
}, [totalPreviousOfferAmount, totalPreviouspayment, TotalNetAmount])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (SelCustId) {
|
if (SelCustId) {
|
||||||
setpaybtns(PaymentOptions);
|
setpaybtns(PaymentOptions);
|
||||||
|
|
@ -272,11 +227,8 @@ const SplitPayment = (props) => {
|
||||||
}, [Splitpayment]);
|
}, [Splitpayment]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const totalPayAmount = Object.keys(SplitSelPayMode)
|
const totalPayAmount = Object.keys(SplitSelPayMode)
|
||||||
.filter(key => key.startsWith('PayAmount-'))
|
.filter((key) => key.startsWith('PayAmount-')) // Filter keys that start with "PayAmount-"
|
||||||
.reduce((sum, key) => {
|
.reduce((sum, key) => sum + parseInt(SplitSelPayMode[key]), 0);
|
||||||
const value = parseInt(SplitSelPayMode[key], 10);
|
|
||||||
return sum + (isNaN(value) ? 0 : value);
|
|
||||||
}, 0);
|
|
||||||
setTotalSplitAmount(totalPayAmount);
|
setTotalSplitAmount(totalPayAmount);
|
||||||
}, [SplitSelPayMode]);
|
}, [SplitSelPayMode]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
@ -570,7 +522,7 @@ const SplitPayment = (props) => {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
PrintOrderDetails?.[0]?.OrderDetails?.map(
|
PrintOrderDetails?.[0]?.OrderDetails?.map(
|
||||||
async (orderDetail, index) => {
|
async (orderDetail, index) => {
|
||||||
const groupedTokens = orderDetail?.productDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.reduce(
|
const groupedTokens = orderDetail?.productDetails?.reduce(
|
||||||
(acc, item, idx) => {
|
(acc, item, idx) => {
|
||||||
if (item.TokenAvailable === 'Y') {
|
if (item.TokenAvailable === 'Y') {
|
||||||
if (!item.CounterName) {
|
if (!item.CounterName) {
|
||||||
|
|
@ -605,7 +557,7 @@ const SplitPayment = (props) => {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
PrintOrderDetails?.[0]?.OrderDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.map(
|
PrintOrderDetails?.[0]?.OrderDetails?.map(
|
||||||
async (orderDetail, index) => {
|
async (orderDetail, index) => {
|
||||||
await TokenPrint(`${index}-${orderDetail?.OrderId}`);
|
await TokenPrint(`${index}-${orderDetail?.OrderId}`);
|
||||||
}
|
}
|
||||||
|
|
@ -633,10 +585,6 @@ const SplitPayment = (props) => {
|
||||||
'Style 11': 'PrintStyle11',
|
'Style 11': 'PrintStyle11',
|
||||||
'Style 12': 'PrintStyle12',
|
'Style 12': 'PrintStyle12',
|
||||||
'Style 13': 'RePrint',
|
'Style 13': 'RePrint',
|
||||||
A4: 'PrintStyleA4',
|
|
||||||
A5: 'PrintStyleA5',
|
|
||||||
A4Standard: 'A4Standard',
|
|
||||||
TaxInvoice: 'TaxInvoice',
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectedStyle =
|
const selectedStyle =
|
||||||
|
|
@ -650,7 +598,7 @@ const SplitPayment = (props) => {
|
||||||
async (orderDetail, index) => {
|
async (orderDetail, index) => {
|
||||||
await printDiv(`${selectedStyle}-${index}`, style); // Use unique IDs for each print
|
await printDiv(`${selectedStyle}-${index}`, style); // Use unique IDs for each print
|
||||||
if (orderDetail?.BookingTypeName !== 'Dine In') {
|
if (orderDetail?.BookingTypeName !== 'Dine In') {
|
||||||
const groupedTokens = orderDetail?.productDetails?.filter(data => data?.EditTokenAvailable !== 'N')?.reduce(
|
const groupedTokens = orderDetail?.productDetails?.reduce(
|
||||||
(acc, item, idx) => {
|
(acc, item, idx) => {
|
||||||
if (item.TokenAvailable === 'Y') {
|
if (item.TokenAvailable === 'Y') {
|
||||||
if (!item.CounterName) {
|
if (!item.CounterName) {
|
||||||
|
|
@ -1033,11 +981,11 @@ const SplitPayment = (props) => {
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
SplitSelPayMode[`PaymentStatus-${i}`] === 'S' ||
|
SplitSelPayMode[`PaymentStatus-${i}`] === 'S' ||
|
||||||
SplitSelPayMode[`FirstPaymentclick-${i}`] === 'Y'
|
SplitSelPayMode[`FirstPaymentclick-${i}`] === 'Y'
|
||||||
? 'Splitbutton-diabled'
|
? 'Splitbutton-diabled'
|
||||||
: 'Splitbutton'
|
: 'Splitbutton'
|
||||||
}
|
}
|
||||||
// onClick={(e) => (SplitSelPayMode[`PaymentStatus-${i}`] === "S" || SplitSelPayMode[`FirstPaymentclick-${i}`] === "Y") ? e.stopPropagation() : onFinish(i)}
|
// onClick={(e) => (SplitSelPayMode[`PaymentStatus-${i}`] === "S" || SplitSelPayMode[`FirstPaymentclick-${i}`] === "Y") ? e.stopPropagation() : onFinish(i)}
|
||||||
>
|
>
|
||||||
Pay
|
Pay
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -1292,12 +1240,7 @@ const SplitPayment = (props) => {
|
||||||
} else {
|
} else {
|
||||||
dispatch(changeOrderCardDetails([]));
|
dispatch(changeOrderCardDetails([]));
|
||||||
}
|
}
|
||||||
dispatch(changeBillEditingMode(false));
|
|
||||||
await dispatch(changePreviousOrderPayment([]));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail([]));
|
|
||||||
await dispatch(ChangeTotalAmount([]));
|
await dispatch(ChangeTotalAmount([]));
|
||||||
dispatch(changeFullOfferAppliedProducts([]));
|
|
||||||
dispatch(ChangeFullFreeProductList([]));
|
|
||||||
await dispatch(changeReorderHoldDetails({}));
|
await dispatch(changeReorderHoldDetails({}));
|
||||||
await dispatch(changeReorderProductDetails([]));
|
await dispatch(changeReorderProductDetails([]));
|
||||||
await dispatch(ChangeNavHoldData(false));
|
await dispatch(ChangeNavHoldData(false));
|
||||||
|
|
@ -1365,8 +1308,8 @@ const SplitPayment = (props) => {
|
||||||
? 'E'
|
? 'E'
|
||||||
: GlobEstBooking === 'ParEst'
|
: GlobEstBooking === 'ParEst'
|
||||||
? GlobProdwisedata?.includes(
|
? GlobProdwisedata?.includes(
|
||||||
a.InwardDtlId + ' ' + a?.BookingTypeName
|
a.InwardDtlId + ' ' + a?.BookingTypeName
|
||||||
)
|
)
|
||||||
? 'E'
|
? 'E'
|
||||||
: 'S'
|
: 'S'
|
||||||
: 'S',
|
: 'S',
|
||||||
|
|
@ -1375,8 +1318,6 @@ const SplitPayment = (props) => {
|
||||||
OfferValue: a?.Type === 'C' ? a?.OfferValue : a.Offer,
|
OfferValue: a?.Type === 'C' ? a?.OfferValue : a.Offer,
|
||||||
OfferAmt: a?.Type === 'C' ? a?.TotalAmt : a.Offer,
|
OfferAmt: a?.Type === 'C' ? a?.TotalAmt : a.Offer,
|
||||||
OfferType: a?.Type === 'C' ? a?.OfferType : '',
|
OfferType: a?.Type === 'C' ? a?.OfferType : '',
|
||||||
OfferMode: a?.OfferMode,
|
|
||||||
OfferMessage: a?.OfferMessage,
|
|
||||||
CounterName: a?.TokenAvailable === 'Y' ? a?.CounterName : null,
|
CounterName: a?.TokenAvailable === 'Y' ? a?.CounterName : null,
|
||||||
ProductIdentifierDtls: a.ProductIdentifierDtls,
|
ProductIdentifierDtls: a.ProductIdentifierDtls,
|
||||||
ModelNumber: a.ModelNumber,
|
ModelNumber: a.ModelNumber,
|
||||||
|
|
@ -1385,9 +1326,9 @@ const SplitPayment = (props) => {
|
||||||
const NotSlectedTypeFind = temporderdetail?.find(
|
const NotSlectedTypeFind = temporderdetail?.find(
|
||||||
(a) => a?.BookingType != SelectedBookingType
|
(a) => a?.BookingType != SelectedBookingType
|
||||||
);
|
);
|
||||||
let updatedOfferDetails = offerAppliedProducts;
|
let updatedOfferDetails = OrderOfferDetail;
|
||||||
if (GlobEstBooking !== 'Sales') {
|
if (GlobEstBooking !== 'Sales') {
|
||||||
updatedOfferDetails = offerAppliedProducts?.filter(
|
updatedOfferDetails = OrderOfferDetail?.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
!(
|
!(
|
||||||
item.TableName === 'LoyaltyPoints' &&
|
item.TableName === 'LoyaltyPoints' &&
|
||||||
|
|
@ -1398,7 +1339,7 @@ const SplitPayment = (props) => {
|
||||||
}
|
}
|
||||||
let temppostdata = {
|
let temppostdata = {
|
||||||
CompId: CompId,
|
CompId: CompId,
|
||||||
SalesMode: RetailWSSalesType || 'R',
|
SalesMode:RetailWSSalesType || 'R',
|
||||||
BranchId: BranchId,
|
BranchId: BranchId,
|
||||||
AppId: AppId,
|
AppId: AppId,
|
||||||
OrderDate: formattedDate,
|
OrderDate: formattedDate,
|
||||||
|
|
@ -1472,37 +1413,37 @@ const SplitPayment = (props) => {
|
||||||
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card'
|
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card'
|
||||||
? SplitSelPayMode[`CardSelection-${i}`]
|
? SplitSelPayMode[`CardSelection-${i}`]
|
||||||
: SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
: SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
||||||
'default'
|
'default'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: SplitSelPayMode[`UPISelection-${i}`],
|
: SplitSelPayMode[`UPISelection-${i}`],
|
||||||
ModeOfPayment:
|
ModeOfPayment:
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find(
|
? PaymentUpiOptions?.find(
|
||||||
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
|
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
|
||||||
)?.UPIDetailId
|
)?.UPIDetailId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl:
|
AccountDtl:
|
||||||
SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
|
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
|
||||||
)
|
)
|
||||||
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
||||||
'pd') ||
|
'pd') ||
|
||||||
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
|
|
||||||
'card' &&
|
|
||||||
SplitSelPayMode[`CardSelection-${i}`]?.toLowerCase() ===
|
|
||||||
'pd')
|
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
|
||||||
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
|
|
||||||
'upi' &&
|
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
|
||||||
'pg') ||
|
|
||||||
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
|
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
|
||||||
'card' &&
|
'card' &&
|
||||||
SplitSelPayMode[`CardSelection-${i}`]?.toLowerCase() ===
|
SplitSelPayMode[`CardSelection-${i}`]?.toLowerCase() ===
|
||||||
'pg')
|
'pd')
|
||||||
|
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||||
|
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
|
||||||
|
'upi' &&
|
||||||
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
||||||
|
'pg') ||
|
||||||
|
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
|
||||||
|
'card' &&
|
||||||
|
SplitSelPayMode[`CardSelection-${i}`]?.toLowerCase() ===
|
||||||
|
'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus:
|
PaymentStatus:
|
||||||
|
|
@ -1511,9 +1452,9 @@ const SplitPayment = (props) => {
|
||||||
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'credit'
|
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
|
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
|
||||||
'upi' &&
|
'upi' &&
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
||||||
'default'
|
'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: 0,
|
Debit: 0,
|
||||||
|
|
@ -1527,7 +1468,7 @@ const SplitPayment = (props) => {
|
||||||
};
|
};
|
||||||
let PostData = temppostdata;
|
let PostData = temppostdata;
|
||||||
(i === 0 && SplitSelPayMode[`PaymentStatus-${i}`] === 'F') ||
|
(i === 0 && SplitSelPayMode[`PaymentStatus-${i}`] === 'F') ||
|
||||||
(i === 0 && props.hasOwnProperty('TableBookingOrderId'))
|
(i === 0 && props.hasOwnProperty('TableBookingOrderId'))
|
||||||
? PutSplitPayment(i)
|
? PutSplitPayment(i)
|
||||||
: i === 0
|
: i === 0
|
||||||
? Object.keys(ReportholdData)?.length > 0
|
? Object.keys(ReportholdData)?.length > 0
|
||||||
|
|
@ -1576,14 +1517,14 @@ const SplitPayment = (props) => {
|
||||||
}
|
}
|
||||||
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]);
|
||||||
|
|
@ -1625,23 +1566,11 @@ const SplitPayment = (props) => {
|
||||||
: ReportholdData?.OrderId;
|
: ReportholdData?.OrderId;
|
||||||
putdata['SalesId'] = ReportholdData?.SalesId;
|
putdata['SalesId'] = ReportholdData?.SalesId;
|
||||||
putdata['UpdatedBy'] = UserId;
|
putdata['UpdatedBy'] = UserId;
|
||||||
let response = null;
|
|
||||||
|
|
||||||
if (salesBillEdit) {
|
let response = await dispatch(PutBookingData(putdata)).unwrap();
|
||||||
response = await dispatch(putSalesBillEdit(putdata)).unwrap();
|
|
||||||
} else {
|
|
||||||
response = await dispatch(PutBookingData(putdata)).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response?.data?.statusCode == 1) {
|
if (response?.data?.statusCode == 1) {
|
||||||
setSalesOrderId(response?.data?.OrderId);
|
setSalesOrderId(response?.data?.OrderId);
|
||||||
const salesEditAmount = response?.data?.PaymentOrderDtl?.find(payment =>
|
|
||||||
payment?.LastOrderTran === 'Y' && payment?.AdjustmentType &&
|
|
||||||
payment?.AdjustmentType != null && payment?.AfterAdjustment && payment?.BeforeAdjustment && payment?.AfterAdjustment != null && payment?.BeforeAdjustment != null
|
|
||||||
)
|
|
||||||
setBeforeAdjAmount(salesEditAmount?.BeforeAdjustment || null);
|
|
||||||
setAfterAdjAmount(salesEditAmount?.AfterAdjustment || null);
|
|
||||||
setAdjustmentType(salesEditAmount?.AdjustmentType || null);
|
|
||||||
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
let Paymentdevicefilter = response?.data?.PaymentOrderDtl?.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
item?.PaymentOptionType?.toLowerCase() === 'pd' &&
|
item?.PaymentOptionType?.toLowerCase() === 'pd' &&
|
||||||
|
|
@ -1677,14 +1606,14 @@ const SplitPayment = (props) => {
|
||||||
}
|
}
|
||||||
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]);
|
||||||
|
|
@ -1743,32 +1672,32 @@ const SplitPayment = (props) => {
|
||||||
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card'
|
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card'
|
||||||
? SplitSelPayMode[`CardSelection-${i}`]
|
? SplitSelPayMode[`CardSelection-${i}`]
|
||||||
: SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
: SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
||||||
'default'
|
'default'
|
||||||
? 'PC'
|
? 'PC'
|
||||||
: SplitSelPayMode[`UPISelection-${i}`],
|
: SplitSelPayMode[`UPISelection-${i}`],
|
||||||
ModeOfPayment:
|
ModeOfPayment:
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
|
||||||
? PaymentUpiOptions?.find(
|
? PaymentUpiOptions?.find(
|
||||||
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
|
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
|
||||||
)?.UPIDetailId
|
)?.UPIDetailId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl:
|
AccountDtl:
|
||||||
SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'default'
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
|
(upipay) => upipay?.Mode === SplitSelPayMode[`UPIMode-${i}`]
|
||||||
)
|
)
|
||||||
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pd') ||
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pd') ||
|
||||||
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card' &&
|
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'card' &&
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pd')
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pd')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||||
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
: (SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
||||||
'pg') ||
|
'pg') ||
|
||||||
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
|
(SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() ===
|
||||||
'card' &&
|
'card' &&
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pg')
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() === 'pg')
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
: [],
|
: [],
|
||||||
PaymentStatus:
|
PaymentStatus:
|
||||||
|
|
@ -1777,8 +1706,8 @@ const SplitPayment = (props) => {
|
||||||
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'credit'
|
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
: SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'upi' &&
|
||||||
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
SplitSelPayMode[`UPISelection-${i}`]?.toLowerCase() ===
|
||||||
'default'
|
'default'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: 'P',
|
||||||
Debit: 0,
|
Debit: 0,
|
||||||
|
|
@ -1786,10 +1715,6 @@ const SplitPayment = (props) => {
|
||||||
SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'credit'
|
SplitSelPayMode[`PaymentMode-${i}`]?.toLowerCase() === 'credit'
|
||||||
? SplitSelPayMode[`PayAmount-${i}`]
|
? SplitSelPayMode[`PayAmount-${i}`]
|
||||||
: 0,
|
: 0,
|
||||||
BeforeAdjAmount: beforeAdjAmount || null,
|
|
||||||
AfterAdjAmount: afterAdjAmount || null,
|
|
||||||
AdjustmentType: adjustmentType || null,
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let response = await dispatch(
|
let response = await dispatch(
|
||||||
|
|
@ -1836,14 +1761,14 @@ const SplitPayment = (props) => {
|
||||||
}
|
}
|
||||||
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]);
|
||||||
|
|
@ -1945,14 +1870,14 @@ const SplitPayment = (props) => {
|
||||||
});
|
});
|
||||||
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?.OrderDetails?.[0]?.FYStatus
|
bookingpaymentupdate?.data?.OrderDetails?.[0]?.FYStatus
|
||||||
)
|
)
|
||||||
: '')
|
: '')
|
||||||
);
|
);
|
||||||
if (bookingpaymentupdate?.data?.OrderDetails?.length > 0) {
|
if (bookingpaymentupdate?.data?.OrderDetails?.length > 0) {
|
||||||
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
setPrintOrderDetails([bookingpaymentupdate?.data]);
|
||||||
|
|
@ -1970,7 +1895,7 @@ const SplitPayment = (props) => {
|
||||||
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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,26 +41,7 @@ import MobilePrint from '../../BookingFunctionality/MobilePrint.jsx';
|
||||||
import '../../../../../Styles/BookingScreen/Components/OtherConponents/Reprint/BSReprint.scss';
|
import '../../../../../Styles/BookingScreen/Components/OtherConponents/Reprint/BSReprint.scss';
|
||||||
import PaymentPdfBooking from '../../../../paymentpdfPage/PaymentPdfBooking.jsx';
|
import PaymentPdfBooking from '../../../../paymentpdfPage/PaymentPdfBooking.jsx';
|
||||||
import {
|
import {
|
||||||
changeBillEditingMode,
|
|
||||||
changeEstimateBooking,
|
|
||||||
changeHoldOrderDtl,
|
|
||||||
changeOrderCardDetails,
|
|
||||||
changeOrderType,
|
|
||||||
ChangeOverAllDiscEstimate,
|
|
||||||
ChangeOverAllDiscSales,
|
|
||||||
changePreviousOrderOfferDetail,
|
|
||||||
changePreviousOrderPayment,
|
|
||||||
changeReorderHoldDetails,
|
|
||||||
changeReorderProductDetails,
|
|
||||||
ChangeSelectedCustDisable,
|
|
||||||
changeSelectedCustId,
|
|
||||||
changeSelectedOption,
|
|
||||||
changeSelProdWiseEst,
|
|
||||||
getAllCustomer,
|
|
||||||
getConfigType,
|
getConfigType,
|
||||||
getCustomerForHold,
|
|
||||||
GlobalSalesBillEdit,
|
|
||||||
GlobalSelectedCustDisable,
|
|
||||||
PreferenceData,
|
PreferenceData,
|
||||||
} from '../../../../../Features/BookingScreen/BookingData/BookingData.js';
|
} from '../../../../../Features/BookingScreen/BookingData/BookingData.js';
|
||||||
import { DatePicker, Form } from 'antd';
|
import { DatePicker, Form } from 'antd';
|
||||||
|
|
@ -82,15 +63,10 @@ import {
|
||||||
import { TbSettingsCog } from 'react-icons/tb';
|
import { TbSettingsCog } from 'react-icons/tb';
|
||||||
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||||
import { axiosRetailInstanceData } from '../../../../../Features/AuthenicationToken/AuthenticationToken.js';
|
import { axiosRetailInstanceData } from '../../../../../Features/AuthenicationToken/AuthenticationToken.js';
|
||||||
import { MdEdit } from "react-icons/md";
|
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
|
||||||
import { changeOrderOfferDetail } from '../../../../../Features/Offer/Offer.js';
|
|
||||||
import { ChangeFullFreeProductList, changeFullOfferAppliedProducts, changeLoyaltyConsumedQuantities } from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
|
||||||
import { ChangeTotalAmount } from '../../../../../Features/ExteraCharges/ExtraCharges.js';
|
|
||||||
|
|
||||||
const RetailApiurl = import.meta.env.ENV_API_URL;
|
const RetailApiurl = import.meta.env.ENV_API_URL;
|
||||||
|
|
||||||
function BSReprint({ setOpenModel = () => { } }) {
|
function BSReprint() {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
const appPreferences = useSelector(ApplicationPreferences);
|
const appPreferences = useSelector(ApplicationPreferences);
|
||||||
|
|
@ -124,31 +100,24 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
const [page, setpage] = useState(1);
|
const [page, setpage] = useState(1);
|
||||||
const [itemsPerPage] = useState(10);
|
const [itemsPerPage] = useState(10);
|
||||||
const [DefReason, setDefReason] = useState({});
|
const [DefReason, setDefReason] = useState({});
|
||||||
|
console.log(DefReason, 'DefReason');
|
||||||
const SettingDataSelector = useSelector(PreferenceData);
|
const SettingDataSelector = useSelector(PreferenceData);
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
|
||||||
const custDisable = useSelector(GlobalSelectedCustDisable);
|
|
||||||
console.log(SettingDataSelector, 'SettingDataSelector');
|
|
||||||
const MobileA4Print = SettingDataSelector?.[0]?.SettingDtlDetails?.find(
|
const MobileA4Print = SettingDataSelector?.[0]?.SettingDtlDetails?.find(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
setting?.SettingIdName?.toLowerCase() === 'mobilea4' &&
|
setting?.SettingIdName?.toLowerCase() === 'mobilea4' &&
|
||||||
setting?.SettingValue === 'Y'
|
setting?.SettingValue === 'Y'
|
||||||
);
|
);
|
||||||
const editBill = SettingDataSelector?.[0]?.SettingDtlDetails?.find(
|
|
||||||
(setting) =>
|
|
||||||
setting?.SettingIdName?.toLowerCase() === 'editbill' &&
|
|
||||||
setting?.SettingValue === 'Y'
|
|
||||||
);
|
|
||||||
const TokenOnly = SettingDataSelector?.[0]?.SettingDtlDetails?.filter(
|
const TokenOnly = SettingDataSelector?.[0]?.SettingDtlDetails?.filter(
|
||||||
(i) => i.SettingIdName === 'TokenOnly'
|
(i) => i.SettingIdName === 'TokenOnly'
|
||||||
)?.[0];
|
)?.[0];
|
||||||
const IndividualToken = SettingDataSelector?.[0]?.SettingDtlDetails?.filter(
|
const IndividualToken = SettingDataSelector?.[0]?.SettingDtlDetails?.filter(
|
||||||
(i) => i.SettingIdName === 'AllProductindividualToken'
|
(i) => i.SettingIdName === 'AllProductindividualToken'
|
||||||
)?.[0];
|
)?.[0];
|
||||||
const Weightasquantity = SettingDataSelector?.[0]?.SettingDtlDetails?.some(
|
const Weightasquantity = SettingDataSelector?.[0]?.SettingDtlDetails?.some(
|
||||||
(setting) =>
|
(setting) =>
|
||||||
setting?.SettingIdName?.toLowerCase() === 'weightasquantity' &&
|
setting?.SettingIdName?.toLowerCase() === 'weightasquantity' &&
|
||||||
setting?.SettingValue === 'Y'
|
setting?.SettingValue === 'Y'
|
||||||
);
|
);
|
||||||
const printDatas = useSelector(GlobalprintDatas);
|
const printDatas = useSelector(GlobalprintDatas);
|
||||||
console.log(printDatas, 'GlobalprintDatas');
|
console.log(printDatas, 'GlobalprintDatas');
|
||||||
const PrinterDetails = useSelector(GlobalPrinterMappingDtls);
|
const PrinterDetails = useSelector(GlobalPrinterMappingDtls);
|
||||||
|
|
@ -591,7 +560,7 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
|
|
||||||
const selectedStyle =
|
const selectedStyle =
|
||||||
stylesMap[
|
stylesMap[
|
||||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||||
];
|
];
|
||||||
if (selectedStyle) {
|
if (selectedStyle) {
|
||||||
if (data === 'without') {
|
if (data === 'without') {
|
||||||
|
|
@ -926,21 +895,6 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
// ...(editBill ? [
|
|
||||||
{
|
|
||||||
title: 'Edit Bill',
|
|
||||||
key: 'EditBill',
|
|
||||||
dataIndex: 'EditBill',
|
|
||||||
align: 'center',
|
|
||||||
render: (text, row) => (
|
|
||||||
<MdEdit
|
|
||||||
style={{ color: '#1292EE', fontSize: '25px', cursor: 'pointer' }}
|
|
||||||
onClick={async (e) => await handleEditBill(e, row)}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
}
|
|
||||||
// ] : [])
|
|
||||||
,
|
|
||||||
{
|
{
|
||||||
title: () => (
|
title: () => (
|
||||||
<div
|
<div
|
||||||
|
|
@ -1238,162 +1192,24 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
console.log(table2Data, 'table2Datadfnfjd');
|
console.log(table2Data, 'table2Datadfnfjd');
|
||||||
|
|
||||||
const totalSalesQty = table2Data?.[0]?.productDetails?.reduce((acc, item) => {
|
const totalSalesQty = table2Data?.[0]?.productDetails?.reduce((acc, item) => {
|
||||||
const isWeightScale = item?.ScaleType === 'weight';
|
const isWeightScale = item?.ScaleType === 'weight';
|
||||||
|
|
||||||
if (isWeightScale) {
|
if (isWeightScale) {
|
||||||
return acc + (
|
return acc + (
|
||||||
Weightasquantity
|
Weightasquantity
|
||||||
? Math.round(Number(item?.SalesQty || item?.OrderQty || 0))
|
? Math.round(Number(item?.SalesQty || item?.OrderQty || 0))
|
||||||
: 1
|
: 1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return acc + Math.round(Number(item?.SalesQty || item?.OrderQty || 0));
|
return acc + Math.round(Number(item?.SalesQty || item?.OrderQty|| 0));
|
||||||
}, 0)
|
}, 0)
|
||||||
|
|
||||||
const widthOutTexAmt = table2Data?.[0]?.TaxDetails?.reduce(
|
const widthOutTexAmt = table2Data?.[0]?.TaxDetails?.reduce(
|
||||||
(sum, item) => sum + (item?.WithOutTaxAmount || 0),
|
(sum, item) => sum + (item?.WithOutTaxAmount || 0),
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
const handleEditBill = async (e, orderDtls) => {
|
|
||||||
setOpenModel(e);
|
|
||||||
dispatch(changeBillEditingMode(true));
|
|
||||||
const {
|
|
||||||
productDetails,
|
|
||||||
ExtraChargeDetails,
|
|
||||||
CustSuppId,
|
|
||||||
OrderOfferDetails,
|
|
||||||
RefDetails,
|
|
||||||
OrderId,
|
|
||||||
OrderType,
|
|
||||||
OverallDisc,
|
|
||||||
OrderPaymentDtl,
|
|
||||||
} = orderDtls;
|
|
||||||
const updated = productDetails?.map((item) => ({
|
|
||||||
...item,
|
|
||||||
Offer: item?.OfferAmt,
|
|
||||||
localId: uuidv4(),
|
|
||||||
OfferMode: item?.OfferMode ? item?.OfferMode?.trim() : null,
|
|
||||||
VariantAvailableFrom: item?.AvailableFrom || null,
|
|
||||||
VariantAvailableTo: item?.AvailableTo || null,
|
|
||||||
OrderQty: item?.SalesQty,
|
|
||||||
OrderRate: item?.Rate,
|
|
||||||
// TotalAmt: formatAmount((item.TotalAmt - item.OfferValue)),
|
|
||||||
}));
|
|
||||||
|
|
||||||
if (RefDetails?.[0]?.FreeProdList) {
|
|
||||||
dispatch(ChangeFullFreeProductList(RefDetails[0]?.FreeProdList));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (RefDetails?.[0]?.OfferAppliedProductList) {
|
|
||||||
dispatch(
|
|
||||||
changeFullOfferAppliedProducts(
|
|
||||||
RefDetails[0]?.OfferAppliedProductList
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (CustSuppId) {
|
|
||||||
let res = await dispatch(
|
|
||||||
getCustomerForHold({
|
|
||||||
CompId: CompId,
|
|
||||||
AppId: AppId,
|
|
||||||
branchId: BranchId,
|
|
||||||
OrderId: OrderId,
|
|
||||||
})
|
|
||||||
).unwrap();
|
|
||||||
|
|
||||||
if (res?.data?.statusCode !== 1) {
|
|
||||||
res = await dispatch(
|
|
||||||
getAllCustomer({
|
|
||||||
CompId: CompId,
|
|
||||||
AppId: AppId,
|
|
||||||
branchId: BranchId,
|
|
||||||
})
|
|
||||||
).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res?.data?.statusCode === 1) {
|
|
||||||
|
|
||||||
const loyaltyFreeProductOfferApplied = (RefDetails?.[0]?.OfferAppliedProductList || [])?.filter(
|
|
||||||
(off) =>
|
|
||||||
off?.FreeProductsList?.OfferMode === 'L' &&
|
|
||||||
off?.TableUniqueName === 'FreeProduct'
|
|
||||||
);
|
|
||||||
|
|
||||||
const customerDetails = res?.data?.data?.find(
|
|
||||||
(item) => item.CustId === CustSuppId
|
|
||||||
);
|
|
||||||
|
|
||||||
if (customerDetails) {
|
|
||||||
const { CustId, CustName, CustMobile, LoyaltyPointsDetail, TotalLoyaltyPoints } = customerDetails;
|
|
||||||
const data = {
|
|
||||||
CustId: CustId,
|
|
||||||
CustName: CustName,
|
|
||||||
label: CustName ? CustName : CustMobile,
|
|
||||||
value: CustMobile,
|
|
||||||
LoyaltyPointsDetail: LoyaltyPointsDetail,
|
|
||||||
TotalLoyaltyPoints: TotalLoyaltyPoints
|
|
||||||
};
|
|
||||||
|
|
||||||
dispatch(changeOrderOfferDetail([...OrderOfferDetails]));
|
|
||||||
dispatch(changeSelectedOption(data));
|
|
||||||
await dispatch(ChangeSelectedCustDisable(true));
|
|
||||||
|
|
||||||
if (loyaltyFreeProductOfferApplied?.length > 0) {
|
|
||||||
const loyaltyProdQuantities = {};
|
|
||||||
|
|
||||||
loyaltyFreeProductOfferApplied.forEach((off) => {
|
|
||||||
const freeProdDtls = off?.FreeProductsList;
|
|
||||||
const freeProdOfferId =
|
|
||||||
freeProdDtls?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
|
||||||
?.ProdOfferId;
|
|
||||||
|
|
||||||
const key = [
|
|
||||||
freeProdDtls?.OfferId,
|
|
||||||
freeProdDtls?.FreeProdId,
|
|
||||||
freeProdDtls?.FreeProdVariantName,
|
|
||||||
freeProdOfferId,
|
|
||||||
].join('|');
|
|
||||||
|
|
||||||
loyaltyProdQuantities[key] = freeProdDtls?.FreeQty || 0;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (Object.keys(loyaltyProdQuantities).length > 0) {
|
|
||||||
dispatch(changeLoyaltyConsumedQuantities(loyaltyProdQuantities));
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log(loyaltyProdQuantities, 'loyaltyProdQuantities');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await dispatch(changeOrderType('Hold'));
|
|
||||||
await dispatch(changeHoldOrderDtl(true));
|
|
||||||
await dispatch(changeReorderHoldDetails(orderDtls));
|
|
||||||
await dispatch(changeReorderProductDetails(updated));
|
|
||||||
await dispatch(changeSelectedCustId(CustSuppId));
|
|
||||||
await dispatch(ChangeTotalAmount(ExtraChargeDetails));
|
|
||||||
await dispatch(changePreviousOrderPayment(OrderPaymentDtl));
|
|
||||||
await dispatch(changePreviousOrderOfferDetail(OrderOfferDetails));
|
|
||||||
dispatch(changeOrderCardDetails(updated));
|
|
||||||
let temp = updated?.filter((item) => item.OrderType === 'E')
|
|
||||||
.map((item) => item.InwardDtlId + ' ' + item.BookingTypeName);
|
|
||||||
await dispatch(changeSelProdWiseEst(temp));
|
|
||||||
|
|
||||||
if (OrderType === 'E') {
|
|
||||||
await dispatch(changeEstimateBooking('OvrAllEst'));
|
|
||||||
await dispatch(ChangeOverAllDiscEstimate(parseFloat(OverallDisc)));
|
|
||||||
} else {
|
|
||||||
await dispatch(changeEstimateBooking('Sales'));
|
|
||||||
await dispatch(ChangeOverAllDiscSales(parseFloat(OverallDisc)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div>
|
<div>
|
||||||
|
|
@ -1479,7 +1295,7 @@ function BSReprint({ setOpenModel = () => { } }) {
|
||||||
<Tables
|
<Tables
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={filteredData}
|
data={filteredData}
|
||||||
// pagination={handlePageChange}
|
// pagination={handlePageChange}
|
||||||
/>
|
/>
|
||||||
{countOfProduct > 10 && (
|
{countOfProduct > 10 && (
|
||||||
<Pagination
|
<Pagination
|
||||||
|
|
|
||||||
|
|
@ -177,9 +177,9 @@ const PrintPreviewPage = (props) => {
|
||||||
carouselRef.current.goTo(index);
|
carouselRef.current.goTo(index);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const goToPrintSetup = () => {
|
const goToPrintSetup = () => {
|
||||||
navigate(`${subDirectory}saleslayouts/print-selection`);
|
navigate(`${subDirectory}saleslayouts/print-selection`);
|
||||||
};
|
};
|
||||||
const getStyleNote = (value) => {
|
const getStyleNote = (value) => {
|
||||||
if (!GlobaldummyData) return false;
|
if (!GlobaldummyData) return false;
|
||||||
const isAnyTableOptionTrue =
|
const isAnyTableOptionTrue =
|
||||||
|
|
@ -385,6 +385,7 @@ const PrintPreviewPage = (props) => {
|
||||||
// (item) => item.StyleName === selectedStyleName
|
// (item) => item.StyleName === selectedStyleName
|
||||||
// );
|
// );
|
||||||
|
|
||||||
|
// debugger
|
||||||
// // Only one "Sales" style should have SetasDefault: "Y"
|
// // Only one "Sales" style should have SetasDefault: "Y"
|
||||||
// const updatedTemplates = SizeOptionData.map((item) => {
|
// const updatedTemplates = SizeOptionData.map((item) => {
|
||||||
// if (
|
// if (
|
||||||
|
|
@ -450,79 +451,78 @@ const PrintPreviewPage = (props) => {
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
|
||||||
const onfinish = async (values) => {
|
const onfinish = async (values) => {
|
||||||
if (!SizeOptionData || SizeOptionData.length === 0) {
|
if (!SizeOptionData || SizeOptionData.length === 0) {
|
||||||
setMessageType('error');
|
setMessageType('error');
|
||||||
setMessageData('Please Setup the Screen');
|
setMessageData('Please Setup the Screen');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectedStyle = SizeOptionData.find(
|
const selectedStyle = SizeOptionData.find(
|
||||||
(item) => item.StyleName === selectedStyleName
|
(item) => item.StyleName === selectedStyleName
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!selectedStyle) {
|
if (!selectedStyle) {
|
||||||
setMessageType('error');
|
setMessageType('error');
|
||||||
setMessageData('Selected style not found');
|
setMessageData('Selected style not found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Update all templates, ensuring only the selected style has SetasDefault: "Y"
|
// Update all templates, ensuring only the selected style has SetasDefault: "Y"
|
||||||
const updatedTemplates = SizeOptionData.map((item) => {
|
const updatedTemplates = SizeOptionData.map((item) => {
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
SetasDefault: item.StyleName === selectedStyleName ? "Y" : "N",
|
SetasDefault: item.StyleName === selectedStyleName ? "Y" : "N",
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(updatedTemplates, 'ngfjbknbfgjbgfjn');
|
|
||||||
|
|
||||||
let TemplateDetails = updatedTemplates.map((item) => ({
|
|
||||||
SizeId: null,
|
|
||||||
StyleId: item.StyleId,
|
|
||||||
SetasDefault: item.SetasDefault,
|
|
||||||
SetasDefaultInvoice: item.SetasDefaultInvoice,
|
|
||||||
PrintTypeId: item?.PrintTypeId,
|
|
||||||
SizeDetails: item.OptionDetails.map((opt) => ({
|
|
||||||
OptionId: opt.ConfigId,
|
|
||||||
})),
|
|
||||||
...(item?.TermsandConditions?.length > 0
|
|
||||||
? {
|
|
||||||
PrintTermsandConditions: (item?.TermsandConditions
|
|
||||||
? item?.TermsandConditions
|
|
||||||
: []
|
|
||||||
)?.map((tc) => ({
|
|
||||||
TermsandConditions: tc,
|
|
||||||
})),
|
|
||||||
}
|
|
||||||
: {}),
|
|
||||||
...(item?.Notes ? { Notes: item.Notes } : {}),
|
|
||||||
...(item?.PageSize ? { PageSize: item.PageSize } : {}),
|
|
||||||
...(item?.PrintHdrName ? { PrintHdrName: item.PrintHdrName } : {}),
|
|
||||||
...(item?.Signature ? { Signature: item?.Signature } : {}),
|
|
||||||
PrintType: item?.PrintType,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const Data = {
|
|
||||||
CompId: CompId,
|
|
||||||
BranchId: BranchId,
|
|
||||||
AppId: AppId,
|
|
||||||
TemplateDetails: TemplateDetails,
|
|
||||||
CreatedBy: UserId,
|
|
||||||
};
|
};
|
||||||
|
});
|
||||||
|
|
||||||
const response = await dispatch(
|
console.log(updatedTemplates, 'ngfjbknbfgjbgfjn');
|
||||||
putPrintSelectionComponentData(Data)
|
|
||||||
).unwrap();
|
|
||||||
|
|
||||||
if (response?.data?.statusCode === 1) {
|
let TemplateDetails = updatedTemplates.map((item) => ({
|
||||||
dispatch(changeSelectedPrintdummyData(false));
|
SizeId: null,
|
||||||
await GetPrintData();
|
StyleId: item.StyleId,
|
||||||
setMessageType('success');
|
SetasDefault: item.SetasDefault,
|
||||||
setMessageData(response?.data?.response);
|
SetasDefaultInvoice: item.SetasDefaultInvoice,
|
||||||
if (onClose) onClose(); // Call the onClose callback after success
|
PrintTypeId: item?.PrintTypeId,
|
||||||
}
|
SizeDetails: item.OptionDetails.map((opt) => ({
|
||||||
|
OptionId: opt.ConfigId,
|
||||||
|
})),
|
||||||
|
...(item?.TermsandConditions?.length > 0
|
||||||
|
? {
|
||||||
|
PrintTermsandConditions: (item?.TermsandConditions
|
||||||
|
? item?.TermsandConditions
|
||||||
|
: []
|
||||||
|
)?.map((tc) => ({
|
||||||
|
TermsandConditions: tc,
|
||||||
|
})),
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
|
...(item?.Notes ? { Notes: item.Notes } : {}),
|
||||||
|
...(item?.PageSize ? { PageSize: item.PageSize } : {}),
|
||||||
|
...(item?.PrintHdrName ? { PrintHdrName: item.PrintHdrName } : {}),
|
||||||
|
...(item?.Signature ? { Signature: item?.Signature } : {}),
|
||||||
|
PrintType: item?.PrintType,
|
||||||
|
}));
|
||||||
|
|
||||||
|
const Data = {
|
||||||
|
CompId: CompId,
|
||||||
|
BranchId: BranchId,
|
||||||
|
AppId: AppId,
|
||||||
|
TemplateDetails: TemplateDetails,
|
||||||
|
CreatedBy: UserId,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const response = await dispatch(
|
||||||
|
putPrintSelectionComponentData(Data)
|
||||||
|
).unwrap();
|
||||||
|
|
||||||
|
if (response?.data?.statusCode === 1) {
|
||||||
|
dispatch(changeSelectedPrintdummyData(false));
|
||||||
|
await GetPrintData();
|
||||||
|
setMessageType('success');
|
||||||
|
setMessageData(response?.data?.response);
|
||||||
|
if (onClose) onClose(); // Call the onClose callback after success
|
||||||
|
}
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', width: '100%' }}>
|
<div style={{ display: 'flex', flexDirection: 'column', width: '100%' }}>
|
||||||
<Messages
|
<Messages
|
||||||
|
|
@ -618,32 +618,32 @@ const PrintPreviewPage = (props) => {
|
||||||
</div>
|
</div>
|
||||||
{style.component}
|
{style.component}
|
||||||
</div>
|
</div>
|
||||||
)) : (
|
)):(
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
padding: "1rem",
|
padding: "1rem",
|
||||||
textAlign: "center",
|
textAlign: "center",
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
color: "#777",
|
color: "#777",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Please set up Print form to view or change here.
|
Please set up Print form to view or change here.
|
||||||
<br />
|
<br />
|
||||||
<span
|
<span
|
||||||
onClick={goToPrintSetup} // <-- call your function here
|
onClick={goToPrintSetup} // <-- call your function here
|
||||||
style={{
|
style={{
|
||||||
marginTop: "0.5rem",
|
marginTop: "0.5rem",
|
||||||
display: "inline-block",
|
display: "inline-block",
|
||||||
color: "#2ba01b",
|
color: "#2ba01b",
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
textDecoration: "underline",
|
textDecoration: "underline",
|
||||||
fontWeight: 600,
|
fontWeight: 600,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Click here to go there
|
Click here to go there
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Carousel>
|
</Carousel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1752,6 +1752,7 @@ const BSCreditCustomer = (props) => {
|
||||||
</label>
|
</label>
|
||||||
}
|
}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
|
// debugger
|
||||||
const value = parseFloat(e?.target?.value) || 0;
|
const value = parseFloat(e?.target?.value) || 0;
|
||||||
if (value <= SelectedBillData?.OrderPendingAmount) {
|
if (value <= SelectedBillData?.OrderPendingAmount) {
|
||||||
HandleAmount(e?.target?.value);
|
HandleAmount(e?.target?.value);
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ const BSNavbarSearchStandard = ({ inputRef }) => {
|
||||||
const ProdName = useSelector(GlobalSearchData);
|
const ProdName = useSelector(GlobalSearchData);
|
||||||
const templateData = useSelector(getTemplateData);
|
const templateData = useSelector(getTemplateData);
|
||||||
const appPreferences = useSelector(ApplicationPreferences);
|
const appPreferences = useSelector(ApplicationPreferences);
|
||||||
console.log(ProdName, "ProdName")
|
|
||||||
const [preFocus, setPreFocus] = useState(false);
|
const [preFocus, setPreFocus] = useState(false);
|
||||||
const [screenWidth, setScreenWidth] = useState(window.innerWidth);
|
const [screenWidth, setScreenWidth] = useState(window.innerWidth);
|
||||||
const [check, setCheck] = useState(false);
|
const [check, setCheck] = useState(false);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ const BSPrinterSetting = ({
|
||||||
IconComponent = PozoReprintIcon,
|
IconComponent = PozoReprintIcon,
|
||||||
ClassName = 'BSBillingNav-icon',
|
ClassName = 'BSBillingNav-icon',
|
||||||
drawerOpen = false,
|
drawerOpen = false,
|
||||||
setDrawerOpen = () => { },
|
setDrawerOpen = () => {},
|
||||||
}) => {
|
}) => {
|
||||||
const CompId = getSession('CompId');
|
const CompId = getSession('CompId');
|
||||||
const BranchId = getSession('BranchId');
|
const BranchId = getSession('BranchId');
|
||||||
|
|
@ -57,7 +57,7 @@ const BSPrinterSetting = ({
|
||||||
const [receiptReprintShow, setReceiptReprintShow] = useState(false);
|
const [receiptReprintShow, setReceiptReprintShow] = useState(false);
|
||||||
const SettingDataSelector = useSelector(PreferenceData);
|
const SettingDataSelector = useSelector(PreferenceData);
|
||||||
const [KioskPrintersetupShow, setKioskPrintersetupShow] = useState(false);
|
const [KioskPrintersetupShow, setKioskPrintersetupShow] = useState(false);
|
||||||
console.log(OpenModel, "OpenModel")
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const printmodelOpen = () => {
|
const printmodelOpen = () => {
|
||||||
setOpenModel(true);
|
setOpenModel(true);
|
||||||
|
|
@ -266,7 +266,7 @@ const BSPrinterSetting = ({
|
||||||
className="printer-settings-tabs"
|
className="printer-settings-tabs"
|
||||||
>
|
>
|
||||||
<TabPane tab="Sales Reprint" key="reprint">
|
<TabPane tab="Sales Reprint" key="reprint">
|
||||||
{reprintShow && <BSReprint setOpenModel={closeModel} />}
|
{reprintShow && <BSReprint />}
|
||||||
</TabPane>
|
</TabPane>
|
||||||
<TabPane tab="Receipt Reprint" key="receiptReprint">
|
<TabPane tab="Receipt Reprint" key="receiptReprint">
|
||||||
{receiptReprintShow && <CreditCustomerReprint />}
|
{receiptReprintShow && <CreditCustomerReprint />}
|
||||||
|
|
|
||||||
|
|
@ -137,18 +137,6 @@ const PrintA4Style11 = ({
|
||||||
let PaymentStatusSuccess = PaymentStatus?.filter(
|
let PaymentStatusSuccess = PaymentStatus?.filter(
|
||||||
(ps) => ps.PaymentStatus === 'S'
|
(ps) => ps.PaymentStatus === 'S'
|
||||||
);
|
);
|
||||||
const isEditedBill = PaymentStatus?.some(payment => {
|
|
||||||
const type = payment?.AdjustmentType?.toLowerCase();
|
|
||||||
return (
|
|
||||||
(type === 'extra' || type === 'refund') &&
|
|
||||||
payment?.BeforeAdjustment != null &&
|
|
||||||
payment?.AfterAdjustment != null
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const lastTransaction = PaymentStatus?.find(
|
|
||||||
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
|
|
||||||
)
|
|
||||||
|
|
||||||
const TakeawayTotal = TakeawayData?.reduce(
|
const TakeawayTotal = TakeawayData?.reduce(
|
||||||
(accumulator, currentValue) => accumulator + currentValue.TotalAmt,
|
(accumulator, currentValue) => accumulator + currentValue.TotalAmt,
|
||||||
0
|
0
|
||||||
|
|
@ -558,7 +546,7 @@ const PrintA4Style11 = ({
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{ WeightasKg ?'Qty/Kg' :'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -944,46 +932,6 @@ const PrintA4Style11 = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'flex-start',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalCredit && (
|
? GlobalCredit && (
|
||||||
<div
|
<div
|
||||||
|
|
@ -1558,7 +1506,7 @@ const PrintA4Style11 = ({
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{ WeightasKg ?'Qty/Kg' :'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -1924,46 +1872,6 @@ const PrintA4Style11 = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'flex-start',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalCredit && (
|
? GlobalCredit && (
|
||||||
<div
|
<div
|
||||||
|
|
@ -2419,7 +2327,7 @@ const PrintA4Style11 = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{(PaymentStatusSuccess?.length > 1 && !isEditedBill) && (
|
{PaymentStatusSuccess?.length > 1 && (
|
||||||
<>
|
<>
|
||||||
{/* <p>Split Payment:</p> */}
|
{/* <p>Split Payment:</p> */}
|
||||||
{Object.keys(aggregatedPayments).map((paymentType) => (
|
{Object.keys(aggregatedPayments).map((paymentType) => (
|
||||||
|
|
@ -2516,46 +2424,6 @@ const PrintA4Style11 = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'flex-start',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalCredit && (
|
? GlobalCredit && (
|
||||||
<div
|
<div
|
||||||
|
|
@ -3063,46 +2931,6 @@ const PrintA4Style11 = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'flex-start',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalCredit && (
|
? GlobalCredit && (
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ const PrintA5Style11 = ({
|
||||||
const CashierNameField = FieldDetails?.['CashierName'];
|
const CashierNameField = FieldDetails?.['CashierName'];
|
||||||
const LogoField = FieldDetails?.['Logo'];
|
const LogoField = FieldDetails?.['Logo'];
|
||||||
const CreditDetails = FieldDetails?.['Credit details'];
|
const CreditDetails = FieldDetails?.['Credit details'];
|
||||||
const WeightasKg = FieldDetails?.['Weight'];
|
const WeightasKg = FieldDetails?.['Weight'];
|
||||||
const GlobalSlNo = useSelector(GlobalprintSlNo);
|
const GlobalSlNo = useSelector(GlobalprintSlNo);
|
||||||
const GlobalItem = useSelector(GlobalprintItem);
|
const GlobalItem = useSelector(GlobalprintItem);
|
||||||
const GlobalMRP = useSelector(GlobalprintMRP);
|
const GlobalMRP = useSelector(GlobalprintMRP);
|
||||||
|
|
@ -137,17 +137,6 @@ const PrintA5Style11 = ({
|
||||||
let PaymentStatusSuccess = PaymentStatus?.filter(
|
let PaymentStatusSuccess = PaymentStatus?.filter(
|
||||||
(ps) => ps.PaymentStatus === 'S'
|
(ps) => ps.PaymentStatus === 'S'
|
||||||
);
|
);
|
||||||
const isEditedBill = PaymentStatus?.some(payment => {
|
|
||||||
const type = payment?.AdjustmentType?.toLowerCase();
|
|
||||||
return (
|
|
||||||
(type === 'extra' || type === 'refund') &&
|
|
||||||
payment?.BeforeAdjustment != null &&
|
|
||||||
payment?.AfterAdjustment != null
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const lastTransaction = PaymentStatus?.find(
|
|
||||||
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
|
|
||||||
)
|
|
||||||
const PackageDetails = table2Data?.PackageDtl;
|
const PackageDetails = table2Data?.PackageDtl;
|
||||||
const TakeawayTotal = TakeawayData?.reduce(
|
const TakeawayTotal = TakeawayData?.reduce(
|
||||||
(accumulator, currentValue) => accumulator + currentValue.TotalAmt,
|
(accumulator, currentValue) => accumulator + currentValue.TotalAmt,
|
||||||
|
|
@ -559,7 +548,7 @@ const PrintA5Style11 = ({
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{ WeightasKg ?'Qty/Kg' :'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -947,46 +936,6 @@ const PrintA5Style11 = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'flex-start',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalCredit && (
|
? GlobalCredit && (
|
||||||
<div
|
<div
|
||||||
|
|
@ -1561,7 +1510,7 @@ const PrintA5Style11 = ({
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{ WeightasKg ?'Qty/Kg' :'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -1927,46 +1876,6 @@ const PrintA5Style11 = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'flex-start',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalCredit && (
|
? GlobalCredit && (
|
||||||
<div
|
<div
|
||||||
|
|
@ -2422,7 +2331,7 @@ const PrintA5Style11 = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{(PaymentStatusSuccess?.length > 1 && !isEditedBill) && (
|
{PaymentStatusSuccess?.length > 1 && (
|
||||||
<>
|
<>
|
||||||
{/* <p>Split Payment:</p> */}
|
{/* <p>Split Payment:</p> */}
|
||||||
{Object.keys(aggregatedPayments).map((paymentType) => (
|
{Object.keys(aggregatedPayments).map((paymentType) => (
|
||||||
|
|
@ -2519,86 +2428,6 @@ const PrintA5Style11 = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'flex-start',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'flex-start',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalCredit && (
|
? GlobalCredit && (
|
||||||
<div
|
<div
|
||||||
|
|
@ -3106,86 +2935,6 @@ const PrintA5Style11 = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'flex-start',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'flex-start',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
? GlobalCredit && (
|
? GlobalCredit && (
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -122,18 +122,6 @@ const PrintStyle10 = ({
|
||||||
(ps) => ps.PaymentTypeName === 'UPI'
|
(ps) => ps.PaymentTypeName === 'UPI'
|
||||||
);
|
);
|
||||||
|
|
||||||
const isEditedBill = PaymentStatus?.some((payment) => {
|
|
||||||
const type = payment?.AdjustmentType?.toLowerCase();
|
|
||||||
return (
|
|
||||||
(type === 'extra' || type === 'refund') &&
|
|
||||||
payment?.BeforeAdjustment != null &&
|
|
||||||
payment?.AfterAdjustment != null
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const lastTransaction = PaymentStatus?.find(
|
|
||||||
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
|
|
||||||
);
|
|
||||||
|
|
||||||
let TermsAndConditions = printDatas?.TermsandConditions;
|
let TermsAndConditions = printDatas?.TermsandConditions;
|
||||||
let SignatureImg = printDatas?.Signature;
|
let SignatureImg = printDatas?.Signature;
|
||||||
let Notestext = printDatas?.Notes;
|
let Notestext = printDatas?.Notes;
|
||||||
|
|
@ -541,7 +529,7 @@ const PrintStyle10 = ({
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{ WeightasKg ?'Qty/Kg' :'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -916,7 +904,7 @@ const PrintStyle10 = ({
|
||||||
<th
|
<th
|
||||||
style={{ width: '10px', textAlign: 'right' }}
|
style={{ width: '10px', textAlign: 'right' }}
|
||||||
>
|
>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{ WeightasKg ?'Qty/Kg' :'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -1658,7 +1646,7 @@ const PrintStyle10 = ({
|
||||||
table2Data?.FYStatus
|
table2Data?.FYStatus
|
||||||
)}{' '}
|
)}{' '}
|
||||||
</div>
|
</div>
|
||||||
{PaymentStatusSuccess?.length > 1 && !isEditedBill && (
|
{PaymentStatusSuccess?.length > 1 && (
|
||||||
<>
|
<>
|
||||||
{/* <p>Split Payment:</p> */}
|
{/* <p>Split Payment:</p> */}
|
||||||
{Object.keys(aggregatedPayments).map(
|
{Object.keys(aggregatedPayments).map(
|
||||||
|
|
@ -1805,77 +1793,6 @@ const PrintStyle10 = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
width: '100%',
|
|
||||||
margin: '2px 0',
|
|
||||||
padding: '2px 0',
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
flexDirection: 'column',
|
|
||||||
borderTop: '1px dashed #000',
|
|
||||||
borderBottom: '1px dashed #000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '90%',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span style={{ color: '#000', fontWeight: '600' }}>
|
|
||||||
Bill Gross Amount
|
|
||||||
</span>
|
|
||||||
<strong>
|
|
||||||
{(lastTransaction?.BeforeAdjustment || 0).toFixed(
|
|
||||||
2
|
|
||||||
)}
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: '800',
|
|
||||||
color: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '-'
|
|
||||||
: '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
marginTop: '4px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span style={{ color: '#000', fontWeight: '600' }}>
|
|
||||||
Net Bill Amount
|
|
||||||
</span>
|
|
||||||
<strong>
|
|
||||||
{(lastTransaction?.AfterAdjustment || 0).toFixed(
|
|
||||||
2
|
|
||||||
)}
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -2620,7 +2537,7 @@ const PrintStyle10 = ({
|
||||||
table2Data?.FYStatus
|
table2Data?.FYStatus
|
||||||
)}{' '}
|
)}{' '}
|
||||||
</div>
|
</div>
|
||||||
{PaymentStatusSuccess?.length > 1 && !isEditedBill && (
|
{PaymentStatusSuccess?.length > 1 && (
|
||||||
<>
|
<>
|
||||||
{/* <p>Split Payment:</p> */}
|
{/* <p>Split Payment:</p> */}
|
||||||
{Object.keys(aggregatedPayments).map(
|
{Object.keys(aggregatedPayments).map(
|
||||||
|
|
@ -2754,75 +2671,6 @@ const PrintStyle10 = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
width: '100%',
|
|
||||||
margin: '2px 0',
|
|
||||||
padding: '2px 0',
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
flexDirection: 'column',
|
|
||||||
borderTop: '1px dashed #000',
|
|
||||||
borderBottom: '1px dashed #000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '90%',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span style={{ color: '#000', fontWeight: '600' }}>
|
|
||||||
Bill Gross Amount
|
|
||||||
</span>
|
|
||||||
<strong>
|
|
||||||
{(lastTransaction?.BeforeAdjustment || 0).toFixed(
|
|
||||||
2
|
|
||||||
)}
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: '800',
|
|
||||||
color: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '-'
|
|
||||||
: '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
marginTop: '4px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span style={{ color: '#000', fontWeight: '600' }}>
|
|
||||||
Net Bill Amount
|
|
||||||
</span>
|
|
||||||
<strong>
|
|
||||||
{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
@ -3182,7 +3030,7 @@ const PrintStyle10 = ({
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{ WeightasKg ?'Qty/Kg' :'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -3508,7 +3356,7 @@ const PrintStyle10 = ({
|
||||||
)
|
)
|
||||||
: Quantity && (
|
: Quantity && (
|
||||||
<th style={{ width: '10px', textAlign: 'right' }}>
|
<th style={{ width: '10px', textAlign: 'right' }}>
|
||||||
{WeightasKg ? 'Qty/Kg' : 'Qty'}
|
{ WeightasKg ?'Qty/Kg' :'Qty'}
|
||||||
</th>
|
</th>
|
||||||
)}
|
)}
|
||||||
{GlobaldummyData
|
{GlobaldummyData
|
||||||
|
|
@ -4187,7 +4035,7 @@ const PrintStyle10 = ({
|
||||||
table2Data?.FYStatus
|
table2Data?.FYStatus
|
||||||
)}{' '}
|
)}{' '}
|
||||||
</div>
|
</div>
|
||||||
{PaymentStatusSuccess?.length > 1 && !isEditedBill && (
|
{PaymentStatusSuccess?.length > 1 && (
|
||||||
<>
|
<>
|
||||||
{/* <p>Split Payment:</p> */}
|
{/* <p>Split Payment:</p> */}
|
||||||
{Object.keys(aggregatedPayments).map((paymentType) => (
|
{Object.keys(aggregatedPayments).map((paymentType) => (
|
||||||
|
|
@ -4305,71 +4153,6 @@ const PrintStyle10 = ({
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
width: '100%',
|
|
||||||
margin: '2px 0',
|
|
||||||
padding: '2px 0',
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'center',
|
|
||||||
alignItems: 'center',
|
|
||||||
flexDirection: 'column',
|
|
||||||
borderTop: '1px dashed #000',
|
|
||||||
borderBottom: '1px dashed #000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '90%',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span style={{ color: '#000', fontWeight: '600' }}>
|
|
||||||
Bill Gross Amount
|
|
||||||
</span>
|
|
||||||
<strong>
|
|
||||||
{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: '800',
|
|
||||||
color: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
marginTop: '4px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span style={{ color: '#000', fontWeight: '600' }}>
|
|
||||||
Net Bill Amount
|
|
||||||
</span>
|
|
||||||
<strong>
|
|
||||||
{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -105,18 +105,6 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
if (keysLength > 0) {
|
if (keysLength > 0) {
|
||||||
dispatch(changeReprintDataFound(true));
|
dispatch(changeReprintDataFound(true));
|
||||||
}
|
}
|
||||||
const isEditedBill = PaymentStatus?.some(payment => {
|
|
||||||
const type = payment?.AdjustmentType?.toLowerCase();
|
|
||||||
return (
|
|
||||||
(type === 'extra' || type === 'refund') &&
|
|
||||||
payment?.BeforeAdjustment != null &&
|
|
||||||
payment?.AfterAdjustment != null
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const lastTransaction = PaymentStatus?.find(
|
|
||||||
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
|
|
||||||
)
|
|
||||||
|
|
||||||
const currentDate = new Date();
|
const currentDate = new Date();
|
||||||
const day = currentDate.getDate().toString().padStart(2, '0');
|
const day = currentDate.getDate().toString().padStart(2, '0');
|
||||||
const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
const monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||||
|
|
@ -252,7 +240,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
{GlobaldummyData ? GlobalItem && <div style={{ width: '200%', textAlign: 'left', fontWeight: 600 }}>ITEM</div> : Item && <div style={{ width: '300%', textAlign: 'left', fontWeight: 600 }}>ITEM</div>}
|
{GlobaldummyData ? GlobalItem && <div style={{ width: '200%', textAlign: 'left', fontWeight: 600 }}>ITEM</div> : Item && <div style={{ width: '300%', textAlign: 'left', fontWeight: 600 }}>ITEM</div>}
|
||||||
{GlobaldummyData ? GlobalHsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div>}
|
{GlobaldummyData ? GlobalHsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div>}
|
||||||
{GlobaldummyData ? GlobalMRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div> : MRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div>}
|
{GlobaldummyData ? GlobalMRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div> : MRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div>}
|
||||||
{GlobaldummyData ? GlobalQuantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>QTY</div> : Quantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}> {WeightasKg ? 'QTY/KG' : 'QTY'}</div>}
|
{GlobaldummyData ? GlobalQuantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>QTY</div> : Quantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}> {WeightasKg ?'QTY/KG' :'QTY'}</div>}
|
||||||
{GlobaldummyData ? GlobalRate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div> : Rate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div>}
|
{GlobaldummyData ? GlobalRate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div> : Rate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div>}
|
||||||
{GlobaldummyData ? GlobalDiscount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div> : Discount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div>}
|
{GlobaldummyData ? GlobalDiscount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div> : Discount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div>}
|
||||||
{GlobaldummyData ? GlobalTax && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>) : (Tax == true && table2Data?.OrderType !== 'E') && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>)}
|
{GlobaldummyData ? GlobalTax && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>) : (Tax == true && table2Data?.OrderType !== 'E') && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>)}
|
||||||
|
|
@ -314,7 +302,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
{GlobaldummyData ? GlobalItem && <div style={{ width: '300%', textAlign: 'center', fontWeight: 600 }}>ITEM</div> : Item && <div style={{ width: '300%', textAlign: 'center', fontWeight: 600 }}>ITEM</div>}
|
{GlobaldummyData ? GlobalItem && <div style={{ width: '300%', textAlign: 'center', fontWeight: 600 }}>ITEM</div> : Item && <div style={{ width: '300%', textAlign: 'center', fontWeight: 600 }}>ITEM</div>}
|
||||||
{GlobaldummyData ? GlobalHsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div>}
|
{GlobaldummyData ? GlobalHsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div>}
|
||||||
{GlobaldummyData ? GlobalMRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div> : MRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div>}
|
{GlobaldummyData ? GlobalMRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div> : MRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div>}
|
||||||
{GlobaldummyData ? GlobalQuantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>QTY</div> : Quantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}> {WeightasKg ? 'QTY/KG' : 'QTY'}</div>}
|
{GlobaldummyData ? GlobalQuantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>QTY</div> : Quantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}> {WeightasKg ?'QTY/KG' :'QTY'}</div>}
|
||||||
{GlobaldummyData ? GlobalRate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div> : Rate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div>}
|
{GlobaldummyData ? GlobalRate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div> : Rate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div>}
|
||||||
{GlobaldummyData ? GlobalDiscount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div> : Discount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div>}
|
{GlobaldummyData ? GlobalDiscount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div> : Discount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div>}
|
||||||
{GlobaldummyData ? GlobalTax && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>) : (Tax == true && table2Data?.OrderType !== 'E') && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>)}
|
{GlobaldummyData ? GlobalTax && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>) : (Tax == true && table2Data?.OrderType !== 'E') && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>)}
|
||||||
|
|
@ -506,51 +494,11 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
<div style={{ marginTop: '5px', padding: 0, fontSize: "17px", fontWeight: "600" }}>{GlobaldummyData ? 'Cash' : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}Payment : {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/- </div>
|
<div style={{ marginTop: '5px', padding: 0, fontSize: "17px", fontWeight: "600" }}>{GlobaldummyData ? 'Cash' : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}Payment : {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/- </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'center',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '10px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<div className="PrintStyle3-print-stradrs" style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div className="PrintStyle3-print-stradrs" style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
|
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', width: "100%" }}>
|
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', width: "100%" }}>
|
||||||
<div style={{ fontSize: "14px", fontWeight: 600 }}>Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}</div>
|
<div style={{ fontSize: "14px", fontWeight: 600 }}>Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}</div>
|
||||||
{(PaymentStatusSuccess?.length > 1 && !isEditedBill) && (
|
{PaymentStatusSuccess?.length > 1 &&
|
||||||
<>
|
<>
|
||||||
{/* <p>Split Payment:</p> */}
|
{/* <p>Split Payment:</p> */}
|
||||||
{Object.keys(aggregatedPayments).map((paymentType) => (
|
{Object.keys(aggregatedPayments).map((paymentType) => (
|
||||||
|
|
@ -559,8 +507,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
)}
|
}
|
||||||
|
|
||||||
{GlobaldummyData && GlobalCashierName &&
|
{GlobaldummyData && GlobalCashierName &&
|
||||||
<div style={{ fontSize: "14px", fontWeight: 600 }}>Cashier : Cashier Name
|
<div style={{ fontSize: "14px", fontWeight: 600 }}>Cashier : Cashier Name
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -904,52 +851,11 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
<div style={{ marginTop: '5px', padding: 0, fontSize: "17px", fontWeight: "600" }}>{GlobaldummyData ? 'Cash' : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}Payment : {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/- </div>
|
<div style={{ marginTop: '5px', padding: 0, fontSize: "17px", fontWeight: "600" }}>{GlobaldummyData ? 'Cash' : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}Payment : {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/- </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'center',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '10px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="PrintStyle3-print-stradrs" style={{ display: 'flex', justifyContent: 'space-between' }}>
|
<div className="PrintStyle3-print-stradrs" style={{ display: 'flex', justifyContent: 'space-between' }}>
|
||||||
|
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', width: "100%" }}>
|
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', width: "100%" }}>
|
||||||
<div style={{ fontSize: "14px", fontWeight: 600 }}>Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}</div>
|
<div style={{ fontSize: "14px", fontWeight: 600 }}>Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}</div>
|
||||||
{(PaymentStatusSuccess?.length > 1 && !isEditedBill) && (
|
{PaymentStatusSuccess?.length > 1 &&
|
||||||
<>
|
<>
|
||||||
{/* <p>Split Payment:</p> */}
|
{/* <p>Split Payment:</p> */}
|
||||||
{Object.keys(aggregatedPayments).map((paymentType) => (
|
{Object.keys(aggregatedPayments).map((paymentType) => (
|
||||||
|
|
@ -958,7 +864,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
)}
|
}
|
||||||
{GlobaldummyData && GlobalCashierName &&
|
{GlobaldummyData && GlobalCashierName &&
|
||||||
<div style={{ fontSize: "14px", fontWeight: 600 }}>Cashier : Cashier Name
|
<div style={{ fontSize: "14px", fontWeight: 600 }}>Cashier : Cashier Name
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1171,7 +1077,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
{GlobaldummyData ? GlobalItem && <div style={{ width: '200%', textAlign: 'left', fontWeight: 600 }}>ITEM</div> : Item && <div style={{ width: '300%', textAlign: 'left', fontWeight: 600 }}>ITEM</div>}
|
{GlobaldummyData ? GlobalItem && <div style={{ width: '200%', textAlign: 'left', fontWeight: 600 }}>ITEM</div> : Item && <div style={{ width: '300%', textAlign: 'left', fontWeight: 600 }}>ITEM</div>}
|
||||||
{GlobaldummyData ? GlobalHsnCode && <div style={{ width: '150%', textAlign: 'right', fontWeight: 600 }}>HSN</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div>}
|
{GlobaldummyData ? GlobalHsnCode && <div style={{ width: '150%', textAlign: 'right', fontWeight: 600 }}>HSN</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div>}
|
||||||
{GlobaldummyData ? GlobalMRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div> : MRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div>}
|
{GlobaldummyData ? GlobalMRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div> : MRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div>}
|
||||||
{GlobaldummyData ? GlobalQuantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>QTY</div> : Quantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}> {WeightasKg ? 'QTY/KG' : 'QTY'}</div>}
|
{GlobaldummyData ? GlobalQuantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>QTY</div> : Quantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}> {WeightasKg ?'QTY/KG' :'QTY'}</div>}
|
||||||
{GlobaldummyData ? GlobalRate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div> : Rate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div>}
|
{GlobaldummyData ? GlobalRate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div> : Rate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div>}
|
||||||
{GlobaldummyData ? GlobalDiscount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div> : Discount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div>}
|
{GlobaldummyData ? GlobalDiscount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div> : Discount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div>}
|
||||||
{GlobaldummyData ? GlobalTax && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>) : (Tax == true && table2Data?.OrderType !== 'E') && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>)}
|
{GlobaldummyData ? GlobalTax && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>) : (Tax == true && table2Data?.OrderType !== 'E') && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>)}
|
||||||
|
|
@ -1233,7 +1139,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
{GlobaldummyData ? GlobalItem && <div style={{ width: '300%', textAlign: 'center', fontWeight: 600 }}>ITEM</div> : Item && <div style={{ width: '300%', textAlign: 'center', fontWeight: 600 }}>ITEM</div>}
|
{GlobaldummyData ? GlobalItem && <div style={{ width: '300%', textAlign: 'center', fontWeight: 600 }}>ITEM</div> : Item && <div style={{ width: '300%', textAlign: 'center', fontWeight: 600 }}>ITEM</div>}
|
||||||
{GlobaldummyData ? GlobalHsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div>}
|
{GlobaldummyData ? GlobalHsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div> : HsnCode && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>HSN</div>}
|
||||||
{GlobaldummyData ? GlobalMRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div> : MRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div>}
|
{GlobaldummyData ? GlobalMRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div> : MRP && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>MRP</div>}
|
||||||
{GlobaldummyData ? GlobalQuantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>QTY</div> : Quantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>{WeightasKg ? 'QTY/KG' : 'QTY'}</div>}
|
{GlobaldummyData ? GlobalQuantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>QTY</div> : Quantity && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>{WeightasKg ?'QTY/KG' :'QTY'}</div>}
|
||||||
{GlobaldummyData ? GlobalRate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div> : Rate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div>}
|
{GlobaldummyData ? GlobalRate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div> : Rate && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>RATE</div>}
|
||||||
{GlobaldummyData ? GlobalDiscount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div> : Discount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div>}
|
{GlobaldummyData ? GlobalDiscount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div> : Discount && <div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>DIS </div>}
|
||||||
{GlobaldummyData ? GlobalTax && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>) : (Tax == true && table2Data?.OrderType !== 'E') && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>)}
|
{GlobaldummyData ? GlobalTax && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>) : (Tax == true && table2Data?.OrderType !== 'E') && (<div style={{ width: '100%', textAlign: 'right', fontWeight: 600 }}>TAX %</div>)}
|
||||||
|
|
@ -1421,46 +1327,6 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
<div style={{ marginTop: '5px', padding: 0, fontSize: "17px", fontWeight: "600" }}>{GlobaldummyData ? 'Cash' : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}Payment : {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/- </div>
|
<div style={{ marginTop: '5px', padding: 0, fontSize: "17px", fontWeight: "600" }}>{GlobaldummyData ? 'Cash' : PaymentStatusSuccess?.length === 1 ? PaymentStatusSuccess?.[0]?.PaymentTypeName : ""}Payment : {GlobaldummyData ? '1,066' : Number(table2Data?.NetAmount).toFixed(2)}/- </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '100%', marginTop: '2px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'center',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #000'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '10px',
|
|
||||||
width: '100%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600, }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#000'
|
|
||||||
: '#000',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '4px' }}>
|
|
||||||
<span style={{ color: '#000', fontWeight: 600 }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{GlobaldummyData ? (
|
{GlobaldummyData ? (
|
||||||
GlobalCredit && (
|
GlobalCredit && (
|
||||||
|
|
@ -1519,7 +1385,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
|
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', width: "100%" }}>
|
<div style={{ display: 'flex', flexDirection: 'column', justifyContent: 'center', width: "100%" }}>
|
||||||
<div style={{ fontSize: "14px", fontWeight: 600 }}>Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}</div>
|
<div style={{ fontSize: "14px", fontWeight: 600 }}>Your Order No :{GlobaldummyData ? '01' : table2Data?.SalesId && extractLastNumber(table2Data?.SalesId)}</div>
|
||||||
{(PaymentStatusSuccess?.length > 1 && !isEditedBill) && (
|
{PaymentStatusSuccess?.length > 1 &&
|
||||||
<>
|
<>
|
||||||
{/* <p>Split Payment:</p> */}
|
{/* <p>Split Payment:</p> */}
|
||||||
{Object.keys(aggregatedPayments).map((paymentType) => (
|
{Object.keys(aggregatedPayments).map((paymentType) => (
|
||||||
|
|
@ -1528,8 +1394,7 @@ const PrintStyle3 = ({ index, totalQuantityFilter, Date1, CashierName, totalQuan
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
)}
|
}
|
||||||
|
|
||||||
{GlobaldummyData && GlobalCashierName &&
|
{GlobaldummyData && GlobalCashierName &&
|
||||||
<div style={{ fontSize: "14px", fontWeight: 600 }}>Cashier : Cashier Name
|
<div style={{ fontSize: "14px", fontWeight: 600 }}>Cashier : Cashier Name
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -264,6 +264,7 @@ const RetailDashboard = () => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isInitialLoad && CompId && AppId && selection === 'dashboard') {
|
if (isInitialLoad && CompId && AppId && selection === 'dashboard') {
|
||||||
|
// debugger
|
||||||
if (dates && dates?.[0] && dates?.[1] && !initialDate) {
|
if (dates && dates?.[0] && dates?.[1] && !initialDate) {
|
||||||
onRangeChange(dates, [
|
onRangeChange(dates, [
|
||||||
dates?.[0]?.format('DD-MM-YYYY'),
|
dates?.[0]?.format('DD-MM-YYYY'),
|
||||||
|
|
|
||||||
|
|
@ -257,29 +257,29 @@ const CardPage1 = (props) => {
|
||||||
if (isItemInCart) {
|
if (isItemInCart) {
|
||||||
newOrderDetails = newOrderDetails.map((cartItem) =>
|
newOrderDetails = newOrderDetails.map((cartItem) =>
|
||||||
cartItem.ProdId === item.ProdId &&
|
cartItem.ProdId === item.ProdId &&
|
||||||
cartItem.InwardDtlId === item.InwardDtlId &&
|
cartItem.InwardDtlId === item.InwardDtlId &&
|
||||||
cartItem.OrderRate === item.OrderRate &&
|
cartItem.OrderRate === item.OrderRate &&
|
||||||
cartItem?.BookingTypeName === item?.BookingTypeName &&
|
cartItem?.BookingTypeName === item?.BookingTypeName &&
|
||||||
!cartItem?.disabled
|
!cartItem?.disabled
|
||||||
? {
|
? {
|
||||||
...cartItem,
|
...cartItem,
|
||||||
OrderQty: cartItem.OrderQty + 1,
|
OrderQty: cartItem.OrderQty + 1,
|
||||||
TotalAmt: (cartItem.OrderQty + 1) * cartItem.OrderRate,
|
TotalAmt: (cartItem.OrderQty + 1) * cartItem.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
((cartItem.OrderQty + 1) *
|
|
||||||
cartItem.OrderRate *
|
|
||||||
cartItem.TaxPercentage) /
|
|
||||||
(100 + cartItem.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
WithoutTaxRate:
|
|
||||||
(cartItem.OrderQty + 1) * cartItem.OrderRate -
|
|
||||||
(
|
|
||||||
((cartItem.OrderQty + 1) *
|
((cartItem.OrderQty + 1) *
|
||||||
cartItem.OrderRate *
|
cartItem.OrderRate *
|
||||||
cartItem.TaxPercentage) /
|
cartItem.TaxPercentage) /
|
||||||
(100 + cartItem.TaxPercentage)
|
(100 + cartItem.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
}
|
WithoutTaxRate:
|
||||||
|
(cartItem.OrderQty + 1) * cartItem.OrderRate -
|
||||||
|
(
|
||||||
|
((cartItem.OrderQty + 1) *
|
||||||
|
cartItem.OrderRate *
|
||||||
|
cartItem.TaxPercentage) /
|
||||||
|
(100 + cartItem.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
}
|
||||||
: cartItem
|
: cartItem
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -360,11 +360,11 @@ const CardPage1 = (props) => {
|
||||||
(cartItem) =>
|
(cartItem) =>
|
||||||
cartItem?.ProdId === item?.ProductDetail?.[0]?.ProdId &&
|
cartItem?.ProdId === item?.ProductDetail?.[0]?.ProdId &&
|
||||||
cartItem?.InwardDtlId ===
|
cartItem?.InwardDtlId ===
|
||||||
item?.ProductDetail?.[0]?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
item?.ProductDetail?.[0]?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||||
?.InwardDtlId &&
|
?.InwardDtlId &&
|
||||||
cartItem?.OrderRate ===
|
cartItem?.OrderRate ===
|
||||||
item?.ProductDetail?.[0]?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
item?.ProductDetail?.[0]?.ProdVariantDetails?.[0]?.StockDetails?.[0]
|
||||||
?.SellPrice
|
?.SellPrice
|
||||||
);
|
);
|
||||||
if (Isincart && Isincart?.StockAvailable === 'Y') {
|
if (Isincart && Isincart?.StockAvailable === 'Y') {
|
||||||
if (Isincart?.BalanceQty > Isincart?.OrderQty) {
|
if (Isincart?.BalanceQty > Isincart?.OrderQty) {
|
||||||
|
|
@ -419,13 +419,13 @@ const CardPage1 = (props) => {
|
||||||
(cartItem) =>
|
(cartItem) =>
|
||||||
cartItem?.ProdId === qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId &&
|
cartItem?.ProdId === qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdId &&
|
||||||
cartItem?.InwardDtlId ===
|
cartItem?.InwardDtlId ===
|
||||||
qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[
|
qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[
|
||||||
item?.VarientIndex
|
item?.VarientIndex
|
||||||
]?.StockDetails?.[0]?.InwardDtlId &&
|
]?.StockDetails?.[0]?.InwardDtlId &&
|
||||||
cartItem?.OrderRate ===
|
cartItem?.OrderRate ===
|
||||||
qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[
|
qtydata?.ProductDetail?.[item?.QtyIndex]?.ProdVariantDetails?.[
|
||||||
item?.VarientIndex
|
item?.VarientIndex
|
||||||
]?.StockDetails?.[0]?.SellPrice
|
]?.StockDetails?.[0]?.SellPrice
|
||||||
);
|
);
|
||||||
console.log(Isincart, item, KioskOrderDetails, 'IsincartsingleVarient');
|
console.log(Isincart, item, KioskOrderDetails, 'IsincartsingleVarient');
|
||||||
if (Isincart && Isincart?.StockAvailable === 'Y') {
|
if (Isincart && Isincart?.StockAvailable === 'Y') {
|
||||||
|
|
@ -543,7 +543,7 @@ const CardPage1 = (props) => {
|
||||||
SinglePc: onePcs ? 'Y' : 'N',
|
SinglePc: onePcs ? 'Y' : 'N',
|
||||||
NoOfPcs: onePcs
|
NoOfPcs: onePcs
|
||||||
? a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
? a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
?.StockDetails?.[stockIndex]?.NoOfPcs
|
?.StockDetails?.[stockIndex]?.NoOfPcs
|
||||||
: null,
|
: null,
|
||||||
ProdVariantName:
|
ProdVariantName:
|
||||||
a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
|
|
@ -568,14 +568,14 @@ const CardPage1 = (props) => {
|
||||||
?.StockDetails?.[stockIndex]?.InwardId,
|
?.StockDetails?.[stockIndex]?.InwardId,
|
||||||
MRP: onePcs
|
MRP: onePcs
|
||||||
? a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
? a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
?.StockDetails?.[stockIndex]?.OnePcsPrice
|
?.StockDetails?.[stockIndex]?.OnePcsPrice
|
||||||
: a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
: a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
?.StockDetails?.[stockIndex]?.MRP,
|
?.StockDetails?.[stockIndex]?.MRP,
|
||||||
OrderRate: onePcs
|
OrderRate: onePcs
|
||||||
? a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
? a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
?.StockDetails?.[stockIndex]?.OnePcsPrice
|
?.StockDetails?.[stockIndex]?.OnePcsPrice
|
||||||
: a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
: a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
?.StockDetails?.[stockIndex]?.SellPrice,
|
?.StockDetails?.[stockIndex]?.SellPrice,
|
||||||
SuppId:
|
SuppId:
|
||||||
a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
a?.ProductDetail?.[QtyIndex]?.ProdVariantDetails?.[VarientIndex]
|
||||||
?.StockDetails?.[stockIndex]?.SuppId,
|
?.StockDetails?.[stockIndex]?.SuppId,
|
||||||
|
|
@ -603,6 +603,7 @@ const CardPage1 = (props) => {
|
||||||
};
|
};
|
||||||
// add Product in cart state
|
// add Product in cart state
|
||||||
const AddOrderDetails = async (item) => {
|
const AddOrderDetails = async (item) => {
|
||||||
|
// debugger
|
||||||
message.success(`${item?.ProdName} Added in the Cart`);
|
message.success(`${item?.ProdName} Added in the Cart`);
|
||||||
const isItemInCart = KioskOrderDetails?.find(
|
const isItemInCart = KioskOrderDetails?.find(
|
||||||
(cartItem) =>
|
(cartItem) =>
|
||||||
|
|
@ -618,29 +619,29 @@ const CardPage1 = (props) => {
|
||||||
changeKioskOrderDetails(
|
changeKioskOrderDetails(
|
||||||
KioskOrderDetails?.map((cartItem) =>
|
KioskOrderDetails?.map((cartItem) =>
|
||||||
cartItem.ProdId === item.ProdId &&
|
cartItem.ProdId === item.ProdId &&
|
||||||
cartItem.InwardDtlId === item.InwardDtlId &&
|
cartItem.InwardDtlId === item.InwardDtlId &&
|
||||||
cartItem.OrderRate === item.OrderRate &&
|
cartItem.OrderRate === item.OrderRate &&
|
||||||
cartItem?.BookingTypeName === item?.BookingTypeName &&
|
cartItem?.BookingTypeName === item?.BookingTypeName &&
|
||||||
!cartItem?.disabled
|
!cartItem?.disabled
|
||||||
? {
|
? {
|
||||||
...cartItem,
|
...cartItem,
|
||||||
OrderQty: cartItem.OrderQty + 1,
|
OrderQty: cartItem.OrderQty + 1,
|
||||||
TotalAmt: (cartItem.OrderQty + 1) * cartItem.OrderRate,
|
TotalAmt: (cartItem.OrderQty + 1) * cartItem.OrderRate,
|
||||||
TaxAmt: (
|
TaxAmt: (
|
||||||
((cartItem.OrderQty + 1) *
|
|
||||||
cartItem.OrderRate *
|
|
||||||
cartItem.TaxPercentage) /
|
|
||||||
(100 + cartItem.TaxPercentage)
|
|
||||||
).toFixed(2),
|
|
||||||
WithoutTaxRate:
|
|
||||||
(cartItem.OrderQty + 1) * cartItem.OrderRate -
|
|
||||||
(
|
|
||||||
((cartItem.OrderQty + 1) *
|
((cartItem.OrderQty + 1) *
|
||||||
cartItem.OrderRate *
|
cartItem.OrderRate *
|
||||||
cartItem.TaxPercentage) /
|
cartItem.TaxPercentage) /
|
||||||
(100 + cartItem.TaxPercentage)
|
(100 + cartItem.TaxPercentage)
|
||||||
).toFixed(2),
|
).toFixed(2),
|
||||||
}
|
WithoutTaxRate:
|
||||||
|
(cartItem.OrderQty + 1) * cartItem.OrderRate -
|
||||||
|
(
|
||||||
|
((cartItem.OrderQty + 1) *
|
||||||
|
cartItem.OrderRate *
|
||||||
|
cartItem.TaxPercentage) /
|
||||||
|
(100 + cartItem.TaxPercentage)
|
||||||
|
).toFixed(2),
|
||||||
|
}
|
||||||
: cartItem
|
: cartItem
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -861,7 +862,7 @@ const CardPage1 = (props) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="KioskCardmaster"
|
className="KioskCardmaster"
|
||||||
style={{ height: '100vh', }}
|
style={{ height: '100vh', }}
|
||||||
>
|
>
|
||||||
{/* Top area */}
|
{/* Top area */}
|
||||||
<div style={{ backgroundColor: '#EEEEEE', overflow: 'auto' }}>
|
<div style={{ backgroundColor: '#EEEEEE', overflow: 'auto' }}>
|
||||||
|
|
@ -874,7 +875,7 @@ const CardPage1 = (props) => {
|
||||||
? props.class
|
? props.class
|
||||||
: 'KioskCard-card-main'
|
: 'KioskCard-card-main'
|
||||||
}
|
}
|
||||||
// style={{ backgroundColor: getKioskLightColourdata }}
|
// style={{ backgroundColor: getKioskLightColourdata }}
|
||||||
>
|
>
|
||||||
{/* Mapping through kioskCategoriesCard */}
|
{/* Mapping through kioskCategoriesCard */}
|
||||||
{(selfBookingOption === 'Card Only' ||
|
{(selfBookingOption === 'Card Only' ||
|
||||||
|
|
@ -890,9 +891,9 @@ const CardPage1 = (props) => {
|
||||||
card?.OverAllQty,
|
card?.OverAllQty,
|
||||||
KioskOrderDetails
|
KioskOrderDetails
|
||||||
) > 0) ||
|
) > 0) ||
|
||||||
card?.ProductDetail?.some(
|
card?.ProductDetail?.some(
|
||||||
(item) => item?.StockAvailable !== 'Y'
|
(item) => item?.StockAvailable !== 'Y'
|
||||||
)
|
)
|
||||||
? 'KioskCard-card'
|
? 'KioskCard-card'
|
||||||
: 'KioskCard-card-dis'
|
: 'KioskCard-card-dis'
|
||||||
}
|
}
|
||||||
|
|
@ -922,9 +923,9 @@ const CardPage1 = (props) => {
|
||||||
card?.OverAllQty,
|
card?.OverAllQty,
|
||||||
KioskOrderDetails
|
KioskOrderDetails
|
||||||
) > 0) ||
|
) > 0) ||
|
||||||
card?.ProductDetail?.some(
|
card?.ProductDetail?.some(
|
||||||
(item) => item?.StockAvailable !== 'Y'
|
(item) => item?.StockAvailable !== 'Y'
|
||||||
) ? (
|
) ? (
|
||||||
''
|
''
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
|
|
@ -956,57 +957,57 @@ const CardPage1 = (props) => {
|
||||||
{card?.ProductDetail?.filter(
|
{card?.ProductDetail?.filter(
|
||||||
(item) => item.OnePcsAvailable == 'Y'
|
(item) => item.OnePcsAvailable == 'Y'
|
||||||
).length !== 0 && (
|
).length !== 0 && (
|
||||||
<div
|
<div
|
||||||
className="card4Main-onepiece-selfBooking"
|
className="card4Main-onepiece-selfBooking"
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
e.stopPropagation(); // Stop event propagation to the parent div
|
e.stopPropagation(); // Stop event propagation to the parent div
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!(
|
!(
|
||||||
(card?.OverAllQty !== undefined &&
|
(card?.OverAllQty !== undefined &&
|
||||||
returnOnepcCount(
|
returnOnepcCount(
|
||||||
card?.ProductDetail?.[0]?.ProdName,
|
card?.ProductDetail?.[0]?.ProdName,
|
||||||
card?.OverAllPcs,
|
card?.OverAllPcs,
|
||||||
CartOrderDetails
|
CartOrderDetails
|
||||||
) > 0) ||
|
) > 0) ||
|
||||||
card?.ProductDetail?.some(
|
card?.ProductDetail?.some(
|
||||||
(item) => item?.StockAvailable !== 'Y'
|
(item) => item?.StockAvailable !== 'Y'
|
||||||
)
|
|
||||||
)
|
)
|
||||||
) {
|
)
|
||||||
return; // Don't proceed if the condition isn't met
|
) {
|
||||||
} else {
|
return; // Don't proceed if the condition isn't met
|
||||||
CardOnClick(card, 'OnePeiceProduct'); // This only runs when you click the "One Piece" button
|
} else {
|
||||||
}
|
CardOnClick(card, 'OnePeiceProduct'); // This only runs when you click the "One Piece" button
|
||||||
}}
|
}
|
||||||
style={{
|
}}
|
||||||
fontFamily: SelectedCardFont || '',
|
style={{
|
||||||
backgroundColor:
|
fontFamily: SelectedCardFont || '',
|
||||||
SelectedCardColor?.FontColor || '#f00000ff',
|
backgroundColor:
|
||||||
color:
|
SelectedCardColor?.FontColor || '#f00000ff',
|
||||||
returnOnepcCount(
|
color:
|
||||||
card?.ProductDetail?.[0]?.ProdName,
|
returnOnepcCount(
|
||||||
card?.OverAllPcs,
|
card?.ProductDetail?.[0]?.ProdName,
|
||||||
CartOrderDetails
|
card?.OverAllPcs,
|
||||||
) > 0 ||
|
CartOrderDetails
|
||||||
card?.ProductDetail?.some(
|
) > 0 ||
|
||||||
(product) => product?.StockAvailable !== 'Y'
|
card?.ProductDetail?.some(
|
||||||
)
|
(product) => product?.StockAvailable !== 'Y'
|
||||||
? true
|
)
|
||||||
? SelectedCardColor?.BackgroundColor ||
|
? true
|
||||||
|
? SelectedCardColor?.BackgroundColor ||
|
||||||
'#000000'
|
'#000000'
|
||||||
: '#fff'
|
: '#fff'
|
||||||
: '#ff4d4f',
|
: '#ff4d4f',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
{' '}
|
{' '}
|
||||||
{AppName?.toLowerCase() === 'sports'
|
{AppName?.toLowerCase() === 'sports'
|
||||||
? 'Single'
|
? 'Single'
|
||||||
: '1PCS'}{' '}
|
: '1PCS'}{' '}
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,6 @@ const PreferenceList = () => {
|
||||||
weeklysalesreport: allSettingsMap['weeklysalesreport'] === 'Y',
|
weeklysalesreport: allSettingsMap['weeklysalesreport'] === 'Y',
|
||||||
notificationblink: allSettingsMap['notificationblink'] === 'Y',
|
notificationblink: allSettingsMap['notificationblink'] === 'Y',
|
||||||
onlineindivdualslots: allSettingsMap['onlineindivdualslots'] === 'Y',
|
onlineindivdualslots: allSettingsMap['onlineindivdualslots'] === 'Y',
|
||||||
editbill: allSettingsMap['editbill'] === 'Y',
|
|
||||||
notification: [
|
notification: [
|
||||||
...(allSettingsMap['onbilltime'] === 'Y' ? ['onbilltime'] : []),
|
...(allSettingsMap['onbilltime'] === 'Y' ? ['onbilltime'] : []),
|
||||||
...(allSettingsMap['1daybefore'] === 'Y' ? ['1daybefore'] : []),
|
...(allSettingsMap['1daybefore'] === 'Y' ? ['1daybefore'] : []),
|
||||||
|
|
@ -309,7 +308,6 @@ const PreferenceList = () => {
|
||||||
lowstockreport: values.lowstockreport,
|
lowstockreport: values.lowstockreport,
|
||||||
weeklysalesreport: values.weeklysalesreport,
|
weeklysalesreport: values.weeklysalesreport,
|
||||||
notificationblink: values.notificationblink,
|
notificationblink: values.notificationblink,
|
||||||
editbill: values.editbill,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const arrayValues = {
|
const arrayValues = {
|
||||||
|
|
@ -629,7 +627,6 @@ const PreferenceList = () => {
|
||||||
'Do you Want Customised Bill Number?'
|
'Do you Want Customised Bill Number?'
|
||||||
)}
|
)}
|
||||||
{renderCheckbox('upiqr', 'Do you want to show the UPI QR code?')}
|
{renderCheckbox('upiqr', 'Do you want to show the UPI QR code?')}
|
||||||
{/* {renderCheckbox('editbill', 'Do you want to edit the previously created bill?')} */}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Divider />
|
<Divider />
|
||||||
|
|
|
||||||
|
|
@ -1034,6 +1034,7 @@ const TableBooking = ({ PaymentStatus }) => {
|
||||||
);
|
);
|
||||||
|
|
||||||
const navigatetoBooking = async (data) => {
|
const navigatetoBooking = async (data) => {
|
||||||
|
|
||||||
const OrderDetails = data?.OrderDetails?.[0];
|
const OrderDetails = data?.OrderDetails?.[0];
|
||||||
const {
|
const {
|
||||||
OrderDtlDetails,
|
OrderDtlDetails,
|
||||||
|
|
|
||||||
|
|
@ -49,18 +49,6 @@ const PaymentPdfBooking = ({
|
||||||
let PaymentStatusSuccess = PaymentStatus?.filter(
|
let PaymentStatusSuccess = PaymentStatus?.filter(
|
||||||
(ps) => ps.PaymentStatus === 'S'
|
(ps) => ps.PaymentStatus === 'S'
|
||||||
);
|
);
|
||||||
const isEditedBill = PaymentStatus?.some(payment => {
|
|
||||||
const type = payment?.AdjustmentType?.toLowerCase();
|
|
||||||
return (
|
|
||||||
(type === 'extra' || type === 'refund') &&
|
|
||||||
payment?.BeforeAdjustment != null &&
|
|
||||||
payment?.AfterAdjustment != null
|
|
||||||
);
|
|
||||||
});
|
|
||||||
const lastTransaction = PaymentStatus?.find(
|
|
||||||
(ps) => ps.PaymentStatus === 'S' && ps?.LastOrderTran === 'Y'
|
|
||||||
)
|
|
||||||
console.log(singleData2?.filter(data => data?.EditTokenAvailable !== 'N'), "singleData2")
|
|
||||||
const ExtraChargeTotal = table2Data?.ExtraChargeDetails?.reduce(
|
const ExtraChargeTotal = table2Data?.ExtraChargeDetails?.reduce(
|
||||||
(accumulator, currentObject) => {
|
(accumulator, currentObject) => {
|
||||||
return accumulator + currentObject.TotalAmt;
|
return accumulator + currentObject.TotalAmt;
|
||||||
|
|
@ -92,7 +80,6 @@ const PaymentPdfBooking = ({
|
||||||
const [BranchZip, setBranchZip] = useState();
|
const [BranchZip, setBranchZip] = useState();
|
||||||
const CashierName = getSession('userName');
|
const CashierName = getSession('userName');
|
||||||
const printerTemplateStyle = useSelector(SelectedPrintTemplate);
|
const printerTemplateStyle = useSelector(SelectedPrintTemplate);
|
||||||
console.log(printerTemplateStyle, "printerTemplateStyle")
|
|
||||||
const appPreferences = useSelector(ApplicationPreferences);
|
const appPreferences = useSelector(ApplicationPreferences);
|
||||||
const SettingData = useSelector(PreferenceData);
|
const SettingData = useSelector(PreferenceData);
|
||||||
const estimatePrintHeader =
|
const estimatePrintHeader =
|
||||||
|
|
@ -310,21 +297,6 @@ const PaymentPdfBooking = ({
|
||||||
return `${h}:${m}${suffix}`;
|
return `${h}:${m}${suffix}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getAdjustmentLabel = (type) => {
|
|
||||||
switch (type?.toUpperCase()) {
|
|
||||||
case 'REFUND':
|
|
||||||
return 'Returned Item Amount';
|
|
||||||
case 'EXTRA':
|
|
||||||
return 'Additional Amount';
|
|
||||||
case 'DISCOUNT':
|
|
||||||
return 'Discount Applied';
|
|
||||||
case 'ROUND_OFF':
|
|
||||||
return 'Round Off';
|
|
||||||
default:
|
|
||||||
return 'Adjustment Amount';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="Reprint-body" id={`RePrint-${index}`}>
|
<div className="Reprint-body" id={`RePrint-${index}`}>
|
||||||
|
|
@ -369,8 +341,8 @@ const PaymentPdfBooking = ({
|
||||||
{table2Data?.AddressDetails?.[0]?.City &&
|
{table2Data?.AddressDetails?.[0]?.City &&
|
||||||
table2Data?.AddressDetails?.[0]?.Zip &&
|
table2Data?.AddressDetails?.[0]?.Zip &&
|
||||||
table2Data?.AddressDetails?.[0]?.City +
|
table2Data?.AddressDetails?.[0]?.City +
|
||||||
'- ' +
|
'- ' +
|
||||||
table2Data?.AddressDetails?.[0]?.Zip}
|
table2Data?.AddressDetails?.[0]?.Zip}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -386,9 +358,9 @@ const PaymentPdfBooking = ({
|
||||||
GSTIN: {table2Data?.BrGSTIN}
|
GSTIN: {table2Data?.BrGSTIN}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{table2Data?.BrMobile && <p style={{ fontSize: '9px', margin: '7px 0 0 0', padding: 0 }}>
|
<p style={{ fontSize: '9px', margin: '7px 0 0 0', padding: 0 }}>
|
||||||
Mobile:+91 {table2Data?.BrMobile}
|
Mobile:+91 {table2Data?.BrMobile}
|
||||||
</p>}
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -463,7 +435,7 @@ const PaymentPdfBooking = ({
|
||||||
|
|
||||||
<div className="Re-print-top2">
|
<div className="Re-print-top2">
|
||||||
<div className="Re-print-bold1">
|
<div className="Re-print-bold1">
|
||||||
Bill No:
|
BillNo:
|
||||||
{table2Data?.OrderId &&
|
{table2Data?.OrderId &&
|
||||||
extractLastNumberOrderId(
|
extractLastNumberOrderId(
|
||||||
table2Data?.OrderId,
|
table2Data?.OrderId,
|
||||||
|
|
@ -540,27 +512,27 @@ const PaymentPdfBooking = ({
|
||||||
|
|
||||||
{item?.ProductIdentifierDtls?.length > 0
|
{item?.ProductIdentifierDtls?.length > 0
|
||||||
? item?.ProductIdentifierDtls.filter(
|
? item?.ProductIdentifierDtls.filter(
|
||||||
(items) =>
|
(items) =>
|
||||||
items.SerialNumber &&
|
items.SerialNumber &&
|
||||||
items.SerialNumber !== ''
|
items.SerialNumber !== ''
|
||||||
).map((a, i) => (
|
).map((a, i) => (
|
||||||
<div key={i}>{a.SerialNumber}</div>
|
<div key={i}>{a.SerialNumber}</div>
|
||||||
))
|
))
|
||||||
: ''}
|
: ''}
|
||||||
{item?.ProductIdentifierDtls?.length > 0
|
{item?.ProductIdentifierDtls?.length > 0
|
||||||
? item?.ProductIdentifierDtls.filter(
|
? item?.ProductIdentifierDtls.filter(
|
||||||
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
|
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
|
||||||
).map((id, i) => {
|
).map((id, i) => {
|
||||||
const imei1 = id.IMEI1 || '';
|
const imei1 = id.IMEI1 || '';
|
||||||
const imei2 = id.IMEI2 || '';
|
const imei2 = id.IMEI2 || '';
|
||||||
return (
|
return (
|
||||||
<div key={i}>
|
<div key={i}>
|
||||||
{[imei1, imei2]
|
{[imei1, imei2]
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
.join(',')}
|
.join(',')}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
: ''}
|
: ''}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -577,25 +549,25 @@ const PaymentPdfBooking = ({
|
||||||
|
|
||||||
{item?.ProductIdentifierDtls?.length > 0
|
{item?.ProductIdentifierDtls?.length > 0
|
||||||
? item?.ProductIdentifierDtls.filter(
|
? item?.ProductIdentifierDtls.filter(
|
||||||
(items) =>
|
(items) =>
|
||||||
items.SerialNumber &&
|
items.SerialNumber &&
|
||||||
items.SerialNumber !== ''
|
items.SerialNumber !== ''
|
||||||
).map((a, i) => (
|
).map((a, i) => (
|
||||||
<div key={i}>{a.SerialNumber}</div>
|
<div key={i}>{a.SerialNumber}</div>
|
||||||
))
|
))
|
||||||
: ''}
|
: ''}
|
||||||
{item?.ProductIdentifierDtls?.length > 0
|
{item?.ProductIdentifierDtls?.length > 0
|
||||||
? item?.ProductIdentifierDtls.filter(
|
? item?.ProductIdentifierDtls.filter(
|
||||||
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
|
(id) => id.IMEI1 !== '' || id.IMEI2 !== ''
|
||||||
).map((id, i) => {
|
).map((id, i) => {
|
||||||
const imei1 = id.IMEI1 || '';
|
const imei1 = id.IMEI1 || '';
|
||||||
const imei2 = id.IMEI2 || '';
|
const imei2 = id.IMEI2 || '';
|
||||||
return (
|
return (
|
||||||
<div key={i}>
|
<div key={i}>
|
||||||
{[imei1, imei2].filter(Boolean).join(',')}
|
{[imei1, imei2].filter(Boolean).join(',')}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
: ''}
|
: ''}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
|
@ -1137,7 +1109,7 @@ const PaymentPdfBooking = ({
|
||||||
></div>
|
></div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{(PaymentStatusSuccess?.length > 1 && !isEditedBill) && (
|
{PaymentStatusSuccess?.length > 1 && (
|
||||||
<>
|
<>
|
||||||
{/* <p>Split Payment:</p> */}
|
{/* <p>Split Payment:</p> */}
|
||||||
{Object.keys(aggregatedPayments)?.map((paymentType) => (
|
{Object.keys(aggregatedPayments)?.map((paymentType) => (
|
||||||
|
|
@ -1150,48 +1122,6 @@ const PaymentPdfBooking = ({
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{isEditedBill && lastTransaction && (
|
|
||||||
<div style={{
|
|
||||||
width: '90%', marginTop: '2px',
|
|
||||||
marginLeft: '10px',
|
|
||||||
paddingTop: '2px', display: 'flex', justifyContent: 'center', alignItems: 'center',
|
|
||||||
flexDirection: 'column', borderTop: '1px dashed #ccc'
|
|
||||||
}}>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
fontSize: '12px',
|
|
||||||
width: '70%'
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#333' }}>Bill Gross Amount</span>
|
|
||||||
<strong>{(lastTransaction?.BeforeAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
display: 'flex',
|
|
||||||
justifyContent: 'space-between',
|
|
||||||
marginTop: '4px',
|
|
||||||
fontWeight: 600,
|
|
||||||
color:
|
|
||||||
lastTransaction?.AdjustmentType === 'REFUND'
|
|
||||||
? '#d32f2f'
|
|
||||||
: '#2e7d32',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<span>{'Adjustment Amount'}</span>
|
|
||||||
<span>
|
|
||||||
{lastTransaction?.AdjustmentType === 'REFUND' ? '-' : '+'}
|
|
||||||
{(lastTransaction?.Amount || 0).toFixed(2)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
|
|
||||||
<span style={{ color: '#333' }}>Net Bill Amount</span>
|
|
||||||
<strong>{(lastTransaction?.AfterAdjustment || 0).toFixed(2)}</strong>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{table2Data?.CustSuppName && (
|
{table2Data?.CustSuppName && (
|
||||||
<div>
|
<div>
|
||||||
<p
|
<p
|
||||||
|
|
@ -1652,7 +1582,7 @@ const PaymentPdfBooking = ({
|
||||||
|
|
||||||
{/* Token print */}
|
{/* Token print */}
|
||||||
{Object.entries(
|
{Object.entries(
|
||||||
singleData2?.filter(data => data?.EditTokenAvailable !== 'N')?.reduce((acc, item, idx) => {
|
singleData2?.reduce((acc, item, idx) => {
|
||||||
if (item.TokenAvailable === 'Y') {
|
if (item.TokenAvailable === 'Y') {
|
||||||
if (!item.CounterName) {
|
if (!item.CounterName) {
|
||||||
// For null or empty CounterName, print each item individually
|
// For null or empty CounterName, print each item individually
|
||||||
|
|
@ -1677,7 +1607,7 @@ const PaymentPdfBooking = ({
|
||||||
<p className="Re-print-title">Token</p>
|
<p className="Re-print-title">Token</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="Re-print-top2">
|
<div className="Re-print-top2">
|
||||||
<p className="Re-print-bold">Bill No: {orderId}</p>
|
<p className="Re-print-bold">BillNo: {orderId}</p>
|
||||||
<p className="Re-print-bold">{Date1}</p>
|
<p className="Re-print-bold">{Date1}</p>
|
||||||
</div>
|
</div>
|
||||||
<table className="Re-print-Table">
|
<table className="Re-print-Table">
|
||||||
|
|
@ -1695,9 +1625,9 @@ const PaymentPdfBooking = ({
|
||||||
<tr className="Re-print-body-Tr" key={idx}>
|
<tr className="Re-print-body-Tr" key={idx}>
|
||||||
<td className="Re-print-td">{idx + 1}</td>
|
<td className="Re-print-td">{idx + 1}</td>
|
||||||
<td className="Re-print-body-Product">{item.ProdName}</td>
|
<td className="Re-print-body-Product">{item.ProdName}</td>
|
||||||
<td className="Re-print-body-Rate">{item?.EditTokenAvailable === 'Y' ? item?.EditTokenQty : item.SalesQty}</td>
|
<td className="Re-print-body-Rate">{item.SalesQty}</td>
|
||||||
<td className="Re-print-body-Rate">{item.Rate}</td>
|
<td className="Re-print-body-Rate">{item.Rate}</td>
|
||||||
<td className="Re-print-body-Rate">{((item?.EditTokenAvailable === 'Y' ? item?.EditTokenQty : item.SalesQty) * item.Rate) - ((item?.EditTokenAvailable === 'Y' ? (item?.OfferAmt / item?.EditTokenQty) : item?.OfferAmt))}</td>
|
<td className="Re-print-body-Rate">{item.TotalAmt}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue