ficks
This commit is contained in:
@@ -514,10 +514,19 @@ export default function OrderDetailsPage() {
|
|||||||
const required = order?.cryptoTotal || 0;
|
const required = order?.cryptoTotal || 0;
|
||||||
const missing = order?.underpaymentAmount || 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 {
|
return {
|
||||||
received,
|
received,
|
||||||
required,
|
required,
|
||||||
missing,
|
missing,
|
||||||
|
receivedGbp,
|
||||||
|
requiredGbp,
|
||||||
|
missingGbp,
|
||||||
percentage: required > 0 ? ((received / required) * 100).toFixed(1) : 0
|
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 className="grid grid-cols-2 md:grid-cols-4 gap-4 text-sm">
|
||||||
<div>
|
<div>
|
||||||
<p className="text-muted-foreground">Required Amount</p>
|
<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>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-muted-foreground">Received Amount</p>
|
<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>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-muted-foreground">Missing Amount</p>
|
<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>
|
||||||
<div>
|
<div>
|
||||||
<p className="text-muted-foreground">Payment Progress</p>
|
<p className="text-muted-foreground">Payment Progress</p>
|
||||||
|
|||||||
@@ -319,10 +319,15 @@ export default function OrderTable() {
|
|||||||
const required = order.cryptoTotal || 0;
|
const required = order.cryptoTotal || 0;
|
||||||
const missing = order.underpaymentAmount || 0;
|
const missing = order.underpaymentAmount || 0;
|
||||||
|
|
||||||
|
// Calculate LTC to GBP exchange rate from order data
|
||||||
|
const ltcToGbpRate = required > 0 ? order.totalPrice / required : 0;
|
||||||
|
const missingGbp = missing * ltcToGbpRate;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
received,
|
received,
|
||||||
required,
|
required,
|
||||||
missing,
|
missing,
|
||||||
|
missingGbp,
|
||||||
percentage: required > 0 ? ((received / required) * 100).toFixed(1) : 0
|
percentage: required > 0 ? ((received / required) * 100).toFixed(1) : 0
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -454,7 +459,7 @@ export default function OrderTable() {
|
|||||||
<span>£{order.totalPrice.toFixed(2)}</span>
|
<span>£{order.totalPrice.toFixed(2)}</span>
|
||||||
{underpaidInfo && (
|
{underpaidInfo && (
|
||||||
<span className="text-xs text-red-400">
|
<span className="text-xs text-red-400">
|
||||||
Missing: £{(underpaidInfo.missing * 100).toFixed(2)}
|
Missing: £{underpaidInfo.missingGbp.toFixed(2)} ({underpaidInfo.missing.toFixed(8)} LTC)
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user