@extends('crm.layouts.app') @section('title', 'Payroll Calculation') @section('content')

Payroll Calculation

Review and approve payroll for the selected period

Pay Period

{{ $payPeriodStart->format('F j, Y') }} - {{ $payPeriodEnd->format('F j, Y') }}

@if(count($calculations) > 0)
@csrf
@foreach($calculations as $calc)

{{ $calc['artist']->name }}

{{ ucfirst(str_replace('_', ' ', $calc['artist']->payrollSetting->pay_type)) }} - {{ $calc['appointments_count'] }} appointments

${{ number_format($calc['total_payout'], 2) }}
Total Payout
${{ number_format($calc['total_earnings'], 2) }}
Base Earnings
@if($calc['artist']->payrollSetting->pay_type === 'commission') {{ $calc['artist']->payrollSetting->pay_rate }}% commission @elseif($calc['artist']->payrollSetting->pay_type === 'hourly') ${{ $calc['artist']->payrollSetting->pay_rate }}/hour @else ${{ $calc['artist']->payrollSetting->pay_rate }}/appointment @endif
${{ number_format($calc['artist_tip_share'], 2) }}
Tip Share
{{ $calc['artist']->payrollSetting->tip_percentage }}% of ${{ number_format($calc['total_tips'], 2) }}
{{ $calc['appointments_count'] }}
Appointments
Completed in period
@endforeach

Total Payroll

{{ count($calculations) }} artists

${{ number_format(collect($calculations)->sum('total_payout'), 2) }}
Cancel
@else

No Data Found

No completed appointments found for the selected artists in this pay period.

@endif
@endsection