@extends('layouts.reports') @section('title', "Balanço $year") @section('report_title', "Balanço $year") @section('contente') @php $numMonths = $untilMonth; @endphp @php $lastMonth = str_pad($numMonths, 2, '0', STR_PAD_LEFT); @endphp

Período: {{ "01/01/$year" }} a {{ date('t', strtotime("$year-$lastMonth-01")) . "/$lastMonth/$year" }}

@for($m=1; $m<=$numMonths; $m++) @endfor @for($m=1; $m<=$numMonths; $m++) @endfor @php $cont = 0; @endphp @foreach($balance as $product) @php $cont++; @endphp @php $total = 0; @endphp @foreach($product->months as $month=>$values) @if($month > $numMonths) @break(1); @endif @php $total += $values->vendas; @endphp @endforeach @endforeach
Meses =>{{ str_pad($m, 2, '0', STR_PAD_LEFT) }}TOTAL
# Produto Tam.Vnd. Est.Vendas
{{ $cont }} {{ $product->product_name }} {{ $product->size }}{{ $values->vendas }} {{ $values->stock }}{{ $total }}
@endsection