first commit
This commit is contained in:
0
Modules/Payroll/app/Http/Controllers/.gitkeep
Normal file
0
Modules/Payroll/app/Http/Controllers/.gitkeep
Normal file
95
Modules/Payroll/app/Http/Controllers/PaymentController.php
Normal file
95
Modules/Payroll/app/Http/Controllers/PaymentController.php
Normal file
@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Payroll\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Employee\Repositories\EmployeeInterface;
|
||||
use Modules\Employee\Repositories\EmployeeRepository;
|
||||
use Modules\Payroll\Repositories\PaymentInterface;
|
||||
use Modules\Payroll\Repositories\PaymentRepository;
|
||||
|
||||
class PaymentController extends Controller
|
||||
{
|
||||
private $paymentRepository;
|
||||
private $employeeRepository;
|
||||
|
||||
public function __construct(PaymentInterface $paymentRepository, EmployeeInterface $employeeRepository)
|
||||
{
|
||||
$this->paymentRepository = $paymentRepository;
|
||||
$this->employeeRepository = $employeeRepository;
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = "Payment Lists";
|
||||
$data['paymentLists'] = $this->paymentRepository->findAll();
|
||||
return view('payroll::payments.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = "Create Payment";
|
||||
$data['editable'] = false;
|
||||
$data['employeeLists'] = $this->employeeRepository->pluck();
|
||||
return view('payroll::payments.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->paymentRepository->create($request->all());
|
||||
toastr()->success('Payment Created Successfully.');
|
||||
return redirect()->route('payment.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('payroll::payments.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = "Edit Payment";
|
||||
$data['editable'] = true;
|
||||
$data['payment'] = $this->paymentRepository->getPaymentById($id);
|
||||
return view('payroll::payments.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
try {
|
||||
$this->paymentRepository->update($id, $request->all());
|
||||
toastr()->success('Payment Updated Successfully.');
|
||||
} catch (\Throwable $th) {
|
||||
toastr()->error($th->getMessage());
|
||||
}
|
||||
return redirect()->route('payment.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
67
Modules/Payroll/app/Http/Controllers/PayrollController.php
Normal file
67
Modules/Payroll/app/Http/Controllers/PayrollController.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Payroll\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class PayrollController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('payroll::index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('payroll::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('payroll::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('payroll::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
0
Modules/Payroll/app/Http/Requests/.gitkeep
Normal file
0
Modules/Payroll/app/Http/Requests/.gitkeep
Normal file
0
Modules/Payroll/app/Models/.gitkeep
Normal file
0
Modules/Payroll/app/Models/.gitkeep
Normal file
42
Modules/Payroll/app/Models/Payment.php
Normal file
42
Modules/Payroll/app/Models/Payment.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Payroll\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Employee\Models\Employee;
|
||||
use Modules\Payroll\Database\factories\PaymentFactory;
|
||||
|
||||
class Payment extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = "tbl_payments";
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'employee_id',
|
||||
'account_no',
|
||||
'paid_date',
|
||||
'paid_amount',
|
||||
'payment_mode',
|
||||
'status',
|
||||
'description',
|
||||
'remarks',
|
||||
'createdBy',
|
||||
'updatedBy',
|
||||
];
|
||||
|
||||
const PAYMENT_MODE = [
|
||||
'check' => 'Check',
|
||||
'online' => 'Online',
|
||||
'cash' => 'Cash'
|
||||
];
|
||||
|
||||
public function employee(){
|
||||
return $this->belongsTo(Employee::class,'employee_id');
|
||||
}
|
||||
|
||||
}
|
0
Modules/Payroll/app/Observers/.gitkeep
Normal file
0
Modules/Payroll/app/Observers/.gitkeep
Normal file
0
Modules/Payroll/app/Providers/.gitkeep
Normal file
0
Modules/Payroll/app/Providers/.gitkeep
Normal file
118
Modules/Payroll/app/Providers/PayrollServiceProvider.php
Normal file
118
Modules/Payroll/app/Providers/PayrollServiceProvider.php
Normal file
@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Payroll\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\Payroll\Repositories\PaymentInterface;
|
||||
use Modules\Payroll\Repositories\PaymentRepository;
|
||||
|
||||
class PayrollServiceProvider extends ServiceProvider
|
||||
{
|
||||
protected string $moduleName = 'Payroll';
|
||||
|
||||
protected string $moduleNameLower = 'payroll';
|
||||
|
||||
/**
|
||||
* Boot the application events.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
$this->registerCommands();
|
||||
$this->registerCommandSchedules();
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
$this->app->bind(PaymentInterface::class, PaymentRepository::class);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register commands in the format of Command::class
|
||||
*/
|
||||
protected function registerCommands(): void
|
||||
{
|
||||
// $this->commands([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register command Schedules.
|
||||
*/
|
||||
protected function registerCommandSchedules(): void
|
||||
{
|
||||
// $this->app->booted(function () {
|
||||
// $schedule = $this->app->make(Schedule::class);
|
||||
// $schedule->command('inspire')->hourly();
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations.
|
||||
*/
|
||||
public function registerTranslations(): void
|
||||
{
|
||||
$langPath = resource_path('lang/modules/'.$this->moduleNameLower);
|
||||
|
||||
if (is_dir($langPath)) {
|
||||
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom($langPath);
|
||||
} else {
|
||||
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
|
||||
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*/
|
||||
protected function registerConfig(): void
|
||||
{
|
||||
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
|
||||
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*/
|
||||
public function registerViews(): void
|
||||
{
|
||||
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);
|
||||
$sourcePath = module_path($this->moduleName, 'resources/views');
|
||||
|
||||
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
|
||||
|
||||
$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder','')));
|
||||
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function getPublishableViewPaths(): array
|
||||
{
|
||||
$paths = [];
|
||||
foreach (config('view.paths') as $path) {
|
||||
if (is_dir($path.'/modules/'.$this->moduleNameLower)) {
|
||||
$paths[] = $path.'/modules/'.$this->moduleNameLower;
|
||||
}
|
||||
}
|
||||
|
||||
return $paths;
|
||||
}
|
||||
}
|
49
Modules/Payroll/app/Providers/RouteServiceProvider.php
Normal file
49
Modules/Payroll/app/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Payroll\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
* Register any model bindings or pattern based filters.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*/
|
||||
public function map(): void
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
Route::middleware('web')->group(module_path('Payroll', '/routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Payroll', '/routes/api.php'));
|
||||
}
|
||||
}
|
0
Modules/Payroll/app/Repositories/.gitkeep
Normal file
0
Modules/Payroll/app/Repositories/.gitkeep
Normal file
12
Modules/Payroll/app/Repositories/PaymentInterface.php
Normal file
12
Modules/Payroll/app/Repositories/PaymentInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Payroll\Repositories;
|
||||
|
||||
interface PaymentInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getPaymentById($paymentId);
|
||||
public function delete($paymentId);
|
||||
public function create(array $paymentDetails);
|
||||
public function update($paymentId, array $newDetails);
|
||||
}
|
34
Modules/Payroll/app/Repositories/PaymentRepository.php
Normal file
34
Modules/Payroll/app/Repositories/PaymentRepository.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Payroll\Repositories;
|
||||
|
||||
use Modules\Payroll\Models\Payment;
|
||||
|
||||
|
||||
class PaymentRepository implements PaymentInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Payment::get();
|
||||
}
|
||||
|
||||
public function getPaymentById($paymentId)
|
||||
{
|
||||
return Payment::findOrFail($paymentId);
|
||||
}
|
||||
|
||||
public function delete($paymentId)
|
||||
{
|
||||
Payment::destroy($paymentId);
|
||||
}
|
||||
|
||||
public function create(array $paymentDetails)
|
||||
{
|
||||
return Payment::create($paymentDetails);
|
||||
}
|
||||
|
||||
public function update($paymentId, array $newDetails)
|
||||
{
|
||||
return Payment::where('id', $paymentId)->update($newDetails);
|
||||
}
|
||||
}
|
30
Modules/Payroll/composer.json
Normal file
30
Modules/Payroll/composer.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "nwidart/payroll",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Widart",
|
||||
"email": "n.widart@gmail.com"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [],
|
||||
"aliases": {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\Payroll\\": "app/",
|
||||
"Modules\\Payroll\\Database\\Factories\\": "database/factories/",
|
||||
"Modules\\Payroll\\Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Modules\\Payroll\\Tests\\": "tests/"
|
||||
}
|
||||
}
|
||||
}
|
0
Modules/Payroll/config/.gitkeep
Normal file
0
Modules/Payroll/config/.gitkeep
Normal file
5
Modules/Payroll/config/config.php
Normal file
5
Modules/Payroll/config/config.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Payroll',
|
||||
];
|
0
Modules/Payroll/database/factories/.gitkeep
Normal file
0
Modules/Payroll/database/factories/.gitkeep
Normal file
0
Modules/Payroll/database/migrations/.gitkeep
Normal file
0
Modules/Payroll/database/migrations/.gitkeep
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tbl_payments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('employee_id')->nullable();
|
||||
$table->text('account_no')->nullable();
|
||||
$table->date('payment_date')->nullable();
|
||||
$table->decimal('payment_amount')->nullable();
|
||||
$table->string('payment_mode')->nullable();
|
||||
$table->integer('status')->default(11);
|
||||
$table->mediumText('description');
|
||||
$table->mediumText('remarks');
|
||||
$table->unsignedBigInteger('createdBy');
|
||||
$table->unsignedBigInteger('updatedBy');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_payments');
|
||||
}
|
||||
};
|
0
Modules/Payroll/database/seeders/.gitkeep
Normal file
0
Modules/Payroll/database/seeders/.gitkeep
Normal file
16
Modules/Payroll/database/seeders/PayrollDatabaseSeeder.php
Normal file
16
Modules/Payroll/database/seeders/PayrollDatabaseSeeder.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Payroll\database\seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class PayrollDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// $this->call([]);
|
||||
}
|
||||
}
|
11
Modules/Payroll/module.json
Normal file
11
Modules/Payroll/module.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Payroll",
|
||||
"alias": "payroll",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\Payroll\\Providers\\PayrollServiceProvider"
|
||||
],
|
||||
"files": []
|
||||
}
|
15
Modules/Payroll/package.json
Normal file
15
Modules/Payroll/package.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^1.1.2",
|
||||
"laravel-vite-plugin": "^0.7.5",
|
||||
"sass": "^1.69.5",
|
||||
"postcss": "^8.3.7",
|
||||
"vite": "^4.0.0"
|
||||
}
|
||||
}
|
0
Modules/Payroll/resources/assets/.gitkeep
Normal file
0
Modules/Payroll/resources/assets/.gitkeep
Normal file
0
Modules/Payroll/resources/assets/js/app.js
Normal file
0
Modules/Payroll/resources/assets/js/app.js
Normal file
0
Modules/Payroll/resources/assets/sass/app.scss
Normal file
0
Modules/Payroll/resources/assets/sass/app.scss
Normal file
0
Modules/Payroll/resources/views/.gitkeep
Normal file
0
Modules/Payroll/resources/views/.gitkeep
Normal file
7
Modules/Payroll/resources/views/index.blade.php
Normal file
7
Modules/Payroll/resources/views/index.blade.php
Normal file
@ -0,0 +1,7 @@
|
||||
@extends('payroll::layouts.master')
|
||||
|
||||
@section('content')
|
||||
<h1>Hello World</h1>
|
||||
|
||||
<p>Module: {!! config('payroll.name') !!}</p>
|
||||
@endsection
|
29
Modules/Payroll/resources/views/layouts/master.blade.php
Normal file
29
Modules/Payroll/resources/views/layouts/master.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<title>Payroll Module - {{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<meta name="description" content="{{ $description ?? '' }}">
|
||||
<meta name="keywords" content="{{ $keywords ?? '' }}">
|
||||
<meta name="author" content="{{ $author ?? '' }}">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||
|
||||
{{-- Vite CSS --}}
|
||||
{{-- {{ module_vite('build-payroll', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-payroll', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
23
Modules/Payroll/resources/views/payments/create.blade.php
Normal file
23
Modules/Payroll/resources/views/payments/create.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->form('POST')->route('payment.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('payroll::payments.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
23
Modules/Payroll/resources/views/payments/edit.blade.php
Normal file
23
Modules/Payroll/resources/views/payments/edit.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->modelForm($payments, 'PUT')->route('payments.update', $payments->payments_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('payroll::paymentss.partials.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
79
Modules/Payroll/resources/views/payments/index.blade.php
Normal file
79
Modules/Payroll/resources/views/payments/index.blade.php
Normal file
@ -0,0 +1,79 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('payment.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Payment</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Department</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Employee Name</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Payment Date</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Payment Amount</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Payment Mode</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Status</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($paymentLists as $index => $item)
|
||||
<tr>
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->department_id }}</td>
|
||||
<td class="tb-col">{{ $item->employee_id }}</td>
|
||||
<td class="tb-col">{{ $item->payment_date }}</td>
|
||||
<td class="tb-col">{{ $item->payment_amount }}</td>
|
||||
<td class="tb-col">{{ $item->payment_mode }}</td>
|
||||
<td class="tb-col">{{ $item->status }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('payment.show', [$item->payment_category_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
|
||||
</li>
|
||||
|
||||
<li><a href="{{ route('payment.edit', [$item->payment_category_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
Edit</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="{{ route('appreciation.destroy', [$item->payment_category_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,41 @@
|
||||
<div class="row gy-3">
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Employee')->class('form-label') }}
|
||||
{{ html()->select('employee_id', $employeeLists)->class('form-select select2')->placeholder('Employee Name') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Account Number')->class('form-label') }}
|
||||
{{ html()->text('account_no')->class('form-control')->placeholder('Bank Account Number') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Payment Date')->class('form-label') }}
|
||||
{{ html()->date('payment_date')->class('form-control')}}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Payment Amount')->class('form-label') }}
|
||||
{{ html()->number('payment_amount')->class('form-control')->placeholder('total Amount in RS.')}}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Payment Mode')->class('form-label') }}
|
||||
{{ html()->select('payment_mode', \Modules\Payroll\Models\Payment::PAYMENT_MODE)->class('form-select select2')->placeholder('Payment Mode') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Description')->class('form-label') }}
|
||||
{{ html()->textarea('description')->class('form-control')->placeholder('Payment Description')->attributes(['rows' => 3]) }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 3]) }}
|
||||
</div>
|
||||
|
||||
<div class="text-end">
|
||||
{{ html()->button($editable ? 'Update' : 'Add Payment', 'submit')->class('btn btn-success') }}
|
||||
</div>
|
||||
</div>
|
48
Modules/Payroll/resources/views/payments/show.blade.php
Normal file
48
Modules/Payroll/resources/views/payments/show.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<p><b>Job Description : </b> <span>{{ $data->job_description }}</span></p>
|
||||
<p><b>Departments Id : </b> <span>{{ $data->departments_id }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
0
Modules/Payroll/routes/.gitkeep
Normal file
0
Modules/Payroll/routes/.gitkeep
Normal file
19
Modules/Payroll/routes/api.php
Normal file
19
Modules/Payroll/routes/api.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Payroll\Http\Controllers\PayrollController;
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------
|
||||
* API Routes
|
||||
*--------------------------------------------------------------------------
|
||||
*
|
||||
* Here is where you can register API routes for your application. These
|
||||
* routes are loaded by the RouteServiceProvider within a group which
|
||||
* is assigned the "api" middleware group. Enjoy building your API!
|
||||
*
|
||||
*/
|
||||
|
||||
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
|
||||
Route::apiResource('payroll', PayrollController::class)->names('payroll');
|
||||
});
|
21
Modules/Payroll/routes/web.php
Normal file
21
Modules/Payroll/routes/web.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\Payroll\Http\Controllers\PaymentController;
|
||||
use Modules\Payroll\Http\Controllers\PayrollController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::group([], function () {
|
||||
Route::resource('payroll', PayrollController::class)->names('payroll');
|
||||
Route::resource('payment', PaymentController::class)->names('payment');
|
||||
});
|
26
Modules/Payroll/vite.config.js
Normal file
26
Modules/Payroll/vite.config.js
Normal file
@ -0,0 +1,26 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: '../../public/build-payroll',
|
||||
emptyOutDir: true,
|
||||
manifest: true,
|
||||
},
|
||||
plugins: [
|
||||
laravel({
|
||||
publicDirectory: '../../public',
|
||||
buildDirectory: 'build-payroll',
|
||||
input: [
|
||||
__dirname + '/resources/assets/sass/app.scss',
|
||||
__dirname + '/resources/assets/js/app.js'
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
//export const paths = [
|
||||
// 'Modules/Payroll/resources/assets/sass/app.scss',
|
||||
// 'Modules/Payroll/resources/assets/js/app.js',
|
||||
//];
|
Reference in New Issue
Block a user