AI Review Center
Commit Review Workspace ?
Select a commit on the left to inspect quality, security, business value, findings, and suggested code changes.
Project AI Score
?
67%
Quality Avg
?
72%
Security Avg
?
54%
Reviews
?
37
Review Result ?
jattin01/army · 50ffe637
The commit adds detailed enhancements for complaint and equipment exports, tax management, and a robust attendance raw punch sync feature. The coding practices shown are generally clean and logical. The addition of input validation and chunk processing improves performance and reliability. However, some variable naming and code clarity could be improved for maintainability. The commit message is vague and should be more descriptive to reflect the breadth of changes.
Quality
?
85%
Security
?
70%
Business Value
?
80%
Maintainability
?
83%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Vague And Low Quality
Where
commit message
Issue / Evidence
vague and low quality
Suggested Fix
provide a detailed descriptive commit message explaining key changes and impact
Magic String Usage In Explode And Index
Where
app/Exports/ComplaintReportExport.php:101
Issue / Evidence
magic string usage in explode and index
Suggested Fix
add constant or comment to clarify parts format to improve maintainability
Missing Validation
Where
app/Http/Controllers/AttendanceRawPunchController.php:40
Issue / Evidence
validation rules
Suggested Fix
improve validation by specifying stricter formats or limits to avoid unexpected input
Long Function
Where
app/Http/Controllers/AttendanceRawPunchController.php:46-102
Issue / Evidence
complex chunk processing
Suggested Fix
consider splitting function or adding comments for clarity and maintainability
Resolvebiometricid Method
Where
app/Http/Controllers/AttendanceRawPunchController.php:263-278
Issue / Evidence
resolveBiometricId method
Suggested Fix
consider adding caching or comments to clarify multi-step identifier resolving
Syncattendancerow Method
Where
app/Http/Controllers/AttendanceRawPunchController.php:280-315
Issue / Evidence
syncAttendanceRow method
Suggested Fix
improve null check handling and add logging for missing employees for better debugging
Incomplete Or Minimal Filter Query
Where
app/Http/Controllers/Admin/TaxManagementController.php:26-29
Issue / Evidence
incomplete or minimal filter query
Suggested Fix
add comments or improve error handling for invalid regime_type inputs
Code Change Preview · app/Exports/ComplaintReportExport.php
?
Removed / Before Commit
- $query->where('complaint_number', 'like', '%/' . $request->production_year); - } - - return $query->get()->map(function ($complaint) { - $equipmentDetails = $complaint->equipment_details ?? []; - $equipmentList = []; - - } - } - - return [ - 'Complaint No' => $complaint->complaint_number, - 'Group' => optional($complaint->group)->name, - 'Sub Section' => optional($complaint->subGroup)->name, - 'Nature Of Complaint' => optional($complaint->natureOfComplaint)->name, - 'Complaint Description' => $complaint->complaint_description, - 'Assigned To' => $complaint->assigned_to_display, - 'Resolver Name' => $complaint->resolver_name_display,
Added / After Commit
+ $query->where('complaint_number', 'like', '%/' . $request->production_year); + } + + return $query->get()->values()->map(function ($complaint, $index) { + $equipmentDetails = $complaint->equipment_details ?? []; + $equipmentList = []; + + } + } + + $productionYear = '-'; + if ($complaint->complaint_number) { + $parts = explode('/', $complaint->complaint_number); + if (count($parts) >= 3) { + $productionYear = $parts[2]; + } + } +
Removed / Before Commit
- return $this->rows->map(function ($equipment, $index) { - $workOrder = $equipment->workOrder; - $unit = $workOrder?->workUnit; - return [ - $index + 1, - $equipment->group?->name ?? '-', - $equipment->sus ?? '-', - $equipment->wcn_number ?? '-', - $equipment->wcn_date ?? '-', - ]; - }); - } - 'Sus', - 'WCN No', - 'WCN Date', - ]; - } - }
Added / After Commit
+ return $this->rows->map(function ($equipment, $index) { + $workOrder = $equipment->workOrder; + $unit = $workOrder?->workUnit; + $gatePass = $equipment->gatePasses?->sortByDesc('gate_pass_date')->first(); + $gatePassNo = $gatePass?->gate_pass_no ?: ($gatePass ? str_pad($gatePass->id, 5, '0', STR_PAD_LEFT) : '-'); + return [ + $index + 1, + $equipment->group?->name ?? '-', + $equipment->sus ?? '-', + $equipment->wcn_number ?? '-', + $equipment->wcn_date ?? '-', + $gatePassNo, + $gatePass?->gate_pass_date ? \Carbon\Carbon::parse($gatePass->gate_pass_date)->format('d-m-Y') : '-', + ]; + }); + } + 'Sus', + 'WCN No',
Removed / Before Commit
- $query->where('is_active', $request->is_active); - } - - $taxRegimes = $query->latest()->paginate(10)->appends($request->all()); - - // Get ALL financial years from ProductionYear model (active only) - // Validate regime data - $regimeData = $request->validate([ - 'regime_name' => 'required|string|max:255', - 'financial_year' => 'required|string|max:20', - 'description' => 'nullable|string', - 'minimum_income' => 'nullable|numeric|min:0', - // Validate regime data - $regimeData = $request->validate([ - 'regime_name' => 'required|string|max:255', - 'financial_year' => 'required|string|max:20', - 'description' => 'nullable|string', - 'minimum_income' => 'nullable|numeric|min:0',
Added / After Commit
+ $query->where('is_active', $request->is_active); + } + + if ($request->filled('regime_type')) { + $query->where('regime_type', $request->regime_type); + } + + $taxRegimes = $query->latest()->paginate(10)->appends($request->all()); + + // Get ALL financial years from ProductionYear model (active only) + // Validate regime data + $regimeData = $request->validate([ + 'regime_name' => 'required|string|max:255', + 'regime_type' => 'required|in:old,new', + 'financial_year' => 'required|string|max:20', + 'description' => 'nullable|string', + 'minimum_income' => 'nullable|numeric|min:0', + // Validate regime data
Removed / Before Commit
- - namespace App\Http\Controllers; - - use App\Models\AttendanceRawPunch; - use Carbon\Carbon; - use Illuminate\Http\Request; - use Illuminate\Support\Facades\DB; - return view('attendance.raw-punches', compact('rawPunches')); - } - - public function fetch(Request $request) - { - $validated = $request->validate([ - return null; - } - } - }
Added / After Commit
+ + namespace App\Http\Controllers; + + use App\Models\Attendance; + use App\Models\AttendanceRawPunch; + use App\Models\Leave; + use App\Models\Staff; + use Carbon\Carbon; + use Illuminate\Http\Request; + use Illuminate\Support\Facades\DB; + return view('attendance.raw-punches', compact('rawPunches')); + } + + public function syncToAttendance(Request $request) + { + $validated = $request->validate([ + 'card_no' => ['nullable', 'string'], + 'pay_code' => ['nullable', 'string'],
Removed / Before Commit
- $request->validate([ - 'group_id' => 'required|exists:groups,id', - 'location' => 'required|string|max:255', - 'nature_of_complaint_id' => 'required|exists:nature_of_complaints,id', - ]); - - 'complaint_date' => Carbon::now('Asia/Kolkata')->toDateString(), - 'complaint_time' => Carbon::now('Asia/Kolkata'), - 'user_name' => Auth::user()->name ?? 'Anonymous User', - 'user_id' => Auth::id(), - 'group_id' => $request->group_id, - 'location' => $request->location, - $complaintData['total_equipment_items'] = $complaint->total_equipment_items; - $complaintData['assigned_to_name'] = $complaint->assigned_to_display; - $complaintData['resolver_name'] = $complaint->resolver_name_display; - - // Add resolver details - $complaintData['resolver_status'] = $complaint->resolver_status;
Added / After Commit
+ $request->validate([ + 'group_id' => 'required|exists:groups,id', + 'location' => 'required|string|max:255', + 'complaint_name' => 'required|string|max:255', + 'nature_of_complaint_id' => 'required|exists:nature_of_complaints,id', + ]); + + 'complaint_date' => Carbon::now('Asia/Kolkata')->toDateString(), + 'complaint_time' => Carbon::now('Asia/Kolkata'), + 'user_name' => Auth::user()->name ?? 'Anonymous User', + 'complaint_name' => $request->complaint_name, + 'user_id' => Auth::id(), + 'group_id' => $request->group_id, + 'location' => $request->location, + $complaintData['total_equipment_items'] = $complaint->total_equipment_items; + $complaintData['assigned_to_name'] = $complaint->assigned_to_display; + $complaintData['resolver_name'] = $complaint->resolver_name_display; + $complaintData['complaint_name'] = $complaint->complaint_name_display;
Removed / Before Commit
Added / After Commit
+ <?php + + namespace App\Http\Controllers; + + use App\Models\FinanceSalaryRuleMaster; + use App\Models\DaRate; + use App\Models\TaxRegimeMaster; + use Illuminate\Http\Request; + use Illuminate\Support\Facades\DB; + + class FinanceSalaryRuleMasterController extends Controller + { + public function index() + { + $rules = FinanceSalaryRuleMaster::with('creator') + ->orderBy('rule_key') + ->orderByDesc('effective_from') + ->orderByDesc('id')
Removed / Before Commit
- 'cr_no' => 'nullable|string|max:255', - 'handicap' => 'nullable|boolean', - 'govt_accommodation' => 'nullable|boolean', - 'bank_name' => 'nullable|string|max:255', - 'account_holder_name' => 'nullable|string|max:255', - 'account_number' => 'nullable|string|max:50', - 'ifsc_code' => 'nullable|string|max:20', - 'branch_name' => 'nullable|string|max:255', - 'account_type' => 'nullable|in:saving,current,salary', - 'special_pay' => 'nullable|numeric', - 'risk_allowance' => 'nullable|numeric', - 'wash' => 'nullable|numeric', - - $staff->update([ - 'is_handicapped' => $request->boolean('handicap'), - 'bank_name' => $validated['bank_name'] ?? null, - 'account_holder_name' => $validated['account_holder_name'] ?? null, - 'account_number' => $validated['account_number'] ?? null,
Added / After Commit
+ 'cr_no' => 'nullable|string|max:255', + 'handicap' => 'nullable|boolean', + 'govt_accommodation' => 'nullable|boolean', + // Bank fields are temporarily disabled on the finance edit page. + // 'bank_name' => 'nullable|string|max:255', + // 'account_holder_name' => 'nullable|string|max:255', + // 'account_number' => 'nullable|string|max:50', + // 'ifsc_code' => 'nullable|string|max:20', + // 'branch_name' => 'nullable|string|max:255', + // 'account_type' => 'nullable|in:saving,current,salary', + 'special_pay' => 'nullable|numeric', + 'risk_allowance' => 'nullable|numeric', + 'wash' => 'nullable|numeric', + + $staff->update([ + 'is_handicapped' => $request->boolean('handicap'), + // Bank fields are temporarily disabled on the finance edit page. + // 'bank_name' => $validated['bank_name'] ?? null,
Removed / Before Commit
- use Carbon\Carbon; - use App\Models\ProductionYear; - use App\Models\RepairClassCode; - - - class WorkOrderController extends Controller - return view('work-order.index', compact('workOrders')); - } - - - - - - $masterLogo = MasterLogo::first()?->name ?? 'ORG'; - // $mainEqptName = Equipment::find($validated['main_eqpt'])?->name ?? $validated['main_eqpt']; - $baseId = $workOrder->id; - - if(count($validated['main_eqpt']) > 1)
Added / After Commit
+ use Carbon\Carbon; + use App\Models\ProductionYear; + use App\Models\RepairClassCode; + use Maatwebsite\Excel\Facades\Excel; + + + class WorkOrderController extends Controller + return view('work-order.index', compact('workOrders')); + } + + public function controlNoUpload() + { + return view('work-order.control-upload'); + } + + public function importControlNumbers(Request $request) + { + $request->validate([
Removed / Before Commit
- 'complaint_date', - 'complaint_time', - 'user_name', - 'user_id', - 'group_id', - 'sub_group_id', - return $this->resolver_name ?: ($this->resolver?->name ?? ''); - } - - public static function getNatureOfComplaintOptions(): array - { - return [
Added / After Commit
+ 'complaint_date', + 'complaint_time', + 'user_name', + 'complaint_name', + 'user_id', + 'group_id', + 'sub_group_id', + return $this->resolver_name ?: ($this->resolver?->name ?? ''); + } + + public function getComplaintNameDisplayAttribute(): string + { + return $this->complaint_name ?: ($this->user_name ?: ''); + } + + public static function getNatureOfComplaintOptions(): array + { + return [
Removed / Before Commit
Added / After Commit
+ <?php + + namespace App\Models; + + use Illuminate\Database\Eloquent\Model; + + class FinanceSalaryRuleMaster extends Model + { + protected $fillable = [ + 'rule_key', + 'rule_value', + 'effective_from', + 'is_active', + 'created_by', + ]; + + protected $casts = [ + 'rule_value' => 'decimal:2',
Removed / Before Commit
- - protected $fillable = [ - 'regime_name', - 'financial_year', - 'description', - 'minimum_income',
Added / After Commit
+ + protected $fillable = [ + 'regime_name', + 'regime_type', + 'financial_year', + 'description', + 'minimum_income',
Removed / Before Commit
- 'route' => 'da', - 'children' => collect(), - ], - ]); - };
Added / After Commit
+ 'route' => 'da', + 'children' => collect(), + ], + (object) [ + 'name' => 'Salary Rules Master', + 'icon' => '<i class="fas fa-sliders-h"></i>', + 'route' => 'salary-rule-master', + 'children' => collect(), + ], + ]); + };
Removed / Before Commit
- - $da = $this->roundAmount($earnedBasic * $daRate / 100); - $hra = $this->calculateHra($basic); - $tpt = $this->calculateTpt($basic); - $risk = $this->manualOrDefault(data_get($finance, 'risk_allowance'), 0); - $cghs = $this->manualOrDefault(data_get($payment, 'cghs'), 0); - $cgegis = $this->manualOrDefault(data_get($payment, 'cgeis'), 0); - $npsBase = $earnedBasic + $da; - $scheme = strtolower((string) data_get($payment, 'gpf_cpf_nps_type', 'nps')); - $isUps = $scheme === 'ups'; - $isContributionScheme = in_array($scheme, ['nps', 'ups'], true); - $individualNpsDefault = $isContributionScheme ? $this->roundAmount($npsBase * $this->ruleValue('nps_individual_percentage', 10) / 100) : 0; - $individualNps = $this->contributionAmount(data_get($payment, 'individual_nps_contribution'), $individualNpsDefault); - $govtContributionPercentage = $isUps ? $this->ruleValue('ups_govt_percentage', 10) : $this->ruleValue('nps_govt_percentage', 14); - $govtContributionDefault = $isContributionScheme ? $this->roundAmount($npsBase * $govtContributionPercentage / 100) : 0; - 'Earned Basic Pay (E-BP)' => $earnedBasic, - 'HRA' => $hra, - 'RISK ALLC' => $risk,
Added / After Commit
+ + $da = $this->roundAmount($earnedBasic * $daRate / 100); + $hra = $this->calculateHra($basic); + $tpt = $this->calculateTpt($staff, $basic); + $risk = $this->manualOrDefault(data_get($finance, 'risk_allowance'), 0); + $cghs = $this->manualOrDefault(data_get($payment, 'cghs'), $this->calculateCghs($level)); + $cgegis = $this->manualOrDefault(data_get($payment, 'cgeis'), $this->calculateCgegis($level)); + $npsBase = $earnedBasic + $da; + $scheme = strtolower((string) data_get($payment, 'gpf_cpf_nps_type', 'nps')); + $isUps = $scheme === 'ups'; + $isContributionScheme = in_array($scheme, ['nps', 'ups'], true); + $individualContributionPercentage = $isUps ? $this->ruleValue('ups_individual_percentage', 10) : $this->ruleValue('nps_individual_percentage', 10); + $individualNpsDefault = $isContributionScheme ? $this->roundAmount($npsBase * $individualContributionPercentage / 100) : 0; + $individualNps = $this->contributionAmount(data_get($payment, 'individual_nps_contribution'), $individualNpsDefault); + $govtContributionPercentage = $isUps ? $this->ruleValue('ups_govt_percentage', 10) : $this->ruleValue('nps_govt_percentage', 14); + $govtContributionDefault = $isContributionScheme ? $this->roundAmount($npsBase * $govtContributionPercentage / 100) : 0; + 'Earned Basic Pay (E-BP)' => $earnedBasic, + 'HRA' => $hra,
Removed / Before Commit
Added / After Commit
+ <?php + + use Illuminate\Database\Migrations\Migration; + use Illuminate\Database\Schema\Blueprint; + use Illuminate\Support\Facades\DB; + use Illuminate\Support\Facades\Schema; + + return new class extends Migration + { + public function up(): void + { + Schema::table('complaints', function (Blueprint $table) { + if (!Schema::hasColumn('complaints', 'complaint_name')) { + $table->string('complaint_name')->nullable()->after('user_name'); + } + }); + + if (Schema::hasColumn('complaints', 'complaint_name')) {
Removed / Before Commit
Added / After Commit
+ <?php + + use Illuminate\Database\Migrations\Migration; + use Illuminate\Database\Schema\Blueprint; + use Illuminate\Support\Facades\DB; + use Illuminate\Support\Facades\Schema; + + return new class extends Migration + { + public function up(): void + { + Schema::create('finance_salary_rule_masters', function (Blueprint $table) { + $table->id(); + $table->string('rule_key'); + $table->decimal('rule_value', 12, 2); + $table->date('effective_from'); + $table->boolean('is_active')->default(false); + $table->unsignedBigInteger('created_by')->nullable();
Removed / Before Commit
Added / After Commit
+ <?php + + use Illuminate\Database\Migrations\Migration; + use Illuminate\Support\Facades\DB; + + return new class extends Migration + { + public function up(): void + { + if (!DB::table('menus')->where('route', 'salary-rule-master')->exists()) { + DB::table('menus')->insert([ + 'name' => 'Salary Rules Master', + 'icon' => '<i class="fas fa-sliders-h"></i>', + 'route' => 'salary-rule-master', + 'parent_id' => null, + 'only_view' => false, + 'created_at' => now(), + 'updated_at' => now(),
Removed / Before Commit
Added / After Commit
+ <?php + + use Illuminate\Database\Migrations\Migration; + use Illuminate\Support\Facades\DB; + + return new class extends Migration + { + public function up(): void + { + if (!DB::table('finance_salary_rule_masters')->where('rule_key', 'da_percentage')->exists()) { + $value = DB::table('da_rates')->where('is_active', 1)->value('percentage') + ?? DB::table('finance_salary_rules')->where('rule_key', 'da_percentage')->value('rule_value') + ?? 58; + + DB::table('finance_salary_rule_masters')->insert([ + 'rule_key' => 'da_percentage', + 'rule_value' => $value, + 'effective_from' => now()->toDateString(),
Removed / Before Commit
Added / After Commit
+ <?php + + use Illuminate\Database\Migrations\Migration; + use Illuminate\Database\Schema\Blueprint; + use Illuminate\Support\Facades\DB; + use Illuminate\Support\Facades\Schema; + + return new class extends Migration + { + public function up(): void + { + if (!Schema::hasColumn('tax_regime_masters', 'regime_type')) { + Schema::table('tax_regime_masters', function (Blueprint $table) { + $table->string('regime_type', 20)->nullable()->after('regime_name'); + }); + } + + DB::table('tax_regime_masters')
Removed / Before Commit
Added / After Commit
+ CREATE TABLE IF NOT EXISTS `finance_salary_rule_masters` ( + `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT, + `rule_key` VARCHAR(255) NOT NULL, + `rule_value` DECIMAL(12,2) NOT NULL, + `effective_from` DATE NOT NULL, + `is_active` TINYINT(1) NOT NULL DEFAULT 0, + `created_by` BIGINT UNSIGNED NULL, + `created_at` TIMESTAMP NULL DEFAULT NULL, + `updated_at` TIMESTAMP NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `finance_salary_rule_masters_rule_key_is_active_index` (`rule_key`, `is_active`), + KEY `finance_salary_rule_masters_created_by_foreign` (`created_by`), + CONSTRAINT `finance_salary_rule_masters_created_by_foreign` + FOREIGN KEY (`created_by`) REFERENCES `users` (`id`) ON DELETE SET NULL + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + + INSERT INTO `finance_salary_rule_masters` + (`rule_key`, `rule_value`, `effective_from`, `is_active`, `created_by`, `created_at`, `updated_at`)
Removed / Before Commit
Added / After Commit
+ ALTER TABLE `tax_regime_masters` + ADD COLUMN `regime_type` VARCHAR(20) NULL AFTER `regime_name`; + + UPDATE `tax_regime_masters` + SET `regime_type` = 'old' + WHERE `regime_type` IS NULL + AND `regime_name` LIKE '%old%'; + + UPDATE `tax_regime_masters` + SET `regime_type` = 'new' + WHERE `regime_type` IS NULL + AND `regime_name` LIKE '%new%';
Removed / Before Commit
- @error('regime_name') <div class="text-danger">{{ $message }}</div> @enderror - </div> - - <!-- Financial Year --> - <div class="col-md-6"> - <label for="financial_year" class="form-label">Financial Year <span class="text-danger">*</span></label>
Added / After Commit
+ @error('regime_name') <div class="text-danger">{{ $message }}</div> @enderror + </div> + + <div class="col-md-6"> + <label for="regime_type" class="form-label">Regime Type <span class="text-danger">*</span></label> + <select id="regime_type" name="regime_type" class="form-control" required> + <option value="">Select Regime Type</option> + <option value="old" {{ old('regime_type', $taxRegime->regime_type ?? '') === 'old' ? 'selected' : '' }}>Old Regime</option> + <option value="new" {{ old('regime_type', $taxRegime->regime_type ?? '') === 'new' ? 'selected' : '' }}>New Regime</option> + </select> + @error('regime_type') <div class="text-danger">{{ $message }}</div> @enderror + </div> + + <!-- Financial Year --> + <div class="col-md-6"> + <label for="financial_year" class="form-label">Financial Year <span class="text-danger">*</span></label>
Removed / Before Commit
- @endforeach - </select> - </div> - <div class="flex-grow-0"> - <label for="is_active" class="form-label">Status</label> - <select name="is_active" id="is_active" class="form-select" onchange="this.form.submit()"> - <thead class="table-light"> - <tr> - <th>Regime Name</th> - <th>Financial Year</th> - <th>Minimum Income</th> - <th>Standard Deduction</th> - @forelse($taxRegimes as $regime) - <tr> - <td>{{ $regime->regime_name }}</td> - <td>{{ $regime->financial_year }}</td> - <td>{{ $regime->minimum_income ? '₹' . number_format($regime->minimum_income, 2) : '-' }}</td> - <td>{{ $regime->standard_deduction ? '₹' . number_format($regime->standard_deduction, 2) : '-' }}</td>
Added / After Commit
+ @endforeach + </select> + </div> + <div class="flex-grow-0"> + <label for="regime_type" class="form-label">Regime Type</label> + <select name="regime_type" id="regime_type" class="form-select" onchange="this.form.submit()"> + <option value="">All Types</option> + <option value="old" {{ request('regime_type') === 'old' ? 'selected' : '' }}>Old Regime</option> + <option value="new" {{ request('regime_type') === 'new' ? 'selected' : '' }}>New Regime</option> + </select> + </div> + <div class="flex-grow-0"> + <label for="is_active" class="form-label">Status</label> + <select name="is_active" id="is_active" class="form-select" onchange="this.form.submit()"> + <thead class="table-light"> + <tr> + <th>Regime Name</th> + <th>Regime Type</th>
Removed / Before Commit
- <i class="fa fa-download me-1"></i> Fetch From SQL Server - </button> - </form> - </div> - </div>
Added / After Commit
+ <i class="fa fa-download me-1"></i> Fetch From SQL Server + </button> + </form> + + <form method="POST" action="{{ route('attendance.raw-punches.sync') }}" class="d-flex gap-2 flex-wrap"> + @csrf + <input type="hidden" name="card_no" value="{{ request('card_no') }}"> + <input type="hidden" name="pay_code" value="{{ request('pay_code') }}"> + <input type="hidden" name="from_date" value="{{ request('from_date') }}"> + <input type="hidden" name="to_date" value="{{ request('to_date') }}"> + <button type="submit" class="btn btn-success"> + <i class="fa fa-refresh me-1"></i> Sync To Attendance + </button> + </form> + </div> + </div>
Removed / Before Commit
- <th>Approval Date & Time</th> - <th>Complaint No</th> - <th>User Name</th> - <th>Nature of Complaint</th> - <th>Group</th> - <th>Sub Group</th> - <th>Actions</th> - </tr> - </thead> - <tbody> - @forelse($complaints as $index => $complaint) - <tr> - <td>{{ $index + 1 }}</td> - <td>{{ $complaint->formatted_complaint_date . ' ' . $complaint->formatted_complaint_time}}</td> - <!-- <td>{{ $complaint->formatted_complaint_time }}</td> --> - <td class="px-3">{{ $complaint->approved_at ? $complaint->approved_at->setTimezone('Asia/Kolkata')->format('d-m-Y h:i A') : '-' }}</td> - <td>{{ $complaint->complaint_number }}</td> - <td>{{ $complaint->user_name }}</td>
Added / After Commit
+ <th>Approval Date & Time</th> + <th>Complaint No</th> + <th>User Name</th> + <th>Complainer Name</th> + <th>Nature of Complaint</th> + <th>Group</th> + <th>Sub Group</th> + <th>Actions</th> + </tr> + </thead> + <tbody id="assignmentTableBody"> + @forelse($complaints as $index => $complaint) + <tr> + <td>{{ ($complaints->firstItem() ?? 0) + $index }}</td> + <td>{{ $complaint->formatted_complaint_date . ' ' . $complaint->formatted_complaint_time}}</td> + <!-- <td>{{ $complaint->formatted_complaint_time }}</td> --> + <td class="px-3">{{ $complaint->approved_at ? $complaint->approved_at->setTimezone('Asia/Kolkata')->format('d-m-Y h:i A') : '-' }}</td> + <td>{{ $complaint->complaint_number }}</td>
Removed / Before Commit
- <div class="row"> - <div class="field"> - <label>Complaint Lodge By:</label> - <span class="field-value">{{ $complaint->user_name ?? '' }}</span> - </div> - <div class="field">
Added / After Commit
+ <div class="row"> + <div class="field"> + <label>Complaint Lodge By:</label> + <span class="field-value">{{ $complaint->complaint_name_display ?? '' }}</span> + </div> + <div class="field"> + <label>User Name:</label> + <span class="field-value">{{ $complaint->user_name ?? '' }}</span> + </div> + <div class="field">
Removed / Before Commit
- - - <!-- Complaint Table --> - <div class="table-responsive" style="overflow-x: auto; max-height: 70vh; overflow-y: auto;"> - <table class="table table-striped table-hover table-bordered sticky-header" id="complaintTable" style="min-width: 2200px;"> - <thead> - <tr> - <th>Resolver Status</th> - <th>Admin Status</th> - <th>User Name</th> - <th>Location</th> - <th>Complainer Status Date</th> - <th>Fault Diagnosis</th> - </thead> - <tbody id="complaintTableBody"> - <tr> - <td colspan="21" class="text-center text-muted py-5"> - <i class="fas fa-filter fa-3x mb-3"></i>
Added / After Commit
+ + + <!-- Complaint Table --> + <div class="table-responsive" style="overflow-x: auto;"> + <table class="table table-striped table-hover table-bordered sticky-header" id="complaintTable" style="min-width: 2200px;"> + <thead> + <tr> + <th>Resolver Status</th> + <th>Admin Status</th> + <th>User Name</th> + <th>Complainer Name</th> + <th>Location</th> + <th>Complainer Status Date</th> + <th>Fault Diagnosis</th> + </thead> + <tbody id="complaintTableBody"> + <tr> + <td colspan="22" class="text-center text-muted py-5">
Removed / Before Commit
- <input type="text" id="user_name" name="user_name" class="form-control" value="{{ Auth::user()->name ?? 'Anonymous User' }}" readonly> - </div> - - <div class="col-md-6 mb-3"> - <label for="nature_of_complaint_id" class="form-label">Nature of Complaint <span class="text-danger">*</span></label> - <select id="nature_of_complaint_id" name="nature_of_complaint_id" class="form-select @error('nature_of_complaint_id') is-invalid @enderror" required> - var nature = $('#nature_of_complaint_id').val(); - var group = $('#group_id').val(); - var location = $('#location').val(); - - if (!group) { - e.preventDefault();
Added / After Commit
+ <input type="text" id="user_name" name="user_name" class="form-control" value="{{ Auth::user()->name ?? 'Anonymous User' }}" readonly> + </div> + + <div class="col-md-4 mb-3"> + <label for="complaint_name" class="form-label">Complainer Name <span class="text-danger">*</span></label> + <input type="text" id="complaint_name" name="complaint_name" class="form-control @error('complaint_name') is-invalid @enderror" placeholder="Complainer name" value="{{ old('complaint_name', Auth::user()->name ?? '') }}" required> + @error('complaint_name') + <div class="invalid-feedback d-block">{{ $message }}</div> + @enderror + </div> + + <div class="col-md-6 mb-3"> + <label for="nature_of_complaint_id" class="form-label">Nature of Complaint <span class="text-danger">*</span></label> + <select id="nature_of_complaint_id" name="nature_of_complaint_id" class="form-select @error('nature_of_complaint_id') is-invalid @enderror" required> + var nature = $('#nature_of_complaint_id').val(); + var group = $('#group_id').val(); + var location = $('#location').val(); + var complaintName = $('#complaint_name').val();
Removed / Before Commit
- <th>Complaint Time</th> - <th>Complaint No.</th> - <th>User Name</th> - <th>Nature of Complaint</th> - <th>Location</th> - <th>Group</th> - <tbody> - @forelse($complaints as $index => $complaint) - <tr> - <td>{{ $index + 1 }}</td> - <td>{{ $complaint->formatted_complaint_date }}</td> - <td>{{ $complaint->formatted_complaint_time }}</td> - <td>{{$complaint->complaint_number}}</td> - <td>{{ $complaint->user_name }}</td> - <td> - {{-- Debug: Show what's actually loaded --}} - @if($complaint->nature_of_complaint) - </tr>
Added / After Commit
+ <th>Complaint Time</th> + <th>Complaint No.</th> + <th>User Name</th> + <th>Complainer Name</th> + <th>Nature of Complaint</th> + <th>Location</th> + <th>Group</th> + <tbody> + @forelse($complaints as $index => $complaint) + <tr> + <td>{{ ($complaints->firstItem() ?? 0) + $index }}</td> + <td>{{ $complaint->formatted_complaint_date }}</td> + <td>{{ $complaint->formatted_complaint_time }}</td> + <td>{{$complaint->complaint_number}}</td> + <td>{{ $complaint->user_name }}</td> + <td>{{ $complaint->complaint_name_display }}</td> + <td> + {{-- Debug: Show what's actually loaded --}}
Removed / Before Commit
- </div> - </form> - - <div class="table-responsive"> - <table class="table table-bordered table-striped align-middle"> - <thead class="table-primary"> - <tr> - <th>S No</th> - <th>Sus</th> - <th>WCN No</th> - <th>WCN Date</th> - </tr> - </thead> - <tbody> - @forelse($rows as $index => $equipment) - @php - $workOrder = $equipment->workOrder; - $unit = $workOrder?->workUnit;
Added / After Commit
+ </div> + </form> + + <style> + .equipment-date-report-scroll { + max-height: 68vh; + overflow: auto; + border: 1px solid #dee2e6; + } + + .equipment-date-report-table { + min-width: 1850px; + margin-bottom: 0; + font-size: 12px; + } + + .equipment-date-report-table th, + .equipment-date-report-table td {
Removed / Before Commit
- <th>Sus</th> - <th>WCN No</th> - <th>WCN Date</th> - </tr> - </thead> - <tbody> - @foreach($rows as $index => $equipment) - @php - $workOrder = $equipment->workOrder; - $unit = $workOrder?->workUnit; - @endphp - <tr> - <td>{{ $index + 1 }}</td> - <td>{{ $equipment->sus ?? '-' }}</td> - <td>{{ $equipment->wcn_number ?? '-' }}</td> - <td>{{ $equipment->wcn_date ?? '-' }}</td> - </tr> - @endforeach
Added / After Commit
+ <th>Sus</th> + <th>WCN No</th> + <th>WCN Date</th> + <th>Gatepass No</th> + <th>Collection Date</th> + </tr> + </thead> + <tbody> + @foreach($rows as $index => $equipment) + @php + $workOrder = $equipment->workOrder; + $unit = $workOrder?->workUnit; + $gatePass = $equipment->gatePasses?->sortByDesc('gate_pass_date')->first(); + $gatePassNo = $gatePass?->gate_pass_no ?: ($gatePass ? str_pad($gatePass->id, 5, '0', STR_PAD_LEFT) : '-'); + @endphp + <tr> + <td>{{ $index + 1 }}</td> + <td>{{ $equipment->sus ?? '-' }}</td>
Removed / Before Commit
Added / After Commit
+ @extends('layouts.app') + + @section('content') + @php + $categoryOrder = ['DA', 'HRA', 'CGHS', 'CGEGIS', 'DA TPT', 'NPS', 'UPS', 'TPT']; + $groupedOptions = collect($ruleOptions)->groupBy('category', preserveKeys: true); + $groupedRules = collect($rules)->groupBy(fn ($items, $key) => $ruleOptions[$key]['category'] ?? 'Other'); + $oldTaxRegimes = collect($taxRegimes ?? [])->filter(fn ($regime) => ($regime->regime_type ?? null) === 'old'); + $newTaxRegimes = collect($taxRegimes ?? [])->filter(fn ($regime) => ($regime->regime_type ?? null) === 'new'); + @endphp + + <div class="container-fluid"> + <h4 class="mb-4">Salary Rules Master</h4> + + @if(session('success')) + <div class="alert alert-success">{{ session('success') }}</div> + @endif +
Removed / Before Commit
- @csrf - @method('PUT') - - <div class="d-flex justify-content-end mb-3"> - <button type="submit" class="btn btn-primary"> - <i class="fa fa-save"></i> Save Finance Details - </button> - </div> - - <div class="card mb-4"> - <div class="card-header bg-light"> - <h5 class="mb-0">Finance Editable Fields</h5> - </div> - </div> - - <div class="card mb-4"> - <div class="card-header bg-light"> - <h5 class="mb-0">Bank Details</h5>
Added / After Commit
+ @csrf + @method('PUT') + + <div class="card mb-4"> + <div class="card-header bg-light"> + <h5 class="mb-0">Finance Editable Fields</h5> + </div> + </div> + + {{-- + <div class="card mb-4"> + <div class="card-header bg-light"> + <h5 class="mb-0">Bank Details</h5> + </div> + </div> + </div> + --}} +
Removed / Before Commit
Added / After Commit
+ @extends('layouts.app') + + @section('content') + <div class="card"> + <div class="card-header py-3"> + <h4 class="mb-0"><b>Import Work Order Control Numbers</b></h4> + </div> + + <div class="card-body"> + @if(session('success')) + <div class="alert alert-success">{{ session('success') }}</div> + @endif + + @if(session('error')) + <div class="alert alert-danger">{{ session('error') }}</div> + @endif + + @if($errors->any())
Removed / Before Commit
- }); - } - - // Remove block - $(document).on('click', '.removeEqptBtn', function () { - $(this).closest('.main-eqpt-block').remove(); - - assySelect.empty(); - - $.each(data, function (id, name) { - assySelect.append(`<option value="${id}">${name}</option>`); - }); - assySelect.prop('disabled', false);
Added / After Commit
+ }); + } + + function sortedAssyEntries(data) { + const rank = (name) => { + const value = String(name || '').trim(); + + if (/^[A-Z]/.test(value)) return 0; + if (/^[a-z]/.test(value)) return 1; + if (/^\d/.test(value)) return 2; + + return 3; + }; + + return Object.entries(data || {}).sort(([, firstName], [, secondName]) => { + const firstRank = rank(firstName); + const secondRank = rank(secondName); +
Removed / Before Commit
- }); - } - - // Remove block - $(document).on('click', '.removeEqptBtn', function () { - $(this).closest('.main-eqpt-block').remove(); - - $.get(`/get-subassy/${equipmentId}`, function (data) { - let options = ''; - $.each(data, function (id, name) { - options += `<option value="${id}">${name}</option>`; - }); - assySelect.html(options).trigger('change');
Added / After Commit
+ }); + } + + function sortedAssyEntries(data) { + const rank = (name) => { + const value = String(name || '').trim(); + + if (/^[A-Z]/.test(value)) return 0; + if (/^[a-z]/.test(value)) return 1; + if (/^\d/.test(value)) return 2; + + return 3; + }; + + return Object.entries(data || {}).sort(([, firstName], [, secondName]) => { + const firstRank = rank(firstName); + const secondRank = rank(secondName); +
Removed / Before Commit
- const selectedAssy = @json($selectedAssyIds ?? []); - let options = '<option value="">Select ASSY</option>'; - - $.each(data, function (id, name) - { - const match = selectedAssy.find(item => item.eqpt_id == id); - console.log(match); - const selected = match ? 'selected' : ''; - } - }); - - // $('#assySelect').on('change', function () { - // const selected = $(this).val(); - // const assyQtyDiv = $('#assyQtyFields');
Added / After Commit
+ const selectedAssy = @json($selectedAssyIds ?? []); + let options = '<option value="">Select ASSY</option>'; + + sortedAssyEntries(data).forEach(([id, name]) => { + const match = selectedAssy.find(item => item.eqpt_id == id); + console.log(match); + const selected = match ? 'selected' : ''; + } + }); + + function sortedAssyEntries(data) { + const rank = (name) => { + const value = String(name || '').trim(); + + if (/^[A-Z]/.test(value)) return 0; + if (/^[a-z]/.test(value)) return 1; + if (/^\d/.test(value)) return 2; +
Removed / Before Commit
- use App\Http\Controllers\CrcReportController; - use App\Http\Controllers\CodControlController; - use App\Http\Controllers\DaController; - use App\Http\Controllers\PayMatrixController; - use App\Http\Controllers\SalaryLevelController; - - Route::delete('/cos/delete/{id}', [CoController::class, 'destroy']); - Route::post('/cos/import', [CoController::class, 'import'])->name('cos.import'); - Route::get('work-orders', [WorkOrderController::class, 'index'])->name('work-orders.listing'); - Route::get('work-orders/create', [WorkOrderController::class,'create']) - ->name('work-orders.create'); - Route::get('/check-unit-wo-no', [WorkOrderController::class,'checkUnitWoNo']); - Route::delete('attendance/{id}', [AttendanceController::class, 'destroy'])->name('attendance.destroy'); - Route::get('attendance-raw-punches', [AttendanceRawPunchController::class, 'index'])->name('attendance.raw-punches.index'); - Route::post('attendance-raw-punches/fetch', [AttendanceRawPunchController::class, 'fetch'])->name('attendance.raw-punches.fetch'); - Route::get('finance-staff-details', [FinanceStaffDetailsController::class, 'index'])->name('finance-staff-details.index'); - Route::get('finance-staff-details/{staff}/edit', [FinanceStaffDetailsController::class, 'edit'])->name('finance-staff-details.edit'); - Route::put('finance-staff-details/{staff}', [FinanceStaffDetailsController::class, 'update'])->name('finance-staff-details.update');
Added / After Commit
+ use App\Http\Controllers\CrcReportController; + use App\Http\Controllers\CodControlController; + use App\Http\Controllers\DaController; + use App\Http\Controllers\FinanceSalaryRuleMasterController; + use App\Http\Controllers\PayMatrixController; + use App\Http\Controllers\SalaryLevelController; + + Route::delete('/cos/delete/{id}', [CoController::class, 'destroy']); + Route::post('/cos/import', [CoController::class, 'import'])->name('cos.import'); + Route::get('work-orders', [WorkOrderController::class, 'index'])->name('work-orders.listing'); + Route::get('work-orders/control-upload', [WorkOrderController::class, 'controlNoUpload'])->name('work-orders.control-upload'); + Route::post('work-orders/control-upload', [WorkOrderController::class, 'importControlNumbers'])->name('work-orders.control-upload.import'); + Route::get('work-orders/create', [WorkOrderController::class,'create']) + ->name('work-orders.create'); + Route::get('/check-unit-wo-no', [WorkOrderController::class,'checkUnitWoNo']); + Route::delete('attendance/{id}', [AttendanceController::class, 'destroy'])->name('attendance.destroy'); + Route::get('attendance-raw-punches', [AttendanceRawPunchController::class, 'index'])->name('attendance.raw-punches.index'); + Route::post('attendance-raw-punches/fetch', [AttendanceRawPunchController::class, 'fetch'])->name('attendance.raw-punches.fetch');