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 reductionInputRef = useRef(null);
|
||||
|
||||
const { setIndex = () => {} } = props;
|
||||
|
||||
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
||||
const SessionData = useSelector(StoredSessionData);
|
||||
// const AppId = SessionData?.AppId;
|
||||
|
|
@ -670,6 +672,7 @@ const BSBillingEditQuantity = (props) => {
|
|||
props.handleEditQuantityCancel();
|
||||
setClearQuantity(false);
|
||||
}
|
||||
setIndex(null);
|
||||
};
|
||||
|
||||
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 { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||
import { Popconfirm, Tooltip } from 'antd';
|
||||
|
|
@ -73,6 +73,8 @@ import {
|
|||
} from '../../../../../Features/Offer/Offernew/BookingOffernew.js';
|
||||
import { useRemoveProducts } from '../BSBillingTable3/RemoveCartWithOffer.jsx';
|
||||
import { useUtilsComponent } from '../../../../../Services/utils.js';
|
||||
import ComboEditQty from '../ComboBillTableEdit/ComboEditQty.jsx';
|
||||
import ComboEditRate from '../ComboBillTableEdit/ComboEditRate.jsx';
|
||||
import CustomerPriceHistory from '../../UtillComponents/CustomerPriceHistory.jsx';
|
||||
|
||||
const ComboSalesBillTable = () => {
|
||||
|
|
@ -131,7 +133,8 @@ const ComboSalesBillTable = () => {
|
|||
const GetCustId = useSelector(GlobalCustId);
|
||||
const selectedCustomer = useSelector(GlobalSelOption);
|
||||
|
||||
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] = useState(false);
|
||||
const [customerPriceHistoryOpen, setCustomerPriceHistoryOpen] =
|
||||
useState(false);
|
||||
const [customerProduct, setCustomerProduct] = useState(null);
|
||||
|
||||
const tableDataDinein = tableData?.filter(
|
||||
|
|
@ -155,6 +158,8 @@ const ComboSalesBillTable = () => {
|
|||
: [];
|
||||
|
||||
const [EditQuantity, setEditQuantity] = useState(false);
|
||||
const [EditQtyCombo, setEditQtyCombo] = useState(false);
|
||||
const [EditRateCombo, setEditRateCombo] = useState(false);
|
||||
const [Modaldata, setModaldata] = useState([]);
|
||||
const [triggerAnimation, setTriggerAnimation] = useState(true);
|
||||
// const editField =
|
||||
|
|
@ -169,6 +174,32 @@ const ComboSalesBillTable = () => {
|
|||
// const [BillOrderPre, setBillOrderPre] = useState();
|
||||
// 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(() => {
|
||||
if (tableOptions?.length > 0) {
|
||||
let editFieldValue = tableOptions?.filter(
|
||||
|
|
@ -255,7 +286,7 @@ const ComboSalesBillTable = () => {
|
|||
const handleCustomerProductPriceHistory = (item) => {
|
||||
setCustomerPriceHistoryOpen(true);
|
||||
setCustomerProduct(item?.ProdId);
|
||||
}
|
||||
};
|
||||
|
||||
const handleEditQuantity = (value) => {
|
||||
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 = () => {
|
||||
setEditQuantity(false);
|
||||
};
|
||||
const handleEditQuantityComboCancel = () => {
|
||||
setEditQtyCombo(false);
|
||||
};
|
||||
const handleEditRateComboCancel = () => {
|
||||
setEditRateCombo(false);
|
||||
};
|
||||
|
||||
const OpenEditTotalAmount = () => {
|
||||
setOpenEditTotalAmt(true);
|
||||
|
|
@ -2115,9 +2179,11 @@ const ComboSalesBillTable = () => {
|
|||
|
||||
{/* Delete */}
|
||||
{item.OptionName === 'Delete' && (
|
||||
<th className="deleteTh"
|
||||
<th
|
||||
className="deleteTh"
|
||||
style={{ textAlign: 'center', width: '80px' }}
|
||||
key={item.OptionId}>
|
||||
key={item.OptionId}
|
||||
>
|
||||
{tableData?.length > 0 ? (
|
||||
<Popconfirm
|
||||
title="Delete the items"
|
||||
|
|
@ -2248,9 +2314,7 @@ const ComboSalesBillTable = () => {
|
|||
'variant'
|
||||
) && <span>{row?.ProdVariantName} </span>}
|
||||
{row?.Size}
|
||||
{row?.SinglePc == 'Y' ? 'PCS' : row?.UomName}
|
||||
|
||||
)
|
||||
{row?.SinglePc == 'Y' ? 'PCS' : row?.UomName})
|
||||
</p>
|
||||
)}
|
||||
{row?.Type === 'C' &&
|
||||
|
|
@ -2276,11 +2340,36 @@ const ComboSalesBillTable = () => {
|
|||
{/* Quantity */}
|
||||
{item.OptionName === 'Quantity' && (
|
||||
<td
|
||||
ref={qtyTdRef}
|
||||
key={`qty-${index}`}
|
||||
className="qtyTd"
|
||||
onClick={() => editField && handleEditQuantity(row)}
|
||||
// className="qtyTd"
|
||||
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>
|
||||
)}
|
||||
|
||||
|
|
@ -2288,12 +2377,31 @@ const ComboSalesBillTable = () => {
|
|||
{item.OptionName === 'Rate' && (
|
||||
<td
|
||||
key={`rate-${index}`}
|
||||
className="rateTd"
|
||||
onClick={() => editField && handleEditQuantity(row)}
|
||||
// className="rateTd"
|
||||
className={EditRateCombo ? 'rateTdEditRate' : 'rateTd'}
|
||||
// onClick={() => editField && handleEditQuantity(row)}
|
||||
onClick={() => editField && handleEditRateCombo(row)}
|
||||
>
|
||||
{!EditRateCombo || row?.localId !== Index ? (
|
||||
<>
|
||||
{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>
|
||||
)}
|
||||
|
||||
|
|
@ -2411,9 +2519,10 @@ const ComboSalesBillTable = () => {
|
|||
BSBillingEditQuantity={EditQuantity}
|
||||
Productdata={Modaldata}
|
||||
Index={Index}
|
||||
setIndex={setIndex}
|
||||
/>
|
||||
)}
|
||||
{(customerPriceHistoryOpen && GetCustId) &&
|
||||
{customerPriceHistoryOpen && GetCustId && (
|
||||
<CustomerPriceHistory
|
||||
open={customerPriceHistoryOpen}
|
||||
custId={GetCustId}
|
||||
|
|
@ -2422,7 +2531,7 @@ const ComboSalesBillTable = () => {
|
|||
setCustomerProduct={setCustomerProduct}
|
||||
selectedCustomer={selectedCustomer}
|
||||
/>
|
||||
}
|
||||
)}
|
||||
</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 {
|
||||
width: 100%;
|
||||
font-family: 'Inter', sans-serif;
|
||||
font-family: "Inter", sans-serif;
|
||||
|
||||
.bill-table {
|
||||
width: 100%;
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
border: 1px solid #9c9c9c;
|
||||
font-size: 13px;
|
||||
white-space: nowrap;
|
||||
font-family: 'Poppins', sans-serif !important;
|
||||
font-family: "Poppins", sans-serif !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@
|
|||
}
|
||||
.rateTd {
|
||||
width: 90px;
|
||||
text-align: right;
|
||||
text-align: center;
|
||||
}
|
||||
.discPerTh {
|
||||
text-align: center;
|
||||
|
|
@ -119,7 +119,7 @@
|
|||
text-align: right;
|
||||
}
|
||||
.totalTh {
|
||||
text-align: center;
|
||||
text-align: right;
|
||||
width: 170px;
|
||||
}
|
||||
.totalTd {
|
||||
|
|
@ -161,3 +161,31 @@
|
|||
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 { useDateStore } from '../../../../Features/BookingScreen/BookingData/DateStore.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 pozologoimg from '../../../../Images/pozologoimg.png';
|
||||
import PaymentGatewayEmbedded from '../UtillComponents/PaymentGatewayEmbedded.jsx';
|
||||
|
|
@ -266,7 +270,9 @@ const BSC1Payment = (props) => {
|
|||
const navigate = useNavigate();
|
||||
const salesBillEdit = useSelector(GlobalSalesBillEdit);
|
||||
const previousOrderPayment = useSelector(GlobalPreviousOrderPayment);
|
||||
const previousOrderOfferDetails = useSelector(GlobalPreviousOrderOfferDetails);
|
||||
const previousOrderOfferDetails = useSelector(
|
||||
GlobalPreviousOrderOfferDetails
|
||||
);
|
||||
const AllPaymentOptions = useSelector(GlobalpaymentOptionData);
|
||||
const SessionData = useSelector(StoredSessionData);
|
||||
const BranchFinancialStatus = useSelector(GlobalBranchFinancialStatus);
|
||||
|
|
@ -349,11 +355,15 @@ const BSC1Payment = (props) => {
|
|||
(preference) => preference?.PreferredCatName === 'Common Module'
|
||||
)?.PreferenceCatDetails;
|
||||
const sportsAppPreference = commonModulePreference?.find(
|
||||
(preference) => preference?.PreferredSubCatName === 'SportsApp'
|
||||
&&
|
||||
(preference) =>
|
||||
preference?.PreferredSubCatName === 'SportsApp' &&
|
||||
preference?.PreferredStatus == 'Y'
|
||||
);
|
||||
console.log(sportsAppPreference,commonModulePreference,"sportsAppPreference")
|
||||
console.log(
|
||||
sportsAppPreference,
|
||||
commonModulePreference,
|
||||
'sportsAppPreference'
|
||||
);
|
||||
const bookingTypePreference = appPreferences?.find(
|
||||
(preference) => preference?.PreferredCatName === 'Booking Type'
|
||||
)?.PreferenceCatDetails;
|
||||
|
|
@ -683,7 +693,6 @@ const BSC1Payment = (props) => {
|
|||
}, [salesBillEdit]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
if (salesBillEdit) {
|
||||
if (SelCustId) {
|
||||
setRefundPayBtns(AllPaymentOptions);
|
||||
|
|
@ -698,8 +707,7 @@ const BSC1Payment = (props) => {
|
|||
setRefundPayBtns(withoutCustomer);
|
||||
}
|
||||
}
|
||||
|
||||
}, [AllPaymentOptions, SelCustId, salesBillEdit])
|
||||
}, [AllPaymentOptions, SelCustId, salesBillEdit]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!preOrder) {
|
||||
|
|
@ -760,14 +768,21 @@ const BSC1Payment = (props) => {
|
|||
|
||||
const filteredPayments =
|
||||
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 =
|
||||
filteredPayments.length > 0 ? filteredPayments : previousOrderPayment || [];
|
||||
filteredPayments.length > 0
|
||||
? filteredPayments
|
||||
: previousOrderPayment || [];
|
||||
|
||||
const totalPreviouspayment = paymentsToUse?.reduce(
|
||||
(acc, payment) => acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
||||
(acc, payment) =>
|
||||
acc + parseFloat(payment.AfterAdjustment || payment.Amount || 0),
|
||||
0
|
||||
);
|
||||
|
||||
|
|
@ -776,23 +791,38 @@ const BSC1Payment = (props) => {
|
|||
0
|
||||
);
|
||||
|
||||
const previousNetAmount =
|
||||
(totalPreviouspayment) || 0;
|
||||
const previousNetAmount = totalPreviouspayment || 0;
|
||||
|
||||
let withdiscTotal =
|
||||
Total - ((OverAllSales || 0) + (OverAllEstimate || 0) +
|
||||
Total -
|
||||
((OverAllSales || 0) +
|
||||
(OverAllEstimate || 0) +
|
||||
(Discount > 0 ? Discount : 0));
|
||||
|
||||
const currentOrderNetAmount = formatAmount(
|
||||
withdiscTotal >= 0
|
||||
? (Number(withdiscTotal) + 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);
|
||||
setPreviousNetAmount(previousNetAmount);
|
||||
dispatch(changeSummeryTotalAmount(salesBillEdit ? (currentOrderNetAmount > previousNetAmount) ? (currentOrderNetAmount - previousNetAmount) : 0 : currentOrderNetAmount));
|
||||
dispatch(
|
||||
changeSummeryTotalAmount(
|
||||
salesBillEdit
|
||||
? currentOrderNetAmount > previousNetAmount
|
||||
? currentOrderNetAmount - previousNetAmount
|
||||
: 0
|
||||
: currentOrderNetAmount
|
||||
)
|
||||
);
|
||||
|
||||
dispatch(changeSummeryComboOfferAmount(withComboSum));
|
||||
|
||||
|
|
@ -812,7 +842,7 @@ const BSC1Payment = (props) => {
|
|||
OverAllEstimate,
|
||||
globalTipAmount,
|
||||
OtherServiceTicketClaim,
|
||||
Discount
|
||||
Discount,
|
||||
]);
|
||||
useEffect(() => {
|
||||
let data = {
|
||||
|
|
@ -1233,7 +1263,11 @@ const BSC1Payment = (props) => {
|
|||
const handleButtonClick = () => {
|
||||
if (qrCode && SelectedUPIPayOption === 'Default') {
|
||||
UpiPayment();
|
||||
} else if (salesBillEdit && currentOrderNetAmount < previousNetAmount && !refundPaySelected) {
|
||||
} else if (
|
||||
salesBillEdit &&
|
||||
currentOrderNetAmount < previousNetAmount &&
|
||||
!refundPaySelected
|
||||
) {
|
||||
setMessageType('warning');
|
||||
setMessageData('Please Select Refund Payment Method');
|
||||
return;
|
||||
|
|
@ -1425,7 +1459,7 @@ const BSC1Payment = (props) => {
|
|||
const handleRefundPaymentMode = (id, name) => {
|
||||
setRefundPaySelected(id);
|
||||
setRefundPaySelectedName(name);
|
||||
}
|
||||
};
|
||||
|
||||
const AddCardOption = (data) => {
|
||||
setSelectedCardOption(data);
|
||||
|
|
@ -2289,8 +2323,10 @@ const BSC1Payment = (props) => {
|
|||
SalesPaymentType: 'normal',
|
||||
PaymentDetail: [
|
||||
{
|
||||
PaymentType: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? refundPaySelected :
|
||||
Paybtnnameselected?.toLowerCase() === 'upi'
|
||||
PaymentType:
|
||||
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||
? refundPaySelected
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi'
|
||||
? SelectedUPIPayOption?.toLowerCase() === 'pd'
|
||||
? PaymentDeviceUPI?.[0]?.ModeId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'pg'
|
||||
|
|
@ -2303,15 +2339,25 @@ const BSC1Payment = (props) => {
|
|||
: paybtnselected
|
||||
? paybtnselected
|
||||
: null,
|
||||
Amount: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? previousNetAmount - currentOrderNetAmount : Math.round(TotalAmount),
|
||||
MerchantId: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
Amount:
|
||||
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||
? previousNetAmount - currentOrderNetAmount
|
||||
: Math.round(TotalAmount),
|
||||
MerchantId:
|
||||
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||
? null
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
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'
|
||||
PaymentOptionType:
|
||||
salesBillEdit &&
|
||||
currentOrderNetAmount < previousNetAmount &&
|
||||
(refundPaySelectedName?.toLowerCase() === 'cash' ||
|
||||
refundPaySelectedName?.toLowerCase() === 'credit')
|
||||
? 'PC'
|
||||
: Paybtnnameselected?.toLowerCase() === 'cash'
|
||||
? 'PC'
|
||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'PC'
|
||||
|
|
@ -2324,16 +2370,21 @@ const BSC1Payment = (props) => {
|
|||
? 'BU'
|
||||
: SelectedUPIPayOption
|
||||
: null,
|
||||
ModeOfPayment: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? null :
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
ModeOfPayment:
|
||||
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||
? null
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? PaymentUpiOptions?.find((upipay) => upipay?.UPIId === UpiId)
|
||||
?.UPIDetailId
|
||||
: SelectedUPIPayOption?.toLowerCase() === 'business'
|
||||
? BusinessPayOption?.find((busupi) => busupi?.ModeId === UpiId)
|
||||
?.MerchantUPIId
|
||||
? BusinessPayOption?.find(
|
||||
(busupi) => busupi?.ModeId === UpiId
|
||||
)?.MerchantUPIId
|
||||
: null,
|
||||
AccountDtl: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? [] :
|
||||
Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
AccountDtl:
|
||||
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||
? []
|
||||
: Paybtnnameselected?.toLowerCase() === 'upi' &&
|
||||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? useOptions?.[0]?.PaymentDetails?.Payatthecounter?.find(
|
||||
(upipay) => upipay?.UPIId === UpiId
|
||||
|
|
@ -2349,8 +2400,10 @@ const BSC1Payment = (props) => {
|
|||
SelectedCardOption?.toLowerCase() === 'pg')
|
||||
? useOptions?.[0]?.PaymentDetails?.PaymentGateway
|
||||
: [],
|
||||
PaymentStatus: (salesBillEdit && currentOrderNetAmount < previousNetAmount) ? 'S' :
|
||||
Paybtnnameselected?.toLowerCase() === 'cash'
|
||||
PaymentStatus:
|
||||
salesBillEdit && currentOrderNetAmount < previousNetAmount
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'cash'
|
||||
? 'S'
|
||||
: Paybtnnameselected?.toLowerCase() === 'credit'
|
||||
? 'S'
|
||||
|
|
@ -2358,9 +2411,18 @@ const BSC1Payment = (props) => {
|
|||
SelectedUPIPayOption?.toLowerCase() === 'default'
|
||||
? 'S'
|
||||
: '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'
|
||||
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)
|
||||
: 0,
|
||||
},
|
||||
|
|
@ -2583,7 +2645,8 @@ const BSC1Payment = (props) => {
|
|||
item?.PaymentStatus === 'P'
|
||||
);
|
||||
|
||||
if (PayatCounterfilter?.length === 1 ||
|
||||
if (
|
||||
PayatCounterfilter?.length === 1 ||
|
||||
response?.data?.PaymentOrderDtl?.length === 0
|
||||
) {
|
||||
setMessageType('success');
|
||||
|
|
@ -3862,7 +3925,8 @@ const BSC1Payment = (props) => {
|
|||
: 1,
|
||||
}}
|
||||
>
|
||||
{paybtns?.length > 0 && (currentOrderNetAmount >= previousNetAmount) ? (
|
||||
{paybtns?.length > 0 &&
|
||||
currentOrderNetAmount >= previousNetAmount ? (
|
||||
paybtns?.map((payment) => (
|
||||
<div className="Table3-cash">
|
||||
<button
|
||||
|
|
@ -3936,7 +4000,9 @@ const BSC1Payment = (props) => {
|
|||
</button>
|
||||
</div>
|
||||
))
|
||||
) : (currentOrderNetAmount < previousNetAmount && salesBillEdit && refundPayBtns.length > 0) ? (
|
||||
) : currentOrderNetAmount < previousNetAmount &&
|
||||
salesBillEdit &&
|
||||
refundPayBtns.length > 0 ? (
|
||||
refundPayBtns.map((payment) => (
|
||||
<div className="Table3-cash">
|
||||
<button
|
||||
|
|
@ -3955,7 +4021,12 @@ const BSC1Payment = (props) => {
|
|||
? 'blink-animation 0.5s infinite alternate'
|
||||
: 'none',
|
||||
}}
|
||||
onClick={() => handleRefundPaymentMode(payment?.ConfigId, payment?.ConfigName)}
|
||||
onClick={() =>
|
||||
handleRefundPaymentMode(
|
||||
payment?.ConfigId,
|
||||
payment?.ConfigName
|
||||
)
|
||||
}
|
||||
>
|
||||
{/* {UpiOption === "" && payment?.ModeName?.toLowerCase() === "upi" && <p> UPI</p>} */}
|
||||
|
||||
|
|
@ -4087,6 +4158,17 @@ const BSC1Payment = (props) => {
|
|||
<div style={{ width: '4px' }}> : </div>
|
||||
<div style={{ textAlign: 'right', width: '1rem' }}> {Qty} </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>
|
||||
|
|
@ -4501,8 +4583,10 @@ const BSC1Payment = (props) => {
|
|||
OrderCardDetail?.length > 0 &&
|
||||
paybtnselected &&
|
||||
CheckBookingStatus != 'Close'
|
||||
? !OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ?
|
||||
'BSC1Payment-div4-button'
|
||||
? !OrderStatus
|
||||
? salesBillEdit &&
|
||||
currentOrderNetAmount < previousNetAmount
|
||||
? 'BSC1Payment-div4-button'
|
||||
: 'BSC1Payment-div4-button'
|
||||
: 'BSC1Payment-div4-button Order'
|
||||
: 'BSC1Payment-div4-button-disable'
|
||||
|
|
@ -4513,7 +4597,13 @@ const BSC1Payment = (props) => {
|
|||
onClick={handleButtonClick}
|
||||
style={{ borderRadius: '6px 0 0 6px' }}
|
||||
>
|
||||
{!OrderStatus ? salesBillEdit && (currentOrderNetAmount < previousNetAmount) ? <div className="Table4-Order">Refund: ₹{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}</div> : (
|
||||
{!OrderStatus ? (
|
||||
salesBillEdit && currentOrderNetAmount < previousNetAmount ? (
|
||||
<div className="Table4-Order">
|
||||
Refund: ₹
|
||||
{(previousNetAmount || 0) - (currentOrderNetAmount || 0)}
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
{isMobile ? (
|
||||
`₹ ${safeRound(
|
||||
|
|
@ -4541,6 +4631,7 @@ const BSC1Payment = (props) => {
|
|||
)}
|
||||
<AiOutlineArrowRight width="25px" height="25px" />
|
||||
</>
|
||||
)
|
||||
) : (
|
||||
<div className="Table4-Order">ORDER</div>
|
||||
)}
|
||||
|
|
@ -4762,10 +4853,17 @@ const BSC1Payment = (props) => {
|
|||
SplitPaymentModal={Splitpayment}
|
||||
handlesplitpaymentclose={handlesplitpaymentclose}
|
||||
TotalNetAmount={
|
||||
OrderType === 'Failed' ? FailedTotalAmt : Math.round(OrderCardDetail?.reduce((acc, data) => data?.TotalAmt + acc, 0) -
|
||||
OrderType === 'Failed'
|
||||
? FailedTotalAmt
|
||||
: Math.round(
|
||||
OrderCardDetail?.reduce(
|
||||
(acc, data) => data?.TotalAmt + acc,
|
||||
0
|
||||
) -
|
||||
((OverAllSales > 0 ? OverAllSales : 0) +
|
||||
(OverAllEstimate > 0 ? OverAllEstimate : 0) +
|
||||
(Discount > 0 ? Discount : 0)))
|
||||
(Discount > 0 ? Discount : 0))
|
||||
)
|
||||
}
|
||||
failedOrderData={failedOrderData}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue