@extends('layouts.app') @section('title', 'Material Catalogue') @section('breadcrumb')Material Catalogue@endsection @section('content')
{{-- Page header --}}

Material Catalogue

Manage material types and their items. W/Sale = internal cost, Retail = client price.

{{-- Add new type form --}}

New Material Type

@csrf
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($types->isEmpty())

No material types yet. Create your first type (e.g. "Cabinet", "Admin", "Accessories").

@else {{-- Tab navigation --}}
@foreach($types as $type) @endforeach
@foreach($types as $type)
{{-- Type header --}}

{{ $type->name }} Materials

{{-- Rename type --}}
@csrf @method('PUT') Rename
{{-- Delete type --}}
@csrf @method('DELETE')
{{-- Materials table --}}
@foreach($type->materials as $mat) {{-- View row --}} {{-- Edit row --}} @endforeach {{-- Add new material row --}}
Description Item Code Unit W/Sale Retail Comments Actions
{{ $mat->description }} {{ $mat->item_code }} {{ $mat->unit }} ${{ number_format($mat->wsale_price,2) }} ${{ number_format($mat->retail_price,2) }} {{ $mat->comments }}
@csrf @method('DELETE')
@csrf @method('PUT')
@csrf
@endforeach
@endif
@endsection