@extends('layouts.app') @section('content')

{{ $stockAdjustment->adjustment_number }} @if($stockAdjustment->type === 'increase') Increase @else Decrease @endif

Stock Adjustment Details

Back to List
@if(session('success')) @endif @if(session('error')) @endif

Current Status

@if($stockAdjustment->status === 'pending') Pending Approval @elseif($stockAdjustment->status === 'approved') Approved @else Rejected @endif
@can('manage stock adjustments') @if($stockAdjustment->status === 'pending')
@csrf
@csrf
@endif @endcan

Adjustment Details

{{ $stockAdjustment->adjustment_number }}

{{ $stockAdjustment->adjustment_date->format('F d, Y h:i A') }}

{{ $stockAdjustment->creator->name }}

@if($stockAdjustment->approved_by)

{{ $stockAdjustment->approver->name }}

@endif @if($stockAdjustment->approved_at)

{{ $stockAdjustment->approved_at->format('F d, Y h:i A') }}

@endif

Product & Stock Details

{{ $stockAdjustment->product->product_name }}

{{ $stockAdjustment->product->category->category_name ?? 'N/A' }}

{{ $stockAdjustment->product->brand->brand_name ?? 'N/A' }}

{{ $stockAdjustment->batch->batch_number }}

@if($stockAdjustment->stock->batch->expiry_date)

{{ $stockAdjustment->stock->batch->expiry_date->format('Y-m-d') }}

@endif @if($stockAdjustment->stock->batch->goodReceiveNote) @endif

{{ number_format($stockAdjustment->stock->available_quantity, 4) }}

LKR {{ number_format($stockAdjustment->stock->selling_price, 2) }}

Reason & Notes

{{ $stockAdjustment->reason }}

@if($stockAdjustment->notes)

{{ $stockAdjustment->notes }}

@endif
@if($stockAdjustment->status === 'approved' && $stockAdjustment->journalEntry)

Accounting Entry

{{ $stockAdjustment->journalEntry->entry_date->format('Y-m-d') }}

{{ $stockAdjustment->journalEntry->description }}

@foreach($stockAdjustment->journalEntry->lines as $line) @endforeach
Account Debit Credit
{{ $line->account->account_code }} - {{ $line->account->account_name }} {{ $line->debit_amount > 0 ? 'LKR ' . number_format($line->debit_amount, 2) : '-' }} {{ $line->credit_amount > 0 ? 'LKR ' . number_format($line->credit_amount, 2) : '-' }}
Total LKR {{ number_format($stockAdjustment->journalEntry->lines->sum('debit_amount'), 2) }} LKR {{ number_format($stockAdjustment->journalEntry->lines->sum('credit_amount'), 2) }}
@endif

Summary

Quantity Before {{ number_format($stockAdjustment->quantity_before, 4) }}
Adjustment {{ $stockAdjustment->type === 'increase' ? '+' : '-' }}{{ number_format($stockAdjustment->quantity_adjusted, 4) }}
Quantity After {{ number_format($stockAdjustment->quantity_after, 4) }}
Cost Price LKR {{ number_format($stockAdjustment->cost_price, 2) }}
Total Value Impact {{ $stockAdjustment->type === 'increase' ? '+' : '-' }}LKR {{ number_format($stockAdjustment->total_value, 2) }}

Timeline

Created

{{ $stockAdjustment->created_at->format('M d, Y h:i A') }}

by {{ $stockAdjustment->creator->name }}

@if($stockAdjustment->approved_at)

{{ $stockAdjustment->status === 'approved' ? 'Approved' : 'Rejected' }}

{{ $stockAdjustment->approved_at->format('M d, Y h:i A') }}

by {{ $stockAdjustment->approver->name }}

@endif
@endsection