@php use Carbon\Carbon;use chillerlan\QRCode\QRCode;use Domain\ShippingPackaging\Enums\ShippingPackagingTypeEnum; @endphp Embalagem de separação - {{$shippingPacking->getKey()}}

Embalagem de {{$shippingPacking->type->label()}} #{{$shippingPacking->getKey()}}

Time:{{strtoupper($shippingPacking->team?->description)}}
Embalagem: {{strtoupper($shippingPacking->packaging?->description)}}
Status:{{$shippingPacking->status->label()}}
Data Criação:{{Carbon::create($shippingPacking->created_at)->format('d/m/Y H:i')}}
@if($shippingPacking->type == ShippingPackagingTypeEnum::EXPEDITION)
Volume:{{ $shippingPacking->volume }}{{ $shippingPacking->observation ? ' - ' . $shippingPacking->observation : '' }}
@endif
Peso:{{number_format($shippingPacking->totalWeight(), 2, ',', '.')}} KG
Pré-faturas: {{ !empty($preInvoices) ? implode(' - ', array_column($preInvoices, 'pre-invoice')) : '-' }}
@if($shippingPacking->type == ShippingPackagingTypeEnum::SEPARATION)
Observação: {{$shippingPacking->observation}}
@endif
qrcode
@foreach($preInvoices as $preInvoice) @php $totalProductWeight = 0; @endphp

Cliente: {{$preInvoice['customer']->integration->parameters['integration_code'] ?? '-'}} - {{ $preInvoice['customer']->description }}

@isset($preInvoice['items'])

Cidade: {{$preInvoice['items'][0]->pickedItem->item->itemable->integration->parameters['CIDCLI'] ?? ''}} - UF: {{$preInvoice['items'][0]->pickedItem->item->itemable->integration->parameters['SIGUFS'] ?? ''}}

@endisset

Pré-fatura: {{ $preInvoice['pre-invoice'] }}

Data Faturamento: {{Carbon::create($preInvoice['data-faturamento'])->format('d/m/Y')}}

Forma de Pagamento: {{$preInvoice['items'][0]->pickedItem->item->itemable->integration->parameters['CODFPG'] ?? ''}} - {{$preInvoice['items'][0]->pickedItem->item->itemable->integration->parameters['DESFPG'] ?? ''}}

Cod. de Pagamento: {{$preInvoice['items'][0]->pickedItem->item->itemable->integration->parameters['CODCPG'] ?? ''}} - {{$preInvoice['items'][0]->pickedItem->item->itemable->integration->parameters['DESCPG'] ?? ''}}

@isset($preInvoice['orderDetails'])

@foreach($preInvoice['orderDetails'] as $orderDetail) @foreach($orderDetail as $title => $detail) @if($title === 'Observações:') {{-- Essa é a chave que vem direto do ERP --}} {{$title}} {{$detail}} @endif @endforeach @endforeach

@endisset

Valor da Pré-fatura: {{$preInvoice['value']}}

Peso da Pré-fatura: {{ number_format($preInvoice['weight'], 2, ',', '.') }}

Tipo de Frete: {{$preInvoice['shippingType']}}

@isset($preInvoice['orderDetails'])
@foreach($preInvoice['orderDetails'] as $orderDetail) @foreach($orderDetail as $title => $detail) @if($title !== 'Endereço Entrega:' && $title !== 'Endereço Cliente:' && $title !== 'Observações:' ) {{-- Essa é a chave que vem direto do ERP --}}

{{$title}} {{$detail}}

@endif @endforeach @endforeach
@endisset
@foreach($preInvoice['picking-orders'] as $pickinOrder)

Tarefa de separação: {{ $pickinOrder['id'] }} - {{ $pickinOrder['position'] }}

Peso da tarefa: {{ number_format($pickinOrder['weight'], 2, ',', '.') }}

@endforeach
@if($withItems) @foreach($preInvoice['items'] as $index => $product) @php $odd = $index % 2 === 0; $weight = $product->pickedItem->item->product->measure->gross_weight * $product->amount; $totalProductWeight += $weight; @endphp $odd])> $odd, 'observation'])> @if(($shippingPacking->type == ShippingPackagingTypeEnum::EXPEDITION && $shippingPacking->team->getKey() == 1) || ($shippingPacking->type == ShippingPackagingTypeEnum::SEPARATION)) $odd, 'observation'])> @if($observation = $product->pickedItem->observation) @endif @endif @endforeach
Seq Ped Cod.Ref Descrição Sep/Tot Un Peso(KG)
{{$product->pickedItem->stockIOProduct->integration->parameters['SEQPES'] ?? '-'}} {{$product->pickedItem->stockIOProduct->integration->parameters['NUMPED'] ?? '-'}} {{$product->pickedItem->item->product->integration->parameters['integration_code']}} {{$product->pickedItem->item->product->description}} {{number_format($product->amount, 2, ',', '.')}}/{{number_format($product->pickedItem->stockIOProduct->amount, 2, ',', '.')}} {{$product->pickedItem->item->product->unitMeasurement->acronym}} {{ number_format($weight, 2, ',', '.') }}
Ped. Cli.: {{$product->pickedItem->stockIOProduct->integration->parameters['PEDCLI'] ?? ''}} - Pro. Cli.: {{$product->pickedItem->stockIOProduct->integration->parameters['PROCLI'] ?? ''}} - E.C.: {{$product->pickedItem->stockIOProduct->integration->parameters['EMICER'] ?? ''}} @if ($product->pickedItem->stockIOProduct->getAttribute('status')->value == 5) Situação: Cancelado @endif
Observações: {{$observation}}
{{number_format($totalProductWeight, 2, ',', '.')}}
@endif
@endforeach
{{-- Número de páginas. Esse código não pode ficar fora do body --}}