Added prices change short cut funtionalies
This commit is contained in:
parent
58c6404699
commit
ef0245d862
|
|
@ -225,35 +225,6 @@ const BSBillingTable7 = () => {
|
||||||
setPreviousdataLength(PreviousOrderLength);
|
setPreviousdataLength(PreviousOrderLength);
|
||||||
}, [PreviousOrderLength]);
|
}, [PreviousOrderLength]);
|
||||||
|
|
||||||
// useEffect(() => {
|
|
||||||
// const handleKeyDown = (event) => {
|
|
||||||
// // Ctrl + Q
|
|
||||||
// if (event.ctrlKey && event.key.toLowerCase() === 'q') {
|
|
||||||
// event.preventDefault();
|
|
||||||
|
|
||||||
// const getItem = (data = []) => {
|
|
||||||
// if (!data.length) return null;
|
|
||||||
// return BillOrderPre === 'Y' ? data[0] : data[data.length - 1];
|
|
||||||
// };
|
|
||||||
|
|
||||||
// let item = null;
|
|
||||||
// if (tableDataTakeAway?.length > 0) {
|
|
||||||
// item = getItem(tableDataTakeAway);
|
|
||||||
// } else if (tableDataDinein?.length > 0) {
|
|
||||||
// item = getItem(tableDataDinein);
|
|
||||||
// }
|
|
||||||
// if (item) {
|
|
||||||
// handleEditQuantity(item);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// window.addEventListener('keydown', handleKeyDown);
|
|
||||||
|
|
||||||
// return () => {
|
|
||||||
// window.removeEventListener('keydown', handleKeyDown);
|
|
||||||
// };
|
|
||||||
// }, [tableDataTakeAway, tableDataDinein, BillOrderPre]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!preferenceshortcutkey) return;
|
if (!preferenceshortcutkey) return;
|
||||||
const getSelectedItem = () => {
|
const getSelectedItem = () => {
|
||||||
|
|
@ -279,21 +250,25 @@ const BSBillingTable7 = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleKeyDown = (event) => {
|
const handleKeyDown = (event) => {
|
||||||
if (!preferenceshortcutkey) return;
|
const key = event.key.toLowerCase();
|
||||||
if (!event.ctrlKey) return;
|
// 👉 ALT + P → Open Edit Total Amount
|
||||||
|
if (event.altKey && key === 'p') {
|
||||||
const key = event.key.toLowerCase();
|
event.preventDefault();
|
||||||
|
if (tableData?.length > 0) {
|
||||||
if (key === 'q') {
|
OpenEditTotalAmount();
|
||||||
event.preventDefault();
|
|
||||||
handleShortcut('qty');
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
if (key === 'e') {
|
}
|
||||||
event.preventDefault();
|
if (!event.ctrlKey) return;
|
||||||
handleShortcut('price');
|
if (key === 'q') {
|
||||||
}
|
event.preventDefault();
|
||||||
};
|
handleShortcut('qty');
|
||||||
|
}
|
||||||
|
if (key === 'e') {
|
||||||
|
event.preventDefault();
|
||||||
|
handleShortcut('price');
|
||||||
|
}
|
||||||
|
};
|
||||||
window.addEventListener('keydown', handleKeyDown);
|
window.addEventListener('keydown', handleKeyDown);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue