This commit is contained in:
zadit
2025-02-16 01:19:51 +07:00
parent 422398c65e
commit df0dbafe18
11 changed files with 285 additions and 112 deletions

View File

@@ -51,7 +51,7 @@ export default function Transactions({ propsShopId, sendParam, deviceType }) {
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);
};
@@ -122,7 +122,7 @@ export default function Transactions({ propsShopId, sendParam, deviceType }) {
{transaction.DetailedTransactions.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>