public function complemento()
 {
     return CfdiComplemento::whereRaw("cfdi_id = {$this->id}")->first();
 }
Exemple #2
0
 public function xml()
 {
     $cfdi_id = $this->cfdi->id;
     if (CfdiComplemento::whereRaw("cfdi_id = {$cfdi_id}")->count() == 0) {
         return $this->xml->getXML();
     } else {
         return file_get_contents($this->path . "/" . strtoupper($this->cfdi->uuid()) . ".xml");
     }
 }