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 · 859e3ed0
The commit includes multiple improvements spanning dashboard graphs, LPO fund status data aggregation, leave type validation, vendor name resolution, and CRC part master import functionality. It adds robust validation and error handling in import operations and enhances reporting with richer data. The SQL queries use safe parameter binding, but some raw SQL strings and dynamic date formatting in queries might introduce subtle bugs or security gaps if inputs are uncontrolled. Overall, the work enhances business capabilities with moderate code complexity and low risk, but some security and quality best practices could be improved.
Quality
?
80%
Security
?
75%
Business Value
?
90%
Maintainability
?
80%
Issues & Suggested Fixes
?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Missing Validation
Where
app/Http/Controllers/Boo/CsBaseController.php:55
Issue / Evidence
direct DB raw queries with input casted as int but no further validation
Suggested Fix
implement more strict input validation or parameterized queries to reduce risk
Long Function
Where
app/Http/Controllers/DashboardController.php:97-106
Issue / Evidence
complex SQL string with multiple date formats in COALESCE could cause unexpected behavior
Suggested Fix
add comprehensive unit tests to cover date parsing and consider centralizing date format parsing logic
Import Logic Catches Generic Throwable But...
Where
app/Http/Controllers/CrcPartMasterController.php:59-84
Issue / Evidence
import logic catches generic Throwable but returns generic error message
Suggested Fix
improve error messages to include more context and log structured data for easier troubleshooting
Too Vague And Abbreviation Heavy
Where
commit message
Issue / Evidence
too vague and abbreviation-heavy
Suggested Fix
improve commit message clarity and spelling, e.g. fix spelling of 'dashboard', add description of changes and impact
Missing Validation
Where
app/Http/Controllers/Boo/FinancialOpeningController.php:87-89
Issue / Evidence
input date validations done but no timezone handling mentioned
Suggested Fix
ensure consistent timezone handling for date comparisons
Missing Validation
Where
app/Http/Controllers/AttendanceController.php:872-877
Issue / Evidence
leave duration validation returns JSON error with message in English only
Suggested Fix
consider localization support for user-facing messages
Code Change Preview · app/Exports/EquipmentDateReportExport.php
?
Removed / Before Commit
- $equipment->assy ?? '-', - $equipment->regd_no ?? '-', - $equipment->RepairClass?->name ?? '-', - $workOrder?->job_no ?? '-', - $workOrder?->job_date ?? '-', - $equipment->status ?? '-', - 'Sub Eqpt', - 'Regd No', - 'Repair Class', - 'Job No', - 'Job Date', - 'Status',
Added / After Commit
+ $equipment->assy ?? '-', + $equipment->regd_no ?? '-', + $equipment->RepairClass?->name ?? '-', + $workOrder?->control_no ?? '-', + $workOrder?->control_date ?? '-', + $workOrder?->job_no ?? '-', + $workOrder?->job_date ?? '-', + $equipment->status ?? '-', + 'Sub Eqpt', + 'Regd No', + 'Repair Class', + 'Control No', + 'Control Date', + 'Job No', + 'Job Date', + 'Status',
Removed / Before Commit
- { - private function normalizeLeaveCategory(?string $category): ?string - { - if (!$category) { - return null; - } - - $category = strtolower(trim(str_replace('-', ' ', $category))); - $category = preg_replace('/\s+/', ' ', $category); - - return match ($category) { - 'industrial' => 'Industrial', - 'non industrial' => 'Non Industrial', - 'both' => 'Both', - default => trim($category), - }; - } -
Added / After Commit
+ { + private function normalizeLeaveCategory(?string $category): ?string + { + return LeaveType::normalizeCategoryName($category); + } + + private function activeLeaveTypesForStaff(Staff $staff) + { + return LeaveType::where('status', 'Active') + ->applicableToStaff($staff) + ->orderBy('leave_name'); + } + + + 'increment_history' => 'nullable|array', + 'increment_history.*.date' => 'nullable', + 'increment_history.*.level' => 'nullable', + 'increment_history.*.cell' => 'nullable',
Removed / Before Commit
- { - private function normalizeCategory(?string $category): ?string - { - if (!$category) { - return null; - } - - $category = strtolower(trim(str_replace('-', ' ', $category))); - $category = preg_replace('/\s+/', ' ', $category); - - return match ($category) { - 'industrial' => 'Industrial', - 'non industrial' => 'Non Industrial', - 'both' => 'Both', - default => trim($category), - }; - } -
Added / After Commit
+ { + private function normalizeCategory(?string $category): ?string + { + return LeaveType::normalizeCategoryName($category); + } + + private function employeeCategoryName(Staff $employee): ?string + + private function activeLeaveTypesForEmployee(Staff $employee) + { + return LeaveType::where('status', 'Active') + ->applicableToStaff($employee); + } + + /** + 'message' => 'Selected leave type is not applicable for this employee category.' + ], 422); + }
Removed / Before Commit
- - try { - $query = DB::connection('attendance_sqlsrv') - ->table('dbo.Tran_MachineRawPunchId') - ->select([ - 'Tran_MachineRawPunchId', - 'CardNo',
Added / After Commit
+ + try { + $query = DB::connection('attendance_sqlsrv') + ->table('dbo.Tran_MachineRawPunch') + ->select([ + 'Tran_MachineRawPunchId', + 'CardNo',
Removed / Before Commit
- { - $caseId = (int)$request->query('CaseID', 0); - $cases = DB::select("SELECT CaseID, CaseNo FROM cases ORDER BY CaseNo"); - $csData = []; - $v1Name = $v2Name = $v3Name = ''; - - if ($caseId) { - $hasSaved = DB::selectOne("SELECT COUNT(*) AS cnt FROM comparativestatements WHERE CaseID=?", [$caseId])->cnt; - if ($hasSaved) { - $csData = DB::select("SELECT ls.LPRSpareID,c.CaseID,COALESCE(s.Section,'') AS Section,COALESCE(s.PartNo,'') AS PartNo,COALESCE(s.Nomenclature,'') AS Nomenclature,COALESCE(a.AUName,'EA') AS AU,ls.Qty,COALESCE(cs.Vendor1Name,'') AS Vendor1Name,COALESCE(cs.Vendor2Name,'') AS Vendor2Name,COALESCE(cs.Vendor3Name,'') AS Vendor3Name,COALESCE(cs.Vendor1Rate,0) AS V1Rate,COALESCE(cs.Vendor1GST,0) AS V1GST,COALESCE(cs.Vendor2Rate,0) AS V2Rate,COALESCE(cs.Vendor2GST,0) AS V2GST,COALESCE(cs.Vendor3Rate,0) AS V3Rate,COALESCE(cs.Vendor3GST,0) AS V3GST,COALESCE(cs.LPP,0) AS LPP,COALESCE(cs.LPPGST,0) AS LPPGST,COALESCE(cs.L1Vendor,'') AS L1Vendor,COALESCE(cs.L1Rate,0) AS L1Rate FROM lprspares ls INNER JOIN new_lprs l ON ls.LPRID=l.LPRID INNER JOIN cases c ON l.CaseNoID=c.CaseID INNER JOIN comparativestatements cs ON cs.LPRSpareID=ls.LPRSpareID AND cs.CaseID=c.CaseID LEFT JOIN spares s ON ls.SpareID=s.SpareID LEFT JOIN au a ON s.AUID=a.AUID WHERE c.CaseID=? AND COALESCE(ls.Qty,0)>0 ORDER BY COALESCE(s.Section,'ZZZ'),COALESCE(s.PartNo,'ZZZ')", [$caseId]); - $v1Name = $csData[0]->Vendor1Name ?? ''; - $v2Name = $csData[0]->Vendor2Name ?? ''; - $v3Name = $csData[0]->Vendor3Name ?? ''; - } - - $showLPP = $this->showLPP; - return view($view, compact('caseId','cases','csData','v1Name','v2Name','v3Name','showLPP')); - }
Added / After Commit
+ { + $caseId = (int)$request->query('CaseID', 0); + $cases = DB::select("SELECT CaseID, CaseNo FROM cases ORDER BY CaseNo"); + $vendors = DB::select("SELECT VendorID, VendorName FROM vendors WHERE IsActive=1 ORDER BY VendorName"); + $csData = []; + $v1Name = $v2Name = $v3Name = ''; + + if ($caseId) { + $hasSaved = DB::selectOne("SELECT COUNT(*) AS cnt FROM comparativestatements WHERE CaseID=?", [$caseId])->cnt; + if ($hasSaved) { + $csData = DB::select("SELECT ls.LPRSpareID,c.CaseID,COALESCE(s.Section,'') AS Section,COALESCE(s.PartNo,'') AS PartNo,COALESCE(s.Nomenclature,'') AS Nomenclature,COALESCE(a.AUName,'EA') AS AU,ls.Qty,COALESCE(cs.Vendor1Name,'') AS Vendor1Name,COALESCE(cs.Vendor2Name,'') AS Vendor2Name,COALESCE(cs.Vendor3Name,'') AS Vendor3Name,COALESCE(cs.Vendor1Rate,0) AS V1Rate,COALESCE(cs.Vendor1GST,0) AS V1GST,COALESCE(cs.Vendor2Rate,0) AS V2Rate,COALESCE(cs.Vendor2GST,0) AS V2GST,COALESCE(cs.Vendor3Rate,0) AS V3Rate,COALESCE(cs.Vendor3GST,0) AS V3GST,COALESCE(cs.LPP,0) AS LPP,COALESCE(cs.LPPGST,0) AS LPPGST,COALESCE(cs.L1Vendor,'') AS L1Vendor,COALESCE(cs.L1Rate,0) AS L1Rate FROM lprspares ls INNER JOIN new_lprs l ON ls.LPRID=l.LPRID INNER JOIN cases c ON l.CaseNoID=c.CaseID INNER JOIN comparativestatements cs ON cs.LPRSpareID=ls.LPRSpareID AND cs.CaseID=c.CaseID LEFT JOIN spares s ON ls.SpareID=s.SpareID LEFT JOIN au a ON s.AUID=a.AUID WHERE c.CaseID=? AND COALESCE(ls.Qty,0)>0 ORDER BY COALESCE(s.Section,'ZZZ'),COALESCE(s.PartNo,'ZZZ')", [$caseId]); + foreach ($csData as $r) { + $r->Vendor1Name = $this->resolveVendorName($r->Vendor1Name ?? ''); + $r->Vendor2Name = $this->resolveVendorName($r->Vendor2Name ?? ''); + $r->Vendor3Name = $this->resolveVendorName($r->Vendor3Name ?? ''); + $r->L1Vendor = $this->resolveVendorName($r->L1Vendor ?? ''); + } + $v1Name = $csData[0]->Vendor1Name ?? '';
Removed / Before Commit
- if (!$case) return response()->json(['success' => false, 'error' => 'Case not found'], 404); - - // Format dates for date inputs (Y-m-d) - foreach (['BidDate','BidOpeningDate','FinancialBidOpeningDate','RADt','TECApprovalDate','COBPart1OrderDate'] as $col) { - if (!empty($case->$col)) { - $case->$col = LpoHelper::fmtDate($case->$col); - } - $tecApprovalDate = $request->TECApprovalDate ?: null; - $financialOpeningDate = $request->FinancialOpeningDate ?: null; - $raDate = $request->RADate ?: null; - - // Date validations - if ($tecApprovalDate && $bidOpenedOn && $tecApprovalDate < $bidOpenedOn) - } - if ($raDate && $financialOpeningDate && $raDate < $financialOpeningDate) - return response()->json(['success' => false, 'error' => '❌ RA Date cannot be less than Financial Opening Date!'], 422); - - try {
Added / After Commit
+ if (!$case) return response()->json(['success' => false, 'error' => 'Case not found'], 404); + + // Format dates for date inputs (Y-m-d) + foreach (['BidDate','BidOpeningDate','FinancialBidOpeningDate','RADt','RAOD','TECApprovalDate','COBPart1OrderDate'] as $col) { + if (!empty($case->$col)) { + $case->$col = LpoHelper::fmtDate($case->$col); + } + $tecApprovalDate = $request->TECApprovalDate ?: null; + $financialOpeningDate = $request->FinancialOpeningDate ?: null; + $raDate = $request->RADate ?: null; + $raOpenedOn = $request->RAOpenedOn ?: null; + + // Date validations + if ($tecApprovalDate && $bidOpenedOn && $tecApprovalDate < $bidOpenedOn) + } + if ($raDate && $financialOpeningDate && $raDate < $financialOpeningDate) + return response()->json(['success' => false, 'error' => '❌ RA Date cannot be less than Financial Opening Date!'], 422); + if ($raOpenedOn && $raDate && $raOpenedOn < $raDate)
Removed / Before Commit
- : 'INDUSTRIAL ESTABLISHMENT'; - - $totals = $this->emptyCrSummaryTotals(); - $monthlyDeductionTitles = $this->monthlyDeductionTitlesForPeriod($month, $year); - $totals['monthly_titles'] = array_fill_keys(array_keys($monthlyDeductionTitles), 0); - $employeeCount = 0; - - ]; - } - - private function monthlyDeductionTitlesForPeriod(int $month, int $year): array - { - return FinanceDeductionTitle::where('month', $month) - ->where('year', $year) - ->orderBy('deduction_title') - ->pluck('amount', 'deduction_title') - ->map(fn ($amount) => (float) $amount)
Added / After Commit
+ : 'INDUSTRIAL ESTABLISHMENT'; + + $totals = $this->emptyCrSummaryTotals(); + $monthlyDeductionTitles = $this->monthlyDeductionTitlesForPeriod($month, $year, $categoryId ? (int) $categoryId : null); + $totals['monthly_titles'] = array_fill_keys(array_keys($monthlyDeductionTitles), 0); + $employeeCount = 0; + + ]; + } + + private function monthlyDeductionTitlesForPeriod(int $month, int $year, ?int $employeeCategoryId = null): array + { + return FinanceDeductionTitle::where('month', $month) + ->where('year', $year) + ->where(function ($query) use ($employeeCategoryId) { + $query->whereNull('employee_category_id'); + + if ($employeeCategoryId) {
Removed / Before Commit
- - public function store(Request $request) - { - $request->validate([ - 'group_id' => 'required|exists:groups,id', - 'location' => 'required|string|max:255',
Added / After Commit
+ + public function store(Request $request) + { + $request->merge([ + 'complaint_name' => trim((string) $request->complaint_name), + ]); + + $request->validate([ + 'group_id' => 'required|exists:groups,id', + 'location' => 'required|string|max:255',
Removed / Before Commit
- use Illuminate\Http\Request; - use App\Models\CrcPartMaster; - use App\Models\Equipment; - - class CrcPartMasterController extends Controller - { - return redirect()->back()->with('success', 'Record Updated Successfully'); - } - - public function destroy($id) - { - CrcPartMaster::findOrFail($id)->delete();
Added / After Commit
+ use Illuminate\Http\Request; + use App\Models\CrcPartMaster; + use App\Models\Equipment; + use App\Imports\CrcPartMasterImport; + use Illuminate\Support\Facades\Log; + use Maatwebsite\Excel\Facades\Excel; + + class CrcPartMasterController extends Controller + { + return redirect()->back()->with('success', 'Record Updated Successfully'); + } + + public function import(Request $request) + { + try { + $request->validate([ + 'file' => 'required|mimes:xlsx,xls,csv' + ]);
Removed / Before Commit
- use App\Models\GatePassDetail; - use App\Models\MasterCommand; - use App\Models\Group; - use Illuminate\Http\Request; - use Illuminate\Support\Facades\Validator; - use Carbon\Carbon; - - class DashboardController extends Controller - // Get current month equipment with gate passes grouped by group - $groupData = $this->getGroupData(); - - - return view('dashboard-new', compact('monthlyData', 'productionYear', 'underRepairData', 'commandData', 'groupData')); - } - - private function getMonthlyWorkEquipmentData($startDate, $endDate) - } -
Added / After Commit
+ use App\Models\GatePassDetail; + use App\Models\MasterCommand; + use App\Models\Group; + use App\Models\EqptTarget; + use Illuminate\Http\Request; + use Illuminate\Support\Facades\Validator; + use Illuminate\Support\Facades\DB; + use Illuminate\Support\Facades\Cache; + use Carbon\Carbon; + + class DashboardController extends Controller + // Get current month equipment with gate passes grouped by group + $groupData = $this->getGroupData(); + + // Get fund state by grant for the selected production year + $fundChartData = $this->getFundGrantData($startDate, $endDate); + + return view('dashboard-new', compact('monthlyData', 'productionYear', 'underRepairData', 'commandData', 'groupData', 'fundChartData'));
Removed / Before Commit
- if (!empty($case->$col)) $case->$col = LpoHelper::fmtDate($case->$col); - } - - $grid = DB::select("SELECT ls.LPRSpareID, COALESCE(s.Section,'') AS Section, COALESCE(s.PartNo,'') AS PartNo, COALESCE(s.Nomenclature,'') AS Nomenclature, COALESCE(a.AUName,'') AS AUID, COALESCE(ls.Qty,0) AS Qty, COALESCE(ls.TotalAONAmount,0) AS TotalAONAmount, ls.FinalGST, COALESCE(ls.OrderPrice,0) AS OrderPrice, COALESCE(ls.TotalOrderAmount,0) AS TotalOrderAmount, COALESCE(ls.L1VendorID,0) AS L1VendorID FROM cases c INNER JOIN new_lprs l ON c.CaseID=l.CaseNoID INNER JOIN lprspares ls ON l.LPRID=ls.LPRID INNER JOIN spares s ON ls.SpareID=s.SpareID LEFT JOIN au a ON s.AUID=a.AUID WHERE c.CaseID=? AND ls.Qty>0 ORDER BY s.Section,s.PartNo", [$caseId]); - - $procRule = DB::selectOne("SELECT PR.ProcRule FROM cases C INNER JOIN ProcRules PR ON C.ProcRuleID=PR.ProcRuleID WHERE C.CaseID=?", [$caseId]); - - $orderPrice = is_numeric($sr['OrderPrice']) ? (float)$sr['OrderPrice'] : null; - $finalGst = is_numeric($sr['FinalGST']) ? (float)$sr['FinalGST'] : null; - $vendorId = (int)($sr['L1VendorID'] ?? 0) ?: null; - $total = $orderPrice !== null ? $orderPrice * (float)($sr['Qty'] ?? 0) : null; - - DB::statement("UPDATE lprspares SET OrderPrice=?,FinalGST=?,TotalOrderAmount=?,L1VendorID=? WHERE LPRSpareID=?", - [$orderPrice, $finalGst, $total, $vendorId, (int)$sr['LPRSpareID']]); - $updated++; - } - return response()->json(['success' => true, 'message' => "✅ EAS Captured! $updated rows updated."]);
Added / After Commit
+ if (!empty($case->$col)) $case->$col = LpoHelper::fmtDate($case->$col); + } + + $grid = DB::select("SELECT ls.LPRSpareID, COALESCE(s.Section,'') AS Section, COALESCE(s.PartNo,'') AS PartNo, COALESCE(s.Nomenclature,'') AS Nomenclature, COALESCE(a.AUName,'') AS AUID, COALESCE(ls.Qty,0) AS Qty, COALESCE(ls.TotalAONAmount,0) AS TotalAONAmount, ls.FinalGST, COALESCE(ls.OrderPrice,0) AS OrderPrice, CASE WHEN ls.OrderPrice IS NULL THEN 0 ELSE ROUND(COALESCE(ls.Qty,0) * COALESCE(ls.OrderPrice,0) * (1 + COALESCE(ls.FinalGST,0) / 100), 2) END AS TotalOrderAmount, COALESCE(ls.L1VendorID,0) AS L1VendorID FROM cases c INNER JOIN new_lprs l ON c.CaseID=l.CaseNoID INNER JOIN lprspares ls ON l.LPRID=ls.LPRID INNER JOIN spares s ON ls.SpareID=s.SpareID LEFT JOIN au a ON s.AUID=a.AUID WHERE c.CaseID=? AND ls.Qty>0 ORDER BY s.Section,s.PartNo", [$caseId]); + + $procRule = DB::selectOne("SELECT PR.ProcRule FROM cases C INNER JOIN ProcRules PR ON C.ProcRuleID=PR.ProcRuleID WHERE C.CaseID=?", [$caseId]); + + $orderPrice = is_numeric($sr['OrderPrice']) ? (float)$sr['OrderPrice'] : null; + $finalGst = is_numeric($sr['FinalGST']) ? (float)$sr['FinalGST'] : null; + $vendorId = (int)($sr['L1VendorID'] ?? 0) ?: null; + if ($finalGst !== null && ($finalGst < 0 || $finalGst > 28)) { + return response()->json(['success' => false, 'error' => 'GST must be between 0 and 28.'], 422); + } + + $qty = (float)($sr['Qty'] ?? 0); + $total = $orderPrice !== null ? round($qty * $orderPrice * (1 + (($finalGst ?? 0) / 100)), 2) : null; + + DB::statement("UPDATE lprspares SET OrderPrice=?,FinalGST=?,TotalOrderAmount=?,L1VendorID=?,EASCreated=?,EASCreatedOn=?,ModifiedDate=NOW() WHERE LPRSpareID=?",
Removed / Before Commit
- - if ($request->get('export') === 'excel') { - return Excel::download( - new EquipmentDateReportExport($this->buildQuery($request)->get(), self::REPORT_TYPES[$request->report_type] ?? 'Equipment Date Report'), - 'equipment-date-report.xlsx' - ); - } - - - return Pdf::loadView('equipment-date-report.pdf', [ - 'rows' => $rows, - 'reportTitle' => self::REPORT_TYPES[$request->report_type] ?? 'Equipment Date Report', - 'fromDate' => $request->from_date, - 'toDate' => $request->to_date, - ]) - ->setPaper('a4', 'landscape') - ->download('equipment-date-report.pdf'); - }
Added / After Commit
+ + if ($request->get('export') === 'excel') { + return Excel::download( + new EquipmentDateReportExport($this->buildQuery($request)->get(), self::REPORT_TYPES[$request->report_type] ?? 'Equipment Data Report'), + 'equipment-data-report.xlsx' + ); + } + + + return Pdf::loadView('equipment-date-report.pdf', [ + 'rows' => $rows, + 'reportTitle' => self::REPORT_TYPES[$request->report_type] ?? 'Equipment Data Report', + 'fromDate' => $request->from_date, + 'toDate' => $request->to_date, + ]) + ->setPaper('a4', 'landscape') + ->download('equipment-data-report.pdf'); + }
Removed / Before Commit
- $equipments = []; - $reportRows = collect(); - - $perPage = request()->get('per_page', 10); // default 10 - - if (true) - { - $reportRows = EquipmentReportRows::rows($equipments->getCollection(), $equipments->firstItem() ?? 1); - } - - $vertical = Vertical::where('name','production')->first(); - // Dropdown filter data - $unitNames = Unit::select('name')->groupBy('name')->pluck('name'); - $groupNames = Group::select('name')->where('vertical_id',$vertical->id)->groupBy('name')->pluck('name'); - $commands = MasterCommand::select('name')->groupBy('name')->pluck('name'); - $workspaces = Wksp::select('name')->groupBy('name')->pluck('name'); - $divisions = Div::select('name')->groupBy('name')->pluck('name'); - $corpsList = Corp::select('name')->groupBy('name')->pluck('name');
Added / After Commit
+ $equipments = []; + $reportRows = collect(); + + $perPage = (int) request()->get('per_page', 10); + $perPage = in_array($perPage, [10, 25, 50, 100], true) ? $perPage : 10; + + if (true) + { + $reportRows = EquipmentReportRows::rows($equipments->getCollection(), $equipments->firstItem() ?? 1); + } + + extract($this->equipmentReportFilterOptions()); + + return view('eq-report.tableindex', compact( + 'equipments', + $equipments = $query->paginate(10); + } +
Removed / Before Commit
- namespace App\Http\Controllers; - - use App\Models\FinanceDeductionTitle; - use Illuminate\Http\Request; - use Illuminate\Validation\Rule; - - - FinanceDeductionTitle::updateOrCreate( - [ - 'deduction_title' => $validated['deduction_title'], - 'month' => $validated['month'], - 'year' => $validated['year'], - $validated = $this->validateData($request); - - $duplicate = FinanceDeductionTitle::where('deduction_title', $validated['deduction_title']) - ->where('month', $validated['month']) - ->where('year', $validated['year']) - ->where('id', '!=', $financeDeductionTitle->id)
Added / After Commit
+ namespace App\Http\Controllers; + + use App\Models\FinanceDeductionTitle; + use App\Models\EmployeeCategory; + use Illuminate\Http\Request; + use Illuminate\Validation\Rule; + + + FinanceDeductionTitle::updateOrCreate( + [ + 'employee_category_id' => $validated['employee_category_id'], + 'deduction_title' => $validated['deduction_title'], + 'month' => $validated['month'], + 'year' => $validated['year'], + $validated = $this->validateData($request); + + $duplicate = FinanceDeductionTitle::where('deduction_title', $validated['deduction_title']) + ->where('employee_category_id', $validated['employee_category_id'])
Removed / Before Commit
- 'nps_individual_percentage' => ['category' => 'NPS', 'label' => 'NPS Individual Contribution', 'unit' => '%'], - 'ups_govt_percentage' => ['category' => 'UPS', 'label' => 'UPS Govt Contribution', 'unit' => '%'], - 'ups_individual_percentage' => ['category' => 'UPS', 'label' => 'UPS Individual Contribution', 'unit' => '%'], - 'tpt_low_amount' => ['category' => 'TPT', 'label' => 'Basic up to 24199', 'unit' => 'Rs'], - 'tpt_low_handicapped_amount' => ['category' => 'TPT', 'label' => 'Basic up to 24199 - Physically Handicapped', 'unit' => 'Rs'], - 'tpt_high_amount' => ['category' => 'TPT', 'label' => 'Basic 24200 and Above', 'unit' => 'Rs'], - 'tpt_high_handicapped_amount' => ['category' => 'TPT', 'label' => 'Basic 24200 and Above - Physically Handicapped', 'unit' => 'Rs'], - ]; - } - }
Added / After Commit
+ 'nps_individual_percentage' => ['category' => 'NPS', 'label' => 'NPS Individual Contribution', 'unit' => '%'], + 'ups_govt_percentage' => ['category' => 'UPS', 'label' => 'UPS Govt Contribution', 'unit' => '%'], + 'ups_individual_percentage' => ['category' => 'UPS', 'label' => 'UPS Individual Contribution', 'unit' => '%'], + 'tpt_level_1_2_low_basic_amount' => ['category' => 'TPT', 'label' => 'Level 1 & 2 - Basic Pay up to 24199', 'unit' => 'Rs'], + 'tpt_level_1_2_high_basic_amount' => ['category' => 'TPT', 'label' => 'Level 1 & 2 - Basic Pay 24200 and Above', 'unit' => 'Rs'], + 'tpt_level_3_8_amount' => ['category' => 'TPT', 'label' => 'Level 3 to 8', 'unit' => 'Rs'], + 'tpt_level_9_plus_amount' => ['category' => 'TPT', 'label' => 'Level 9 and Above', 'unit' => 'Rs'], + 'risk_allowance_90' => ['category' => 'Risk Allowance', 'label' => 'Risk and Hardship Allowance 90', 'unit' => 'Rs'], + 'risk_allowance_135' => ['category' => 'Risk Allowance', 'label' => 'Risk and Hardship Allowance 135', 'unit' => 'Rs'], + 'risk_allowance_180' => ['category' => 'Risk Allowance', 'label' => 'Risk and Hardship Allowance 180', 'unit' => 'Rs'], + 'risk_allowance_225' => ['category' => 'Risk Allowance', 'label' => 'Risk and Hardship Allowance 225', 'unit' => 'Rs'], + 'risk_allowance_405' => ['category' => 'Risk Allowance', 'label' => 'Risk and Hardship Allowance 405', 'unit' => 'Rs'], + 'risk_allowance_675' => ['category' => 'Risk Allowance', 'label' => 'Risk and Hardship Allowance 675', 'unit' => 'Rs'], + 'risk_allowance_900' => ['category' => 'Risk Allowance', 'label' => 'Risk and Hardship Allowance 900', 'unit' => 'Rs'], + 'risk_allowance_3375' => ['category' => 'Risk Allowance', 'label' => 'Risk and Hardship Allowance 3375', 'unit' => 'Rs'], + 'risk_allowance_4250' => ['category' => 'Risk Allowance', 'label' => 'Risk and Hardship Allowance 4250', 'unit' => 'Rs'], + ]; + }
Removed / Before Commit
- namespace App\Http\Controllers; - - use App\Models\EmployeeCategory; - use App\Models\DaRate; - use App\Models\FinancePaymentRecovery; - use App\Models\FinanceStaffDetail; - use App\Models\FinanceSupplementaryPayment; - use App\Models\Staff; - use Illuminate\Http\Request; - - class FinanceStaffDetailsController extends Controller - 'staff' => $staff, - 'financeDetail' => $staff->financeDetail, - 'readonlyData' => $this->readonlyData($staff), - ]); - } - - // 'branch_name' => 'nullable|string|max:255',
Added / After Commit
+ namespace App\Http\Controllers; + + use App\Models\EmployeeCategory; + use App\Models\Attendance; + use App\Models\DaRate; + use App\Models\FinancePaymentRecovery; + use App\Models\FinanceSalaryRuleMaster; + use App\Models\FinanceStaffDetail; + use App\Models\FinanceSupplementaryPayment; + use App\Models\Staff; + use App\Models\TaxRegimeMaster; + use Illuminate\Http\Request; + + class FinanceStaffDetailsController extends Controller + 'staff' => $staff, + 'financeDetail' => $staff->financeDetail, + 'readonlyData' => $this->readonlyData($staff), + 'grossBreakdown' => $this->grossBreakdown($staff),
Removed / Before Commit
- { - private function normalizeCategory(?string $category): ?string - { - if (!$category) { - return null; - } - - $category = strtolower(trim(str_replace('-', ' ', $category))); - $category = preg_replace('/\s+/', ' ', $category); - - return match ($category) { - 'industrial' => 'Industrial', - 'non industrial' => 'Non Industrial', - 'both' => 'Both', - default => trim($category), - }; - } -
Added / After Commit
+ { + private function normalizeCategory(?string $category): ?string + { + return LeaveType::normalizeCategoryName($category); + } + + private function employeeCategoryName(Staff $employee): ?string + + private function activeLeaveTypesForEmployee(Staff $employee) + { + return LeaveType::where('status', 'Active') + ->applicableToStaff($employee); + } + + // public function index() + } + + $duration = $leaveGroup['duration'];
Removed / Before Commit
- { - private function normalizeCategory(?string $category): ?string - { - if (!$category) { - return null; - } - - $category = strtolower(trim(str_replace('-', ' ', $category))); - $category = preg_replace('/\s+/', ' ', $category); - - return match ($category) { - 'industrial' => 'Industrial', - 'non industrial' => 'Non Industrial', - 'both' => 'Both', - default => trim($category), - }; - } -
Added / After Commit
+ { + private function normalizeCategory(?string $category): ?string + { + return LeaveType::normalizeCategoryName($category); + } + + private function employeeCategoryName(Staff $employee): ?string + + private function activeLeaveTypesForEmployee(Staff $employee) + { + return LeaveType::where('status', 'Active') + ->applicableToStaff($employee); + } + + public function index() { + $balance = $annualLimit - $taken; + $leaveBalance[$type->id] = [ + 'name' => $type->leave_name,
Removed / Before Commit
- - // Get employee categories for filter dropdown - $employeeCategories = EmployeeCategory::where('is_active', 1)->get(); - $typeCategoryOptions = [ - 'Industrial' => 'Industrial', - 'Non Industrial' => 'Non Industrial', - 'Both' => 'Both' - ]; - - // Apply filters - if ($request->filled('type_category')) { - $selectedCategory = $request->type_category; - $query->where('leave_category', $selectedCategory); - } - - if ($request->filled('leave_category')) { - return view('leave_types.create', compact('employeeCategories', 'selectedCategories')); - }
Added / After Commit
+ + // Get employee categories for filter dropdown + $employeeCategories = EmployeeCategory::where('is_active', 1)->get(); + $typeCategoryOptions = EmployeeCategory::where('is_active', 1) + ->orderBy('name') + ->pluck('name', 'id') + ->prepend('All', LeaveType::ALL_CATEGORY_VALUE); + + // Apply filters + if ($request->filled('type_category')) { + $selectedCategory = $request->type_category; + $query->where(function ($q) use ($selectedCategory) { + $q->where('leave_category', $selectedCategory) + ->orWhereRaw('FIND_IN_SET(?, leave_category)', [$selectedCategory]); + }); + } + + if ($request->filled('leave_category')) {
Removed / Before Commit
- - // ── Dropdown lists for FY selectors ────────────────────────────── - $lprFYs = DB::select("SELECT DISTINCT YEAR(LPRDate) AS FYYear FROM new_lprs WHERE LPRDate IS NOT NULL ORDER BY FYYear DESC"); - $orderFYs = DB::select("SELECT DISTINCT YEAR(OrderDate) AS FYYear FROM SupplyOrders WHERE OrderDate IS NOT NULL ORDER BY FYYear DESC"); - $fundFYs = DB::select("SELECT DISTINCT FYYear FROM ( - SELECT YEAR(AuthorityDate) AS FYYear FROM FundTransactions WHERE AuthorityDate IS NOT NULL - UNION - SELECT YEAR(OrderDate) AS FYYear FROM SupplyOrders WHERE OrderDate IS NOT NULL - ) FY ORDER BY FYYear DESC"); - - // ── KPI Cards ───────────────────────────────────────────────────── - $totalLPRs = DB::selectOne("SELECT COUNT(*) AS cnt FROM new_lprs WHERE LPRDate >= ? AND LPRDate <= ?", [$fyStart, $fyEnd])->cnt; - $sparesDemanded = DB::selectOne("SELECT COUNT(DISTINCT CONCAT(ls.LPRID,'|',ls.SpareID)) AS cnt FROM lprspares ls JOIN new_lprs l ON ls.LPRID=l.LPRID WHERE l.LPRDate >= ? AND l.LPRDate <= ? AND ls.LPRID IS NOT NULL AND ls.SpareID IS NOT NULL", [$fyStart, $fyEnd])->cnt; - $sparesIssued = DB::selectOne("SELECT COUNT(DISTINCT CONCAT(ls.LPRID,'|',ls.SpareID)) AS cnt FROM lprspares ls JOIN new_lprs l ON ls.LPRID=l.LPRID WHERE l.LPRDate >= ? AND l.LPRDate <= ? AND ls.CRVDate IS NOT NULL", [$fyStart, $fyEnd])->cnt; - $orderPlaced = DB::selectOne("SELECT COUNT(*) AS cnt FROM SupplyOrders WHERE OrderDate >= ? AND OrderDate <= ?", [$fyStart, $fyEnd])->cnt; - $sparesSupplied = DB::selectOne("SELECT COUNT(DISTINCT CONCAT(ls.LPRID,'|',ls.SpareID)) AS cnt FROM lprspares ls JOIN new_lprs l ON ls.LPRID=l.LPRID WHERE l.LPRDate >= ? AND l.LPRDate <= ? AND ls.ChallanDate IS NOT NULL", [$fyStart, $fyEnd])->cnt; - $onTimeCount = DB::selectOne("SELECT COUNT(DISTINCT CONCAT(ls.LPRID,'|',ls.SpareID)) AS cnt FROM lprspares ls JOIN new_lprs l ON ls.LPRID=l.LPRID WHERE l.LPRDate >= ? AND l.LPRDate <= ? AND ls.ChallanDate IS NOT NULL AND ls.ChallanDate <= ls.DeliveryPeriod", [$fyStart, $fyEnd])->cnt; - $onTimePct = $sparesSupplied > 0 ? round($onTimeCount * 100 / $sparesSupplied) : 0;
Added / After Commit
+ + // ── Dropdown lists for FY selectors ────────────────────────────── + $lprFYs = DB::select("SELECT DISTINCT YEAR(LPRDate) AS FYYear FROM new_lprs WHERE LPRDate IS NOT NULL ORDER BY FYYear DESC"); + $orderFYs = DB::select("SELECT DISTINCT YEAR(OrderDate) AS FYYear FROM lprspares WHERE OrderDate IS NOT NULL ORDER BY FYYear DESC"); + $fundFYs = DB::select("SELECT DISTINCT FYYear FROM ( + SELECT YEAR(AuthorityDate) AS FYYear FROM fundtransactions WHERE AuthorityDate IS NOT NULL + UNION + SELECT YEAR(OrderDate) AS FYYear FROM lprspares WHERE OrderDate IS NOT NULL + ) FY ORDER BY FYYear DESC"); + + // ── KPI Cards ───────────────────────────────────────────────────── + $totalLPRs = DB::selectOne("SELECT COUNT(*) AS cnt FROM new_lprs WHERE LPRDate >= ? AND LPRDate <= ?", [$fyStart, $fyEnd])->cnt; + $sparesDemanded = DB::selectOne("SELECT COUNT(DISTINCT CONCAT(ls.LPRID,'|',ls.SpareID)) AS cnt FROM lprspares ls JOIN new_lprs l ON ls.LPRID=l.LPRID WHERE l.LPRDate >= ? AND l.LPRDate <= ? AND ls.LPRID IS NOT NULL AND ls.SpareID IS NOT NULL", [$fyStart, $fyEnd])->cnt; + $sparesIssued = DB::selectOne("SELECT COUNT(DISTINCT CONCAT(ls.LPRID,'|',ls.SpareID)) AS cnt FROM lprspares ls JOIN new_lprs l ON ls.LPRID=l.LPRID WHERE l.LPRDate >= ? AND l.LPRDate <= ? AND ls.CRVDate IS NOT NULL", [$fyStart, $fyEnd])->cnt; + $orderPlaced = DB::selectOne("SELECT COUNT(DISTINCT OrderNo) AS cnt FROM lprspares WHERE OrderDate >= ? AND OrderDate <= ? AND OrderNo IS NOT NULL AND TRIM(OrderNo) != ''", [$fyStart, $fyEnd])->cnt; + $sparesSupplied = DB::selectOne("SELECT COUNT(DISTINCT CONCAT(ls.LPRID,'|',ls.SpareID)) AS cnt FROM lprspares ls JOIN new_lprs l ON ls.LPRID=l.LPRID WHERE l.LPRDate >= ? AND l.LPRDate <= ? AND ls.ChallanDate IS NOT NULL", [$fyStart, $fyEnd])->cnt; + $onTimeCount = DB::selectOne("SELECT COUNT(DISTINCT CONCAT(ls.LPRID,'|',ls.SpareID)) AS cnt FROM lprspares ls JOIN new_lprs l ON ls.LPRID=l.LPRID WHERE l.LPRDate >= ? AND l.LPRDate <= ? AND ls.ChallanDate IS NOT NULL AND ls.ChallanDate <= ls.DeliveryPeriod", [$fyStart, $fyEnd])->cnt; + $onTimePct = $sparesSupplied > 0 ? round($onTimeCount * 100 / $sparesSupplied) : 0;
Removed / Before Commit
- 'NACValidity' => 'nullable|date', - ]); - - try { - $lprId = DB::transaction(function () use ($request) { - DB::statement("INSERT INTO new_lprs (UserGroupID,UrgencyNo,UrgencyDate,LPRNo,LPRDate,GrantID,NACNo,NACDate,NACValidity) VALUES (?,?,?,?,?,?,?,?,?)", [
Added / After Commit
+ 'NACValidity' => 'nullable|date', + ]); + + $duplicate = DB::table('new_lprs') + ->where('LPRNo', trim($request->LPRNo)) + ->where('UserGroupID', (int) $request->UserGroupID) + ->whereDate('LPRDate', $request->LPRDate) + ->exists(); + + if ($duplicate) { + return response()->json([ + 'success' => false, + 'error' => 'Duplicate LPR exists for the same LPR No., User Group, and LPR Date.', + ], 422); + } + + try { + $lprId = DB::transaction(function () use ($request) {
Removed / Before Commit
- - use App\Http\Controllers\Controller; - use Illuminate\Http\Request; - use Illuminate\Support\Facades\DB; - use App\Helpers\LpoHelper; - - class PendingLprController extends Controller - /** POST /lpr/pending/spare/{spareId}/lock */ - public function lockSpare(Request $request, int $spareId) - { - $price = (float)$request->ProposalPrice; - $gst = (int)$request->GST; - $other = (float)$request->OtherCharges; - $qty = (float)$request->Qty; - - if ($gst < 0 || $gst > 28) { - return response()->json(['success' => false, 'error' => 'GST must be between 0 and 28'], 422); - }
Added / After Commit
+ + use App\Http\Controllers\Controller; + use Illuminate\Http\Request; + use Illuminate\Support\Facades\Auth; + use Illuminate\Support\Facades\DB; + use Illuminate\Support\Facades\Schema; + use App\Helpers\LpoHelper; + + class PendingLprController extends Controller + /** POST /lpr/pending/spare/{spareId}/lock */ + public function lockSpare(Request $request, int $spareId) + { + $request->validate([ + 'ProposalPrice' => 'required|numeric|min:0', + 'GST' => 'required|numeric|min:0|max:28', + 'OtherCharges' => 'nullable|numeric|min:0', + 'Qty' => 'required|numeric|min:0.01', + 'Reason' => 'nullable|string|max:50',
Removed / Before Commit
- MAX(lp.GEMCNo) AS GEMCNo, - MAX(lp.OrderDate) AS OrderDate, - MAX(lp.DeliveryPeriod) AS DeliveryPeriod, - SUM(COALESCE(lp.Qty,0) * COALESCE(lp.OrderPrice,0)) AS OrderAmount, - COALESCE(MAX(v.VendorName),'') AS VendorName, - COALESCE(MAX(c.FinPower),'') AS FinPower, - COALESCE(MAX(c.CaseNo),'') AS CaseNo,
Added / After Commit
+ MAX(lp.GEMCNo) AS GEMCNo, + MAX(lp.OrderDate) AS OrderDate, + MAX(lp.DeliveryPeriod) AS DeliveryPeriod, + SUM(ROUND(COALESCE(lp.Qty,0) * COALESCE(lp.OrderPrice,0) * (1 + COALESCE(lp.FinalGST,0) / 100), 2)) AS OrderAmount, + COALESCE(MAX(v.VendorName),'') AS VendorName, + COALESCE(MAX(c.FinPower),'') AS FinPower, + COALESCE(MAX(c.CaseNo),'') AS CaseNo,
Removed / Before Commit
- MAX(lp.GEMCNo) AS GEMCNo, - DATE_FORMAT(MAX(lp.OrderDate), '%d-%m-%Y') AS OrderDate, - DATE_FORMAT(MAX(lp.DeliveryPeriod), '%d-%m-%Y') AS DeliveryPeriod, - SUM(COALESCE(lp.Qty,0) * COALESCE(lp.OrderPrice,0)) AS OrderAmount, - COALESCE(MAX(v.VendorName),'') AS VendorName - FROM lprspares lp - LEFT JOIN vendors v ON lp.L1VendorID = v.VendorID
Added / After Commit
+ MAX(lp.GEMCNo) AS GEMCNo, + DATE_FORMAT(MAX(lp.OrderDate), '%d-%m-%Y') AS OrderDate, + DATE_FORMAT(MAX(lp.DeliveryPeriod), '%d-%m-%Y') AS DeliveryPeriod, + SUM(ROUND(COALESCE(lp.Qty,0) * COALESCE(lp.OrderPrice,0) * (1 + COALESCE(lp.FinalGST,0) / 100), 2)) AS OrderAmount, + COALESCE(MAX(v.VendorName),'') AS VendorName + FROM lprspares lp + LEFT JOIN vendors v ON lp.L1VendorID = v.VendorID
Removed / Before Commit
- "SELECT - DATE_FORMAT(MAX(lp.OrderDate), '%d-%m-%Y') AS OrderDate, - DATE_FORMAT(MAX(lp.DeliveryPeriod), '%d-%m-%Y') AS DeliveryPeriodStr, - COALESCE(SUM(lp.Qty * lp.OrderPrice), 0) AS OrderAmount, - COALESCE(GROUP_CONCAT(DISTINCT v.VendorName ORDER BY v.VendorName SEPARATOR ', '), 'N/A') AS VendorName, - COALESCE(MAX(lp.VendorLetterNo), '') AS VendorLetterNo, - DATE_FORMAT(MAX(lp.VendorLetterDate), '%d-%m-%Y') AS VendorLetterDateStr,
Added / After Commit
+ "SELECT + DATE_FORMAT(MAX(lp.OrderDate), '%d-%m-%Y') AS OrderDate, + DATE_FORMAT(MAX(lp.DeliveryPeriod), '%d-%m-%Y') AS DeliveryPeriodStr, + COALESCE(SUM(ROUND(COALESCE(lp.Qty,0) * COALESCE(lp.OrderPrice,0) * (1 + COALESCE(lp.FinalGST,0) / 100), 2)), 0) AS OrderAmount, + COALESCE(GROUP_CONCAT(DISTINCT v.VendorName ORDER BY v.VendorName SEPARATOR ', '), 'N/A') AS VendorName, + COALESCE(MAX(lp.VendorLetterNo), '') AS VendorLetterNo, + DATE_FORMAT(MAX(lp.VendorLetterDate), '%d-%m-%Y') AS VendorLetterDateStr,
Removed / Before Commit
- DATE_FORMAT(MAX(lp.OrderDate), '%d-%m-%Y') AS OrderDate, - GROUP_CONCAT(DISTINCT lp.GEMCNo ORDER BY lp.GEMCNo SEPARATOR ', ') AS GEMCNo, - DATE_FORMAT(MAX(lp.DeliveryPeriod), '%d-%m-%Y') AS DeliveryPeriod, - SUM(lp.Qty * lp.OrderPrice) AS OrderAmount, - GROUP_CONCAT(DISTINCT v.VendorName ORDER BY v.VendorName SEPARATOR ', ') AS VendorName, - MAX(c.CaseNo) AS CaseNo, - MAX(pr.ProcRule) AS ProcType, - DATE_FORMAT(MAX(coi.OrderDate), '%d-%m-%Y') AS OrderDate, - GROUP_CONCAT(DISTINCT coi.GEMCNo ORDER BY coi.GEMCNo SEPARATOR ', ') AS GEMCNo, - MAX(coi.DeliveryPeriod) AS DeliveryPeriod, - SUM(coi.Qty * coi.OrderPrice) AS OrderAmount, - GROUP_CONCAT(DISTINCT v.VendorName ORDER BY v.VendorName SEPARATOR ', ') AS VendorName, - MAX(c.CaseNo) AS CaseNo, - MAX(pr.ProcRule) AS ProcType,
Added / After Commit
+ DATE_FORMAT(MAX(lp.OrderDate), '%d-%m-%Y') AS OrderDate, + GROUP_CONCAT(DISTINCT lp.GEMCNo ORDER BY lp.GEMCNo SEPARATOR ', ') AS GEMCNo, + DATE_FORMAT(MAX(lp.DeliveryPeriod), '%d-%m-%Y') AS DeliveryPeriod, + SUM(ROUND(COALESCE(lp.Qty,0) * COALESCE(lp.OrderPrice,0) * (1 + COALESCE(lp.FinalGST,0) / 100), 2)) AS OrderAmount, + GROUP_CONCAT(DISTINCT v.VendorName ORDER BY v.VendorName SEPARATOR ', ') AS VendorName, + MAX(c.CaseNo) AS CaseNo, + MAX(pr.ProcRule) AS ProcType, + DATE_FORMAT(MAX(coi.OrderDate), '%d-%m-%Y') AS OrderDate, + GROUP_CONCAT(DISTINCT coi.GEMCNo ORDER BY coi.GEMCNo SEPARATOR ', ') AS GEMCNo, + MAX(coi.DeliveryPeriod) AS DeliveryPeriod, + SUM(ROUND(COALESCE(coi.Qty,0) * COALESCE(coi.OrderPrice,0) * (1 + COALESCE(lp.FinalGST,0) / 100), 2)) AS OrderAmount, + GROUP_CONCAT(DISTINCT v.VendorName ORDER BY v.VendorName SEPARATOR ', ') AS VendorName, + MAX(c.CaseNo) AS CaseNo, + MAX(pr.ProcRule) AS ProcType,
Removed / Before Commit
- "SELECT - COALESCE(v.VendorName,'N/A') AS VendorName, - DATE_FORMAT(MAX(ls.OrderDate), '%d-%m-%Y') AS OrderDate, - COALESCE(SUM(ls.Qty * ls.OrderPrice), 0) AS OrderAmount - FROM lprspares ls - INNER JOIN new_lprs l ON ls.LPRID = l.LPRID - INNER JOIN cases c ON l.CaseNoID = c.CaseID
Added / After Commit
+ "SELECT + COALESCE(v.VendorName,'N/A') AS VendorName, + DATE_FORMAT(MAX(ls.OrderDate), '%d-%m-%Y') AS OrderDate, + COALESCE(SUM(ROUND(COALESCE(ls.Qty,0) * COALESCE(ls.OrderPrice,0) * (1 + COALESCE(ls.FinalGST,0) / 100), 2)), 0) AS OrderAmount + FROM lprspares ls + INNER JOIN new_lprs l ON ls.LPRID = l.LPRID + INNER JOIN cases c ON l.CaseNoID = c.CaseID
Removed / Before Commit
- - if ($caseId) { - $caseDetails = DB::selectOne("SELECT c.BidNo,c.BidDate,c.BidOpeningDate AS BidOpenedOn, COALESCE(c.RANo,'') AS RANo, c.RADt, COALESCE(d.Designation,'') AS CFA, COALESCE(c.FinPower,'') AS FinPower FROM cases c LEFT JOIN designation d ON c.DesignationID=d.DesignationID WHERE c.CaseID=?", [$caseId]); - $orderRows = DB::select("SELECT ls.LPRSpareID, COALESCE(s.Section,'') AS Section, COALESCE(s.PartNo,'') AS PartNo, COALESCE(s.Nomenclature,'') AS Nomenclature, COALESCE(s.AUID,'') AS AUID, COALESCE(ls.Qty,0) AS Qty, COALESCE(ls.OrderPrice,0) AS OrderPrice, COALESCE(ls.Qty,0)*COALESCE(ls.OrderPrice,0) AS TotalOrderAmount, COALESCE(v.VendorName,'') AS L1Vendor, COALESCE(ls.GEMCNo,'') AS GEMCNo, COALESCE(ls.OrderNo,'') AS OrderNo, ls.OrderDate, ls.NoOfDays, ls.DeliveryPeriod, COALESCE(g.GrantName,'') AS GrantName FROM cases c INNER JOIN new_lprs l ON c.CaseID=l.CaseNoID INNER JOIN lprspares ls ON l.LPRID=ls.LPRID INNER JOIN spares s ON ls.SpareID=s.SpareID LEFT JOIN vendors v ON ls.L1VendorID=v.VendorID LEFT JOIN new_grants g ON l.GrantID=g.GrantID WHERE c.CaseID=? ORDER BY COALESCE(s.Section,''),s.PartNo", [$caseId]); - $orderSummary = DB::select("SELECT ls.OrderNo, MAX(ls.OrderDate) AS OrderDate, COALESCE(v.VendorName,'Various') AS VendorName, SUM(ls.Qty*ls.OrderPrice) AS TotalAmount FROM cases c INNER JOIN new_lprs l ON c.CaseID=l.CaseNoID INNER JOIN lprspares ls ON l.LPRID=ls.LPRID LEFT JOIN vendors v ON ls.L1VendorID=v.VendorID WHERE c.CaseID=? AND ls.OrderNo IS NOT NULL AND TRIM(OrderNo)!='' AND ls.OrderPrice IS NOT NULL AND ls.Qty IS NOT NULL GROUP BY ls.OrderNo,v.VendorName ORDER BY MAX(ls.OrderDate) DESC,ls.OrderNo", [$caseId]); - - // Format dates - foreach ($orderRows as $r) {
Added / After Commit
+ + if ($caseId) { + $caseDetails = DB::selectOne("SELECT c.BidNo,c.BidDate,c.BidOpeningDate AS BidOpenedOn, COALESCE(c.RANo,'') AS RANo, c.RADt, COALESCE(d.Designation,'') AS CFA, COALESCE(c.FinPower,'') AS FinPower FROM cases c LEFT JOIN designation d ON c.DesignationID=d.DesignationID WHERE c.CaseID=?", [$caseId]); + $orderRows = DB::select("SELECT ls.LPRSpareID, COALESCE(s.Section,'') AS Section, COALESCE(s.PartNo,'') AS PartNo, COALESCE(s.Nomenclature,'') AS Nomenclature, COALESCE(s.AUID,'') AS AUID, COALESCE(ls.Qty,0) AS Qty, COALESCE(ls.OrderPrice,0) AS OrderPrice, CASE WHEN ls.OrderPrice IS NULL THEN 0 ELSE ROUND(COALESCE(ls.Qty,0)*COALESCE(ls.OrderPrice,0)*(1+COALESCE(ls.FinalGST,0)/100),2) END AS TotalOrderAmount, COALESCE(v.VendorName,'') AS L1Vendor, COALESCE(ls.GEMCNo,'') AS GEMCNo, COALESCE(ls.OrderNo,'') AS OrderNo, ls.OrderDate, ls.NoOfDays, ls.DeliveryPeriod, COALESCE(g.GrantName,'') AS GrantName FROM cases c INNER JOIN new_lprs l ON c.CaseID=l.CaseNoID INNER JOIN lprspares ls ON l.LPRID=ls.LPRID INNER JOIN spares s ON ls.SpareID=s.SpareID LEFT JOIN vendors v ON ls.L1VendorID=v.VendorID LEFT JOIN new_grants g ON l.GrantID=g.GrantID WHERE c.CaseID=? ORDER BY COALESCE(s.Section,''),s.PartNo", [$caseId]); + $orderSummary = DB::select("SELECT ls.OrderNo, MAX(ls.OrderDate) AS OrderDate, COALESCE(v.VendorName,'Various') AS VendorName, SUM(ROUND(COALESCE(ls.Qty,0)*COALESCE(ls.OrderPrice,0)*(1+COALESCE(ls.FinalGST,0)/100),2)) AS TotalAmount FROM cases c INNER JOIN new_lprs l ON c.CaseID=l.CaseNoID INNER JOIN lprspares ls ON l.LPRID=ls.LPRID LEFT JOIN vendors v ON ls.L1VendorID=v.VendorID WHERE c.CaseID=? AND ls.OrderNo IS NOT NULL AND TRIM(OrderNo)!='' AND ls.OrderPrice IS NOT NULL AND ls.Qty IS NOT NULL GROUP BY ls.OrderNo,v.VendorName ORDER BY MAX(ls.OrderDate) DESC,ls.OrderNo", [$caseId]); + + // Format dates + foreach ($orderRows as $r) {
Removed / Before Commit
- // ── Shared case loader ───────────────────────────────────────────────── - private function caseData(int $caseId): object - { - $case = DB::selectOne("SELECT c.*, d.Designation AS CFA, d.ICNo, d.Rank, d.OffrsName, g.GrantName, pr.ProcRule FROM cases c LEFT JOIN (SELECT l.GrantID FROM new_lprs l WHERE l.CaseNoID=? LIMIT 1) lg ON 1=1 LEFT JOIN designation d ON c.DesignationID=d.DesignationID LEFT JOIN new_grants g ON lg.GrantID=g.GrantID LEFT JOIN ProcRules pr ON c.ProcRuleID=pr.ProcRuleID WHERE c.CaseID=?", [$caseId, $caseId]); - abort_if(!$case, 404, 'Case not found'); - return $case; - } - - COALESCE(SP.PartNo,'') AS PartNo, - COALESCE(SP.Nomenclature,'') AS Nomenclature, - COALESCE(AU.AUName,'') AS AU, - COALESCE(LPS.Qty,0) AS Qty, - COALESCE(LPS.OrderPrice,0) AS OrderPrice, - COALESCE(LPS.FinalGST,0) AS FinalGST, - COALESCE(LPS.TotalOrderAmount,0) AS TotalOrderAmount, - COALESCE(V.VendorName,'') AS VendorName - FROM cases C - INNER JOIN new_lprs L ON C.CaseID=L.CaseNoID
Added / After Commit
+ // ── Shared case loader ───────────────────────────────────────────────── + private function caseData(int $caseId): object + { + $case = DB::selectOne(" + SELECT + c.*, + d.Designation AS CFA, + d.ICNo, + d.Rank, + d.OffrsName, + g.GrantName, + g.MinorHead, + g.CodeHead, + g.Schedule, + g.SubSchedule, + pr.ProcRule, + lpr.GrantID, + lpr.LPRNo,
Removed / Before Commit
- COALESCE(au.AUName, '') AS AUName, - SUM(COALESCE(ls.Qty, 0)) AS TotalQty, - AVG(COALESCE(ls.OrderPrice, 0)) AS AvgOrderPrice, - SUM(COALESCE(ls.TotalOrderAmount, COALESCE(ls.Qty, 0) * COALESCE(ls.OrderPrice, 0), 0)) AS TotalOrderAmount - FROM lprspares ls - INNER JOIN new_lprs l ON ls.LPRID = l.LPRID - LEFT JOIN new_grants g ON l.GrantID = g.GrantID - LEFT JOIN UserGroups ug ON l.UserGroupID = ug.UserGroupID - LEFT JOIN eqpts e ON j.EqptID = e.EqptID - WHERE l.LPRDate IS NOT NULL - AND COALESCE(ls.TotalOrderAmount, COALESCE(ls.Qty, 0) * COALESCE(ls.OrderPrice, 0), 0) > 0 - GROUP BY - COALESCE(g.GrantName, ''), - COALESCE(sp.AUID, ''),
Added / After Commit
+ COALESCE(au.AUName, '') AS AUName, + SUM(COALESCE(ls.Qty, 0)) AS TotalQty, + AVG(COALESCE(ls.OrderPrice, 0)) AS AvgOrderPrice, + SUM(CASE WHEN ls.OrderPrice IS NULL THEN 0 ELSE ROUND(COALESCE(ls.Qty, 0) * COALESCE(ls.OrderPrice, 0) * (1 + COALESCE(ls.FinalGST, 0) / 100), 2) END) AS TotalOrderAmount + FROM lprspares ls + INNER JOIN new_lprs l ON ls.LPRID = l.LPRID + LEFT JOIN new_grants g ON l.GrantID = g.GrantID + LEFT JOIN UserGroups ug ON l.UserGroupID = ug.UserGroupID + LEFT JOIN eqpts e ON j.EqptID = e.EqptID + WHERE l.LPRDate IS NOT NULL + AND CASE WHEN ls.OrderPrice IS NULL THEN 0 ELSE ROUND(COALESCE(ls.Qty, 0) * COALESCE(ls.OrderPrice, 0) * (1 + COALESCE(ls.FinalGST, 0) / 100), 2) END > 0 + GROUP BY + COALESCE(g.GrantName, ''), + COALESCE(sp.AUID, ''),
Removed / Before Commit
- COALESCE(v.VendorName, '') AS VendorName, - COALESCE(g.GrantName, '') AS GrantName, - COALESCE(ug.UserGroupName, '') AS UserGroupName, - COALESCE(ls.TotalOrderAmount, COALESCE(ls.Qty, 0) * COALESCE(ls.OrderPrice, 0), 0) AS OrderAmount, - ls.DeliveryPeriod, - ls.ChallanDate, - ls.CRVDate,
Added / After Commit
+ COALESCE(v.VendorName, '') AS VendorName, + COALESCE(g.GrantName, '') AS GrantName, + COALESCE(ug.UserGroupName, '') AS UserGroupName, + CASE WHEN ls.OrderPrice IS NULL THEN 0 ELSE ROUND(COALESCE(ls.Qty, 0) * COALESCE(ls.OrderPrice, 0) * (1 + COALESCE(ls.FinalGST, 0) / 100), 2) END AS OrderAmount, + ls.DeliveryPeriod, + ls.ChallanDate, + ls.CRVDate,
Removed / Before Commit
- ]); - } - - public function printFormatOne(FinanceSalarySnapshot $salarySnapshot) - { - return view('finance-salaries.print-format-one', [ - 'snapshot' => $salarySnapshot, - 'salary' => $salarySnapshot->salary_json, - ]); - } - - public function printFormatTwo(FinanceSalarySnapshot $salarySnapshot) - { - return view('finance-salaries.print-single', [ - 'snapshot' => $salarySnapshot, - 'salary' => $salarySnapshot->salary_json, - ]);
Added / After Commit
+ ]); + } + + public function printFormatOne(FinanceSalarySnapshot $salarySnapshot, SalaryCalculationService $salaryService) + { + $salarySnapshot->load('employee.designation', 'employee.employeeCategory', 'employee.user.group', 'employee.financeDetail', 'employee.financePaymentRecovery'); + $salary = $salarySnapshot->salary_json ?: []; + $month = (int) data_get($salary, 'period.month', $salarySnapshot->month); + $year = (int) data_get($salary, 'period.year', $salarySnapshot->year); + + if ($salarySnapshot->employee && $month && $year) { + $salarySnapshot = $salaryService->generateForStaff($salarySnapshot->employee, $month, $year, true); + } + + return view('finance-salaries.print-format-one', [ + 'snapshot' => $salarySnapshot, + 'salary' => $salarySnapshot->salary_json, + ]);
Removed / Before Commit
- 'au' => 'nullable|string|max:255', - 'page_no' => 'nullable|string|max:255', - 'grant' => 'nullable|string|max:255', - - 'purchase_type' => 'required|in:COD,LPR', - 'purchase_date' => 'required|date', - ]); - - if ($validator->fails()) { - return redirect()->back() - ->withErrors($validator) - ->withInput(); - } - - // Generate RV number - $rvNumber = StoreInventory::generateRVNumber(); - - $quantity = (int) $request->input('quantity', 1);
Added / After Commit
+ 'au' => 'nullable|string|max:255', + 'page_no' => 'nullable|string|max:255', + 'grant' => 'nullable|string|max:255', + 'rv_number' => 'required|string|max:255', + + 'purchase_type' => 'required|in:COD,LPR', + 'purchase_date' => 'required|date', + ]); + + if ($validator->fails()) { + if ($request->ajax() || $request->wantsJson()) { + return response()->json([ + 'success' => false, + 'message' => 'Validation failed', + 'errors' => $validator->errors() + ], 422); + } +
Removed / Before Commit
- if ($job) - { - $equipments = $job->equipments() - ->where('status', 'INITATE TO WCN') - ->whereNull('wcn_number') // ✅ jinka wcn_number null hai - ->whereHas('qcInspection') - { - - $committedData = $job->equipments()->whereNotNull('wcn_number') - ->with(['workOrder', 'qcInspection']) // optional eager loading - ->get(); - } - } - // In your controller - public function committedHtml($jobNo) - { - $committedData = WorkEquipment::where('work_order_id', $jobNo)->whereNotNull('wcn_number') - ->where('wcn_committed', 0)->get();
Added / After Commit
+ if ($job) + { + $equipments = $job->equipments() + ->with(['workOrder.workUnit.units', 'group', 'Equipments', 'CrcEquipments', 'qcInspection.mr']) + ->where('status', 'INITATE TO WCN') + ->whereNull('wcn_number') // ✅ jinka wcn_number null hai + ->whereHas('qcInspection') + { + + $committedData = $job->equipments()->whereNotNull('wcn_number') + ->with(['workOrder.workUnit.units', 'group', 'Equipments', 'CrcEquipments', 'qcInspection.mr']) + ->get(); + } + } + // In your controller + public function committedHtml($jobNo) + { + $committedData = WorkEquipment::with(['workOrder.workUnit.units', 'group', 'Equipments', 'qcInspection.mr'])
Removed / Before Commit
- namespace App\Imports; - - use App\Models\CrcPartMaster; - use Maatwebsite\Excel\Concerns\ToModel; - use Maatwebsite\Excel\Concerns\WithHeadingRow; - - class CrcPartMasterImport implements ToModel, WithHeadingRow - { - public function model(array $row) - { - return new CrcPartMaster([ - 'part_no' => $row['part_no'], - 'equipment_name' => $row['equipment_name'], - 'nomenclature' => $row['nomenclature'], - 'hours' => $row['hours'], - ]); - } - }
Added / After Commit
+ namespace App\Imports; + + use App\Models\CrcPartMaster; + use App\Models\Equipment; + use App\Models\Group; + use Illuminate\Support\Collection; + use Illuminate\Support\Facades\DB; + use Maatwebsite\Excel\Concerns\ToCollection; + use Maatwebsite\Excel\Concerns\WithChunkReading; + use Maatwebsite\Excel\Concerns\WithHeadingRow; + use RuntimeException; + + class CrcPartMasterImport implements ToCollection, WithHeadingRow, WithChunkReading + { + public int $created = 0; + public int $skipped = 0; + public int $duplicates = 0; + public int $equipmentCreated = 0;
Removed / Before Commit
- 'equipment_name', - 'nomenclature', - 'hours', - ]; - } - \ No newline at end of file
Added / After Commit
+ 'equipment_name', + 'nomenclature', + 'hours', + 'excel_row_data', + ]; + \ No newline at end of file + + protected $casts = [ + 'excel_row_data' => 'array', + ]; + }
Removed / Before Commit
- use HasFactory; - - protected $fillable = [ - 'deduction_title', - 'amount', - 'month', - 'month' => 'integer', - 'year' => 'integer', - ]; - }
Added / After Commit
+ use HasFactory; + + protected $fillable = [ + 'employee_category_id', + 'deduction_title', + 'amount', + 'month', + 'month' => 'integer', + 'year' => 'integer', + ]; + + public function employeeCategory() + { + return $this->belongsTo(EmployeeCategory::class); + } + }
Removed / Before Commit
- 'total_tax', - 'tax_tds', - 'monthly_tax', - 'da_arrear', - 'tuition_fee', - 'arrears_of_pay',
Added / After Commit
+ 'total_tax', + 'tax_tds', + 'monthly_tax', + 'tax_regime_type', + 'da_arrear', + 'tuition_fee', + 'arrears_of_pay',
Removed / Before Commit
- 'govt_accommodation', - 'special_pay', - 'risk_allowance', - 'wash', - 'misc_nps', - 'misc_pay', - 'govt_accommodation' => 'boolean', - 'special_pay' => 'decimal:2', - 'risk_allowance' => 'decimal:2', - 'wash' => 'decimal:2', - 'misc_nps' => 'decimal:2', - 'misc_pay' => 'decimal:2',
Added / After Commit
+ 'govt_accommodation', + 'special_pay', + 'risk_allowance', + 'dress_allowance', + 'night_duty_allowance', + 'wash', + 'misc_nps', + 'misc_pay', + 'govt_accommodation' => 'boolean', + 'special_pay' => 'decimal:2', + 'risk_allowance' => 'decimal:2', + 'dress_allowance' => 'decimal:2', + 'night_duty_allowance' => 'decimal:2', + 'wash' => 'decimal:2', + 'misc_nps' => 'decimal:2', + 'misc_pay' => 'decimal:2',
Removed / Before Commit
- 'ot', - 'nda', - 'bonus', - 'medical_claim', - 'misc_supplementary', - 'misc_supplementary_remark', - 'ot' => 'decimal:2', - 'nda' => 'decimal:2', - 'bonus' => 'decimal:2', - 'medical_claim' => 'decimal:2', - 'misc_supplementary' => 'decimal:2', - 'active_fields' => 'array',
Added / After Commit
+ 'ot', + 'nda', + 'bonus', + 'washing_allowance', + 'plb', + 'medical_claim', + 'misc_supplementary', + 'misc_supplementary_remark', + 'ot' => 'decimal:2', + 'nda' => 'decimal:2', + 'bonus' => 'decimal:2', + 'washing_allowance' => 'decimal:2', + 'plb' => 'decimal:2', + 'medical_claim' => 'decimal:2', + 'misc_supplementary' => 'decimal:2', + 'active_fields' => 'array',
Removed / Before Commit
- - use Illuminate\Database\Eloquent\Factories\HasFactory; - use Illuminate\Database\Eloquent\Model; - - class LeaveType extends Model - { - 'deduction_rule' => 'array', - ]; - - public function designations() - { - return $this->belongsToMany(Designation::class, 'designation_leave_type')
Added / After Commit
+ + use Illuminate\Database\Eloquent\Factories\HasFactory; + use Illuminate\Database\Eloquent\Model; + use App\Models\EmployeeCategory; + use App\Models\Staff; + + class LeaveType extends Model + { + 'deduction_rule' => 'array', + ]; + + protected $appends = [ + 'category_label', + 'effective_duration_type', + ]; + + public const ALL_CATEGORY_VALUE = 'Both'; +
Removed / Before Commit
- }]) - ->get(); - - $menus = $mergePersonalMenus($menus); - } elseif ($user) { - $menus = $defaultPersonalMenus(); - } else { - $menus = collect(); - }
Added / After Commit
+ }]) + ->get(); + + } elseif ($user) { + $menus = collect(); + } else { + $menus = collect(); + }
Removed / Before Commit
- * @param int $leaveDays - * @return array ['valid' => bool, 'message' => string] - */ - public function validateLeaveApplication(Staff $employee, LeaveType $leaveType, $startDate, $endDate, $leaveDays) - { - - // 1. Check if leave type is active - ->where('leave_type_id', $leaveType->id) - ->whereBetween('from_date', [$fyStart->toDateString(), $fyEnd->toDateString()]) - ->whereIn('status', ['approved', 'pending']) - ->sum('total_days'); - - // Calculate available balance - // 6. Check for overlapping leaves - $overlappingLeaves = Leave::where('employee_id', $employee->id) - ->whereIn('status', ['approved', 'pending']) - ->where(function($query) use ($startDate, $endDate) { - $query->whereBetween('from_date', [$startDate, $endDate])
Added / After Commit
+ * @param int $leaveDays + * @return array ['valid' => bool, 'message' => string] + */ + public function validateLeaveApplication(Staff $employee, LeaveType $leaveType, $startDate, $endDate, $leaveDays, $excludeLeaveId = null) + { + + // 1. Check if leave type is active + ->where('leave_type_id', $leaveType->id) + ->whereBetween('from_date', [$fyStart->toDateString(), $fyEnd->toDateString()]) + ->whereIn('status', ['approved', 'pending']) + ->when($excludeLeaveId, fn ($query) => $query->where('id', '!=', $excludeLeaveId)) + ->sum('total_days'); + + // Calculate available balance + // 6. Check for overlapping leaves + $overlappingLeaves = Leave::where('employee_id', $employee->id) + ->whereIn('status', ['approved', 'pending']) + ->when($excludeLeaveId, fn ($query) => $query->where('id', '!=', $excludeLeaveId))
Removed / Before Commit
- use App\Models\FinanceInduDeduction; - use App\Models\FinanceSalarySnapshot; - use App\Models\FinanceSupplementaryPayment; - use App\Models\Staff; - use Carbon\Carbon; - use Illuminate\Support\Facades\DB; - $snapshot['totals']['deduction_total'] = $this->roundAmount(array_sum($snapshot['deductions'])); - $snapshot['totals']['recovery_total'] = $this->roundAmount(array_sum($snapshot['recoveries'])); - $snapshot['totals']['net_pay'] = $this->roundAmount($snapshot['totals']['gross_total'] - $snapshot['totals']['deduction_total']); - $snapshot['totals']['pay_in_hand'] = $this->roundAmount($snapshot['totals']['net_pay'] - $snapshot['totals']['recovery_total']); - } - - return FinanceSalarySnapshot::updateOrCreate( - ->orderByDesc('effective_from') - ->value('percentage') ?? $this->ruleValue('da_percentage', 58)); - $attendance = $this->attendanceSummary($staff, $month, $year); - $earnedBasic = $this->roundAmount($basic * $attendance['present_days'] / max(1, $attendance['total_working_days'])); -
Added / After Commit
+ use App\Models\FinanceInduDeduction; + use App\Models\FinanceSalarySnapshot; + use App\Models\FinanceSupplementaryPayment; + use App\Models\Leave; + use App\Models\Staff; + use Carbon\Carbon; + use Illuminate\Support\Facades\DB; + $snapshot['totals']['deduction_total'] = $this->roundAmount(array_sum($snapshot['deductions'])); + $snapshot['totals']['recovery_total'] = $this->roundAmount(array_sum($snapshot['recoveries'])); + $snapshot['totals']['net_pay'] = $this->roundAmount($snapshot['totals']['gross_total'] - $snapshot['totals']['deduction_total']); + $snapshot['totals']['pay_in_hand'] = $this->roundAmount($snapshot['totals']['net_pay']); + } + + return FinanceSalarySnapshot::updateOrCreate( + ->orderByDesc('effective_from') + ->value('percentage') ?? $this->ruleValue('da_percentage', 58)); + $attendance = $this->attendanceSummary($staff, $month, $year); + $leaveBalances = $this->leaveBalances($staff);
Removed / Before Commit
- 'Sub Eqpt', - 'Regd No', - 'Repair Class', - 'Job No', - 'Job Date', - 'Status', - $equipment->assy ?? '-', - $equipment->regd_no ?? '-', - $equipment->RepairClass?->name ?? '-', - $workOrder?->job_no ?? '-', - $workOrder?->job_date ?? '-', - $equipment->status ?? '-',
Added / After Commit
+ 'Sub Eqpt', + 'Regd No', + 'Repair Class', + 'Control No', + 'Control Date', + 'Job No', + 'Job Date', + 'Status', + $equipment->assy ?? '-', + $equipment->regd_no ?? '-', + $equipment->RepairClass?->name ?? '-', + $workOrder?->control_no ?? '-', + $workOrder?->control_date ?? '-', + $workOrder?->job_no ?? '-', + $workOrder?->job_date ?? '-', + $equipment->status ?? '-',
Removed / Before Commit
- 'nps_individual_percentage' => 10, - 'ups_govt_percentage' => 10, - 'ups_individual_percentage' => 10, - 'tpt_low_amount' => 900, - 'tpt_low_handicapped_amount' => 1800, - 'tpt_high_amount' => 1800, - 'tpt_high_handicapped_amount' => 3600, - ]; - - foreach ($defaults as $key => $fallback) {
Added / After Commit
+ 'nps_individual_percentage' => 10, + 'ups_govt_percentage' => 10, + 'ups_individual_percentage' => 10, + 'tpt_level_1_2_low_basic_amount' => 900, + 'tpt_level_1_2_high_basic_amount' => 1800, + 'tpt_level_3_8_amount' => 1800, + 'tpt_level_9_plus_amount' => 3600, + ]; + + foreach ($defaults as $key => $fallback) {
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('finance_deduction_titles', function (Blueprint $table) { + $table->foreignId('employee_category_id') + ->nullable() + ->after('id') + ->constrained('employee_categories') + ->nullOnDelete(); + + $table->dropUnique('finance_deduction_titles_unique_period');
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 + { + $rules = [ + 'tpt_level_1_2_low_basic_amount' => [ + 'value' => DB::table('finance_salary_rules')->where('rule_key', 'tpt_low_amount')->value('rule_value') ?? 900, + 'description' => 'TPT for level 1 and 2 with basic pay up to 24199', + ], + 'tpt_level_1_2_high_basic_amount' => [ + 'value' => DB::table('finance_salary_rules')->where('rule_key', 'tpt_high_amount')->value('rule_value') ?? 1800, + 'description' => 'TPT for level 1 and 2 with basic pay 24200 and above', + ],
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('finance_payment_recoveries', function (Blueprint $table) { + if (!Schema::hasColumn('finance_payment_recoveries', 'tax_regime_type')) { + $table->string('tax_regime_type', 20)->nullable()->after('monthly_tax'); + } + }); + } + + public function down(): void
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('finance_staff_details', function (Blueprint $table) { + if (!Schema::hasColumn('finance_staff_details', 'dress_allowance')) { + $table->decimal('dress_allowance', 12, 2)->nullable()->after('risk_allowance'); + } + + if (!Schema::hasColumn('finance_staff_details', 'night_duty_allowance')) { + $table->decimal('night_duty_allowance', 12, 2)->nullable()->after('dress_allowance');
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('finance_supplementary_payments', function (Blueprint $table) { + if (!Schema::hasColumn('finance_supplementary_payments', 'washing_allowance')) { + $table->decimal('washing_allowance', 12, 2)->default(0)->after('medical_claim'); + } + + if (!Schema::hasColumn('finance_supplementary_payments', 'plb')) { + $table->decimal('plb', 12, 2)->default(0)->after('washing_allowance'); + }
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('crc_part_master', function (Blueprint $table) { + if (! Schema::hasColumn('crc_part_master', 'excel_row_data')) { + $table->json('excel_row_data')->nullable()->after('hours'); + } + }); + } + + public function down(): void
Removed / Before Commit
Added / After Commit
+ -- Army509 finance staff rules update + -- Run this SQL on the target MySQL database before/with the included PHP files. + + DELIMITER $$ + + DROP PROCEDURE IF EXISTS add_column_if_missing $$ + CREATE PROCEDURE add_column_if_missing( + IN table_name_param VARCHAR(64), + IN column_name_param VARCHAR(64), + IN column_definition_param TEXT + ) + BEGIN + IF NOT EXISTS ( + SELECT 1 + FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() + AND TABLE_NAME = table_name_param + AND COLUMN_NAME = column_name_param
Removed / Before Commit
Added / After Commit
+ -- Army509 finance updates + -- Date: 2026-06-25 + -- Purpose: Add employee-category wise deduction titles. + + ALTER TABLE finance_deduction_titles + ADD COLUMN employee_category_id BIGINT UNSIGNED NULL AFTER id; + + ALTER TABLE finance_deduction_titles + DROP INDEX finance_deduction_titles_unique_period; + + ALTER TABLE finance_deduction_titles + ADD CONSTRAINT finance_deduction_titles_employee_category_id_foreign + FOREIGN KEY (employee_category_id) REFERENCES employee_categories(id) + ON DELETE SET NULL; + + ALTER TABLE finance_deduction_titles + ADD UNIQUE KEY finance_deduction_titles_category_period_unique + (employee_category_id, deduction_title, month, year);
Removed / Before Commit
Added / After Commit
+ -- Army509 post-zip payment/recovery tax updates + -- Date: 2026-06-25 + -- Run after applying public/army509_finance_updates_2026_06_25.zip + + ALTER TABLE finance_payment_recoveries + ADD COLUMN tax_regime_type VARCHAR(20) NULL AFTER monthly_tax; + + START TRANSACTION; + + DELETE FROM tax_slab_masters; + DELETE FROM tax_regime_masters; + + INSERT INTO tax_regime_masters + (regime_name, regime_type, financial_year, description, minimum_income, standard_deduction, cess_percentage, surcharge_percentage, surcharge_income_threshold, is_active, created_at, updated_at) + VALUES + ('Old Regime FY 2025-2026', 'old', '2025-2026', 'India Govt old tax regime for salaried individuals. Standard deduction Rs 50,000, rebate up to taxable income Rs 5,00,000, cess 4%.', 500000.00, 50000.00, 4.00, 0.00, NULL, 1, NOW(), NOW()); + + SET @old_regime_id = LAST_INSERT_ID();
Removed / Before Commit
Added / After Commit
+ -- Army509 salary print/payment-recovery update + -- Date: 2026-06-27 + -- Run this on the target MySQL database if these columns/rules are not already present. + + DELIMITER $$ + + DROP PROCEDURE IF EXISTS add_column_if_missing $$ + CREATE PROCEDURE add_column_if_missing( + IN table_name_param VARCHAR(64), + IN column_name_param VARCHAR(64), + IN column_definition_param TEXT + ) + BEGIN + IF NOT EXISTS ( + SELECT 1 + FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() + AND TABLE_NAME = table_name_param
Removed / Before Commit
Added / After Commit
+ -- Army509 updates for 2026-06-26 + -- Purpose: + -- 1. Make the previously hardcoded personal/finance sidebar entries available in Menu Master. + -- 2. After these rows exist, assign role permissions from the Role Permission screen. + -- 3. Complaint name and WCN page changes are code-only and do not require schema changes. + + INSERT INTO menus (name, icon, route, parent_id, created_at, updated_at) + SELECT 'My Leave', '<i class="fas fa-calendar-check"></i>', 'leave', NULL, NOW(), NOW() + WHERE NOT EXISTS ( + SELECT 1 FROM menus WHERE route = 'leave' + ); + + INSERT INTO menus (name, icon, route, parent_id, created_at, updated_at) + SELECT 'Attendance Calendar', '<i class="fas fa-calendar-alt"></i>', 'attendance-calendar', NULL, NOW(), NOW() + WHERE NOT EXISTS ( + SELECT 1 FROM menus WHERE route = 'attendance-calendar' + ); +
Removed / Before Commit
Added / After Commit
+ -- CRC Part Master Excel import updates + -- Date: 2026-06-29 + -- Purpose: + -- 1. Add a JSON column to store the full Excel row data in crc_part_master. + -- 2. Ensure an exact CRC group exists once. This does not treat FCRC as CRC. + + SET @column_exists := ( + SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE TABLE_SCHEMA = DATABASE() + AND TABLE_NAME = 'crc_part_master' + AND COLUMN_NAME = 'excel_row_data' + ); + + SET @add_column_sql := IF( + @column_exists = 0, + 'ALTER TABLE `crc_part_master` ADD COLUMN `excel_row_data` JSON NULL AFTER `hours`', + 'SELECT ''excel_row_data column already exists'' AS message'
Removed / Before Commit
Added / After Commit
+ -- India salary tax regime master data + -- Date: 2026-06-25 + -- Financial Year: 2025-2026 + -- Replaces existing tax regime/slab master rows with Govt of India old/new regime slabs. + + START TRANSACTION; + + DELETE FROM tax_slab_masters; + DELETE FROM tax_regime_masters; + + INSERT INTO tax_regime_masters + (regime_name, regime_type, financial_year, description, minimum_income, standard_deduction, cess_percentage, surcharge_percentage, surcharge_income_threshold, is_active, created_at, updated_at) + VALUES + ('Old Regime FY 2025-2026', 'old', '2025-2026', 'India Govt old tax regime for salaried individuals. Standard deduction Rs 50,000, rebate up to taxable income Rs 5,00,000, cess 4%.', 500000.00, 50000.00, 4.00, 0.00, NULL, 1, NOW(), NOW()); + + SET @old_regime_id = LAST_INSERT_ID(); + + INSERT INTO tax_regime_masters
Removed / Before Commit
Added / After Commit
+ -- Leave category and duration cleanup for Army 509 + -- Date: 2026-06-30 + -- Purpose: + -- 1. Make Casual Leave and Commuted/Commulated Leave support both full day and half day from one leave type. + -- 2. Remove separate Half Casual / Half Commuted / Half Commulated leave types. + -- 3. Keep All/Both category records compatible with the updated code. + + START TRANSACTION; + + -- Ensure main Casual Leave can be applied as Full Day or First/Second Half. + UPDATE leave_types + SET duration_type = 'both', + updated_at = NOW() + WHERE LOWER(leave_name) LIKE '%casual%' + AND LOWER(leave_name) NOT LIKE 'half casual%'; + + -- Ensure main Commuted/Commulated Leave can be applied as Full Day or First/Second Half. + UPDATE leave_types
Removed / Before Commit
Added / After Commit
+ -- LPO/LPR/EAS print correction package + -- Date: 2026-06-29 + -- + -- No MySQL schema migration or data update is required for these changes. + -- The work is implemented in Laravel controllers and Blade templates only. + -- + -- Optional verification queries: + -- + -- Check available cases for print URLs: + -- SELECT CaseID, CaseNo FROM cases ORDER BY CaseID; + -- + -- Check available order numbers for inspection note URLs: + -- SELECT DISTINCT OrderNo + -- FROM lprspares + -- WHERE OrderNo IS NOT NULL AND TRIM(OrderNo) <> '' + -- ORDER BY OrderNo;
Removed / Before Commit
Added / After Commit
+ -- Print corrections support queries + -- Date: 2026-06-26 + -- + -- No mandatory MySQL schema migration or data update is required for these print fixes. + -- The application changes read existing tables: + -- cases, new_lprs, lprspares, spares, au, vendors, new_grants, + -- finpower, designation, ProcRules, comparativestatements. + -- + -- Optional verification queries: + + -- 1. Verify AON/CFA fallback data for a case. + SELECT + c.CaseID, + c.CaseNo, + c.AONAmount, + l.GrantID, + g.GrantName, + g.MinorHead,
Removed / Before Commit
- @endif - </td> - <td> - <span class="badge bg-info">{{ $leaveType->leave_category ?: 'Blank' }}</span> - </td> - <td>{{ $leaveType->leave_count ?? 0 }}</td> - <td>{{ $used }}</td> - ========================= */ - - let incrementIndex = 0; - - function addIncrement(data = {}) { - - <div class="col-md-2"> - <label>Level</label> - - <input type="text" - class="form-control"
Added / After Commit
+ @endif + </td> + <td> + <span class="badge bg-info">{{ $leaveType->category_label }}</span> + </td> + <td>{{ $leaveType->leave_count ?? 0 }}</td> + <td>{{ $used }}</td> + ========================= */ + + let incrementIndex = 0; + const incrementPayLevels = @json($levels ?? []); + + function normalizeIncrementPayValue(value) { + const match = String(value || '').match(/\d+/); + return match ? match[0] : String(value || ''); + } + + function incrementLevelOptions(selectedLevel = '') {
Removed / Before Commit
- @endphp - <tr> - <td>{{ $leaveType->leave_name ?? $leaveType->name ?? 'N/A' }}</td> - <td>{{ $leaveType->leave_category ?? 'N/A' }}</td> - <td class="text-end">{{ number_format($allocated, 2) }}</td> - <td class="text-end">{{ number_format($used, 2) }}</td> - <td class="text-end">{{ number_format(max(0, $allocated - $used), 2) }}</td>
Added / After Commit
+ @endphp + <tr> + <td>{{ $leaveType->leave_name ?? $leaveType->name ?? 'N/A' }}</td> + <td>{{ $leaveType->category_label ?? 'N/A' }}</td> + <td class="text-end">{{ number_format($allocated, 2) }}</td> + <td class="text-end">{{ number_format($used, 2) }}</td> + <td class="text-end">{{ number_format(max(0, $allocated - $used), 2) }}</td>
Removed / Before Commit
- {{-- Roman numeral I --}} - <div style="margin-top:20px; margin-bottom:12px; text-align:center;"><b>I</b></div> - - {{-- ── TITLE ── --}} - <div class="title-section"> - ACCEPTANCE OF NECESSITY FOR PROCUREMENT OF ITEMS REQUIRED BY - {{ $case->ICNo ?? '' }} {{ $case->OffrsName ?? '' }} - FOR - {{ $case->EqptName ?? '___' }} - AGAINST - {{ $case->JobType ?? '___' }} JOBS - </div> - - {{-- Para 1 --}} - <div class="para"><span class="para-number">1.</span> Pl ref :-</div> - - @php - $firstSpare = count($spares) > 0 ? $spares[0] : null;
Added / After Commit
+ {{-- Roman numeral I --}} + <div style="margin-top:20px; margin-bottom:12px; text-align:center;"><b>I</b></div> + + @php + $firstSpare = count($spares) > 0 ? $spares[0] : null; + $lprNo = $case->LPRNo ?? ($firstSpare->LPRNo ?? '___'); + if ($lprDate && $lprDate !== '___') + $lprDate = \Carbon\Carbon::parse($lprDate)->format('d M Y'); + } catch(\Exception $e) {} + $userGroup = $case->UserGroupName ?? $case->UGSection ?? ($firstSpare->Section ?? '___'); + $minorHead = $case->MinorHead ?: '___'; + $codeHead = $case->CodeHead ?: '___'; + $scheduleNo = trim(preg_replace('/^Schedule\s*/i', '', $case->Schedule ?? '')); + $subSchedule = trim(preg_replace('/^Sub\s*Schedule\s*/i', '', $case->SubSchedule ?? '')); + $schedule = trim($scheduleNo . ($subSchedule ? ', Sub Schedule ' . $subSchedule : '')); + $cfaDesignation = trim($case->CFA ?? ''); + $finPower = trim($case->FinPower ?? ''); + $isIfaCase = stripos($finPower, 'IFA') !== false;
Removed / Before Commit
- ESTIMATED QTY AND COST PROPOSAL - </div> - - @php - $grandTotal = 0; - $i = 1; - $lprNo = $case->LPRNo ?? ''; - @endphp - - <table> - <thead> - <b>Method of derivation of the estimated cost (Per Unit)</b> - </div> - - <div class="para"> - Based on the <b>BQ/BM/LPP</b> received and the quantity arrived based on the LPR No - <b>{{ $lprNo ?: '___' }}</b>, is placed opposite. - </div>
Added / After Commit
+ ESTIMATED QTY AND COST PROPOSAL + </div> + + @php + $grandTotal = 0; + $i = 1; + $lprNo = $case->LPRNo ?? ''; + $lprDate = $case->LPRDate ?? ''; + try { + if ($lprDate) $lprDate = \Carbon\Carbon::parse($lprDate)->format('d M Y'); + } catch(\Exception $e) {} + @endphp + + <table> + <thead> + <b>Method of derivation of the estimated cost (Per Unit)</b> + </div> +
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - {{-- ── TITLE ── --}} - - <div class="sub-para"> - <span class="sub-para-number">4.1</span> - <span class="sub-para-text">Category 1: ___________________________</span> - </div> - <div class="sub-para"> - <span class="sub-para-number">4.2</span> - <span class="sub-para-text">Category 2: ___________________________</span> - </div> - <div class="sub-para"> - <span class="sub-para-number">4.3</span>
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + {{-- ── TITLE ── --}} + + <div class="sub-para"> + <span class="sub-para-number">4.1</span> + <span class="sub-para-text">Category 1: <b>{{ $case->Category1 ?: '___________________________' }}</b></span> + </div> + <div class="sub-para"> + <span class="sub-para-number">4.2</span> + <span class="sub-para-text">Category 2: <b>{{ $case->Category2 ?: '___________________________' }}</b></span> + </div> + <div class="sub-para"> + <span class="sub-para-number">4.3</span> + <span class="sub-para-text">Category 3: <b>{{ $case->Category3 ?: '___________________________' }}</b></span>
Removed / Before Commit
- if (res.success && res.leave_types) { - $.each(res.leave_types, function (i, leave) { - let displayText = leave.leave_name + (leave.leave_code ? ' (' + leave.leave_code + ')' : ''); - options += `<option value="${leave.id}">${displayText}</option>`; - }); - } - $('#modalLeaveType').html(options);
Added / After Commit
+ if (res.success && res.leave_types) { + $.each(res.leave_types, function (i, leave) { + let displayText = leave.leave_name + (leave.leave_code ? ' (' + leave.leave_code + ')' : ''); + if (leave.category_label) { + displayText += ' [' + leave.category_label + ']'; + } + options += `<option value="${leave.id}" data-duration-type="${leave.effective_duration_type || leave.duration_type || 'full_day'}">${displayText}</option>`; + }); + } + $('#modalLeaveType').html(options);
Removed / Before Commit
- <div class="card shadow-sm mb-3" style="border:1px solid #D9E2EC"> - <div class="card-body"> - <div class="row g-3"> - <div class="col-md-3"><label class="form-label fw-bold">Vendor 1 Name</label><input type="text" id="gv1" class="form-control" value="{{ $v1Name }}" oninput="updateHeaders()"></div> - <div class="col-md-3"><label class="form-label fw-bold">Vendor 2 Name</label><input type="text" id="gv2" class="form-control" value="{{ $v2Name }}" oninput="updateHeaders()"></div> - <div class="col-md-3"><label class="form-label fw-bold">Vendor 3 Name</label><input type="text" id="gv3" class="form-control" value="{{ $v3Name }}" oninput="updateHeaders()"></div> - <div class="col-md-3 d-flex align-items-end gap-2"> - <button type="button" class="btn btn-primary" onclick="saveAll()">💾 Save Statement</button> - <a href="{{ route('print.cs', $caseId) }}" target="_blank" class="btn btn-outline-success">🖨️ Print</a>
Added / After Commit
+ <div class="card shadow-sm mb-3" style="border:1px solid #D9E2EC"> + <div class="card-body"> + <div class="row g-3"> + <div class="col-md-3"><label class="form-label fw-bold">Vendor 1 Name</label><select id="gv1" class="form-select" onchange="updateHeaders()"><option value="">-- Select --</option>@foreach($vendors as $v)<option value="{{ $v->VendorName }}" @selected($v1Name===$v->VendorName)>{{ $v->VendorName }}</option>@endforeach</select></div> + <div class="col-md-3"><label class="form-label fw-bold">Vendor 2 Name</label><select id="gv2" class="form-select" onchange="updateHeaders()"><option value="">-- Select --</option>@foreach($vendors as $v)<option value="{{ $v->VendorName }}" @selected($v2Name===$v->VendorName)>{{ $v->VendorName }}</option>@endforeach</select></div> + <div class="col-md-3"><label class="form-label fw-bold">Vendor 3 Name</label><select id="gv3" class="form-select" onchange="updateHeaders()"><option value="">-- Select --</option>@foreach($vendors as $v)<option value="{{ $v->VendorName }}" @selected($v3Name===$v->VendorName)>{{ $v->VendorName }}</option>@endforeach</select></div> + <div class="col-md-3 d-flex align-items-end gap-2"> + <button type="button" class="btn btn-primary" onclick="saveAll()">💾 Save Statement</button> + <a href="{{ route('print.cs', $caseId) }}" target="_blank" class="btn btn-outline-success">🖨️ Print</a>
Removed / Before Commit
- <div class="card"> - <div class="card-body"> - <div class="row g-3"> - <div class="col-md-3"><label class="form-label fw-bold">Vendor 1 Name</label><input type="text" id="gv1" class="form-control" value="{{ $v1Name }}" oninput="updateHeaders()"></div> - <div class="col-md-3"><label class="form-label fw-bold">Vendor 2 Name</label><input type="text" id="gv2" class="form-control" value="{{ $v2Name }}" oninput="updateHeaders()"></div> - <div class="col-md-3"><label class="form-label fw-bold">Vendor 3 Name</label><input type="text" id="gv3" class="form-control" value="{{ $v3Name }}" oninput="updateHeaders()"></div> - <div class="col-md-3 d-flex align-items-end gap-2"> - <button type="button" class="btn btn-success" onclick="saveAll()"> Save Statement</button> - <a href="{{ route('print.cs', $caseId) }}" target="_blank" class="btn btn-filter"> Print</a>
Added / After Commit
+ <div class="card"> + <div class="card-body"> + <div class="row g-3"> + <div class="col-md-3"><label class="form-label fw-bold">Vendor 1 Name</label><select id="gv1" class="form-select" onchange="updateHeaders()"><option value="">-- Select --</option>@foreach($vendors as $v)<option value="{{ $v->VendorName }}" @selected($v1Name===$v->VendorName)>{{ $v->VendorName }}</option>@endforeach</select></div> + <div class="col-md-3"><label class="form-label fw-bold">Vendor 2 Name</label><select id="gv2" class="form-select" onchange="updateHeaders()"><option value="">-- Select --</option>@foreach($vendors as $v)<option value="{{ $v->VendorName }}" @selected($v2Name===$v->VendorName)>{{ $v->VendorName }}</option>@endforeach</select></div> + <div class="col-md-3"><label class="form-label fw-bold">Vendor 3 Name</label><select id="gv3" class="form-select" onchange="updateHeaders()"><option value="">-- Select --</option>@foreach($vendors as $v)<option value="{{ $v->VendorName }}" @selected($v3Name===$v->VendorName)>{{ $v->VendorName }}</option>@endforeach</select></div> + <div class="col-md-3 d-flex align-items-end gap-2"> + <button type="button" class="btn btn-success" onclick="saveAll()"> Save Statement</button> + <a href="{{ route('print.cs', $caseId) }}" target="_blank" class="btn btn-filter"> Print</a>
Removed / Before Commit
- <div class="card"> - <div class="card-body"> - <div class="row g-3"> - <div class="col-md-3"><label class="form-label fw-bold">Vendor 1 Name</label><input type="text" id="gv1" class="form-control" value="{{ $v1Name }}" oninput="updateHeaders()"></div> - <div class="col-md-3"><label class="form-label fw-bold">Vendor 2 Name</label><input type="text" id="gv2" class="form-control" value="{{ $v2Name }}" oninput="updateHeaders()"></div> - <div class="col-md-3"><label class="form-label fw-bold">Vendor 3 Name</label><input type="text" id="gv3" class="form-control" value="{{ $v3Name }}" oninput="updateHeaders()"></div> - <div class="col-md-3 d-flex align-items-end gap-2"> - <button type="button" class="btn btn-success" onclick="saveAll()"> Save Statement</button> - <a href="{{ route('print.cs', $caseId) }}" target="_blank" class="btn btn-filter"> Print</a>
Added / After Commit
+ <div class="card"> + <div class="card-body"> + <div class="row g-3"> + <div class="col-md-3"><label class="form-label fw-bold">Vendor 1 Name</label><select id="gv1" class="form-select" onchange="updateHeaders()"><option value="">-- Select --</option>@foreach($vendors as $v)<option value="{{ $v->VendorName }}" @selected($v1Name===$v->VendorName)>{{ $v->VendorName }}</option>@endforeach</select></div> + <div class="col-md-3"><label class="form-label fw-bold">Vendor 2 Name</label><select id="gv2" class="form-select" onchange="updateHeaders()"><option value="">-- Select --</option>@foreach($vendors as $v)<option value="{{ $v->VendorName }}" @selected($v2Name===$v->VendorName)>{{ $v->VendorName }}</option>@endforeach</select></div> + <div class="col-md-3"><label class="form-label fw-bold">Vendor 3 Name</label><select id="gv3" class="form-select" onchange="updateHeaders()"><option value="">-- Select --</option>@foreach($vendors as $v)<option value="{{ $v->VendorName }}" @selected($v3Name===$v->VendorName)>{{ $v->VendorName }}</option>@endforeach</select></div> + <div class="col-md-3 d-flex align-items-end gap-2"> + <button type="button" class="btn btn-success" onclick="saveAll()"> Save Statement</button> + <a href="{{ route('print.cs', $caseId) }}" target="_blank" class="btn btn-filter"> Print</a>
Removed / Before Commit
- - {{-- Row 3 --}} - <div class="row g-3 mb-3"> - <div class="col-md-3"> - <label class="form-label">RA Date</label> - <input type="date" id="txtRADate" class="form-control"> - </div> - <div class="col-md-3"> - <label class="form-label">Part 1 Order No</label> - <input type="text" id="txtCOBPart1OrderNo" class="form-control"> - </div> - document.getElementById('txtFinancialOpeningDate').value = c.FinancialBidOpeningDate || ''; - document.getElementById('txtRANo').value = c.RANo || ''; - document.getElementById('txtRADate').value = c.RADt || ''; - document.getElementById('txtCOBPart1OrderNo').value = c.COBPart1OrderNo || ''; - document.getElementById('txtCOBPart1OrderDate').value = c.COBPart1OrderDate || ''; - - function clearCase() {
Added / After Commit
+ + {{-- Row 3 --}} + <div class="row g-3 mb-3"> + <div class="col-md-2"> + <label class="form-label">RA Date</label> + <input type="date" id="txtRADate" class="form-control"> + </div> + <div class="col-md-2"> + <label class="form-label">RA End Date</label> + <input type="date" id="txtRAOpenedOn" class="form-control"> + </div> + <div class="col-md-2"> + <label class="form-label">Part 1 Order No</label> + <input type="text" id="txtCOBPart1OrderNo" class="form-control"> + </div> + document.getElementById('txtFinancialOpeningDate').value = c.FinancialBidOpeningDate || ''; + document.getElementById('txtRANo').value = c.RANo || ''; + document.getElementById('txtRADate').value = c.RADt || '';
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - {{-- Top right label --}} - $finBidOD = $case->FinancialBidOpeningDate ? \Carbon\Carbon::parse($case->FinancialBidOpeningDate)->format('d M Y') : '___'; - $raNo = $case->RANo ?? ''; - $raDt = $case->RADt ? \Carbon\Carbon::parse($case->RADt)->format('d M Y') : '___'; - $cobPart1No = $case->COBPart1OrderNo ?? '___'; - $cobPart1Dt = $case->COBPart1OrderDate ? \Carbon\Carbon::parse($case->COBPart1OrderDate)->format('d M Y') : '___'; - $boardRec = $case->COBBoardRecommendations ?? ''; - $month = now()->format('M Y'); - - // Parse GEM bid year and bid number - $bidYear = '___'; - <tr>
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + {{-- Top right label --}} + $finBidOD = $case->FinancialBidOpeningDate ? \Carbon\Carbon::parse($case->FinancialBidOpeningDate)->format('d M Y') : '___'; + $raNo = $case->RANo ?? ''; + $raDt = $case->RADt ? \Carbon\Carbon::parse($case->RADt)->format('d M Y') : '___'; + $raOpenedOn = $case->RAOD ? \Carbon\Carbon::parse($case->RAOD)->format('d M Y') : $raDt; + $cobPart1No = $case->COBPart1OrderNo ?? '___'; + $cobPart1Dt = $case->COBPart1OrderDate ? \Carbon\Carbon::parse($case->COBPart1OrderDate)->format('d M Y') : '___'; + $boardRec = $case->COBBoardRecommendations ?? ''; + $month = now()->format('M Y'); + $userGroup = $case->UserGroupName ?? '___'; + $lprNo = $case->LPRNo ?? '___'; + $lprDate = $case->LPRDate ? \Carbon\Carbon::parse($case->LPRDate)->format('d M Y') : '___'; +
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - @php - $nomen = $r->Nomenclature ?? ''; - $qty = (float)($r->Qty ?? 0); - $qtyStr = $qty == floor($qty) ? ($qty < 10 ? str_pad((int)$qty,2,'0',STR_PAD_LEFT) : (string)(int)$qty) : number_format($qty,3,'.',''); - $lprDetails = $case->LPRNo ?? '___'; - $jobType = $case->JobType ?? '___'; - $eqptName = $case->EqptName ?? '___'; - $userGroup = $case->ICNo ?? $case->OffrsName ?? '___'; - $concatData = strtoupper($case->CaseNo ?? ''); - - // Vendor data - $v1Name = $r->Vendor1Name ?? ''; $v1Rate = (float)($r->Vendor1Rate ?? 0); $v1GST = (float)($r->Vendor1GST ?? 0);
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + @php + $nomen = $r->Nomenclature ?? ''; + $qty = (float)($r->Qty ?? 0); + $qtyStr = $qty == floor($qty) ? ($qty < 10 ? str_pad((int)$qty,2,'0',STR_PAD_LEFT) : (string)(int)$qty) : number_format($qty,3,'.',''); + $lprDetails = $case->LPRNo ?? '___'; + $lprDate = $case->LPRDate ? \Carbon\Carbon::parse($case->LPRDate)->format('d M Y') : '___'; + $userGroup = $case->UserGroupName ?? '___'; + $concatData = strtoupper($case->CaseNo ?? ''); + + // Vendor data + $v1Name = $r->Vendor1Name ?? ''; $v1Rate = (float)($r->Vendor1Rate ?? 0); $v1GST = (float)($r->Vendor1GST ?? 0); + $v3Total = $v3UnitCost * $qty; +
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - {{-- Top right --}} - ? \Carbon\Carbon::parse($case->COBPart1OrderDate)->format('d M Y') - : '___'; - $month = now()->format('M Y'); - $userGroup = $case->ICNo ?? $case->OffrsName ?? '___'; - - // Parse GEM bid year and number - $bidYear = now()->year; $bidNum = '___'; - - // PNC specific fields - $l1Vendor = $case->L1VendorName ?? '___'; - $pncRep = $case->PNCRep ?? '___';
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + {{-- Top right --}} + ? \Carbon\Carbon::parse($case->COBPart1OrderDate)->format('d M Y') + : '___'; + $month = now()->format('M Y'); + $userGroup = $case->UserGroupName ?? '___'; + + // Parse GEM bid year and number + $bidYear = now()->year; $bidNum = '___'; + + // PNC specific fields + $l1Vendor = $case->L1VendorName ?? '___'; + $pncRep = $case->FirmRep ?? '___'; + $pncMeeting = $case->PNCMode ?? 'Physical';
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - {{-- Top right --}} - ? \Carbon\Carbon::parse($case->TECPart1OrderDate)->format('d M Y') - : '___'; - $month = now()->format('M Y'); - $userGroup = $case->ICNo ?? $case->OffrsName ?? '___'; - $lprNo = $case->LPRNo ?? '___'; - - // Parse GEM bid year and number - </div> - - </body> - </html>
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + {{-- Top right --}} + ? \Carbon\Carbon::parse($case->TECPart1OrderDate)->format('d M Y') + : '___'; + $month = now()->format('M Y'); + $userGroup = $case->UserGroupName ?? '___'; + $lprNo = $case->LPRNo ?? '___'; + + // Parse GEM bid year and number + </div> + + </body> + \ No newline at end of file + </html>
Removed / Before Commit
- - <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
Added / After Commit
+ + <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') }}" required> + @error('complaint_name') + <div class="invalid-feedback d-block">{{ $message }}</div> + @enderror
Removed / Before Commit
- - <form id="importForm" enctype="multipart/form-data"> - - <input type="file" name="file" id="fileInput" required /> - - <button type="button" id="selectFileBtn" class="custom-upload-btn"> - 📁 Import File - </button> - - - </form> - <a href="/sample/crcpart.xlsx" download class="sample-link">📄 Download Sample</a> - </div> - </div> - - - @section('scripts') - <script>
Added / After Commit
+ + <form id="importForm" enctype="multipart/form-data"> + + <input type="file" name="file" id="fileInput" hidden required /> + + <button type="button" id="selectFileBtn1" class="custom-upload-btn"> + 📁 Import File + </button> + + + </form> + <a href="{{ asset('MASTFILE (1).xls') }}" download class="sample-link">📄 Download Sample</a> + </div> + </div> + + + @section('scripts') + <script>
Removed / Before Commit
- color: #000000; - font-size: 14px; - } - </style> - - {{-- <div class="content w-100"> - </div> - - - <div class="row g-3 mb-4" style="height:450px;!important"> - <div class="col-md-12" style="height:450px;!important"> - <div class="chart-container" style="position: relative;height:400px;!important"> - <div class="d-flex" style="justify-content:center"> - <div><h6 class="mb-3"><strong>Monthly Repair State 510</strong></h6></div> - </div> - <canvas id="comparisonChart" style="height:400px;!important"></canvas> - </div> - </div>
Added / After Commit
+ color: #000000; + font-size: 14px; + } + .fund-state-panel { + background: #ffffff; + border-radius: 8px; + padding: 20px; + min-height: 520px; + } + .fund-state-canvas { + position: relative; + height: 455px; + } + .tat-panel { + background: #ffffff; + border-radius: 8px; + padding: 20px; + min-height: 560px;
Removed / Before Commit
- :root{--primary-gradient:linear-gradient(135deg,#667eea 0%,#764ba2 100%)} - body{background:linear-gradient(135deg,#f5f7fa 0%,#c3cfe2 100%)} - .dashboard-container{max-width:1400px;margin:0 auto;padding-top:1rem} - .row-1{display:grid;grid-template-columns:20% 20% 56%;gap:1.5rem;margin-bottom:2rem;min-height:520px;align-items:stretch} - .card{border:none;border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,.08);transition:transform .3s,box-shadow .3s;animation:fadeInUp .6s ease forwards;background:#fff} - .card:hover{transform:translateY(-6px);box-shadow:0 20px 40px rgba(0,0,0,.12)} - - <div class="dashboard-container"> - - {{-- ROW 1: Spare Demand | Procurement | Fund State --}} - <div class="row-1"> - - const dpsuData = @json($dpsuData); - const jobTypeData = @json($jobTypeData); - const groupData = @json($groupData); - - // Re-shape to match what JS expects - const dpsu = { labels: {!! json_encode($dpsuData['labels']) !!}, values: {!! json_encode($dpsuData['values']) !!} };
Added / After Commit
+ :root{--primary-gradient:linear-gradient(135deg,#667eea 0%,#764ba2 100%)} + body{background:linear-gradient(135deg,#f5f7fa 0%,#c3cfe2 100%)} + .dashboard-container{max-width:1400px;margin:0 auto;padding-top:1rem} + .fund-hero{margin-bottom:2rem} + .fund-hero .card-header{background:linear-gradient(135deg,#22313f,#0f766e)} + .fund-hero .chart-container{height:62vh;min-height:440px;padding:1rem 1.25rem .75rem} + .fund-hero .form-select{width:120px} + .row-1{display:grid;grid-template-columns:20% 20% 56%;gap:1.5rem;margin-bottom:2rem;min-height:520px;align-items:stretch} + .card{border:none;border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,.08);transition:transform .3s,box-shadow .3s;animation:fadeInUp .6s ease forwards;background:#fff} + .card:hover{transform:translateY(-6px);box-shadow:0 20px 40px rgba(0,0,0,.12)} + + <div class="dashboard-container"> + + {{-- Top Fund Grant Graph --}} + <div class="card fund-hero"> + <div class="card-header"> + <h5><i class="fas fa-chart-line me-2"></i>Fund State by Grant</h5> + <select class="filter-select-sm form-select" onchange="window.location='?fy='+this.value">
Removed / Before Commit
- </td> - <td> - <input type="number" class="form-control form-control-sm text-end txtFinalGST" - value="${gst}" min="0" max="28" style="width:70px"> - </td> - <td class="text-end fw-bold bg-light lblTotalOrderAmount"> - ₹${formatINR(r.TotalOrderAmount)} - function calcTotalOrderAmount(input) { - const tr = input.closest('tr'); - const qty = parseFloat(tr.dataset.qty) || 0; - const price = parseFloat(input.value) || 0; - const total = qty * price; - const aon = parseFloat(tr.dataset.aon) || 0; - - tr.querySelector('.lblTotalOrderAmount').textContent = '₹' + formatINR(total);
Added / After Commit
+ </td> + <td> + <input type="number" class="form-control form-control-sm text-end txtFinalGST" + value="${gst}" min="0" max="28" style="width:70px" + oninput="calcTotalOrderAmount(this)"> + </td> + <td class="text-end fw-bold bg-light lblTotalOrderAmount"> + ₹${formatINR(r.TotalOrderAmount)} + function calcTotalOrderAmount(input) { + const tr = input.closest('tr'); + const qty = parseFloat(tr.dataset.qty) || 0; + const price = parseFloat(tr.querySelector('.txtOrderPrice').value) || 0; + const gst = parseFloat(tr.querySelector('.txtFinalGST').value) || 0; + const total = qty * price * (1 + gst / 100); + const aon = parseFloat(tr.dataset.aon) || 0; + + tr.querySelector('.lblTotalOrderAmount').textContent = '₹' + formatINR(total);
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - {{-- NOTING SHEET heading --}} - {{-- Title --}} - <div class="title-section"> - AON CUM SANCTION FOR PROCUREMENT OF GOODS REQUIRED BY - {{ $case->ICNo ?? '' }} {{ $case->OffrsName ?? '' }} - GROUP FOR {{ $case->EqptName ?? '___' }} - AGAINST {{ $case->JobType ?? '___' }} JOBS - </div> - - - @php - $lprNo = $case->LPRNo ?? '___';
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + {{-- NOTING SHEET heading --}} + {{-- Title --}} + <div class="title-section"> + AON CUM SANCTION FOR PROCUREMENT OF GOODS REQUIRED BY + {{ $case->UserGroupName ?? '___' }} GROUP + FOR {{ $case->EqptName ?? '___' }} + AGAINST {{ $case->JobType ?? '___' }} JOBS + </div> + + + @php + $lprNo = $case->LPRNo ?? '___'; + $grp = $case->UserGroupName ?? '___';
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - {{-- ── HEADER ── --}} - @endif - - </body> - </html> - \ No newline at end of file
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + {{-- ── HEADER ── --}} + @endif + + </body> + \ No newline at end of file + </html>
Removed / Before Commit
- <html lang="en"> - <head> - <meta charset="utf-8"> - <title>DPMF-1 Certificate – {{ $case->CaseNo }}</title> - <style> - body { font-family: Arial, sans-serif; font-size: 14px; } - - - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - <div class="container"> - - {{-- DPMF label top right --}} - <div style="margin-left:80%;">DPMF - 1</div> - <div style="margin-left:80%; margin-bottom:15px;">(Refers to Paragraph 2.4.1)</div>
Added / After Commit
+ <html lang="en"> + <head> + <meta charset="utf-8"> + <title>Certificate – {{ $case->CaseNo }}</title> + <style> + body { font-family: Arial, sans-serif; font-size: 14px; } + + + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + <div class="container"> + + <h2>CERTIFICATE FOR PURCHASE OF GOODS AND SERVICES WITHOUT QUOTATION</h2> + + <br> +
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - {{-- NOTING SHEET heading --}} - </table> - - </body> - </html> - \ No newline at end of file
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + {{-- NOTING SHEET heading --}} + </table> + + </body> + \ No newline at end of file + </html>
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - {{-- ── HEADER ── --}} - {{-- Title --}} - <div class="title-section"> - EAS APPROVAL FOR PROCUREMENT OF GOODS REQUIRED BY - {{ $case->ICNo ?? '' }} {{ $case->OffrsName ?? '' }} - FOR {{ $case->EqptName ?? '___' }} - AGAINST {{ $case->JobType ?? '___' }} JOBS - </div> - <span class="para-number">5.</span> - <span class="para-text"> - <b>Grant Details :</b> Major Head <b>2076</b>, - Minor Head <b>___</b>,
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + {{-- ── HEADER ── --}} + {{-- Title --}} + <div class="title-section"> + EAS APPROVAL FOR PROCUREMENT OF GOODS REQUIRED BY + {{ $case->UserGroupName ?? '___' }} GROUP + FOR {{ $case->EqptName ?? '___' }} + AGAINST {{ $case->JobType ?? '___' }} JOBS + </div> + <span class="para-number">5.</span> + <span class="para-text"> + <b>Grant Details :</b> Major Head <b>2076</b>, + Minor Head <b>{{ $case->MinorHead ?: '___' }}</b>, + Code Head <b>{{ $case->CodeHead ?: '___' }}</b> of
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - {{-- Title --}} - $uoDate = $case->UODate ?? ''; - try { if ($uoDate) $uoDate = \Carbon\Carbon::parse($uoDate)->format('d M Y'); } catch(\Exception $e) {} - $grantName = $case->GrantName ?? '___'; - $finPower = $case->FinPower ?? '___'; - $cfa = $case->CFA ?? '___'; - $i = 1; - @endphp - <tr> - <td class="center">7.</td> - <td>Major, Minor, Sub- and Detailed Heads under which expenditure is to be booked</td> - <td>Major Head <b>2076</b> — {{ $grantName }}</td>
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + {{-- Title --}} + $uoDate = $case->UODate ?? ''; + try { if ($uoDate) $uoDate = \Carbon\Carbon::parse($uoDate)->format('d M Y'); } catch(\Exception $e) {} + $grantName = $case->GrantName ?? '___'; + $schedule = trim(($case->Schedule ?? '') . (($case->SubSchedule ?? '') ? ', Sub Schedule ' . $case->SubSchedule : '')); + $finPower = $schedule ?: ($case->FinPower ?? '___'); + $cfa = $case->CFA ?? '___'; + $i = 1; + @endphp + <tr> + <td class="center">7.</td> + <td>Major, Minor, Sub- and Detailed Heads under which expenditure is to be booked</td> + <td>Major Head <b>2076</b>, Minor Head <b>{{ $case->MinorHead ?: '___' }}</b>, Code Head <b>{{ $case->CodeHead ?: '___' }}</b> — {{ $grantName }}</td>
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:6px 18px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - @php - @endphp - - @foreach($vendorGroups as $group) - - {{-- ══ PAGE 1 — SO Title + Header + PART I ══ --}} - <div class="page"> - <br> - - <p class="center bold" style="font-size:10.5pt; line-height:1.5;"> - PLACEMENT OF SUPPLY ORDER NO SO/ RS LUP-322/TL/DR/144 /LP-006-2025-26/_______________DATED_____ MAR 2026 - </p>
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:6px 18px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + @php + @endphp + + @foreach($vendorGroups as $group) + @php + $orderNo = $group['OrderNo'] ?: ($case->CaseNo ?? '___'); + $orderDate = !empty($group['OrderDate']) ? \Carbon\Carbon::parse($group['OrderDate'])->format('d M Y') : '___'; + $deliveryPeriod = !empty($group['DeliveryPeriod']) ? \Carbon\Carbon::parse($group['DeliveryPeriod'])->format('d M Y') : '___________'; + $noOfDays = $group['NoOfDays'] ?: ''; + $majorHead = '2076'; + $minorHead = $case->MinorHead ?: '___'; + $codeHead = $case->CodeHead ?: '___'; + $schedule = trim(($case->Schedule ?? '') . (($case->SubSchedule ?? '') ? ', Sub Schedule ' . $case->SubSchedule : ''));
Removed / Before Commit
- <th>Regd No</th> - <th>WCN No</th> - <th>WCN Date</th> - <th>Job No</th> - <th>Job Date</th> - <th>Control No</th> - </tr> - </thead> - <tbody> - <td>{{ $equipment->assy ?? '-' }}</td> - <td>{{ $equipment->regd_no ?? '-' }}</td> - <td>{{ $equipment->wcn_number ?? '-' }}</td> - <td>{{ \Carbon\Carbon::parse($equipment->wcn_date)->format('d-M-Y') ?? '-' }}</td> - <td>{{ $wo?->job_no ?? '-' }}</td> - <td>{{ $wo?->job_date ?? '-' }}</td> - <td>{{ $wo?->control_no ?? '-' }}</td> - </tr> - @endforeach
Added / After Commit
+ <th>Regd No</th> + <th>WCN No</th> + <th>WCN Date</th> + <th>Control No</th> + <th>Control Date</th> + <th>Job No</th> + <th>Job Date</th> + </tr> + </thead> + <tbody> + <td>{{ $equipment->assy ?? '-' }}</td> + <td>{{ $equipment->regd_no ?? '-' }}</td> + <td>{{ $equipment->wcn_number ?? '-' }}</td> + <td>{{ $equipment->wcn_date ? \Carbon\Carbon::parse($equipment->wcn_date)->format('d-M-Y') : '-' }}</td> + <td>{{ $wo?->control_no ?? '-' }}</td> + <td>{{ $wo?->control_date ?? '-' }}</td> + <td>{{ $wo?->job_no ?? '-' }}</td> + <td>{{ $wo?->job_date ?? '-' }}</td>
Removed / Before Commit
- </div> - <div class="col-md-3"><strong>Job No:</strong> {{ $wo->job_no ?? '-' }}</div> - <div class="col-md-3"><strong>Control No:</strong> {{ $wo->control_no ?? '-' }}</div> - <div class="col-md-3"><strong>Status:</strong> {{ $equipment->status ?? '-' }}</div> - <div class="col-md-3"><strong>QA Initiate:</strong> {{ $equipment->qa_initiate ? 'Yes' : 'No' }} - </div>
Added / After Commit
+ </div> + <div class="col-md-3"><strong>Job No:</strong> {{ $wo->job_no ?? '-' }}</div> + <div class="col-md-3"><strong>Control No:</strong> {{ $wo->control_no ?? '-' }}</div> + <div class="col-md-3"><strong>Control Date:</strong> {{ $wo->control_date ?? '-' }}</div> + <div class="col-md-3"><strong>Status:</strong> {{ $equipment->status ?? '-' }}</div> + <div class="col-md-3"><strong>QA Initiate:</strong> {{ $equipment->qa_initiate ? 'Yes' : 'No' }} + </div>
Removed / Before Commit
- button.btn{ - color:#6c757d; - } - </style> - @if ($errors->any()) - <div class="alert alert-danger"> - <select name="wcn_no" class="form-select select2"> - <option value="">-- Select --</option> - @foreach($wcns as $wcnno) - <option value="{{ $wcnno }}" {{ request('wcn_no') == $jobno ? 'selected' : '' }}>{{ $wcnno }} - </option> - @endforeach - </select> - </small> - </div> - </div> - <div class="table-responsive"> - <table class="table table-bordered table-striped" id="example242">
Added / After Commit
+ button.btn{ + color:#6c757d; + } + .work-equipment-report-scroll { + max-height: 68vh; + overflow: auto; + border: 1px solid #dee2e6; + } + .work-equipment-report-table { + min-width: 3200px; + margin-bottom: 0; + font-size: 12px; + } + .work-equipment-report-table th, + .work-equipment-report-table td { + white-space: nowrap; + vertical-align: middle; + }
Removed / Before Commit
- - <div class="card"> - <div class="card-header py-3 d-flex justify-content-between align-items-center flex-wrap gap-2"> - <h4 class="mb-0"><b>Equipment Date Report</b></h4> - @if(request()->filled(['report_type', 'from_date', 'to_date'])) - <div class="d-flex gap-2"> - <a href="{{ request()->fullUrlWithQuery(['export' => 'excel']) }}" class="btn btn-success rounded-0">Excel Export</a> - } - - .equipment-date-report-table { - min-width: 1850px; - margin-bottom: 0; - font-size: 12px; - } - <th>Sub Eqpt</th> - <th>Regd No</th> - <th>Repair Class</th> - <th>Job No</th>
Added / After Commit
+ + <div class="card"> + <div class="card-header py-3 d-flex justify-content-between align-items-center flex-wrap gap-2"> + <h4 class="mb-0"><b>Equipment Data Report</b></h4> + @if(request()->filled(['report_type', 'from_date', 'to_date'])) + <div class="d-flex gap-2"> + <a href="{{ request()->fullUrlWithQuery(['export' => 'excel']) }}" class="btn btn-success rounded-0">Excel Export</a> + } + + .equipment-date-report-table { + min-width: 2050px; + margin-bottom: 0; + font-size: 12px; + } + <th>Sub Eqpt</th> + <th>Regd No</th> + <th>Repair Class</th> + <th>Control No</th>
Removed / Before Commit
- <th>Sub Eqpt</th> - <th>Regd No</th> - <th>Repair Class</th> - <th>Job No</th> - <th>Job Date</th> - <th>Status</th> - <td>{{ $equipment->assy ?? '-' }}</td> - <td>{{ $equipment->regd_no ?? '-' }}</td> - <td>{{ $equipment->RepairClass?->name ?? '-' }}</td> - <td>{{ $workOrder?->job_no ?? '-' }}</td> - <td>{{ $workOrder?->job_date ?? '-' }}</td> - <td>{{ $equipment->status ?? '-' }}</td>
Added / After Commit
+ <th>Sub Eqpt</th> + <th>Regd No</th> + <th>Repair Class</th> + <th>Control No</th> + <th>Control Date</th> + <th>Job No</th> + <th>Job Date</th> + <th>Status</th> + <td>{{ $equipment->assy ?? '-' }}</td> + <td>{{ $equipment->regd_no ?? '-' }}</td> + <td>{{ $equipment->RepairClass?->name ?? '-' }}</td> + <td>{{ $workOrder?->control_no ?? '-' }}</td> + <td>{{ $workOrder?->control_date ?? '-' }}</td> + <td>{{ $workOrder?->job_no ?? '-' }}</td> + <td>{{ $workOrder?->job_date ?? '-' }}</td> + <td>{{ $equipment->status ?? '-' }}</td>
Removed / Before Commit
- <input type="hidden" name="year" value="{{ $currentYear }}"> - - <div class="row g-3 align-items-end"> - <div class="col-md-4"> - <label class="form-label">Deduction Title</label> - <input type="text" name="deduction_title" class="form-control" - value="{{ old('deduction_title', $editDeductionTitle->deduction_title ?? '') }}" required> - <table class="table table-bordered table-striped align-middle"> - <thead> - <tr> - <th>Deduction Title</th> - <th>Amount</th> - <th>Month</th> - && (int) $deductionTitle->year === $currentYear; - @endphp - <tr> - <td>{{ $deductionTitle->deduction_title }}</td> - <td>{{ number_format((float) $deductionTitle->amount, 2) }}</td>
Added / After Commit
+ <input type="hidden" name="year" value="{{ $currentYear }}"> + + <div class="row g-3 align-items-end"> + <div class="col-md-3"> + <label class="form-label">Employee Category</label> + <select name="employee_category_id" class="form-control" required> + <option value="">Select Category</option> + @foreach($employeeCategories as $category) + <option value="{{ $category->id }}" + @selected((string) old('employee_category_id', $editDeductionTitle->employee_category_id ?? '') === (string) $category->id)> + {{ $category->name }} + </option> + @endforeach + </select> + </div> + <div class="col-md-3"> + <label class="form-label">Deduction Title</label> + <input type="text" name="deduction_title" class="form-control"
Removed / Before Commit
- @php - $salary = $snapshot->salary_json; - $monthNames = [1=>'JAN',2=>'FEB',3=>'MAR',4=>'APR',5=>'MAY',6=>'JUN',7=>'JUL',8=>'AUG',9=>'SEP',10=>'OCT',11=>'NOV',12=>'DEC']; - $schemeLabel = array_key_exists('UPS (GOVT)', $salary['deductions'] ?? []) ? 'UPS' : 'NPS'; - $monthlyTitles = $salary['deductions_meta']['monthly_titles'] ?? []; - $allowanceRows = [ - ['MONTH', ($monthNames[$salary['period']['month']] ?? $salary['period']['month']) . ' ' . $salary['period']['year']], - ['E Basic', $salary['employee']['earned_basic_pay'] ?? 0], - ['DA', $salary['allowances']['DA'] ?? 0], - ['HRA', $salary['allowances']['HRA'] ?? 0], - ['TPT', $salary['allowances']['SPL PAY/TPT'] ?? 0], - ['DA TPT', $salary['allowances']['DA TPT'] ?? 0], - ['EOL', 0], - ['LATE MINUTES', 0], - ['MISC PAY', $salary['allowances']['MISC PAY'] ?? 0], - ['MISC PAY REMARKS', $salary['remarks'] ?? ''], - ['GROSS TOTAL', $salary['totals']['gross_total'] ?? 0], - ];
Added / After Commit
+ @php + $salary = $snapshot->salary_json; + $fmtValue = function ($value) { + if (is_array($value)) { + return number_format((float) ($value[0] ?? 0), 0) . '/' . number_format((float) ($value[1] ?? 0), 0); + } + + return is_numeric($value) ? number_format((float) $value, 0) : ($value ?? ''); + }; + $monthNames = [1=>'JAN',2=>'FEB',3=>'MAR',4=>'APR',5=>'MAY',6=>'JUN',7=>'JUL',8=>'AUG',9=>'SEP',10=>'OCT',11=>'NOV',12=>'DEC']; + $schemeLabel = array_key_exists('UPS (GOVT)', $salary['deductions'] ?? []) ? 'UPS' : 'NPS'; + $govtMain = (float) data_get($salary, 'allowances.NPS GOVT CONT', data_get($salary, 'allowances.UPS GOVT CONT', 0)); + $miscGovt = (float) data_get($salary, 'allowances.MISC PAY NPS GOVT CONT', data_get($salary, 'allowances.MISC PAY UPS GOVT CONT', 0)); + $npsCont = $govtMain + $miscGovt; + $monthlyTitles = $salary['deductions_meta']['monthly_titles'] ?? []; + $allowanceRows = [ + ['MONTH', ($monthNames[$salary['period']['month']] ?? $salary['period']['month']) . ' ' . $salary['period']['year']], + ['E Basic', $salary['employee']['earned_basic_pay'] ?? 0],
Removed / Before Commit
- @php - $salary = $snapshot->salary_json; - $monthNames = [1=>'Jan',2=>'Feb',3=>'Mar',4=>'Apr',5=>'May',6=>'Jun',7=>'Jul',8=>'Aug',9=>'Sep',10=>'Oct',11=>'Nov',12=>'Dec']; - $monthText = ($monthNames[$salary['period']['month']] ?? $salary['period']['month']) . '/' . $salary['period']['year']; - $dob = !empty($salary['employee']['dob']) ? \Carbon\Carbon::parse($salary['employee']['dob'])->format('d/M/Y') : '-'; - $doa = !empty($salary['employee']['joining_date']) ? \Carbon\Carbon::parse($salary['employee']['joining_date'])->format('d/M/Y') : '-'; - $dor = !empty($salary['employee']['dob']) ? \Carbon\Carbon::parse($salary['employee']['dob'])->addYears(60)->format('d/M/Y') : '-'; - $govtDeduction = $salary['deductions']['NPS/(GOVT)'] ?? ($salary['deductions']['UPS (GOVT)'] ?? 0); - $cghsEis = ($salary['deductions']['CGHS'] ?? 0) + ($salary['deductions']['CGEGIS'] ?? 0); - $monthlyTitles = $salary['deductions_meta']['monthly_titles'] ?? []; - @endphp - - <div class="salary-slip statement-format"> - <div class="text-center"> - <h3>509 ARMY BASE WORKSHOP, AGRA-282001</h3> - <h4>Monthly Statement of Account for the month of {{ $monthText }}</h4> - </div> -
Added / After Commit
+ @php + $salary = $salary ?? $snapshot->salary_json; + $fmt = fn ($value) => number_format((float) ($value ?? 0), 0); + $upper = fn ($value) => strtoupper((string) ($value ?? '-')); + $monthNames = [1=>'Jan',2=>'Feb',3=>'Mar',4=>'Apr',5=>'May',6=>'Jun',7=>'Jul',8=>'Aug',9=>'Sep',10=>'Oct',11=>'Nov',12=>'Dec']; + $monthText = ($monthNames[$salary['period']['month']] ?? $salary['period']['month']) . '/' . $salary['period']['year']; + $dateFmt = fn ($value) => !empty($value) ? strtoupper(\Carbon\Carbon::parse($value)->format('d/M/Y')) : '-'; + $dob = $dateFmt(data_get($salary, 'employee.dob')); + $doa = $dateFmt(data_get($salary, 'employee.joining_date')); + $dor = !empty(data_get($salary, 'employee.end_date')) + ? $dateFmt(data_get($salary, 'employee.end_date')) + : (!empty(data_get($salary, 'employee.dob')) ? strtoupper(\Carbon\Carbon::parse(data_get($salary, 'employee.dob'))->addYears(60)->format('d/M/Y')) : '-'); + $scheme = strtoupper($salary['rules']['scheme'] ?? 'NPS'); + $govtMain = (float) data_get($salary, 'allowances.NPS GOVT CONT', data_get($salary, 'allowances.UPS GOVT CONT', 0)); + $miscGovt = (float) data_get($salary, 'allowances.MISC PAY NPS GOVT CONT', data_get($salary, 'allowances.MISC PAY UPS GOVT CONT', 0)); + $npsCont = $govtMain + $miscGovt; + $monthlyTitles = $salary['deductions_meta']['monthly_titles'] ?? []; + $advances = $salary['deductions_meta']['advances'] ?? [];
Removed / Before Commit
Added / After Commit
+ <!doctype html> + <html> + <head> + <meta charset="utf-8"> + <title>Salary Print Format 2</title> + <style> + @page { size: A4 landscape; margin: 8mm; } + body { font-family: Arial, sans-serif; color: #000; font-size: 11px; } + .toolbar { margin-bottom: 10px; } + .toolbar button { padding: 6px 14px; } + .salary-slip { width: 100%; max-width: 270mm; margin: 0 auto; page-break-inside: avoid; } + .text-center { text-align: center; } + h3 { margin: 0; font-size: 17px; text-decoration: underline; } + h4 { margin: 0; font-size: 13px; text-decoration: underline; } + .statement-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; margin: 2px 0 8px; } + .statement-left { text-align: left; } + .statement-right { text-align: right; } + .top-info { display: grid; grid-template-columns: 1fr 1fr 1.4fr 1fr; gap: 4px 18px; margin-bottom: 6px; }
Removed / Before Commit
- - @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');
Added / After Commit
+ + @section('content') + @php + $categoryOrder = ['DA', 'HRA', 'CGHS', 'CGEGIS', 'DA TPT', 'NPS', 'UPS', 'TPT', 'Risk Allowance']; + $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');
Removed / Before Commit
- 'level' => 'Level', - 'increment_month' => 'Increment Month', - ]; - @endphp - - <div class="card"> - @csrf - @method('PUT') - - <div class="card mb-4"> - <div class="card-header bg-light"> - <h5 class="mb-0">Finance Editable Fields</h5> - <label class="form-label d-block">Handicapped</label> - <div class="form-check form-switch"> - <input type="hidden" name="handicap" value="0"> - <input class="form-check-input" type="checkbox" name="handicap" value="1" - @checked(old('handicap', $financeDetail->handicap ?? $staff->is_handicapped ?? false))> - </div>
Added / After Commit
+ 'level' => 'Level', + 'increment_month' => 'Increment Month', + ]; + + $money = fn ($value) => 'Rs ' . \App\Helpers\LpoHelper::numberFormatIndian((float) round($value ?? 0), 2); + $grossItems = collect($grossBreakdown)->except('config'); + @endphp + + <div class="card"> + @csrf + @method('PUT') + + <div class="card mb-4"> + <div class="card-header bg-light d-flex justify-content-between align-items-center"> + <h5 class="mb-0">Gross Salary Details</h5> + <button class="btn btn-sm btn-outline-primary" type="button" data-bs-toggle="collapse" data-bs-target="#grossSalaryDetails" aria-expanded="true" aria-controls="grossSalaryDetails"> + <i class="fa fa-chevron-down"></i> + </button>
Removed / Before Commit
- 'tuition_fee', - 'arrears_of_pay', - 'lve_ench', - 'ot', - 'nda', - 'bonus', - 'medical_claim', - 'misc_supplementary', - 'misc_supplementary_remark', - ]; - 'level' => 'Level', - 'increment_month' => 'Increment Month', - ]; - @endphp - - <div class="card"> - </button> - </div>
Added / After Commit
+ 'tuition_fee', + 'arrears_of_pay', + 'lve_ench', + 'nda', + 'medical_claim', + 'washing_allowance', + 'plb', + 'misc_supplementary', + 'misc_supplementary_remark', + ]; + 'level' => 'Level', + 'increment_month' => 'Increment Month', + ]; + $money = fn ($value) => 'Rs ' . \App\Helpers\LpoHelper::numberFormatIndian((float) round($value ?? 0), 2); + $grossItems = collect($grossBreakdown)->except('config'); + $selectedTaxRegimeType = old('tax_regime_type', $paymentRecovery->tax_regime_type ?? 'old'); + $miscDeductionRows = [ + ['fes_adv_date', 'fes_adv', 'fes_per_inst', 'fes_code'],
Removed / Before Commit
- <div class="col-md-4 mb-3"> - <label>Categories <span class="text-danger">*</span></label> - <select name="leave_category[]" class="form-select select2 ps-1" multiple required> - @foreach($employeeCategories as $category) - <option value="{{ $category->id }}" - @if(isset($leaveType) && isset($selectedCategories) && in_array($category->id, $selectedCategories)) - selected - @elseif(old('leave_category') && in_array($category->id, old('leave_category'))) - selected - allowClear: true, - width: '100%' - }); - - // Add form submission debugging - $('form').on('submit', function(e) {
Added / After Commit
+ <div class="col-md-4 mb-3"> + <label>Categories <span class="text-danger">*</span></label> + <select name="leave_category[]" class="form-select select2 ps-1" multiple required> + <option value="Both" + @if(old('leave_category') && in_array('Both', old('leave_category'))) + selected + @elseif(isset($selectedCategories) && in_array('Both', $selectedCategories)) + selected + @endif + >All</option> + @foreach($employeeCategories as $category) + <option value="{{ $category->id }}" + @if(isset($leaveType) && isset($selectedCategories) && (in_array((string) $category->id, $selectedCategories) || in_array($category->name, $selectedCategories))) + selected + @elseif(old('leave_category') && in_array($category->id, old('leave_category'))) + selected + allowClear: true, + width: '100%'
Removed / Before Commit
- <td>{{ $type->id }}</td> - <td>{{ $type->leave_name }}</td> - <td> - @if ($type->leave_category) - <span class="badge bg-info">{{ $type->leave_category }}</span> - @else - <span class="badge bg-secondary">-</span> - @endif - </td> - <td>{{ ucfirst($type->eligible_for) }}</td> - <td>{{ $type->leave_count ?? 'Unlimited' }}</td>
Added / After Commit
+ <td>{{ $type->id }}</td> + <td>{{ $type->leave_name }}</td> + <td> + <span class="badge bg-info">{{ $type->category_label }}</span> + </td> + <td>{{ ucfirst($type->eligible_for) }}</td> + <td>{{ $type->leave_count ?? 'Unlimited' }}</td>
Removed / Before Commit
- $.each(res.leave_types, function (i, leave) { - let displayText = leave.display_name || `${leave.leave_name} (${leave.leave_code}) - Balance: ${leave.balance}`; - let disabled = leave.balance <= 0 ? 'disabled' : ''; - options += `<option value="${leave.id}" data-balance="${leave.balance}" data-duration-type="${leave.duration_type || 'full_day'}" ${disabled}>${displayText}</option>`; - }); - $('#leave_type_id').html(options); - },
Added / After Commit
+ $.each(res.leave_types, function (i, leave) { + let displayText = leave.display_name || `${leave.leave_name} (${leave.leave_code}) - Balance: ${leave.balance}`; + let disabled = leave.balance <= 0 ? 'disabled' : ''; + options += `<option value="${leave.id}" data-balance="${leave.balance}" data-duration-type="${leave.effective_duration_type || leave.duration_type || 'full_day'}" ${disabled}>${displayText}</option>`; + }); + $('#leave_type_id').html(options); + },
Removed / Before Commit
- $.each(res.leave_types, function (i, leave) { - let displayText = leave.display_name || `${leave.leave_name} (${leave.leave_code}) - Balance: ${leave.balance}`; - let selected = leave.id == selectedLeaveId ? 'selected' : ''; - options += `<option value="${leave.id}" data-balance="${leave.balance}" data-duration-type="${leave.duration_type || 'full_day'}" ${selected}>${displayText}</option>`; - }); - $('#leave_type_id').html(options);
Added / After Commit
+ $.each(res.leave_types, function (i, leave) { + let displayText = leave.display_name || `${leave.leave_name} (${leave.leave_code}) - Balance: ${leave.balance}`; + let selected = leave.id == selectedLeaveId ? 'selected' : ''; + options += `<option value="${leave.id}" data-balance="${leave.balance}" data-duration-type="${leave.effective_duration_type || leave.duration_type || 'full_day'}" ${selected}>${displayText}</option>`; + }); + $('#leave_type_id').html(options);
Removed / Before Commit
- <div class="col-md-3"> - <div class="card p-3 text-center shadow-sm"> - <h6>{{ $balance['name'] }}</h6> - <h4>{{ $balance['balance'] }}</h4> - <small>Taken: {{ $balance['taken'] }} / Total: {{ $balance['total'] }}</small> - </div> - @forelse($leaves as $leave) - <tr> - <td>{{ $leave->subject }}</td> - <td>{{ $leave->leaveType->leave_name ?? 'N/A' }}</td> - <td>{{ \Carbon\Carbon::parse($leave->from_date)->format('d-m-Y') }}</td> - <td>{{ \Carbon\Carbon::parse($leave->to_date)->format('d-m-Y') }}</td> - <td>{{ $leave->total_days }}</td>
Added / After Commit
+ <div class="col-md-3"> + <div class="card p-3 text-center shadow-sm"> + <h6>{{ $balance['name'] }}</h6> + <span class="badge bg-info mb-2">{{ $balance['category'] ?? 'All' }}</span> + <h4>{{ $balance['balance'] }}</h4> + <small>Taken: {{ $balance['taken'] }} / Total: {{ $balance['total'] }}</small> + </div> + @forelse($leaves as $leave) + <tr> + <td>{{ $leave->subject }}</td> + <td> + {{ $leave->leaveType->leave_name ?? 'N/A' }} + @if($leave->leaveType) + <span class="badge bg-info ms-1">{{ $leave->leaveType->category_label }}</span> + @endif + </td> + <td>{{ \Carbon\Carbon::parse($leave->from_date)->format('d-m-Y') }}</td> + <td>{{ \Carbon\Carbon::parse($leave->to_date)->format('d-m-Y') }}</td>
Removed / Before Commit
- <th>Subject</th> - <th>From Date</th> - <th>To Date</th> - <th>Total Days</th> - <th>Status</th> - @if(!$isStaffSearch) - <td>{{ $leave->subject ?? '-' }}</td> - <td>{{ \Carbon\Carbon::parse($leave->from_date)->format('d-m-Y') }}</td> - <td>{{ \Carbon\Carbon::parse($leave->to_date)->format('d-m-Y') }}</td> - <td>{{ $leave->total_days }}</td> - <td class="text-capitalize">{{ $leave->status }}</td> - @if(!$isStaffSearch)
Added / After Commit
+ <th>Subject</th> + <th>From Date</th> + <th>To Date</th> + <th>Duration</th> + <th>Total Days</th> + <th>Status</th> + @if(!$isStaffSearch) + <td>{{ $leave->subject ?? '-' }}</td> + <td>{{ \Carbon\Carbon::parse($leave->from_date)->format('d-m-Y') }}</td> + <td>{{ \Carbon\Carbon::parse($leave->to_date)->format('d-m-Y') }}</td> + <td>{{ ucwords(str_replace('_', ' ', $leave->duration ?? 'full_day')) }}</td> + <td>{{ $leave->total_days }}</td> + <td class="text-capitalize">{{ $leave->status }}</td> + @if(!$isStaffSearch)
Removed / Before Commit
- <label for="leaveType" class="form-label">Leave Type <span class="text-danger">*</span></label> - <select id="leaveType" class="form-select"> - <option value="">Select Leave Type...</option> - @foreach($leaveTypes as $type) - <option value="{{ $type->id }}" data-duration-type="{{ $type->duration_type ?? 'full_day' }}">{{ $type->leave_name }}</option> - @endforeach - </select> - </div> - - if (response.success) { - let options = '<option value="">Select Leave Type...</option>'; - $.each(response.leave_types, function (i, leave) { - options += `<option value="${leave.id}" data-duration-type="${leave.duration_type ?? 'full_day'}">${leave.leave_name}</option>`; - }); - $('#leaveType').html(options); - $('#durationContainer').hide();
Added / After Commit
+ <label for="leaveType" class="form-label">Leave Type <span class="text-danger">*</span></label> + <select id="leaveType" class="form-select"> + <option value="">Select Leave Type...</option> + </select> + </div> + + if (response.success) { + let options = '<option value="">Select Leave Type...</option>'; + $.each(response.leave_types, function (i, leave) { + const category = leave.category_label ? ` [${leave.category_label}]` : ''; + options += `<option value="${leave.id}" data-duration-type="${leave.effective_duration_type || leave.duration_type || 'full_day'}">${leave.leave_name}${category}</option>`; + }); + $('#leaveType').html(options); + $('#durationContainer').hide();
Removed / Before Commit
- <thead class="table-secondary"><tr> - <th style="width:22%">Nomenclature</th><th style="width:12%">Part No</th><th style="width:5%">Qty</th><th style="width:10%">Job No</th> - <th style="width:5%" class="text-center">Hist</th><th style="width:10%">Rate ₹</th><th style="width:7%">GST%</th> - <th style="width:9%">Others ₹</th><th style="width:10%">Total ₹</th><th style="width:10%">Action</th> - </tr></thead><tbody>`; - spares.forEach(sp => { - html+=`<tr id="spare_row_${sp.LPRSpareID}"> - <td><input type="number" class="form-control form-control-sm text-end fw-bold txtGST" value="${sp.GST}" min="0" max="28" style="width:60px"><small class="text-danger gstError d-none">0-28</small></td> - <td><input type="number" class="form-control form-control-sm text-end txtOther" value="${sp.OtherCharges}" min="0" step="0.01" style="min-width:80px"></td> - <td><input type="text" class="form-control form-control-sm text-end bg-light fw-bold txtTotal" value="${sp.TotalAONAmount}" readonly></td> - <td> - <button class="btn btn-sm btn-success me-1 py-0" onclick="lockSpare(${sp.LPRSpareID},${sp.Qty},this)">🔒</button> - <button class="btn btn-sm btn-warning py-0" onclick="unlockSpare(this)">🔓</button> - </td> - </tr>`; - }); - async function lockSpare(lprSpareId, qty, btn) { - const row=btn.closest('tr');
Added / After Commit
+ <thead class="table-secondary"><tr> + <th style="width:22%">Nomenclature</th><th style="width:12%">Part No</th><th style="width:5%">Qty</th><th style="width:10%">Job No</th> + <th style="width:5%" class="text-center">Hist</th><th style="width:10%">Rate ₹</th><th style="width:7%">GST%</th> + <th style="width:9%">Others ₹</th><th style="width:10%">Total ₹</th><th style="width:14%">Reason</th><th style="width:10%">Action</th> + </tr></thead><tbody>`; + spares.forEach(sp => { + html+=`<tr id="spare_row_${sp.LPRSpareID}"> + <td><input type="number" class="form-control form-control-sm text-end fw-bold txtGST" value="${sp.GST}" min="0" max="28" style="width:60px"><small class="text-danger gstError d-none">0-28</small></td> + <td><input type="number" class="form-control form-control-sm text-end txtOther" value="${sp.OtherCharges}" min="0" step="0.01" style="min-width:80px"></td> + <td><input type="text" class="form-control form-control-sm text-end bg-light fw-bold txtTotal" value="${sp.TotalAONAmount}" readonly></td> + <td><input type="text" class="form-control form-control-sm txtReason" maxlength="50" placeholder="Correction reason"></td> + <td> + <button class="btn btn-sm btn-success me-1 py-0" onclick="lockSpare(${sp.LPRSpareID},${sp.Qty},this)">Update</button> + <button class="btn btn-sm btn-warning py-0" onclick="unlockSpare(this)">Edit</button> + </td> + </tr>`; + }); + async function lockSpare(lprSpareId, qty, btn) {
Removed / Before Commit
- - <div class="no-print"> - <button onclick="window.print()" style="padding:5px 14px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:5px 14px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - @php - <div class="signature-block">LPO</div> - - </body> - </html> - \ No newline at end of file
Added / After Commit
+ + <div class="no-print"> + <button onclick="window.print()" style="padding:5px 14px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + @php + <div class="signature-block">LPO</div> + + </body> + \ No newline at end of file + </html>
Removed / Before Commit
- - <div class="no-print" style="margin-bottom:10px;"> - <button onclick="window.print()" style="padding:5px 14px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> - <button onclick="window.close()" style="padding:5px 14px;background:#757575;color:#fff;border:none;border-radius:4px;margin-left:6px;cursor:pointer">✕ Close</button> - </div> - - @php - $group = $firstRow->UserGroupName ?? '___'; - $grant = $firstRow->GrantName ?? '___'; - $nacNo = $details->NACNo ?? '___'; - $caseNos = $details->CaseNo ?? ''; - @endphp - - {{-- Top right --}} - </table> - - <div style="margin-bottom:12px;"> - 5. Details of Items inspected :{{ $caseNos ? ' '.$caseNos : '' }}
Added / After Commit
+ + <div class="no-print" style="margin-bottom:10px;"> + <button onclick="window.print()" style="padding:5px 14px;background:#1d72b8;color:#fff;border:none;border-radius:4px;font-weight:bold;cursor:pointer">🖨️ Print</button> + </div> + + @php + $group = $firstRow->UserGroupName ?? '___'; + $grant = $firstRow->GrantName ?? '___'; + $nacNo = $details->NACNo ?? '___'; + $lprDetails = $details->LPRDetails ?? ''; + @endphp + + {{-- Top right --}} + </table> + + <div style="margin-bottom:12px;"> + 5. Details of Items inspected : {{ $lprDetails ?: 'LPR No & Date __________' }} + </div>
Removed / Before Commit
- - <input type="date" id="purchase_date" name="purchase_date" hidden readonly class="form-control" value="{{ date('Y-m-d') }}" required> - - <input type="text" id="rv_display" class="form-control bg-light" hidden readonly value="{{ App\Models\StoreInventory::generateRVNumber() }}"> - - - <!-- Master Data Fields --> - <div class="col-md-4 mb-3"> - - <div class="col-md-12 mb-3"> - <label class="form-label">Purchase Type <span class="text-danger">*</span></label> - <div class="row"> - <div class="col-md-6"> - <div class="form-check"> - <input class="form-check-input" type="radio" name="purchase_type" id="purchase_type_cod" value="COD" required> - <label class="form-check-label" for="purchase_type_cod"> - <strong>COD</strong> - </label>
Added / After Commit
+ + <input type="date" id="purchase_date" name="purchase_date" hidden readonly class="form-control" value="{{ date('Y-m-d') }}" required> + + <div class="col-md-4 mb-3"> + <label for="rv_number" class="form-label">RV Number <span class="text-danger">*</span></label> + <input type="text" id="rv_number" name="rv_number" class="form-control" placeholder="Enter RV number" required> + </div> + + <!-- Master Data Fields --> + <div class="col-md-4 mb-3"> + + <div class="col-md-12 mb-3"> + <label class="form-label">Purchase Type <span class="text-danger">*</span></label> + <div class="d-flex align-items-center gap-4 flex-wrap"> + <div> + <div class="form-check"> + <input class="form-check-input" type="radio" name="purchase_type" id="purchase_type_cod" value="COD" required> + <label class="form-check-label" for="purchase_type_cod">
Removed / Before Commit
- <select class="form-select select2" id="purchaseTypeFilter" name="purchase_type" onchange="this.form.submit()"> - <option value="">All Purchase Types</option> - <option value="COD" {{ request('purchase_type') == 'COD' ? 'selected' : '' }}>COD</option> - <option value="LPR" {{ request('purchase_type') == 'LPR' ? 'selected' : '' }}>LPR</option> - </select> - </div> - <div class="col-md-4 mx-1"> - - <td> - <span class="badge bg-{{ $inventory->purchase_type == 'COD' ? 'warning' : 'success' }}"> - {{ $inventory->purchase_type }} - </span> - </td> - {{-- <td><code>{{ $inventory->rv_number }}</code></td> - html += '<div class="col-md-6">'; - if (data.item_name) html += '<p><strong>Item Name:</strong> ' + data.item_name + '</p>'; - if (data.quantity) html += '<p><strong>Quantity:</strong> <span class="badge bg-info">' + data.quantity + '</span></p>'; - if (data.purchase_type) html += '<p><strong>Purchase Type:</strong> <span class="badge bg-' + (data.purchase_type == 'COD' ? 'warning' : 'success') + '">' + data.purchase_type + '</span></p>';
Added / After Commit
+ <select class="form-select select2" id="purchaseTypeFilter" name="purchase_type" onchange="this.form.submit()"> + <option value="">All Purchase Types</option> + <option value="COD" {{ request('purchase_type') == 'COD' ? 'selected' : '' }}>COD</option> + <option value="LPR" {{ request('purchase_type') == 'LPR' ? 'selected' : '' }}>LP</option> + </select> + </div> + <div class="col-md-4 mx-1"> + + <td> + <span class="badge bg-{{ $inventory->purchase_type == 'COD' ? 'warning' : 'success' }}"> + {{ $inventory->purchase_type == 'LPR' ? 'LP' : $inventory->purchase_type }} + </span> + </td> + {{-- <td><code>{{ $inventory->rv_number }}</code></td> + html += '<div class="col-md-6">'; + if (data.item_name) html += '<p><strong>Item Name:</strong> ' + data.item_name + '</p>'; + if (data.quantity) html += '<p><strong>Quantity:</strong> <span class="badge bg-info">' + data.quantity + '</span></p>'; + if (data.purchase_type) html += '<p><strong>Purchase Type:</strong> <span class="badge bg-' + (data.purchase_type == 'COD' ? 'warning' : 'success') + '">' + purchaseTypeLabel(data.purchase_type) + '</span></p>';
Removed / Before Commit
- - <input type="date" id="purchase_date" name="purchase_date" hidden readonly class="form-control" value="{{ $inventory->purchase_date ? $inventory->purchase_date->format('Y-m-d') : date('Y-m-d') }}" required> - - <input type="text" id="rv_display" class="form-control bg-light" hidden readonly value="{{ $inventory->rv_number }}"> - - - <!-- Master Data Fields --> - <div class="col-md-4 mb-3"> - </div> - <div class="form-check form-check-inline"> - <input class="form-check-input" type="radio" name="purchase_type" id="purchase_type_lpr" value="LPR" {{ $inventory->purchase_type == 'LPR' ? 'checked' : '' }} required> - <label class="form-check-label" for="purchase_type_lpr">LPR</label> - </div> - </div> - </div> - <!-- LPR Fields --> - <div id="lpr_fields" class="row mb-3 p-3 border rounded" style="{{ $inventory->purchase_type == 'LPR' ? '' : 'display:none;' }};"> - <div class="col-12 mb-3">
Added / After Commit
+ + <input type="date" id="purchase_date" name="purchase_date" hidden readonly class="form-control" value="{{ $inventory->purchase_date ? $inventory->purchase_date->format('Y-m-d') : date('Y-m-d') }}" required> + + <div class="col-md-4 mb-3"> + <label for="rv_number" class="form-label">RV Number <span class="text-danger">*</span></label> + <input type="text" id="rv_number" name="rv_number" class="form-control" value="{{ $inventory->rv_number ?? '' }}" placeholder="Enter RV number" required> + </div> + + <!-- Master Data Fields --> + <div class="col-md-4 mb-3"> + </div> + <div class="form-check form-check-inline"> + <input class="form-check-input" type="radio" name="purchase_type" id="purchase_type_lpr" value="LPR" {{ $inventory->purchase_type == 'LPR' ? 'checked' : '' }} required> + <label class="form-check-label" for="purchase_type_lpr">LP</label> + </div> + </div> + </div> + <!-- LPR Fields -->
Removed / Before Commit
- <div class="card-header"> - <div class="d-flex justify-content-between align-items-center"> - <div class="col-md-6"> - <h4> <strong>Generate IV Number</strong></h4> - </div> - <div class="col-md-6 row"> - <div class="col-md-6 mb-3"> - <label for="custom_group" class="form-label">Custom Group Name <span class="text-danger">*</span></label> - <input type="text" id="custom_group" name="custom_group" class="form-control" placeholder="Enter custom group name"> - </div> - </div> - - <div> - <div class="mt-3"> - <div> - <button type="button" class="btn btn-success" id="generateBtn" disabled> - <i class="fas fa-file-invoice"></i> Generate IV Numbers - </button>
Added / After Commit
+ <div class="card-header"> + <div class="d-flex justify-content-between align-items-center"> + <div class="col-md-6"> + <h4> <strong>Save IV Number</strong></h4> + </div> + <div class="col-md-6 row"> + <div class="col-md-6 mb-3"> + <label for="custom_group" class="form-label">Custom Group Name <span class="text-danger">*</span></label> + <input type="text" id="custom_group" name="custom_group" class="form-control" placeholder="Enter custom group name"> + </div> + <div class="col-md-6 mb-3"> + <label for="iv_number" class="form-label">IV Number <span class="text-danger">*</span></label> + <input type="text" id="iv_number" name="iv_number" class="form-control" placeholder="Enter IV number" required> + </div> + </div> + + <div> + <div class="mt-3">
Removed / Before Commit
- <select class="form-select select2" id="purchaseTypeFilter" name="purchase_type" onchange="this.form.submit()"> - <option value="">All Purchase Types</option> - <option value="COD" {{ request('purchase_type') == 'COD' ? 'selected' : '' }}>COD</option> - <option value="LPR" {{ request('purchase_type') == 'LPR' ? 'selected' : '' }}>LPR</option> - </select> - </div> - <div class="col-md-2 mx-1"> - - <td> - <span class="badge bg-{{ $inventory->purchase_type == 'COD' ? 'warning' : 'success' }}"> - {{ $inventory->purchase_type }} - </span> - </td> - {{-- <td><code>{{ $inventory->rv_number }}</code></td> - html += '<div class="col-md-6">'; - if (data.item_name) html += '<p><strong>Item Name:</strong> ' + data.item_name + '</p>'; - if (data.quantity) html += '<p><strong>Quantity:</strong> <span class="badge bg-info">' + data.quantity + '</span></p>'; - if (data.purchase_type) html += '<p><strong>Purchase Type:</strong> <span class="badge bg-' + (data.purchase_type == 'COD' ? 'warning' : 'success') + '">' + data.purchase_type + '</span></p>';
Added / After Commit
+ <select class="form-select select2" id="purchaseTypeFilter" name="purchase_type" onchange="this.form.submit()"> + <option value="">All Purchase Types</option> + <option value="COD" {{ request('purchase_type') == 'COD' ? 'selected' : '' }}>COD</option> + <option value="LPR" {{ request('purchase_type') == 'LPR' ? 'selected' : '' }}>LP</option> + </select> + </div> + <div class="col-md-2 mx-1"> + + <td> + <span class="badge bg-{{ $inventory->purchase_type == 'COD' ? 'warning' : 'success' }}"> + {{ $inventory->purchase_type == 'LPR' ? 'LP' : $inventory->purchase_type }} + </span> + </td> + {{-- <td><code>{{ $inventory->rv_number }}</code></td> + html += '<div class="col-md-6">'; + if (data.item_name) html += '<p><strong>Item Name:</strong> ' + data.item_name + '</p>'; + if (data.quantity) html += '<p><strong>Quantity:</strong> <span class="badge bg-info">' + data.quantity + '</span></p>'; + if (data.purchase_type) html += '<p><strong>Purchase Type:</strong> <span class="badge bg-' + (data.purchase_type == 'COD' ? 'warning' : 'success') + '">' + purchaseTypeLabel(data.purchase_type) + '</span></p>';
Removed / Before Commit
- - <div class="row"> - {{-- <div class="col-md-12"> --}} - <label class="form-label">Select Items to Generate Group Rv Number <span - class="text-danger">*</span></label> - <div class="table-responsive"> - <table class="table table-striped table-hover" id="ivManagementTable"> - <td> - <span - class="badge bg-{{ $item->purchase_type == 'COD' ? 'warning' : 'success' }}"> - {{ $item->purchase_type }} - </span> - </td> - <td>{{ $item->formatted_purchase_date }}</td> - placeholder="Enter name"> - </div> - - <div class="col-md-4 mb-3">
Added / After Commit
+ + <div class="row"> + {{-- <div class="col-md-12"> --}} + <label class="form-label">Select Items for Group RV Number <span + class="text-danger">*</span></label> + <div class="table-responsive"> + <table class="table table-striped table-hover" id="ivManagementTable"> + <td> + <span + class="badge bg-{{ $item->purchase_type == 'COD' ? 'warning' : 'success' }}"> + {{ $item->purchase_type == 'LPR' ? 'LP' : $item->purchase_type }} + </span> + </td> + <td>{{ $item->formatted_purchase_date }}</td> + placeholder="Enter name"> + </div> + + <div class="col-md-4 mb-3">
Removed / Before Commit
- <label for="purchase_type" class="form-label">Purchase Type</label> - <select id="purchase_type" name="purchase_type" class="form-select select2"> - <option value="">All Types</option> - <option value="LPR">LPR</option> - <option value="COD">COD</option> - </select> - </div> - <label for="status" class="form-label">Status</label> - <select id="status" name="status" class="form-select select2"> - <option value="">All Status</option> - <option value="iv_generated">IV Number Generated</option> - <option value="group_received">Group Received</option> - </select> - </div> - <div class="card text-center"> - <div class="card-body"> - <h5 class="card-title text-success" id="ivGeneratedItems">0</h5> - <p class="card-text">IV Generated</p>
Added / After Commit
+ <label for="purchase_type" class="form-label">Purchase Type</label> + <select id="purchase_type" name="purchase_type" class="form-select select2"> + <option value="">All Types</option> + <option value="LPR">LP</option> + <option value="COD">COD</option> + </select> + </div> + <label for="status" class="form-label">Status</label> + <select id="status" name="status" class="form-select select2"> + <option value="">All Status</option> + <option value="iv_generated">IV Number Saved</option> + <option value="group_received">Group Received</option> + </select> + </div> + <div class="card text-center"> + <div class="card-body"> + <h5 class="card-title text-success" id="ivGeneratedItems">0</h5> + <p class="card-text">IV Saved</p>
Removed / Before Commit
- @if(count($committedData)) - @foreach($committedData as $equipment) - <tr> - <td>{{ $equipment?->workOrder?->job_no }}</td> - <td>{{ date('d-m-Y',strtotime($equipment?->workOrder?->job_date)) }}</td> - <td>{{ $equipment->group?->name }}</td>
Added / After Commit
+ @if(count($committedData)) + @foreach($committedData as $equipment) + <tr> + <td>{{ $equipment?->workOrder?->workUnit?->units?->name ?? '-' }}</td> + <td>{{ $equipment?->workOrder?->control_no ?? '-' }}</td> + <td>{{ $equipment?->workOrder?->control_date ? date('d-m-Y', strtotime($equipment?->workOrder?->control_date)) : '-' }}</td> + <td>{{ $equipment?->workOrder?->job_no }}</td> + <td>{{ date('d-m-Y',strtotime($equipment?->workOrder?->job_date)) }}</td> + <td>{{ $equipment->group?->name }}</td>
Removed / Before Commit
- <thead class="table-secondary"> - <tr> - <th><input type="checkbox" id="selectAll"></th> - <th>Job No </th> - <th>Job Date </th> - <th>Group</th> - <th>Regd No</th> - <th>Type</th> - <th>Qty</th> - <th>QC Insepection Status</th> - <th>QC Inspection Date</th> - </tr> - </thead> - <tbody> - @foreach($equipments as $equipment) - <tr> - <td><input type="checkbox" name="equipment_ids[]" value="{{ $equipment->id }}"></td> - <td>{{ $equipment?->workOrder?->job_no }}</td>
Added / After Commit
+ <thead class="table-secondary"> + <tr> + <th><input type="checkbox" id="selectAll"></th> + <th>Unit Name</th> + <th>Ctrl No</th> + <th>Control Date</th> + <th>Job No </th> + <th>Job Date </th> + <th>Group</th> + <th>Regd No</th> + <th>Type</th> + <th>Qty</th> + </tr> + </thead> + <tbody> + @foreach($equipments as $equipment) + <tr> + <td><input type="checkbox" name="equipment_ids[]" value="{{ $equipment->id }}"></td>
Removed / Before Commit
- @foreach($committedData as $equipment) - <tr> - <td>{{ $equipment?->workOrder?->job_no }}</td> - <td>{{ date('d-m-Y',strtotime($equipment?->workOrder?->job_date)) }}</td> - <td>{{ $equipment->group?->name }}</td>
Added / After Commit
+ @foreach($committedData as $equipment) + <tr> + <td>{{ $equipment?->workOrder?->workUnit?->units?->name ?? '-' }}</td> + <td>{{ $equipment?->workOrder?->control_no ?? '-' }}</td> + <td>{{ $equipment?->workOrder?->control_date ? date('d-m-Y', strtotime($equipment?->workOrder?->control_date)) : '-' }}</td> + <td>{{ $equipment?->workOrder?->job_no }}</td> + <td>{{ date('d-m-Y',strtotime($equipment?->workOrder?->job_date)) }}</td> + <td>{{ $equipment->group?->name }}</td>
Removed / Before Commit
- - Route::middleware(['auth'])->group(function () { - Route::get('/dashboard', [DashboardController::class, 'dashboard'])->name('dashboard')->middleware('check.permission:Dashboard,view');; - Route::get('/users', [UserController::class, 'index'])->name('user.index')->middleware('check.permission:User,view');; - Route::get('/user-edit/{id}', [UserController::class, 'edit'])->name('user.edit')->middleware('check.permission:User,modify');; - Route::get('/user-delete/{id}', [UserController::class, 'delete'])->name('user.delete')->middleware('check.permission:User,delete');; - Route::get('/crc-parts', [CrcPartMasterController::class, 'index'])->name('crc.index'); - Route::post('/crc-part-master/store', [CrcPartMasterController::class, 'store'])->name('crc.store'); - Route::post('/crc-part-master/update', [CrcPartMasterController::class, 'update'])->name('crc.update'); - Route::delete('/crc-part-master/delete/{id}', [CrcPartMasterController::class, 'destroy'])->name('crc.delete'); - - Route::POST('/crc-job-create', [CrcEntryController::class, 'generatejob'])->name('crc.job');
Added / After Commit
+ + Route::middleware(['auth'])->group(function () { + Route::get('/dashboard', [DashboardController::class, 'dashboard'])->name('dashboard')->middleware('check.permission:Dashboard,view');; + Route::get('/dashboard/avg-tat-days', [DashboardController::class, 'avgTatDays'])->name('dashboard.avg-tat-days')->middleware('check.permission:Dashboard,view'); + Route::get('/dashboard/eqpt-target-state-charts', [DashboardController::class, 'eqptTargetStateCharts'])->name('dashboard.eqpt-target-state-charts')->middleware('check.permission:Dashboard,view'); + Route::get('/dashboard/first-yield-pass', [DashboardController::class, 'firstYieldPass'])->name('dashboard.first-yield-pass')->middleware('check.permission:Dashboard,view'); + Route::get('/users', [UserController::class, 'index'])->name('user.index')->middleware('check.permission:User,view');; + Route::get('/user-edit/{id}', [UserController::class, 'edit'])->name('user.edit')->middleware('check.permission:User,modify');; + Route::get('/user-delete/{id}', [UserController::class, 'delete'])->name('user.delete')->middleware('check.permission:User,delete');; + Route::get('/crc-parts', [CrcPartMasterController::class, 'index'])->name('crc.index'); + Route::post('/crc-part-master/store', [CrcPartMasterController::class, 'store'])->name('crc.store'); + Route::post('/crc-part-master/update', [CrcPartMasterController::class, 'update'])->name('crc.update'); + Route::post('/crc-part-master/import', [CrcPartMasterController::class, 'import'])->name('crc.import'); + Route::delete('/crc-part-master/delete/{id}', [CrcPartMasterController::class, 'destroy'])->name('crc.delete'); + + Route::POST('/crc-job-create', [CrcEntryController::class, 'generatejob'])->name('crc.job');