fix: display monetary value
parent
8222eb4b50
commit
69a93b1041
|
@ -12,7 +12,7 @@ import { Download, Search, Loader2, DollarSign, TrendingUp, Calculator } from "l
|
||||||
|
|
||||||
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:5000/api/v1"
|
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:5000/api/v1"
|
||||||
|
|
||||||
function formatDateBr(dateStr:string) {
|
function formatDateBr(dateStr: string) {
|
||||||
const [year, month, day] = dateStr.split("-");
|
const [year, month, day] = dateStr.split("-");
|
||||||
return `${day}/${month}/${year}`;
|
return `${day}/${month}/${year}`;
|
||||||
}
|
}
|
||||||
|
@ -319,7 +319,7 @@ export default function TranscriptionTable() {
|
||||||
{formatCurrency(costInfo.total_client_cost, "BRL")}
|
{formatCurrency(costInfo.total_client_cost, "BRL")}
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xs text-muted-foreground">
|
<p className="text-xs text-muted-foreground">
|
||||||
{formatDateBr(costInfo.start_date)} até {formatDateBr(costInfo.end_date)}
|
{formatDateBr(costInfo.start_date)} até {formatDateBr(costInfo.end_date)}
|
||||||
</p>
|
</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
|
@ -495,22 +495,24 @@ export default function TranscriptionTable() {
|
||||||
<TableCell>{(item as HitTranscriptionData).src || "-"}</TableCell>
|
<TableCell>{(item as HitTranscriptionData).src || "-"}</TableCell>
|
||||||
<TableCell>{(item as HitTranscriptionData).dst || "-"}</TableCell>
|
<TableCell>{(item as HitTranscriptionData).dst || "-"}</TableCell>
|
||||||
<TableCell>{(item as HitTranscriptionData).total_billsec || "-"}</TableCell>
|
<TableCell>{(item as HitTranscriptionData).total_billsec || "-"}</TableCell>
|
||||||
<TableCell>{(item as HitTranscriptionData).total_min || "-"}</TableCell>
|
<TableCell>{(item as HitTranscriptionData).total_min || "-"}</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{(item as HitTranscriptionData).client_total_cost
|
{(item as HitTranscriptionData)?.client_total_cost
|
||||||
? `R$ ${(item as HitTranscriptionData).client_total_cost.slice(0, 4)}`
|
? `R$ ${Number((item as HitTranscriptionData).client_total_cost).toFixed(2)}`
|
||||||
: "-"}
|
: "-"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{(item as HitTranscriptionData).client_price
|
{(item as HitTranscriptionData).client_price
|
||||||
? `R$ ${(item as HitTranscriptionData).client_price}`
|
? `R$ ${(item as HitTranscriptionData).client_price}`
|
||||||
: "-"}
|
: "-"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{(item as HitTranscriptionData).custo_hit
|
{(item as HitTranscriptionData)?.custo_hit
|
||||||
? `$ ${(item as HitTranscriptionData).custo_hit.slice(0, 4)}`
|
? `$ ${Number((item as HitTranscriptionData).custo_hit).toFixed(2)}`
|
||||||
: "-"}
|
: "-"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
<TableCell>{formatDateTime((item as HitTranscriptionData).start_call || "-")}</TableCell>
|
<TableCell>{formatDateTime((item as HitTranscriptionData).start_call || "-")}</TableCell>
|
||||||
<TableCell>{formatDateTime((item as HitTranscriptionData).end_call || "-")}</TableCell>
|
<TableCell>{formatDateTime((item as HitTranscriptionData).end_call || "-")}</TableCell>
|
||||||
<TableCell>{(item as HitTranscriptionData).qtd_token_input || "-"}</TableCell>
|
<TableCell>{(item as HitTranscriptionData).qtd_token_input || "-"}</TableCell>
|
||||||
|
@ -525,10 +527,12 @@ export default function TranscriptionTable() {
|
||||||
<TableCell>{(item as ClientTranscriptionData).total_billsec || "-"}</TableCell>
|
<TableCell>{(item as ClientTranscriptionData).total_billsec || "-"}</TableCell>
|
||||||
<TableCell>{(item as ClientTranscriptionData).total_min || "-"}</TableCell>
|
<TableCell>{(item as ClientTranscriptionData).total_min || "-"}</TableCell>
|
||||||
<TableCell>
|
<TableCell>
|
||||||
{(item as ClientTranscriptionData).client_total_cost
|
{(item as ClientTranscriptionData)?.client_total_cost
|
||||||
? `R$ ${(item as ClientTranscriptionData).client_total_cost.slice(0, 4)}`
|
? `R$ ${Number((item as ClientTranscriptionData).client_total_cost).toFixed(2)}`
|
||||||
: "-"}
|
: "-"}
|
||||||
</TableCell>
|
</TableCell>
|
||||||
|
|
||||||
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
Loading…
Reference in New Issue