@php use App\Http\Controllers\Mod\ModOrigin;use App\Http\Controllers\Mod\ModPaymentMethodRecurrent;use App\Http\Controllers\Mod\ModSalesOrderPaymentMethod;use App\Http\Controllers\ModFinancial; @endphp @include('system-layouts/head') @include('mod-report.title-report')
{{-- ORIGEM--}} {{-- ANALISE--}} {{-- TOTAL--}} {{-- BASE--}} {{-- ORIGEM--}} {{-- ANALISE--}} {{-- TOTAL--}} {{-- BASE--}} {{-- ORIGEM--}} {{-- TOTAL--}} {{-- BASE--}} {{-- FATURADO--}} {{-- PENDENTE--}} {{-- @php dd($record_ranger_responsible); @endphp--}} @php //TOTAL // $record_origin_total = ModOrigin::informationSalesorder([ // 'selectString'=>'idOrigin,idSalesOrder,idUserResponsible' , // // 'idOrigin' => $row->idOrigin, // 'distinct'=>'on', // //'idSalesOrderStatus' => '9,3', //VENDAS REALIZADA // // 'dateRange'=> Request::input('dateRangeEdit'), // 'dateRangeName' => 'clientAcceptedDate,sellerDate',//Data de criação // 'idUserResponsible'=>$record_ranger_responsible, // // 'orderByName'=> 'idUserResponsible', // 'optionList'=>'g', // 'optionListQtt'=>'a', // ]); // // $count_total = count($record_origin_total); @endphp @foreach($record_report as $row) @php //TOTAL $record_origin_subtotal = ModOrigin::informationSalesOrderLast([ 'selectString'=>'idOrigin,idSalesOrder,idUserResponsible' , 'idOrigin' => $row->idOrigin, 'distinct'=>'on', //'idSalesOrderStatus' => '9,3', //VENDAS REALIZADA 'dateRange'=> Request::input('dateRangeEdit'), 'dateRangeName' => 'clientAcceptedDate,sellerDate',//Data de criação 'idUserResponsible'=>$record_ranger_responsible, 'orderByName'=> 'idUserResponsible', 'optionList'=>'g', 'optionListQtt'=>'a', ]); $count_subtotal = count($record_origin_subtotal); $calc_value_pt = 0; $calc_value_rt=0; //FORMA DE PAGAMENTO: EVENTUAL (VENDAS) $record_origin = ModOrigin::informationSalesOrderLast([ 'selectString'=>'idOrigin,idNegotiation,idSalesOrder,idPaymentMethod,idPaymentMethodRecurrent,shippingFee' , 'idOrigin' => $row->idOrigin, 'idSalesOrderStatus' => '9', //VENDAS REALIZADA 'idPaymentMethod'=>1, 'dateRange'=> Request::input('dateRangeEdit'), 'dateRangeName'=>'clientAcceptedDate,sellerDate', 'idUserResponsible'=>$record_ranger_responsible, 'optionList'=>'g', 'optionListQtt'=>'a', ]); $count=count($record_origin); $calc_value=0; foreach ($record_origin as $row_so){ //FORMA DE PAGMTO: PARCELADO $record_method = ModSalesOrderPaymentMethod::paymentMethod('0', $row_so->idSalesOrder); foreach ($record_method as $row_method) { $calc_value += isset($row_method->quotaValue) ? $row_method->quotaValue : 0; } } //FORMA DE PAGAMENTO: EVENTUAL (VENDAS) $record_origin = ModOrigin::informationSalesOrderLast([ 'selectString'=>'idOrigin,idNegotiation,idSalesOrder,idPaymentMethod,idPaymentMethodRecurrent,shippingFee' , 'idOrigin' => $row->idOrigin, 'idSalesOrderStatus' => '3', //PENDENTE 'idPaymentMethod'=>1, 'dateRange'=> Request::input('dateRangeEdit'), 'dateRangeName'=>'clientAcceptedDate,sellerDate', 'idUserResponsible'=>$record_ranger_responsible, 'optionList'=>'g', 'optionListQtt'=>'a', ]); $count_pf=count($record_origin); $calc_value_pf=0; foreach ($record_origin as $row_so){ //FORMA DE PAGMTO: PARCELADO $record_method = ModSalesOrderPaymentMethod::paymentMethod('0', $row_so->idSalesOrder); foreach ($record_method as $row_method) { $calc_value_pf += isset($row_method->quotaValue) ? $row_method->quotaValue : 0; } } //------------------------------------------------------------------------------------ //FORMA DE PAGAMENTO: RECORRENTE $record_origin_r=ModOrigin::informationSalesOrderLast([ 'selectString'=>'idOrigin,idNegotiation,idSalesOrder,idPaymentMethod,idPaymentMethodRecurrent,shippingFee' , 'idOrigin' => $row->idOrigin, 'idSalesOrderStatus' => '9', //VENDAS REALIZADA 'idPaymentMethod'=>2, 'dateRange'=> Request::input('dateRangeEdit'), 'dateRangeName'=>'clientAcceptedDate,sellerDate', 'idUserResponsible'=>$record_ranger_responsible, 'optionList'=>'g', 'optionListQtt'=>'a', ]); $count_r=count($record_origin_r); $calc_value_r=0; foreach ($record_origin_r as $row_so){ $calc_value_r += $row_so->shippingFee; //Escolhe o metodo de pagamento //FORMA DE PAGMTO: RECORRENTE $record_value_rec = ModPaymentMethodRecurrent::information([ 'idSalesOrder' => $row_so->idSalesOrder, 'idStatusReg' => 1, 'sumValue' => 'on', 'groupBy' => 'idSalesOrder', ]); //METODO DE PAGAMENTO:: Se for anual divide por 12x $id_payment_method_recurrent = isset($record_value_rec->idPaymentMethodRecurrent) ? $record_value_rec->idPaymentMethodRecurrent : null; if($id_payment_method_recurrent == 4){ $method_value_r = floatval(isset($record_value_rec->value) ? $record_value_rec->value : 0); $method_value_r = $method_value_r/12; }else{ $method_value_r = floatval(isset($record_value_rec->value) ? $record_value_rec->value : 0); } //VALOR $calc_value_r += $method_value_r; } //------------------------------------------------------------------------------------ //PENDENTE //FORMA DE PAGAMENTO: RECORRENTE $record_origin_pr=ModOrigin::informationSalesOrderLast([ 'selectString'=>'idOrigin,idNegotiation,idSalesOrder,idPaymentMethod,idPaymentMethodRecurrent,shippingFee' , 'idOrigin' => $row->idOrigin, 'idSalesOrderStatus' => '3', //VENDAS REALIZADA 'idPaymentMethod'=>2, 'dateRange'=> Request::input('dateRangeEdit'), 'dateRangeName'=>'clientAcceptedDate,sellerDate', 'idUserResponsible'=>$record_ranger_responsible, 'optionList'=>'g', 'optionListQtt'=>'a', ]); $count_pr=count($record_origin_pr); $calc_value_pr=0; foreach ($record_origin_pr as $row_so){ $calc_value_pr += $row_so->shippingFee; //Escolhe o metodo de pagamento //FORMA DE PAGMTO: RECORRENTE $record_value_rec = ModPaymentMethodRecurrent::information([ 'idSalesOrder' => $row_so->idSalesOrder, 'idStatusReg' => 1, 'sumValue' => 'on', 'groupBy' => 'idSalesOrder', ]); //METODO DE PAGAMENTO:: Se for anual divide por 12x $id_payment_method_recurrent = isset($record_value_rec->idPaymentMethodRecurrent) ? $record_value_rec->idPaymentMethodRecurrent : null; if($id_payment_method_recurrent == 4){ $method_value_pr = floatval(isset($record_value_rec->value) ? $record_value_rec->value : 0); $method_value_pr = $method_value_pr/12; }else{ $method_value_pr = floatval(isset($record_value_rec->value) ? $record_value_rec->value : 0); } //VALOR $calc_value_pr += $method_value_pr; } @endphp @php $id=$row->idOrigin; @endphp {{-- ORIGEM--}} {{-- TOTAL--}} {{-- BASE--}} {{-- FATURADO--}} {{-- PENDENTE--}} {{--INFORMACOES--}} {{-- ORIGEM--}} @endforeach {{-- ORIGEM--}} {{-- ANALISE--}} {{-- TOTAL--}} {{-- FATURADO--}} {{-- PENDENTE--}}
TOTAL
Forma de pagamento
FATURADO PENDENTE
Todas as Propostas Vendas Recorrente Vendas Recorrente Vendas Recorrente
Origem das negociações Qtdd % Qtdd Valor Qtdd Valor Qtdd Valor Qtdd Valor Qtdd Valor Qtdd Valor
{{$row->xName}} {{$count_subtotal}} {{-- {{$count+$count_pf+$count_r+$count_pr}}--}} @php $soma = $count+$count_pf+$count_r+$count_pr; $result=0; if($soma != 0) { // dd($count_subtotal,$soma,$result ); if($count_subtotal != 0) { $result = ModFinancial::porcentagemConvert($soma,$count_subtotal); // $result=$soma*100; // $result=$result/$count_total; } } echo ModFinancial::formatMoney( $result,'pt_BR').'%'; @endphp {{$count+$count_pf}} {{ModFinancial::formatMoney($calc_value+$calc_value_pf,'pt_BR')}} {{$count_r+$count_pr}} {{ModFinancial::formatMoney($calc_value_r+$calc_value_pr,'pt_BR')}} {{$count}} {{ModFinancial::formatMoney($calc_value,'pt_BR')}} {{$count_r}} {{ModFinancial::formatMoney($calc_value_r,'pt_BR')}} {{$count_pf}} {{ModFinancial::formatMoney($calc_value_pf,'pt_BR')}} {{$count_pr}} {{ModFinancial::formatMoney($calc_value_pr,'pt_BR')}}
TOTAL 0 0,0 0 0,0 0 0,0 0 0,0 0 0,0 0 0,0 0 0,0
Descrições
Todas as propostas:
A partir da origem da negociação, lista todas as propostas pelas data do ultimo evento de alteração "Origem"
Total Faturado/Recorrente:
A partir da origem da negociação, lista todas as propostas pelas data de aceite do cliente e da liberação do gerente com a forma de pagamento da proposta Vendas e/ou Recorrente
Total Faturado/Recorrente=faturado/Pendente:
A partir da origem da negociação, lista todas as proposta pelas data de aceite do cliente e da liberação do gerente com a forma de pagamento da proposta Vendas e/ou Recorrente e com os status de pagamento faturado e pendente
Listas de Usuários:
Lista: Os usuários Administradores, Supervisor de Vendas e Vendedores.
Não listar: Usuarios que não tiveram registro de proposta

Descrições dos vendedores
Origem de negociações por vendedores
Lista os vendedores com as respectivas vendas;
@include('system-layouts/footer')