This commit is contained in:
frontend perkafean
2024-08-09 13:00:10 +00:00
parent 76741e304f
commit 6102db3f56
18 changed files with 271 additions and 141 deletions

View File

@@ -11,9 +11,9 @@ import {
handlePaymentFromGuestDevice,
} from "../helpers/transactionHelpers";
export default function Invoice({ sendParam, deviceType, socket }) {
const { shopId, tableId } = useParams();
sendParam({ shopId, tableId });
export default function Invoice({ table, sendParam, deviceType, socket }) {
const { shopId, tableCode } = useParams();
sendParam({ shopId, tableCode });
const location = useLocation(); // Use useLocation hook instead of useSearchParams
const searchParams = new URLSearchParams(location.search); // Pass location.search directly
@@ -76,7 +76,7 @@ export default function Invoice({ sendParam, deviceType, socket }) {
shopId,
isCash ? "cash" : "cashless",
orderType,
tableNumber,
table.tableNo || tableNumber,
socketId
);
}
@@ -103,7 +103,7 @@ export default function Invoice({ sendParam, deviceType, socket }) {
<h2 className={styles["Invoice-detail"]}>
{orderType === "pickup"
? "Diambil di kasir"
: `Diantar ke meja nomor ${tableNumber}`}
: `Diantar ke meja nomor ${table.tableNo || tableNumber || "-"}`}
</h2>
<div className={styles.TotalContainer}>
<span>Total:</span>