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