77 lines
3.6 KiB
PHP
77 lines
3.6 KiB
PHP
<table class="table table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th class="text-start income-type">{{ __('Income Types') }}</th>
|
|
<th class="text-start d-print-none">{{ __('Date') }}</th>
|
|
<th class="text-start">{{ __('Sale') }}</th>
|
|
<th class="text-end d-print-none">{{ __('Income') }}</th>
|
|
<th class="text-start expense-type">{{ __('Expenses Types') }}</th>
|
|
<th class="text-start d-print-none">{{ __('Date') }}</th>
|
|
<th class="text-end">{{ __('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 class="text-start loss-profit-tbody">
|
|
{{ $incomeSaleRow ? $incomeSaleRow->type : '' }}
|
|
</td>
|
|
<td class="text-start loss-profit-tbody d-print-none">
|
|
{{ $incomeSaleRow ? formatted_date($incomeSaleRow->date) : '' }}
|
|
</td>
|
|
<td class="text-start loss-profit-tbody d-print-none">
|
|
{{ $incomeSaleRow && isset($incomeSaleRow->total_sales) ? currency_format($incomeSaleRow->total_sales, 'icon', 2, business_currency()) : '' }}
|
|
</td>
|
|
<td class="text-end loss-profit-tbody d-print-none">
|
|
{{ $incomeSaleRow && isset($incomeSaleRow->total_incomes) ? currency_format($incomeSaleRow->total_incomes, 'icon', 2, business_currency()) : '' }}
|
|
</td>
|
|
|
|
{{-- Expense Column --}}
|
|
<td class="text-start loss-profit-tbody expense-type">
|
|
{{ $expenseRow ? $expenseRow->type : '' }}
|
|
</td>
|
|
<td class="text-start loss-profit-tbody d-print-none">
|
|
{{ $expenseRow ? formatted_date($expenseRow->date) : '' }}
|
|
</td>
|
|
<td class="text-end loss-profit-tbody">
|
|
{{ $expenseRow ? currency_format($expenseRow->total_expenses ?? 0, 'icon', 2, business_currency()) : '' }}
|
|
</td>
|
|
</tr>
|
|
@endfor
|
|
|
|
{{-- Summary Rows --}}
|
|
<tr class="fw-bold d-print-none">
|
|
<td class="text-start bottom-profit-expense" colspan="2">{{ __('Gross Profit') }}</td>
|
|
<td class="text-start bottom-profit-expense">
|
|
{{ currency_format($grossSaleProfit, 'icon', 2, business_currency()) }}
|
|
</td>
|
|
<td class="text-end bottom-profit-expense">
|
|
{{ currency_format($grossIncomeProfit, 'icon', 2, business_currency()) }}
|
|
</td>
|
|
<td class="text-start bottom-profit-expense expense-type" colspan="2">{{ __('Total Expenses') }}</td>
|
|
<td class="text-end bottom-profit-expense">
|
|
{{ currency_format($totalExpenses, 'icon', 2, business_currency()) }}
|
|
</td>
|
|
</tr>
|
|
|
|
<tr class="fw-bold text-center bg-light">
|
|
<td class="bottom-net-profit" 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>
|