Example #1
0
 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     $generator = new \App\Droit\Generate\Pdf\PdfGenerator();
     $register = \App::make('App\\Droit\\Inscription\\Repo\\InscriptionInterface');
     $this->groupe->load('colloque', 'user');
     $user = $this->groupe->user;
     $user->load('adresses');
     $this->groupe->setAttribute('adresse_facturation', $user->adresse_facturation);
     $annexes = $this->groupe->colloque->annexe;
     $inscriptions = $register->getByGroupe($this->groupe->id);
     // Generate annexes if any
     if (!$inscriptions->isEmpty()) {
         foreach ($inscriptions as $inscription) {
             if (!empty($annexes)) {
                 $generator->setInscription($inscription)->generate($annexes);
             }
         }
     }
     $generator->factureGroupeEvent($this->groupe, $inscriptions, $inscriptions->first()->price->price);
     $generator->bvGroupeEvent($this->groupe, $inscriptions, $inscriptions->first()->price->price);
 }