@extends('tenant.settings.general.all-general-settings') @section('breadcrumb') @include('tenant.layouts.breadcrumb', [ 'items' => [ __('breadcrumb.general_settings') => route('tenant.settings.general.show-page', ['type' => 'company-information']), __('breadcrumb.fiscal_years') => '#', ], ]) @endsection @section('sidebar') @include('tenant.layouts.sidebar', ['activeItem' => 'settings.general.fiscal-years']) @endsection @section('style') @endsection @section('settings-content')

@lang('settings/general/fiscal-years.fiscal_years')

{{-- procedures of fiscal years --}} @can('generalSettings-fiscalYears-create') @if (count($years) == 0) @else @if ($create_new_year)
@csrf
@endif @endif @endcan
{{-- create fiscal-year form --}} @can('generalSettings-fiscalYears-create') @if (count($years) == 0) @endif @endcan {{-- fiscal-years with their periods --}}
@forelse ($years as $year) @empty @endforelse
# @lang('settings/general/fiscal-years.from') @lang('settings/general/fiscal-years.to') @lang('settings/general/fiscal-years.periods') @lang('settings/general/fiscal-years.year_status') @lang('settings/general/fiscal-years.active_year')
{{ $loop->iteration }} {{ $year->parseDateToCarbon('from')->format('Y-m-d') }} {{ $year->parseDateToCarbon('to')->format('Y-m-d') }}
@lang('settings/general/fiscal-years.fiscal_year_periods') ( {{ $year->parseDateToCarbon('from')->year }} )
@foreach ($year->periods as $period) @endforeach
@lang('settings/general/fiscal-years.period') @lang('settings/general/fiscal-years.procedures')
@csrf
@can('accounting')
@csrf
@endcan
{{ $period->month }} @if ($period->is_open) @can('accounting') @endcan @else @endif
@csrf
@if ($year->is_open) @can('accounting') @can('generalSettings-fiscalYears-closeYear')
@csrf
@lang('settings/general/fiscal-years.last_minute_goods')
@if (count($branches_items_balances) > 0) @foreach ($branches_items_balances as $branches_items_balance) @php $branchId = $branches_items_balance['branch']->id; $totalCost = $branches_items_balance['balance'] ?? 0; @endphp
@endforeach
@lang('settings/general/fiscal-years.branch') @lang('settings/general/fiscal-years.cost_balance')
{{ $branches_items_balance['branch']->name }}
@else
@endif
@endcan @endcan @else @can('generalSettings-fiscalYears-openYear')
@csrf
@endcan @endif
@if ($active_year == $year->id)

@lang('settings/general/fiscal-years.active')

@endif @can('generalSettings-fiscalYears-activateYear') @if ($active_year != $year->id)
@csrf
@endif @endcan
@lang('settings/general/fiscal-years.there_are_no_fiscal_years_yet')
{{-- un-posted actions layout [when close specifc period] --}} @if (session()->has('unposted_actions'))
@php $unposted = session('unposted_actions'); $only_has_minus_out_batches = isset($unposted['minus_out_batches']) && count($unposted['minus_out_batches']) > 0 && collect($unposted)->filter(function ($items, $key) { return $key !== 'minus_out_batches' && count($items) > 0; })->isEmpty(); @endphp @if ($only_has_minus_out_batches) تسوية المبيعات بالسالب @endif @foreach (session('unposted_actions') as $unposted_group_name => $unposted_actions) @foreach ($unposted_actions as $action) @endforeach @endforeach
# @lang('settings/general/fiscal-years.transaction') @lang('settings/general/fiscal-years.reference')
{{ $loop->parent->iteration }} @switch($unposted_group_name) @case('entries') قيد @break @case('receipts') قبض @break @case('exchanges') صرف @break @case('services_sale_invoices') فاتورة بيع خدمة @break @case('returned_services_bonds') سند مردود خدمة @break @case('debit_notes') إشعار مدين @break @case('credit_notes') إشعار دائن @break @case('entry_bonds') سند إدخال @break @case('out_bonds') سند إخراج @break @case('convert_bonds') سند تحويل @break @case('sales_invoices') فاتورة بيع @break @case('purchase_invoices') فاتورة شراء @break @case('minus_out_batches') فاتورة مبيعات بالسالب غير مكلّفة بشكل كامل @break @endswitch @switch($unposted_group_name) @case('entries') {{ $action->id }} @break @case('receipts') {{ $action->id }} @break @case('exchanges') {{ $action->id }} @break @case('services_sale_invoices') {{ $action->id }} @break @case('returned_services_bonds') {{ $action->id }} @break @case('debit_notes') {{ $action->id }} @break @case('credit_notes') {{ $action->id }} @break @case('entry_bonds') {{ $action->id }} @break @case('out_bonds') {{ $action->id }} @break @case('convert_bonds') {{ $action->id }} @break @case('sales_invoices') {{ $action->id }} @break @case('purchase_invoices') {{ $action->id }} @break @case('minus_out_batches') رقم الفاتورة {{ $action->bond->bond_number }}
@foreach ($action->bond->items as $sales_invoice_item) @if ($sales_invoice_item->minus_transactions->count() > 0) @foreach ($sales_invoice_item->minus_transactions as $minus_transaction) {{ $sales_invoice_item->barcode?->ar_name }} ({{ $minus_transaction->quantity }})
@endforeach @endif @endforeach @break @endswitch
@endif
@endsection @push('script') @endpush