Commit 06d5118a authored by David Mburu's avatar David Mburu

Integrated Commit

parent ee38070a
...@@ -4,11 +4,6 @@ namespace App\Http\Controllers; ...@@ -4,11 +4,6 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use App\Allowance;
use Input;
use Excel;
use PDF;
class PayslipController extends Controller class PayslipController extends Controller
{ {
...@@ -35,15 +30,27 @@ class PayslipController extends Controller ...@@ -35,15 +30,27 @@ class PayslipController extends Controller
return view('Payslip.payslip', compact(['employee', 'payslip'])); return view('Payslip.payslip', compact(['employee', 'payslip']));
} }
public function downloadPDF($id){
$allowance = Allowance::find($id);
$pdf = PDF::loadView('pdf', compact('user'));
return $pdf->download('Payslip.pdf');
} public function view_payslip(Request $request){
$user_id = 2;
$users = DB::table('payslips')
->join('main_users', 'main_users.id', '=', 'payslips.user_id')
->join('departments', 'departments.id', '=', 'main_users.department')
->join('calendar_months', 'calendar_months.numeral', '=', 'payslips.month')
->join('employee_salary_details', 'employee_salary_details.user_id', '=', 'payslips.user_id')
->select(DB::raw('distinct payslips.user_id'), 'payslips.year', 'employee_salary_details.salary', 'main_users.first_name', 'main_users.last_name', 'main_users.employee_id', 'departments.department_name', 'calendar_months.month')
->get();
$user_details = DB::table('payslips')
->where('payslips.user_id', $user_id)
->join('main_users', 'main_users.id', '=', 'payslips.user_id')
->join('employee_salary_details', 'employee_salary_details.user_id', '=', 'payslips.user_id')
->join('departments', 'departments.id', '=', 'main_users.department')
->select('employee_salary_details.salary', 'main_users.first_name', 'main_users.last_name', 'main_users.employee_id', 'departments.department_name', 'payslips.*')
->get();
return view('Payslip.view_payslip', compact(['users', 'user_details']));
}
} }
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
namespace App; namespace App;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable class User extends Authenticatable
......
...@@ -13,7 +13,7 @@ class CreatePasswordResetsTable extends Migration ...@@ -13,7 +13,7 @@ class CreatePasswordResetsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('password_resets', function (Blueprint $table) { Schema::create('main_password_resets', function (Blueprint $table) {
$table->string('email')->index(); $table->string('email')->index();
$table->string('token'); $table->string('token');
$table->timestamp('created_at')->nullable(); $table->timestamp('created_at')->nullable();
...@@ -27,6 +27,6 @@ class CreatePasswordResetsTable extends Migration ...@@ -27,6 +27,6 @@ class CreatePasswordResetsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('password_resets'); Schema::dropIfExists('main_password_resets');
} }
} }
...@@ -19,6 +19,7 @@ class CreateProcessedPayrollTable extends Migration ...@@ -19,6 +19,7 @@ class CreateProcessedPayrollTable extends Migration
$table->unsignedInteger('year'); $table->unsignedInteger('year');
$table->string('business_units'); $table->string('business_units');
$table->string('departments'); $table->string('departments');
$table->tinyInteger('closed')->default(0);
$table->dateTime('created_at'); $table->dateTime('created_at');
}); });
} }
......
...@@ -22,6 +22,8 @@ class CreatePayslipsTable extends Migration ...@@ -22,6 +22,8 @@ class CreatePayslipsTable extends Migration
$table->unsignedInteger('tax_option')->nullable(); $table->unsignedInteger('tax_option')->nullable();
$table->string('item_name'); $table->string('item_name');
$table->float('item_amount'); $table->float('item_amount');
$table->unsignedInteger('paye')->default(0);
$table->unsignedInteger('gross')->default(0);
$table->unsignedInteger('created_by'); $table->unsignedInteger('created_by');
$table->timestamps(); $table->timestamps();
}); });
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
/*!
* Bootstrap-select v1.7.5 (http://silviomoreto.github.io/bootstrap-select)
*
* Copyright 2013-2015 bootstrap-select
* Licensed under MIT (https://github.com/silviomoreto/bootstrap-select/blob/master/LICENSE)
*/.bootstrap-select{width:220px \0}.bootstrap-select>.dropdown-toggle{width:100%;padding-right:25px}.error .bootstrap-select .dropdown-toggle,.has-error .bootstrap-select .dropdown-toggle{border-color:#b94a48}.bootstrap-select.fit-width{width:auto!important}.bootstrap-select:not([class*=col-]):not([class*=form-control]):not(.input-group-btn){width:220px}.bootstrap-select .dropdown-toggle:focus{outline:thin dotted #333!important;outline:5px auto -webkit-focus-ring-color!important;outline-offset:-2px}.bootstrap-select.form-control{margin-bottom:0;padding:0;border:none}.bootstrap-select.form-control:not([class*=col-]){width:100%}.bootstrap-select.form-control.input-group-btn{z-index:auto}.bootstrap-select.btn-group:not(.input-group-btn),.bootstrap-select.btn-group[class*=col-]{float:none;display:inline-block;margin-left:0}.bootstrap-select.btn-group.dropdown-menu-right,.bootstrap-select.btn-group[class*=col-].dropdown-menu-right,.row .bootstrap-select.btn-group[class*=col-].dropdown-menu-right{float:right}.form-group .bootstrap-select.btn-group,.form-horizontal .bootstrap-select.btn-group,.form-inline .bootstrap-select.btn-group{margin-bottom:0}.form-group-lg .bootstrap-select.btn-group.form-control,.form-group-sm .bootstrap-select.btn-group.form-control{padding:0}.form-inline .bootstrap-select.btn-group .form-control{width:100%}.bootstrap-select.btn-group.disabled,.bootstrap-select.btn-group>.disabled{cursor:not-allowed}.bootstrap-select.btn-group.disabled:focus,.bootstrap-select.btn-group>.disabled:focus{outline:0!important}.bootstrap-select.btn-group.bs-container{position:absolute}.bootstrap-select.btn-group.bs-container .dropdown-menu{z-index:1060}.bootstrap-select.btn-group .dropdown-toggle .filter-option{display:inline-block;overflow:hidden;width:100%;text-align:left}.bootstrap-select.btn-group .dropdown-toggle .caret{position:absolute;top:50%;right:12px;margin-top:-2px;vertical-align:middle}.bootstrap-select.btn-group[class*=col-] .dropdown-toggle{width:100%}.bootstrap-select.btn-group .dropdown-menu{min-width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .dropdown-menu.inner{position:static;float:none;border:0;padding:0;margin:0;border-radius:0;-webkit-box-shadow:none;box-shadow:none}.bootstrap-select.btn-group .dropdown-menu li{position:relative}.bootstrap-select.btn-group .dropdown-menu li.active small{color:#fff}.bootstrap-select.btn-group .dropdown-menu li.disabled a{cursor:not-allowed}.bootstrap-select.btn-group .dropdown-menu li a{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bootstrap-select.btn-group .dropdown-menu li a.opt{position:relative;padding-left:2.25em}.bootstrap-select.btn-group .dropdown-menu li a span.check-mark{display:none}.bootstrap-select.btn-group .dropdown-menu li a span.text{display:inline-block}.bootstrap-select.btn-group .dropdown-menu li small{padding-left:.5em}.bootstrap-select.btn-group .dropdown-menu .notify{position:absolute;bottom:5px;width:96%;margin:0 2%;min-height:26px;padding:3px 5px;background:#f5f5f5;border:1px solid #e3e3e3;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05);pointer-events:none;opacity:.9;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bootstrap-select.btn-group .no-results{padding:3px;background:#f5f5f5;margin:0 5px;white-space:nowrap}.bootstrap-select.btn-group.fit-width .dropdown-toggle .filter-option{position:static}.bootstrap-select.btn-group.fit-width .dropdown-toggle .caret{position:static;top:auto;margin-top:-1px}.bootstrap-select.btn-group.show-tick .dropdown-menu li.selected a span.check-mark{position:absolute;display:inline-block;right:15px;margin-top:5px}.bootstrap-select.btn-group.show-tick .dropdown-menu li a span.text{margin-right:34px}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle{z-index:1061}.bootstrap-select.show-menu-arrow .dropdown-toggle:before{content:'';border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid rgba(204,204,204,.2);position:absolute;bottom:-4px;left:9px;display:none}.bootstrap-select.show-menu-arrow .dropdown-toggle:after{content:'';border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;bottom:-4px;left:10px;display:none}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:before{bottom:auto;top:-3px;border-top:7px solid rgba(204,204,204,.2);border-bottom:0}.bootstrap-select.show-menu-arrow.dropup .dropdown-toggle:after{bottom:auto;top:-3px;border-top:6px solid #fff;border-bottom:0}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:before{right:12px;left:auto}.bootstrap-select.show-menu-arrow.pull-right .dropdown-toggle:after{right:13px;left:auto}.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:after,.bootstrap-select.show-menu-arrow.open>.dropdown-toggle:before{display:block}.bs-actionsbox,.bs-donebutton,.bs-searchbox{padding:4px 8px}.bs-actionsbox{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-actionsbox .btn-group button{width:50%}.bs-donebutton{float:left;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.bs-donebutton .btn-group button{width:100%}.bs-searchbox+.bs-actionsbox{padding:0 8px 4px}.bs-searchbox .form-control{margin-bottom:0;width:100%;float:none}select.bs-select-hidden,select.selectpicker{display:none!important}select.mobile-device{position:absolute!important;top:0;left:0;display:block!important;width:100%;height:100%!important;opacity:0}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -18,7 +18,7 @@ return [ ...@@ -18,7 +18,7 @@ return [
'after' => 'The :attribute must be a date after :date.', 'after' => 'The :attribute must be a date after :date.',
'after_or_equal' => 'The :attribute must be a date after or equal to :date.', 'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
'alpha' => 'The :attribute may only contain letters.', 'alpha' => 'The :attribute may only contain letters.',
'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.', 'alpha_dash' => 'The :attribute may only contain letters, numbers, and dashes.',
'alpha_num' => 'The :attribute may only contain letters and numbers.', 'alpha_num' => 'The :attribute may only contain letters and numbers.',
'array' => 'The :attribute must be an array.', 'array' => 'The :attribute must be an array.',
'before' => 'The :attribute must be a date before :date.', 'before' => 'The :attribute must be a date before :date.',
...@@ -42,18 +42,6 @@ return [ ...@@ -42,18 +42,6 @@ return [
'exists' => 'The selected :attribute is invalid.', 'exists' => 'The selected :attribute is invalid.',
'file' => 'The :attribute must be a file.', 'file' => 'The :attribute must be a file.',
'filled' => 'The :attribute field must have a value.', 'filled' => 'The :attribute field must have a value.',
'gt' => [
'numeric' => 'The :attribute must be greater than :value.',
'file' => 'The :attribute must be greater than :value kilobytes.',
'string' => 'The :attribute must be greater than :value characters.',
'array' => 'The :attribute must have more than :value items.',
],
'gte' => [
'numeric' => 'The :attribute must be greater than or equal :value.',
'file' => 'The :attribute must be greater than or equal :value kilobytes.',
'string' => 'The :attribute must be greater than or equal :value characters.',
'array' => 'The :attribute must have :value items or more.',
],
'image' => 'The :attribute must be an image.', 'image' => 'The :attribute must be an image.',
'in' => 'The selected :attribute is invalid.', 'in' => 'The selected :attribute is invalid.',
'in_array' => 'The :attribute field does not exist in :other.', 'in_array' => 'The :attribute field does not exist in :other.',
...@@ -62,18 +50,6 @@ return [ ...@@ -62,18 +50,6 @@ return [
'ipv4' => 'The :attribute must be a valid IPv4 address.', 'ipv4' => 'The :attribute must be a valid IPv4 address.',
'ipv6' => 'The :attribute must be a valid IPv6 address.', 'ipv6' => 'The :attribute must be a valid IPv6 address.',
'json' => 'The :attribute must be a valid JSON string.', 'json' => 'The :attribute must be a valid JSON string.',
'lt' => [
'numeric' => 'The :attribute must be less than :value.',
'file' => 'The :attribute must be less than :value kilobytes.',
'string' => 'The :attribute must be less than :value characters.',
'array' => 'The :attribute must have less than :value items.',
],
'lte' => [
'numeric' => 'The :attribute must be less than or equal :value.',
'file' => 'The :attribute must be less than or equal :value kilobytes.',
'string' => 'The :attribute must be less than or equal :value characters.',
'array' => 'The :attribute must not have more than :value items.',
],
'max' => [ 'max' => [
'numeric' => 'The :attribute may not be greater than :max.', 'numeric' => 'The :attribute may not be greater than :max.',
'file' => 'The :attribute may not be greater than :max kilobytes.', 'file' => 'The :attribute may not be greater than :max kilobytes.',
...@@ -89,7 +65,6 @@ return [ ...@@ -89,7 +65,6 @@ return [
'array' => 'The :attribute must have at least :min items.', 'array' => 'The :attribute must have at least :min items.',
], ],
'not_in' => 'The selected :attribute is invalid.', 'not_in' => 'The selected :attribute is invalid.',
'not_regex' => 'The :attribute format is invalid.',
'numeric' => 'The :attribute must be a number.', 'numeric' => 'The :attribute must be a number.',
'present' => 'The :attribute field must be present.', 'present' => 'The :attribute field must be present.',
'regex' => 'The :attribute format is invalid.', 'regex' => 'The :attribute format is invalid.',
...@@ -125,9 +100,31 @@ return [ ...@@ -125,9 +100,31 @@ return [
*/ */
'custom' => [ 'custom' => [
'attribute-name' => [ 'income-name' => [
'rule-name' => 'custom-message', 'required' => 'Provide an income name',
],
'deduction-name' => [
'required' => 'Provide a deduction name',
],
'income-type' => [
'required' => 'Select an income type'
],
'deduction-type' => [
'required' => 'Select a deduction type'
],
'tabulation-type' => [
'required' => 'Select a tabulation type'
],
'tax-option' => [
'required' => 'Select a tax option'
], ],
'range-name.required' => 'Provide a range name',
'payroll-item.required' => 'Select a range category',
'range-lower-limit[].required' => 'Provide a lower limit for the range',
'range-upper-limit[].required' => 'Provide an upper limit for the range',
'range-rate[].required' => 'Provide a rate for the range',
'range.required' => 'Select a range',
'relief-name.required' => 'Provide a relief name',
], ],
/* /*
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Allowances') @section('title', 'Allowances')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Create allowance') @section('title', 'Create allowance')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Edit allowance') @section('title', 'Edit allowance')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Edit group') @section('title', 'Edit group')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Add employees') @section('title', 'Add employees')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', $allowance->income_name) @section('title', $allowance->income_name)
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Create deductions') @section('title', 'Create deductions')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Deductions') @section('title', 'Deductions')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Edit deductions') @section('title', 'Edit deductions')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Edit group') @section('title', 'Edit group')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Add employees') @section('title', 'Add employees')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', $deduction->deduction_name) @section('title', $deduction->deduction_name)
......
...@@ -2,20 +2,6 @@ ...@@ -2,20 +2,6 @@
@section('title', 'Employees') @section('title', 'Employees')
<style> <style>
.info p {
text-align:center;
color: #999;
text-transform:none;
font-weight:600;
font-size:15px;
margin-top:2px
}
.info i {
color:#F6AA93;
}
form { form {
border-radius: 5px; border-radius: 5px;
width:100%; width:100%;
......
...@@ -2,14 +2,6 @@ ...@@ -2,14 +2,6 @@
@section('title', 'Employees') @section('title', 'Employees')
<style> <style>
.choose_file {
position: relative;
display: inline-block;
font: normal 14px Myriad Pro, Verdana, Geneva, sans-serif;
color: #7f7f7f;
margin-top: 2px;
background: white
}
#import_file{ #import_file{
-webkit-appearance:none; -webkit-appearance:none;
position:absolute; position:absolute;
......
<!DOCTYPE html>
<html lang="en" class="app">
<head>
<meta charset="utf-8" />
<title>Page not found</title>
<meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="stylesheet" href="/css/bootstrap.css" type="text/css" />
<link rel="stylesheet" href="/css/animate.css" type="text/css" />
<link rel="stylesheet" href="/css/font-awesome.min.css" type="text/css" />
<link rel="stylesheet" href="/css/font.css" type="text/css" />
<link rel="stylesheet" href="/css/app.css" type="text/css" />
<!--[if lt IE 9]>
<script src="/js/ie/html5shiv.js"></script>
<script src="/js/ie/respond.min.js"></script>
<script src="/js/ie/excanvas.js"></script>
<![endif]-->
</head>
<body class="">
<section id="content">
<div class="row m-n">
<div class="col-sm-4 col-sm-offset-4">
<div class="text-center m-b-lg">
<h1 class="h text-white animated fadeInDownBig">404</h1>
</div>
<div class="list-group m-b-sm bg-white m-b-lg">
<a href="#" class="list-group-item">
<i class="fa fa-chevron-right icon-muted"></i>
<i class="fa fa-fw fa-home icon-muted"></i> Goto homepage
</a>
<a href="#" class="list-group-item">
<i class="fa fa-chevron-right icon-muted"></i>
<i class="fa fa-fw fa-question icon-muted"></i> Send us an email
</a>
<a href="#" class="list-group-item">
<i class="fa fa-chevron-right icon-muted"></i>
<span class="badge">021-215-584</span>
<i class="fa fa-fw fa-phone icon-muted"></i> Call us
</a>
</div>
</div>
</div>
</section>
<!-- footer -->
<footer id="footer">
<div class="text-center padder clearfix">
<p>
<small>Kinetic HRM<br>&copy; <?php echo date('Y'); ?></small>
</p>
</div>
</footer>
<!-- / footer -->
<script src="/js/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="/js/bootstrap.js"></script>
<!-- App -->
<script src="/js/app.js"></script>
<script src="/js/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/app.plugin.js"></script>
</body>
</html>
\ No newline at end of file
@extends('Layout.master')
@section('title', 'An error occurred')
@section('content')
<div>
<div>500</div>
</div>
@endsection
\ No newline at end of file
This diff is collapsed.
...@@ -22,40 +22,95 @@ ...@@ -22,40 +22,95 @@
Process payroll Process payroll
</header> </header>
<div class="panel-body pull-in"> <div class="panel-body pull-in">
@include('Layout.errors') <div class="alert-info padder padder-v">
Ready to process payroll!
</div>
<div class="col-md-2"> <div class="col-md-2">
<label class="control-label">Year</label> <label class="control-label">Year</label>
<select class="form-control {{ ($errors->has('income-type'))?'input-danger':'' }}" name="income-type"> <select class="form-control" id="payroll-year">
<option value="">Year</option> <option value="" disabled>Year</option>
<?php
$year = date('Y');
do{
echo "<option value='$year'>$year</option>";
$year -= 1;
}while($year > 2017)
?>
</select> </select>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<label class="control-label">Month</label> <label class="control-label">Month</label>
<select class="form-control {{ ($errors->has('tabulation-type'))?'input-danger':'' }}" name="tabulation-type" id="tabulation-type"> <select class="form-control" id="payroll-month">
<option value="">Month</option> <option value="" disabled>Month</option>
<?php
$month = date('m');
$month *= 1; # [Optional] This forces PHP to display 3 instead of 03 for the month
do{
echo "<option value='$month'>$month</option>";
$month -= 1;
}while($month > 0)
?>
</select> </select>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label class="control-label">Business unit</label> <label class="control-label">Business unit</label>
<select class="form-control multi-select {{ ($errors->has('tax-option'))?'input-danger':'' }}" name="business-units[]" multiple="multiple"> <select class="form-control multi-select" id="business-units" name="payroll-business-units[]" multiple="multiple">
<option value="" selected>All business units</option> <option value="0" selected>All business units</option>
@foreach($business_units as $business_unit)
<option value="{{ $business_unit->id }}">{{ $business_unit->business_unit}}</option>
@endforeach
</select> </select>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label class="control-label">Department</label> <label class="control-label">Department</label>
<select class="form-control multi-select {{ ($errors->has('range'))?'input-danger':'' }}" name="departments[]" multiple="multiple"> <select class="form-control multi-select" id="payroll-departments" name="payroll-departments[]" multiple="multiple">
<option value="" selected>All departments</option> <option value="0" selected>All departments</option>
@foreach($departments as $department) @foreach($departments as $department)
<option value="{{ $department->id }}">{{ $department->department_name }}</option> <option value="{{ $department->id }}">{{ $department->department_name }}</option>
@endforeach @endforeach
</select> </select>
</div> </div>
<div class="col-md-12" style="margin-top:20px;text-align:center;border-top:1px dashed rgba(0,0,0,0.2);"> <div class="col-md-12 payroll-instances no-padder" style="margin-top:20px;border-top:1px dashed rgba(0,0,0,0.2);">
<table class="table table-condensed m-b-none" style="border:0 !important;">
<thead>
<tr>
<th>Year</th>
<th>Month</th>
<th>Business Units</th>
<th>Departments</th>
<th>Approvals</th>
<th>Rejections</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@if(!count($instances))
<tr>
<td colspan="6" class="text-center">Payroll has not been processed for selected dates</td>
</tr>
@else
@foreach($instances as $instance)
<tr>
<td>{{ $instance->year }}</td>
<td>{{ $instance->month }}</td>
<td>{{ $instance->business_units }}</td>
<td>{{ $instance->departments }}</td>
<td>4/5</td>
<td>1/5</td>
<td>
<span class="btn btn-default btn-sm"><i class="fa fa-eye no-margin"></i></span>
<span class="btn btn-info btn-sm">Re-Run</span>
<span class="btn btn-danger btn-sm"><i class="fa fa-trash no-margin"></i></span>
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
<div class="col-md-12" style="text-align:right;border-top:1px dashed rgba(0,0,0,0.2);">
<div style="margin-top:20px;"> <div style="margin-top:20px;">
<button type="submit" class="btn btn-success"><i class="fa fa-database"></i>Process</button> <button type="submit" class="btn btn-success" id="process-payroll"><i class="fa fa-database"></i>Process</button>
</div> </div>
</div> </div>
</div> </div>
...@@ -84,6 +139,54 @@ ...@@ -84,6 +139,54 @@
<script> <script>
$(document).on('ready', function(){ $(document).on('ready', function(){
$('.multi-select').select2(); $('.multi-select').select2();
$('#process-payroll').on('click', function(e){
e.preventDefault();
let el = $(this);
let year = $('#payroll-year').val();
let month = $('#payroll-month').val();
let businessUnits = $("#business-units").val();
let departments = $("#payroll-departments").val();
console.log('Starting..');
let processPayrollRequest = $.ajax({
type:'POST',
url:'/process_payroll/process',
data:{
year:year,
month:month,
businessUnits:businessUnits,
departments:departments
},
dataType:'json',
timeout:10000,
beforeSend:function(){
console.log('Processing..');
el.addClass('disabled');
},
success:function(response){
el.removeClass('disabled');
if (response.status === 0){
alert(response.error_message);
}else{
window.location = '/process_payroll';
}
},
error(x,t,m){
el.removeClass('disabled');
if (t === "timeout"){
processPayrollRequest.abort();
console.log('Request time out');
}
}
});
console.log('Done..');
});
}); });
</script> </script>
@endsection @endsection
\ No newline at end of file
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Create a range') @section('title', 'Create a range')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Edit a range') @section('title', 'Edit a range')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Range manager') @section('title', 'Range manager')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Create a range') @section('title', 'Create a range')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Create relief') @section('title', 'Create relief')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Edit relief') @section('title', 'Edit relief')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Edit group') @section('title', 'Edit group')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Add employees') @section('title', 'Add employees')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', 'Relief') @section('title', 'Relief')
......
@extends('Layout.Payslipmaster') @extends('Layout.master')
@section('title', $relief->relief_name) @section('title', $relief->relief_name)
......
...@@ -11,8 +11,9 @@ ...@@ -11,8 +11,9 @@
| |
*/ */
#Dashboard
Route::get('/', 'DashboardController@index'); Route::get('/', 'DashboardController@index');
Route::get('/dashboard', 'DashboardController@index');
/**********************- To be shared by all 3 payroll items -********************/ /**********************- To be shared by all 3 payroll items -********************/
...@@ -50,12 +51,12 @@ Route::post('/deductions/destroy', 'DeductionsController@destroy'); ...@@ -50,12 +51,12 @@ Route::post('/deductions/destroy', 'DeductionsController@destroy');
Route::get('/dashboard', 'DashboardController@index'); Route::get('/dashboard', 'DashboardController@index');
#ProcessPayrollController #ProcessPayrollController
Route::get('/process_payroll/process', 'ProcessPayrollController@process_payroll'); Route::post('/process_payroll/process', 'ProcessPayrollController@process_payroll');
Route::resource('/process_payroll', 'ProcessPayrollController'); Route::resource('/process_payroll', 'ProcessPayrollController');
#PayslipController #PayslipController
Route::get('/payslip', 'PayslipController@index'); Route::get('/payslip', 'PayslipController@index');
Route::post('/payslip/view_payslip', 'PayslipController@view_payslip'); Route::get('/payslip/view_payslip', 'PayslipController@view_payslip');
#EmployeesController #EmployeesController
Route::get('/employees', 'EmployeesController@index'); Route::get('/employees', 'EmployeesController@index');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment