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

Review Result ?

jattin01/army · 93807804
The commit introduces new features such as managing funds related to FinancialPower and updating expenditure calculations for LpoFunds, as well as improvements in filtering and grouping in various Controllers. However, the commit message is uninformative ('code changes'), which lowers understanding and traceability. There is partial validation in the saveFunds method, but no robust validation or error handling in some areas. Additionally, the security can be improved with more input validation and proper authorization checks before modifying data.
Quality ?
70%
Security ?
60%
Business Value ?
60%
Maintainability ?
65%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Issue
Where commit message
Issue / Evidence issue
Suggested Fix provide a descriptive commit message explaining what the changes are and their purpose to improve business value and maintainability scores
Missing Validation
Where app/Http/Controllers/FinancialPowerController.php:104
Issue / Evidence lack of input validation and authorization checks
Suggested Fix add proper validation and user permission checks before syncing funds to reduce bug risk and improve security
Missing Validation
Where app/Http/Controllers/FinancialPowerController.php:118
Issue / Evidence validation only checks amount against total inherit_power without more granular control
Suggested Fix consider validating total sum of assigned funds compared to inherit_power or add detailed business logic to improve correctness
Iterate Funds Without Checking If Funds Ex...
Where app/Http/Controllers/FinancialPowerController.php:111
Issue / Evidence iterate funds without checking if funds exist or are valid
Suggested Fix add checks to ensure fund IDs are valid to reduce potential errors
Missing Validation
Where app/Http/Controllers/UrgencyController.php:480
Issue / Evidence generateLpr method lacks authorization and input validation
Suggested Fix add validation for selected urgencies and enforce permission checks to reduce security risks
Generating Lpr Number Via Manual String Ma...
Where app/Http/Controllers/UrgencyController.php:490
Issue / Evidence generating LPR number via manual string manipulation
Suggested Fix consider using database sequences or locking mechanisms to avoid race conditions
Expenditure Calculation Might Be Inefficie...
Where app/Http/Controllers/LpoFundController.php:35
Issue / Evidence expenditure calculation might be inefficient if dataset is large
Suggested Fix consider performing calculations in DB query to improve performance
Incomplete If Statement
Where app/Http/Controllers/DemandController.php:69
Issue / Evidence incomplete if statement
Suggested Fix clarify and document purpose of condition to improve maintainability
Code Change Preview · app/Http/Controllers/DemandController.php ?
Removed / Before Commit
- 
- $allowedFields = ['os_ser_no', 'cat_part_no', 'nomenclature', 'account_unit', 'no_off', 'qty_required'];
- 
-     if (!in_array($request->field, $allowedFields)) {
- return response()->json(['success' => false, 'message' => 'Field not allowed']);
- }
Added / After Commit
+ 
+ $allowedFields = ['os_ser_no', 'cat_part_no', 'nomenclature', 'account_unit', 'no_off', 'qty_required'];
+ 
+     if (in_array($request->field, $allowedFields)) {
+ return response()->json(['success' => false, 'message' => 'Field not allowed']);
+ }
Removed / Before Commit
- namespace App\Http\Controllers;
- 
- use App\Models\FinancialPower;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\Validator;
- 
- 
- return response()->json(['message' => 'Financial Power deleted successfully.']);
- }
- }
Added / After Commit
+ namespace App\Http\Controllers;
+ 
+ use App\Models\FinancialPower;
+ use App\Models\LpoFund;
+ use App\Models\FinancialPowerFund;
+ use Illuminate\Http\Request;
+ use Illuminate\Support\Facades\Validator;
+ 
+ 
+ return response()->json(['message' => 'Financial Power deleted successfully.']);
+ }
+ public function funds($id)
+ {
+     $fp = FinancialPower::with('funds')->findOrFail($id);
+ 
+     // Create a mapping: fund_id => assigned_amount
+     $assignedAmounts = [];
+     foreach ($fp->funds as $fund) {
Removed / Before Commit
- use Illuminate\Http\Request;
- use App\Models\McoDemand;
- use App\Models\InventoryCart;
- use DB;
- 
- class InventoryController extends Controller
- return $item->mco_demand_no.'_'.$item->job_no.'_'.$item->work_equipment_id;
- });
- 
-     return view('inventory.partials.demand_details', compact('demands', 'receiveSums'));
- }
- 
- public function addToCart(Request $request)
- 
- foreach ($request->items as $item) 
- {
-             if (!empty($item['qty_received']) && $item['qty_received'] > 0) {
- DB::table('receiving')->insert([
Added / After Commit
+ use Illuminate\Http\Request;
+ use App\Models\McoDemand;
+ use App\Models\InventoryCart;
+ use App\Models\Receive;
+ use DB;
+ 
+ class InventoryController extends Controller
+ return $item->mco_demand_no.'_'.$item->job_no.'_'.$item->work_equipment_id;
+ });
+ 
+     return view('inventory.partials.demand_details', compact('demands', 'receiveSums','demand_no_decrypted'));
+ }
+ 
+ public function addToCart(Request $request)
+ 
+ foreach ($request->items as $item) 
+ {
+             
Removed / Before Commit
- 
- // Generate financial year dropdown (current year to next 5)
- $years = $this->generateFinancialYears(0, 5);
- 
- return view('lpofund.index', compact('lpofunds', 'years'));
- }
Added / After Commit
+ 
+ // Generate financial year dropdown (current year to next 5)
+ $years = $this->generateFinancialYears(0, 5);
+         foreach ($lpofunds as $fund) {
+     $expenditure = 0;
+     $expenditureAfterBill = 0;
+ 
+     foreach ($fund->cases as $case) {
+         foreach ($case->urgencies as $urgency) {
+             $finalRate = $urgency->final_rate ?? 0;
+             $expenditure += $finalRate;
+ 
+             if ($urgency->bill_submitted_date) {
+                 $expenditureAfterBill += $finalRate;
+             }
+         }
+     }
+ 
Removed / Before Commit
- $req_no = Crypt::decrypt($req_no);
- 
- // Current year
-     $year = now()->year;
- 
- // Check if demand exists in current year
-     $demand = McoDemand::where('prod_year', $year)
-         ->where('req_no', $req_no)
- ->with('workEquipment')
- ->first();
- 
- if (empty($demand->mco_demand_no)) 
- {
- $lastDemandNo = McoDemand::where('prod_year', $year)
Added / After Commit
+ $req_no = Crypt::decrypt($req_no);
+ 
+ // Current year
+    $year = now()->year;              // 2025
+ $range = $year . '-' . ($year+1); // 2025-2026
+ 
+ 
+ // Check if demand exists in current year
+     $demand = McoDemand::where('req_no', $req_no)
+ ->with('workEquipment')
+ ->first();
+     
+ if (empty($demand->mco_demand_no)) 
+ {
+ $lastDemandNo = McoDemand::where('prod_year', $year)
Removed / Before Commit
- public function preview($equipment)
- {
- // Check if the parameter is encrypted (JSON string)
-        if (is_numeric($equipment)) {
- // Single equipment ID
- $drafts = Demand::where('work_equipment_id', $equipment)
- ->where('status', 'draft') // status 1 = draft
- 'equipmentId' => $equipment,
- 'drafts' => $drafts
- ]);
-         } else {
- // Encrypted JSON string
- $equipmentIds = json_decode(decrypt($equipment), true);
- $drafts = Demand::with(['equipment'])
- ->whereIn('work_equipment_id', $equipmentIds)
- ->where('status', 'draft')
- ->get()
- ->groupBy('work_equipment_id'); // group by each equipment
Added / After Commit
+ public function preview($equipment)
+ {
+ // Check if the parameter is encrypted (JSON string)
+        if (is_numeric($equipment)) 
+         {
+ // Single equipment ID
+ $drafts = Demand::where('work_equipment_id', $equipment)
+ ->where('status', 'draft') // status 1 = draft
+ 'equipmentId' => $equipment,
+ 'drafts' => $drafts
+ ]);
+         } 
+         else 
+         {
+ // Encrypted JSON string
+ $equipmentIds = json_decode(decrypt($equipment), true);
+            
+ $drafts = Demand::with(['equipment'])
Removed / Before Commit
- use App\Models\Lpr;
- use App\Models\Urgency;
- use App\Models\FinancialPower;
- use Illuminate\Support\Collection;
- 
- class UrgencyController extends Controller
- {
- 
- // NAC Status filter
- if ($request->filled('nac_status')) {
-         $query->whereHas('urgencies', function($q) use ($request) {
-             if ($request->nac_status == 'completed') {
-                 $q->whereNotNull('nac_id');
-             } elseif ($request->nac_status == 'pending') {
- $q->whereNull('nac_id');
-             }
-         });
-     }
Added / After Commit
+ use App\Models\Lpr;
+ use App\Models\Urgency;
+ use App\Models\FinancialPower;
+ use App\Models\CaseMaster;
+ use App\Models\LpoFund;
+ use Illuminate\Support\Collection;
+ use Carbon\Carbon;
+ 
+ class UrgencyController extends Controller
+ {
+ 
+ // NAC Status filter
+ if ($request->filled('nac_status')) {
+     $query->whereHas('urgencies', function($q) use ($request) {
+         switch ($request->nac_status) {
+             case 'lprpending':
+                 $q->whereNull('lpr_no');
+                 break;
Removed / Before Commit

                                                
Added / After Commit
+ <?php
+ 
+ namespace App\Models;
+ 
+ use Illuminate\Database\Eloquent\Factories\HasFactory;
+ use Illuminate\Database\Eloquent\Model;
+ 
+ class CaseMaster extends Model
+ {
+     use HasFactory;
+ 
+     protected $table = 'case_masters';
+ 
+      protected $fillable = [
+         'case_no',
+         'draft_bid_no',
+         'draft_bid_date',
+         'aone_no',
Removed / Before Commit
- public function getScaleAttribute()
- {
- $mcoScale = $this->mcoScale; // First get McoScale record
- 
- if (!$mcoScale || !$mcoScale->table_name) {
- return null;
- }
Added / After Commit
+ public function getScaleAttribute()
+ {
+ $mcoScale = $this->mcoScale; // First get McoScale record
+     
+ if (!$mcoScale || !$mcoScale->table_name) {
+ return null;
+ }
Removed / Before Commit
- ];
- 
- protected $dates = ['deleted_at'];
- }
Added / After Commit
+ ];
+ 
+ protected $dates = ['deleted_at'];
+     public function funds()
+ {
+     return $this->belongsToMany(LpoFund::class, 'financial_power_funds')
+                 ->withPivot('assigned_amount')
+                 ->withTimestamps();
+ }
+ }
Removed / Before Commit
- ];
- 
- protected $dates = ['date', 'deleted_at'];
- }
Added / After Commit
+ ];
+ 
+ protected $dates = ['date', 'deleted_at'];
+     public function cases() {
+         return $this->hasMany(CaseMaster::class, 'fund_id');
+     }
+ }
Removed / Before Commit
- 'reason',
- 'estimate_amount',
- 'nac_id',
- // new fields
- 'rate_negotiation',
- 'bid_rate',
- {
- return $this->hasOne(Lpr::class, 'nac_id', 'nac_id');
- }
Added / After Commit
+ 'reason',
+ 'estimate_amount',
+ 'nac_id',
+         'lpr_no',
+ // new fields
+ 'rate_negotiation',
+ 'bid_rate',
+ {
+ return $this->hasOne(Lpr::class, 'nac_id', 'nac_id');
+ }
+ public function isLprCompleted(): bool
+ {
+     $total = $this->items()->count();
+     $withLpr = $this->items()->whereNotNull('lpr_no')->count();
+ 
+     return $total > 0 && $total === $withLpr;
+ }
+ 
Removed / Before Commit
- return $selected ? $selected->cfa : null;
- }
- 
-     public function nacStatus(): string
- {
- $total = $this->urgencies()->count();
-     $withNac = $this->urgencies()->whereNotNull('nac_id')->count();
- 
- if ($total === 0) {
-         return 'NAC Pending'; // कोई urgency ही नहीं है
- }
- 
-     if ($withNac === $total) {
-         return 'NAC Completed'; // सभी urgencies में nac_id है
-     } elseif ($withNac > 0) {
-         return 'NAC Partially Done'; // कुछ urgencies में है, कुछ में नहीं
- }
- 
Added / After Commit
+ return $selected ? $selected->cfa : null;
+ }
+ 
+ public function nacStatus(): string
+ {
+ $total = $this->urgencies()->count();
+ 
+ if ($total === 0) {
+         return 'LPR Pending'; // कोई urgency ही नहीं है
+ }
+ 
+     // --- LPR Status Check ---
+     $withLpr = $this->urgencies()->whereNotNull('lpr_no')->count();
+ 
+     if ($withLpr === 0) {
+         return 'LPR Pending';
+     } elseif ($withLpr < $total) {
+         return 'LPR Partially Done';
Removed / Before Commit
- </thead>
- <tbody>
- @forelse($attendances as $attendance)
-                         <tr class="{{ \Carbon\Carbon::parse($attendance->date)->isToday() ? 'table-info' : '' }}">
- <td>{{ $attendance->employee->employee_number ?? $attendance->employee_code }}</td>
- <td>{{ $attendance->employee->name ?? $attendance->employee_name }}</td>
- <td>{{ $attendance?->employee?->user?->group?->name ?? '' }}</td>
- <td>{{ $attendance->check_out }}</td>
- <td>
- <span class="badge 
-                                         {{ $attendance->status == 'present' ? 'bg-success' : ($attendance->status == 'absent' ? 'bg-danger' : 'bg-warning') }}">
- {{ ucfirst($attendance->status) }}
- </span>
- </td>
- </script>
- 
- <script>
-     document.addEventListener('DOMContentLoaded', function() {
Added / After Commit
+ </thead>
+ <tbody>
+ @forelse($attendances as $attendance)
+                         <tr>
+ <td>{{ $attendance->employee->employee_number ?? $attendance->employee_code }}</td>
+ <td>{{ $attendance->employee->name ?? $attendance->employee_name }}</td>
+ <td>{{ $attendance?->employee?->user?->group?->name ?? '' }}</td>
+ <td>{{ $attendance->check_out }}</td>
+ <td>
+ <span class="badge 
+                                         {{ $attendance->status == 'Present' ? 'bg-success' : ($attendance->status == 'Absent' ? 'bg-danger' : 'bg-warning') }}">
+ {{ ucfirst($attendance->status) }}
+ </span>
+ </td>
+ </script>
+ 
+ <script>
+    document.addEventListener('DOMContentLoaded', function() {
Removed / Before Commit
- <a href="{{ route('demand.spares', $eq->id) }}">
- <i class="fa fa-file-signature"></i> 
- </a>
-                                     <a href="{{ route('demand.previous.details', ['demand_id' => $eq->id]) }}" title="View Previous Details">
- <i class="fa fa-eye" style="color: #008cff;background:white"></i>
- </a>
Added / After Commit
+ <a href="{{ route('demand.spares', $eq->id) }}">
+ <i class="fa fa-file-signature"></i> 
+ </a>
+                                     <a href="{{ route('demand.previous.details', ['job_no' => encrypt($eq->workOrder?->job_no)]) }}" title="View Previous Details">
+ <i class="fa fa-eye" style="color: #008cff;background:white"></i>
+ </a>
Removed / Before Commit
- <!-- <a href="{{ route('demand.spares', $eq->id) }}">
- <i class="fa fa-file-signature"></i> 
- </a> -->
-                             <a href="{{ route('demand.previous.details', ['demand_id' => $eq->id]) }}" title="View Previous Details">
- <i class="fa fa-eye" style="color: #008cff;background:white"></i>
- </a>
Added / After Commit
+ <!-- <a href="{{ route('demand.spares', $eq->id) }}">
+ <i class="fa fa-file-signature"></i> 
+ </a> -->
+                             <a href="{{ route('demand.previous.details', ['job_no' => encrypt($eq->workOrder?->job_no)]) }}" title="View Previous Details">
+ <i class="fa fa-eye" style="color: #008cff;background:white"></i>
+ </a>
Removed / Before Commit
- </tr>
- </thead>
- <tbody>
- @foreach($equipmentDrafts as $demand)
- @php
- $scale = $demand->scale;
Added / After Commit
+ </tr>
+ </thead>
+ <tbody>
+                        
+ @foreach($equipmentDrafts as $demand)
+ @php
+ $scale = $demand->scale;
Removed / Before Commit
- <td>{{ $p->next_higher_cfa }}</td>
- <td>{{ \Illuminate\Support\Str::limit($p->inherit_power, 80) }}</td>
- <td>{{ \Illuminate\Support\Str::limit($p->power_in_consultation_with_isa, 80) }}</td>
-                                 <td>
-                                     <a href="javascript:void(0);" class="text-primary btn-edit"
-                                        data-id="{{ $p->id }}"
-                                        data-cfa="{{ $p->cfa }}"
-                                        data-next="{{ $p->next_higher_cfa }}"
-                                        data-inherit="{{ $p->inherit_power }}"
-                                        data-power="{{ $p->power_in_consultation_with_isa }}">
-                                         <i class="fas fa-pencil"></i>
-                                     </a>
- 
-                                     <a href="javascript:void(0);" class="text-danger ms-3 btn-delete"
-                                        data-id="{{ $p->id }}"
-                                        data-url="{{ url('/financial-powers/delete/' . $p->id) }}">
-                                         <i class="fas fa-trash text-dark"></i>
-                                     </a>
Added / After Commit
+ <td>{{ $p->next_higher_cfa }}</td>
+ <td>{{ \Illuminate\Support\Str::limit($p->inherit_power, 80) }}</td>
+ <td>{{ \Illuminate\Support\Str::limit($p->power_in_consultation_with_isa, 80) }}</td>
+                                <td>
+     <!-- Edit -->
+     <a href="javascript:void(0);" class="text-primary btn-edit"
+        data-id="{{ $p->id }}"
+        data-cfa="{{ $p->cfa }}"
+        data-next="{{ $p->next_higher_cfa }}"
+        data-inherit="{{ $p->inherit_power }}"
+        data-power="{{ $p->power_in_consultation_with_isa }}">
+         <i class="fas fa-pencil"></i>
+     </a>
+ 
+     <!-- Delete -->
+     <a href="javascript:void(0);" class="text-danger ms-3 btn-delete"
+        data-id="{{ $p->id }}"
+        data-url="{{ url('/financial-powers/delete/' . $p->id) }}">
Removed / Before Commit
- <th>Already Qty Received</th>
- <th>Qty Received</th>
- <th>Unique IV No</th>
- <th>Remarks</th>
- </tr>
- </thead>
- <td>
- <input type="text" name="items[{{ $index }}][unique_iv_no]" class="form-control">
- </td>
- <td>
- <input type="text" name="items[{{ $index }}][remark]" class="form-control">
- </td>
Added / After Commit
+ <th>Already Qty Received</th>
+ <th>Qty Received</th>
+ <th>Unique IV No</th>
+                         <th>Date</th>
+ <th>Remarks</th>
+ </tr>
+ </thead>
+ <td>
+ <input type="text" name="items[{{ $index }}][unique_iv_no]" class="form-control">
+ </td>
+                         <td>
+                             <input type="date" name="items[{{ $index }}][date]" class="form-control">
+                         </td>
+ <td>
+ <input type="text" name="items[{{ $index }}][remark]" class="form-control">
+ </td>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <style>
+ .select2-container {
+     width: 100% !important;
+ }
+ .select2-selection {
+     min-height: 32px;
+ }
+ form{
+     margin-bottom: 40px;
+ }
+ </style>
+ <style>
+ .select2-results__option {
+     padding-left: 10px;
+     display: flex;
Removed / Before Commit
- <th>No Off</th>
- <th>Qty Demanded</th>
- <th>Qty Received</th>
- 
- </tr>
- </thead>
- <td>{{ $item->qty_demanded }}</td>
- 
- <td>{{ $qtyreceived }}</td>
- 
- </tr>
Added / After Commit
+ <th>No Off</th>
+ <th>Qty Demanded</th>
+ <th>Qty Received</th>
+             <th>OSS Detail</th>
+ 
+ </tr>
+ </thead>
+ <td>{{ $item->qty_demanded }}</td>
+ 
+ <td>{{ $qtyreceived }}</td>
+                         <td><a href="{{ url('/oss-details?item_id='.$scale->id.'&demand_id='.$demand_no_decrypted) }}"> <i class="fa fa-eye " ></i></a></td>
+ 
+ </tr>
Removed / Before Commit
- <th>Name of Fund</th>
- <th>Code head</th>
- <th>Amount</th>
- <th>Financial Year</th>
- <th>Authority</th>
- <th>Date</th>
- <td>{{ $fund->name_of_fund }}</td>
- <td>{{ $fund->code_head }}</td>
- <td>{{ number_format($fund->amount_allotted,2) }}</td>
- <td>{{ $fund->financial_year }}</td>
- <td>{{ $fund->authority }}</td>
- <td>{{ $fund->date ? \Carbon\Carbon::parse($fund->date)->format('d-m-Y') : '-' }}</td>
Added / After Commit
+ <th>Name of Fund</th>
+ <th>Code head</th>
+ <th>Amount</th>
+                             <th>Expendeture</th>
+                             <th>Expendeture after bill</th>
+                             <th>Balance</th>
+ <th>Financial Year</th>
+ <th>Authority</th>
+ <th>Date</th>
+ <td>{{ $fund->name_of_fund }}</td>
+ <td>{{ $fund->code_head }}</td>
+ <td>{{ number_format($fund->amount_allotted,2) }}</td>
+                                 <td>{{ number_format($fund->expenditure, 2) }}</td>
+ <td>{{ number_format($fund->expenditure_after_bill, 2) }}</td>
+ <td>{{ number_format($fund->balance, 2) }}</td>
+ <td>{{ $fund->financial_year }}</td>
+ <td>{{ $fund->authority }}</td>
+ <td>{{ $fund->date ? \Carbon\Carbon::parse($fund->date)->format('d-m-Y') : '-' }}</td>
Removed / Before Commit
- @php
- $equipment = \App\Models\WorkEquipment::with(['Equipments', 'group', 'RepairClass'])
- ->find($demands[0]->work_equipment_id);
- 
- $isSubmitted = \App\Models\McoSubmission::where('req_no', $demands[0]->req_no)
- ->exists();
- @endphp
- <th>Nomenclature</th>
- <th>A/U</th>
- <th>No Off</th>
- <th>Qty Demanded</th>
- </tr>
- </thead>
- <tbody>
- <td>{{ $scale->nomenclature }}</td>
- <td>{{ $scale->account_unit }}</td>
- <td>{{ $scale->no_off }}</td>
-                  @php
Added / After Commit
+ @php
+ $equipment = \App\Models\WorkEquipment::with(['Equipments', 'group', 'RepairClass'])
+ ->find($demands[0]->work_equipment_id);
+     if($equipment->repair_class != 4)
+     {
+ 
+             $scalenos = \App\Models\McoScale::where('group_id',$equipment->group_id)->where('equipment_id',$equipment->main_eqpt)->where('repair_class_id','other')->first();
+     }
+     else
+     {
+             $scalenos = \App\Models\McoScale::where('group_id',$equipment->group_id)->where('equipment_id',$equipment->main_eqpt)->where('repair_class_id',$equipment->repair_class)->first();
+     }
+ 
+      $targets = \App\Models\EqptTarget::where('main_eqpt',$equipment->Equipments->name)->first();
+    
+ $isSubmitted = \App\Models\McoSubmission::where('req_no', $demands[0]->req_no)
+ ->exists();
+ @endphp
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <style>
+ .table-fixed { table-layout: fixed; width: 100%; }
+ .table-fixed th, .table-fixed td { word-wrap: break-word; text-align: center; vertical-align: middle; }
+ .total-estimate { font-weight: bold; margin-bottom: 15px; }
+ </style>
+ 
+ <div class="card">
+     <div class="card-header d-flex justify-content-between align-items-center">
+         <h4>Create Case No</h4>
+         <a href="{{ url('/urgency-mco') }}" class="btn btn-secondary btn-sm">Back</a>
+     </div>
+ 
+     <div class="card-body">
+ 
+         <!-- Total Estimate & Fund -->
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card mb-3">
+         <div class="card-header d-flex justify-content-between align-items-center">
+             <div>
+                 <span class="fw-bold">
+                     Job No: {{$nac?->urgencies[0]?->demand?->job_no}} ||
+                     NAC No: {{ $nac->nac_no }} ||
+                     NAC Date: {{ $nac->nac_date }} ||
+                     NAC Validity Date: {{ $nac->validity_date }} ||
+                     Case No: {{ $caseNo }}
+                 </span>
+             </div>
+         </div>
+         <div class="card-header d-flex justify-content-between align-items-center">
+             <div>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ 
+ @section('content')
+ <div class="card">
+     <div class="card-header d-flex justify-content-between">
+         <h4>Case Summary</h4>
+     </div>
+     <div class="card-body">
+         <table class="table table-bordered">
+             <thead class="table-primary">
+                 <tr>
+                     <th>Case No</th>
+                     <th>LPR No</th>
+                     <th>Urgency No</th>
+                     <th>Action</th>
+                 </tr>
+             </thead>
+             <tbody>
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ @section('content')
+ <div class="card">
+     <div class="card-header d-flex justify-content-between">
+         <h4>MCO LPR Form - Urgency No: {{ $decryptedid }}</h4>
+         <a href="{{ url('/urgency-mco') }}" class="btn btn-secondary btn-sm">Back</a>
+     </div>
+ 
+     <div class="card-body">
+         {{-- Pending Items Table --}}
+         @if($pendingItems->count())
+             <form method="POST" id="lprForm" action="{{ route('urgency.lpr.generate', $urgencyMaster->id) }}">
+                 @csrf
+                 <button type="submit" class="btn btn-success mb-2" id="generateLprBtn" style="display:none;">Generate LPR</button>
+ 
+                 <div class="table-responsive">
+                     <h5>Pending LPR</h5>
+                     <table class="table table-bordered table-striped table-fixed">
Removed / Before Commit
- \ No newline at end of file
Added / After Commit
+ @extends('layouts.app')
+ @section('content')
+ <div class="card">
+     <div class="card-header d-flex justify-content-between">
+         <h4>Create Case No</h4>
+     </div>
+ 
+     <div class="card-body">
+         <div class="table-responsive">
+             <table class="table table-bordered table-striped table-fixed">
+                 <thead class="table-danger text-center">
+                 <tr>
+                     <th>Select</th><th>LPR No</th><th>Job No</th><th>Req No</th><th>Urgency No</th>
+                 </tr>
+             </thead>
+             <tbody class="text-center">
+                 @foreach($lprGroups as $lprNo => $items)
+                 <tr>
Removed / Before Commit
- 
- {{-- NAC Status --}}
- <select name="nac_status" class="form-select select2">
-                 <option value="">All Nac Status</option>
-                 <option value="pending" {{ request('nac_status') == 'pending' ? 'selected' : '' }}>NAC Pending</option>
-                 <option value="completed" {{ request('nac_status') == 'completed' ? 'selected' : '' }}>NAC Completed</option>
- </select>
- 
- <!-- <button type="submit" class="btn btn-primary">Filter</button>
- <td>{{ $d->id ?? '-' }}</td>
- <td><small style="color:blue">{{ $d->nacStatus() }}</small></td>
- <td>
-                                     <a href="{{ route('urgency.mco.details', encrypt($d->id)) }}"  title="View Details">
-                                         <i class="fa fa-eye" style="color: #008cff;background:white"></i>
-                                     </a></td>
- </tr>
- @endforeach
Added / After Commit
+ 
+ {{-- NAC Status --}}
+ <select name="nac_status" class="form-select select2">
+                 <option value="">All Status</option>
+                 <option value="lprpending" {{ request('nac_status') == 'lprpending' ? 'selected' : '' }}>LPR Pending</option>
+                 <option value="lprpartial" {{ request('nac_status') == 'lprpartial' ? 'selected' : '' }}>LPR Partially Done</option>
+                 <option value="lprcompleted" {{ request('nac_status') == 'lprcompleted' ? 'selected' : '' }}>LPR Completed</option>
+ 
+                 <option value="nacpending" {{ request('nac_status') == 'nacpending' ? 'selected' : '' }}>NAC Pending</option>
+                 <option value="nacpartial" {{ request('nac_status') == 'nacpartial' ? 'selected' : '' }}>NAC Partially Done</option>
+                 <option value="naccompleted" {{ request('nac_status') == 'naccompleted' ? 'selected' : '' }}>NAC Completed</option>
+ </select>
+ 
+ <!-- <button type="submit" class="btn btn-primary">Filter</button>
+ <td>{{ $d->id ?? '-' }}</td>
+ <td><small style="color:blue">{{ $d->nacStatus() }}</small></td>
+ <td>
+                                     {{-- LPR Icon --}}
Removed / Before Commit

                                                
Added / After Commit
+ @extends('layouts.app')
+ @section('content')
+ <div class="card">
+     <div class="card-header d-flex justify-content-between">
+         <h4>MCO NAC Form - Urgency No: {{ $decryptedid }}</h4>
+         <a href="{{ url('/urgency-mco') }}" class="btn btn-secondary btn-sm">Back</a>
+     </div>
+ 
+     <div class="card-body">
+         @foreach($lprGroups as $lprNo => $items)
+             <div class="table-responsive mt-3">
+                 <h5 class="d-flex justify-content-between">
+                     <span>LPR No: {{ $lprNo }}</span>
+                     @php
+                         $hasNac = $items->first()->nac_id;
+                          $firstItem = $items->first();
+                     @endphp
+                     @if(!$hasNac)
Removed / Before Commit
- Route::post('financial-powers/store', [FinancialPowerController::class, 'store'])->name('financialpowers.store');
- Route::post('financial-powers/update/{id}', [FinancialPowerController::class, 'update'])->name('financialpowers.update');
- Route::delete('financial-powers/delete/{id}', [FinancialPowerController::class, 'destroy'])->name('financialpowers.destroy');
-     
- // Financial Power End
- 
- // urgency start
- ->name('urgency.checkPower');
- Route::post('/lpr/{lpr}/store-gems-details', [UrgencyController::class, 'storeGemsDetails'])->name('lpr.store.gems');
- Route::post('/urgency/update-field', [UrgencyController::class, 'updateField'])->name('urgency.updateField');
- 
- 
- 
- Route::post('/cart/issue', [InventoryController::class, 'storeIssue'])->name('cart.issue.store');
- });
- 
- Route::get('issues', [IssueController::class, 'index'])->name('issues.index');  // list grouped regn_no
- Route::get('issues/{regn_no}', [IssueController::class, 'show'])->name('issues.show');  // show spares by regn_no
Added / After Commit
+ Route::post('financial-powers/store', [FinancialPowerController::class, 'store'])->name('financialpowers.store');
+ Route::post('financial-powers/update/{id}', [FinancialPowerController::class, 'update'])->name('financialpowers.update');
+ Route::delete('financial-powers/delete/{id}', [FinancialPowerController::class, 'destroy'])->name('financialpowers.destroy');
+      Route::get('financial-powers/{id}/funds', [FinancialPowerController::class, 'funds'])->name('financial-powers.funds');
+     Route::post('financial-powers/{id}/funds/save', [FinancialPowerController::class, 'saveFunds'])->name('financial-powers.funds.save');
+ // Financial Power End
+ 
+ // urgency start
+ ->name('urgency.checkPower');
+ Route::post('/lpr/{lpr}/store-gems-details', [UrgencyController::class, 'storeGemsDetails'])->name('lpr.store.gems');
+ Route::post('/urgency/update-field', [UrgencyController::class, 'updateField'])->name('urgency.updateField');
+     Route::get('/urgency/case-summary', [UrgencyController::class, 'caseSummary'])->name('urgencies.case.summary');
+ Route::get('/urgency/case-items/{caseNo}', [UrgencyController::class, 'caseItems'])->name('urgencies.case.items');
+ Route::post('/urgency/case-bid/{caseNo}', [UrgencyController::class, 'storeBid'])->name('urgencies.case.bid.store');
+ // Draft Bid save
+ Route::post('/cases/{case}/draft-bid', [UrgencyController::class, 'saveDraftBid'])->name('cases.saveDraftBid');
+ 
+ // Gems Details save