/**
  * Execute the job.
  *
  * @return void
  */
 public function handle()
 {
     $archivos = $this->arch;
     if ($archivos && !$archivos->validado) {
         $datos = $archivos->sat;
         if (!$datos) {
             $datos = $archivos->empresa;
         }
         $servidorSat = new ConsultarSat($datos->uuid, $datos->rfc_emisor, $datos->rfc_receptor, $datos->total);
         $servidorSat->hacerPeticion();
     }
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $archivos = Archivos::where('validado', '=', false)->get();
     foreach ($archivos as $arch) {
         if ($arch->validado == true) {
             //puede ser que este archivo ya fue validado en otra cola
             continue;
         }
         $datos = $arch->sat;
         if (!$datos) {
             $datos = $arch->empresa;
         }
         $servidorSat = new ConsultarSat($datos->uuid, $datos->rfc_emisor, $datos->rfc_receptor, $datos->total);
         $resp = $servidorSat->hacerPeticion();
         //s$this->info($resp);
     }
 }
Beispiel #3
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $contribuyentes = Contribuyente::all();
     foreach ($contribuyentes as $contr) {
         $nuevasCanceladas = [];
         $listSat = ArchivoSat::where(function ($q) use($contr) {
             $q->where('rfc_emisor', '=', $contr)->orWhere('rfc_receptor', '=', $contr);
         })->lists('uuid');
         $archivosEmpresa = ArchivoEmpresa::where(function ($q) use($contr) {
             $q->where('rfc_emisor', '=', $contr)->orWhere('rfc_receptor', '=', $contr);
         })->whereNotIn('uuid', $listSat)->get();
         $archivosSat = ArchivoSat::whereIn('uuid', $listSat)->get();
         $archivos = $archivosSat->merge($archivosEmpresa);
         foreach ($archivos as $datos) {
             $servidorSat = new ConsultarSat($datos->uuid, $datos->rfc_emisor, $datos->rfc_receptor, $datos->total);
             $servidorSat->hacerPeticion();
             if ($servidorSat->fueCanceladaRecientemente()) {
                 $nuevasCanceladas[] = array('uuid' => $datos->uuid, 'contribuyente' => $contr->nombre, 'rfc' => $contr->rfc);
             }
         }
     }
 }