@extends('layouts.pdf') @section('title') {{ $extra['module_name'] }} @endsection @section('content')
@include('admin.partials.header', ['extra' => $extra]) @if (!$extra['branch']) @endif @foreach ($file_receivings as $file_receiving) @php $file_sold_received_amount=0; if(isset($file_receiving->fileSold->general_receipt_items)){ $file_sold_received_amount = $file_receiving->fileSold->general_receipt_items->sum('amount'); } $difference_amount=0; if($file_receiving->fileSold->file_sold_amount){ $difference_amount = $file_receiving->fileSold->file_sold_amount - $file_receiving->file_actual_amount; } $profit_amount = 0; $profit_percent = 0; $loss_amount = 0; $loss_percent = 0; if($difference_amount){ $profit_amount = ($difference_amount > 0) ? $difference_amount : 0; $loss_amount = ($difference_amount < 0) ? abs($difference_amount) : 0; $profit_percent = ($profit_amount > 0) ? ($profit_amount/$file_receiving->file_actual_amount) * 100 : 0; $loss_percent = ($loss_amount > 0) ? ($loss_amount/$file_receiving->file_actual_amount) * 100 : 0; } $grand_term_amount += $file_receiving->term->payable_amount; $grand_file_receiving_amount += $file_receiving->file_actual_amount; $grand_file_sold_amount += $file_receiving->fileSold->file_sold_amount; $grand_profit_amount += $profit_amount; $grand_loss_amount += $loss_amount; $grand_received_amount += $file_sold_received_amount; @endphp @if (!$extra['branch']) @endif @endforeach {{-- GRAND PROFIT START --}} @php $grand_profit_percent= 0; $grand_loss_percent = 0; if($grand_profit_amount){ $grand_profit_percent = ($grand_profit_amount/$grand_file_receiving_amount)*100; } if($grand_loss_amount){ $grand_loss_percent = ($grand_loss_amount/$grand_file_receiving_amount)*100; } @endphp {{-- GRAND PROFIT END --}}
{{__('lang.serial_no')}} {{__('lang.project')}} {{__('lang.customer')}} {{__('lang.registration_no')}} {{__('lang.term')}} {{__('lang.term')}} {{$transaction->systemSettingCurrency()}} {{__('lang.file_name')}} {{__('lang.file_receiving_amount')}} {{$transaction->systemSettingCurrency()}} {{__('lang.file_sold_amount')}} {{$transaction->systemSettingCurrency()}} {{__('lang.net_profit')}} {{$transaction->systemSettingCurrency()}} {{__('lang.net_profit_percentage')}} {{__('lang.net_loss')}} {{$transaction->systemSettingCurrency()}} {{__('lang.net_loss_percentage')}} {{__('lang.file_sold_received')}} {{$transaction->systemSettingCurrency()}}
{{ $loop->iteration }}{{ $file_receiving->sell->branch->name }}{{ $file_receiving->sell->customer->name }} {{ $file_receiving->sell->registration_no }} {{ $file_receiving->term->term }} {{ $transaction->convert_money_format($file_receiving->term->payable_amount) }} {{ $file_receiving->file_number }} {{ $transaction->convert_money_format($file_receiving->file_actual_amount) }} @if ($file_receiving->fileSold->file_sold_amount) {{ $transaction->convert_money_format($file_receiving->fileSold->file_sold_amount) }} @else - @endif @if ($profit_amount) {{ $transaction->convert_money_format($profit_amount) }} @else - @endif @if ($profit_percent) {{ number_format($profit_percent,2) }} % @else - @endif @if ($loss_amount) {{ $transaction->convert_money_format($loss_amount) }} @else - @endif @if ($loss_percent) {{ number_format($loss_percent,2) }} % @else - @endif {{ $transaction->convert_money_format($file_sold_received_amount) }}
{{__('lang.total')}} {{ $transaction->convert_money_format($grand_term_amount) }} {{ $transaction->convert_money_format($grand_file_receiving_amount) }} @if ($grand_file_sold_amount) {{ $transaction->convert_money_format($grand_file_sold_amount) }} @else - @endif @if ($grand_profit_percent) {{ $transaction->convert_money_format($grand_profit_amount) }} @else - @endif @if ($grand_profit_percent) {{ number_format($grand_profit_percent,2) }} % @else - @endif @if ($grand_loss_amount) {{ $transaction->convert_money_format($grand_loss_amount) }} @else - @endif @if ($grand_loss_percent) {{ number_format($grand_loss_percent,2) }} % @else - @endif {{ $transaction->convert_money_format($grand_received_amount) }}
@stop