{{ $product->name }}

@if ($product->productgroup) {{ $product->productgroup->name }} @endif @if ($product->location) {{ $product->location }} @endif @if ($product->code) {{ $product->code }} @endif @if ($product->productWebsites && $product->productWebsites->count() > 0) @foreach ($product->productWebsites as $website) @php $domain = parse_url($website->link, PHP_URL_HOST) ?? $website->link; // Extract domain from URL $domain = preg_replace('/^www\./i', '', $domain); // Remove 'www.' if present @endphp {{ $domain }} @endforeach @endif
{{ __('Pricing Information') }}
@can('reports.ledger')
{{ __('Account Subjects') }}
@endcan @if (isset($product->description) && $product->description)
{{ __('Description') }}
{{ $product->description }}
@endif
{{ __('Transaction History') }}
@forelse ($historyItems as $item) @empty @endforelse @if ($historyItems->hasPages()) @endif
{{ __('Date') }} {{ __('Buy') }} {{ __('Sell') }} {{ __('Buy Unit Price') }} {{ __('Ancillary Cost') }} {{ __('Sell Unit Price') }} {{ __('OFF') }} {{ __('Remaining') }}
{{ formatDate($item->invoice->date) }} @if ($item->invoice->invoice_type === \App\Enums\InvoiceType::BUY) {{ formatNumber($item->quantity) }} @else - @endif @if ($item->invoice->invoice_type === \App\Enums\InvoiceType::SELL) {{ formatNumber($item->quantity) }} @else - @endif @if ($item->invoice->invoice_type === \App\Enums\InvoiceType::BUY) {{ formatNumber($item->unit_price) }} @else - @endif @php $ancillaryCost = 0; if ($item->invoice->invoice_type === \App\Enums\InvoiceType::BUY) { $ancillaryCost = $item->invoice->ancillaryCosts->sum(function ($ac) { return $ac->items->sum('amount'); }) / $item->quantity; } @endphp @if ($ancillaryCost > 0) {{ formatNumber($ancillaryCost) }} @else - @endif @if ($item->invoice->invoice_type === \App\Enums\InvoiceType::SELL) {{ formatNumber($item->unit_price) }} @else - @endif @if ($item->unit_discount > 0) {{ formatNumber($item->unit_discount) }} @else - @endif @if ($item->invoice->status->isApproved()) {{ formatNumber($item->quantity_at + $item->quantity) }} @else - @endif
{{ __('No transactions found') }}
{{ __('Balance from previous page') }} @php $balanceFromPrevious = 0; if ($historyItems->currentPage() < $historyItems->lastPage() && $historyItems->isNotEmpty()) { $lastItem = $historyItems->last(); $balanceFromPrevious = $lastItem->quantity; } if ($historyItems->currentPage() == 1) { $balanceFromPrevious = $product->quantity; } @endphp {{ formatNumber($balanceFromPrevious) }}
@if ($historyItems->hasPages())
{{ $historyItems->links() }}
@endif