@extends('layouts.app') @section('title',$company->name.' • JAN Enterprises ERP') @section('page_title',$company->name) @section('page_subtitle','Company details, agreements, prices and historical business') @section('content') @php $agreement=$company->agreements->sortByDesc('start_date')->first(); $prices=$agreement?->prices?->keyBy('asset_id') ?? collect(); @endphp
Total Orders{{ $company->orders->count() }}
Historical Investment₹{{ number_format($company->orders->sum(fn($o)=>$o->items->sum('invested_amount')),0) }}
Historical Billing₹{{ number_format($company->orders->sum(fn($o)=>$o->items->sum('final_amount')),0) }}
Historical Profit₹{{ number_format($company->orders->sum(fn($o)=>$o->items->sum('profit')),0) }}

Company Master

Edit customer invoice information
@csrf @method('PUT')

Current Agreement

Price list is tied to this agreement
@if($agreement)
Agreement Start{{ $agreement->start_date->format('d M Y') }}
Agreement End{{ $agreement->end_date->format('d M Y') }}
Days Remaining{{ now()->startOfDay()->diffInDays($agreement->end_date,false) }}
@else
No agreement found.
@endif
@if($agreement)

Agreement Price Master

Update buy and company selling prices
@csrf @method('PUT')
@foreach($assets as $asset)@php $p=$prices->get($asset->id); @endphp@endforeach
AssetBuy PriceSell PriceExpected Profit / Unit
{{ $asset->name }}
₹{{ number_format(($p?->sell_price ?? 0)-($p?->buy_price ?? 0),0) }}
@endif @endsection