Added short cut Key funtionalies parcel and Weight / Amount
This commit is contained in:
parent
fd791c78eb
commit
9da6fba311
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in New Issue