ok
This commit is contained in:
@@ -73,7 +73,7 @@ export default function Transactions({
|
||||
|
||||
const calculateTotalPrice = (detailedTransactions) => {
|
||||
return detailedTransactions.reduce((total, dt) => {
|
||||
return total + dt.qty * dt.Item.price;
|
||||
return total + dt.qty * (dt.promoPrice ? dt.promoPrice : dt.price);
|
||||
}, 0);
|
||||
};
|
||||
|
||||
@@ -124,7 +124,7 @@ export default function Transactions({
|
||||
|
||||
return (
|
||||
<div className={styles.Transaction}>
|
||||
<div className={styles.TransactionListContainer}>
|
||||
<div className={styles.TransactionListContainer} style={{ overflow: 'hidden' }}>
|
||||
{transaction && (
|
||||
<div
|
||||
key={transaction.transactionId}
|
||||
@@ -133,7 +133,7 @@ export default function Transactions({
|
||||
setSelectedTable(transaction.Table || { tableId: 0 })
|
||||
}
|
||||
>
|
||||
|
||||
|
||||
<div className={styles['receipt-header']}>
|
||||
<ColorRing className={styles['receipt-logo']} />
|
||||
<div className={styles['receipt-info']}>
|
||||
@@ -164,7 +164,7 @@ export default function Transactions({
|
||||
).map((detail) => (
|
||||
<li key={detail.detailedTransactionId}>
|
||||
<span>{detail.Item.name}</span> - {detail.qty} x Rp{" "}
|
||||
{detail.Item.price}
|
||||
{detail.promoPrice ? detail.promoPrice : detail.price}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
@@ -172,9 +172,8 @@ export default function Transactions({
|
||||
<h2 className={styles["Transactions-detail"]}>
|
||||
{transaction.serving_type === "pickup"
|
||||
? "Self pickup"
|
||||
: `Serve to ${
|
||||
transaction.Table ? transaction.Table.tableNo : "N/A"
|
||||
}`}
|
||||
: `Serve to ${transaction.Table ? transaction.Table.tableNo : "N/A"
|
||||
}`}
|
||||
</h2>
|
||||
{(transaction.notes !== "") && (
|
||||
<>
|
||||
@@ -222,13 +221,15 @@ export default function Transactions({
|
||||
isPaymentOpen={isPaymentOpen}
|
||||
>
|
||||
{transaction.payment_type == 'cash' || isPaymentLoading ? (
|
||||
<>
|
||||
{transaction.payment_type == 'cash' && <p>Bayar nanti</p>}
|
||||
</>
|
||||
(transaction.payment_type == 'cash' && 'Bayar nanti')
|
||||
) : isPaymentOpen ? (
|
||||
"Claim has paid" // Display "Confirm has paid" if the transaction is confirmed (1)
|
||||
(transaction.paymentClaimed ? <>
|
||||
<div style={{position: 'absolute', left: '15px', top: '9px'}}>
|
||||
<ColorRing
|
||||
height="20"
|
||||
width="20" className={styles['receipt-logo']} /></div> Menunggu konfirmasi</> : "Klaim telah bayar") // Display "Confirm has paid" if the transaction is confirmed (1)
|
||||
) : (
|
||||
"Show payment" // Display "Confirm availability" if the transaction is not confirmed (0)
|
||||
"Tampilkan QR" // Display "Confirm availability" if the transaction is not confirmed (0)
|
||||
)}
|
||||
</ButtonWithReplica>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user