@extends('layouts.business.pdf.pdf_layout') @section('pdf_title')
@include('business::print.header')

{{ __('Party Loss Profit Report') }}

{{--

{{ __('Duration: 14-12-2025 to 24-12-2025') }}

--}}
@endsection @section('pdf_content') @foreach ($parties as $party) @endforeach @if ($parties->count() > 0) @endif
{{ __('Party Name') }} {{ __('Sale Amount') }} {{ __('Profit') }} {{ __('Loss') }}
{{ $party->name }} {{ currency_format($party->sales?->sum('totalAmount'), currency: business_currency()) }} {{ currency_format($party->sales?->where('lossProfit', '>', 0)->sum('lossProfit') ?? 0, currency: business_currency()) }} {{ currency_format($party->sales?->where('lossProfit', '<', 0)->sum('lossProfit') ?? 0, currency: business_currency()) }}
{{ __('Total') }} {{ currency_format($parties->sum(fn($party) => $party->sales?->sum('totalAmount') ?? 0), currency: business_currency()) }} {{ currency_format($parties->sum(fn($party) => $party->sales?->where('lossProfit', '>', 0)->sum('lossProfit') ?? 0), currency: business_currency()) }} {{ currency_format(abs($parties->sum(fn($party) => $party->sales?->where('lossProfit', '<', 0)->sum('lossProfit') ?? 0)), currency: business_currency()) }}
@endsection