| {{ __('SL') }}. | {{ __('Party Name') }} | {{ __('Sale Amount') }} | {{ __('Profit') }} | {{ __('Loss') }} | {{ __('Action') }} |
|---|---|---|---|---|---|
| {{ $parties->firstItem() + $loop->index }} | {{ $party->name }} | {{ currency_format($party->sales?->sum('totalAmount'), currency: business_currency()) }} | {{ $profit > 0 ? currency_format($profit, currency: business_currency()) : currency_format(0, currency: business_currency()) }} | {{ $loss < 0 ? currency_format(abs($loss), currency: business_currency()) : currency_format(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()) }} |