@php $total_cant=0; $total_precio_unit=0; $total_precio_venta=0; $total_valorcomisionable=0; $total_cuotaini=0; $total_saldo=0; $total_montocuotas=0; $total_numerocuotas=0; $total_comision=0; $total_montocomision=0; $total_acuenta=0; $total_costounit=0; @endphp @foreach($datos as $index=>$contratos) @php $subtotal_cant=0; $subtotal_precio_unit=0; $subtotal_precio_venta=0; $subtotal_valorcomisionable=0; $subtotal_cuotaini=0; $subtotal_saldo=0; $subtotal_montocuotas=0; $subtotal_numerocuotas=0; $subtotal_comision=0; $subtotal_montocomision=0; $subtotal_acuenta=0; $subtotal_costounit=0; @endphp @foreach($contratos as $k1=>$v) @php $c=\App\Contrato::find($v->id); @endphp @foreach($c->detalle()->orderBy('precio_unitario','DESC')->get() as $k2=>$r) @php $subtotal_cant+=$r->cantidad; $subtotal_precio_unit+=$r->precio_unitario; $subtotal_precio_venta+=$v->preciototal; $subtotal_valorcomisionable+=$v->valorcomisionable; $subtotal_cuotaini+=$v->cuotainicial; $subtotal_saldo+=$v->saldo; $subtotal_montocuotas+=$v->montocuotas; $subtotal_numerocuotas+=$v->numcuotas; $subtotal_comision+=$v->porcentajecomision; $subtotal_montocomision+=$v->montocomision; $subtotal_acuenta+=$v->cuentacomision; $subtotal_costounit+=$r->libro->precio_base; $total_cant+= $subtotal_cant; $total_precio_unit+= $subtotal_precio_unit; $total_precio_venta+= $subtotal_precio_venta; $total_valorcomisionable+= $subtotal_valorcomisionable; $total_cuotaini+= $subtotal_cuotaini; $total_saldo+= $subtotal_saldo; $total_montocuotas+= $subtotal_montocuotas; $total_numerocuotas+= $subtotal_numerocuotas; $total_comision+= $subtotal_comision; $total_montocomision+= $subtotal_montocomision; $total_acuenta+= $subtotal_acuenta; $total_costounit+= $subtotal_costounit; @endphp @if($k2<=0) @else @endif @endforeach @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}} {{ $subtotal_cant}} {{number_format($subtotal_precio_unit, 2, ',', '.')}} {{number_format($subtotal_precio_venta, 2, ',', '.')}} {{number_format($subtotal_valorcomisionable, 2, ',', '.')}} {{number_format($subtotal_cuotaini, 2, ',', '.')}} {{number_format($subtotal_saldo, 2, ',', '.')}} {{number_format($subtotal_montocuotas, 2, ',', '.')}} {{number_format($subtotal_numerocuotas, 2, ',', '.')}} {{number_format($subtotal_comision, 2, ',', '.')}} {{number_format($subtotal_montocomision, 2, ',', '.')}} {{number_format($subtotal_acuenta, 2, ',', '.')}} {{number_format($subtotal_costounit, 2, ',', '.')}}
  TOTALES           {{$total_cant}}    {{ number_format($total_precio_unit, 2, ',', '.')}} {{ number_format($total_precio_venta, 2, ',', '.')}} {{ number_format($total_valorcomisionable, 2, ',', '.') }} {{ number_format( $total_cuotaini, 2, ',', '.') }} {{ number_format( $total_saldo, 2, ',', '.')}} {{ number_format( $total_montocuotas, 2, ',', '.')}} {{ $total_numerocuotas}} {{ number_format( $total_comision, 2, ',', '.')}} {{ number_format( $total_montocomision, 2, ',', '.')}} {{ number_format( $total_acuenta, 2, ',', '.')}} {{ number_format( $total_costounit, 2, ',', '.')}}