@extends('crm.layouts.master') @section('title','Trades') @section('page-css') @endsection @section('main-content')
@if(session('success'))| # | Client | Symbol | Side | Quantity | Price | Total | P/L | Currency | Executed By | Open Date | Close Date | Actions | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $trade->id }} | {{ $trade->lead->fname ?? '' }} {{ $trade->lead->lname ?? '' }} |
{{ $trade->symbol->name ?? '—' }}
{{ $trade->symbol->tv_symbol ?? '' }} |
{{ strtoupper($trade->side) }} | {{ rtrim(rtrim(number_format($trade->quantity, 8), '0'), '.') }} | {{ number_format($trade->price, 2) }} | {{ number_format($trade->total_cost, 2) }} | @if($trade->side === 'buy')— | @elseif($trade->realized_pnl === null)Unavailable | @else @php $realizedPnl = (float) $trade->realized_pnl; $pnlClass = $realizedPnl > 0 ? 'text-success' : ($realizedPnl < 0 ? 'text-danger' : 'text-muted'); $pnlSign = $realizedPnl > 0 ? '+' : ($realizedPnl < 0 ? '-' : ''); @endphp{{ $pnlSign }}{{ $trade->currency }} {{ number_format(abs($realizedPnl), 2) }} | @endif{{ $trade->currency }} | {{ $trade->executor->name ?? '—' }} | @if($trade->position_opened_at) {{ $trade->position_opened_at->format('Y-m-d H:i') }} @elseif($trade->side === 'sell') Unavailable @else — @endif | {{ $trade->side === 'sell' ? $trade->traded_at->format('Y-m-d H:i') : '—' }} |