| {{ ucfirst($day) }} | @endforeachTotal | ||||||
|---|---|---|---|---|---|---|---|
|
{{ $d->copy()->addWeeks($i)->addDays($key)->format('M d') }}
{{ $clock_time['total_time'] }}
@if( in_array($k, $staff->shifts) )
{{ 'System generated' }}
@endif
|
@else
{{ $d->copy()->addWeeks($i)->addDays($key)->format('M d') }}
{{ 'Inaccurate' }}
@if( in_array($k, $staff->shifts) )
{{ 'System generated' }}
@endif
|
@endif
@php
$rowTotal += $clock_time['time'];
/*
// Daily OT
$rowTotal += $clock_time['time'];
$regular_hours = $working_hours * 60 * 60;
if( $clock_time['time'] > $regular_hours ) {
$otRowTotal += $clock_time['time'] - $regular_hours; // Add OT
}
*/
@endphp
@else
{{ $d->copy()->addWeeks($i)->addDays($key)->format('M d') }}
{{ '0h 0m' }}
@if( in_array($k, $staff->shifts) )
{{ 'System generated' }}
@endif
|
@endif
@endforeach
@php $partsWeNeed = ( $rowTotal / 3600 ) > 1 ? 2 : 1; @endphp
@php
$hours = floor($rowTotal / 3600);
$mins = floor($rowTotal / 60 % 60);
echo timeDiffInHoursAndMins($hours, $mins);
@endphp
{{--
$rowTotal > 60
? \Carbon\CarbonInterval::seconds($rowTotal)->cascade()
->forHumans(['short' => true, 'join' => true, 'parts' => $partsWeNeed ])
: 0
--}}
@if( false && $otRowTotal > 60 ) {{ '(OT:' }} @php /* // Daily OT $hours = floor($otRowTotal / 3600); $mins = floor($otRowTotal / 60 % 60); echo timeDiffInHoursAndMins($hours, $mins); */ @endphp {{ ')' }} @endif @if( $rowTotal > 60 ) {{ '(OT:' }} @php $regular_hours = $weekly_hours * 60 * 60; if( $rowTotal > $regular_hours ) { $otRowTotal += $rowTotal - $regular_hours; // Add OT } $hours = floor($otRowTotal / 3600); $mins = floor($otRowTotal / 60 % 60); echo timeDiffInHoursAndMins($hours, $mins); @endphp {{ ')' }} @endif |
||||
| Bi-Week Hours: @php if ($grandTotal < 3600) { $formattedTime = $grandTotal > 60 ? \Carbon\CarbonInterval::seconds($grandTotal)->cascade()->forHumans(['short' => true, 'join' => true, 'parts' => $partsWeNeed]) : '0s'; // Set to '0s' if less than 60 seconds } else { $hours = floor($grandTotal / 3600); $minutes = floor(($grandTotal % 3600) / 60); $formattedTime = $hours . 'h'; if ($minutes > 0) { $formattedTime .= ' ' . $minutes . 'm'; } } @endphp {{ $formattedTime }} | Bi-Week Tip:${{ number_format(round( $grandTotal * $dollorPerSec, 2 ), 2 ) }} | Bi-Week Pay: @if( isset($staff->payment_type_hourly) && $staff->payment_type_hourly > 0 ) @php $per_hour = $staff->payment_type_hourly; $hours = floor($grandTotal / 3600); $mins = floor($grandTotal / 60 % 60); // Calculate the total amount $total_amount = round($hours * $per_hour + $mins * ($per_hour / 60), 2); // Format the total amount to always have two digits after the decimal point $formatted_amount = number_format($total_amount, 2); echo '$' . $formatted_amount; @endphp @else {{ 'N/A' }} @endif | OT: @if( isset($staff->payment_type_hourly) && $staff->payment_type_hourly > 0 ) @php $per_hour = $staff->payment_type_hourly; $hours = floor($otGrandTotal / 3600); $mins = floor($otGrandTotal / 60 % 60); // Calculate the total amount $total_amount = round($hours * $per_hour + $mins * ($per_hour / 60), 2) * 1.5; // Format the total amount to always have two digits after the decimal point $formatted_amount = number_format($total_amount, 2); echo '$' . $formatted_amount; @endphp @else {{ 'N/A' }} @endif | Grand Total | @php $partsWeNeed = ( $grandTotal / 3600 ) > 1 ? 2 : 1; @endphp {{-- $grandTotal > 60 ? \Carbon\CarbonInterval::seconds($grandTotal)->cascade() ->forHumans(['short' => true, 'join' => true, 'parts' => $partsWeNeed ]) : 0 --}} @if( isset($staff->payment_type_hourly) && $staff->payment_type_hourly > 0 ) @php $per_hour = $staff->payment_type_hourly; $hours = floor($grandTotal / 3600); $mins = floor($grandTotal / 60 % 60); // Calculate the total amount $total_amount = round($hours * $per_hour + $mins * ($per_hour / 60), 2); $total_amount += round( $grandTotal * $dollorPerSec, 2 ); // Add tip amount // Format the total amount to always have two digits after the decimal point $formatted_amount = number_format($total_amount, 2); echo '$' . $formatted_amount; @endphp @else {{ 'N/A' }} @endif | ||