@extends('layouts.app') @section('title') {{ $pageInfo['title'] }} @endsection @section('admin-content')

{{ $pageInfo['title'] }}

  • Cabang: {{ $cabang->name }}
  • Periode: {{ ucfirst($month) }} {{ $year }} Periode Accounting: {{ request()->accounting_period ?? '-' }}
  • Cost Centre: {{ $cabang->cost->code }}
@php /** * PEMBARUAN LOGIKA: * 1. Building Maintenance Dihapus * 2. Presentation Ditambahkan di urutan ke-7 * 3. Account Number disesuaikan dengan image_01e273.png */ $configJurnal = [ ['name' => 'Telp./ Fax / Email', 'account' => '800 104 00'], ['name' => 'Listrik', 'account' => '800 105 00'], ['name' => 'Postages / Courier', 'account' => '800 107 00'], ['name' => 'Office Supplies / Bank Changes / Interest', 'account' => '800 108 00'], ['name' => 'Relokasi', 'account' => '800 111 00'], ['name' => 'Meeting / Seminar', 'account' => '800 201 00'], ['name' => 'Presentation', 'account' => '800 304 00'], // Urutan ke-7 ['name' => 'Up Country', 'account' => '800 305 00'], ['name' => 'Vehicle Running Cost', 'account' => '800 306 00'], ['name' => 'Field Force', 'account' => '800 308 00'], ['name' => 'Entertainment', 'account' => '800 309 00'], ['name' => 'Rumah Tangga', 'account' => '800 213 00'], ]; $totalDr = 0; $totalCr = 0; $counter = 1; // Mencari ID Kategori berdasarkan nama untuk mengambil nilai dari array $nominals $kategoriCollection = collect($kategori); @endphp
@include('backend.layouts.partials.messages') {{-- 1 - 12: Loop berdasarkan config yang sudah diurutkan --}} @foreach ($configJurnal as $conf) @php // Ambil objek kategori dari database yang namanya cocok $katObj = $kategoriCollection->where('name', $conf['name'])->first(); $drValue = $katObj ? ($nominals[$katObj->id] ?? 0) : 0; $totalDr += $drValue; @endphp @endforeach {{-- 13: Cash in Bank BCA --}} @php $cashInBankValue = $pettyCashAmount - $totalKategori; @endphp @if ($cashInBankValue >= 0) @php $totalDr += $cashInBankValue; @endphp @else @php $totalCr += abs($cashInBankValue); @endphp @endif {{-- 14: Petty Cash --}} {{-- 15: Cash Advance (Opening) --}} {{-- 16: Cash Advance (Ending) --}}
# Type Account Number Dr Cr
{{ $counter++ }} {{ $conf['name'] }} {{ $conf['account'] }} {{ $drValue == 0 ? '' : number_format($drValue, 0, ',', '.') }}
{{ $counter++ }} Cash in Bank BCA 170 600 00{{ $cashInBankValue == 0 ? '' : number_format($cashInBankValue, 0, ',', '.') }} {{ number_format(abs($cashInBankValue), 0, ',', '.') }}
{{ $counter++ }} Petty Cash @php $totalCr += $pettyCashAmount; @endphp {{ $pettyCashAmount == 0 ? '' : number_format($pettyCashAmount, 0, ',', '.') }}
{{ $counter++ }} Cash Advance (Opening Balance) 170 600 00 @php $totalCr += 500000; @endphp {{ number_format(500000, 0, ',', '.') }}
{{ $counter++ }} Cash Advance (Ending Balance) 170 600 00 @php $totalDr += 500000; @endphp {{ number_format(500000, 0, ',', '.') }}
Total {{ number_format($totalDr, 0, ',', '.') }} {{ number_format($totalCr, 0, ',', '.') }}
@endsection @section('scripts') @endsection