@extends('layouts.master') @section('title', 'General Ledger Entry | Alboosh - Timeless authenticity, born of the desert') @section('title-topbar', __('basic.general ledger')) @section('css') @endsection @section('content')
{{ __('basic.dashboard') }} | {{ __('basic.quotation') }}
{{ __('basic.new entry') }} {{ __('basic.print') }} {{ __('basic.search filter') }}
{{ __('basic.general ledger') }}
{{ $company_name }}
{{ __('basic.from') }} {{ $date_from }} {{ __('basic.to') }} {{ $date_to }}
{{ __('basic.currency') }} {{ $system_currency->name }}
@foreach ($accounts as $item)
{{ $item->name }} {{ $item->code }}
@php $total_debit = 0; $total_credit = 0; $total_amount = 0; @endphp @foreach ($item->entry_items as $item_ent) @endforeach
{{ __('basic.transaction') }} {{ __('basic.worker') }} {{ __('basic.debit') }} {{ __('basic.credit') }} {{ __('basic.amount') }}
@php $icon = "fas fa-wallet"; $icon_color = "main-color"; @endphp

{{ "(". $item_ent->new_id . ")" . $item_ent->date }}

{{ $item_ent->description . "(". $item_ent->code . ")" }}

{{ $item_ent->entry->worker->full_name}} @php $total_debit += $item_ent->debit_local; @endphp @if($item_ent->debit_local !== '0.00') {{ $item_ent->debit_local }} {{ $system_currency->code }} @endif @php $total_credit += $item_ent->credit_local; @endphp @if($item_ent->credit_local !== '0.00') {{ $item_ent->credit_local }} {{ $system_currency->code }} @endif @php //if it is credit if ($item->origin == 0) { if ($item_ent->credit_local > 0) { //more credit and the acc origin is credit, balance will be + $new_acc_balance = $item_ent->credit_local + $total_amount; } else { //more debit and the acc origin is credit, balance will be - $new_acc_balance = $total_amount - $item_ent->debit_local; } } else { if ($item_ent->debit_local > 0) { //more debit and the acc origin is debit, balance will be + $new_acc_balance = $item_ent->debit_local + $total_amount; } else { //more credit and the acc origin is debit, balance will be - $new_acc_balance = $total_amount - $item_ent->credit_local; } } @endphp

{{ $new_acc_balance }} {{ $system_currency->code }} @php $total_amount = $new_acc_balance; @endphp

{{ __('basic.total') }} {{ $total_debit }} {{ $total_credit }} {{ $total_amount }}
@endforeach
{{ $accounts->appends(request()->input())->links() }}
@endsection @section('js') {{-- data table --}} @endsection