combo screen edit qty and rate added
This commit is contained in:
parent
1d7944d28c
commit
4c10e36840
|
|
@ -48,6 +48,8 @@ const BSBillingEditQuantity = (props) => {
|
||||||
const priceChangeInputRef = useRef(null);
|
const priceChangeInputRef = useRef(null);
|
||||||
const reductionInputRef = useRef(null);
|
const reductionInputRef = useRef(null);
|
||||||
|
|
||||||
|
const { setIndex = () => {} } = props;
|
||||||
|
|
||||||
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
||||||
const SessionData = useSelector(StoredSessionData);
|
const SessionData = useSelector(StoredSessionData);
|
||||||
// const AppId = SessionData?.AppId;
|
// const AppId = SessionData?.AppId;
|
||||||
|
|
@ -670,6 +672,7 @@ const BSBillingEditQuantity = (props) => {
|
||||||
props.handleEditQuantityCancel();
|
props.handleEditQuantityCancel();
|
||||||
setClearQuantity(false);
|
setClearQuantity(false);
|
||||||
}
|
}
|
||||||
|
setIndex(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleEditQuantity = async (
|
const handleEditQuantity = async (
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
.EditQTYcomboInput {
|
||||||
|
width: 80px;
|
||||||
|
height: 25px;
|
||||||
|
border: none;
|
||||||
|
outline: none !important;
|
||||||
|
padding: 2px;
|
||||||
|
text-align: center;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
font-weight: 500;
|
||||||
|
vertical-align: middle;
|
||||||
|
background-color: #1292ee;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
&::placeholder {
|
||||||
|
color: #bdd4ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.EditQTYcomboInputRate {
|
||||||
|
width: 80px;
|
||||||
|
height: 25px;
|
||||||
|
border: none;
|
||||||
|
outline: none !important;
|
||||||
|
padding: 2px !important;
|
||||||
|
text-align: center;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
font-weight: 500;
|
||||||
|
vertical-align: middle;
|
||||||
|
background-color: #1292ee;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 4px;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: 0 !important;
|
||||||
|
padding-top: unset !important;
|
||||||
|
|
||||||
|
&::placeholder {
|
||||||
|
color: #bdd4ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: #1292ee !important;
|
||||||
|
padding: 2px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// .EditQuantity-Content .ant-form-item
|
||||||
|
|
||||||
|
.rateTdEditRate {
|
||||||
|
.ant-form-item {
|
||||||
|
padding-bottom: 0 !important;
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
}
|
||||||
|
.ant-form-item-control-input {
|
||||||
|
min-height: unset;
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useRef, useState } from 'react';
|
||||||
import './ComboSalesBillTable.scss';
|
import './ComboSalesBillTable.scss';
|
||||||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||||
import { Popconfirm, Tooltip } from 'antd';
|
import { Popconfirm, Tooltip } from 'antd';
|
||||||
|
|
@ -73,6 +73,8 @@ import {
|
||||||
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
||||||
import { useRemoveProducts } from '../BSBillingTable3/RemoveCartWithOffer.jsx';
|
import { useRemoveProducts } from '../BSBillingTable3/RemoveCartWithOffer.jsx';
|
||||||
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
||||||
|
import ComboEditQty from '../ComboBillTableEdit/ComboEditQty.jsx';
|
||||||
|
import ComboEditRate from '../ComboBillTableEdit/ComboEditRate.jsx';
|
||||||
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
||||||
|
|
||||||
const ComboSalesBillTable = () => {
|
const ComboSalesBillTable = () => {
|
||||||
|
|
@ -131,7 +133,8 @@ const ComboSalesBillTable = () => {
|
||||||
const GetCustId = useSelector(GlobalCustId);
|
const GetCustId = useSelector(GlobalCustId);
|
||||||
const selectedCustomer = useSelector(GlobalSelOption);
|
const selectedCustomer = useSelector(GlobalSelOption);
|
||||||
|
|
||||||
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] = useState(false);
|
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] =
|
||||||
|
useState(false);
|
||||||
const [customerProduct, setCustomerProduct] = useState(null);
|
const [customerProduct, setCustomerProduct] = useState(null);
|
||||||
|
|
||||||
const tableDataDinein = tableData?.filter(
|
const tableDataDinein = tableData?.filter(
|
||||||
|
|
@ -145,16 +148,18 @@ const ComboSalesBillTable = () => {
|
||||||
OrderType === 'Hold'
|
OrderType === 'Hold'
|
||||||
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
? tableData?.filter((a, b) => a.BookingTypeName === 'TakeAway')
|
||||||
: tableData?.filter(
|
: tableData?.filter(
|
||||||
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
(a, b) => a.BookingTypeName === 'TakeAway' && !a?.SalesId
|
||||||
);
|
);
|
||||||
const OldtableDataTakeAway =
|
const OldtableDataTakeAway =
|
||||||
OrderType != 'Hold'
|
OrderType != 'Hold'
|
||||||
? tableData?.filter(
|
? tableData?.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);
|
||||||
|
const [EditQtyCombo, setEditQtyCombo] = useState(false);
|
||||||
|
const [EditRateCombo, setEditRateCombo] = useState(false);
|
||||||
const [Modaldata, setModaldata] = useState([]);
|
const [Modaldata, setModaldata] = useState([]);
|
||||||
const [triggerAnimation, setTriggerAnimation] = useState(true);
|
const [triggerAnimation, setTriggerAnimation] = useState(true);
|
||||||
// const editField =
|
// const editField =
|
||||||
|
|
@ -169,6 +174,32 @@ const ComboSalesBillTable = () => {
|
||||||
// const [BillOrderPre, setBillOrderPre] = useState();
|
// const [BillOrderPre, setBillOrderPre] = useState();
|
||||||
// console.log(BillOrderPre,'BillOrderPre');
|
// console.log(BillOrderPre,'BillOrderPre');
|
||||||
|
|
||||||
|
const [qtyEdit, setQtyEdit] = useState(false);
|
||||||
|
const qtyTdRef = useRef(null);
|
||||||
|
const qtyInputRef = useRef(null);
|
||||||
|
|
||||||
|
const handleEditQTYcombo = () => {
|
||||||
|
if (!qtyEdit) {
|
||||||
|
setQtyEdit(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Outside click handler for quantity edit
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const handleOutsideClick = (e) => {
|
||||||
|
if (qtyEdit && qtyTdRef.current && !qtyTdRef.current.contains(e.target)) {
|
||||||
|
setQtyEdit(false); // 👈 outside click → close edit
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
document.addEventListener('mousedown', handleOutsideClick);
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener('mousedown', handleOutsideClick);
|
||||||
|
};
|
||||||
|
}, [qtyEdit]);
|
||||||
|
// Outside click handler for quantity edit End
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (tableOptions?.length > 0) {
|
if (tableOptions?.length > 0) {
|
||||||
let editFieldValue = tableOptions?.filter(
|
let editFieldValue = tableOptions?.filter(
|
||||||
|
|
@ -255,7 +286,7 @@ const ComboSalesBillTable = () => {
|
||||||
const handleCustomerProductPriceHistory = (item) => {
|
const handleCustomerProductPriceHistory = (item) => {
|
||||||
setCustomerPriceHistoryOpen(true);
|
setCustomerPriceHistoryOpen(true);
|
||||||
setCustomerProduct(item?.ProdId);
|
setCustomerProduct(item?.ProdId);
|
||||||
}
|
};
|
||||||
|
|
||||||
const handleEditQuantity = (value) => {
|
const handleEditQuantity = (value) => {
|
||||||
if (OtherServicesglobal && value.Type == 'OS' && value.ServiceType == 'I') {
|
if (OtherServicesglobal && value.Type == 'OS' && value.ServiceType == 'I') {
|
||||||
|
|
@ -270,10 +301,43 @@ const ComboSalesBillTable = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const handleEditQuantityCombo = (value) => {
|
||||||
|
if (OtherServicesglobal && value.Type == 'OS' && value.ServiceType == 'I') {
|
||||||
|
setEditQtyCombo(false);
|
||||||
|
} else {
|
||||||
|
if (value?.SalesId) {
|
||||||
|
setEditQtyCombo(false);
|
||||||
|
} else {
|
||||||
|
setEditQtyCombo(true);
|
||||||
|
setEditRateCombo(false);
|
||||||
|
setModaldata(value);
|
||||||
|
setIndex(value?.localId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const handleEditRateCombo = (value) => {
|
||||||
|
if (OtherServicesglobal && value.Type == 'OS' && value.ServiceType == 'I') {
|
||||||
|
setEditRateCombo(false);
|
||||||
|
} else {
|
||||||
|
if (value?.SalesId) {
|
||||||
|
setEditRateCombo(false);
|
||||||
|
} else {
|
||||||
|
setEditRateCombo(true);
|
||||||
|
setModaldata(value);
|
||||||
|
setIndex(value?.localId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const handleEditQuantityCancel = () => {
|
const handleEditQuantityCancel = () => {
|
||||||
setEditQuantity(false);
|
setEditQuantity(false);
|
||||||
};
|
};
|
||||||
|
const handleEditQuantityComboCancel = () => {
|
||||||
|
setEditQtyCombo(false);
|
||||||
|
};
|
||||||
|
const handleEditRateComboCancel = () => {
|
||||||
|
setEditRateCombo(false);
|
||||||
|
};
|
||||||
|
|
||||||
const OpenEditTotalAmount = () => {
|
const OpenEditTotalAmount = () => {
|
||||||
setOpenEditTotalAmt(true);
|
setOpenEditTotalAmt(true);
|
||||||
|
|
@ -1058,9 +1122,9 @@ const ComboSalesBillTable = () => {
|
||||||
)?.map((item, idx) =>
|
)?.map((item, idx) =>
|
||||||
idx === 0
|
idx === 0
|
||||||
? {
|
? {
|
||||||
...item,
|
...item,
|
||||||
FreeQty,
|
FreeQty,
|
||||||
}
|
}
|
||||||
: item
|
: item
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
@ -2115,9 +2179,11 @@ const ComboSalesBillTable = () => {
|
||||||
|
|
||||||
{/* Delete */}
|
{/* Delete */}
|
||||||
{item.OptionName === 'Delete' && (
|
{item.OptionName === 'Delete' && (
|
||||||
<th className="deleteTh"
|
<th
|
||||||
|
className="deleteTh"
|
||||||
style={{ textAlign: 'center', width: '80px' }}
|
style={{ textAlign: 'center', width: '80px' }}
|
||||||
key={item.OptionId}>
|
key={item.OptionId}
|
||||||
|
>
|
||||||
{tableData?.length > 0 ? (
|
{tableData?.length > 0 ? (
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="Delete the items"
|
title="Delete the items"
|
||||||
|
|
@ -2180,20 +2246,20 @@ const ComboSalesBillTable = () => {
|
||||||
tableDataDinein?.length >= PreviousdataLength
|
tableDataDinein?.length >= PreviousdataLength
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: BookingType !== 'Dine In' &&
|
: BookingType !== 'Dine In' &&
|
||||||
triggerAnimation &&
|
triggerAnimation &&
|
||||||
OldtableDataTakeAway?.length + index === 0 &&
|
OldtableDataTakeAway?.length + index === 0 &&
|
||||||
tableDataDinein?.length >= PreviousdataLength &&
|
tableDataDinein?.length >= PreviousdataLength &&
|
||||||
!HoldOrderDtl &&
|
!HoldOrderDtl &&
|
||||||
!UnpaidData
|
!UnpaidData
|
||||||
? 'wheat'
|
? 'wheat'
|
||||||
: 'inherit'
|
: 'inherit'
|
||||||
: 'none',
|
: 'none',
|
||||||
background: row?.SalesId
|
background: row?.SalesId
|
||||||
? 'rgb(243, 248, 213)'
|
? 'rgb(243, 248, 213)'
|
||||||
: GlobEstBooking === 'ParEst' &&
|
: GlobEstBooking === 'ParEst' &&
|
||||||
GlobProdwisedata?.includes(
|
GlobProdwisedata?.includes(
|
||||||
row?.InwardDtlId + ' ' + row?.BookingTypeName
|
row?.InwardDtlId + ' ' + row?.BookingTypeName
|
||||||
)
|
)
|
||||||
? '#b2d1f7'
|
? '#b2d1f7'
|
||||||
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
: (OldtableDataTakeAway?.length + index) % 2 === 0
|
||||||
? 'white'
|
? 'white'
|
||||||
|
|
@ -2228,39 +2294,37 @@ const ComboSalesBillTable = () => {
|
||||||
{/* Product Name / Item */}
|
{/* Product Name / Item */}
|
||||||
{(item.OptionName === 'Item' ||
|
{(item.OptionName === 'Item' ||
|
||||||
item.OptionName === 'Product Name') && (
|
item.OptionName === 'Product Name') && (
|
||||||
<td
|
<td
|
||||||
key={`prod-${index}`}
|
key={`prod-${index}`}
|
||||||
className="productNameTd"
|
className="productNameTd"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
row.FullProductIdentifierDtls?.length > 0 ||
|
row.FullProductIdentifierDtls?.length > 0 ||
|
||||||
row.ProductIdentifierDtls?.length > 0
|
row.ProductIdentifierDtls?.length > 0
|
||||||
? handleImeiDetails(row)
|
? handleImeiDetails(row)
|
||||||
: editField && handleEditQuantity(row)
|
: editField && handleEditQuantity(row)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{row?.Type !== 'OS' ? row.ProdName : row.ServiceName}
|
{row?.Type !== 'OS' ? row.ProdName : row.ServiceName}
|
||||||
{row?.BrandName ? ` ${row.BrandName}` : ''}
|
{row?.BrandName ? ` ${row.BrandName}` : ''}
|
||||||
{row?.Type !== 'C' && (
|
{row?.Type !== 'C' && (
|
||||||
<p className="Tbl3-Variant">
|
<p className="Tbl3-Variant">
|
||||||
{/* {row?.ProdVariantName} {row?.Size} {row?.UomName} */}
|
{/* {row?.ProdVariantName} {row?.Size} {row?.UomName} */}
|
||||||
(
|
(
|
||||||
{!row?.ProdVariantName?.toLowerCase()?.includes(
|
{!row?.ProdVariantName?.toLowerCase()?.includes(
|
||||||
'variant'
|
'variant'
|
||||||
) && <span>{row?.ProdVariantName} </span>}
|
) && <span>{row?.ProdVariantName} </span>}
|
||||||
{row?.Size}
|
{row?.Size}
|
||||||
{row?.SinglePc == 'Y' ? 'PCS' : row?.UomName}
|
{row?.SinglePc == 'Y' ? 'PCS' : row?.UomName})
|
||||||
|
</p>
|
||||||
)
|
)}
|
||||||
|
{row?.Type === 'C' &&
|
||||||
|
row.ProdDetail?.map((prod, idx) => (
|
||||||
|
<p key={idx}>
|
||||||
|
{prod.ProdName} - {prod.Size} {prod.UomName}
|
||||||
</p>
|
</p>
|
||||||
)}
|
))}
|
||||||
{row?.Type === 'C' &&
|
</td>
|
||||||
row.ProdDetail?.map((prod, idx) => (
|
)}
|
||||||
<p key={idx}>
|
|
||||||
{prod.ProdName} - {prod.Size} {prod.UomName}
|
|
||||||
</p>
|
|
||||||
))}
|
|
||||||
</td>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Barcode */}
|
{/* Barcode */}
|
||||||
{item.OptionName === 'Barcode' && (
|
{item.OptionName === 'Barcode' && (
|
||||||
|
|
@ -2276,11 +2340,36 @@ const ComboSalesBillTable = () => {
|
||||||
{/* Quantity */}
|
{/* Quantity */}
|
||||||
{item.OptionName === 'Quantity' && (
|
{item.OptionName === 'Quantity' && (
|
||||||
<td
|
<td
|
||||||
|
ref={qtyTdRef}
|
||||||
key={`qty-${index}`}
|
key={`qty-${index}`}
|
||||||
className="qtyTd"
|
// className="qtyTd"
|
||||||
onClick={() => editField && handleEditQuantity(row)}
|
className={
|
||||||
|
EditQtyCombo && row?.localId === Index
|
||||||
|
? 'EditQTYcomboTD'
|
||||||
|
: 'qtyTd'
|
||||||
|
}
|
||||||
|
onClick={() =>
|
||||||
|
editField && handleEditQuantityCombo(row)
|
||||||
|
}
|
||||||
|
// onClick={() => handleEditQTYcombo()}
|
||||||
>
|
>
|
||||||
{row.OrderQty}
|
{(!EditQtyCombo || row?.localId !== Index) && (
|
||||||
|
<>{row.OrderQty}</>
|
||||||
|
)}
|
||||||
|
{EditQtyCombo && row?.localId === Index && (
|
||||||
|
<ComboEditQty
|
||||||
|
key={`edit-qty-${Index}`}
|
||||||
|
handleEditQuantityCancel={
|
||||||
|
handleEditQuantityComboCancel
|
||||||
|
}
|
||||||
|
BSBillingEditQuantity={EditQtyCombo}
|
||||||
|
Productdata={Modaldata}
|
||||||
|
Index={Index}
|
||||||
|
setIndex={setIndex}
|
||||||
|
setEditQtyCombo={setEditQtyCombo}
|
||||||
|
// id={`qty-${index}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -2288,12 +2377,31 @@ const ComboSalesBillTable = () => {
|
||||||
{item.OptionName === 'Rate' && (
|
{item.OptionName === 'Rate' && (
|
||||||
<td
|
<td
|
||||||
key={`rate-${index}`}
|
key={`rate-${index}`}
|
||||||
className="rateTd"
|
// className="rateTd"
|
||||||
onClick={() => editField && handleEditQuantity(row)}
|
className={EditRateCombo ? 'rateTdEditRate' : 'rateTd'}
|
||||||
|
// onClick={() => editField && handleEditQuantity(row)}
|
||||||
|
onClick={() => editField && handleEditRateCombo(row)}
|
||||||
>
|
>
|
||||||
{allowDecimal
|
{!EditRateCombo || row?.localId !== Index ? (
|
||||||
? Number(row?.OrderRate).toFixed(2)
|
<>
|
||||||
: Number(row?.OrderRate)}
|
{allowDecimal
|
||||||
|
? Number(row?.OrderRate).toFixed(2)
|
||||||
|
: Number(row?.OrderRate)}
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
{EditRateCombo && row?.localId === Index && (
|
||||||
|
<ComboEditRate
|
||||||
|
key={`edit-rate-${Index}`}
|
||||||
|
handleEditRateComboCancel={
|
||||||
|
handleEditRateComboCancel
|
||||||
|
}
|
||||||
|
BSBillingEditRate={EditRateCombo}
|
||||||
|
Productdata={Modaldata}
|
||||||
|
Index={Index}
|
||||||
|
setIndex={setIndex}
|
||||||
|
setEditRateCombo={setEditRateCombo}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -2306,9 +2414,9 @@ const ComboSalesBillTable = () => {
|
||||||
>
|
>
|
||||||
{row?.Offer > 0
|
{row?.Offer > 0
|
||||||
? `${(
|
? `${(
|
||||||
(row.Offer / (row?.OrderQty * row?.OrderRate)) *
|
(row.Offer / (row?.OrderQty * row?.OrderRate)) *
|
||||||
100
|
100
|
||||||
).toFixed(2)}%`
|
).toFixed(2)}%`
|
||||||
: '-'}
|
: '-'}
|
||||||
</td>
|
</td>
|
||||||
)}
|
)}
|
||||||
|
|
@ -2411,9 +2519,10 @@ const ComboSalesBillTable = () => {
|
||||||
BSBillingEditQuantity={EditQuantity}
|
BSBillingEditQuantity={EditQuantity}
|
||||||
Productdata={Modaldata}
|
Productdata={Modaldata}
|
||||||
Index={Index}
|
Index={Index}
|
||||||
|
setIndex={setIndex}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{(customerPriceHistoryOpen && GetCustId) &&
|
{customerPriceHistoryOpen && GetCustId && (
|
||||||
<CustomerPriceHistory
|
<CustomerPriceHistory
|
||||||
open={customerPriceHistoryOpen}
|
open={customerPriceHistoryOpen}
|
||||||
custId={GetCustId}
|
custId={GetCustId}
|
||||||
|
|
@ -2422,7 +2531,7 @@ const ComboSalesBillTable = () => {
|
||||||
setCustomerProduct={setCustomerProduct}
|
setCustomerProduct={setCustomerProduct}
|
||||||
selectedCustomer={selectedCustomer}
|
selectedCustomer={selectedCustomer}
|
||||||
/>
|
/>
|
||||||
}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
|
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap");
|
||||||
|
|
||||||
.combo-sales-bill-table {
|
.combo-sales-bill-table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: 'Inter', sans-serif;
|
font-family: "Inter", sans-serif;
|
||||||
|
|
||||||
.bill-table {
|
.bill-table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
border: 1px solid #9c9c9c;
|
border: 1px solid #9c9c9c;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
font-family: 'Poppins', sans-serif !important;
|
font-family: "Poppins", sans-serif !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
}
|
}
|
||||||
.rateTd {
|
.rateTd {
|
||||||
width: 90px;
|
width: 90px;
|
||||||
text-align: right;
|
text-align: center;
|
||||||
}
|
}
|
||||||
.discPerTh {
|
.discPerTh {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
@ -119,7 +119,7 @@
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.totalTh {
|
.totalTh {
|
||||||
text-align: center;
|
text-align: right;
|
||||||
width: 170px;
|
width: 170px;
|
||||||
}
|
}
|
||||||
.totalTd {
|
.totalTd {
|
||||||
|
|
@ -161,3 +161,31 @@
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.EditQTYcomboInput {
|
||||||
|
width: 80px;
|
||||||
|
height: 25px;
|
||||||
|
border: none;
|
||||||
|
outline: none !important;
|
||||||
|
padding: 2px;
|
||||||
|
text-align: center;
|
||||||
|
font-family: "Poppins", sans-serif;
|
||||||
|
font-weight: 500;
|
||||||
|
vertical-align: middle;
|
||||||
|
background-color: #1292ee;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
&::placeholder {
|
||||||
|
color: #bdd4ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.EditQTYcomboTD {
|
||||||
|
padding: 1px !important;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.rateTdEditRate {
|
||||||
|
padding: 1px !important;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,11 @@ import CardPopover from '../BSBillingTables/StandardTable/Utils/CardPopover.jsx'
|
||||||
import UpiPopover from '../BSBillingTables/StandardTable/Utils/UpiPopOver.jsx';
|
import UpiPopover from '../BSBillingTables/StandardTable/Utils/UpiPopOver.jsx';
|
||||||
import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js';
|
import { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.js';
|
||||||
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 pozologoimg from '../../../../Images/pozologoimg.png';
|
||||||
import PaymentGatewayEmbedded from '../UtillComponents/PaymentGatewayEmbedded.jsx';
|
import PaymentGatewayEmbedded from '../UtillComponents/PaymentGatewayEmbedded.jsx';
|
||||||
|
|
@ -266,7 +270,9 @@ const BSC1Payment = (props) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
||||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
||||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
const previousOrderOfferDetails = useSelector(
|
||||||
|
GlobalPreviousOrderOfferDetails
|
||||||
|
);
|
||||||
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
||||||
const SessionData = useSelector(StoredSessionData);
|
const SessionData = useSelector(StoredSessionData);
|
||||||
const BranchFinancialStatus = useSelector(GlobalBranchFinancialStatus);
|
const BranchFinancialStatus = useSelector(GlobalBranchFinancialStatus);
|
||||||
|
|
@ -349,11 +355,15 @@ const BSC1Payment = (props) => {
|
||||||
(preference) => preference?.PreferredCatName === 'Common Module'
|
(preference) => preference?.PreferredCatName === 'Common Module'
|
||||||
)?.PreferenceCatDetails;
|
)?.PreferenceCatDetails;
|
||||||
const sportsAppPreference = commonModulePreference?.find(
|
const sportsAppPreference = commonModulePreference?.find(
|
||||||
(preference) => preference?.PreferredSubCatName === 'SportsApp'
|
(preference) =>
|
||||||
&&
|
preference?.PreferredSubCatName === 'SportsApp' &&
|
||||||
preference?.PreferredStatus == 'Y'
|
preference?.PreferredStatus == 'Y'
|
||||||
);
|
);
|
||||||
console.log(sportsAppPreference,commonModulePreference,"sportsAppPreference")
|
console.log(
|
||||||
|
sportsAppPreference,
|
||||||
|
commonModulePreference,
|
||||||
|
'sportsAppPreference'
|
||||||
|
);
|
||||||
const bookingTypePreference = appPreferences?.find(
|
const bookingTypePreference = appPreferences?.find(
|
||||||
(preference) => preference?.PreferredCatName === 'Booking Type'
|
(preference) => preference?.PreferredCatName === 'Booking Type'
|
||||||
)?.PreferenceCatDetails;
|
)?.PreferenceCatDetails;
|
||||||
|
|
@ -683,7 +693,6 @@ const BSC1Payment = (props) => {
|
||||||
}, [salesBillEdit]);
|
}, [salesBillEdit]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
||||||
if (salesBillEdit) {
|
if (salesBillEdit) {
|
||||||
if (SelCustId) {
|
if (SelCustId) {
|
||||||
setRefundPayBtns(AllPaymentOptions);
|
setRefundPayBtns(AllPaymentOptions);
|
||||||
|
|
@ -698,8 +707,7 @@ const BSC1Payment = (props) => {
|
||||||
setRefundPayBtns(withoutCustomer);
|
setRefundPayBtns(withoutCustomer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}, [AllPaymentOptions, SelCustId, salesBillEdit]);
|
||||||
}, [AllPaymentOptions, SelCustId, salesBillEdit])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!preOrder) {
|
if (!preOrder) {
|
||||||
|
|
@ -760,14 +768,21 @@ const BSC1Payment = (props) => {
|
||||||
|
|
||||||
const filteredPayments =
|
const filteredPayments =
|
||||||
previousOrderPayment?.filter(
|
previousOrderPayment?.filter(
|
||||||
p => p?.LastOrderTran === 'Y' && p?.AfterAdjustment != null && p?.AfterAdjustment !== '' && p?.AfterAdjustment
|
(p) =>
|
||||||
|
p?.LastOrderTran === 'Y' &&
|
||||||
|
p?.AfterAdjustment != null &&
|
||||||
|
p?.AfterAdjustment !== '' &&
|
||||||
|
p?.AfterAdjustment
|
||||||
) || [];
|
) || [];
|
||||||
|
|
||||||
const paymentsToUse =
|
const paymentsToUse =
|
||||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
filteredPayments.length > 0
|
||||||
|
? filteredPayments
|
||||||
|
: previousOrderPayment || [];
|
||||||
|
|
||||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
const totalPreviouspayment = paymentsToUse?.reduce(
|
||||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
(acc, payment) =>
|
||||||
|
acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -776,23 +791,38 @@ const BSC1Payment = (props) => {
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
const previousNetAmount =
|
const previousNetAmount = totalPreviouspayment || 0;
|
||||||
(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(
|
const currentOrderNetAmount = formatAmount(
|
||||||
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);
|
setTotalAmount(
|
||||||
|
salesBillEdit
|
||||||
|
? currentOrderNetAmount > previousNetAmount
|
||||||
|
? currentOrderNetAmount - previousNetAmount
|
||||||
|
: 0
|
||||||
|
: currentOrderNetAmount
|
||||||
|
);
|
||||||
setCurrentOrderNetAmount(currentOrderNetAmount);
|
setCurrentOrderNetAmount(currentOrderNetAmount);
|
||||||
setPreviousNetAmount(previousNetAmount);
|
setPreviousNetAmount(previousNetAmount);
|
||||||
dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount));
|
dispatch(
|
||||||
|
changeSummeryTotalAmount(
|
||||||
|
salesBillEdit
|
||||||
|
? currentOrderNetAmount > previousNetAmount
|
||||||
|
? currentOrderNetAmount - previousNetAmount
|
||||||
|
: 0
|
||||||
|
: currentOrderNetAmount
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
||||||
|
|
||||||
|
|
@ -812,7 +842,7 @@ const BSC1Payment = (props) => {
|
||||||
OverAllEstimate,
|
OverAllEstimate,
|
||||||
globalTipAmount,
|
globalTipAmount,
|
||||||
OtherServiceTicketClaim,
|
OtherServiceTicketClaim,
|
||||||
Discount
|
Discount,
|
||||||
]);
|
]);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let data = {
|
let data = {
|
||||||
|
|
@ -1233,7 +1263,11 @@ const BSC1Payment = (props) => {
|
||||||
const handleButtonClick = () => {
|
const handleButtonClick = () => {
|
||||||
if (qrCode && SelectedUPIPayOption === 'Default') {
|
if (qrCode && SelectedUPIPayOption === 'Default') {
|
||||||
UpiPayment();
|
UpiPayment();
|
||||||
} else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) {
|
} else if (
|
||||||
|
salesBillEdit &&
|
||||||
|
currentOrderNetAmount < previousNetAmount &&
|
||||||
|
!refundPaySelected
|
||||||
|
) {
|
||||||
setMessageType('warning');
|
setMessageType('warning');
|
||||||
setMessageData('Please Select Refund Payment Method');
|
setMessageData('Please Select Refund Payment Method');
|
||||||
return;
|
return;
|
||||||
|
|
@ -1425,7 +1459,7 @@ const BSC1Payment = (props) => {
|
||||||
const handleRefundPaymentMode = (id, name) => {
|
const handleRefundPaymentMode = (id, name) => {
|
||||||
setRefundPaySelected(id);
|
setRefundPaySelected(id);
|
||||||
setRefundPaySelectedName(name);
|
setRefundPaySelectedName(name);
|
||||||
}
|
};
|
||||||
|
|
||||||
const AddCardOption = (data) => {
|
const AddCardOption = (data) => {
|
||||||
setSelectedCardOption(data);
|
setSelectedCardOption(data);
|
||||||
|
|
@ -1774,7 +1808,7 @@ const BSC1Payment = (props) => {
|
||||||
|
|
||||||
const selectedStyle =
|
const selectedStyle =
|
||||||
stylesMap[
|
stylesMap[
|
||||||
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
printerTemplateStyle == undefined ? 'Style 13' : printerTemplateStyle
|
||||||
];
|
];
|
||||||
|
|
||||||
if (selectedStyle) {
|
if (selectedStyle) {
|
||||||
|
|
@ -2171,15 +2205,15 @@ const BSC1Payment = (props) => {
|
||||||
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',
|
||||||
|
|
@ -2263,7 +2297,7 @@ const BSC1Payment = (props) => {
|
||||||
: 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:
|
||||||
|
|
@ -2280,87 +2314,115 @@ const BSC1Payment = (props) => {
|
||||||
? globalTipAmount === 0
|
? globalTipAmount === 0
|
||||||
? SelectedTableDetails
|
? SelectedTableDetails
|
||||||
: SelectedTableDetails?.map((item) => ({
|
: SelectedTableDetails?.map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
TipsAmount: globalTipAmount,
|
TipsAmount: globalTipAmount,
|
||||||
}))
|
}))
|
||||||
: null,
|
: null,
|
||||||
// "Credit": TotalAmount,
|
// "Credit": TotalAmount,
|
||||||
// "Debit": 0,
|
// "Debit": 0,
|
||||||
SalesPaymentType: 'normal',
|
SalesPaymentType: 'normal',
|
||||||
PaymentDetail: [
|
PaymentDetail: [
|
||||||
{
|
{
|
||||||
PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected :
|
PaymentType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi'
|
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
? refundPaySelected
|
||||||
? PaymentDeviceUPI?.[0]?.ModeId
|
: Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'pg'
|
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
||||||
? PaymentgatewayUPI?.[0]?.ModeId
|
? PaymentDeviceUPI?.[0]?.ModeId
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
: SelectedUPIPayOption?.toLowerCase() === 'pg'
|
||||||
? BusinessPayOption?.find(
|
? PaymentgatewayUPI?.[0]?.ModeId
|
||||||
(busupi) => busupi?.ModeId === UpiId
|
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
)?.ModeId
|
? BusinessPayOption?.find(
|
||||||
: paybtnselected
|
(busupi) => busupi?.ModeId === UpiId
|
||||||
: paybtnselected
|
)?.ModeId
|
||||||
? paybtnselected
|
: paybtnselected
|
||||||
: null,
|
: paybtnselected
|
||||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
? paybtnselected
|
||||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
: null,
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
Amount:
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'business'
|
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? previousNetAmount - currentOrderNetAmount
|
||||||
?.MerchantId
|
: Math.round(TotalAmount),
|
||||||
: null,
|
MerchantId:
|
||||||
PaymentOptionType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) && (refundPaySelectedName?.toLowerCase() === 'cash' || refundPaySelectedName?.toLowerCase() === 'credit') ? 'PC' :
|
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
? null
|
||||||
? 'PC'
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
? 'PC'
|
|
||||||
: Paybtnnameselected?.toLowerCase() === 'card'
|
|
||||||
? SelectedCardOption
|
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi'
|
|
||||||
? SelectedUPIPayOption?.toLowerCase() === 'default'
|
|
||||||
? 'PC'
|
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
|
||||||
? 'BU'
|
|
||||||
: SelectedUPIPayOption
|
|
||||||
: null,
|
|
||||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
|
||||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
|
||||||
?.UPIDetailId
|
|
||||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
|
||||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||||
?.MerchantUPIId
|
?.MerchantId
|
||||||
: null,
|
: null,
|
||||||
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
PaymentOptionType:
|
||||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
salesBillEdit &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
currentOrderNetAmount < previousNetAmount &&
|
||||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
(refundPaySelectedName?.toLowerCase() === 'cash' ||
|
||||||
(upipay) => upipay?.UPIId === UpiId
|
refundPaySelectedName?.toLowerCase() === 'credit')
|
||||||
)
|
? 'PC'
|
||||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
? 'PC'
|
||||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
SelectedCardOption?.toLowerCase() === 'pd')
|
? 'PC'
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
: Paybtnnameselected?.toLowerCase() === 'card'
|
||||||
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
? SelectedCardOption
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
: Paybtnnameselected?.toLowerCase() === 'upi'
|
||||||
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
? SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
SelectedCardOption?.toLowerCase() === 'pg')
|
? 'PC'
|
||||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
: [],
|
? 'BU'
|
||||||
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
: SelectedUPIPayOption
|
||||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
: null,
|
||||||
? 'S'
|
ModeOfPayment:
|
||||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||||
? 'S'
|
? null
|
||||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
: SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
|
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||||
|
?.UPIDetailId
|
||||||
|
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||||
|
? BusinessPayOption?.find(
|
||||||
|
(busupi) => busupi?.ModeId === UpiId
|
||||||
|
)?.MerchantUPIId
|
||||||
|
: null,
|
||||||
|
AccountDtl:
|
||||||
|
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||||
|
? []
|
||||||
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
|
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||||
|
(upipay) => upipay?.UPIId === UpiId
|
||||||
|
)
|
||||||
|
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
|
SelectedUPIPayOption?.toLowerCase() === 'pd') ||
|
||||||
|
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||||
|
SelectedCardOption?.toLowerCase() === 'pd')
|
||||||
|
? useOptions?.[0]?.PaymentDetails?.PaymentDevice
|
||||||
|
: (Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
|
SelectedUPIPayOption?.toLowerCase() === 'pg') ||
|
||||||
|
(Paybtnnameselected?.toLowerCase() === 'card' &&
|
||||||
|
SelectedCardOption?.toLowerCase() === 'pg')
|
||||||
|
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||||
|
: [],
|
||||||
|
PaymentStatus:
|
||||||
|
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||||
|
? 'S'
|
||||||
|
: Paybtnnameselected?.toLowerCase() === 'cash'
|
||||||
|
? 'S'
|
||||||
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? 'S'
|
? 'S'
|
||||||
: 'P',
|
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||||
Debit: (salesBillEdit && currentOrderNetAmount < previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(previousNetAmount - currentOrderNetAmount) : 0,
|
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||||
Credit: salesBillEdit ? (currentOrderNetAmount > previousNetAmount && refundPaySelectedName?.toLowerCase() === 'credit') ? Math.round(TotalAmount) : 0 :
|
? 'S'
|
||||||
Paybtnnameselected?.toLowerCase() === 'credit'
|
: 'P',
|
||||||
|
Debit:
|
||||||
|
salesBillEdit &&
|
||||||
|
currentOrderNetAmount < previousNetAmount &&
|
||||||
|
refundPaySelectedName?.toLowerCase() === 'credit'
|
||||||
|
? Math.round(previousNetAmount - currentOrderNetAmount)
|
||||||
|
: 0,
|
||||||
|
Credit: salesBillEdit
|
||||||
|
? currentOrderNetAmount > previousNetAmount &&
|
||||||
|
refundPaySelectedName?.toLowerCase() === 'credit'
|
||||||
|
? Math.round(TotalAmount)
|
||||||
|
: 0
|
||||||
|
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||||
? Math.round(TotalAmount)
|
? Math.round(TotalAmount)
|
||||||
: 0,
|
: 0,
|
||||||
},
|
},
|
||||||
|
|
@ -2425,14 +2487,14 @@ const BSC1Payment = (props) => {
|
||||||
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]);
|
||||||
|
|
@ -2583,20 +2645,21 @@ 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');
|
||||||
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]);
|
||||||
|
|
@ -2700,14 +2763,14 @@ const BSC1Payment = (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]);
|
||||||
|
|
@ -2804,14 +2867,14 @@ const BSC1Payment = (props) => {
|
||||||
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]);
|
||||||
|
|
@ -2829,7 +2892,7 @@ const BSC1Payment = (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
|
||||||
|
|
||||||
|
|
@ -3848,30 +3911,31 @@ const BSC1Payment = (props) => {
|
||||||
(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 &&
|
||||||
|
currentOrderNetAmount >= previousNetAmount ? (
|
||||||
paybtns?.map((payment) => (
|
paybtns?.map((payment) => (
|
||||||
<div className="Table3-cash">
|
<div className="Table3-cash">
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
paybtnselected === payment.ModeId &&
|
paybtnselected === payment.ModeId &&
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
(UpinotSelected || CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode-notupisel'
|
? 'Btn-payment-mode-notupisel'
|
||||||
: paybtnselected === payment.ModeId &&
|
: paybtnselected === payment.ModeId &&
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
(!UpinotSelected || !CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode'
|
? 'Btn-payment-mode'
|
||||||
: 'Btn-payment-mode-sel'
|
: 'Btn-payment-mode-sel'
|
||||||
}
|
}
|
||||||
|
|
@ -3936,16 +4000,18 @@ const BSC1Payment = (props) => {
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
))
|
))
|
||||||
) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? (
|
) : currentOrderNetAmount < previousNetAmount &&
|
||||||
|
salesBillEdit &&
|
||||||
|
refundPayBtns.length > 0 ? (
|
||||||
refundPayBtns.map((payment) => (
|
refundPayBtns.map((payment) => (
|
||||||
<div className="Table3-cash">
|
<div className="Table3-cash">
|
||||||
<button
|
<button
|
||||||
className={
|
className={
|
||||||
refundPaySelected === payment.ConfigId &&
|
refundPaySelected === payment.ConfigId &&
|
||||||
(UpinotSelected || CardoptionnotSelected)
|
(UpinotSelected || CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode-notupisel'
|
? 'Btn-payment-mode-notupisel'
|
||||||
: refundPaySelected === payment.ConfigId &&
|
: refundPaySelected === payment.ConfigId &&
|
||||||
(!UpinotSelected || !CardoptionnotSelected)
|
(!UpinotSelected || !CardoptionnotSelected)
|
||||||
? 'Btn-payment-mode'
|
? 'Btn-payment-mode'
|
||||||
: 'Btn-payment-mode-sel'
|
: 'Btn-payment-mode-sel'
|
||||||
}
|
}
|
||||||
|
|
@ -3955,7 +4021,12 @@ const BSC1Payment = (props) => {
|
||||||
? 'blink-animation 0.5s infinite alternate'
|
? 'blink-animation 0.5s infinite alternate'
|
||||||
: 'none',
|
: 'none',
|
||||||
}}
|
}}
|
||||||
onClick={() => handleRefundPaymentMode(payment?.ConfigId, payment?.ConfigName)}
|
onClick={() =>
|
||||||
|
handleRefundPaymentMode(
|
||||||
|
payment?.ConfigId,
|
||||||
|
payment?.ConfigName
|
||||||
|
)
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
||||||
|
|
||||||
|
|
@ -3988,16 +4059,16 @@ const BSC1Payment = (props) => {
|
||||||
(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,
|
||||||
}}
|
}}
|
||||||
|
|
@ -4017,14 +4088,14 @@ const BSC1Payment = (props) => {
|
||||||
style={{
|
style={{
|
||||||
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
|
||||||
? '#fff'
|
? '#fff'
|
||||||
: '#ffffffff',
|
: '#ffffffff',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
|
|
@ -4087,6 +4158,17 @@ const BSC1Payment = (props) => {
|
||||||
<div style={{ width: '4px' }}> : </div>
|
<div style={{ width: '4px' }}> : </div>
|
||||||
<div style={{ textAlign: 'right', width: '1rem' }}> {Qty} </div>
|
<div style={{ textAlign: 'right', width: '1rem' }}> {Qty} </div>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
style={{ display: 'flex', alignItems: 'center' }}
|
||||||
|
className="BSC1Payment-div4-naming"
|
||||||
|
>
|
||||||
|
<div style={{ width: '3rem' }}>Dis </div>
|
||||||
|
<div style={{ width: '4px' }}> : </div>
|
||||||
|
<div style={{ textAlign: 'right', width: '1rem' }}>
|
||||||
|
{' '}
|
||||||
|
{Discount}{' '}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -4120,61 +4202,19 @@ const BSC1Payment = (props) => {
|
||||||
{/* {item?.OptionName=="Hold" && */}
|
{/* {item?.OptionName=="Hold" && */}
|
||||||
{unpaidFlow == false
|
{unpaidFlow == false
|
||||||
? item?.OptionName == 'Hold' &&
|
? item?.OptionName == 'Hold' &&
|
||||||
BookingType !== 'Dine In' &&
|
BookingType !== 'Dine In' &&
|
||||||
!BookingTypeBoth &&
|
!BookingTypeBoth &&
|
||||||
OrderCardDetail?.length != 0 &&
|
OrderCardDetail?.length != 0 &&
|
||||||
CheckOrderType?.length === 0 &&
|
CheckOrderType?.length === 0 &&
|
||||||
OrderType != 'Failed' &&
|
OrderType != 'Failed' &&
|
||||||
CheckBookingStatus != 'Close' &&
|
CheckBookingStatus != 'Close' &&
|
||||||
!addnewAccess && (
|
!addnewAccess && (
|
||||||
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
<TooltipWrapper title={'Hold'} isMobile={isMobile}>
|
||||||
{' '}
|
{' '}
|
||||||
<div
|
|
||||||
style={{
|
|
||||||
backgroundColor: '' ? '#52c41a' : '#1292EE',
|
|
||||||
color: '' ? '#52c41a' : '#ffffffff',
|
|
||||||
height: '40px',
|
|
||||||
width: '45px',
|
|
||||||
borderRadius: '6px',
|
|
||||||
display: 'flex',
|
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center',
|
|
||||||
padding: '8px 8px 12px 8px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<PozoHoldIcon
|
|
||||||
className="BSBillingNav-icon-table-icon"
|
|
||||||
onClick={() => AddBookingDetails('Hold')}
|
|
||||||
style={{
|
|
||||||
cursor: 'pointer',
|
|
||||||
// color: '' ? '#52c41a' : '#1292EE',
|
|
||||||
}}
|
|
||||||
/>{' '}
|
|
||||||
{/* <p className="payOptionDecition"> Hold</p> */}
|
|
||||||
</div>
|
|
||||||
</TooltipWrapper>
|
|
||||||
)
|
|
||||||
: ''}
|
|
||||||
|
|
||||||
{unpaidFlow == false
|
|
||||||
? item?.OptionName == 'Hold' &&
|
|
||||||
BookingType !== 'Dine In' &&
|
|
||||||
!BookingTypeBoth &&
|
|
||||||
Holddata?.length > 0 &&
|
|
||||||
OrderCardDetail?.length == 0 &&
|
|
||||||
CheckBookingStatus != 'Close' &&
|
|
||||||
!addnewAccess && (
|
|
||||||
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
|
||||||
{' '}
|
|
||||||
<Badge
|
|
||||||
count={Holddata?.length}
|
|
||||||
size={'small'}
|
|
||||||
offset={[0, 7]}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: Holddata ? '#52c41a' : 'default',
|
backgroundColor: '' ? '#52c41a' : '#1292EE',
|
||||||
color: Holddata ? '#ffffffff' : 'default',
|
color: '' ? '#52c41a' : '#ffffffff',
|
||||||
height: '40px',
|
height: '40px',
|
||||||
width: '45px',
|
width: '45px',
|
||||||
borderRadius: '6px',
|
borderRadius: '6px',
|
||||||
|
|
@ -4186,18 +4226,60 @@ const BSC1Payment = (props) => {
|
||||||
>
|
>
|
||||||
<PozoHoldIcon
|
<PozoHoldIcon
|
||||||
className="BSBillingNav-icon-table-icon"
|
className="BSBillingNav-icon-table-icon"
|
||||||
onClick={() => HandleholdModelOpen()}
|
onClick={() => AddBookingDetails('Hold')}
|
||||||
style={{
|
style={{
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
// color: Holddata ? '#52c41a' : 'default',
|
// color: '' ? '#52c41a' : '#1292EE',
|
||||||
pointerEvents:
|
|
||||||
OrderType === 'Failed' ? 'none' : 'auto',
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>{' '}
|
||||||
|
{/* <p className="payOptionDecition"> Hold</p> */}
|
||||||
</div>
|
</div>
|
||||||
</Badge>
|
</TooltipWrapper>
|
||||||
</TooltipWrapper>
|
)
|
||||||
)
|
: ''}
|
||||||
|
|
||||||
|
{unpaidFlow == false
|
||||||
|
? item?.OptionName == 'Hold' &&
|
||||||
|
BookingType !== 'Dine In' &&
|
||||||
|
!BookingTypeBoth &&
|
||||||
|
Holddata?.length > 0 &&
|
||||||
|
OrderCardDetail?.length == 0 &&
|
||||||
|
CheckBookingStatus != 'Close' &&
|
||||||
|
!addnewAccess && (
|
||||||
|
<TooltipWrapper title={'Recall'} isMobile={isMobile}>
|
||||||
|
{' '}
|
||||||
|
<Badge
|
||||||
|
count={Holddata?.length}
|
||||||
|
size={'small'}
|
||||||
|
offset={[0, 7]}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
backgroundColor: Holddata ? '#52c41a' : 'default',
|
||||||
|
color: Holddata ? '#ffffffff' : 'default',
|
||||||
|
height: '40px',
|
||||||
|
width: '45px',
|
||||||
|
borderRadius: '6px',
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
padding: '8px 8px 12px 8px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PozoHoldIcon
|
||||||
|
className="BSBillingNav-icon-table-icon"
|
||||||
|
onClick={() => HandleholdModelOpen()}
|
||||||
|
style={{
|
||||||
|
cursor: 'pointer',
|
||||||
|
// color: Holddata ? '#52c41a' : 'default',
|
||||||
|
pointerEvents:
|
||||||
|
OrderType === 'Failed' ? 'none' : 'auto',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</Badge>
|
||||||
|
</TooltipWrapper>
|
||||||
|
)
|
||||||
: ''}
|
: ''}
|
||||||
{tabledata?.length > 0 && dinePreference && (
|
{tabledata?.length > 0 && dinePreference && (
|
||||||
<>
|
<>
|
||||||
|
|
@ -4266,9 +4348,9 @@ const BSC1Payment = (props) => {
|
||||||
style={{
|
style={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
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'
|
||||||
: '#1292eeff',
|
: '#1292eeff',
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
|
|
@ -4311,36 +4393,36 @@ const BSC1Payment = (props) => {
|
||||||
{FeatureAddonData?.FeatureDtls?.find(
|
{FeatureAddonData?.FeatureDtls?.find(
|
||||||
(item) => item?.FeatureAddonName?.toLowerCase() === 'preorder'
|
(item) => item?.FeatureAddonName?.toLowerCase() === 'preorder'
|
||||||
) && (
|
) && (
|
||||||
<>
|
<>
|
||||||
{
|
{
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
pointerEvents:
|
pointerEvents:
|
||||||
OrderCardDetail?.length > 0 || OrderType === 'Failed'
|
OrderCardDetail?.length > 0 || OrderType === 'Failed'
|
||||||
? 'none'
|
? 'none'
|
||||||
: 'auto',
|
: 'auto',
|
||||||
opacity: OrderCardDetail?.length > 0 ? 0.5 : 1,
|
opacity: OrderCardDetail?.length > 0 ? 0.5 : 1,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<TooltipWrapper title={'Pre Order'} isMobile={isMobile}>
|
<TooltipWrapper title={'Pre Order'} isMobile={isMobile}>
|
||||||
<Badge
|
<Badge
|
||||||
count={preOrderPendingCount}
|
count={preOrderPendingCount}
|
||||||
offset={[-5, 10]}
|
offset={[-5, 10]}
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<PozoPreOrderIcon
|
<PozoPreOrderIcon
|
||||||
className="BSBillingNav-icon"
|
className="BSBillingNav-icon"
|
||||||
fill={preOrderOpen ? '#52C41A' : '#1292EE'}
|
fill={preOrderOpen ? '#52C41A' : '#1292EE'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
openPreOrder();
|
openPreOrder();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Badge>
|
</Badge>
|
||||||
</TooltipWrapper>
|
</TooltipWrapper>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{preOrderOpen && <BSNavBarPreOrder />}
|
{preOrderOpen && <BSNavBarPreOrder />}
|
||||||
{sportsAppPreference && <BSMembership />}
|
{sportsAppPreference && <BSMembership />}
|
||||||
{dinePreference &&
|
{dinePreference &&
|
||||||
|
|
@ -4498,12 +4580,14 @@ const BSC1Payment = (props) => {
|
||||||
addnewAccess
|
addnewAccess
|
||||||
? 'BSC1Payment-div4-button-disable'
|
? 'BSC1Payment-div4-button-disable'
|
||||||
: FirstPaymentclick === false &&
|
: FirstPaymentclick === false &&
|
||||||
OrderCardDetail?.length > 0 &&
|
OrderCardDetail?.length > 0 &&
|
||||||
paybtnselected &&
|
paybtnselected &&
|
||||||
CheckBookingStatus != 'Close'
|
CheckBookingStatus != 'Close'
|
||||||
? !OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ?
|
? !OrderStatus
|
||||||
'BSC1Payment-div4-button'
|
? salesBillEdit &&
|
||||||
: 'BSC1Payment-div4-button'
|
currentOrderNetAmount < previousNetAmount
|
||||||
|
? 'BSC1Payment-div4-button'
|
||||||
|
: 'BSC1Payment-div4-button'
|
||||||
: 'BSC1Payment-div4-button Order'
|
: 'BSC1Payment-div4-button Order'
|
||||||
: 'BSC1Payment-div4-button-disable'
|
: 'BSC1Payment-div4-button-disable'
|
||||||
}
|
}
|
||||||
|
|
@ -4513,34 +4597,41 @@ 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 ? (
|
||||||
<>
|
salesBillEdit && currentOrderNetAmount < previousNetAmount ? (
|
||||||
{isMobile ? (
|
<div className="Table4-Order">
|
||||||
`₹ ${safeRound(
|
Refund: ₹
|
||||||
OrderType === 'Failed'
|
{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}
|
||||||
? FailedTotalAmt
|
</div>
|
||||||
: credit && overAllBal >= 0
|
) : (
|
||||||
? Math.max(0, TotalAmount - overAllBal)
|
<>
|
||||||
: TotalAmount
|
{isMobile ? (
|
||||||
)}`
|
`₹ ${safeRound(
|
||||||
) : (
|
OrderType === 'Failed'
|
||||||
<div>
|
? FailedTotalAmt
|
||||||
₹
|
: credit && overAllBal >= 0
|
||||||
<CountUp
|
? Math.max(0, TotalAmount - overAllBal)
|
||||||
duration={0.4}
|
: TotalAmount
|
||||||
className="counter"
|
)}`
|
||||||
end={safeRound(
|
) : (
|
||||||
OrderType === 'Failed'
|
<div>
|
||||||
? FailedTotalAmt
|
₹
|
||||||
: credit && overAllBal >= 0
|
<CountUp
|
||||||
? Math.max(0, TotalAmount - overAllBal)
|
duration={0.4}
|
||||||
: TotalAmount
|
className="counter"
|
||||||
)}
|
end={safeRound(
|
||||||
/>
|
OrderType === 'Failed'
|
||||||
</div>
|
? FailedTotalAmt
|
||||||
)}
|
: credit && overAllBal >= 0
|
||||||
<AiOutlineArrowRight width="25px" height="25px" />
|
? Math.max(0, TotalAmount - overAllBal)
|
||||||
</>
|
: TotalAmount
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<AiOutlineArrowRight width="25px" height="25px" />
|
||||||
|
</>
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<div className="Table4-Order">ORDER</div>
|
<div className="Table4-Order">ORDER</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -4730,8 +4821,8 @@ const BSC1Payment = (props) => {
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={TableData}
|
data={TableData}
|
||||||
dataSource={TableData}
|
dataSource={TableData}
|
||||||
// pagination={handlePageChange}
|
// pagination={handlePageChange}
|
||||||
// onChange={handleChange}
|
// onChange={handleChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
@ -4762,10 +4853,17 @@ 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'
|
||||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
? FailedTotalAmt
|
||||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
: Math.round(
|
||||||
(Discount > 0 ? Discount : 0)))
|
OrderCardDetail?.reduce(
|
||||||
|
(acc, data) => data?.TotalAmt + acc,
|
||||||
|
0
|
||||||
|
) -
|
||||||
|
((OverAllSales > 0 ? OverAllSales : 0) +
|
||||||
|
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
||||||
|
(Discount > 0 ? Discount : 0))
|
||||||
|
)
|
||||||
}
|
}
|
||||||
failedOrderData={failedOrderData}
|
failedOrderData={failedOrderData}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue