@foreach($data as $value) Nota de Crédito - {{ sprintf("CRE-%'.05d", $value->id) }} @endforeach
@foreach($empresa as $val)

{{ $val->direccion }},
{{ $val->ciudad }} {{ $val->provincia }} R.D.
Tel: {{ $val->tel1 }} || RNC: {{ $val->rnc }}

@endforeach

NOTA DE CREDITO

@foreach($data as $value)

Orden #: {{ str_pad($value->id, 9, 'CRE-0000', STR_PAD_LEFT) }}
Fecha de la orden: {{ Carbon\Carbon::parse($value->created_at)->format('d M Y') }}
Cliente: {{ $value->cliente }}
Factura #: {{ str_pad($value->id_factura, 9, 'FAC-0000', STR_PAD_LEFT) }}


@php $nombre = json_decode($value->productos); $cantidad = json_decode($value->cantidad); $total = json_decode($value->total); $inicio = 1; $count = count($nombre); $descripcion = $value->descripcion; @endphp @for( $i = 0; $i < count($nombre); $i ++ ) @endfor @php $itbis = $value->total_final * 0.18; $subtotal = $value->total_final - $itbis; @endphp
PRODUCTO CANT PRECIO
{{ $nombre[$i] }} {{ $cantidad[$i] }} RD${{ number_format($total[$i], 2) }}
SUBTOTAL RD${{ number_format($subtotal, 2) }}
ITBIS RD${{ number_format($itbis, 2) }}
TOTAL RD${{ number_format($value->total_final, 2) }}

¡GRACIAS POR SU COMPRA!

@endforeach