Showing AI reviews for army
Project AI Score ?
67%
Quality Avg ?
72%
Security Avg ?
54%
Reviews ?
37

Review Result ?

jattin01/army · 3f5f7c61
The commit introduces a new GrantMasterController with CRUD operations for managing grants and integrates grant selection in other financial controllers. It also adds sample download and import functionalities for complaint data. The validation for grants is present but the manual increment of GrantID risks race conditions. Database queries use raw SQL in some places which can introduce injection risks if parameters are not sanitized. The commit message is vague.
Quality ?
70%
Security ?
40%
Business Value ?
75%
Maintainability ?
60%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Vague
Where commit message
Issue / Evidence vague
Suggested Fix improve message with specific details on changes introduced
Manual Grantid Assignment
Where app/Http/Controllers/Adm/GrantMasterController.php:22
Issue / Evidence manual GrantID assignment
Suggested Fix switch to database auto-increment or unique ID generation to avoid race conditions and bugs
Permission Checks Missing
Where app/Http/Controllers/Adm/GrantMasterController.php:43
Issue / Evidence permission checks missing
Suggested Fix add authorization checks before destroy to improve security
Raw Sql Query
Where app/Http/Controllers/Adm/FinPowersController.php:18
Issue / Evidence raw SQL query
Suggested Fix use parameterized queries or Eloquent ORM to reduce SQL injection risk
Raw Sql Query
Where app/Http/Controllers/Adm/FundTransactionController.php:23
Issue / Evidence raw SQL query
Suggested Fix use parameterized queries or Eloquent ORM to reduce SQL injection risk
Code Change Preview · app/Http/Controllers/Adm/FinPowersController.php ?
Removed / Before Commit
- 
- public function index()
- {
-         $grants       = DB::select("SELECT GrantID, GrantName FROM new_grants ORDER BY GrantName");
- $designations = DB::select("SELECT DesignationID, `Designation` FROM designation ORDER BY `Designation`");
- $finPowers    = DB::select("SELECT fp.FinPowerID, g.GrantName, d.`Designation`, fp.Inherent, fp.WithIFA, fp.CreatedDate FROM finpower fp INNER JOIN new_grants g ON fp.GrantID=g.GrantID INNER JOIN designation d ON fp.DesignationID=d.DesignationID ORDER BY g.GrantName, fp.Inherent");
- return view('adm.fin-powers', compact('grants','designations','finPowers'));
Added / After Commit
+ 
+ public function index()
+ {
+         $grants       = DB::select("SELECT GrantID, GrantName FROM new_grants WHERE COALESCE(IsActive, 1) = 1 ORDER BY GrantName");
+ $designations = DB::select("SELECT DesignationID, `Designation` FROM designation ORDER BY `Designation`");
+ $finPowers    = DB::select("SELECT fp.FinPowerID, g.GrantName, d.`Designation`, fp.Inherent, fp.WithIFA, fp.CreatedDate FROM finpower fp INNER JOIN new_grants g ON fp.GrantID=g.GrantID INNER JOIN designation d ON fp.DesignationID=d.DesignationID ORDER BY g.GrantName, fp.Inherent");
+ return view('adm.fin-powers', compact('grants','designations','finPowers'));
Removed / Before Commit
- 
- public function index()
- {
-         $grants       = DB::select("SELECT GrantID, GrantName FROM new_grants ORDER BY GrantName");
- $designations = DB::select("SELECT DesignationID, `Designation` FROM designation ORDER BY `Designation`");
- $transactions = DB::select("SELECT g.GrantName, ft.TransactionType, ft.Amount, ft.Authority, ft.AuthorityDate, ft.TransactionDate FROM fundtransactions ft INNER JOIN new_grants g ON ft.GrantID=g.GrantID ORDER BY ft.TransactionDate DESC LIMIT 50");
- return view('adm.fund-transaction', compact('grants','designations','transactions'));
Added / After Commit
+ 
+ public function index()
+ {
+         $grants       = DB::select("SELECT GrantID, GrantName FROM new_grants WHERE COALESCE(IsActive, 1) = 1 ORDER BY GrantName");
+ $designations = DB::select("SELECT DesignationID, `Designation` FROM designation ORDER BY `Designation`");
+ $transactions = DB::select("SELECT g.GrantName, ft.TransactionType, ft.Amount, ft.Authority, ft.AuthorityDate, ft.TransactionDate FROM fundtransactions ft INNER JOIN new_grants g ON ft.GrantID=g.GrantID ORDER BY ft.TransactionDate DESC LIMIT 50");
+ return view('adm.fund-transaction', compact('grants','designations','transactions'));
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Http\Controllers\Adm;
+ 
+ use App\Http\Controllers\Controller;
+ use App\Models\NewGrant;
+ use Illuminate\Http\Request;
+ 
+ class GrantMasterController extends Controller
+ {
+     public function index()
+     {
+         $grants = NewGrant::orderBy('GrantName')->get();
+ 
+         return view('adm.grants', compact('grants'));
+     }
+ 
+     public function store(Request $request)
Removed / Before Commit
- $grantId   = $grantRow->GrantID ?? 0;
- 
- if ($grantId && $aonAmount > 0) {
-                 $fpRows = DB::select("SELECT FP.Inherent,FP.WithIFA,D.Designation,D.DesignationID FROM FinPower FP INNER JOIN designation D ON FP.DesignationID=D.DesignationID WHERE FP.GrantID=? ORDER BY FP.Inherent,FP.WithIFA", [$grantId]);
- foreach ($fpRows as $fp) {
- if ($aonAmount <= (float)$fp->Inherent) {
- $cfaName = $fp->Designation; $finPower = 'Inherent'; $designId = $fp->DesignationID; break;
Added / After Commit
+ $grantId   = $grantRow->GrantID ?? 0;
+ 
+ if ($grantId && $aonAmount > 0) {
+                 $fpRows = DB::select("SELECT FP.Inherent,FP.WithIFA,D.Designation,D.DesignationID FROM finpower FP INNER JOIN designation D ON FP.DesignationID=D.DesignationID WHERE FP.GrantID=? ORDER BY FP.Inherent,FP.WithIFA", [$grantId]);
+ foreach ($fpRows as $fp) {
+ if ($aonAmount <= (float)$fp->Inherent) {
+ $cfaName = $fp->Designation; $finPower = 'Inherent'; $designId = $fp->DesignationID; break;
Removed / Before Commit
- use App\Models\ProductionYear;
- use App\Exports\ComplaintReportExport;
- use Maatwebsite\Excel\Facades\Excel;
- 
- class ComplaintController extends Controller
- {
- ]);
- }
- 
- public function exportComplaintReport(Request $request)
- {
- return Excel::download(
Added / After Commit
+ use App\Models\ProductionYear;
+ use App\Exports\ComplaintReportExport;
+ use Maatwebsite\Excel\Facades\Excel;
+ use Illuminate\Support\Facades\DB;
+ use PhpOffice\PhpSpreadsheet\IOFactory;
+ use PhpOffice\PhpSpreadsheet\Shared\Date as ExcelDate;
+ use PhpOffice\PhpSpreadsheet\Spreadsheet;
+ use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
+ 
+ class ComplaintController extends Controller
+ {
+ ]);
+ }
+ 
+     public function downloadImportSample()
+     {
+         $headers = [
+             'Complaint_no',
Removed / Before Commit
- $groupId       = Group::where('name', 'TL')->value('id');
- $unitname       = Unit::where('id', $validated['unit_id'])->value('name');
- $repairClassId = RepairClass::where('name', 'CRC')->value('id');
-             $equipmentCache = CrcPartmaster::pluck('id', 'equipment_name')->toArray();
- 
- $unitEntry = WorkUnit::create([
- 'unit'    => $validated['unit_id'],
- 
- foreach ($ivUnit['parts'] as $part) {
- 
-                     if (!isset($workOrderMap[$part['part_no']])) 
- {
- $baseId = DB::table('work_orders')
- ->join('production_years', function ($join) {
- 'control_date' => date('d-M-y',strtotime($ivUnit['crc_date'])),
- ]);
- 
-                         $workOrderMap[$part['part_no']] = $workOrder->id;
Added / After Commit
+ $groupId       = Group::where('name', 'TL')->value('id');
+ $unitname       = Unit::where('id', $validated['unit_id'])->value('name');
+ $repairClassId = RepairClass::where('name', 'CRC')->value('id');
+             $partCache = CrcPartmaster::pluck('id', 'part_no')->toArray();
+ 
+ $unitEntry = WorkUnit::create([
+ 'unit'    => $validated['unit_id'],
+ 
+ foreach ($ivUnit['parts'] as $part) {
+ 
+                     $equipmentKey = $this->crcEquipmentKey($part['equipment_name']);
+ 
+                     if (!isset($workOrderMap[$equipmentKey])) 
+ {
+ $baseId = DB::table('work_orders')
+ ->join('production_years', function ($join) {
+ 'control_date' => date('d-M-y',strtotime($ivUnit['crc_date'])),
+ ]);
Removed / Before Commit
- }
- }
- 
- public function destroy($id)
- {
- CrcPartMaster::findOrFail($id)->delete();
Added / After Commit
+ }
+ }
+ 
+     public function syncYardstickHours()
+     {
+         $updated = 0;
+         $skipped = 0;
+         $missingYardstick = 0;
+ 
+         CrcPartMaster::query()
+             ->whereNotNull('excel_row_data')
+             ->orderBy('id')
+             ->chunkById(500, function ($parts) use (&$updated, &$skipped, &$missingYardstick) {
+                 foreach ($parts as $part) {
+                     $rowData = $part->excel_row_data;
+ 
+                     if (is_string($rowData)) {
+                         $rowData = json_decode($rowData, true);
Removed / Before Commit
- 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'));
- }
- 
- private function getFundGrantData($startDate, $endDate): array
- 
- public function avgTatDays(Request $request)
Added / After Commit
+ use Illuminate\Support\Facades\Validator;
+ use Illuminate\Support\Facades\DB;
+ use Illuminate\Support\Facades\Cache;
+ use Illuminate\Support\Facades\Auth;
+ use Carbon\Carbon;
+ 
+ class DashboardController extends Controller
+ // Get current month equipment with gate passes grouped by group
+ $groupData = $this->getGroupData();
+ 
+         $isSuperAdmin = $this->isDashboardSuperAdmin();
+ 
+ // Get fund state by grant for the selected production year
+         $fundChartData = $isSuperAdmin ? $this->getFundGrantData($startDate, $endDate) : [
+             'labels' => [],
+             'allotted' => [],
+             'expend' => [],
+             'forward' => [],
Removed / Before Commit
- 
- $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=?",
-                     [$orderPrice, $finalGst, $total, $vendorId, now()->format('Y-m-d'), now()->format('Y-m-d'), (int)$sr['LPRSpareID']]);
- $updated++;
- }
- return response()->json(['success' => true, 'message' => "✅ EAS Captured! $updated rows updated."]);
Added / After Commit
+ 
+ $qty        = (float)($sr['Qty'] ?? 0);
+ $total      = $orderPrice !== null ? round($qty * $orderPrice * (1 + (($finalGst ?? 0) / 100)), 2) : null;
+                 $spareId    = (int)$sr['LPRSpareID'];
+                 $existing   = DB::selectOne("SELECT OrderPrice, FinalGST, TotalOrderAmount, L1VendorID, EASCreatedOn FROM lprspares WHERE LPRSpareID=?", [$spareId]);
+                 $isComplete = $orderPrice !== null && $orderPrice > 0 && $vendorId !== null;
+                 $changed    = !$existing
+                     || (float)($existing->OrderPrice ?? 0) !== (float)($orderPrice ?? 0)
+                     || (float)($existing->FinalGST ?? 0) !== (float)($finalGst ?? 0)
+                     || (float)($existing->TotalOrderAmount ?? 0) !== (float)($total ?? 0)
+                     || (int)($existing->L1VendorID ?? 0) !== (int)($vendorId ?? 0);
+ 
+                 $easDate = null;
+                 if ($isComplete) {
+                     $easDate = (!$changed && !empty($existing->EASCreatedOn))
+                         ? $existing->EASCreatedOn
+                         : now()->format('Y-m-d');
+                 }
Removed / Before Commit
- 
- $perPage = (int) request()->get('per_page', 10);
- $perPage = in_array($perPage, [10, 25, 50, 100], true) ? $perPage : 10;
- 
- if (true)
- {
- }
- 
- // Job date range
-                      if ($request->filled('job_date') && str_contains($request->job_date, ' - ')) {
- 
- [$start, $end] = explode(' - ', $request->job_date);
- 
-                         $q->whereBetween('job_date', [
-                             Carbon::parse(trim($start))->format('Y-m-d'),
-                             Carbon::parse(trim($end))->format('Y-m-d'),
-                         ]);
- }
Added / After Commit
+ 
+ $perPage = (int) request()->get('per_page', 10);
+ $perPage = in_array($perPage, [10, 25, 50, 100], true) ? $perPage : 10;
+          $sortOptions = $this->equipmentReportSortOptions();
+          $sortBy = $request->get('sort_by');
+          $sortDir = strtolower($request->get('sort_dir', 'asc')) === 'desc' ? 'desc' : 'asc';
+ 
+ if (true)
+ {
+ }
+ 
+ // Job date range
+                     if ($request->filled('job_date') && str_contains($request->job_date, ' - ')) {
+ 
+ [$start, $end] = explode(' - ', $request->job_date);
+ 
+                         $q->whereRaw(
+                             $this->dateSql('job_date') . ' BETWEEN ? AND ?',
Removed / Before Commit
- 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
- {
- 
- public function edit(Staff $staff)
- {
-         $staff->load(['employeeCategory', 'user.group', 'financeDetail']);
- 
- return view('finance-staff-details.edit', [
Added / After Commit
+ use App\Models\Attendance;
+ use App\Models\DaRate;
+ use App\Models\FinancePaymentRecovery;
+ use App\Models\FinanceSalarySnapshot;
+ use App\Models\FinanceSalaryRuleMaster;
+ use App\Models\FinanceStaffDetail;
+ use App\Models\FinanceSupplementaryPayment;
+ use App\Models\Leave;
+ use App\Models\Staff;
+ use App\Models\TaxRegimeMaster;
+ use Illuminate\Http\Request;
+ use Illuminate\Validation\ValidationException;
+ 
+ class FinanceStaffDetailsController extends Controller
+ {
+ 
+ public function edit(Staff $staff)
+ {
Removed / Before Commit
- use App\Http\Controllers\Controller;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\DB;
- use App\Helpers\LpoHelper;
- 
- class LprEditController extends Controller
- return response()->json($rows);
- }
- 
- /** GET /lpr/edit/{lprId} – AJAX: load master + spares */
- public function load(int $lprId)
- {
Added / After Commit
+ use App\Http\Controllers\Controller;
+ use Illuminate\Http\Request;
+ use Illuminate\Support\Facades\DB;
+ use Illuminate\Support\Facades\Schema;
+ use App\Helpers\LpoHelper;
+ 
+ class LprEditController extends Controller
+ return response()->json($rows);
+ }
+ 
+     /** DELETE /lpr/{lprId} */
+     public function destroy(int $lprId)
+     {
+         $lpr = DB::selectOne("SELECT LPRID, LPRNo, CaseNoID FROM new_lprs WHERE LPRID=?", [$lprId]);
+ 
+         if (!$lpr) {
+             return redirect()->route('lpr.all')->with('error', 'LPR not found.');
+         }
Removed / Before Commit
- public function create()
- {
- $userGroups = DB::select("SELECT UserGroupID, UserGroupName FROM UserGroups ORDER BY UserGroupName");
-         $grants     = DB::select("SELECT GrantID, GrantName FROM new_grants ORDER BY GrantName");
- $aus        = DB::select("SELECT AUID, AUName FROM au ORDER BY AUName");
- $units      = DB::select("SELECT id as UnitID, name as UnitName FROM units ORDER BY UnitName");
- $eqpts      = DB::select("SELECT EqptID, EqptName FROM eqpts ORDER BY EqptName");
Added / After Commit
+ public function create()
+ {
+ $userGroups = DB::select("SELECT UserGroupID, UserGroupName FROM UserGroups ORDER BY UserGroupName");
+         $grants     = DB::select("SELECT GrantID, GrantName FROM new_grants WHERE COALESCE(IsActive, 1) = 1 ORDER BY GrantName");
+ $aus        = DB::select("SELECT AUID, AUName FROM au ORDER BY AUName");
+ $units      = DB::select("SELECT id as UnitID, name as UnitName FROM units ORDER BY UnitName");
+ $eqpts      = DB::select("SELECT EqptID, EqptName FROM eqpts ORDER BY EqptName");
Removed / Before Commit
- return response()->json(['success' => false, 'error' => 'Spare row not found'], 404);
- }
- 
-         $hasExistingValues = $spare->ProposalPrice !== null || $spare->GST !== null || $spare->OtherCharges !== null || $spare->TotalAONAmount !== null;
-         if ($hasExistingValues && $reason === '') {
-             return response()->json(['success' => false, 'error' => 'Correction reason is required for updating an existing spare row.'], 422);
-         }
- 
- $total = (($price * (1 + $gst / 100)) * $qty) + $other;
- 
- try {
- 'message' => json_encode([
- 'module' => 'LPO Pending',
- 'lpr_spare_id' => $spareId,
-                             'reason' => $reason ?: 'Initial cost capture',
- 'old' => [
- 'ProposalPrice' => $spare->ProposalPrice,
- 'GST' => $spare->GST,
Added / After Commit
+ return response()->json(['success' => false, 'error' => 'Spare row not found'], 404);
+ }
+ 
+ $total = (($price * (1 + $gst / 100)) * $qty) + $other;
+ 
+ try {
+ 'message' => json_encode([
+ 'module' => 'LPO Pending',
+ 'lpr_spare_id' => $spareId,
+                             'reason' => $reason ?: 'Rate updated',
+ 'old' => [
+ 'ProposalPrice' => $spare->ProposalPrice,
+ 'GST' => $spare->GST,
Removed / Before Commit
- DATE_FORMAT(InvoiceDate, '%Y-%m-%d') AS InvoiceDate,
- BillNo,
- DATE_FORMAT(BillDate, '%Y-%m-%d')    AS BillDate,
- DVNo,
- DATE_FORMAT(PassedOn, '%Y-%m-%d')    AS PassedOn,
- BillStatus
- DATE_FORMAT(InvoiceDate, '%d-%m-%Y') AS InvoiceDate,
- BillNo,
- DATE_FORMAT(BillDate, '%d-%m-%Y')    AS BillDate,
- DVNo,
- DATE_FORMAT(PassedOn, '%d-%m-%Y')    AS PassedOn,
- BillStatus
- $invoiceDate = $request->InvoiceDate     ?: null;
- $billNo      = trim($request->BillNo     ?? '');
- $billDate    = $request->BillDate        ?: null;
- 
- if (!$orderNo)               return back()->with('error', '⚠️ Please select an Order No first!');
- if (!$invoiceNo || !$billNo) return back()->with('error', '❌ Invoice No and Bill No are required!');
Added / After Commit
+ DATE_FORMAT(InvoiceDate, '%Y-%m-%d') AS InvoiceDate,
+ BillNo,
+ DATE_FORMAT(BillDate, '%Y-%m-%d')    AS BillDate,
+                     COALESCE(DelayWeek, 0)                AS DelayWeek,
+                     COALESCE(LDAmount, 0)                 AS LDAmount,
+ DVNo,
+ DATE_FORMAT(PassedOn, '%Y-%m-%d')    AS PassedOn,
+ BillStatus
+ DATE_FORMAT(InvoiceDate, '%d-%m-%Y') AS InvoiceDate,
+ BillNo,
+ DATE_FORMAT(BillDate, '%d-%m-%Y')    AS BillDate,
+                 COALESCE(DelayWeek, 0)                AS DelayWeek,
+                 COALESCE(LDAmount, 0)                 AS LDAmount,
+ DVNo,
+ DATE_FORMAT(PassedOn, '%d-%m-%Y')    AS PassedOn,
+ BillStatus
+ $invoiceDate = $request->InvoiceDate     ?: null;
+ $billNo      = trim($request->BillNo     ?? '');
Removed / Before Commit
- $gemCNo      = trim($r['GEMCNo'] ?? '');
- $orderNo     = trim($r['OrderNo'] ?? '');
- $orderDate   = $r['OrderDate'] ?: null;
-             $noOfDays    = $r['NoOfDays'] !== '' ? (int)$r['NoOfDays'] : null;
- $delivPeriod = $r['DeliveryPeriod'] ?: null;
- 
- // Auto-format order number: GrantName/Serial/FY
- if ($orderNo && $orderDate) {
- $grant = DB::selectOne("SELECT g.GrantName FROM lprspares ls INNER JOIN new_lprs l ON ls.LPRID=l.LPRID INNER JOIN new_grants g ON l.GrantID=g.GrantID WHERE ls.LPRSpareID=? LIMIT 1", [$lprSpareId]);
Added / After Commit
+ $gemCNo      = trim($r['GEMCNo'] ?? '');
+ $orderNo     = trim($r['OrderNo'] ?? '');
+ $orderDate   = $r['OrderDate'] ?: null;
+             $noOfDays    = $r['NoOfDays'] !== '' ? max(0, (int)$r['NoOfDays']) : null;
+ $delivPeriod = $r['DeliveryPeriod'] ?: null;
+ 
+             if ($orderDate && $noOfDays !== null) {
+                 $delivPeriod = \Carbon\Carbon::parse($orderDate)->addDays($noOfDays)->format('Y-m-d');
+             }
+ 
+ // Auto-format order number: GrantName/Serial/FY
+ if ($orderNo && $orderDate) {
+ $grant = DB::selectOne("SELECT g.GrantName FROM lprspares ls INNER JOIN new_lprs l ON ls.LPRID=l.LPRID INNER JOIN new_grants g ON l.GrantID=g.GrantID WHERE ls.LPRSpareID=? LIMIT 1", [$lprSpareId]);
Removed / Before Commit
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\DB;
- use App\Helpers\LpoHelper;
- 
- class PrintController extends Controller
- {
- COALESCE(LPS.FinalGST,0) AS FinalGST,
- SUM(CASE WHEN LPS.OrderPrice IS NULL THEN 0 ELSE ROUND(COALESCE(LPS.Qty,0) * COALESCE(LPS.OrderPrice,0) * (1 + COALESCE(LPS.FinalGST,0) / 100), 2) END) AS TotalOrderAmount,
- COALESCE(V.VendorName,'') AS VendorName,
- COALESCE(LPS.OrderNo,'') AS OrderNo,
- MAX(LPS.OrderDate) AS OrderDate,
- MAX(LPS.DeliveryPeriod) AS DeliveryPeriod,
- LEFT JOIN au AU ON SP.AUID=AU.AUID
- LEFT JOIN vendors V ON LPS.L1VendorID=V.VendorID
- WHERE C.CaseID=? AND COALESCE(LPS.Qty,0)>0
- GROUP BY COALESCE(SP.Section,''), COALESCE(SP.PartNo,''), COALESCE(SP.Nomenclature,''),
- COALESCE(AU.AUName,''), COALESCE(LPS.OrderPrice,0), COALESCE(LPS.FinalGST,0),
-                 COALESCE(V.VendorName,''), COALESCE(LPS.OrderNo,'')
Added / After Commit
+ use Illuminate\Http\Request;
+ use Illuminate\Support\Facades\DB;
+ use App\Helpers\LpoHelper;
+ use App\Helpers\NumberToWords;
+ 
+ class PrintController extends Controller
+ {
+ COALESCE(LPS.FinalGST,0) AS FinalGST,
+ SUM(CASE WHEN LPS.OrderPrice IS NULL THEN 0 ELSE ROUND(COALESCE(LPS.Qty,0) * COALESCE(LPS.OrderPrice,0) * (1 + COALESCE(LPS.FinalGST,0) / 100), 2) END) AS TotalOrderAmount,
+ COALESCE(V.VendorName,'') AS VendorName,
+                 COALESCE(V.Address,'') AS VendorAddress,
+ COALESCE(LPS.OrderNo,'') AS OrderNo,
+ MAX(LPS.OrderDate) AS OrderDate,
+ MAX(LPS.DeliveryPeriod) AS DeliveryPeriod,
+ LEFT JOIN au AU ON SP.AUID=AU.AUID
+ LEFT JOIN vendors V ON LPS.L1VendorID=V.VendorID
+ WHERE C.CaseID=? AND COALESCE(LPS.Qty,0)>0
+                 AND LPS.OrderPrice IS NOT NULL
Removed / Before Commit
- COALESCE(g.GrantName, '') AS GrantName,
- COALESCE(sp.AUID, '') AS AUID,
- CASE
-                         WHEN MONTH(l.LPRDate) >= 4
-                             THEN CONCAT(YEAR(l.LPRDate), '-', RIGHT(YEAR(l.LPRDate) + 1, 2))
-                         ELSE CONCAT(YEAR(l.LPRDate) - 1, '-', RIGHT(YEAR(l.LPRDate), 2))
- END AS FinancialYear,
- COALESCE(ug.UserGroupName, '') AS UserGroupName,
- COALESCE(jt.JobType, '') AS JobType,
- LEFT JOIN jobtypes jt ON j.JobTypeID = jt.JobTypeID
- 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, ''),
- $sourceSql = $this->abcSourceSql();
- 
Added / After Commit
+ COALESCE(g.GrantName, '') AS GrantName,
+ COALESCE(sp.AUID, '') AS AUID,
+ CASE
+                         WHEN MONTH(ls.OrderDate) >= 4
+                             THEN CONCAT(YEAR(ls.OrderDate), '-', RIGHT(YEAR(ls.OrderDate) + 1, 2))
+                         ELSE CONCAT(YEAR(ls.OrderDate) - 1, '-', RIGHT(YEAR(ls.OrderDate), 2))
+ END AS FinancialYear,
+ COALESCE(ug.UserGroupName, '') AS UserGroupName,
+ COALESCE(jt.JobType, '') AS JobType,
+ LEFT JOIN jobtypes jt ON j.JobTypeID = jt.JobTypeID
+ LEFT JOIN UserGroups ug ON l.UserGroupID = ug.UserGroupID
+ LEFT JOIN eqpts e ON j.EqptID = e.EqptID
+                 WHERE ls.OrderDate 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, ''),
+ $sourceSql = $this->abcSourceSql();
+ 
Removed / Before Commit
- use App\Http\Controllers\Controller;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\DB;
- 
- class OrderStateController extends Controller
- {
- $fy       = trim($request->query('FY', ''));
- $status   = trim($request->query('status', ''));
- 
-         $grants  = DB::select("SELECT 0 AS GrantID,'-- All Grants --' AS GrantName UNION SELECT GrantID,GrantName FROM new_grants ORDER BY GrantName");
- $vendors = DB::select("SELECT 0 AS VendorID,'-- All Vendors --' AS VendorName UNION SELECT VendorID,VendorName FROM vendors WHERE IsActive=1 ORDER BY VendorName");
- $ugroups = DB::select("SELECT 0 AS UserGroupID,'-- All Groups --' AS UserGroupName UNION SELECT UserGroupID,UserGroupName FROM UserGroups ORDER BY UserGroupName");
- $fyList  = DB::select("SELECT DISTINCT YEAR(OrderDate) AS FY FROM lprspares WHERE OrderDate IS NOT NULL AND YEAR(OrderDate)>=YEAR(CURDATE())-10 ORDER BY FY DESC");
- $params
- );
- 
- return view('reports.order-state', compact('grants','vendors','ugroups','fyList','rows','grantId','vendorId','ugId','fy','status'));
- }
Added / After Commit
+ use App\Http\Controllers\Controller;
+ use Illuminate\Http\Request;
+ use Illuminate\Support\Facades\DB;
+ use App\Helpers\LpoHelper;
+ 
+ class OrderStateController extends Controller
+ {
+ $fy       = trim($request->query('FY', ''));
+ $status   = trim($request->query('status', ''));
+ 
+         $grants  = DB::select("SELECT 0 AS GrantID,'-- All Grants --' AS GrantName UNION SELECT GrantID,GrantName FROM new_grants WHERE COALESCE(IsActive, 1) = 1 ORDER BY GrantName");
+ $vendors = DB::select("SELECT 0 AS VendorID,'-- All Vendors --' AS VendorName UNION SELECT VendorID,VendorName FROM vendors WHERE IsActive=1 ORDER BY VendorName");
+ $ugroups = DB::select("SELECT 0 AS UserGroupID,'-- All Groups --' AS UserGroupName UNION SELECT UserGroupID,UserGroupName FROM UserGroups ORDER BY UserGroupName");
+ $fyList  = DB::select("SELECT DISTINCT YEAR(OrderDate) AS FY FROM lprspares WHERE OrderDate IS NOT NULL AND YEAR(OrderDate)>=YEAR(CURDATE())-10 ORDER BY FY DESC");
+ $params
+ );
+ 
+         if ($request->query('export') === 'csv') {
Removed / Before Commit
- use App\Models\FinanceSalarySnapshot;
- use App\Models\Staff;
- use App\Services\SalaryCalculationService;
- use Illuminate\Http\Request;
- 
- class SalaryController extends Controller
- {
- public function show(Request $request, Staff $staff, SalaryCalculationService $salaryService)
- {
-         $month = (int) $request->input('month', now()->month);
-         $year = (int) $request->input('year', now()->year);
-         $force = $request->boolean('regenerate');
-         $existingBeforeGenerate = FinanceSalarySnapshot::where('employee_id', $staff->id)
- ->where('month', $month)
- ->where('year', $year)
-             ->exists();
- 
-         $staff->load(['designation', 'employeeCategory', 'user.group', 'financeDetail', 'financePaymentRecovery']);
Added / After Commit
+ use App\Models\FinanceSalarySnapshot;
+ use App\Models\Staff;
+ use App\Services\SalaryCalculationService;
+ use Barryvdh\DomPDF\Facade\Pdf;
+ use Illuminate\Http\Request;
+ 
+ class SalaryController extends Controller
+ {
+ public function show(Request $request, Staff $staff, SalaryCalculationService $salaryService)
+ {
+         $staff->load(['designation', 'employeeCategory', 'user.group', 'financeDetail', 'financePaymentRecovery']);
+         $defaultPeriod = $this->defaultSalaryPeriod($staff);
+         $month = (int) $request->input('month', $defaultPeriod['month']);
+         $year = (int) $request->input('year', $defaultPeriod['year']);
+         $generate = $request->boolean('generate');
+         $regenerate = $request->boolean('regenerate');
+         $periodRule = $this->salaryPeriodRule($staff, $month, $year);
+         $existingSnapshot = FinanceSalarySnapshot::where('employee_id', $staff->id)
Removed / Before Commit
- {
- 
- public function index(Request $request)
- {
-     $query = SubAssyEquipment::with('equipment.subgroup.group');
- 
-     if ($request->filled('group_id')) {
-         $query->whereHas('equipment.subgroup', function ($q) use ($request) {
-             $q->where('group_id', $request->group_id);
-         });
-     }
- 
-     if ($request->filled('equipment_id')) {
-         $query->where('equipment_id', $request->equipment_id);
-     }
- 
-     if ($request->filled('sub_equipment_name')) {
-         $query->where('sub_equipment_name', 'like', '%' . $request->sub_equipment_name . '%');
Added / After Commit
+ {
+ 
+ public function index(Request $request)
+     {
+         $query = SubAssyEquipment::with(['equipment.group', 'equipment.subgroup.group']);
+ 
+         if ($request->filled('group_id')) {
+             $query->whereHas('equipment', function ($q) use ($request) {
+                 $q->where('group_id', $request->group_id)
+                     ->orWhereHas('subgroup', function ($subgroupQuery) use ($request) {
+                         $subgroupQuery->where('group_id', $request->group_id);
+                     });
+             });
+         }
+ 
+         if ($request->filled('equipment_id')) {
+             $query->where('equipment_id', $request->equipment_id);
+         }
Removed / Before Commit
- 'resolved_at',
- 'equipment_details',
- 'complaint_number',
- ];
- 
- protected $casts = [
- 'created_at' => 'datetime',
- 'updated_at' => 'datetime',
- 'equipment_details' => 'array',
- ];
- 
- public function resolver(): BelongsTo
Added / After Commit
+ 'resolved_at',
+ 'equipment_details',
+ 'complaint_number',
+         'old_import_data',
+ ];
+ 
+ protected $casts = [
+ 'created_at' => 'datetime',
+ 'updated_at' => 'datetime',
+ 'equipment_details' => 'array',
+         'old_import_data' => 'array',
+ ];
+ 
+ public function resolver(): BelongsTo
Removed / Before Commit
- 'cr_no',
- 'handicap',
- 'govt_accommodation',
- 'special_pay',
- 'risk_allowance',
- 'dress_allowance',
- 'night_duty_allowance',
- 'wash',
- 'misc_nps',
- 'misc_pay',
- 'misc_deduction',
- ];
- 
- protected $casts = [
- 'handicap' => 'boolean',
- 'govt_accommodation' => 'boolean',
- 'special_pay' => 'decimal:2',
- 'risk_allowance' => 'decimal:2',
Added / After Commit
+ 'cr_no',
+ 'handicap',
+ 'govt_accommodation',
+         'is_ex_serviceman',
+         'has_cghs_card',
+ 'special_pay',
+ 'risk_allowance',
+ 'dress_allowance',
+ 'night_duty_allowance',
+ 'wash',
+ 'misc_nps',
+         'misc_nps_ind',
+ 'misc_pay',
+         'misc_pay_remark',
+ 'misc_deduction',
+         'misc_deduction_remark',
+ ];
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Model;
+ use Illuminate\Database\Eloquent\Relations\HasMany;
+ 
+ class NewGrant extends Model
+ {
+     protected $table = 'new_grants';
+     protected $primaryKey = 'GrantID';
+     public $incrementing = false;
+     public $timestamps = false;
+ 
+     protected $fillable = [
+         'GrantID',
+         'GrantName',
+         'CodeHead',
Removed / Before Commit
- use App\Models\FinanceInduDeduction;
- use App\Models\FinanceSalarySnapshot;
- use App\Models\FinanceSupplementaryPayment;
- use App\Models\Leave;
- use App\Models\Staff;
- use Carbon\Carbon;
- $leaveBalances = $this->leaveBalances($staff);
- $earnedBasic = $this->roundAmount($basic * $attendance['pay_days'] / max(1, $attendance['total_working_days']));
- 
-         $da = $this->roundAmount($earnedBasic * $daRate / 100);
-         $hra = $this->calculateHra($staff, $earnedBasic, $attendance);
-         $tpt = $attendance['whole_month_non_present'] ? 0 : $this->calculateTpt($staff, $basic);
-         $risk = $attendance['whole_month_non_present'] ? 0 : round($this->manualOrDefault(data_get($finance, 'risk_allowance'), 0));
- $specialPay = (float) data_get($finance, 'special_pay', 0);
- $daTpt = $this->roundAmount($tpt * $this->ruleValue('da_tpt_percentage', $daRate) / 100);
- $dressAllowance = (float) data_get($finance, 'dress_allowance', 0);
-         $nightDutyAllowance = (float) data_get($finance, 'night_duty_allowance', 0);
-         $cghs = $this->manualOrDefault(data_get($payment, 'cghs'), $this->calculateCghs($level));
Added / After Commit
+ use App\Models\FinanceInduDeduction;
+ use App\Models\FinanceSalarySnapshot;
+ use App\Models\FinanceSupplementaryPayment;
+ use App\Models\Holiday;
+ use App\Models\Leave;
+ use App\Models\Staff;
+ use Carbon\Carbon;
+ $leaveBalances = $this->leaveBalances($staff);
+ $earnedBasic = $this->roundAmount($basic * $attendance['pay_days'] / max(1, $attendance['total_working_days']));
+ 
+         $da = $this->roundAmount($basic * $daRate / 100);
+         $hraStatus = $this->hraStatus($staff, $attendance, $month, $year);
+         $hra = $this->calculateHra($staff, $earnedBasic, $attendance, $month, $year);
+         $tptZeroReason = $attendance['tpt_zero_reason'] ?? null;
+         $tpt = $tptZeroReason ? 0 : $this->calculateTpt($staff, $basic, $month, $year, $attendance);
+         $riskAllowanceZeroReason = $attendance['risk_allowance_zero_reason'] ?? null;
+         $risk = $riskAllowanceZeroReason ? 0 : round($this->manualOrDefault(data_get($finance, 'risk_allowance'), 0));
+ $specialPay = (float) data_get($finance, 'special_pay', 0);
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('vendorbills', function (Blueprint $table) {
+             if (!Schema::hasColumn('vendorbills', 'DelayWeek')) {
+                 $table->unsignedInteger('DelayWeek')->default(0)->after('BillDate');
+             }
+             if (!Schema::hasColumn('vendorbills', 'LDAmount')) {
+                 $table->decimal('LDAmount', 14, 2)->default(0)->after('DelayWeek');
+             }
+         });
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('complaints', function (Blueprint $table) {
+             if (!Schema::hasColumn('complaints', 'old_import_data')) {
+                 $table->json('old_import_data')->nullable()->after('complaint_number');
+             }
+         });
+     }
+ 
+     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\Schema;
+ 
+ return new class extends Migration
+ {
+     public function up(): void
+     {
+         Schema::table('finance_staff_details', function (Blueprint $table) {
+             if (!Schema::hasColumn('finance_staff_details', 'misc_nps_ind')) {
+                 $table->decimal('misc_nps_ind', 12, 2)->nullable()->after('misc_nps');
+             }
+ 
+             if (!Schema::hasColumn('finance_staff_details', 'misc_pay_remark')) {
+                 $table->text('misc_pay_remark')->nullable()->after('misc_pay');
+             }
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_staff_details', function (Blueprint $table) {
+             if (!Schema::hasColumn('finance_staff_details', 'is_ex_serviceman')) {
+                 $table->boolean('is_ex_serviceman')->default(false)->after('govt_accommodation');
+             }
+ 
+             if (!Schema::hasColumn('finance_staff_details', 'has_cghs_card')) {
+                 $table->boolean('has_cghs_card')->default(false)->after('is_ex_serviceman');
+             }
Removed / Before Commit

                                                
Added / After Commit
+ -- Army509 updates for 2026-07-08
+ -- Grant master table and Order Billing migration SQL.
+ 
+ CREATE TABLE IF NOT EXISTS `new_grants` (
+     `GrantID` int NOT NULL,
+     `GrantName` varchar(50) DEFAULT NULL,
+     `CodeHead` varchar(20) DEFAULT NULL,
+     `MinorHead` varchar(50) DEFAULT NULL,
+     `Schedule` varchar(100) DEFAULT NULL,
+     `SubSchedule` varchar(50) DEFAULT NULL,
+     `IsActive` tinyint(1) DEFAULT NULL,
+     PRIMARY KEY (`GrantID`)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+ 
+ SET @sql := (
+     SELECT IF(
+         COUNT(*) = 0,
+         'ALTER TABLE `vendorbills` ADD COLUMN `DelayWeek` int unsigned NOT NULL DEFAULT 0 AFTER `BillDate`',
Removed / Before Commit
- <div class="col-md-6">
- <h4 class="mb-0"><b>Add Grant</b></h4>
- </div>
- </div>
- </div>
- <hr>
Added / After Commit
+ <div class="col-md-6">
+ <h4 class="mb-0"><b>Add Grant</b></h4>
+ </div>
+                     <div class="col-md-6 text-end">
+                         <a href="{{ route('adm.grants') }}" class="btn btn-outline-primary btn-sm">Manage Grants</a>
+                     </div>
+ </div>
+ </div>
+ <hr>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ @section('title','Grant Master')
+ @section('content')
+ 
+ <div class="row">
+     <div class="col">
+ 
+         @if(session('success'))
+             <div class="alert alert-success alert-dismissible fade show fw-bold">
+                 {{ session('success') }}<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
+             </div>
+         @endif
+         @if(session('error'))
+             <div class="alert alert-danger alert-dismissible fade show fw-bold">
+                 {{ session('error') }}<button type="button" class="btn-close" data-bs-dismiss="alert"></button>
+             </div>
+         @endif
+         @if(isset($errors) && $errors->any())
Removed / Before Commit
- <meta charset="utf-8">
- <title>AON Print – {{ $case->CaseNo }}</title>
- <style>
-     @page { size: A4 portrait; margin: 0.8cm; }
-     body { font-family: Arial, sans-serif; font-size: 14px; color: #000; line-height: 1.4; margin: 0; padding: 0; }
- 
- .title-section { text-align: center; font-weight: bold; margin: 0 30px 20px 30px; line-height: 1.2; text-transform: uppercase; }
- 
- @media print {
- .no-print { display: none; }
- body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
-         @page { size: A4 portrait; margin: 0.8cm; }
- }
- </style>
- </head>
- </div>
- 
- {{-- Para 1 --}}
Added / After Commit
+ <meta charset="utf-8">
+ <title>AON Print – {{ $case->CaseNo }}</title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+     body { font-family: Arial, sans-serif; font-size: 14px; color: #000; line-height: 1.4; margin: 0; padding: 0.8cm; }
+ 
+ .title-section { text-align: center; font-weight: bold; margin: 0 30px 20px 30px; line-height: 1.2; text-transform: uppercase; }
+ 
+ @media print {
+ .no-print { display: none; }
+ body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
+         @page { size: A4 portrait; margin: 0; }
+ }
+ </style>
+ </head>
+ </div>
+ 
+ {{-- Para 1 --}}
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Undertaking – {{ $case->CaseNo }}</title>
- <style>
-     @page { size: A4 portrait; margin: 1cm 1.5cm 1cm 2.5cm; }
- 
- body {
- font-family: Arial, sans-serif;
- font-size: 12pt;
- line-height: 1.4;
- margin: 0;
-         padding: 0;
- color: #000;
- }
- 
- margin-bottom: 30px;
- font-size: 14pt;
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+ 
+ body {
+ font-family: Arial, sans-serif;
+ font-size: 12pt;
+ line-height: 1.4;
+ margin: 0;
+         padding: 1cm 1.5cm 1cm 2.5cm;
+ color: #000;
+ }
+ 
+ margin-bottom: 30px;
+ font-size: 14pt;
Removed / Before Commit
- <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>
- </div>
- </div>
- </div>
Added / After Commit
+ <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.benchmarking', $caseId) }}" target="_blank" class="btn btn-filter"> Print</a>
+ </div>
+ </div>
+ </div>
Removed / Before Commit

                                                
Added / After Commit
+ <!DOCTYPE html>
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+     @page matrix { size: A4 landscape; margin: 0; }
+     body { font-family: Arial, sans-serif; font-size: 13px; color:#000; line-height:1.25; margin:0; padding:1.2cm; box-sizing:border-box; }
+     .no-print { text-align:right; margin-bottom:10px; }
+     .page { page-break-after: always; min-height: 26cm; }
+     .matrix-page { page: matrix; page-break-after: auto; }
+     .title { text-align:center; font-weight:bold; text-transform:uppercase; }
+     .annex { text-align:right; font-weight:bold; text-decoration:underline; margin-bottom:24px; }
+     .meta-table { width:100%; border-collapse:collapse; margin-top:30px; }
+     .meta-table td { padding:8px 6px; vertical-align:top; }
+     .colon { width:20px; text-align:center; }
+     .label { width:32%; }
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Commercial Opening Board – {{ $case->CaseNo }}</title>
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
- <style>
-     body { background: white; padding: 30px; font-size: 14px; }
- .print-header { text-align: center; margin-bottom: 10px; }
- .master-table td { padding: 6px 10px; }
- .para { margin: 0 0 14px 0; text-align: justify; }
- .para-number { display: inline-block; width: 20px; margin-right: 15px; }
- .para-text { display: inline; }
- .sub-para { margin-left: 35px; margin-bottom: 10px; text-align: justify; }
- .sub-para-number { display: inline-block; width: 35px; font-weight: bold; margin-right: 15px; }
- .sub-para-text { display: inline; }
- .no-print { text-align: right; margin-bottom: 10px; }
- @media print {
-         body { margin: 0; padding: 15px; }
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+     body { background: white; padding: 1cm; font-family: Arial, sans-serif; font-size: 14px; color:#000; line-height:1.35; box-sizing:border-box; }
+ .print-header { text-align: center; margin-bottom: 10px; }
+ .master-table td { padding: 6px 10px; }
+     table { width:100%; border-collapse:collapse; }
+     .table-borderless td { border:none; }
+     .table-bordered th, .table-bordered td { border:1px solid #000; padding:5px; vertical-align:middle; }
+     .table-light th { background:#f5f5f5; }
+     .fw-bold { font-weight:bold; }
+ .para { margin: 0 0 14px 0; text-align: justify; }
+ .para-number { display: inline-block; width: 20px; margin-right: 15px; }
+ .para-text { display: inline; }
+ .sub-para { margin-left: 35px; margin-bottom: 10px; text-align: justify; }
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>PNC Board Report – {{ $case->CaseNo }}</title>
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
- <style>
-     body { background: white; padding: 30px; font-size: 14px; }
- .master-table td { padding: 6px 10px; }
- .para { margin: 0 0 14px 0; text-align: justify; }
- .para-number { display: inline-block; width: 20px; margin-right: 15px; }
- .sub-para-number { display: inline-block; width: 35px; font-weight: bold; margin-right: 15px; }
- .sub-para-text { display: inline; }
- .no-print { text-align: right; margin-bottom: 10px; }
- @media print {
-         body { margin: 0; padding: 15px; }
- .no-print { display: none; }
-         @page { size: A4 portrait; margin: 1cm; }
- }
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+     body { background: white; padding: 1cm; font-family: Arial, sans-serif; font-size: 14px; color:#000; line-height:1.35; box-sizing:border-box; }
+     table { width:100%; border-collapse:collapse; }
+     .table-borderless td { border:none; }
+     .table-bordered th, .table-bordered td { border:1px solid #000; padding:5px; vertical-align:middle; }
+     .table-light th { background:#f5f5f5; }
+     .fw-bold { font-weight:bold; }
+ .master-table td { padding: 6px 10px; }
+ .para { margin: 0 0 14px 0; text-align: justify; }
+ .para-number { display: inline-block; width: 20px; margin-right: 15px; }
+ .sub-para-number { display: inline-block; width: 35px; font-weight: bold; margin-right: 15px; }
+ .sub-para-text { display: inline; }
+ .no-print { text-align: right; margin-bottom: 10px; }
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>TEC Report – {{ $case->CaseNo }}</title>
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
- <style>
-     @page { size: A4 portrait; margin: 0.8cm; }
-     body { font-family: Arial, sans-serif; font-size: 14px; color: #000; line-height: 1.4; margin: 0; padding: 0; }
- .master-table td { padding: 6px 10px; }
- .para { margin: 0 0 14px 0; text-align: justify; }
- .para-number { display: inline-block; width: 20px; margin-right: 15px; }
- .sub-para-number { display: inline-block; width: 35px; font-weight: bold; margin-right: 15px; }
- .sub-para-text { display: inline; }
- .no-print { text-align: right; margin-bottom: 10px; }
- @media print {
-         body { margin: 0; padding: 8px; }
- .no-print { display: none; }
-         @page { size: A4 portrait; margin: 0.8cm; }
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+     body { background: white; padding: 1cm; font-family: Arial, sans-serif; font-size: 14px; color:#000; line-height:1.35; box-sizing:border-box; }
+     table { width:100%; border-collapse:collapse; }
+     .table-borderless td { border:none; }
+     .table-bordered th, .table-bordered td { border:1px solid #000; padding:5px; vertical-align:middle; }
+     .table-light th { background:#f5f5f5; }
+     .fw-bold { font-weight:bold; }
+ .master-table td { padding: 6px 10px; }
+ .para { margin: 0 0 14px 0; text-align: justify; }
+ .para-number { display: inline-block; width: 20px; margin-right: 15px; }
+ .sub-para-number { display: inline-block; width: 35px; font-weight: bold; margin-right: 15px; }
+ .sub-para-text { display: inline; }
+ .no-print { text-align: right; margin-bottom: 10px; }
Removed / Before Commit
- <small class="text-muted">All complaints in the system</small>
- </div>
- <div class="col-md-6">
-                 <div class="d-flex justify-content-end">
- {{-- Show admin approval link only for admin users --}}
- @if(auth()->check() && (auth()->user()->role === 'admin' || auth()->user()->role === 'superadmin'))
-                         <a href="{{ route('complaints.adminApproval') }}" class="btn btn-warning me-2">
- <i class="fas fa-check-circle"></i> Admin Approval
- </a>
- @endif
-                     
- <a href="{{ route('complaints.create') }}" class="btn btn-primary">Raise New Complaint</a>
- </div>
- </div>
- 
- <hr>
- <div class="card-body">
- <div class="table-responsive">
Added / After Commit
+ <small class="text-muted">All complaints in the system</small>
+ </div>
+ <div class="col-md-6">
+                 <div class="d-flex justify-content-end flex-wrap gap-2">
+ {{-- Show admin approval link only for admin users --}}
+ @if(auth()->check() && (auth()->user()->role === 'admin' || auth()->user()->role === 'superadmin'))
+                         <a href="{{ route('complaints.admin-approval') }}" class="btn btn-warning me-2">
+ <i class="fas fa-check-circle"></i> Admin Approval
+ </a>
+ @endif
+ 
+                     <a href="{{ route('complaints.import.sample') }}" class="btn btn-success text-white" style="background-color:#198754 !important; border-color:#198754 !important; color:#fff !important;">
+                         <i class="fas fa-download"></i> Sample File
+                     </a>
+                     <button type="button" class="btn btn-info text-white" style="background-color:#0dcaf0 !important; border-color:#0dcaf0 !important; color:#fff !important;" data-bs-toggle="modal" data-bs-target="#complaintImportModal">
+                         <i class="fas fa-file-import"></i> Import Old Data
+                     </button>
+ <a href="{{ route('complaints.create') }}" class="btn btn-primary">Raise New Complaint</a>
Removed / Before Commit
- <tr>
- <td>{{ $entry->c_n }}</td>
- <td>{{ $entry?->workUnit?->units?->name ?? '-' }}</td>
-                         <td>@foreach ($entry->WorkOrders as $control)
-                             <div>{{ $control->control_no }}  <a href="{{ route('crc.workorder.print', base64_encode($control->control_no)) }}" target="_blank" class="btn" style="color:blue"><i class="fa fa-eye" aria-hidden="true"></i></a></div>
- 
-                             @endforeach</td>
- <td>
- @if(count($entry->WorkOrders) == 0)
- Pending
- });
- });
- </script>
- @endpush
- \ No newline at end of file
Added / After Commit
+ <tr>
+ <td>{{ $entry->c_n }}</td>
+ <td>{{ $entry?->workUnit?->units?->name ?? '-' }}</td>
+                         <td>
+                             @php
+                                 $hasCrcJob = $entry->WorkOrders->contains(fn ($workOrder) => !empty($workOrder->job_no));
+                             @endphp
+                             @foreach ($entry->WorkOrders as $control)
+                             <div>
+                                 {{ $control->control_no }}
+                                 <a href="{{ route('crc.workorder.print', base64_encode($control->control_no)) }}" target="_blank" class="btn" style="color:blue" title="Work Order"><i class="fa fa-eye" aria-hidden="true"></i></a>
+                                 @if($hasCrcJob)
+                                     <a href="{{ route('crc.timeallotment.print', base64_encode($control->control_no)) }}" target="_blank" class="btn btn-sm" style="color:blue" title="Time Allotment Print">
+                                         <i class="fa fa-print" aria-hidden="true"></i>
+                                     </a>
+                                 @endif
+                             </div>
+ 
Removed / Before Commit

                                                
Added / After Commit
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <meta charset="UTF-8">
+ <title>CRC Time Allotment Sheet</title>
+ 
+ <style>
+ body {
+     font-family: Arial, sans-serif;
+     margin: 34px;
+     font-size: 14px;
+     color: #000;
+ }
+ 
+ .print-btn {
+     text-align: center;
+     margin-bottom: 18px;
+ }
Removed / Before Commit
- <th>Hours</th>
- </tr>
- 
- @php $total = 0;$totalhour = 0; @endphp
- 
- @foreach($equipments as $group)
- 
- @php
- $item = $group->first();
- $qty = $group->sum('quantity');
- 
- $totalhour = $item->CrcEquipments->hours * $qty
- @endphp
- 
- <tr>
- <td>{{ $item->CrcEquipments->nomenclature }}</td>
- <td>{{ $qty }}</td>
- <td></td>
Added / After Commit
+ <th>Hours</th>
+ </tr>
+ 
+ @php $total = 0; $totalHours = 0; @endphp
+ 
+ @foreach($equipments as $group)
+ 
+ @php
+ $item = $group->first();
+ $qty = $group->sum('quantity');
+ 
+ $rowHours = ($item->CrcEquipments->hours ?? 0) * $qty;
+ @endphp
+ 
+ <tr>
+ <td>{{ $item->CrcEquipments->nomenclature }}</td>
+ <td>{{ $qty }}</td>
+ <td></td>
Removed / Before Commit
- border-radius: 8px;
- background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
- padding: 12px 12px 4px;
- }
- .tat-chart-canvas {
- position: relative;
- height: 440px;
-       min-width: 1400px;
- }
- .tat-loader {
- height: 440px;
- font-weight: 700;
- white-space: nowrap;
- }
- .target-chart-shell {
- position: relative;
- overflow-x: auto;
- border-radius: 8px;
Added / After Commit
+ border-radius: 8px;
+ background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
+ padding: 12px 12px 4px;
+       scrollbar-gutter: stable;
+ }
+ .tat-chart-canvas {
+ position: relative;
+ height: 440px;
+       min-width: 100%;
+ }
+ .tat-loader {
+ height: 440px;
+ font-weight: 700;
+ white-space: nowrap;
+ }
+     .target-state-actions {
+       display: flex;
+       align-items: center;
Removed / Before Commit
- <div class="row mb-2">
- <div class="col-12 d-flex gap-2 flex-wrap">
- <button class="btn btn-success btn-custom" onclick="captureEAS(this)"> Capture EAS</button>
-                     <button class="btn btn-filter btn-custom" onclick="revealPrintButtons()"> Print</button>
-                     <button id="btnNoting"      class="btn btn-dark btn-custom d-none"         onclick="printNoting()"> Noting Sheet</button>
-                     <button id="btn154"         class="btn btn-secondary btn-custom d-none"    onclick="printCert154()"> Cert (154)</button>
-                     <button id="btnCFASanction" class="btn btn-warning text-dark btn-custom d-none" onclick="printSanction()"> Sanction Order</button>
-                     <button id="btnSO"          class="btn btn-danger btn-custom d-none"       onclick="printSupplyOrder()"> Supply Order</button>
- </div>
- </div>
- </div>
- .forEach(id => document.getElementById(id).value = '');
- document.getElementById('easBody').innerHTML =
- '<tr><td colspan="10" class="text-center text-muted py-3">Select Case No above to load EAS Sheet</td></tr>';
-     // Hide all print sub-buttons on case clear
-     ['btnNoting','btn154','btnCFASanction','btnSO']
-         .forEach(id => document.getElementById(id).classList.add('d-none'));
- }
Added / After Commit
+ <div class="row mb-2">
+ <div class="col-12 d-flex gap-2 flex-wrap">
+ <button class="btn btn-success btn-custom" onclick="captureEAS(this)"> Capture EAS</button>
+                     <button class="btn btn-filter btn-custom" onclick="printEasGem()"> Print</button>
+                     <button id="btnNoting"      class="btn btn-dark btn-custom"         onclick="printNoting()"> Noting Sheet</button>
+                     <button id="btn154"         class="btn btn-secondary btn-custom"    onclick="printCert154()"> Cert (154)</button>
+                     <button id="btnCFASanction" class="btn btn-warning text-dark btn-custom" onclick="printSanction()"> Sanction Order</button>
+                     <button id="btnSO"          class="btn btn-danger btn-custom"       onclick="printSupplyOrder()"> Supply Order</button>
+ </div>
+ </div>
+ </div>
+ .forEach(id => document.getElementById(id).value = '');
+ document.getElementById('easBody').innerHTML =
+ '<tr><td colspan="10" class="text-center text-muted py-3">Select Case No above to load EAS Sheet</td></tr>';
+ }
+ 
+ // Reveal print sub-buttons only when user clicks the Print button (matches original PHP)
+ function revealPrintButtons() {
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>EAS Approval Print – {{ $case->CaseNo }}</title>
- <style>
-     @page { size: A4 portrait; margin: 0.8cm; }
- 
- body {
- font-family: Arial, sans-serif;
- font-size: 14px;
- color: #000;
- line-height: 1.4;
- margin: 0;
-         padding: 0;
- }
- 
- .header-section, .title-section { text-align: center; }
- .no-print { display: none; }
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+ 
+ body {
+ font-family: Arial, sans-serif;
+ font-size: 14px;
+ color: #000;
+ line-height: 1.4;
+ margin: 0;
+         padding: 0.8cm;
+         box-sizing: border-box;
+ }
+ 
+ .header-section, .title-section { text-align: center; }
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Rule 155 Approval Print – {{ $case->CaseNo }}</title>
- <style>
-     @page { size: A4 portrait; margin: 0.8cm; }
- 
- body {
- font-family: Arial, sans-serif;
- font-size: 14px;
- color: #000;
- line-height: 1.4;
- margin: 0;
-         padding: 0;
- }
- 
- .header-section, .title-section { text-align: center; }
- @media print {
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+ 
+ body {
+ font-family: Arial, sans-serif;
+ font-size: 14px;
+ color: #000;
+ line-height: 1.4;
+ margin: 0;
+         padding: 0.8cm;
+         box-sizing: border-box;
+ }
+ 
+ .header-section, .title-section { text-align: center; }
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Certificate – {{ $case->CaseNo }}</title>
- <style>
-     body { font-family: Arial, sans-serif; font-size: 14px; }
- 
- .container { width: 900px; margin: auto; }
- 
- @media print {
- .no-print { display: none; }
- body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
-         @page { size: A4 portrait; margin: 1cm; }
- }
- </style>
- </head>
- : rtrim(rtrim(number_format($qty, 3, '.', ''), '0'), '.');
- @endphp
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+     body { font-family: Arial, sans-serif; font-size: 14px; margin:0; padding:0.8cm; box-sizing:border-box; }
+ 
+ .container { width: 900px; margin: auto; }
+ 
+ @media print {
+ .no-print { display: none; }
+ body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
+         body { margin:0; padding:0.8cm; }
+ }
+ </style>
+ </head>
+ : rtrim(rtrim(number_format($qty, 3, '.', ''), '0'), '.');
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>EAS Direct Purchase – {{ $case->CaseNo }}</title>
- <style>
-     @page { size: A4 portrait; margin: 0.8cm; }
-     body { font-family: Arial, sans-serif; font-size: 14px; color: #000; line-height: 1.4; margin: 0; padding: 0; }
- .title-section { text-align: center; font-weight: bold; margin: 0 50px 20px 50px; line-height: 1.2; text-transform: uppercase; }
- .para { margin: 0 0 12px 0; text-align: justify; }
- .para-number { display: inline-block; min-width: 25px; }
- .no-print { display: none; }
- thead { display: table-header-group; }
- body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
-         @page { size: A4 portrait; margin: 0.8cm; }
- }
- </style>
- </head>
- {{-- Title — note "DIRECTLY AVILABLE ON GEM" at end (matches original typo) --}}
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+     body { font-family: Arial, sans-serif; font-size: 14px; color: #000; line-height: 1.4; margin: 0; padding: 0.8cm; box-sizing:border-box; }
+ .title-section { text-align: center; font-weight: bold; margin: 0 50px 20px 50px; line-height: 1.2; text-transform: uppercase; }
+ .para { margin: 0 0 12px 0; text-align: justify; }
+ .para-number { display: inline-block; min-width: 25px; }
+ .no-print { display: none; }
+ thead { display: table-header-group; }
+ body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
+         body { margin: 0; padding: 0.8cm; }
+ }
+ </style>
+ </head>
+ {{-- Title — note "DIRECTLY AVILABLE ON GEM" at end (matches original typo) --}}
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>EAS Approval GeM – {{ $case->CaseNo }}</title>
- <style>
-     @page { size: A4 portrait; margin: 0.8cm; }
-     body { font-family: Arial, sans-serif; font-size: 14px; color: #000; line-height: 1.4; margin: 0; padding: 0; }
- .title-section { text-align: center; font-weight: bold; margin: 0 50px 20px 50px; line-height: 1.2; text-transform: uppercase; }
- .para { margin: 0 0 12px 0; text-align: justify; }
- .para-number { display: inline-block; min-width: 25px; }
- .no-print { display: none; }
- thead { display: table-header-group; }
- body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
-         @page { size: A4 portrait; margin: 0.8cm; }
- }
- </style>
- </head>
- <div class="title-section">
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+     body { font-family: Arial, sans-serif; font-size: 14px; color: #000; line-height: 1.4; margin: 0; padding: 0.8cm; box-sizing:border-box; }
+ .title-section { text-align: center; font-weight: bold; margin: 0 50px 20px 50px; line-height: 1.2; text-transform: uppercase; }
+ .para { margin: 0 0 12px 0; text-align: justify; }
+ .para-number { display: inline-block; min-width: 25px; }
+ .no-print { display: none; }
+ thead { display: table-header-group; }
+ body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
+         body { margin: 0; padding: 0.8cm; }
+ }
+ </style>
+ </head>
+ <div class="title-section">
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Sanction Print – {{ $case->CaseNo }}</title>
- <style>
-     @page { size: A4 portrait; margin: 0.8cm; }
-     body { font-family: Arial, sans-serif; font-size: 14px; color: #000; line-height: 1.4; margin: 0; padding: 0; }
- 
- .title { text-align: center; font-weight: bold; text-transform: uppercase; margin-bottom: 15px; }
- 
- @media print {
- .no-print { display: none; }
- body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
-         @page { size: A4 portrait; margin: 0.8cm; }
- }
- </style>
- </head>
- : rtrim(rtrim(number_format($qty, 3, '.', ''), '0'), '.');
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+     @page { size: A4 portrait; margin: 0; }
+     body { font-family: Arial, sans-serif; font-size: 14px; color: #000; line-height: 1.4; margin: 0; padding: 0.8cm; box-sizing:border-box; }
+ 
+ .title { text-align: center; font-weight: bold; text-transform: uppercase; margin-bottom: 15px; }
+ 
+ @media print {
+ .no-print { display: none; }
+ body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
+         body { margin: 0; padding: 0.8cm; }
+ }
+ </style>
+ </head>
+ : rtrim(rtrim(number_format($qty, 3, '.', ''), '0'), '.');
Removed / Before Commit
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Supply Order – {{ $case->CaseNo }}</title>
- <style>
- * { margin:0; padding:0; box-sizing:border-box; }
- body { font-family: Arial, sans-serif; font-size: 10.5pt; color: #000; background: #fff; }
- if (!isset($vendorGroups[$key])) {
- $vendorGroups[$key] = [
- 'VendorName'     => $vendorName,
- 'OrderNo'        => $orderNo,
- 'OrderDate'      => $s->OrderDate ?? '',
- 'DeliveryPeriod' => $s->DeliveryPeriod ?? '',
- <p class="para" style="margin-top:4px;">Phone No : 2542257/5042</p>
- <p class="para">eMail : Jeev.7689@gov.in</p>
- <p class="para">To,</p>
-     <p class="para bold">M/s {{ $group['VendorName'] }}</p>
- 
Added / After Commit
+ <html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title></title>
+ <style>
+ * { margin:0; padding:0; box-sizing:border-box; }
+ body { font-family: Arial, sans-serif; font-size: 10.5pt; color: #000; background: #fff; }
+ if (!isset($vendorGroups[$key])) {
+ $vendorGroups[$key] = [
+ 'VendorName'     => $vendorName,
+                 'VendorAddress'  => $s->VendorAddress ?? '',
+ 'OrderNo'        => $orderNo,
+ 'OrderDate'      => $s->OrderDate ?? '',
+ 'DeliveryPeriod' => $s->DeliveryPeriod ?? '',
+ <p class="para" style="margin-top:4px;">Phone No : 2542257/5042</p>
+ <p class="para">eMail : Jeev.7689@gov.in</p>
+ <p class="para">To,</p>
+     <p class="para bold">{{ $group['VendorName'] }}</p>
Removed / Before Commit
- button.btn{
- color:#6c757d;
- }
- .work-equipment-report-scroll {
- max-height: 68vh;
- overflow: auto;
- background: #9aa7b8;
- border-radius: 6px;
- }
- </style>
- @if ($errors->any())
- <div class="alert alert-danger">
- <hr>
- <div class="card-body">
- <div class="container-fluid">
-            <form method="GET" action="{{ route('table-report') }}">
- <div class="row">
- @php
Added / After Commit
+ button.btn{
+ color:#6c757d;
+ }
+ .sort-apply-btn,
+ .sort-apply-btn:hover,
+ .sort-apply-btn:focus,
+ .sort-apply-btn:active {
+     color: #fff !important;
+ }
+ .sort-apply-btn:hover,
+ .sort-apply-btn:focus,
+ .sort-apply-btn:active {
+     background-color: #3398ff !important;
+     border-color: #3398ff !important;
+ }
+ .work-equipment-report-scroll {
+ max-height: 68vh;
+ overflow: auto;
Removed / Before 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']],
-         ['T No', $salary['employee']['employee_number'] ?? '-'],
Added / After Commit
+ @php
+     $salary = $salary ?? ($snapshot->salary_json ?: []);
+     $monthNames = [1=>'January',2=>'February',3=>'March',4=>'April',5=>'May',6=>'June',7=>'July',8=>'August',9=>'September',10=>'October',11=>'November',12=>'December'];
+     $month = (int) data_get($salary, 'period.month', $snapshot->month ?? now()->month);
+     $year = (int) data_get($salary, 'period.year', $snapshot->year ?? now()->year);
+     $regularAllowanceOrder = [
+         'Earned Basic Pay (E-BP)',
+         'HRA',
+         'RISK ALLC',
+         'DA TPT',
+         'DRESS ALLOWANCE',
+         'NPS GOVT CONT',
+         'UPS GOVT CONT',
+         'MISC PAY',
+         'MISC PAY NPS GOVT CONT',
+         'MISC PAY UPS GOVT CONT',
+         'MISC NPS/UPS (GOVT)',
+         'DA',
Removed / Before Commit
- $monthlyTitles = $salary['deductions_meta']['monthly_titles'] ?? [];
- $advances = $salary['deductions_meta']['advances'] ?? [];
- $balances = $salary['deductions_meta']['balances'] ?? [];
- $activeSupplementary = $salary['allowance_meta']['supplementary_active_fields'] ?? [];
- $supplementaryMap = [
- 'arrears_of_pay' => ['PAY FIX ARR', 'PAY FIX ARREAR'],
- 'lve_ench' => ['LVE ENCH', 'LEAVE ENCASHMENT'],
- 'misc_supplementary' => ['MISC SUPL', 'MISC SUPPLEMENTARY'],
- 'washing_allowance' => ['WASH', 'WASHING ALLOWANCE'],
-         'nda' => ['BONUS', 'NIGHT DUTY ALLOWANCE'],
-         'plb' => ['OT/NDA', 'PLB'],
- ];
- $regularRows = [
- ['BASIC PAY', data_get($salary, 'allowances.Earned Basic Pay (E-BP)', 0)],
- 
- return [$label, $amount, $amount != 0.0];
- })->values()->all();
- $deductionRows = [
Added / After Commit
+ $monthlyTitles = $salary['deductions_meta']['monthly_titles'] ?? [];
+ $advances = $salary['deductions_meta']['advances'] ?? [];
+ $balances = $salary['deductions_meta']['balances'] ?? [];
+     $advanceDetails = $salary['deductions_meta']['advance_details'] ?? [];
+     if (empty($advanceDetails)) {
+         foreach (['GPF', 'PC', 'FES', 'VEH', 'HB'] as $advanceLabel) {
+             $advanceDetails[$advanceLabel] = [
+                 'advance' => $advances[$advanceLabel . ' ADV'] ?? 0,
+                 'per_inst' => data_get($salary, 'deductions.' . match ($advanceLabel) {
+                     'GPF' => 'GPF Per Inst',
+                     'PC' => 'PC Per Inst',
+                     'FES' => 'Fes Per Inst',
+                     'VEH' => 'Veh Per Inst',
+                     'HB' => 'HB Per Inst',
+                 }, 0),
+                 'balance' => $balances[$advanceLabel . ' BAL'] ?? 0,
+             ];
+         }
Removed / Before Commit
- <meta charset="utf-8">
- <title>Salary Print Format 1</title>
- <style>
-         @page { size: A4 landscape; margin: 8mm; }
- body { font-family: Arial, sans-serif; color: #000; font-size: 12px; }
-         .toolbar { margin-bottom: 10px; }
-         .toolbar button { padding: 6px 14px; }
-         .format-one-slip { width: 100%; max-width: 270mm; margin: 0 auto; }
- table { width: 100%; border-collapse: collapse; }
- td, th { border: 1px solid #000; padding: 3px 5px; line-height: 1.15; }
- th { text-align: center; font-size: 13px; }
- .amount { text-align: right; min-width: 70px; }
-         .total { font-weight: 700; }
-         @media print { .toolbar { display: none; } }
- </style>
- </head>
- <body>
-     <div class="toolbar"><button onclick="window.print()">Print Format 1</button></div>
Added / After Commit
+ <meta charset="utf-8">
+ <title>Salary Print Format 1</title>
+ <style>
+         @page { size: A4 landscape; margin: 0; }
+         html, body { margin: 0; padding: 0; }
+ body { font-family: Arial, sans-serif; color: #000; font-size: 12px; }
+         .format-one-slip { width: 100%; max-width: 270mm; margin: 0 auto; padding: 8mm; box-sizing: border-box; }
+         h2 { text-align: center; margin: 0 0 10px; font-size: 20px; }
+         h3 { margin: 0 0 5px; font-size: 13px; text-decoration: underline; }
+         .employee-main-grid,
+         .attendance-grid,
+         .salary-tables,
+         .totals-grid { display: table; width: 100%; table-layout: fixed; }
+         .employee-main-grid { margin-bottom: 8px; }
+         .attendance-grid { margin-bottom: 12px; }
+         .employee-main-grid > div,
+         .attendance-grid > div,
+         .salary-tables > div,
Removed / Before Commit
- <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; }
- .item-amount { text-align: right; min-width: 42px; }
- .total { font-weight: 700; }
- .footer { text-align: center; margin-top: 6px; font-size: 10px; }
-         @media print { .toolbar { display: none; } }
- </style>
- </head>
- <body>
-     <div class="toolbar"><button onclick="window.print()">Print Format 2</button></div>
- @include('finance-salaries.partials.slip-format-two', ['snapshot' => $snapshot, 'salary' => $salary])
- </body>
- </html>
Added / After Commit
+ <meta charset="utf-8">
+ <title>Salary Print Format 2</title>
+ <style>
+         @page { size: A4 landscape; margin: 0; }
+ body { font-family: Arial, sans-serif; color: #000; font-size: 11px; }
+ .toolbar { margin-bottom: 10px; }
+ .toolbar button { padding: 6px 14px; }
+ .item-amount { text-align: right; min-width: 42px; }
+ .total { font-weight: 700; }
+ .footer { text-align: center; margin-top: 6px; font-size: 10px; }
+         @media print {
+             html, body { margin: 0 !important; padding: 0 !important; }
+             .toolbar { display: none; }
+             .salary-slip { padding: 8mm; box-sizing: border-box; }
+         }
+ </style>
+ </head>
+ <body>
Removed / Before Commit
- 
- @section('content')
- @php
-     $salary = $snapshot->salary_json;
- $monthNames = [1=>'January',2=>'February',3=>'March',4=>'April',5=>'May',6=>'June',7=>'July',8=>'August',9=>'September',10=>'October',11=>'November',12=>'December'];
- $isCurrent = (int) $month === now()->month && (int) $year === now()->year;
- @endphp
- 
- <div class="card">
- <h4 class="mb-0"><b>Salary Slip</b></h4>
- <div class="d-flex gap-2">
- <a href="{{ route('finance-staff-details.index') }}" class="btn btn-secondary"><i class="fas fa-arrow-left"></i> Back</a>
-                 @if($isCurrent)
-                     <a href="{{ route('finance-salaries.show', [$staff, 'month' => $month, 'year' => $year, 'regenerate' => 1]) }}" class="btn btn-warning"><i class="fas fa-sync"></i> Regenerate</a>
- @endif
-                 <a href="{{ route('finance-salaries.print-format-one', $snapshot) }}" target="_blank" class="btn btn-primary"><i class="fas fa-print"></i> Print Format 1</a>
-                 <a href="{{ route('finance-salaries.print-format-two', $snapshot) }}" target="_blank" class="btn btn-dark"><i class="fas fa-print"></i> Print Format 2</a>
- </div>
Added / After Commit
+ 
+ @section('content')
+ @php
+     $salary = $previewSalary ?? ($snapshot?->salary_json ?: []);
+     $attendanceSalary = $previewSalary ?? $salary;
+ $monthNames = [1=>'January',2=>'February',3=>'March',4=>'April',5=>'May',6=>'June',7=>'July',8=>'August',9=>'September',10=>'October',11=>'November',12=>'December'];
+ $isCurrent = (int) $month === now()->month && (int) $year === now()->year;
+     $regularAllowanceOrder = [
+         'Earned Basic Pay (E-BP)',
+         'HRA',
+         'RISK ALLC',
+         'DA TPT',
+         'DRESS ALLOWANCE',
+         'NPS GOVT CONT',
+         'UPS GOVT CONT',
+         'MISC PAY',
+         'MISC PAY NPS GOVT CONT',
+         'MISC PAY UPS GOVT CONT',
Removed / Before Commit
- data-hra-percent="{{ $grossBreakdown['config']['hra_percent'] }}"
- data-hra-payable="{{ $grossBreakdown['config']['hra_payable'] ? 1 : 0 }}"
- data-hra-zero-reason="{{ $grossBreakdown['config']['hra_zero_reason'] }}"
- data-da-percent="{{ $grossBreakdown['config']['da_percent'] }}"
- data-da-tpt-percent="{{ $grossBreakdown['config']['da_tpt_percent'] }}"
- data-pay-level="{{ $grossBreakdown['config']['pay_level_number'] }}"
- data-tpt-l12-low="{{ $grossBreakdown['config']['tpt_level_1_2_low_basic_amount'] }}"
- data-tpt-l12-high="{{ $grossBreakdown['config']['tpt_level_1_2_high_basic_amount'] }}"
- data-tpt-l38="{{ $grossBreakdown['config']['tpt_level_3_8_amount'] }}"
-                             data-tpt-l9-plus="{{ $grossBreakdown['config']['tpt_level_9_plus_amount'] }}">
- @foreach($grossItems as $key => $item)
- <div class="col-md-3">
- <div class="border rounded p-2 h-100 {{ $key === 'gross_total' ? 'bg-light' : '' }}">
- <label class="form-label mb-1">{{ $item['label'] }}</label>
- <div class="fw-semibold" data-gross-value="{{ $key }}">{{ $money($item['value']) }}</div>
- @if(!empty($item['meta']))
-                                             <small class="text-muted">{{ $item['meta'] }}</small>
- @endif
Added / After Commit
+ data-hra-percent="{{ $grossBreakdown['config']['hra_percent'] }}"
+ data-hra-payable="{{ $grossBreakdown['config']['hra_payable'] ? 1 : 0 }}"
+ data-hra-zero-reason="{{ $grossBreakdown['config']['hra_zero_reason'] }}"
+                             data-hra-factor="{{ $grossBreakdown['config']['hra_proration_factor'] ?? 1 }}"
+ data-da-percent="{{ $grossBreakdown['config']['da_percent'] }}"
+ data-da-tpt-percent="{{ $grossBreakdown['config']['da_tpt_percent'] }}"
+ data-pay-level="{{ $grossBreakdown['config']['pay_level_number'] }}"
+ data-tpt-l12-low="{{ $grossBreakdown['config']['tpt_level_1_2_low_basic_amount'] }}"
+ data-tpt-l12-high="{{ $grossBreakdown['config']['tpt_level_1_2_high_basic_amount'] }}"
+ data-tpt-l38="{{ $grossBreakdown['config']['tpt_level_3_8_amount'] }}"
+                             data-tpt-l9-plus="{{ $grossBreakdown['config']['tpt_level_9_plus_amount'] }}"
+                             data-tpt-zero="{{ !empty($grossBreakdown['config']['tpt_zero_reason']) ? 1 : 0 }}"
+                             data-tpt-factor="{{ $grossBreakdown['config']['tpt_proration_factor'] ?? 1 }}"
+                             data-nps-govt-contribution="{{ $grossBreakdown['config']['nps_govt_contribution'] }}"
+                             data-risk-allowance-zero="{{ !empty($grossBreakdown['config']['risk_allowance_zero_reason']) ? 1 : 0 }}">
+ @foreach($grossItems as $key => $item)
+ <div class="col-md-3">
+ <div class="border rounded p-2 h-100 {{ $key === 'gross_total' ? 'bg-light' : '' }}">
Removed / Before Commit
- ['fes_adv_date', 'fes_adv', 'fes_per_inst', 'fes_code'],
- ['gpf_adv_date', 'gpf_adv', 'gpf_per_inst'],
- ['pc_adv_date', 'pc_adv', 'pc_adv_interest', 'pc_bal_interest', 'pc_per_inst'],
-         ['ppan', 'gpf_pran_no', 'gpf_cpf_nps_type'],
- ['govt_nps_contribution', 'individual_nps_contribution'],
- ['veh_adv_date', 'veh_adv', 'veh_interest', 'veh_int_bal', 'veh_per_inst'],
- ['hb_adv_date', 'hb_adv', 'hb_interest', 'hb_int_bal', 'hb_per_inst'],
-         ['finance_misc_nps', 'finance_misc_pay', 'misc_pay_govt_nps_contribution', 'misc_pay_individual_nps_contribution', 'finance_misc_deduction'],
-         ['cgeis', 'cghs', 'gpf_nps_amt', 'house_rent', 'leave_adjustment', 'period', 'bill_no_date'],
- ];
- @endphp
- 
- 
- <form method="POST" action="{{ route('finance-staff-details.payment-recovery.update', $staff) }}"
- data-basic-salary="{{ (float) ($staff->basic_salary ?? 0) }}"
-             data-da-percentage="{{ (float) ($daPercentage ?? 0) }}">
- @csrf
- @method('PUT')
Added / After Commit
+ ['fes_adv_date', 'fes_adv', 'fes_per_inst', 'fes_code'],
+ ['gpf_adv_date', 'gpf_adv', 'gpf_per_inst'],
+ ['pc_adv_date', 'pc_adv', 'pc_adv_interest', 'pc_bal_interest', 'pc_per_inst'],
+         ['gpf_cpf_nps_type', 'gpf_pran_no', 'gpf_nps_amt', 'ppan'],
+ ['govt_nps_contribution', 'individual_nps_contribution'],
+ ['veh_adv_date', 'veh_adv', 'veh_interest', 'veh_int_bal', 'veh_per_inst'],
+ ['hb_adv_date', 'hb_adv', 'hb_interest', 'hb_int_bal', 'hb_per_inst'],
+         ['finance_misc_nps', 'finance_misc_nps_ind', 'finance_misc_pay', 'misc_pay_govt_nps_contribution', 'misc_pay_individual_nps_contribution', 'finance_misc_deduction'],
+         ['cgeis', 'cghs', 'house_rent', 'leave_adjustment', 'period', 'bill_no_date'],
+ ];
+ @endphp
+ 
+ 
+ <form method="POST" action="{{ route('finance-staff-details.payment-recovery.update', $staff) }}"
+ data-basic-salary="{{ (float) ($staff->basic_salary ?? 0) }}"
+             data-da-percentage="{{ (float) ($daPercentage ?? 0) }}"
+             data-gpf-eligible="{{ !empty($gpfRules['eligible']) ? 1 : 0 }}"
+             data-gpf-min="{{ (float) ($gpfRules['min_amount'] ?? 0) }}"
Removed / Before Commit
- <td>{{ $r->SpareCount }}</td>
- <td>{{ $r->TotalQty }}</td>
- <td>{{ LpoHelper::formatINR((float)$r->TotalValue) }}</td>
-                     <td>
- <a href="{{ route('lpr.edit', ['lpr_id' => $r->LPRID]) }}" title="Edit LPR">
- <i class="fas fa-pencil"></i>
- </a>
- </td>
- </tr>
- @empty
Added / After Commit
+ <td>{{ $r->SpareCount }}</td>
+ <td>{{ $r->TotalQty }}</td>
+ <td>{{ LpoHelper::formatINR((float)$r->TotalValue) }}</td>
+                     <td class="text-nowrap">
+ <a href="{{ route('lpr.edit', ['lpr_id' => $r->LPRID]) }}" title="Edit LPR">
+ <i class="fas fa-pencil"></i>
+ </a>
+                         @if(empty($r->CaseNoID))
+                             <form method="POST" action="{{ route('lpr.destroy', $r->LPRID) }}" class="d-inline ms-2" onsubmit="return confirm('Delete this LPR and its spares?');">
+                                 @csrf
+                                 @method('DELETE')
+                                 <button type="submit" class="btn btn-link p-0 text-danger align-baseline" title="Delete LPR">
+                                     <i class="fas fa-trash"></i>
+                                 </button>
+                             </form>
+                         @else
+                             <span class="text-muted ms-2" title="Case generated LPR cannot be deleted">
+                                 <i class="fas fa-trash"></i>
Removed / Before Commit
- spares.forEach(sp => {
- html+=`<tr id="spare_row_${sp.LPRSpareID}">
- <td><strong>${sp.Nomenclature}</strong></td><td><code>${sp.PartNo}</code></td>
-             <td class="text-center"><span class="badge bg-secondary">${sp.Qty}</span></td><td>${sp.JobNo||''}</td>
- <td class="text-center"><button class="btn btn-sm btn-info py-0" onclick="showPriceHistory(${sp.SpareID},${sp.LPRSpareID})">📊</button></td>
-             <td><input type="number" class="form-control form-control-sm text-end fw-bold txtRate" value="${sp.ProposalPrice}" min="0" step="0.01" style="min-width:80px"></td>
-             <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>`;
- });
- html+='</tbody></table></div>';
- container.innerHTML=html;
Added / After Commit
+ spares.forEach(sp => {
+ html+=`<tr id="spare_row_${sp.LPRSpareID}">
+ <td><strong>${sp.Nomenclature}</strong></td><td><code>${sp.PartNo}</code></td>
+             <td class="text-center"><span class="badge bg-secondary qtyValue" data-qty="${sp.Qty}">${sp.Qty}</span></td><td>${sp.JobNo||''}</td>
+ <td class="text-center"><button class="btn btn-sm btn-info py-0" onclick="showPriceHistory(${sp.SpareID},${sp.LPRSpareID})">📊</button></td>
+             <td><input type="number" class="form-control form-control-sm text-end fw-bold txtRate" value="${sp.ProposalPrice}" min="0" step="0.01" style="min-width:80px" oninput="calculateRowTotal(this)"></td>
+             <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" oninput="calculateRowTotal(this)"><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" oninput="calculateRowTotal(this)"></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"></td>
+ <td>
+                 <button class="btn btn-sm btn-success py-0" onclick="lockSpare(${sp.LPRSpareID},${sp.Qty},this)">Update</button>
+ </td>
+ </tr>`;
+ });
+ html+='</tbody></table></div>';
+ container.innerHTML=html;
+     container.querySelectorAll('tbody tr').forEach(calculateRowTotal);
Removed / Before Commit
- .table thead th { font-size:.76rem; }
- .table tbody td { font-size:.82rem; vertical-align:middle; }
- .dv-panel { background:#e8f4fd; border:1px solid #b3d4f5; border-radius:8px; padding:16px; }
- </style>
- @endpush
- 
- $iDt  = old('InvoiceDate', $existingBill->InvoiceDate ?? '');
- $bNo  = old('BillNo',      $existingBill->BillNo      ?? '');
- $bDt  = old('BillDate',    $existingBill->BillDate    ?? '');
- $dvNo = old('DVNo',        $existingBill->DVNo        ?? '');
- $po   = old('PassedOn',    $existingBill->PassedOn    ?? '');
- @endphp
- 
- {{-- ── ROW 1: Order selector + read-only info ── --}}
- @csrf
- <input type="hidden" name="OrderNo" id="hidOrderNo" value="{{ $selectedOrder }}">
- 
-                 <div class="row g-3 mb-3" id="billFieldsRow">
Added / After Commit
+ .table thead th { font-size:.76rem; }
+ .table tbody td { font-size:.82rem; vertical-align:middle; }
+ .dv-panel { background:#e8f4fd; border:1px solid #b3d4f5; border-radius:8px; padding:16px; }
+     .btn-outline-dark { background:#343a40;border-color:#343a40; color:#343a40; }
+ </style>
+ @endpush
+ 
+ $iDt  = old('InvoiceDate', $existingBill->InvoiceDate ?? '');
+ $bNo  = old('BillNo',      $existingBill->BillNo      ?? '');
+ $bDt  = old('BillDate',    $existingBill->BillDate    ?? '');
+                 $delayWeek = old('DelayWeek', $existingBill->DelayWeek ?? 0);
+                 $ldAmount  = old('LDAmount',  $existingBill->LDAmount  ?? 0);
+ $dvNo = old('DVNo',        $existingBill->DVNo        ?? '');
+ $po   = old('PassedOn',    $existingBill->PassedOn    ?? '');
+                 $orderAmountRaw = $orderDetails ? (float)$orderDetails->OrderAmount : 0;
+ @endphp
+ 
+ {{-- ── ROW 1: Order selector + read-only info ── --}}
Removed / Before Commit
- <th>GeM/C No</th>
- <th>Order No</th>
- <th>Order Date</th>
-                                 <th>No of Days</th>
- <th>Delivery Period</th>
- </tr>
- </thead>
- </td>
- <td>
- <input type="number" class="form-control form-control-sm txtNoOfDays text-end"
-                                            value="{{ $r->NoOfDays }}" min="0" style="width:70px">
- </td>
- <td>
- <input type="date" class="form-control form-control-sm txtDeliveryPeriod"
-                                            value="{{ $r->DeliveryPeriod }}">
- </td>
- </tr>
- @endforeach
Added / After Commit
+ <th>GeM/C No</th>
+ <th>Order No</th>
+ <th>Order Date</th>
+                                 <th>Delivery Days</th>
+ <th>Delivery Period</th>
+ </tr>
+ </thead>
+ </td>
+ <td>
+ <input type="number" class="form-control form-control-sm txtNoOfDays text-end"
+                                            value="{{ $r->NoOfDays }}" min="0" inputmode="numeric" style="width:70px">
+ </td>
+ <td>
+ <input type="date" class="form-control form-control-sm txtDeliveryPeriod"
+                                            value="{{ $r->DeliveryPeriod }}" readonly>
+ </td>
+ </tr>
+ @endforeach
Removed / Before Commit

                                                
Added / After Commit
+ <!DOCTYPE html>
+ <html>
+ <head>
+ <meta charset="utf-8">
+ <title>Contingent Bill</title>
+ <style>
+ @media print {
+     @page { size: A4 portrait; margin: .8cm; }
+     .no-print { display: none; }
+ }
+ body { font-family: Arial, sans-serif; font-size: 12px; color: #111; margin: 0; padding: 24px 34px; }
+ .top-note { text-align: right; font-weight: 700; margin-bottom: 18px; }
+ .heading { text-align: center; font-weight: 700; text-decoration: underline; line-height: 1.35; margin-bottom: 26px; }
+ .title { text-align: center; font-weight: 700; text-decoration: underline; margin: 22px 0; }
+ .line-row { display: flex; align-items: flex-start; margin: 12px 0; }
+ .label { min-width: 230px; }
+ .dots { flex: 1; border-bottom: 1px dotted #777; height: 13px; margin: 0 8px; }
+ .amount { width: 150px; text-align: right; font-weight: 700; }
Removed / Before Commit
- .signature-section { margin-top: 40px; }
- .receipt-cert { text-align: center; font-weight: bold; text-decoration: underline; margin: 12px 0; }
- .crv-notes { text-align: left; margin: 50px 0; }
- </style>
- <script>window.onload = function () { window.print(); };</script>
- </head>
- {{-- Meta info table --}}
- <table style="width:100%; border-collapse:collapse; margin-bottom:20px;">
- <tr>
-         <td style="width:65%;">
- Inspection Note No : <b>_______________</b>
- &nbsp;&nbsp;&nbsp;
- Inspection Note Date : <b>_______________</b>
- </td>
-         <td></td>
- </tr>
- <tr>
-         <td>1. Vendor Name : <b>{{ $vendorName }}</b></td>
Added / After Commit
+ .signature-section { margin-top: 40px; }
+ .receipt-cert { text-align: center; font-weight: bold; text-decoration: underline; margin: 12px 0; }
+ .crv-notes { text-align: left; margin: 50px 0; }
+ .inline-detail { display: inline-block; margin-left: 48px; }
+ </style>
+ <script>window.onload = function () { window.print(); };</script>
+ </head>
+ {{-- Meta info table --}}
+ <table style="width:100%; border-collapse:collapse; margin-bottom:20px;">
+ <tr>
+         <td>
+ Inspection Note No : <b>_______________</b>
+ &nbsp;&nbsp;&nbsp;
+ Inspection Note Date : <b>_______________</b>
+ </td>
+ </tr>
+ <tr>
+         <td>
Removed / Before Commit
- @foreach($grantList as $g)<option value="{{ $g->GrantName }}" @selected($selGrant==$g->GrantName)>{{ $g->GrantName }}</option>@endforeach
- </select>
- </div>
-             <div class="col-md-2"><button type="submit" class="btn btn-primary"> Apply</button></div>
- </form>
- </div>
- </div>
Added / After Commit
+ @foreach($grantList as $g)<option value="{{ $g->GrantName }}" @selected($selGrant==$g->GrantName)>{{ $g->GrantName }}</option>@endforeach
+ </select>
+ </div>
+             <div class="col-md-3 d-flex align-items-end gap-2">
+                 <button type="submit" class="btn btn-primary">Apply</button>
+                 <a href="{{ request()->fullUrlWithQuery(['export' => 'csv', 'pg' => null]) }}" class="btn btn-success">
+                     Export CSV
+                 </a>
+             </div>
+ </form>
+ </div>
+ </div>
Removed / Before Commit
- </div>
- <div class="col-md-3 d-flex gap-2">
- <button type="submit" class="btn btn-filter btn-sm"> Filter</button>
- <a href="{{ route('reports.order-state') }}" class="btn btn-info btn-sm">Reset</a>
- </div>
- </form>
Added / After Commit
+ </div>
+ <div class="col-md-3 d-flex gap-2">
+ <button type="submit" class="btn btn-filter btn-sm"> Filter</button>
+                 <a href="{{ request()->fullUrlWithQuery(['export' => 'csv']) }}" class="btn btn-success btn-sm">Export CSV</a>
+ <a href="{{ route('reports.order-state') }}" class="btn btn-info btn-sm">Reset</a>
+ </div>
+ </form>
Removed / Before Commit
- window.location = "{{ route('sub-assy.index') }}?" + params.toString();
- }
- 
-     // auto filter on change
-     $('#filterGroup, #filterEquipment').on('change', applyFilters);
- 
-     // auto filter on typing (after short delay)
-     let typingTimer;
-     $('#filterSubName').on('keyup', function() {
-         clearTimeout(typingTimer);
-         typingTimer = setTimeout(applyFilters, 600); // wait 600ms after typing stops
- });
- function autoUpload() {
- let form = document.getElementById("importForm");
- </script>
- 
- 
- @endsection
Added / After Commit
+ window.location = "{{ route('sub-assy.index') }}?" + params.toString();
+ }
+ 
+     $('#filterGroup').on('change', function() {
+         $('#filterEquipment').val('').trigger('change.select2');
+         applyFilters();
+     });
+ 
+     $('#filterEquipment').on('change', applyFilters);
+ 
+     $('#filterSubName').on('keydown', function(event) {
+         if (event.key === 'Enter') {
+             event.preventDefault();
+             applyFilters();
+         }
+ });
+ function autoUpload() {
+ let form = document.getElementById("importForm");
Removed / Before Commit
- use Illuminate\Support\Facades\Route;
- use App\Http\Controllers\BiometricController;
- use App\Http\Controllers\AttendanceRawPunchController;
- 
- /*
- |--------------------------------------------------------------------------
- Route::post('/biometric', [BiometricController::class, 'receive']);
- Route::post('/biometric/store', [BiometricController::class, 'store']);
- Route::post('/attendance-raw-punches/fetch', [AttendanceRawPunchController::class, 'fetch']);
Added / After Commit
+ use Illuminate\Support\Facades\Route;
+ use App\Http\Controllers\BiometricController;
+ use App\Http\Controllers\AttendanceRawPunchController;
+ use App\Http\Controllers\CrcPartMasterController;
+ 
+ /*
+ |--------------------------------------------------------------------------
+ Route::post('/biometric', [BiometricController::class, 'receive']);
+ Route::post('/biometric/store', [BiometricController::class, 'store']);
+ Route::post('/attendance-raw-punches/fetch', [AttendanceRawPunchController::class, 'fetch']);
+ Route::get('/crc-part-master/sync-yardstick-hours', [CrcPartMasterController::class, 'syncYardstickHours']);
Removed / Before Commit
- use App\Http\Controllers\Adm\AdmDesignationController;
- use App\Http\Controllers\Adm\FinPowersController;
- use App\Http\Controllers\Adm\FundTransactionController;
- use App\Http\Controllers\Reports\AbcReportController;
- use App\Http\Controllers\Reports\OrderStateController;
- use App\Http\Controllers\Reports\SearchController;
- 
- Route::POST('/crc-job-create', [CrcEntryController::class, 'generatejob'])->name('crc.job');
- Route::get('/crc-work-order/print/{id}', [CrcEntryController::class,'print'])->name('crc.workorder.print');
- Route::get('/crc-issue-voucher/print/{id}', [CrcEntryController::class,'issueprint'])->name('crc.voucher.print');
- Route::get('/crc-report', [CrcReportController::class,'index'])->name('crc.report');
- Route::get('/ber-report', [CrcReportController::class,'berindex'])->name('ber.report');
- Route::get('/', [ComplaintController::class, 'index'])->name('complaints.index');
- Route::get('/create', [ComplaintController::class, 'create'])->name('complaints.create');
- Route::post('/', [ComplaintController::class, 'store'])->name('complaints.store');
- Route::get('/get-subgroup-users/{subGroup}', [ComplaintController::class, 'getSubgroupUsers'])->name('complaints.subgroup-users');
- Route::get('/{complaint}', [ComplaintController::class, 'show'])->name('complaints.show');
- Route::get('/{complaint}/edit', [ComplaintController::class, 'edit'])->name('complaints.edit');
Added / After Commit
+ use App\Http\Controllers\Adm\AdmDesignationController;
+ use App\Http\Controllers\Adm\FinPowersController;
+ use App\Http\Controllers\Adm\FundTransactionController;
+ use App\Http\Controllers\Adm\GrantMasterController;
+ use App\Http\Controllers\Reports\AbcReportController;
+ use App\Http\Controllers\Reports\OrderStateController;
+ use App\Http\Controllers\Reports\SearchController;
+ 
+ Route::POST('/crc-job-create', [CrcEntryController::class, 'generatejob'])->name('crc.job');
+ Route::get('/crc-work-order/print/{id}', [CrcEntryController::class,'print'])->name('crc.workorder.print');
+             Route::get('/crc-time-allotment/print/{id}', [CrcEntryController::class,'timeAllotmentPrint'])->name('crc.timeallotment.print');
+ Route::get('/crc-issue-voucher/print/{id}', [CrcEntryController::class,'issueprint'])->name('crc.voucher.print');
+ Route::get('/crc-report', [CrcReportController::class,'index'])->name('crc.report');
+ Route::get('/ber-report', [CrcReportController::class,'berindex'])->name('ber.report');
+ Route::get('/', [ComplaintController::class, 'index'])->name('complaints.index');
+ Route::get('/create', [ComplaintController::class, 'create'])->name('complaints.create');
+ Route::post('/', [ComplaintController::class, 'store'])->name('complaints.store');
+             Route::get('/sample-download', [ComplaintController::class, 'downloadImportSample'])->name('complaints.import.sample');