@extends('layouts.main') @push('styles') @endpush @section('content')

{{ __('payroll.payroll_schedules') }}

@include('payroll::payroll.menu')
@include('flash::message') Print
{{ __('payroll.payroll_schedule_name') }} {{ $schedule->name }} {{ __('payroll.created_by') }} {{ get_full_name($schedule->created_by, 'id', 'first_name', 'last_name', 'users') }} {{ __('payroll.created_at') }} {{ streamline_date_time($schedule->created_at) }}
{{ __('payroll.payment_year') }} {{ $schedule->pay_year }} {{ __('payroll.payment_month') }} {{ $schedule->pay_month }} {{ __('payroll.due_date') }} {{ streamline_date($schedule->due_date) }}
{{ __('payroll.salaries_expenses_account') }} {{ $expense_accounts[$schedule->salaries_expense_account] }} {{ __('payroll.tax_expense_account') }} {{ $expense_accounts[$schedule->tax_expense_account] }} {{ __('payroll.social_security_expense_account') }} {{ $expense_accounts[$schedule->social_security_expense_account] }}
{{ __('payroll.salaries_payable_account') }} {{ $payable_accounts[$schedule->salaries_payable_account] }} {{ __('payroll.tax_payable_account') }} {{ $payable_accounts[$schedule->tax_payable_account] }} {{ __('payroll.social_security_payable_account') }} {{ $payable_accounts[$schedule->social_security_payable_account] }}
{{ __('payroll.memo') }} {{ $schedule->memo }}


@php $payroll_category_arr = explode(",", $schedule->payroll_category); $employee_id_arr = explode(",", $schedule->employee_id); $basic_pay_arr = explode(",", $schedule->basic_pay); $allowances_arr = explode(",", $schedule->allowances); $gross_pay_arr = explode(",", $schedule->gross_pay); $tax_amount_arr = explode(",", $schedule->tax_amount); $social_security_amount_arr = explode(",", $schedule->social_security_amount); $deductions_arr = explode(",", $schedule->deductions); $total_deductions_arr = explode(",", $schedule->total_deductions); $net_pay_arr = explode(",", $schedule->net_pay); $basic_pay_total = 0; $allowances_total = 0; $gross_pay_total = 0; $tax_amount_total = 0; $social_security_amount_total = 0; $deductions_total = 0; $total_deductions_total = 0; $net_pay_total = 0; @endphp @for($i = 0; $i < count($employee_id_arr); $i++) @php $employee = \Illuminate\Support\Facades\DB::table('payrolls')->where('id', $employee_id_arr[$i])->first(); $patient = \Illuminate\Support\Facades\DB::table('patients')->where('id', $employee->patient_id)->first(); $basic_pay_total += $basic_pay_arr[$i]; $allowances_total += $allowances_arr[$i]; $gross_pay_total += $gross_pay_arr[$i]; $tax_amount_total += $tax_amount_arr[$i]; $social_security_amount_total += $social_security_amount_arr[$i]; $deductions_total += $deductions_arr[$i]; $total_deductions_total += $total_deductions_arr[$i]; $net_pay_total += $net_pay_arr[$i]; @endphp {{ Form::hidden('payroll_category[]', $employee->payroll_category) }} @endfor
{{ __('payroll.employee_name') }} {{ __('payroll.payroll_category') }} {{ __('payroll.basic_pay') }} {{ __('payroll.allowances') }} {{ __('payroll.gross_pay') }} {{ __('payroll.tax_amount') }} {{ __('payroll.social_security_amount') }} {{ __('payroll.deductions') }} {{ __('payroll.total_deductions') }} {{ __('payroll.net_pay') }}
{{ $patient->first_name . ' ' . $patient->last_name }} ({{ $patient->number }}) {{ $payroll_categories[$employee->payroll_category] }}{{ ugandan_shillings($basic_pay_arr[$i]) }} {{ ugandan_shillings($allowances_arr[$i]) }} {{ ugandan_shillings($gross_pay_arr[$i]) }} {{ ugandan_shillings($tax_amount_arr[$i]) }} {{ ugandan_shillings($social_security_amount_arr[$i]) }} {{ ugandan_shillings($deductions_arr[$i]) }} {{ ugandan_shillings($total_deductions_arr[$i]) }} {{ ugandan_shillings($net_pay_arr[$i]) }}
TOTALS {{ ugandan_shillings($basic_pay_total) }} {{ ugandan_shillings($allowances_total) }} {{ ugandan_shillings($gross_pay_total) }} {{ ugandan_shillings($tax_amount_total) }} {{ ugandan_shillings($social_security_amount_total) }} {{ ugandan_shillings($deductions_total) }} {{ ugandan_shillings($total_deductions_total) }} {{ ugandan_shillings($net_pay_total) }}
@endsection @push('scripts') @endpush