@extends('layouts.master') @section('page_title', 'View Details') @section('title', 'Purchases Details') @section('main_item', 'Purchases') @section('sub_item', 'Purshases Details') @section('content')

Purchase Details: (Reference Number: #{{ $grn->ref_no }})

Supplier:
Business Name: {{ $grn->supplier->business_name }}
Supplier Name: {{ $grn->supplier->name }}
Address: {{ $grn->supplier->landmark }}
City: {{ $grn->supplier->city_id->name_en ?? 'N/A' }}
District: {{ $grn->supplier->district->name_en ?? 'N/A' }}
Mobile: {{ $grn->supplier->mobile }}
Email: {{ $grn->supplier->email }}
Reference No: #{{ $grn->ref_no }}
Date: {{ explode(' ', $grn->grn_date)[0] }}
Purchase Status: Received
Payment Status: Paid
Created By : {{ $grn->user->full_name ?? 'N/A' }}
@foreach ($grn->grnItems as $item) @php $attribute_value_id = App\AttributeValue::find($item->attribute_value_id); $second_attribute_value_id = App\AttributeValue::find($item->second_attribute_value_id); @endphp @if (!empty($item->product->product_name)) @else @endif @endforeach
Product Name SKU Purchase Quantity Purchase Price Subtotal
{{ $item->product->product_name }}
@if (!empty($attribute_value_id->value)) ({{ $attribute_value_id->value }}) | @else @endif @if (!empty($second_attribute_value_id)) ({{ $second_attribute_value_id->value }}) @else @endif
@php if (!empty($second_attribute_value_id)) { $product_sku = App\ProductHasMultipleVarition::where('product_id', $item->product_id) ->where('attribute_value_id', $item->attribute_value_id) ->where('second_attribute_value_id', $item->second_attribute_value_id) ->first(); } else { $product_sku = App\ProductHasMultipleVarition::where('product_id', $item->product_id) ->where('attribute_value_id', $item->attribute_value_id) ->first(); } @endphp {{ $product_sku->sku }} {{ $item->qty . ' ' . $item->product->unit->short_name }} {{ number_format($item->grn_unit_cost, 2) }} {{ number_format($item->grn_line_total, 2) }}
Net Total Amount: ₨ {{ number_format($grn->grn_total, 2) }}
Discount: (-) ₨ {{ number_format($grn->grn_discount, 2) }}
Purchase Total: ₨ {{ number_format($grn->grn_nettotal, 2) }}
@endsection @section('scripts') @endsection