@extends('reports::layouts.master') @use('App\Services\Date') @section('title', __('reports::reports.Sales Summary Report')) @section('page-link') @endsection @section('action_buttons')
@if(LaravelLocalization::getCurrentLocale() === 'en') @else @endif @if(request()->all()) @can('reports.sales-summary.export') @endcan @endif
@endsection @section('section_title') @lang('reports::reports.Sales Summary Report') @endsection @section('form-open-tag')
@lang('Filter')
@php $selectedCostCenters = (array) request('cost_centers', []); // Fallback logic if needed, but sticking to pattern if (empty($selectedCostCenters) && request()->has('cost_center_id')) { $selectedCostCenters = (array) request('cost_center_id'); } $allCostCentersCount = app(\Modules\Products\Repositories\CostCentersRepository::class)->count(); $costCentersCollection = is_array($data['costCenters']) ? collect($data['costCenters']) : $data['costCenters']; $hasAccessToAllCostCenters = auth()->user()->adjustRolesLikeOwnerPermissions() || $costCentersCollection->count() >= $allCostCentersCount; @endphp @error('cost_center_id') @enderror
@error('customer_id') @enderror
@error('fiscal_year_id') @enderror @error('from') @enderror @error('to') @enderror
@endsection @section('extra_styles') @parent @endsection @section('koolreport') @if(request()->all())

@lang('reports::reports.Sales Summary Report')

@lang('reports::reports.company name') :{{ $data['companyName'] }}

@lang('reports::reports.customer name') :{{optional(@$data['customers']->where('id',$data['salesTransactions'])->first()->customer_id)->first()->name ?? $data['customers']->where('id',request('customer_id'))->first()->name}}

@lang('from') {{$data['dates']['from']}} @lang('to') {{$data['dates']['to']}}


@lang('reports::reports.report summary'):

@lang('reports::reports.total sales')

{{ number_format($data['total_sales'],2,".",",") }}

{!! __('settings::currencies.SAR') !!}

@lang('reports::reports.total paid')

{{ number_format($data['paid_sales'],2,".",",") }}

{!! __('settings::currencies.SAR') !!}

@lang('reports::reports.total remaining')

{{ number_format($data['remaining_sales'],2,".",",") }}

{!! __('settings::currencies.SAR') !!}

@lang('reports::reports.total payment')

{{number_format($data['total_payment'],2,".",",")}}

{!! __('settings::currencies.SAR') !!}

@lang('reports::reports.not assigned pay in')

{{ number_format($data['not_assigned_pay_in'],2,".",",") }}

{!! __('settings::currencies.SAR') !!}

@lang('reports::reports.not assigned pay out')

{{ number_format($data['not_assigned_pay_out'],2,".",",") }}

{!! __('settings::currencies.SAR') !!}


@lang('reports::reports.asset_report.Transactions History'):

@if(!count($data['salesTransactions'])) @else @foreach ($data['salesTransactions'] as $transaction) @endforeach @endif
@lang('sales::transactions.Date') @lang('sales::transactions.Reference ID') @lang('sales::transactions.operation type') @lang('sales::transactions.description') @lang('sales::transactions.status') @lang('sales::transactions.gross') @lang('sales::transactions.vat') @lang('sales::transactions.total') @lang('sales::transactions.paid') @lang('sales::transactions.remaining')
{{__('reports::reports.no_data')}}
{{$transaction->date}}{{ Date::format($transaction->date, 'date') }} route_name}.show", ['subdomain' => $subdomain, "{$transaction->routeVariableName}" => $transaction->id])}}">{{$transaction->reference}} {{ $transaction->operationType }} {{ $transaction->description }} {{ $transaction->status ? Modules\Purchases\Enums\BillStatusEnum::toString($transaction->status) : ($transaction->kind ? Modules\Purchases\Enums\PaymentReceiptTypesEnum::toString($transaction->kind) : '') }} {{ number_format(abs((float)$transaction->gross),2,".",",") }} {{ number_format(abs((float)$transaction->total_vat),2,".",",") }} {{ number_format(abs((float)$transaction->total),2,".",",") }} {{ ($transaction->paid_amount < 0 ) ? '(' . number_format(abs($transaction->paid_amount),2,".",",") . ')' : number_format($transaction->paid_amount,2,".",",") }} {{ ($transaction->outstanding < 0 ) ? '(' . number_format(abs($transaction->outstanding),2,".",",") . ')' : number_format($transaction->outstanding,2,".",",") }}

@lang('reports::reports.accrual_basis') {{ Date::now('datetime') }}
@endif @endsection @section('extra_scripts_filter_by_date') @endsection