This commit is contained in:
NotII
2025-07-22 02:40:36 +01:00
parent b329c8422d
commit cb1335b8fd
2 changed files with 21 additions and 4 deletions

View File

@@ -514,10 +514,19 @@ export default function OrderDetailsPage() {
const required = order?.cryptoTotal || 0;
const missing = order?.underpaymentAmount || 0;
// Calculate LTC to GBP exchange rate from order data
const ltcToGbpRate = required > 0 ? (order?.totalPrice || 0) / required : 0;
const receivedGbp = received * ltcToGbpRate;
const requiredGbp = order?.totalPrice || 0;
const missingGbp = missing * ltcToGbpRate;
return {
received,
required,
missing,
receivedGbp,
requiredGbp,
missingGbp,
percentage: required > 0 ? ((received / required) * 100).toFixed(1) : 0
};
};
@@ -616,15 +625,18 @@ export default function OrderDetailsPage() {
<div className="grid grid-cols-2 md:grid-cols-4 gap-4 text-sm">
<div>
<p className="text-muted-foreground">Required Amount</p>
<p className="font-mono">{underpaidInfo.required}</p>
<p className="font-mono">£{underpaidInfo.requiredGbp.toFixed(2)}</p>
<p className="font-mono text-xs text-muted-foreground">{underpaidInfo.required.toFixed(8)} LTC</p>
</div>
<div>
<p className="text-muted-foreground">Received Amount</p>
<p className="font-mono">{underpaidInfo.received}</p>
<p className="font-mono">£{underpaidInfo.receivedGbp.toFixed(2)}</p>
<p className="font-mono text-xs text-muted-foreground">{underpaidInfo.received.toFixed(8)} LTC</p>
</div>
<div>
<p className="text-muted-foreground">Missing Amount</p>
<p className="font-mono text-red-600">{underpaidInfo.missing}</p>
<p className="font-mono text-red-600">£{underpaidInfo.missingGbp.toFixed(2)}</p>
<p className="font-mono text-xs text-red-400">{underpaidInfo.missing.toFixed(8)} LTC</p>
</div>
<div>
<p className="text-muted-foreground">Payment Progress</p>