@php
use App\Http\Controllers\Mod\ModNegotiation;use App\Http\Controllers\Mod\ModNegotiationProposal;use App\Http\Controllers\Mod\ModPaymentMethod;use App\Http\Controllers\Mod\ModSalesOrder;use App\Http\Controllers\Mod\ModSalesOrderViewsDescriptionSeller;use App\Models\Profile;use Illuminate\Support\Facades\Crypt;
$profile=Profile::user();
$datacriacao = 0;
$record_sec_count=count($record_sec);
$record_negotiation = isset($record_negotiation)?$record_negotiation:$record;
@endphp
@if($record_sec_count < 0)
@php
$record_sec=ModSalesOrder::informationSimple([
'idNegotiation' => $record_negotiation->idNegotiation,
'orderBy'=>'orderByDesc',
'idStatusEye'=>1,
'optionList' => 'p',
'optionListQtt'=>'20',
]);
$s='';
if($record_sec->total() > 1){
$s='s';
}
@endphp
Proposta não encontrada
Dica: Há {{$record_sec->total()}}
Proposta{{$s}} Oculta{{$s}}
desta negociação.
@else
@foreach($record_sec as $row_proposal)
@php
$debug=isset($debug)?$debug:null;
$row_proposal = isset($row_proposal)?$row_proposal:null;
if($debug=='on'){
dump($row_proposal);
}
$id_salesorder = isset($row_proposal->idSalesOrder)?$row_proposal->idSalesOrder:null;
$id_status_rating = isset($row_proposal->idStatusRating)?$row_proposal->idStatusRating:null;
//--------------------------------------------------------------------------------------------------------------
//TAREFAS: PROPOSTA
//USUARIO: CLASSIFICAÇÃO: DEV
// if($profile->idGroup <= 4 ){
// $row_proposal = ModSalesOrder::informationSimple([
// 'idSalesOrder'=>$id_salesorder,
// 'idUserResponsible'=>$profile->idUser,
// ]);
//
// dump('DEV');
// }else{
// $row_proposal = ModSalesOrder::informationSimple([
// 'idSalesOrder'=>$id_salesorder,
// ]);
// }
// dump($record_task);
// if($row_proposal==null){
// dump('ADM/Gerente/Vendedor');
// dd($row_proposal);
// }
// $record_negotiation = ModNegotiation::informationAll([
// 'selectString'=> 'relationshipDays,relationshipDate',
// 'idNegotiation'=>$row_proposal->idNegotiation,
// ]);
//--------------------------------------------------------------------------------------------------------------
//STATUS: PEDIDO DE TESTE
$record_status = ModSalesOrder::statusTest($row_proposal->idSalesOrder);
//--------------------------------------------------------------------------------------------------------------
//FORMA DE PAGAMENTO
$id_payment_method = isset($row_proposal->idPaymentMethod)?$row_proposal->idPaymentMethod:null;
$payment = null;
if($id_payment_method !==null){
$record_payment = ModPaymentMethod::status($id_payment_method);
$payment = $record_payment->xName;
}
//--------------------------------------------------------------------------------------------------------------
// QUANTIDADE DE PROPOSTA VISUALIZADA
$record_proposal_view = ModNegotiationProposal::informationEvent([
'selectString' => 'created_at,idSalesOrderProposalStatusEvent,idSalesOrder',
'idSalesOrder' => $id_salesorder,
'idAction' => '27',
'optionList' => 'g',
'optionListQtt' => 'a',
]);
$record_proposal_view = isset($record_proposal_view) ? $record_proposal_view : null;
//--------------------------------------------------------------------------------------------------------------
//MENSAGENS INTERNA
$record_description_seller = ModSalesOrderViewsDescriptionSeller::information([
'selectString' => 'created_at,idSalesOrderDescriptionSeller,idSalesOrder',
'idSalesOrder'=>$id_salesorder,
'optionList' => 'g',
'optionListQtt' => 'a',
]);
$record_description_seller = isset($record_description_seller)?$record_description_seller:null;
//EDITAR HERANÇA
if($row_proposal->xValue == null){
//ATUALIZA O VALOR TOTAL DA PROPOSTA
$record_value = ModSalesOrder::xValue(['idSalesOrder'=>$row_proposal->idSalesOrder]);
$row_proposal->xValue = $record_value->total;
}
$idRating=10;
$id_salesorder = $row_proposal->idSalesOrder;
@endphp
@php($record_payment = ModPaymentMethod::status($row_proposal->idPaymentMethod))
{{-- ACESSO AS FERRAMENTAS DA NEGOCIACAO --}}
@if( ModNegotiation::accessTool([
'idUserResponsible'=>$record_negotiation->idUserResponsible,
'idUserResponsibleClient'=>$row_proposal->idUserResponsibleClient,
'idUserResponsibleAssistant'=> $record_negotiation->idUserResponsibleAssistant,
]) == 1)
@include('mod-negotiation.index-proposal-menu')
@else
@endif
@include('mod-negotiation.index-proposal-conterner')
@include('mod-negotiation.index-proposal-status')
@endforeach
@if(count($record_sec)==0)
Nenhuma proposta foi encontrada.
Dica:
A proposta pode estar oculdada, clique na ferramenta do canto esquerdo da negociação:
@endif
@if(count($record_sec)>=5)
@endif
@include('mod-negotiation.script_proposal')
@endif