mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-11 18:51:31 +00:00
resolved conflicts
This commit is contained in:
@@ -0,0 +1,375 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet" type="text/css"/>
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('payroll.payroll_schedules') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('payroll.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('payroll.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('payroll.payroll_schedules') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('payroll::payroll.menu')
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
{{ Form::open(['route' => 'payroll_schedules.create']) }}
|
||||
|
||||
<h3>{{ __('payroll.filter_by_category') }}</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
{{ Form::label('payroll_category',__('payroll.payroll_category')) }}
|
||||
{{ Form::select('payroll_category',$payroll_categories,'',['class' => 'form-control compulsory','required']) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
<div class="form-group" style="margin-top: 25px;">
|
||||
{{ Form::submit(__('investigations.search'), ['class'=>'btn btn-success']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ Form::close() }}
|
||||
|
||||
@if(count($employees) > 0)
|
||||
<hr>
|
||||
|
||||
<h3>{{ __('payroll.payroll_schedule_details') }}</h3>
|
||||
|
||||
{{ Form::open(['route' => 'payroll_schedules.save_schedule', 'data-toggle' => 'validator']) }}
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('name', __('payroll.payroll_schedule_name')) }}
|
||||
{{ Form::text('name','',['class' => 'form-control compulsory', 'required']) }}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{{ Form::label('pay_year',__('payroll.payment_year')) }}
|
||||
{{ Form::select('pay_year',$years,'',['class' => 'form-control compulsory','required']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('salaries_expense_account',__('payroll.salaries_expenses_account')) }}
|
||||
{{ Form::select('salaries_expense_account',$expense_accounts,'',['class' => 'form-control compulsory','required']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('salaries_payable_account',__('payroll.salaries_payable_account')) }}
|
||||
{{ Form::select('salaries_payable_account',$payable_accounts,'',['class' => 'form-control compulsory','required']) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{{ Form::label('pay_month',__('payroll.payment_month')) }}
|
||||
{{ Form::select('pay_month',$months,'',['class' => 'form-control compulsory','required']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('tax_expense_account',__('payroll.tax_expense_account')) }}
|
||||
{{ Form::select('tax_expense_account',$expense_accounts,'',['class' => 'form-control compulsory','required']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('tax_payable_account',__('payroll.tax_payable_account')) }}
|
||||
{{ Form::select('tax_payable_account',$payable_accounts,'',['class' => 'form-control compulsory','required']) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
{{ Form::label('due_date', __('payroll.due_date')) }}
|
||||
{{ Form::text('due_date','',['class' => 'form-control compulsory', 'readonly', 'required', 'id'=>'due_date']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('social_security_expense_account',__('payroll.social_security_expense_account')) }}
|
||||
{{ Form::select('social_security_expense_account',$expense_accounts,'',['class' => 'form-control compulsory','required']) }}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('social_security_payable_account',__('payroll.social_security_payable_account')) }}
|
||||
{{ Form::select('social_security_payable_account',$payable_accounts,'',['class' => 'form-control compulsory','required']) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
{{ Form::label('memo', __('payroll.memo')) }}
|
||||
<textarea name="memo" placeholder="Memo" class="form-control compulsory" required rows="5"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>{{ __('payroll.employee_name') }}</th>
|
||||
<th>{{ __('payroll.payroll_category') }}</th>
|
||||
<th>{{ __('payroll.basic_pay') }}</th>
|
||||
<th>{{ __('payroll.allowances') }}</th>
|
||||
<th>{{ __('payroll.gross_pay') }}</th>
|
||||
<th>{{ __('payroll.tax_amount') }}</th>
|
||||
<th>{{ __('payroll.social_security_amount') }}</th>
|
||||
<th>{{ __('payroll.deductions') }}</th>
|
||||
<th>{{ __('payroll.total_deductions') }}</th>
|
||||
<th>{{ __('payroll.net_pay') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($employees as $employee)
|
||||
<tr id="row_{{ $employee->id }}" class="to_remove">
|
||||
<td>
|
||||
<input type="checkbox" id="chk" class="employee_check" value="{{ $employee->id }}" />
|
||||
{{ Form::hidden('employee_id[]', $employee->id) }}
|
||||
</td>
|
||||
<td>{{ $employee->first_name . ' ' . $employee->last_name }} ({{ $employee->number }})</td>
|
||||
<td>{{ $payroll_categories[$employee->payroll_category] }}</td>
|
||||
{{ Form::hidden('payroll_category[]', $employee->payroll_category) }}
|
||||
@php
|
||||
$deductions = 0;
|
||||
$allowances = 0;
|
||||
$deductions_arr = [];
|
||||
$allowances_arr = [];
|
||||
|
||||
$allow_deducts = \Illuminate\Support\Facades\DB::table('payroll_allowances_or_deductions')->where('billed', 0)->where('member_id', $employee->id)->whereNull('deleted_at')->get();
|
||||
|
||||
foreach ($allow_deducts as $allow_deduct) {
|
||||
if ($allow_deduct->type == 0) {
|
||||
$allowances += $allow_deduct->amount;
|
||||
$allowances_arr[] = $allow_deduct->id;
|
||||
} else {
|
||||
$deductions += $allow_deduct->amount;
|
||||
$deductions_arr[] = $allow_deduct->id;
|
||||
}
|
||||
}
|
||||
|
||||
$gross_pay = $employee->basic_pay + $allowances;
|
||||
$total_deductions = $employee->tax_amount + $employee->social_security_amount + $deductions;
|
||||
@endphp
|
||||
{{ Form::hidden('allowances_arr[]', implode(',', $allowances_arr), ['id' => 'allowances_arr_' . $employee->id]) }}
|
||||
{{ Form::hidden('deductions_arr[]', implode(',', $deductions_arr), ['id' => 'deductions_arr_' . $employee->id]) }}
|
||||
|
||||
<td>{{ Form::number('basic_pay[]', $employee->basic_pay, ['class' => 'form-control compulsory basic_pay_field', 'required', 'id' => 'basic_pay_' . $employee->id]) }}</td>
|
||||
<td>
|
||||
{{ Form::number('allowance[]', $allowances, ['class' => 'form-control compulsory allowance_field', 'readonly', 'required', 'id' => 'allowance_' . $employee->id]) }}
|
||||
|
||||
<a href="#row_{{ $employee->id }}" onclick="view_allowances({{ $employee->id }})">View Allowances</a>
|
||||
</td>
|
||||
<td>{{ Form::number('gross_pay[]', $gross_pay, ['class' => 'form-control compulsory gross_pay_field', 'readonly', 'required', 'id' => 'gross_pay_' . $employee->id]) }}</td>
|
||||
<td>{{ Form::number('tax[]', $employee->tax_amount, ['class' => 'form-control compulsory tax_field', 'required', 'id' => 'tax_' . $employee->id]) }}</td>
|
||||
<td>{{ Form::number('social_security[]', $employee->social_security_amount, ['class' => 'form-control compulsory social_security_field', 'required', 'id' => 'social_security_' . $employee->id]) }}</td>
|
||||
<td>
|
||||
{{ Form::number('deductions[]', $deductions, ['class' => 'form-control compulsory deductions_field', 'readonly', 'required', 'id' => 'deductions_' . $employee->id]) }}
|
||||
|
||||
<a href="#row_{{ $employee->id }}" onclick="view_deductions({{ $employee->id }})">View Deductions</a>
|
||||
</td>
|
||||
<td>{{ Form::number('total_deductions[]', $total_deductions, ['class' => 'form-control compulsory total_deductions_field', 'readonly', 'required', 'id' => 'total_deductions_' . $employee->id]) }}</td>
|
||||
<td>{{ Form::number('net_pay[]', ($gross_pay - $total_deductions), ['class' => 'form-control compulsory net_pay_field', 'readonly', 'required', 'id' => 'net_pay_' . $employee->id]) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
<td><b>TOTALS</b></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td id="basic_pay_total"></td>
|
||||
<td id="allowance_total"></td>
|
||||
<td id="gross_pay_total"></td>
|
||||
<td id="tax_total"></td>
|
||||
<td id="social_security_total"></td>
|
||||
<td id="deductions_total"></td>
|
||||
<td id="total_deductions_total"></td>
|
||||
<td id="net_pay_total"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<input type="button" id="confirm_selection_btn" class="btn btn-success btn-rounded pull-right" value="{{ __('payroll.confirm_selection') }}" />
|
||||
<button class="btn btn-success btn-rounded pull-right" style="display: none;" id="submit_selection_btn">{{ __('payroll.submit') }}</button>
|
||||
|
||||
<br><br>
|
||||
|
||||
{{ Form::close() }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="modal" id="modal_allowance_details" tabindex="-1" role="dialog" aria-labelledby="debt_plan_modal_label" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">Allowance/Deduction Details</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('payroll.type') }}</th>
|
||||
<th>{{ __('payroll.amount') }}</th>
|
||||
<th>{{ __('payroll.is_recurring') }}</th>
|
||||
<th>{{ __('payroll.recurring_final_date') }}</th>
|
||||
<th>{{ __('payroll.reason') }}</th>
|
||||
<th>{{ __('payroll.created_by') }}</th>
|
||||
<th>{{ __('payroll.created_on') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="allowance_deductions_details_body"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function (){
|
||||
calculate_totals();
|
||||
});
|
||||
|
||||
function view_allowances(id) {
|
||||
let ids = $('#allowances_arr_' + id).val();
|
||||
|
||||
if (ids !== '') {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/payroll_schedules/get_allowance_deductions_details",
|
||||
data: {'ids':ids},
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
$('#allowance_deductions_details_body').html(result);
|
||||
$('#modal_allowance_details').modal('show')
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert('No allowances available');
|
||||
}
|
||||
}
|
||||
|
||||
function view_deductions(id) {
|
||||
let ids = $('#deductions_arr_' + id).val();
|
||||
|
||||
if (ids !== '') {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/payroll_schedules/get_allowance_deductions_details",
|
||||
data: {'ids':ids},
|
||||
cache: false,
|
||||
success: function (result) {
|
||||
$('#allowance_deductions_details_body').html(result);
|
||||
$('#modal_allowance_details').modal('show')
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert('No allowances available');
|
||||
}
|
||||
}
|
||||
|
||||
function calculate_totals() {
|
||||
let basic_pay_total = 0;
|
||||
let allowance_total = 0;
|
||||
let gross_pay_total = 0;
|
||||
let tax_total = 0;
|
||||
let social_security_total = 0;
|
||||
let deductions_total = 0;
|
||||
let total_deductions_total = 0;
|
||||
let net_pay_total = 0;
|
||||
|
||||
$(".basic_pay_field").each(function(){
|
||||
basic_pay_total += +$(this).val();
|
||||
});
|
||||
|
||||
$(".allowance_field").each(function(){
|
||||
allowance_total += +$(this).val();
|
||||
});
|
||||
|
||||
$(".gross_pay_field").each(function(){
|
||||
gross_pay_total += +$(this).val();
|
||||
});
|
||||
|
||||
$(".tax_field").each(function(){
|
||||
tax_total += +$(this).val();
|
||||
});
|
||||
|
||||
$(".social_security_field").each(function(){
|
||||
social_security_total += +$(this).val();
|
||||
});
|
||||
|
||||
$(".deductions_field").each(function(){
|
||||
deductions_total += +$(this).val();
|
||||
});
|
||||
|
||||
$(".total_deductions_field").each(function(){
|
||||
total_deductions_total += +$(this).val();
|
||||
});
|
||||
|
||||
$(".net_pay_field").each(function(){
|
||||
net_pay_total += +$(this).val();
|
||||
});
|
||||
|
||||
$('#basic_pay_total').text(numberWithCommas(basic_pay_total));
|
||||
$('#allowance_total').text(numberWithCommas(allowance_total));
|
||||
$('#gross_pay_total').text(numberWithCommas(gross_pay_total));
|
||||
$('#tax_total').text(numberWithCommas(tax_total));
|
||||
$('#social_security_total').text(numberWithCommas(social_security_total));
|
||||
$('#deductions_total').text(numberWithCommas(deductions_total));
|
||||
$('#total_deductions_total').text(numberWithCommas(total_deductions_total));
|
||||
$('#net_pay_total').text(numberWithCommas(net_pay_total));
|
||||
}
|
||||
|
||||
function numberWithCommas(x) {
|
||||
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
||||
}
|
||||
|
||||
$('#due_date').datepicker({
|
||||
autoclose: true,
|
||||
todayHighlight: true,
|
||||
format: 'dd/mm/yyyy'
|
||||
});
|
||||
|
||||
$('.employee_check').click(function() {
|
||||
if($(this).is(':checked')){
|
||||
$(this).parent().parent().css({'background-color': '#FFFF99'});
|
||||
$('#row_' + $(this).val()).removeClass('to_remove');
|
||||
} else{
|
||||
$(this).parent().parent().css({'background-color': '#fff'});
|
||||
$('#row_' + $(this).val()).addClass('to_remove');
|
||||
}
|
||||
});
|
||||
|
||||
$("#confirm_selection_btn").click(function (e) {
|
||||
let is_employee_selected = $('input:checkbox').is(':checked');
|
||||
|
||||
if (is_employee_selected) {
|
||||
$(".to_remove").remove();
|
||||
$(".employee_check").attr("disabled", "disabled");
|
||||
|
||||
$('#submit_selection_btn').show();
|
||||
$('#confirm_selection_btn').hide();
|
||||
calculate_totals();
|
||||
} else {
|
||||
e.preventDefault();
|
||||
alert("Please select an employee before continuing");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,160 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('payroll.payroll_schedules') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('payroll.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('payroll.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('payroll.payroll_schedules') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('payroll::payroll.menu')
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
<a class="btn btn-success btn-sm pull-right" target="_blank" href="/payroll_schedules/print_details/{{ $schedule->id }}">Print</a>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered">
|
||||
<tr>
|
||||
<th><b>{{ __('payroll.payroll_schedule_name') }}</b></th>
|
||||
<td>{{ $schedule->name }}</td>
|
||||
<th><b>{{ __('payroll.created_by') }}</b></th>
|
||||
<td>{{ get_full_name($schedule->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
<th><b>{{ __('payroll.created_at') }}</b></th>
|
||||
<td>{{ streamline_date_time($schedule->created_at) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('payroll.payment_year') }}</b></th>
|
||||
<td>{{ $schedule->pay_year }}</td>
|
||||
<th><b>{{ __('payroll.payment_month') }}</b></th>
|
||||
<td>{{ $schedule->pay_month }}</td>
|
||||
<th><b>{{ __('payroll.due_date') }}</b></th>
|
||||
<td>{{ streamline_date($schedule->due_date) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('payroll.salaries_expenses_account') }}</b></th>
|
||||
<td>{{ $expense_accounts[$schedule->salaries_expense_account] }}</td>
|
||||
<th><b>{{ __('payroll.tax_expense_account') }}</b></th>
|
||||
<td>{{ $expense_accounts[$schedule->tax_expense_account] }}</td>
|
||||
<th><b>{{ __('payroll.social_security_expense_account') }}</b></th>
|
||||
<td>{{ $expense_accounts[$schedule->social_security_expense_account] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('payroll.salaries_payable_account') }}</b></th>
|
||||
<td>{{ $payable_accounts[$schedule->salaries_payable_account] }}</td>
|
||||
<th><b>{{ __('payroll.tax_payable_account') }}</b></th>
|
||||
<td>{{ $payable_accounts[$schedule->tax_payable_account] }}</td>
|
||||
<th><b>{{ __('payroll.social_security_payable_account') }}</b></th>
|
||||
<td>{{ $payable_accounts[$schedule->social_security_payable_account] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('payroll.memo') }}</b></th>
|
||||
<td colspan="5">{{ $schedule->memo }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('payroll.employee_name') }}</th>
|
||||
<th>{{ __('payroll.payroll_category') }}</th>
|
||||
<th>{{ __('payroll.basic_pay') }}</th>
|
||||
<th>{{ __('payroll.allowances') }}</th>
|
||||
<th>{{ __('payroll.gross_pay') }}</th>
|
||||
<th>{{ __('payroll.tax_amount') }}</th>
|
||||
<th>{{ __('payroll.social_security_amount') }}</th>
|
||||
<th>{{ __('payroll.deductions') }}</th>
|
||||
<th>{{ __('payroll.total_deductions') }}</th>
|
||||
<th>{{ __('payroll.net_pay') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@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
|
||||
<tr>
|
||||
<td>{{ $patient->first_name . ' ' . $patient->last_name }} ({{ $patient->number }})</td>
|
||||
<td>{{ $payroll_categories[$employee->payroll_category] }}</td>
|
||||
{{ Form::hidden('payroll_category[]', $employee->payroll_category) }}
|
||||
|
||||
<td>{{ ugandan_shillings($basic_pay_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($allowances_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($gross_pay_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($tax_amount_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($social_security_amount_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($deductions_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($total_deductions_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($net_pay_arr[$i]) }}</td>
|
||||
</tr>
|
||||
@endfor
|
||||
|
||||
<tr>
|
||||
<td><b>TOTALS</b></td>
|
||||
<td></td>
|
||||
<td>{{ ugandan_shillings($basic_pay_total) }}</td>
|
||||
<td>{{ ugandan_shillings($allowances_total) }}</td>
|
||||
<td>{{ ugandan_shillings($gross_pay_total) }}</td>
|
||||
<td>{{ ugandan_shillings($tax_amount_total) }}</td>
|
||||
<td>{{ ugandan_shillings($social_security_amount_total) }}</td>
|
||||
<td>{{ ugandan_shillings($deductions_total) }}</td>
|
||||
<td>{{ ugandan_shillings($total_deductions_total) }}</td>
|
||||
<td>{{ ugandan_shillings($net_pay_total) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
@endpush
|
||||
@@ -0,0 +1,88 @@
|
||||
@extends('layouts.main')
|
||||
|
||||
@push('styles')
|
||||
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="row bg-title">
|
||||
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
|
||||
<h4 class="page-title">{{ __('payroll.payroll_schedules') }}</h4>
|
||||
</div>
|
||||
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
|
||||
<ol class="breadcrumb">
|
||||
<li><a href="{{ route('home') }}"><i class="fa fa-home"></i> {{ __('payroll.home') }}</a></li>
|
||||
<li><a href="{{ route('finance') }}"><i class="fa fa-money"></i> {{ __('payroll.finance_home') }}</a></li>
|
||||
<li class="active"><i class="fa fa-eye"></i> {{ __('payroll.payroll_schedules') }}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('payroll::payroll.menu')
|
||||
|
||||
<div class="white-box">
|
||||
@include('flash::message')
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table color-bordered-table success-bordered-table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('payroll.payroll_schedule_name') }}</th>
|
||||
<th>{{ __('payroll.pay_period') }}</th>
|
||||
<th>{{ __('payroll.total_net_pay') }}</th>
|
||||
<th>{{ __('payroll.due_date') }}</th>
|
||||
<th>{{ __('payroll.payment_date') }}</th>
|
||||
<th>{{ __('payroll.created_at') }}</th>
|
||||
<th>{{ __('payroll.created_by') }}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php $totals = 0; @endphp
|
||||
@foreach($schedules as $schedule)
|
||||
<tr>
|
||||
<td>{{ $schedule->name }}</td>
|
||||
<td>{{ $schedule->pay_month }} {{ $schedule->pay_year }}</td>
|
||||
@php
|
||||
$total_net_pay = array_sum(explode(",", $schedule->net_pay));
|
||||
$totals += $total_net_pay;
|
||||
@endphp
|
||||
<td>{{ ugandan_shillings($total_net_pay) }}</td>
|
||||
<td>{{ streamline_date($schedule->due_date) }}</td>
|
||||
<td>{{ $schedule->payment_date ? streamline_date($schedule->payment_date) : 'Not Paid' }}</td>
|
||||
<td>{{ get_full_name($schedule->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
<td>{{ streamline_date_time($schedule->created_at) }}</td>
|
||||
<td><a href="/payroll_schedules/details/{{ $schedule->id }}" class="btn btn-sm btn-success">Details</a></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<h4>{{ __('payroll.total_net_pay') }}: {{ ugandan_shillings($totals) }}</h4>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
|
||||
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
|
||||
|
||||
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
|
||||
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
|
||||
|
||||
<script>
|
||||
$('.table').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
pageLength: 100,
|
||||
buttons: ['copy', 'csv', 'pdf', 'print']
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
+165
@@ -0,0 +1,165 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ app()->getLocale() }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ asset('uploads/streamline/color/streamline_icon-02.png') }}">
|
||||
<title>{{ config('app.name', 'Stre@mline') }}</title>
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="{{ asset('bootstrap/css/bootstrap.min.css') }}" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body{
|
||||
/*font-size: 1.2em;*/
|
||||
}
|
||||
|
||||
thead {
|
||||
/*display: table-header-group;*/
|
||||
}
|
||||
|
||||
tfoot {
|
||||
/*display: table-row-group;*/
|
||||
}
|
||||
|
||||
tr {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
@include('layouts.header_pdf_print')
|
||||
|
||||
<table class="table table-sm">
|
||||
<tr>
|
||||
<th><b>{{ __('payroll.payroll_schedule_name') }}</b></th>
|
||||
<td>{{ $schedule->name }}</td>
|
||||
<th><b>{{ __('payroll.created_by') }}</b></th>
|
||||
<td>{{ get_full_name($schedule->created_by, 'id', 'first_name', 'last_name', 'users') }}</td>
|
||||
<th><b>{{ __('payroll.created_at') }}</b></th>
|
||||
<td>{{ streamline_date_time($schedule->created_at) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('payroll.payment_year') }}</b></th>
|
||||
<td>{{ $schedule->pay_year }}</td>
|
||||
<th><b>{{ __('payroll.payment_month') }}</b></th>
|
||||
<td>{{ $schedule->pay_month }}</td>
|
||||
<th><b>{{ __('payroll.due_date') }}</b></th>
|
||||
<td>{{ streamline_date($schedule->due_date) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('payroll.salaries_expenses_account') }}</b></th>
|
||||
<td>{{ $expense_accounts[$schedule->salaries_expense_account] }}</td>
|
||||
<th><b>{{ __('payroll.tax_expense_account') }}</b></th>
|
||||
<td>{{ $expense_accounts[$schedule->tax_expense_account] }}</td>
|
||||
<th><b>{{ __('payroll.social_security_expense_account') }}</b></th>
|
||||
<td>{{ $expense_accounts[$schedule->social_security_expense_account] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('payroll.salaries_payable_account') }}</b></th>
|
||||
<td>{{ $payable_accounts[$schedule->salaries_payable_account] }}</td>
|
||||
<th><b>{{ __('payroll.tax_payable_account') }}</b></th>
|
||||
<td>{{ $payable_accounts[$schedule->tax_payable_account] }}</td>
|
||||
<th><b>{{ __('payroll.social_security_payable_account') }}</b></th>
|
||||
<td>{{ $payable_accounts[$schedule->social_security_payable_account] }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><b>{{ __('payroll.memo') }}</b></th>
|
||||
<td colspan="5">{{ $schedule->memo }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('payroll.employee_name') }}</th>
|
||||
<th>{{ __('payroll.payroll_category') }}</th>
|
||||
<th>{{ __('payroll.basic_pay') }}</th>
|
||||
<th>{{ __('payroll.allowances') }}</th>
|
||||
<th>{{ __('payroll.gross_pay') }}</th>
|
||||
<th>{{ __('payroll.tax_amount') }}</th>
|
||||
<th>{{ __('payroll.social_security_amount') }}</th>
|
||||
<th>{{ __('payroll.deductions') }}</th>
|
||||
<th>{{ __('payroll.total_deductions') }}</th>
|
||||
<th>{{ __('payroll.net_pay') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@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
|
||||
<tr>
|
||||
<td>{{ $patient->first_name . ' ' . $patient->last_name }} ({{ $patient->number }})</td>
|
||||
<td>{{ $payroll_categories[$employee->payroll_category] }}</td>
|
||||
{{ Form::hidden('payroll_category[]', $employee->payroll_category) }}
|
||||
|
||||
<td>{{ ugandan_shillings($basic_pay_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($allowances_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($gross_pay_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($tax_amount_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($social_security_amount_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($deductions_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($total_deductions_arr[$i]) }}</td>
|
||||
<td>{{ ugandan_shillings($net_pay_arr[$i]) }}</td>
|
||||
</tr>
|
||||
@endfor
|
||||
|
||||
<tr>
|
||||
<td><b>TOTALS</b></td>
|
||||
<td></td>
|
||||
<td>{{ ugandan_shillings($basic_pay_total) }}</td>
|
||||
<td>{{ ugandan_shillings($allowances_total) }}</td>
|
||||
<td>{{ ugandan_shillings($gross_pay_total) }}</td>
|
||||
<td>{{ ugandan_shillings($tax_amount_total) }}</td>
|
||||
<td>{{ ugandan_shillings($social_security_amount_total) }}</td>
|
||||
<td>{{ ugandan_shillings($deductions_total) }}</td>
|
||||
<td>{{ ugandan_shillings($total_deductions_total) }}</td>
|
||||
<td>{{ ugandan_shillings($net_pay_total) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user