ok
This commit is contained in:
@@ -11,7 +11,7 @@ import { getTables } from "../helpers/tableHelper";
|
||||
import TableCanvas from "../components/TableCanvas";
|
||||
import { useSearchParams } from "react-router-dom";
|
||||
|
||||
export default function Transactions({ propsShopId, sendParam, deviceType }) {
|
||||
export default function Transactions({ propsShopId, sendParam, deviceType, handleMoveToTransaction, shopImg }) {
|
||||
const { shopId, tableId } = useParams();
|
||||
if (sendParam) sendParam({ shopId, tableId });
|
||||
|
||||
@@ -108,9 +108,7 @@ export default function Transactions({ propsShopId, sendParam, deviceType }) {
|
||||
|
||||
return (
|
||||
<div className={styles.Transactions}>
|
||||
<div style={{ marginTop: "30px" }}></div>
|
||||
<h2 className={styles["Transactions-title"]}>Transactions</h2>
|
||||
{/* <TableCanvas tables={tables} selectedTable={selectedTable} /> */}
|
||||
|
||||
<div className={styles.TransactionListContainer}>
|
||||
{transaction && (
|
||||
<div
|
||||
@@ -120,13 +118,59 @@ export default function Transactions({ propsShopId, sendParam, deviceType }) {
|
||||
setSelectedTable(transaction.Table || { tableId: 0 })
|
||||
}
|
||||
>
|
||||
|
||||
<div className={styles['receipt-header']}>
|
||||
<img
|
||||
src={shopImg} // Placeholder image URL
|
||||
alt='logo'
|
||||
className={styles['receipt-logo']}
|
||||
/>
|
||||
<div className={styles['receipt-info']}>
|
||||
<h3>Receipt Information</h3>
|
||||
<p>Transaction ID: {transaction.transactionId}</p>
|
||||
<p>Payment Type: {transaction.payment_type}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={styles['dotted-line']}>
|
||||
<div className={styles['circle-left']} onClick={() => handleMoveToTransaction('previous', transaction.transactionId)}>
|
||||
<div className={styles["inner-circle"]}>
|
||||
<svg
|
||||
viewBox="0 0 16 16"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="#000000"
|
||||
style={{ transform: 'Rotate(-90deg)', width: '100%', height: '100%' }} // Ensure SVG fits the div
|
||||
>
|
||||
<g id="SVGRepo_bgCarrier" strokeWidth="0"></g>
|
||||
<g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g>
|
||||
<g id="SVGRepo_iconCarrier">
|
||||
<path d="M 0.198 14.001 C -0.192 14.392 -0.088 11.275 0.1 11.088 L 7.293 4.293 C 7.684 3.902 8.316 3.902 8.707 4.293 L 15.833 11.258 C 16.021 11.445 16.203 14.644 15.812 14.253 L 8 6.414 L 0.198 14.001 Z" fill="#dbdbdb"></path>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
<div className={styles.circle}>1</div>
|
||||
</div>
|
||||
<div className={styles['line']} ></div>
|
||||
<div className={styles['circle-right']} onClick={() => handleMoveToTransaction('next', transaction.transactionId)}>
|
||||
<div className={styles["inner-circle"]}>
|
||||
<span className="inner-text"><svg
|
||||
viewBox="0 0 16 16"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
fill="#000000"
|
||||
style={{ transform: 'Rotate(90deg)', width: '100%', height: '100%' }} // Ensure SVG fits the div
|
||||
>
|
||||
<g id="SVGRepo_bgCarrier" strokeWidth="0"></g>
|
||||
<g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g>
|
||||
<g id="SVGRepo_iconCarrier">
|
||||
<path d="M 0.198 14.001 C -0.192 14.392 -0.088 11.275 0.1 11.088 L 7.293 4.293 C 7.684 3.902 8.316 3.902 8.707 4.293 L 15.833 11.258 C 16.021 11.445 16.203 14.644 15.812 14.253 L 8 6.414 L 0.198 14.001 Z" fill="#dbdbdb"></path>
|
||||
</g>
|
||||
</svg>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.RibbonBanner}></div>
|
||||
<h2 className={styles["Transactions-detail"]}>
|
||||
Transaction ID: {transaction.transactionId}
|
||||
</h2>
|
||||
<h2 className={styles["Transactions-detail"]}>
|
||||
Payment Type: {transaction.payment_type}
|
||||
</h2>
|
||||
<ul>
|
||||
{transaction.DetailedTransactions.map((detail) => (
|
||||
<li key={detail.detailedTransactionId}>
|
||||
@@ -137,10 +181,9 @@ export default function Transactions({ propsShopId, sendParam, deviceType }) {
|
||||
</ul>
|
||||
<h2 className={styles["Transactions-detail"]}>
|
||||
{transaction.serving_type === "pickup"
|
||||
? "Self pickup"
|
||||
: `Serve to ${
|
||||
transaction.Table ? transaction.Table.tableNo : "N/A"
|
||||
}`}
|
||||
? "Ambil sendiri"
|
||||
: `Diantar ke meja ${transaction.Table ? transaction.Table.tableNo : "N/A"
|
||||
}`}
|
||||
</h2>
|
||||
{transaction.notes != "" && (
|
||||
<>
|
||||
@@ -178,17 +221,17 @@ export default function Transactions({ propsShopId, sendParam, deviceType }) {
|
||||
{isPaymentLoading ? (
|
||||
<ColorRing height="50" width="50" color="white" />
|
||||
) : transaction.confirmed === 1 ? (
|
||||
"Confirm has paid" // Display "Confirm has paid" if the transaction is confirmed (1)
|
||||
"Konfirmasi telah bayar" // Display "Confirm has paid" if the transaction is confirmed (1)
|
||||
) : transaction.confirmed === -1 ? (
|
||||
"Declined" // Display "Declined" if the transaction is declined (-1)
|
||||
"Ditolak" // Display "Declined" if the transaction is declined (-1)
|
||||
) : transaction.confirmed === -2 ? (
|
||||
"Canceled" // Display "Declined" if the transaction is declined (-1)
|
||||
"Dibatalkan" // Display "Declined" if the transaction is declined (-1)
|
||||
) : transaction.confirmed === 2 ? (
|
||||
"Confirm item has ready" // Display "Item ready" if the transaction is ready (2)
|
||||
"Konfirmasi pesanan siap" // Display "Item ready" if the transaction is ready (2)
|
||||
) : transaction.confirmed === 3 ? (
|
||||
"Transaction success" // Display "Item ready" if the transaction is ready (2)
|
||||
) : (
|
||||
"Confirm availability" // Display "Confirm availability" if the transaction is not confirmed (0)
|
||||
"Konfirmasi ketersediaan" // Display "Confirm availability" if the transaction is not confirmed (0)
|
||||
)}
|
||||
</button>
|
||||
</div>
|
||||
@@ -197,7 +240,7 @@ export default function Transactions({ propsShopId, sendParam, deviceType }) {
|
||||
className={styles.DeclineButton}
|
||||
onClick={() => handleDecline(transaction.transactionId)}
|
||||
>
|
||||
decline
|
||||
batalkan
|
||||
</h5>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user