@extends('layouts.layout-horizontal') @section('title', ' Products') @section('css') @endsection @section('content')
{{ $product->name }}
Product ID: {{ $product->product_id }}
Unit: {{ $product->unit ?? '-' }}
HSN: {{ $product->hsn ?? '-' }}
Cost Price: {{ $product->mrp ? '₹' . number_format($product->mrp, 2) : '-' }}
@if($product->image_path)
{{ $product->name }}
@endif
Tax Rates
    @forelse($product->taxRates as $t)
  • {{ $t->starts_at->format('d M Y') }} — {{ rtrim(rtrim(indian_number($t->percentage,2,'.',''), '0'),'.') }}%
  • @empty
  • No tax rates
  • @endforelse
{{-- Opening Stock & Current Balance per Company --}}
Opening Stock & Current Balance (per Company)

Set the opening stock for each company. When saved, the balance (c1/c2/c3) will be updated accordingly.

@foreach($companies as $company) @php $stockCol = 'c' . $company->id; $opening = $product->openings->where('company_id', $company->id)->first(); @endphp @if($opening) {{-- Existing opening - show edit form --}} @csrf @method('PUT') @else {{-- No opening - show add form --}} @csrf @endif @endforeach
Company Opening Date Opening Qty Current Balance Actions
{{ $company->name }}
{{ indian_number($product->$stockCol ?? 0, 2) }}
@csrf @method('DELETE')
{{ indian_number($product->$stockCol ?? 0, 2) }}
How it works:
  • Add Opening: Adds the quantity to the current balance
  • Update Opening: Adjusts the balance by the difference (new qty - old qty)
  • Delete Opening: Subtracts the quantity from the current balance
@endsection