@extends('layouts.app') @section('title','Shared Product Library') @section('content')
ERP / PRODUCT FOUNDATION

Shared Product Library

One product identity across companies. Activation and prices belong to the selected company.

@if(session('success'))
{{ session('success') }}
@endif @if($errors->any())@endif
Existing company products have not been merged automatically. Shared barcodes are allowed, but always require explicit selection when ambiguous. All prices below include VAT 5%.
@if($canCreate)
any()) open @endif>Add a shared product
@csrf
@endif
@forelse($products as $p) @empty@endforelse
Product identityBarcodesCurrent companyCompany prices (AED, VAT included)
@if($p->company_product_id){{ $p->sku }}@else{{ $p->sku }}@endif
{{ $p->name }}
{{ $p->brand }} {{ $p->model }} {{ $p->color }}
{{ $p->status }}
@forelse($barcodes->get($p->id,collect()) as $barcode)
{{ $barcode->barcode }} @if(in_array($barcode->barcode,$duplicateCodes,true))Shared barcode@endif
@emptyNot provided@endforelse
@if($p->company_product_id){{ $p->company_active?'Enabled':'Inactive' }}@elseif($canCreate)
@csrf
@elseNot enabled@endif
@if($p->company_product_id) @php($currentPrices=$prices->get($p->company_product_id,collect())->unique('price_type')) @forelse($currentPrices as $price)
{{ ucfirst($price->price_type) }}: {{ \App\Support\ProductRegistry::formatUnitPrice((string)$price->gross_amount) }} from {{ $price->effective_date }}
@empty

No prices recorded.

@endforelse @if($canEdit)
Set company price
@csrf
@endif @elseEnable this product to record company prices.@endif
No shared products found. Existing company products are unchanged.
{{ $products->links() }}
@endsection