Added short cut Key funtionalies parcel and Weight / Amount

This commit is contained in:
Srinath 2026-02-09 16:52:21 +05:30
parent fd791c78eb
commit 9da6fba311
1 changed files with 32 additions and 14 deletions

View File

@ -102,15 +102,33 @@ const BSBillingEditQuantity = (props) => {
const SettingDataSelector = useSelector(PreferenceData);
const OrderType = useSelector(GlobalOrderType);
const [BillOrderPre, setBillOrderPre] = useState(null);
const [RadioBtnSelection, setRadioBtnSelection] = useState(
props?.shortKeyMethod == 'price'
? 'Price'
: ItemData?.ScaleType !== 'weight'
? 'Quantity'
: PriceChangeaccess
? 'Price'
: 'Parcel'
);
const SHORTKEY_TO_RADIO = {
price: 'Price',
quantity: 'qty',
Parcel: 'Parcel',
weightAmount: 'weightAmount'
};
const [RadioBtnSelection, setRadioBtnSelection] = useState(() => {
if (props?.shortKeyMethod && SHORTKEY_TO_RADIO[props.shortKeyMethod]) {
return SHORTKEY_TO_RADIO[props.shortKeyMethod];
}
if (ItemData?.ScaleType !== 'weight') {
return 'Quantity';
}
if (PriceChangeaccess) {
return 'Price';
}
return 'Parcel';
});
// const [RadioBtnSelection, setRadioBtnSelection] = useState(
// props?.shortKeyMethod == 'price'
// ? 'Price'
// : ItemData?.ScaleType !== 'weight'
// ? 'Quantity'
// : PriceChangeaccess
// ? 'Price'
// : 'Parcel'
// );
const [PercentageSelection, setPercentageSelection] = useState('Fixed');
const [RadioDetails, setRadioDetails] = useState(false);
const [editedPrice, setEditedPrice] = useState(0);
@ -3552,13 +3570,13 @@ const BSBillingEditQuantity = (props) => {
{isKg && (<button
type="button"
className={
RadioBtnSelection === 'AddWeight'
? 'SelecBtn AddWeight'
RadioBtnSelection === 'weightAmount'
? 'SelecBtn weightAmount'
: 'ChangeBtn'
}
onClick={() => onRadioBtnChange('AddWeight')}
onClick={() => onRadioBtnChange('weightAmount')}
>
Add Weight
Weight / Amount
</button>)}
</div>
@ -3766,7 +3784,7 @@ const BSBillingEditQuantity = (props) => {
/>
</>
)}
{RadioBtnSelection == 'AddWeight' && (
{RadioBtnSelection == 'weightAmount' && (
<>
<WeightCalculatePrice
CartOrderDetails={CartOrderDetails}