From 9da6fba3114c0be3a0ec21a19ff70f9468ec596e Mon Sep 17 00:00:00 2001 From: Srinath Date: Mon, 9 Feb 2026 16:52:21 +0530 Subject: [PATCH] Added short cut Key funtionalies parcel and Weight / Amount --- .../BSBillingEditQuantity.jsx | 46 +++++++++++++------ 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx index 073cbf6..af7eb6a 100644 --- a/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx +++ b/src/Pages/BookingScreen/Components/BSBillingTables/BSBillingEditQuantity/BSBillingEditQuantity.jsx @@ -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 && ()} @@ -3766,7 +3784,7 @@ const BSBillingEditQuantity = (props) => { /> )} - {RadioBtnSelection == 'AddWeight' && ( + {RadioBtnSelection == 'weightAmount' && ( <>