@extends('layouts.app') @section('title', __('lang_v1.sell_exchange')) @section('content')

@lang('lang_v1.sell_exchange')

@lang('lang_v1.exchange_details')

@lang('sale.invoice_no'): {{ $sell_exchange->transaction->invoice_no ?? '-' }}
@lang('messages.date'): {{ @format_date($sell_exchange->created_at) }}
@lang('contact.customer'): {{ $sell_exchange->transaction->contact->name ?? '-' }}
@lang('purchase.business_location'): {{ $sell_exchange->businessLocation->name ?? '-' }}
@foreach ($exchangeDetails as $detail)

@lang('lang_v1.exchanged_products')

@foreach ($detail['exchange_products'] as $index => $product) @endforeach
# @lang('product.product_name') @lang('product.variation') @lang('sale.quantity') @lang('sale.unit_price') @lang('sale.total_price')
{{ $loop->iteration }} {{ $product->name }} {{ optional($product->variations->firstWhere('id', $detail['exchange_variation_ids'][$index]))->name ?? 'N/A' }} {{ $detail['exchange_quantities'][$index] ?? '-' }} {{ $detail['exchange_unit_price'][$index] ?? '-' }} {{ $detail['exchange_total_price'][$index] ?? '-' }}

@lang('lang_v1.new_products_given')

@foreach ($detail['new_products'] as $index => $product) @endforeach
# @lang('product.product_name') @lang('product.variation') @lang('sale.quantity') @lang('sale.unit_price') @lang('sale.total_price')
{{ $loop->iteration }} {{ $product->name }} {{ optional($product->variations->firstWhere('id', $detail['new_variation_ids'][$index]))->name ?? 'N/A' }} {{ $detail['new_quantities'][$index] ?? '-' }} {{ $detail['new_unit_price'][$index] ?? '-' }} {{ $detail['new_total_price'][$index] ?? '-' }}
@endforeach
@endsection