@php $total_cant=0; $total_pu=0; $total_pb=0; @endphp @foreach($datos as $k1=>$v) @php $c=\App\Contrato::find($v->id); $total_cant+=$c->detalle->sum('cantidad'); $total_pu+=$c->detalle->sum('precio_unitario'); @endphp @foreach($c->detalle()->orderBy('precio_unitario','DESC')->get() as $k2=>$r) @if($k2<=0) @else @endif @php $total_pb+=$r->libro->precio_base; @endphp @endforeach {{----}} {{----}} {{----}} {{----}} {{----}} @endforeach
FECHA
CTTO
FECHA
CTTO
C.I.
VENDEDOR CHOFER CLIENTE COD
CLIENTE
NºCTT CANT CODIGO TITULO P.U. PRECIO
VENTA
PRECIO
BASICO
CUOTA
INICIAL
SALDO MONTO
CUOTAS
NUMERO
CUOTAS
%
COMISION
MONTO
COMISION
IMPORTE A
CUENTA
NUM
REPORTE
NUM
RECIBO
COBRADOR COSTO
UNIT
{{$k1+1}} {{\Carbon\Carbon::createFromFormat('Y-m-d',$v->fechacontrato)->format('d/m/Y')}} @if(isset($v->fechadoc) && !is_null($v->fechadoc)) {{\Carbon\Carbon::createFromFormat('Y-m-d',$v->fechadoc)->format('d/m/Y')}} @endif {{$c->vendedor->nombre_completo}} {{$c->chofer->nombre_completo}} {{$c->nombre_completo}} {{$v->numcuenta}} {{$v->numcontrato}} {{$r->cantidad}} {{$r->codigo}} {{$r->titulo}} {{number_format($r->precio_unitario, 2, ',', '.')}}{{number_format($v->preciototal, 2, ',', '.')}} {{number_format($v->valorcomisionable, 2, ',', '.')}} {{number_format($v->cuotainicial, 2, ',', '.')}} {{number_format( $v->saldo, 2, '.', ',')}} {{number_format($v->montocuotas, 2, ',', '.')}} {{$v->numcuotas}} {{number_format($v->porcentajecomision, 2, ',', '.')}} {{number_format($v->montocomision, 2, ',', '.')}} {{number_format($v->cuentacomision, 2, ',', '.')}} {{$v->numreporte}} {{$v->numdocumento}} @if(isset($c->credito->cobrador)) {{$c->credito->cobrador->nombre_completo}} @endif 0 0 0 0 0 0 0 0 0 0 0 {{number_format($r->libro->precio_base, 2, ',', '.')}}
00000 TOTAL PRODUCCION {{$c->vendedor->nombre_completo}} {{$c->detalle()->sum('cantidad')}} {{$c->detalle()->sum('precio_unitario')}} 0 0 0 0 0 0
  TOTALES           {{$total_cant}}    {{ number_format($total_pb, 2, ',', '.')}} {{ number_format($datos->sum('preciototal'), 2, ',', '.')}} {{ number_format($datos->sum('valorcomisionable'), 2, ',', '.') }} {{ number_format($datos->sum('cuotainicial'), 2, ',', '.') }} {{ number_format($datos->sum('saldo'), 2, ',', '.')}} {{ number_format( $datos->sum('montocuotas'), 2, ',', '.')}} {{ $datos->sum('numcuotas')}} {{ number_format( $datos->sum('porcentajecomision'), 2, ',', '.')}} {{ number_format( $datos->sum('montocomision'), 2, ',', '.')}} {{ number_format( $datos->sum('cuentacomision'), 2, ',', '.')}} {{ number_format( $total_pu, 2, ',', '.')}}