@extends('layouts.admin') @push('styles') @endpush @section('content')
Refresh

Statement of Financial Position

@php $totalExpense = 0; $totalInDirExpense = 0; $totalAssetExpense = 0; $totalSale = 0; $totalPurchase = 0; $prevOutlet = null; $outletTotal = 0; $grandTotal = 0; @endphp @foreach ($saleData as $sale) @if ($prevOutlet !== null && $sale->outlet_name != $prevOutlet) @php $outletTotal = 0; @endphp @endif @if ($sale->outlet_name != $prevOutlet) @php $prevOutlet = $sale->outlet_name; @endphp @else @endif @php $outletTotal += $sale->amount; $grandTotal += $sale->amount; @endphp @endforeach {{-- Final outlet total (for the last group) --}} @if ($prevOutlet !== null) @endif {{-- Grand total --}} @php $groupedPurchase = []; foreach ($purchase as $pur) { $groupedPurchase[$pur->cat_name][] = $pur; } @endphp @foreach ($groupedPurchase as $categoryName => $items) @foreach ($items as $pur) @php $totalPurchase += $pur->total_amt; @endphp @endforeach @endforeach @if (!empty($direct_expense)) @php $groupedExpenses = []; foreach ($direct_expense as $v) { $groupedExpenses[$v->group_name][] = $v; } @endphp @foreach ($groupedExpenses as $groupName => $items) @foreach ($items as $v) @php $totalExpense = $totalExpense + $v->amount; @endphp @endforeach @endforeach @endif @if (!empty($direct_expense)) @php $groupedExpenses = []; foreach ($inDirect_expense as $v) { $groupedExpenses[$v->group_name][] = $v; } @endphp @foreach ($groupedExpenses as $groupName => $items) @foreach ($items as $v) @php $totalInDirExpense = $totalInDirExpense + $v->amount; @endphp @endforeach @endforeach @endif @php $profit = $totalSale - ($totalCostOfSale + $totalTaxAmt + $totalTransportCost + $totalAssetExpense +$totalInDirExpense); @endphp
{{ $companyInfo->company_name }}
Ramarbagh, Kutubpur, Fatullah, Narayanganj

Statement of Financial Position

Date: {{ $formdate }} To {{ $todate }}

Description Payment Method Taka Taka
Sales
Total ({{ $prevOutlet }}) {{ number_format($outletTotal, 2) }}
{{ $sale->outlet_name }} {{ $sale->payment_method }} {{ number_format($sale->amount, 2) }}
Total ({{ $prevOutlet }}) {{ number_format($outletTotal, 2) }}
Net Sale (All Outlets) {{ number_format($grandTotal, 2) }}
Factory & Kitchen Opening Opening Amount Total Amount
Factory {{$factoryOpening}}
Kitchen {{$kitchenOpening}}
Total @php $factoryAndKitchenOpeningBalance = $factoryOpening + $kitchenOpening; @endphp {{$factoryAndKitchenOpeningBalance}}
Purchase Product Name Quantity Avg Total Amount
▶ {{ $categoryName }} {{ number_format(collect($items)->sum(function($item) { return $item->quantity * $item->rate; }), 2) }}
Total Purchase {{$totalPurchase }}
Direct Expense
▶ {{ $groupName }} {{ collect($items)->sum('amount') }}
Net Direct Expense {{ $totalExpense }}
Cost Of Sale @php $totalCostOfSale = $totalExpense + $totalPurchase +$factoryAndKitchenOpeningBalance; @endphp {{$totalCostOfSale}}
Factory & Kitchen Closing Closing Amount
Factory {{$factoryClosing}}
Kitchen {{$kitchenClosing}}
Total @php $totalFactoryAndKitchenClosing=$kitchenClosing + $factoryClosing; @endphp {{ $totalFactoryAndKitchenClosing}}
Cost of Goods Sold @php $closingStock = ($totalCostOfSale) - $totalFactoryAndKitchenClosing; @endphp {{$closingStock}}
Gross Profit @php $grossProfit = ($grandTotal-$closingStock); @endphp {{number_format($grossProfit,2)}}
Direct Expense
▶ {{ $groupName }} {{ collect($items)->sum('amount') }}
Net Direct Expense {{ $totalInDirExpense }}
Net Profit @php $netProfit = $grossProfit +$totalInDirExpense; @endphp {{ $netProfit }}
@endsection @push('scripts') @endpush