Files
kulakpos_web/Modules/Business/resources/views/loss-profit-histories/pdf.blade.php

88 lines
5.1 KiB
PHP
Raw Normal View History

2026-03-15 17:08:23 +07:00
@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;">{{ __('Loss Profit History List') }}</h4>
</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="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Income Types') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Date') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Sale') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Income') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Expenses Types') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Date') }}</th>
<th style="font-size:12px; border:1px solid gainsboro; color: white" class="text-start">{{ __('Expense') }}</th>
</tr>
</thead>
<tbody>
@php
$maxRowCount = max($mergedIncomeSaleData->count(), $mergedExpenseData->count());
@endphp
@for ($i = 0; $i < $maxRowCount; $i++)
@php
$incomeSaleRow = $mergedIncomeSaleData[$i] ?? null;
$expenseRow = $mergedExpenseData[$i] ?? null;
@endphp
<tr>
{{-- Sale / Income Column --}}
<td style="border:1px solid gainsboro; text-align:center;">
{{ $incomeSaleRow ? $incomeSaleRow->type : '' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $incomeSaleRow ? formatted_date($incomeSaleRow->date) : '' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $incomeSaleRow && isset($incomeSaleRow->total_sales) ? currency_format($incomeSaleRow->total_sales, 'icon', 2, business_currency()) : '' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $incomeSaleRow && isset($incomeSaleRow->total_incomes) ? currency_format($incomeSaleRow->total_incomes, 'icon', 2, business_currency()) : '' }}
</td>
{{-- Expense Column --}}
<td style="border:1px solid gainsboro; text-align:center;">
{{ $expenseRow ? $expenseRow->type : '' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $expenseRow ? formatted_date($expenseRow->date) : '' }}
</td>
<td style="border:1px solid gainsboro; text-align:center;">
{{ $expenseRow ? currency_format($expenseRow->total_expenses ?? 0, 'icon', 2, business_currency()) : '' }}
</td>
</tr>
@endfor
{{-- Summary Rows --}}
<tr style="background-color:#C52127; color:#FFFFFF; font-weight:bold;">
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;" colspan="2">{{ __('Gross Profit') }}</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($grossSaleProfit, 'icon', 2, business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($grossIncomeProfit, 'icon', 2, business_currency()) }}
</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;" colspan="2">{{ __('Total Expenses') }}</td>
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;">
{{ currency_format($totalExpenses, 'icon', 2, business_currency()) }}
</td>
</tr>
<tr style="background-color:#C52127; color:#FFFFFF; font-weight:bold;">
<td style="border:1px solid gainsboro; text-align:center; color: white; font-weight: 600;" colspan="7">
{{ __('Net Profit (Income - Expense) =') }}
<span class="{{ $netProfit >= 0 ? 'profit-ammount' : 'expense-ammount' }}">
{{ currency_format($netProfit, 'icon', 2, business_currency()) }}
</span>
</td>
</tr>
</tbody>
</table>
@endsection