@extends('companyuser::layouts.master') @section('title', __('Show') . ' ' . ucfirst(__($product->type))) @section('breadcrumb') @endsection @section('content')
@can('products.products.edit') @endcan
{{ __('products::product.Id') }}
{{ $product->identifier }}
{{ __('products::product.List Name') }}
{{ $product->name }}
{{ __('products::product.Type') }}
{{ __($product->type) }}
{{ __('products::product.Category') }}
{{ $product->category->name }}
{{ __('products::product.Unit') }}
{{ $product->unit->name }}
{{ __('products::product.Barcode') }}
{{ $product->barcode }}
{{ __('products::product.Tax rate') }}
{{ isset($product->tax) ? $product->tax->name : '' }}
{{ __('products::product.Selling Account') }}
{{ $product->selling_account->name ?? '' }}
@if ($product->type != \Modules\Products\Enums\ProductTypeEnum::RECIPE)
{{ __('products::product.Buying Account') }}
{{ $product->purchasing_account->name ?? '' }}
@endif @if ($checkContinuosInventory && $product->type == \Modules\Products\Models\Product::TYPE_PRODUCT)
{{ __('products::product.Average Cost') }}
{{ number_format($product->average_cost, 2, '.', ',') }}
{{ __('products::product.Total Cost') }}
{{ number_format($product->total_cost, 2, '.', ',') }}
@endif @if ($product->type == \Modules\Products\Models\Product::TYPE_RECIPE)
{{ __('products::product.Additional Cost') }}
{{ number_format($product->additional_cost, 2, '.', ',') }}
{{ __('products::product.Additional Cost Account') }}
{{ $product->additional_cost_account->name ?? '' }}
@endif @if ($product->total_cost && $product->type == \Modules\Products\Models\Product::TYPE_RECIPE)
{{ __('products::product.Total Cost') }}
{{ number_format($product->total_cost, 2, '.', ',') }}
@endif

@if ($product->type == \Modules\Products\Models\Product::TYPE_PRODUCT)

@lang('products::product.warehouse_assignment')

@foreach ($warehouse_assignments as $warehouse_assignment) @endforeach
@lang('products::product.warehouse') @lang('products::product.openingBalance') @lang('products::product.selling_price') @lang('products::product.buying_price') @lang('products::product.minimum_quantity') @lang('products::product.inventory_account')
{{ $warehouse_assignment->warehouse->short_title }} {{ $warehouse_assignment->quantity }} {{ $warehouse_assignment->selling_price }} {{ $warehouse_assignment->buying_price }} {{ $warehouse_assignment->minimum_quantity }} {{ $warehouse_assignment->inventory_account->name ?? $warehouse_assignment->inventory_account_id }}
@endif

@lang('products::product.Contained products')

@foreach ($productRecipes as $productRecipe) @endforeach
@lang('products::product.product') @lang('sales::estimates.description') @lang('products::product.Unit') @lang('sales::estimates.qty') @lang('products::product.cost')
{{ $productRecipe->product_name }} {{ $productRecipe->description }} {{ $productRecipe->unit }} {{ $productRecipe->quantity }} {{ $productRecipe->cost }}

@lang('products::product.Transactions')

@foreach ($transactions as $transaction) @endforeach
@lang('products::product.Date') @lang('products::product.Id') @lang('products::product.Type') @lang('products::product.QTY') @lang('products::product.price') @lang('products::product.Discount') @lang('products::product.Total')
{{ $transaction['date'] }} {{ $transaction['code'] }} {{ $transaction['type'] }} {{ $transaction['qty'] }} {{ $transaction['price'] }} {{ $transaction['discount'] }} {{ $transaction['total'] }}

@lang('products::product.Activity Log')

@foreach ($logs as $row) @php $isWarehouseProduct = $row->auditable_type === 'Modules\Products\Models\WarehouseProduct'; $warehouseName = null; if ($isWarehouseProduct && $row->auditable) { $warehouseName = optional($row->auditable->warehouse)->title; } @endphp
@lang('products::product.Date') @lang('products::product.username') @lang('products::product.Action') @lang('products::product.Details')
{{ $row->formatDateTime($row->created_at) }} {{ $row->user->uname ?? '-' }} @if ($isWarehouseProduct) {{ __('products::product.warehouse_stock_update') }} @if ($warehouseName)
{{ $warehouseName }} @endif @else {{ trans($row->event) }} @endif
@if ($row->event != 'created') @foreach ($row->new_values as $key => $change) @if (in_array($key, ['updated_at', 'created_at', 'product_id', 'warehouse_id', 'cost_center_id'])) @continue @endif @if ($key == 'category_id') {{ __('products::product.Category') . ' ' . __('products::product.changed to') . ' ' . $categories[$change]['name_' . App::getLocale()] }}
@elseif($key == 'unit_id') {{ __('products::product.Unit') . ' ' . __('products::product.changed to') . ' ' . $units[$change]['name_' . App::getLocale()] }}
@elseif($key == 'tax_id') @if ($change) {{ __('products::product.Taxes') . ' ' . __('products::product.changed to') . ' ' . $taxes[$change]['name_' . App::getLocale()] }}
@else {{ __('products::product.tax_removed') }}
@endif @elseif($key == 'allow_notification') @if ($change) {{ __('products::product.notification_activated') }}
@else {{ __('products::product.notification_deactivated') }}
@endif @elseif($key == 'inventory_account_id' || $key == 'purchasing_account_id' || $key == 'selling_account_id') {{ __('products::product.' . $key) . ' ' . __('products::product.changed to') . ' ' }} @if ($change) {{ $change }} @endif
@elseif($key == 'custom_fields') @if ($change)