@extends('backend.layouts.admin') @section('main-content') @php $min_date = $vCurrentPrice->last()?$vCurrentPrice->last()->c_p_date:date('Y-m-d'); @endphp
Price Details: {{ $vehicleDetail->registration_no }}
Buying Price : {{ number_format($vehicleDetail->buying_price) }}     Current Price : {{ number_format($vehicleDetail->curr_price) }}

@php $lastCurrentPrice = null; @endphp @forelse($vCurrentPrice as $cPrice) @empty @endforelse
Sr No. Date Current Price ({{config('constants.currency_symbol')}}) Depreciation ({{config('constants.currency_symbol')}}) Description Action
{{ $loop->iteration }} {{ date('d-m-Y',strtotime($cPrice->c_p_date)) }} {{ number_format($cPrice->c_price) }} @if($loop->iteration == 1) @php $depreciationValue = $vehicleDetail->buying_price - $cPrice->c_price; @endphp @else @php $depreciationValue = $lastCurrentPrice - $cPrice->c_price; @endphp @endif @php $lastCurrentPrice = $cPrice->c_price; @endphp {{ $depreciationValue }} {{ $cPrice->c_p_description }} @if($loop->last) @endif
No Data
@if(count($vCurrentPrice)) @php($max_price= $vCurrentPrice->last()->c_price) @else @php($max_price= $vehicleDetail->curr_price) @endif

Add Vehicle Current Price

@csrf

Update Current Price

@csrf
@endsection @push('scripts') @endpush