@extends('backend.master') @section('mainContent') {{generateBreadcrumb()}}

@lang('common.Staff Info')

{{ __('common.Name') }}
@if(isset($staffDetails)) {{@$staffDetails->user->name}} @endif
@if ($staffDetails->user->role_id != 1)
{{ __('common.Employee Id') }}
@if(isset($staffDetails)) {{$staffDetails->employee_id}} @endif
{{ __('common.Opening Balance') }}
@if(isset($staffDetails)) {{single_price($staffDetails->opening_balance)}} @endif
@endif
{{ __('role.Role') }}
@if(isset($staffDetails)) {{@$staffDetails->user->role->name}} @endif
{{ __('department.Department') }}
@if(isset($staffDetails)) {{ !empty($staffDetails->department != null)? $staffDetails->department->name:''}} @endif
@if ($staffDetails->user->role_id != 1)
{{ __('common.Date of Joining') }}
@if(isset($staffDetails)) {{ showDate($staffDetails->date_of_joining) }} @endif
{{ __('common.Employment Type') }}
@if(isset($staffDetails)) {{ $staffDetails->employment_type }} @endif
{{ __('common.Last Date Of Provisional Period') }}
@if(isset($staffDetails)) {{ showDate(\Carbon\Carbon::now()->addMonths($staffDetails->provisional_months)) }} @endif
@endif

{{ __('common.Personal Info') }}

{{ __('common.Phone') }}
@if(isset($staffDetails)) {{$staffDetails->phone}} @endif
{{ __('common.Email') }}
@if(isset($staffDetails)) {{@$staffDetails->user->email}} @endif
@if ($staffDetails->user->role_id != 1)
{{ __('common.Date of Birth') }}
@if(isset($staffDetails)) {{$staffDetails->date_of_birth != ""? date('m/d/Y', strtotime($staffDetails->date_of_birth)):''}} @endif

{{ __('common.Address') }}

{{ __('common.Current Address') }}
@if(isset($staffDetails)) {{$staffDetails->current_address}} @endif
{{ __('common.Permanent Address') }}
@if(isset($staffDetails)) {{$staffDetails->permanent_address}} @endif

{{ __('common.Bank Account Details') }}

{{ __('common.Account Name') }}
@if(isset($staffDetails)) {{$staffDetails->bank_account_name}} @endif
{{ __('common.Bank Account Number') }}
@if(isset($staffDetails)) {{$staffDetails->bank_account_no}} @endif
{{ __('common.Bank Name') }}
@if(isset($staffDetails)) {{$staffDetails->bank_name}} @endif
{{ __('common.Bank Branch Name') }}
@if(isset($staffDetails)) {{$staffDetails->bank_branch_name}} @endif
@endif
@if(isset($staffDetails)) @endif
@isset($staffDocuments) @foreach ($staffDocuments as $key => $staffDocument) @endforeach @endisset
{{__('common.Document Title')}} {{__('common.Action')}}
{{ $staffDocument->name }}
@if(isModuleActive('HumanResource'))
@php $remaining_leave_days = 0; $extra_leave_days = 0; if ($total_leave->sum('total_days') > $leaveDetails->sum('total_days')) { $remaining_leave_days = $total_leave->sum('total_days') - $leaveDetails->sum('total_days'); }else { $extra_leave_days = $apply_leave_histories->sum('total_days') - $leaveDetails->sum('total_days'); } @endphp

{{ __('leave.Total Leave') }}

{{ $total_leave->sum('total_days') }} {{__('leave.Days')}}

{{ __('leave.Remaining') }}

{{ $remaining_leave_days }} {{__('leave.Days')}}

{{ __('leave.Extra Taken') }}

{{ $extra_leave_days }} {{__('leave.Days')}}

@foreach ($leaveDetails as $key => $leaveDetail) @endforeach
{{__('leave.Leave')}} {{__('leave.Type')}} {{__('leave.Leave From')}} {{__('leave.Leave To')}} {{__('leave.Apply Date')}} {{__('common.Status')}} {{__('common.Action')}}
{{ @$leaveDetail->leave_type->name }} {{ showDate($leaveDetail->start_date) }} {{ showDate($leaveDetail->end_date) }} {{ showDate($leaveDetail->apply_date) }} @if ($leaveDetail->status == 0) {{ __('common.Pending') }} @elseif ($leaveDetail->status == 1) {{ __('common.Approved') }} @else {{ __('common.Cancelled') }} @endif
@endif @if(isModuleActive('Account'))
@php $total_return_loan = $loans->sum('paid_loan_amount'); $total_loan = $loans->sum('amount'); $due = $total_loan - $total_return_loan; $total_monthly_installment = $loans->where('paid', 0)->sum('monthly_installment'); @endphp

{{ __('common.Total Loan') }}

{{ single_price($total_loan) }}

{{ __('common.Returned Amount') }}

{{ single_price($total_return_loan) }}

{{ __('common.Due') }}

{{ single_price($due) }}

{{ __('common.Monthly Installment') }}

{{ single_price($total_monthly_installment) }}

@isset($loans) @foreach($loans as $key => $loan) @if ($loan->user != null) @php $due = $loan->amount - $loan->paid_loan_amount; @endphp @endif @endforeach @endisset
{{ __('common.ID') }} {{ __('common.Name') }} {{ __('common.Type') }} {{ __('common.Amount') }} {{ __('common.Monthly Installment') }} {{ __('common.Due') }} {{ __('common.Approval') }} {{ __('common.Status') }} {{ __('common.Action') }}
{{ $key+1 }} {{ $loan->user != null ? $loan->user->name : "Removed" }} {{ $loan->loan_type }} {{ single_price($loan->amount) }} {{ single_price($loan->monthly_installment) }}{{ single_price($due) }} @if ($loan->approval == 0) {{__('common.Pending')}} @elseif ($loan->approval == 1) {{__('common.Approved')}} @else {{__('common.Cancelled')}} @endif @if ($loan->paid == 0) {{__('common.Running')}} @else {{__('common.Complete')}} @endif
@endif @if(isModuleActive('Account'))
@php $chartAccount = Modules\Account\Entities\ChartAccount::where('contactable_type', 'App\User')->where('contactable_id', @$staffDetails->user->id)->first(); if ($chartAccount && $chartAccount->transactions()->exists()) { $transactions = $chartAccount->transactions()->Approved()->get(); } $currentBalance = 0 + $staffDetails->opening_balance; @endphp @isset($transactions) @foreach ($transactions as $key => $payment) @if ($payment->type == "Cr") @php $currentBalance -= $payment->amount; @endphp @else @php $currentBalance += $payment->amount; @endphp @endif @endforeach @endisset
{{ __('account.Date') }} {{ __('account.Description') }} {{ __('account.Debit') }} {{ __('account.Credit') }} {{ __('account.Balance') }}
{{ __('account.Openning Balance') }} {{ single_price($currentBalance) }}
{{ showDate(@$payment->voucherable->date) }} {{ @$payment->voucherable->narration }} @if ($payment->type == "Dr") {{ single_price($payment->amount) }} @endif @if ($payment->type == "Cr") {{ single_price($payment->amount) }} @endif {{ single_price($currentBalance) }}
{{ __('account.Current Balance') }} {{ single_price($currentBalance) }}
@endif
@include('backend.partials.delete_modal') @endsection @push('scripts') @endpush