@extends('layouts/layoutMaster') @section('title', 'Edit Jurnal Single Entry') @section('vendor-style') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-buttons-bs5/buttons.bootstrap5.scss', 'resources/assets/vendor/libs/select2/select2.scss' ]) @endsection @section('vendor-script') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js', 'resources/assets/vendor/libs/select2/select2.js', ]) @endsection @section('page-script') @vite('Modules/Akuntansi/resources/assets/js/edit-single-journal.js') @endsection @section('content')
Edit Jurnal Single Entry
@csrf @method('PUT')
@php // Determine current entry settings $firstEntry = $journal->entries->first(); $entryType = $firstEntry ? $firstEntry->entry_type : ''; $accountType = $firstEntry ? $firstEntry->listSubAccount->subAccount->account->account_type : ''; // Determine flow based on entry type and account type $flow = ''; if ($entryType && $accountType) { if (in_array($accountType, [1, 5])) { // Assets and Expenses $flow = $entryType === 'debit' ? 'positive' : 'negative'; } else { // Liabilities, Equity, and Income $flow = $entryType === 'credit' ? 'positive' : 'negative'; } } @endphp
Pilih 'Penambahan' untuk menambah saldo atau 'Pengurangan' untuk mengurangi saldo akun.
Transaksi ini akan dicatat sebagai {{ strtoupper($entryType) }}
Kembali
@endsection @php function getAccountTypeName($type) { $types = [ 1 => 'Aset', 2 => 'Liabilitas', 3 => 'Ekuitas', 4 => 'Pendapatan', 5 => 'Beban' ]; return $types[$type] ?? 'Lainnya'; } @endphp