Added prices change short cut funtionalies
This commit is contained in:
parent
58c6404699
commit
ef0245d862
|
|
@ -225,35 +225,6 @@ const BSBillingTable7 = () => {
|
|||
setPreviousdataLength(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(() => {
|
||||
if (!preferenceshortcutkey) return;
|
||||
const getSelectedItem = () => {
|
||||
|
|
@ -279,21 +250,25 @@ const BSBillingTable7 = () => {
|
|||
};
|
||||
|
||||
const handleKeyDown = (event) => {
|
||||
if (!preferenceshortcutkey) return;
|
||||
if (!event.ctrlKey) return;
|
||||
|
||||
const key = event.key.toLowerCase();
|
||||
|
||||
if (key === 'q') {
|
||||
event.preventDefault();
|
||||
handleShortcut('qty');
|
||||
const key = event.key.toLowerCase();
|
||||
// 👉 ALT + P → Open Edit Total Amount
|
||||
if (event.altKey && key === 'p') {
|
||||
event.preventDefault();
|
||||
if (tableData?.length > 0) {
|
||||
OpenEditTotalAmount();
|
||||
}
|
||||
|
||||
if (key === 'e') {
|
||||
event.preventDefault();
|
||||
handleShortcut('price');
|
||||
}
|
||||
};
|
||||
return;
|
||||
}
|
||||
if (!event.ctrlKey) return;
|
||||
if (key === 'q') {
|
||||
event.preventDefault();
|
||||
handleShortcut('qty');
|
||||
}
|
||||
if (key === 'e') {
|
||||
event.preventDefault();
|
||||
handleShortcut('price');
|
||||
}
|
||||
};
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
|
||||
return () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue