GENERAL PAYROLL
SALARY DEFERENTIAL
Salary Adjustment

WE ACKNOWLEDGE THE RECEIPT OF THE SUMS SHOWN OPPOSITE AS FULL COMPENSATION FOR OUR SERVICES RENDERED FOR THE PERIOD : @foreach ($listArray as $key=>$Function) @php echo (date('M-d-Y',strtotime($Function[0][0]['effective_date']))); echo " - ". (date('M-d-Y',strtotime($Function[0][0]['nosi_approve_date']))); break; @endphp @endforeach
@foreach ($listArray as $key=>$byFunction) @foreach($byFunction as $page => $datalist) @php $count_looks = count($datalist); @endphp @foreach($datalist as $key => $data) @php $cnt_data++; \App\Models\Payroll\PersonnelDeferential::query()->where('id', '=', $data['id'])->update(['index' => $cnt_data]); $testcnt++; $monthly =[]; $total = 0.00; $first = \Carbon\Carbon::parse($data['effective_date'].'12:00:00'); //$last = \Carbon\Carbon::parse(\Carbon\Carbon::now()->format('Y-m-d').'12:00:00'); $last = \Carbon\Carbon::parse($data['nosi_approve_date'].'12:00:00'); $last = $last->subMonth(); $last = $last->endOfMonth(); $firstyear = $first->year; $ctn = 0; $level = 0; if(date('d',strtotime($first)) > 1){ $lastday = new DateTime($first); $lastday->modify('last day of this month'); $monthly[$ctn] = [date('M d',strtotime( $first->format('Y-m-d'))).' -'.date('d, Y',strtotime( $lastday->format('Y-m-d'))),$first->diffInDays($lastday),1]; $ctn++; $level++; } while ($firstyear < $last->year) { if($level == 0){ $month = date('Y-m',strtotime($first)); $lastdate = \Carbon\Carbon::parse($firstyear.'-12-31'); $test = \Carbon\Carbon::parse($first); }else { $month = date('Y-m',strtotime(' +1 months '. $first)); $lastdate = \Carbon\Carbon::parse($firstyear.'-12-01'); $test = \Carbon\Carbon::parse($first); $level = 0; } if(date('d',strtotime($first)) > 1 && date('m',strtotime($first)) != 12){ $monthly[$ctn] = [((date('m',strtotime($month)) == 12)?'Dec':date('M',strtotime($month)).'- Dec').' 1-31, '.date('Y',strtotime($first)),31,$lastdate->diffInMonths($test) + 1]; } $ctn++; $firstyear++; $first = $firstyear.'-01-01'; } $last = \Carbon\Carbon::parse($last); $test0 = \Carbon\Carbon::parse($first); $monthly[$ctn] = [((date('M',strtotime($first)) == date('M',strtotime( $last->format('Y-m'))))? '':date('M',strtotime($first)).'-').date('M',strtotime( $last->format('Y-m'))).' 1-'.date('d, Y',strtotime( $last->format('Y-m-d'))),31,$last->diffInMonths($test0) + 1]; $diff = $data['new_rate'] - $data['old_rate']; $casualTotalDays = \App\Models\Payroll\CasualDefaultNumberDays::where(function($query) use ($data) { $query->where('year', \Carbon\Carbon::create($data['effective_date'])->format('Y'))->where('month', '>=', \Carbon\Carbon::create($data['effective_date'])->format('m')); }) ->orWhere(function($query) use ($data) { $query->where('year', \Carbon\Carbon::now()->format('Y'))->where('month', '<=', \Carbon\Carbon::now()->format('m')); }) ->sum('numberOfDays'); @endphp @foreach($monthly as $value) @php $deduct = new \App\Models\Payroll\Deduction(); $deduction = \App\Models\Payroll\PersonnelDeduction::query()->where('personnel_id', '=', $data['p_id'])->where('active', '=', 1)->where('deduction_id', '=', 26)->first(); $gross = ($diff/31)*$value[1]*$value[2]; $deduction_LRP = $gross * $deduct::DEFAULT_VALUE['LRP']; $LSUFA = $gross * $deduct::DEFAULT_VALUE['LSUFA']; if ($tenure == 1 || $tenure === '1') { $gross = ($diff * $casualTotalDays); $casualTotalGrossPerMonth = (round($data['new_rate'] * 22)*$value[2]) - (round($data['old_rate'] * 22)*$value[2]); $deduction_LRP = $casualTotalGrossPerMonth * $deduct::DEFAULT_VALUE['LRP']; $LSUFA = $casualTotalGrossPerMonth * $deduct::DEFAULT_VALUE['LSUFA']; } if ($deduction) { $deduction_LSUFA = $LSUFA; } else { $deduction_LSUFA = 0; } $deduction = ($deduction_LRP + $deduction_LSUFA); $recieve = $gross - $deduction; $total += $recieve; $grandtotal_deduciton += $deduction; $deductiontotalLRP += $deduction_LRP; $deductiontotalLSUFA += $deduction_LSUFA; $grosstotal +=$gross; @endphp @endforeach @php $grandtotal +=$total; @endphp @endforeach
# NAME/DESIGNATION POSITION/
RANK
MONTH(s) NEW
RATE
OLD
RATE
TOTAL
DIFF'L
GROSS
AMOUNT
LRP-BKPR LSU-FA WTAX TOTAL
Deduction
Net Amount
Received
Signature Remarks
Function: {{$datalist[0]['desc']}} - {{$datalist[0]['code']}}
{{ $cnt_data }} {{ $data['fullname'] }} {{ $data['position_name'] }}
{{ $value[0] }} {{number_format((float)$data['new_rate'] , 2, '.', ',') }} {{number_format((float)$data['old_rate'] , 2, '.', ',') }} {{number_format((float)$diff , 2, '.', ',') }}{{number_format((float)$gross, 2, '.', ',')}} {{number_format((float)$deduction_LRP, 2, '.', ',')}} {{ $deduction_LSUFA > 0 ? number_format((float)$deduction_LSUFA, 2, '.', ',') : ''}} {{number_format((float)$deduction, 2, '.', ',')}} {{number_format((float)$recieve, 2, '.', ',')}} {{ $cnt_data }}.
TOTAL {{ number_format((float)$grosstotal, 2, '.', ',') }} {{ number_format((float)$deductiontotalLRP, 2, '.', ',') }} {{ number_format((float)$deductiontotalLSUFA, 2, '.', ',') }} {{ number_format((float)$grandtotal_deduciton, 2, '.', ',') }} {{ number_format((float)$grandtotal, 2, '.', ',') }}
@endforeach @php // Reset counters $testcnt = 0; $grosstotal = 0; $deductiontotalLRP = 0; $deductiontotalLSUFA = 0; $grandtotal_deduciton = 0; $grandtotal = 0; @endphp @endforeach
CERTIFIED: Services have been duly rendered as stated: APPROVED FOR PAYMENT:
{{ strtoupper($signaturies[2]['fullname']) }}
{{ $signaturies[2]['label'] }}
{{ strtoupper($signaturies[3]['fullname']) }}
{{ $signaturies[3]['label'] }}
CERTIFIED FUNDS AVAILABLE: CERTIFIED: Each employee above has been paid the amount indicated opposite his/her name.
{{ strtoupper($signaturies[1]['fullname']) }}
{{ $signaturies[1]['label'] }}
{{ strtoupper($signaturies[0]['fullname']) }}
{{ $signaturies[0]['label'] }}
Payroll Deferential Page {PAGENO} of {nbpg}