84 lines
4.6 KiB
PHP
84 lines
4.6 KiB
PHP
@extends('layouts.business.pdf.pdf_layout')
|
|
|
|
@section('pdf_title')
|
|
<div class="table-header justify-content-center border-0 d-none d-block d-print-block text-center">
|
|
@include('business::print.header')
|
|
<h4 style="text-align: center; margin: 0; padding: 0; font-size: 16px;" class="">{{ __('Bill Wise Profit & Loss') }}</h4>
|
|
@if ($filter_from_date && $filter_to_date)
|
|
<p style="text-align: center; margin: 0; padding: 0; font-weight: 400; font-size: 14px;" class="">{{ __('Duration:') }}
|
|
@if ($duration === 'today')
|
|
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
|
|
@elseif ($duration === 'yesterday')
|
|
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
|
|
@else
|
|
{{ Carbon\Carbon::parse($filter_from_date)->format('d-m-Y') }}
|
|
{{ __('to') }}
|
|
{{ Carbon\Carbon::parse($filter_to_date)->format('d-m-Y') }}
|
|
@endif
|
|
</p>
|
|
@endif
|
|
</div>
|
|
@endsection
|
|
|
|
@section('pdf_content')
|
|
<table width="100%" cellpadding="6" cellspacing="0" style="border-collapse: collapse; border: 1px solid gainsboro; font-size:12px;">
|
|
<thead>
|
|
<tr style="background-color: #C52127; color: white;">
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Date') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Invoice') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Party Name') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Sale Amount') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Profit') }}</th>
|
|
<th style="border:1px solid gainsboro; color:white;" class="text-start">{{ __('Loss') }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tbody>
|
|
@foreach ($profits as $profit)
|
|
<tr style="background-color: {{ $loop->even ? '#F5F5F5' : '#FFFFFF' }};">
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ formatted_date($profit->saleDate) }}
|
|
</td>
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ $profit->invoiceNumber }}
|
|
</td>
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ $profit->party->name ?? '' }}
|
|
</td>
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ currency_format($profit->totalAmount, currency: business_currency()) }}
|
|
</td>
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ $profit->lossProfit > 0 ? currency_format($profit->lossProfit, currency: business_currency()) : '' }}
|
|
</td>
|
|
<td style="border:1px solid gainsboro; text-align:center;">
|
|
{{ $profit->lossProfit < 0 ? currency_format(abs($profit->lossProfit), currency: business_currency()) : '' }}
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
@if ($profits->count() > 0)
|
|
<tfoot>
|
|
<tr style="background-color:#C52127; color:#FFFFFF; font-weight:bold;">
|
|
<td style="border:1px solid gainsboro; text-align:center; color: white">
|
|
{{ __('Total') }}
|
|
</td>
|
|
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
|
<td style="border:1px solid gainsboro; text-align:center;"></td>
|
|
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
|
{{ currency_format($profits->sum('totalAmount'), currency: business_currency()) }}
|
|
</td>
|
|
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
|
{{ currency_format($profits->where('lossProfit', '>', 0)->sum('lossProfit'), currency: business_currency()) }}
|
|
</td>
|
|
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
|
|
{{ currency_format(abs($profits->where('lossProfit', '<', 0)->sum('lossProfit')), currency: business_currency()) }}
|
|
</td>
|
|
</tr>
|
|
</tfoot>
|
|
@endif
|
|
</table>
|
|
@endsection
|
|
|
|
|