Skip to content

Commit

Permalink
Merge pull request #362 from secultce/develop
Browse files Browse the repository at this point in the history
♻️ Alterando logica para fiscais
  • Loading branch information
Junior-Shyko authored Dec 31, 2024
2 parents 88189cd + 5c5faf9 commit 5c9b749
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public function POST_save(): void

$app = App::i();
$registration = $app->repo('Registration')->find($this->data['registration']);

// Consulta se tem diligencia
$isDiligence = $app->repo('Diligence\Entities\Diligence')->findOneBy(['registration' => $this->data['registration']]);

if(is_null($isDiligence) || $isDiligence->open_agent_id == $app->user->profile_id){
// Se não tiver diligencia ou se quem abriu a diligencia é a mesma pessoa logada poderá alterar o registro
if(is_null($isDiligence) || $isDiligence->openAgent->id == $app->user->profile->id){
if (($this->data['idDiligence'] ?: 0) == 0 && (is_null($registration->opportunity->use_multiple_diligence) || $registration->opportunity->use_multiple_diligence === 'Não')) {
$diligences = $app->repo(EntityDiligence::class)->findBy([
'registration' => $registration,
Expand Down Expand Up @@ -73,9 +73,9 @@ public function GET_getcontent(): void
{
$app = App::i();

//ID é o número da inscrição
// ID é o número da inscrição
if (isset($this->data['id'])) {
//Repositorio da Diligencia
// Repositorio da Diligencia
$diligences = $app->repo('Diligence\Entities\Diligence')
->findBy(
['registration' => $this->data['id']],
Expand Down

0 comments on commit 5c9b749

Please sign in to comment.