@extends('layouts.master') @section('title', 'Cost Center Reports | Alboosh - Timeless authenticity, born of the desert') @section('title-topbar', __('basic.cost center reports')) @section('css') @endsection @section('content')
{{ __('basic.dashboard') }} | {{ __('basic.cost center reports') }}
{{ __('basic.new income') }} {{ __('basic.new expenses') }} {{ __('basic.print') }} {{ __('basic.search filter') }}
{{ __('basic.cost center reports') }}
{{ $company_name }}
{{ __('basic.from') }} {{ $date_from }} {{ __('basic.to') }} {{ $date_to }}
{{ __('basic.currency') }} {{ $system_currency->name }}
{{ __('basic.invoices') }}
@foreach ($accounts as $item)
{{ $item->name }} {{ $item->code }}
@php $total_debit = 0; $total_credit = 0; $total_amount = 0; @endphp @foreach ($item->cost_center_items as $item_ent) @endforeach
{{ __('basic.transaction') }} {{ __('basic.account') }} {{ __('basic.entry number') }} {{ __('basic.description') }} {{ __('basic.percentage') }} {{ __('basic.debit') }} {{ __('basic.credit') }} {{ __('basic.amount') }}
@php $icon = "fas fa-wallet"; $icon_color = "main-color"; @endphp

{{ $item_ent->date}}

{{ $item_ent->new_id}}

{{ __('basic.worker') . ": " . $item_ent->worker->full_name}}

{{ $item_ent->account->code . " - ". $item_ent->account->name }}
@if($item_ent->entry) {{ $item_ent->entry->new_id }} @else {{ __('basic.not selected') }} @endif {{ $item_ent->description }} {{ $item_ent->percentage }}% @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 }} {{ $system_currency->code }} {{ $total_credit }} {{ $system_currency->code }} {{ $total_amount }} {{ $system_currency->code }}
@endforeach @endsection @section('js') @php $chart_color = ['#323ac8', '#38dfa8','#1a78f1', '#d13c62', '#12c7d9', '#03c2c3', '#5035df', '#17a673', '#2e59d9', '#9aeded', '#f3d56a', '#7c859d', '#a4adc5', '#80142f', '#33d293', '#bed233', '#3958e9', '#10c86f', '#654fb6', '#a44fb6', '#89728e', '#c85110', '#6d769d', '#1b6954', '#204494', '#94206b', '#948320', '#209493', '#292094', '#203a65', '#4e6fa5', '#e29031', '#e23168', '#31e0e2', '#e29131', '#319fe2', '#8131e2', '#31a8e2', '#31e2c0', '#31c3e2', '#e2a931', '#3157e2']; @endphp {{-- data table --}} @endsection