Added qty edit click funtions
This commit is contained in:
parent
a2bdb67940
commit
167b3196db
|
|
@ -36,8 +36,10 @@ const ComboEditQtyAndRate = (props) => {
|
||||||
const formRef = useRef(null);
|
const formRef = useRef(null);
|
||||||
const quantityInputRef = useRef(null);
|
const quantityInputRef = useRef(null);
|
||||||
const priceChangeInputRef = useRef(null);
|
const priceChangeInputRef = useRef(null);
|
||||||
|
const modalRef = useRef(null);
|
||||||
const { setIndex = () => {}, setEditQtyCombo = () => {}, setEditRateCombo = () => {} } = props;
|
const { setIndex = () => {}, setEditQtyCombo = () => {}, setEditRateCombo = () => {} } = props;
|
||||||
|
|
||||||
|
|
||||||
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
const [disableSubmitButton, setDisableSubmitButton] = useState(false);
|
||||||
const SessionData = useSelector(StoredSessionData);
|
const SessionData = useSelector(StoredSessionData);
|
||||||
// const AppId = SessionData?.AppId;
|
// const AppId = SessionData?.AppId;
|
||||||
|
|
@ -139,14 +141,21 @@ const ComboEditQtyAndRate = (props) => {
|
||||||
}, [RadioBtnSelection, props.BSBillingEditQuantity, props.BSBillingEditRate]);
|
}, [RadioBtnSelection, props.BSBillingEditQuantity, props.BSBillingEditRate]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleKeyDown = (event) => {
|
const handleKeyDown = (event) => {
|
||||||
if (preferenceshortcutkey && event.shiftKey && event.key === 'E') {
|
const navigationKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'];
|
||||||
|
if (event.key === 'Escape' || navigationKeys.includes(event.key)) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (PriceChangeaccess && props.Productdata?.Offer <= 0) {
|
if (props.BSBillingEditQuantity) {
|
||||||
onRadioBtnChange('Price');
|
props.handleEditQuantityCancel?.();
|
||||||
|
setEditQtyCombo(false);
|
||||||
}
|
}
|
||||||
|
if (props.BSBillingEditRate) {
|
||||||
|
props.handleEditRateComboCancel?.();
|
||||||
|
setEditRateCombo(false);
|
||||||
}
|
}
|
||||||
};
|
return;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
if (EditOpen) {
|
if (EditOpen) {
|
||||||
document.addEventListener('keydown', handleKeyDown);
|
document.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
@ -160,8 +169,12 @@ const ComboEditQtyAndRate = (props) => {
|
||||||
preferenceshortcutkey,
|
preferenceshortcutkey,
|
||||||
PriceChangeaccess,
|
PriceChangeaccess,
|
||||||
props.Productdata?.Offer,
|
props.Productdata?.Offer,
|
||||||
|
props.BSBillingEditQuantity,
|
||||||
|
props.BSBillingEditRate,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const BillOrder = SettingDataSelector?.[0]?.SettingDtlDetails?.find(
|
const BillOrder = SettingDataSelector?.[0]?.SettingDtlDetails?.find(
|
||||||
(item) => item.SettingIdName === 'BillItemsOrder'
|
(item) => item.SettingIdName === 'BillItemsOrder'
|
||||||
|
|
@ -3203,6 +3216,7 @@ const ComboEditQtyAndRate = (props) => {
|
||||||
ref={quantityInputRef}
|
ref={quantityInputRef}
|
||||||
type="number"
|
type="number"
|
||||||
value={Quantity}
|
value={Quantity}
|
||||||
|
min="0"
|
||||||
onChange={(e) => setQuantity(e.target.value)}
|
onChange={(e) => setQuantity(e.target.value)}
|
||||||
onBlur={() => {
|
onBlur={() => {
|
||||||
if (Quantity && Quantity.trim() !== '') {
|
if (Quantity && Quantity.trim() !== '') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue