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 · bbb30d60
The commit introduces multiple code additions including PDF export functionality, filtering and pagination for finance salary summaries, and improvements in demand handling with validations and conditional queries. The changes mostly follow good practices with clear separation of concerns, usage of Laravel validation, and efficient eager loading of relationships. However, the commit message is not descriptive and the change introduces some minor risks related to handling unvalidated user input in export functions and some potential code duplication in the SparesExport instantiation.
Quality
?
80%
Security
?
85%
Business Value
?
75%
Maintainability
?
85%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Too Generic
Where
commit message
Issue / Evidence
too generic
Suggested Fix
provide a detailed commit message describing the purpose and impact of changes to improve business value and reviewability
Duplicate Logic
Where
app/Http/Controllers/APDemandController.php:223
Issue / Evidence
duplication
Suggested Fix
instantiate SparesExport once instead of twice for headings and rows to improve quality and performance
Missing Validation
Where
app/Http/Controllers/APDemandController.php:216-229
Issue / Evidence
validation missing
Suggested Fix
validate masterId input before database queries to reduce bug risk especially on exportPdf method
Improve Error Handling
Where
app/Http/Controllers/DemandController.php:73-81
Issue / Evidence
improve error handling
Suggested Fix
consider returning more detailed HTTP status codes for failed demand lookups to improve API robustness and client experience
Missing Validation
Where
app/Http/Controllers/FinanceMonthlyPaySummaryController.php:50-53
Issue / Evidence
validation covered but consider adding explicit error messages for client side clarity to improve usability and business value
Suggested Fix
Review and simplify this section.
Code Change Preview · app/Exports/SparesExport.php
?
Removed / Before Commit
- 'd.cod_control_no', - 'd.cod_control_date', - 'd.iil_no', - 'd.cvil_no' - ) - ->leftJoin('ap_demands as d', function($join){ - $join->on('d.item_id', '=', 's.id') - 'COD Control No', - 'COD Control Date', - 'IIL No', - 'CVIL No', - ]; - } - }
Added / After Commit
+ 'd.cod_control_no', + 'd.cod_control_date', + 'd.iil_no', + 'd.iil_date', + 'd.cvil_no', + 'd.cvil_date' + ) + ->leftJoin('ap_demands as d', function($join){ + $join->on('d.item_id', '=', 's.id') + 'COD Control No', + 'COD Control Date', + 'IIL No', + 'IIL Date', + 'CVIL No', + 'CVIL Date', + ]; + } + }
Removed / Before Commit
- use Illuminate\Support\Facades\Schema; - use App\Exports\SparesExport; - use App\Imports\SparesImport; - use Maatwebsite\Excel\Facades\Excel; - - - DB::table('ap_demands')->insert($apData); - } - - return redirect('apdemands.preview?id=' . $master->id); - } - - public function preview(Request $request) - if ($request->filled('cos_sec')) { - $query->where('s.cos_sec', $request->cos_sec); - } - if ($request->filled('cat_part_no')) { - $query->where('s.cat_part_no', 'like', '%' . $request->cat_part_no . '%');
Added / After Commit
+ use Illuminate\Support\Facades\Schema; + use App\Exports\SparesExport; + use App\Imports\SparesImport; + use Barryvdh\DomPDF\Facade\Pdf; + use Maatwebsite\Excel\Facades\Excel; + + + DB::table('ap_demands')->insert($apData); + } + + return redirect()->route('apdemands.preview', ['id' => $master->id]); + } + + public function preview(Request $request) + if ($request->filled('cos_sec')) { + $query->where('s.cos_sec', $request->cos_sec); + } + if ($request->filled('os_ser_no')) {
Removed / Before Commit
- return response()->json(['success' => false, 'message' => 'Field not allowed']); - } - - McoDemand::where('id', $request->id)->update([ - $request->field => $request->value - ]); - - return response()->json(['success' => true]); - } - - } -
Added / After Commit
+ return response()->json(['success' => false, 'message' => 'Field not allowed']); + } + + $demand = McoDemand::where('id', $request->id) + ->where('is_cancelled', false) + ->first(); + + if (!$demand) { + return response()->json(['success' => false, 'message' => 'Demand not found or cancelled']); + } + + $demand->update([ + $request->field => $request->value + ]); + + return response()->json(['success' => true]); + } +
Removed / Before Commit
Added / After Commit
+ <?php + + namespace App\Http\Controllers; + + use App\Models\FinanceSalarySnapshot; + use Illuminate\Http\Request; + use Illuminate\Pagination\LengthAwarePaginator; + + class FinanceMonthlyPaySummaryController extends Controller + { + public function index(Request $request) + { + $filters = $this->filters($request); + $rows = $this->paginatedRows($request, $filters['month'], $filters['year']); + $pageRows = $rows->getCollection(); + + return view('finance-monthly-pay-summary.index', [ + 'rows' => $rows,
Removed / Before Commit
Added / After Commit
+ <?php + + namespace App\Http\Controllers; + + use App\Models\FinanceSalarySnapshot; + use Illuminate\Http\Request; + + class FinanceMonthlyStatusController extends Controller + { + public function index(Request $request) + { + $filters = $this->filters($request); + $rows = $this->rows($filters['month'], $filters['year'], $filters['type']); + + return view('finance-monthly-status.index', [ + 'rows' => $rows, + 'totals' => $this->totals($rows), + 'month' => $filters['month'],
Removed / Before Commit
Added / After Commit
+ <?php + + namespace App\Http\Controllers; + + use App\Models\FinanceStaffDetail; + use App\Models\FinanceStaffTax; + use Illuminate\Http\Request; + + class FinanceMonthlyTaxReportController extends Controller + { + public function index(Request $request) + { + $filters = $this->filters($request); + $rows = $this->rows($filters['month'], $filters['year'], $filters['cr_no']); + + return view('finance-monthly-tax-report.index', [ + 'rows' => $rows, + 'groups' => $rows->groupBy('cr_no'),
Removed / Before Commit
- ]; - } - - private function paymentRecoveryRules(): array - { - $rules = [];
Added / After Commit
+ ]; + } + + public function readonlyDataForTax(Staff $staff): array + { + return $this->readonlyData($staff); + } + + private function paymentRecoveryRules(): array + { + $rules = [];
Removed / Before Commit
Added / After Commit
+ <?php + + namespace App\Http\Controllers; + + use App\Models\FinanceSalarySnapshot; + use App\Models\FinanceStaffTax; + use App\Models\Staff; + use Illuminate\Http\Request; + + class FinanceStaffTaxController extends Controller + { + public function edit(Request $request, Staff $staff) + { + $financialYear = $request->input('financial_year', $this->currentFinancialYear()); + [$fyStartYear, $fyEndYear] = $this->financialYearParts($financialYear); + + $staff->load(['employeeCategory', 'designation', 'user.group', 'financeDetail']); + $tax = FinanceStaffTax::where('staff_id', $staff->id)
Removed / Before Commit
- }) - ->whereNotNull('mco_demands.mco_demand_no') - ->where('mco_demands.prod_year', $prod_year) - ->groupBy('mco_demands.mco_demand_no') - ->orderBy('mco_demands.mco_demand_no'); - - */ - $demands = McoDemand::where('mco_demand_no', $demand_no_decrypted) - ->where('prod_year', $prod_year_decrypted) - ->paginate(10); - - - $receiveSums = DB::table('receiving') - ->select( - 'mco_id', - DB::raw('SUM(qty_received) as total_qty_receive') - ) - ->whereIn('mco_id', $keys->pluck('mco_id')) // only mco_id check
Added / After Commit
+ }) + ->whereNotNull('mco_demands.mco_demand_no') + ->where('mco_demands.prod_year', $prod_year) + ->where('mco_demands.is_cancelled', false) + ->groupBy('mco_demands.mco_demand_no') + ->orderBy('mco_demands.mco_demand_no'); + + */ + $demands = McoDemand::where('mco_demand_no', $demand_no_decrypted) + ->where('prod_year', $prod_year_decrypted) + ->where('is_cancelled', false) + ->paginate(10); + + + $receiveSums = DB::table('receiving') + ->select( + 'mco_id', + DB::raw('SUM(qty_received) as total_qty_receive'),
Removed / Before Commit
- | Main Listing Query - |-------------------------------------------------------------------------- - */ - $query = Receive::query(); - - if ($selectedYear) { - $query->where('prod_year', $selectedYear); - |-------------------------------------------------------------------------- - | Same filters apply so dropdowns stay dependent - */ - $filterQuery = Receive::query(); - - if ($selectedYear) { - $filterQuery->where('prod_year', $selectedYear); - // Show spares for a regn_no - public function show($regn_no,$prod_year) - { - $spares = Receive::where('voucher_no', decrypt($regn_no))->where('prod_year', decrypt($prod_year))->get();
Added / After Commit
+ | Main Listing Query + |-------------------------------------------------------------------------- + */ + $query = $this->activeReceiveQuery(); + + if ($selectedYear) { + $query->where('prod_year', $selectedYear); + |-------------------------------------------------------------------------- + | Same filters apply so dropdowns stay dependent + */ + $filterQuery = $this->activeReceiveQuery(); + + if ($selectedYear) { + $filterQuery->where('prod_year', $selectedYear); + // Show spares for a regn_no + public function show($regn_no,$prod_year) + { + $spares = $this->activeReceiveQuery()
Removed / Before Commit
- DB::raw('ANY_VALUE(prod_year) as prod_year') - ) - ->where('status', 'approved') - - // submission me year match - ->whereIn(DB::raw("(req_no, prod_year)"), function ($q) { - |-------------------------------------------------------------------------- - */ - $dropdownBase = McoDemand::where('status','approved') - - ->whereIn(DB::raw("(req_no, prod_year)"), function ($q) { - $q->selectRaw("req_no, prod_year") - where('job_no', $job_no) - ->where('req_no', $req_no) - ->where('prod_year', $prod_year) - ->get(); - - return view('mco_admin.approvals.details', compact('demands', 'req_no', 'job_no','prod_year','alreadySubmitted'));
Added / After Commit
+ DB::raw('ANY_VALUE(prod_year) as prod_year') + ) + ->where('status', 'approved') + ->where('is_cancelled', false) + + // submission me year match + ->whereIn(DB::raw("(req_no, prod_year)"), function ($q) { + |-------------------------------------------------------------------------- + */ + $dropdownBase = McoDemand::where('status','approved') + ->where('is_cancelled', false) + + ->whereIn(DB::raw("(req_no, prod_year)"), function ($q) { + $q->selectRaw("req_no, prod_year") + where('job_no', $job_no) + ->where('req_no', $req_no) + ->where('prod_year', $prod_year) + ->where('is_cancelled', false)
Removed / Before Commit
- ->get(); - - $regNos = McoDemand::select('registation_no') - ->whereNotNull('registation_no') - ->where('registation_no', '!=', '') - ->distinct() - ->orderBy('registation_no') - ->pluck('registation_no'); - - $productionYears = McoDemand::select('prod_year') - ->whereNotNull('prod_year') - ->where('prod_year', '!=', '') - ->distinct() - ->orderByDesc('prod_year') - ->pluck('prod_year'); - - $groupReqNos = McoDemand::select('req_no', DB::raw('MAX(created_at) as created_at')) - ->whereNotNull('req_no')
Added / After Commit
+ ->get(); + + $regNos = McoDemand::select('registation_no') + ->where('is_cancelled', false) + ->whereNotNull('registation_no') + ->where('registation_no', '!=', '') + ->distinct() + ->orderBy('registation_no') + ->pluck('registation_no'); + + $productionYears = McoDemand::select('prod_year') + ->where('is_cancelled', false) + ->whereNotNull('prod_year') + ->where('prod_year', '!=', '') + ->distinct() + ->orderByDesc('prod_year') + ->pluck('prod_year'); +
Removed / Before Commit
- $allEquipments = WorkEquipment::whereNull('wcn_number') - ->whereHas('workOrder', function ($query) { - $query->whereNotNull('job_no') - ->where('job_no', '!=', '') - ->whereNotNull('control_no') - ->where('control_no', '!=', ''); - }) - ->whereHas('repairClass', function ($q) { - $q->where('name', 'CL A'); - public function otherindex(Request $request) - { - $user = auth()->user(); - - /** - * 🔐 Common group condition (reuse everywhere) - */ - $applyGroupCondition = function ($query) use ($user) { - if (!is_null($user->role)) {
Added / After Commit
+ $allEquipments = WorkEquipment::whereNull('wcn_number') + ->whereHas('workOrder', function ($query) { + $query->whereNotNull('job_no') + ->where('job_no', '!=', ''); + }) + ->whereHas('repairClass', function ($q) { + $q->where('name', 'CL A'); + public function otherindex(Request $request) + { + $user = auth()->user(); + $username = strtolower((string) ($user->username ?? $user->name ?? '')); + $isSuperAdmin = empty($user->role) && in_array($username, ['admin', 'superadmin'], true); + + /** + * 🔐 Common group condition (reuse everywhere) + */ + $applyGroupCondition = function ($query) use ($user, $isSuperAdmin) { + if (!$isSuperAdmin && $user->group_id) {
Removed / Before Commit
- namespace App\Imports; - - use App\Models\APDemand; - use Illuminate\Support\Facades\DB; - use Maatwebsite\Excel\Concerns\ToModel; - use Maatwebsite\Excel\Concerns\WithHeadingRow; - use Illuminate\Support\Str; - - class SparesImport implements ToModel, WithHeadingRow - { - } - - // केवल Excel में value वाले fields update करें - foreach ([ - 'ap_demand_no', - 'ap_demand_date', - 'oss_stock', - 'cod_control_no',
Added / After Commit
+ namespace App\Imports; + + use App\Models\APDemand; + use Carbon\Carbon; + use Illuminate\Support\Facades\DB; + use Maatwebsite\Excel\Concerns\ToModel; + use Maatwebsite\Excel\Concerns\WithHeadingRow; + use Illuminate\Support\Str; + use PhpOffice\PhpSpreadsheet\Shared\Date as ExcelDate; + + class SparesImport implements ToModel, WithHeadingRow + { + } + + // केवल Excel में value वाले fields update करें + $dateFields = [ + 'ap_demand_date', + 'cod_control_date',
Removed / Before Commit
Added / After Commit
+ <?php + + namespace App\Models; + + use Illuminate\Database\Eloquent\Factories\HasFactory; + use Illuminate\Database\Eloquent\Model; + + class FinanceStaffTax extends Model + { + use HasFactory; + + protected $fillable = [ + 'staff_id', + 'financial_year', + 'month', + 'year', + 'salary_till_date_json', + 'salary_total_json',
Removed / Before Commit
- 'mco_demand_no', - 'status', - 'registation_no', - ]; - - public function workEquipment()
Added / After Commit
+ 'mco_demand_no', + 'status', + 'registation_no', + 'is_cancelled', + 'cancel_remark', + 'cancelled_by', + 'cancelled_at', + ]; + + protected $casts = [ + 'is_cancelled' => 'boolean', + 'cancelled_at' => 'datetime', + ]; + + public function workEquipment()
Removed / Before Commit
- return $this->hasMany(FinanceSalarySnapshot::class, 'employee_id'); - } - - }
Added / After Commit
+ return $this->hasMany(FinanceSalarySnapshot::class, 'employee_id'); + } + + public function financeStaffTaxes() + { + return $this->hasMany(FinanceStaffTax::class, 'staff_id'); + } + + }
Removed / Before Commit
Added / After Commit
+ <?php + + use Illuminate\Database\Migrations\Migration; + use Illuminate\Database\Schema\Blueprint; + use Illuminate\Support\Facades\Schema; + + return new class extends Migration + { + public function up(): void + { + Schema::create('finance_staff_taxes', function (Blueprint $table) { + $table->id(); + $table->foreignId('staff_id')->constrained('staff')->cascadeOnDelete(); + $table->string('financial_year', 20); + $table->unsignedTinyInteger('month')->nullable(); + $table->unsignedSmallInteger('year')->nullable(); + $table->json('salary_till_date_json')->nullable(); + $table->json('salary_total_json')->nullable();
Removed / Before Commit
Added / After Commit
+ <?php + + use Illuminate\Database\Migrations\Migration; + use Illuminate\Database\Schema\Blueprint; + use Illuminate\Support\Facades\Schema; + + return new class extends Migration + { + public function up(): void + { + Schema::table('ap_demands', function (Blueprint $table) { + if (!Schema::hasColumn('ap_demands', 'iil_date')) { + $table->date('iil_date')->nullable()->after('iil_no'); + } + + if (!Schema::hasColumn('ap_demands', 'cvil_date')) { + $table->date('cvil_date')->nullable()->after('cvil_no'); + }
Removed / Before Commit
Added / After Commit
+ <?php + + use Illuminate\Database\Migrations\Migration; + use Illuminate\Database\Schema\Blueprint; + use Illuminate\Support\Facades\Schema; + + return new class extends Migration + { + public function up(): void + { + Schema::table('mco_demands', function (Blueprint $table) { + if (!Schema::hasColumn('mco_demands', 'is_cancelled')) { + $table->boolean('is_cancelled')->default(false)->after('status'); + } + + if (!Schema::hasColumn('mco_demands', 'cancel_remark')) { + $table->text('cancel_remark')->nullable()->after('is_cancelled'); + }
Removed / Before Commit
Added / After Commit
+ ALTER TABLE `ap_demands` + ADD COLUMN IF NOT EXISTS `iil_date` date NULL AFTER `iil_no`, + ADD COLUMN IF NOT EXISTS `cvil_date` date NULL AFTER `cvil_no`;
Removed / Before Commit
Added / After Commit
+ -- Monthly tax report source query for phpMyAdmin/MySQL. + -- Change these values before running. + SET @month = 5; + SET @year = 2026; + SET @financial_year = '2026-2027'; + SET @cr_no = 'all'; -- use 'all' for every CR No, or use a value like '1' + + SELECT + COALESCE(fsd.cr_no, 'NO CR') AS cr_no, + s.employee_number AS emp_no, + CONCAT(COALESCE(d.name, ''), CASE WHEN d.name IS NULL THEN '' ELSE ' ' END, s.name) AS name, + COALESCE(JSON_UNQUOTE(JSON_EXTRACT(fst.tax_details_json, '$.gross')), 0) AS tot_gross, + COALESCE(JSON_UNQUOTE(JSON_EXTRACT(fst.savings_json, '$.tot_rent')), 0) AS hra_exemp, + COALESCE(JSON_UNQUOTE(JSON_EXTRACT(fst.savings_json, '$.sec24')), 0) AS sec24, + COALESCE(JSON_UNQUOTE(JSON_EXTRACT(fst.savings_json, '$.sec80u')), 0) AS sec80u, + COALESCE(JSON_UNQUOTE(JSON_EXTRACT(fst.tax_details_json, '$.ded_under_sec10')), 0) AS ded_under_sec10, + COALESCE(JSON_UNQUOTE(JSON_EXTRACT(fst.savings_json, '$.sec80d_claim')), 0) AS sec80d_claim, + COALESCE(JSON_UNQUOTE(JSON_EXTRACT(fst.savings_json, '$.sec80d')), 0) AS sec80d,
Removed / Before Commit
Added / After Commit
+ CREATE TABLE `finance_staff_taxes` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `staff_id` bigint unsigned NOT NULL, + `financial_year` varchar(20) NOT NULL, + `month` tinyint unsigned DEFAULT NULL, + `year` smallint unsigned DEFAULT NULL, + `salary_till_date_json` json DEFAULT NULL, + `salary_total_json` json DEFAULT NULL, + `approx_salary_json` json DEFAULT NULL, + `savings_json` json DEFAULT NULL, + `tax_details_json` json DEFAULT NULL, + `old_slabs_json` json DEFAULT NULL, + `new_slabs_json` json DEFAULT NULL, + `old_regime_tax` decimal(14,2) NOT NULL DEFAULT '0.00', + `new_regime_tax` decimal(14,2) NOT NULL DEFAULT '0.00', + `old_monthly_tax` decimal(14,2) NOT NULL DEFAULT '0.00', + `new_monthly_tax` decimal(14,2) NOT NULL DEFAULT '0.00', + `created_by` bigint unsigned DEFAULT NULL,
Removed / Before Commit
Added / After Commit
+ <!doctype html> + <html> + <head> + <meta charset="utf-8"> + <style> + body { font-family: DejaVu Sans, sans-serif; font-size: 7px; color: #000; } + h3 { margin: 0 0 6px; text-align: center; } + table { width: 100%; border-collapse: collapse; } + th, td { border: 1px solid #000; padding: 2px; vertical-align: top; } + th { font-weight: bold; text-align: center; } + </style> + </head> + <body> + <h3>AP Demand - {{ $master->equipment->name ?? '' }} / {{ $master->prod_year }}</h3> + <table> + <thead> + <tr> + @foreach($headings as $heading)
Removed / Before Commit
- - <div class="d-flex gap-2"> - <a href="{{ route('apdemands.export', $master->id) }}" class="btn btn-success">Export Excel</a> - - <form id="importForm" action="{{ route('apdemands.import', $master->id) }}" method="POST" enctype="multipart/form-data" style="display:inline;"> - @csrf - @endforeach - </select> - </div> - <div class="col-md-3"> - <label>Cat/Part No</label> - <select name="cat_part_no" class="form-control select2 auto-submit">
Added / After Commit
+ + <div class="d-flex gap-2"> + <a href="{{ route('apdemands.export', $master->id) }}" class="btn btn-success">Export Excel</a> + <a href="{{ route('apdemands.export-pdf', $master->id) }}" class="btn btn-danger">Export PDF</a> + + <form id="importForm" action="{{ route('apdemands.import', $master->id) }}" method="POST" enctype="multipart/form-data" style="display:inline;"> + @csrf + @endforeach + </select> + </div> + <div class="col-md-3"> + <label>OS Ser No</label> + <select name="os_ser_no" class="form-control select2 auto-submit"> + <option value="">-- All --</option> + @foreach($osSerNos as $osSerNo) + <option value="{{ $osSerNo }}" {{ request('os_ser_no') == $osSerNo ? 'selected' : '' }}>{{ $osSerNo }}</option> + @endforeach + </select>
Removed / Before Commit
- </div> - <div class="col-md-7"> - <form method="GET" class="mb-1" id="filterForm"> - <div class="row align-items-end"> - {{-- Control Number --}} - <div class="col-md-4"></div> - <div class="col-md-4"> - <label for="control_number" class="form-label">Job Number</label> - <select name="job_no" class="form-select select2 auto-submit"> - <option value="">-- Select Job No --</option> - @endforeach - </select> - </div> - <div class="col-md-4"> - <label for="equips" class="form-label">Eqpt</label> - <select name="equipment_id" class="form-select select2 auto-submit"> - <option value="">-- Select Equipment --</option> - @endforeach
Added / After Commit
+ </div> + <div class="col-md-7"> + <form method="GET" class="mb-1" id="filterForm"> + <div class="row align-items-end g-2"> + <div class="col-md-3"> + <label for="control_number" class="form-label">Job Number</label> + <select name="job_no" class="form-select select2 auto-submit"> + <option value="">-- Select Job No --</option> + @endforeach + </select> + </div> + <div class="col-md-3"> + <label for="equips" class="form-label">Eqpt</label> + <select name="equipment_id" class="form-select select2 auto-submit"> + <option value="">-- Select Equipment --</option> + @endforeach + </select> + </div>
Removed / Before Commit
Added / After Commit
+ @extends('layouts.app') + + @section('content') + @php + $fmt = fn ($value) => number_format((float) ($value ?? 0), 0); + @endphp + + <div class="card"> + <div class="card-header py-3"> + <div class="d-flex flex-wrap justify-content-between align-items-center gap-2"> + <h4 class="mb-0"><b>Monthly Pay Summary</b></h4> + <a href="{{ route('finance-staff-details.index') }}" class="btn btn-secondary"> + <i class="fa fa-arrow-left"></i> Back + </a> + </div> + </div> + <div class="card-body"> + <form method="GET" action="{{ route('finance-monthly-pay-summary.index') }}" class="row g-2 align-items-end mb-3">
Removed / Before Commit
Added / After Commit
+ @php + $fmt = fn ($value) => number_format((float) ($value ?? 0), 0); + $pages = [ + 1 => $pageOneColumns, + 2 => $pageTwoColumns, + ]; + if (!empty($printPage)) { + $pages = [$printPage => $pages[$printPage]]; + } + @endphp + <!doctype html> + <html> + <head> + <meta charset="utf-8"> + <title>Monthly Pay Summary {{ $monthText }}</title> + <style> + @page { size: A4 landscape; margin: 6mm; } + body { font-family: "Courier New", monospace; color: #000; font-size: 8px; }
Removed / Before Commit
Added / After Commit
+ @extends('layouts.app') + + @section('content') + @php + $isGpf = $type === 'gpf'; + $title = $isGpf ? 'GPF Status' : 'CGHS Status'; + @endphp + + <div class="card"> + <div class="card-header py-3"> + <div class="d-flex flex-wrap justify-content-between align-items-center gap-2"> + <h4 class="mb-0"><b>{{ $title }}</b></h4> + <a href="{{ route('finance-staff-details.index') }}" class="btn btn-secondary"> + <i class="fa fa-arrow-left"></i> Back + </a> + </div> + </div> + <div class="card-body">
Removed / Before Commit
Added / After Commit
+ @php + $isGpf = $type === 'gpf'; + $label = $isGpf ? 'GPF' : 'CGHS'; + @endphp + <!doctype html> + <html> + <head> + <meta charset="utf-8"> + <title>{{ $label }} Status {{ $monthName }} {{ $year }}</title> + <style> + body { font-family: Arial, sans-serif; color: #000; font-size: 18px; } + .wrap { width: 92%; margin: 60px auto 0; } + .unit { text-align: center; font-weight: 700; text-decoration: underline; margin-bottom: 24px; } + .title { text-align: center; font-weight: 700; text-decoration: underline; margin-bottom: 10px; } + table { width: 100%; border-collapse: collapse; } + th, td { border: 1px solid #000; padding: 9px 8px; } + th { text-align: center; font-weight: 700; } + .center { text-align: center; }
Removed / Before Commit
Added / After Commit
+ @extends('layouts.app') + + @section('content') + @php + $fmt = fn ($value) => number_format((float) ($value ?? 0), 0); + @endphp + + <div class="card"> + <div class="card-header py-3"> + <div class="d-flex flex-wrap justify-content-between align-items-center gap-2"> + <h4 class="mb-0"><b>Monthly Tax Report</b></h4> + <a href="{{ route('finance-staff-details.index') }}" class="btn btn-secondary"> + <i class="fa fa-arrow-left"></i> Back + </a> + </div> + </div> + <div class="card-body"> + <form method="GET" action="{{ route('finance-monthly-tax-report.index') }}" class="row g-2 align-items-end mb-3">
Removed / Before Commit
Added / After Commit
+ @php + $fmt = fn ($value) => number_format((float) ($value ?? 0), 0); + @endphp + <!doctype html> + <html> + <head> + <meta charset="utf-8"> + <title>Monthly Tax Report {{ $monthText }}</title> + <style> + @page { size: A4 landscape; margin: 5mm; } + body { font-family: "Courier New", monospace; color: #000; font-size: 7px; } + .toolbar { margin: 8px; font-family: Arial, sans-serif; } + .toolbar button { padding: 6px 14px; } + .cr-page { page-break-after: always; } + .cr-page:last-child { page-break-after: auto; } + .title { text-align: center; font-weight: 700; text-decoration: underline; margin-bottom: 5px; font-size: 10px; } + .meta { display: flex; justify-content: space-between; margin-bottom: 4px; font-weight: 700; } + table { width: 100%; border-collapse: collapse; table-layout: fixed; }
Removed / Before Commit
- <h4 class="mb-0"><b>Finance Staff Details</b></h4> - </div> - <div class="col-md-8"> - <form method="GET" action="{{ route('finance-staff-details.index') }}" class="row g-2 justify-content-end"> - <div class="col-md-3"> - <label class="form-label fw-bold">Employee ID</label> - <a href="{{ route('finance-salaries.show', $staff) }}" title="Salary Generate / Salary Slip"> - <i class="fas fa-file-invoice-dollar"></i> - </a> - </td> - </tr> - @empty
Added / After Commit
+ <h4 class="mb-0"><b>Finance Staff Details</b></h4> + </div> + <div class="col-md-8"> + <div class="d-flex justify-content-end mb-2"> + <a href="{{ route('finance-monthly-tax-report.index') }}" class="btn btn-warning me-2"> + <i class="fas fa-file-invoice"></i> Monthly Tax Report + </a> + <a href="{{ route('finance-monthly-pay-summary.index') }}" class="btn btn-success me-2"> + <i class="fas fa-file-alt"></i> Monthly Pay Summary + </a> + <a href="{{ route('finance-monthly-status.index') }}" class="btn btn-info"> + <i class="fas fa-balance-scale"></i> GPF / CGHS Status + </a> + </div> + <form method="GET" action="{{ route('finance-staff-details.index') }}" class="row g-2 justify-content-end"> + <div class="col-md-3"> + <label class="form-label fw-bold">Employee ID</label> + <a href="{{ route('finance-salaries.show', $staff) }}" title="Salary Generate / Salary Slip">
Removed / Before Commit
Added / After Commit
+ @extends('layouts.app') + + @section('content') + @php + $money = fn ($value) => number_format((float) ($value ?? 0), 2, '.', ''); + $staffFields = [ + 'name' => 'Name', + 'category' => 'Category', + 'group_name' => 'Group Name', + 'dob' => 'Date of Birth', + 'joining_date' => 'Date of Joining', + 'retirement_date' => 'Date of Retirement', + 'father_name' => 'Father Name', + 'pan_no' => 'PAN No', + 'basic_salary' => 'Basic Salary', + 'cell' => 'Cell', + 'level' => 'Level', + 'increment_month' => 'Increment Month',
Removed / Before Commit
Added / After Commit
+ @php + $money = fn ($value) => number_format((float) ($value ?? 0), 0); + $salaryRows = collect($tax->salary_till_date_json ?? []); + $salaryTotal = $tax->salary_total_json ?? []; + $approxSalary = $tax->approx_salary_json ?? []; + $savings = $tax->savings_json ?? []; + $taxDetails = $tax->tax_details_json ?? []; + $oldSlabs = $tax->old_slabs_json ?? []; + $newSlabs = $tax->new_slabs_json ?? []; + @endphp + <!doctype html> + <html> + <head> + <meta charset="utf-8"> + <title>Income Tax MGT</title> + <style> + body { font-family: Arial, sans-serif; color: #000; font-size: 11px; } + .header { text-align: center; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
Removed / Before Commit
- - @section('content') - - <div class="card"> - <div class="card-body"> - <div class="container-fluid"> - @php - $equipment = \App\Models\WorkEquipment::with(['Equipments', 'group', 'RepairClass']) - ->find($cartItems[0]->work_equipment_id); - <div class="me-3"><strong>Group:</strong> {{ $equipment->group->name ?? 'N/A' }}</div> - </div> - - @if($cartItems->isEmpty()) - <p>No items in cart.</p> - @else - <form action="{{ route('inventory.cart.issue.store') }}" method="POST"> - @csrf -
Added / After Commit
+ + @section('content') + + @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()) + <div class="alert alert-danger"> + <strong>Whoops!</strong> Please fix the following: + <ul> + @foreach ($errors->all() as $error) + <li>{{ $error }}</li> + @endforeach + </ul> + </div>
Removed / Before Commit
- } - }); - - // Add to cart - $(document).on('change', '.add-to-cart-checkbox', function () { - if (this.checked) { - let spare_id = $(this).val(); - let work_equipment_id = $(this).data('work-equipment-id'); - let mco_demand_no = $(this).data('mco-demand-no'); - let job_no = $(this).data('job-no'); - let prod_year = $('#productionYear').val(); - - $.post("{{ route('inventory.add-to-cart') }}", { - _token: "{{ csrf_token() }}", - spare_id: [spare_id], - work_equipment_id, - mco_demand_no, - job_no,
Added / After Commit
+ } + }); + + function addSelectedSparesToCart(spareIds, source) { + if (!spareIds.length) return; + + let firstChecked = $('.select-spare:checked:not(:disabled)').first(); + let prod_year = $('#productionYear').val(); + + $.post("{{ route('inventory.add-to-cart') }}", { + _token: "{{ csrf_token() }}", + spare_id: spareIds, + work_equipment_id: firstChecked.data('work-equipment-id'), + mco_demand_no: firstChecked.data('mco-demand-no'), + job_no: firstChecked.data('job-no'), + prod_year + }, function (res) { + if (source !== 'single' || res.added > 0) {
Removed / Before Commit
- <th>Registration No</th> - <th>Qty Demanded</th> - <th>Qty Received</th> - <th>OSS Detail</th> - - </tr> - - @php - $qtyreceived = $receiveSums[$item->id]->total_qty_receive ?? 0; - $scale = $item->scale; - @endphp - - data-work-equipment-id="{{ $item->work_equipment_id }}" - data-mco-demand-no="{{ $item->mco_demand_no }}" - data-job-no="{{ $item->job_no }}" - @if(isset($receiveSums[$item->id])) disabled @endif - > - </td>
Added / After Commit
+ <th>Registration No</th> + <th>Qty Demanded</th> + <th>Qty Received</th> + <th>History</th> + <th>OSS Detail</th> + + </tr> + + @php + $qtyreceived = $receiveSums[$item->id]->total_qty_receive ?? 0; + $receiptCount = $receiveSums[$item->id]->receipt_count ?? 0; + $balanceQty = max(0, (int) $item->qty_demanded - (int) $qtyreceived); + $scale = $item->scale; + @endphp + + data-work-equipment-id="{{ $item->work_equipment_id }}" + data-mco-demand-no="{{ $item->mco_demand_no }}" + data-job-no="{{ $item->job_no }}"
Removed / Before Commit
- <td>{{ $scale->no_off }}</td> - @php - $total_qty_demanded = \App\Models\McoDemand::where('item_id', $demand->item_id)->where('job_no', $demand->job_no) - ->whereYear('created_at', now()->year) - ->sum('qty_demanded'); - @endphp
Added / After Commit
+ <td>{{ $scale->no_off }}</td> + @php + $total_qty_demanded = \App\Models\McoDemand::where('item_id', $demand->item_id)->where('job_no', $demand->job_no) + ->where('is_cancelled', false) + ->whereYear('created_at', now()->year) + ->sum('qty_demanded'); + @endphp
Removed / Before Commit
- {{-- ================= DEMAND NO WISE LOOP ================= --}} - @foreach($pages as $demandNo => $items) - - @if(!$loop->first) - <div class="page-break"></div> - @endif - <table class="info-table"> - <tr> - <td><strong>FROM:</strong> - {{ $demand->workEquipment->unit_wo_no ?? '' }} - </td> - - <td> - <strong>JOB NO.:</strong> {{ $demand->job_no }} - <strong>DT:</strong> - {{ \Carbon\Carbon::parse($demand->workEquipment->unit_wo_date)->format('d-m-y') }} - </td> -
Added / After Commit
+ {{-- ================= DEMAND NO WISE LOOP ================= --}} + @foreach($pages as $demandNo => $items) + + @php + $pageDemand = $items->first(); + $regdNos = $items->pluck('registation_no')->filter()->unique()->values(); + + if ($regdNos->isEmpty() && $pageDemand) { + $regdNos = \App\Models\McoDemand::where('req_no', $pageDemand->req_no) + ->where('prod_year', $pageDemand->prod_year) + ->where('job_no', $pageDemand->job_no) + ->where('work_equipment_id', $pageDemand->work_equipment_id) + ->where('is_cancelled', false) + ->whereNotNull('registation_no') + ->where('registation_no', '!=', '') + ->pluck('registation_no') + ->unique() + ->values();
Removed / Before Commit
- - @section('content') - - - <div class="card"> - <div class="card-header py-3"> - <th>Item DMD For Current Production Year</th> - @endif - <th>Qty Demanded</th> - - </tr> - </thead> - ->where('registation_no',$demand->registation_no) - ->sum('qty_demanded'); - $total_qty_demand = \App\Models\McoDemand::where('item_id', $demand->item_id)->where('scale_id',$scalenos->id) - ->whereNull('registation_no') - ->where('prod_year', $prodYear) - ->sum('qty_demanded');
Added / After Commit
+ + @section('content') + + @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()) + <div class="alert alert-danger"> + <strong>Whoops!</strong> Please fix the following: + <ul> + @foreach ($errors->all() as $error) + <li>{{ $error }}</li> + @endforeach
Removed / Before Commit
- .select2-selection { - min-height: 32px; - } - form{ - margin-bottom: 40px; - } - </style> - <style> - .select2-results__option { - </ul> - </div> - @endif - <div class="card"> - <div class="card-header bg-white border-bottom py-3"> - - </form> - - </div>
Added / After Commit
+ .select2-selection { + min-height: 32px; + } + </style> + <style> + .select2-results__option { + </ul> + </div> + @endif + @if (session('success')) + <div class="alert alert-success">{{ session('success') }}</div> + @endif + @if (session('error')) + <div class="alert alert-danger">{{ session('error') }}</div> + @endif + <div class="card"> + <div class="card-header bg-white border-bottom py-3"> +
Removed / Before Commit
- use App\Http\Controllers\FinancialPowerController; - use App\Http\Controllers\FinanceDeductionTitleController; - use App\Http\Controllers\FinanceStaffDetailsController; - use App\Http\Controllers\SalaryController; - use App\Http\Controllers\BulkSalaryController; - use App\Http\Controllers\UrgencyController; - Route::prefix('mco-demands')->name('mco.demands.')->group(function () { - Route::get('/', [McoDemandController::class, 'index'])->name('index'); - Route::get('/details', [McoDemandController::class, 'details'])->name('details'); - }); - Route::post('/demand/update-field', [DemandController::class, 'updateField'])->name('demand.update.field'); - Route::post('/mco-demands/submit-demand', [McoDemandController::class, 'submitDemand'])->name('mco.demands.submit'); - Route::put('finance-staff-details/{staff}', [FinanceStaffDetailsController::class, 'update'])->name('finance-staff-details.update'); - Route::get('finance-staff-details/{staff}/payment-recovery', [FinanceStaffDetailsController::class, 'paymentRecovery'])->name('finance-staff-details.payment-recovery'); - Route::put('finance-staff-details/{staff}/payment-recovery', [FinanceStaffDetailsController::class, 'updatePaymentRecovery'])->name('finance-staff-details.payment-recovery.update'); - Route::get('finance-deduction-titles', [FinanceDeductionTitleController::class, 'index'])->name('finance-deduction-titles.index'); - Route::get('finance-deduction-titles/create', [FinanceDeductionTitleController::class, 'create'])->name('finance-deduction-titles.create'); - Route::post('finance-deduction-titles', [FinanceDeductionTitleController::class, 'store'])->name('finance-deduction-titles.store');
Added / After Commit
+ use App\Http\Controllers\FinancialPowerController; + use App\Http\Controllers\FinanceDeductionTitleController; + use App\Http\Controllers\FinanceStaffDetailsController; + use App\Http\Controllers\FinanceStaffTaxController; + use App\Http\Controllers\FinanceMonthlyStatusController; + use App\Http\Controllers\FinanceMonthlyPaySummaryController; + use App\Http\Controllers\FinanceMonthlyTaxReportController; + use App\Http\Controllers\SalaryController; + use App\Http\Controllers\BulkSalaryController; + use App\Http\Controllers\UrgencyController; + Route::prefix('mco-demands')->name('mco.demands.')->group(function () { + Route::get('/', [McoDemandController::class, 'index'])->name('index'); + Route::get('/details', [McoDemandController::class, 'details'])->name('details'); + Route::post('/cancel-spare/{demand}', [McoDemandController::class, 'cancelSpare'])->name('cancel-spare'); + }); + Route::post('/demand/update-field', [DemandController::class, 'updateField'])->name('demand.update.field'); + Route::post('/mco-demands/submit-demand', [McoDemandController::class, 'submitDemand'])->name('mco.demands.submit'); + Route::put('finance-staff-details/{staff}', [FinanceStaffDetailsController::class, 'update'])->name('finance-staff-details.update');