Factura A111

{{$emisor->nombre_comercial}} FOLIO FISCAL{{$xml["uuid"]}}
FECHA Y HORA DE CERTIFICACIÓN{{$xml["fechatimbrado"]}}
CERTIFICADO SAT{{{$xml["certificadosat"]}}}
CERTIFICADO EMISOR{{$xml["certificadoemisor"]}}
FECHA Y HORA DE EXPEDICION{{$xml["fechaemision"]}}
LUGAR DE EXPEDICION{{$data["factura"]["LugarExpedicion"]}}
TIPO DE DOCUMENTO{{$doc->tipo_cfdi}}
DATOS DEL EMISORDATOS DEL RECEPTOR
{{$emisor->nombre}}
RFC: {{$emisor->rfc}}
{{$serie->calle}} {{$serie->noext}} {{$serie->noint}}
{{$serie->colonia}} {{$serie->localidad}},
{{$serie->municipio}}, {{$serie->estado}}, CP: {{$serie->cp}}
País: {{$emisor->codigoPais}}:{{$emisor->pais}}
Régimen Fiscal:{{$emisor->c_regimen}} {{$emisor->regimen}}
TEL: {{$emisor->telefono}}
CORREO: {{$emisor->correo}}
{{$receptor->nombre}}
RFC: {{$receptor->rfc}}
Uso de CFDi: {{$usoCfdi->clave}} {{$usoCfdi->descripcion}}
Régimen Fiscal: {{$regimenFiscalCliente->c_regimen}} {{$regimenFiscalCliente->descripcion}}

count($request->input("concepto")['descripcion']) @for($i = 0; $i <= count($data->conceptos); $i++) @endfor
CANT. CÓDIGO UNIDAD CLAVE PRODUCTO/SERVICIO CLAVE SAT DESCRIPCIÓN P. UNITARIO DESCUENTO IMPUESTOS IMPORTE
{{$data->conceptos[$i]->cantidad}} {{$data->conceptos[$i]->ID}} {{$data->conceptos[$i]->unidad}} {{$data->conceptos[$i]->ClaveProdServ}} {{$data->conceptos[$i]->ClaveUnidad}} {{$data->conceptos[$i]->descripcion}} {{$data->conceptos[$i]->valorunitario}} {{$data->conceptos[$i]->cantidad}} {{$data->conceptos[$i]->cantidad}} {{$data->conceptos[$i]->importe}}
SUBTOTAL
DESCUENTO #
IVA 16% #
TOTAL IMPUESTOS TRASLADADOS #
TOTAL IMPUESTOS RETENIDOS #
TOTAL #
TOTAL EN LETRA CIENTO DIECISEIS PESOS 00/100 M.N. T.C. 1.00
FORMA DE PAGO #asdsadsa MÉTODO DE PAGO #asdasda
SELLO DIGITAL EMISOR
xxxx
SELLO SAT
xxxx
CADENA ORIGINAL DEL COMPLEMENTO DE CERTIFICACION DIGITAL DEL SAT
xxxxxx

ESTE DOCUMENTO ES UNA REPRESENTACION IMPRESA DE UN CFDI 4.0

Invoice

Factura A111

{{$emisor->nombre_comercial}} FOLIO FISCAL{{$xml["uuid"]}}
FECHA Y HORA DE CERTIFICACIÓN{{$xml["fechatimbrado"]}}
CERTIFICADO SAT{{{$xml["certificadosat"]}}}
CERTIFICADO EMISOR{{$xml["certificadoemisor"]}}
FECHA Y HORA DE EXPEDICION{{$xml["fechaemision"]}}
LUGAR DE EXPEDICION{{$data["factura"]["LugarExpedicion"]}}
TIPO DE DOCUMENTO{{$doc->tipo_cfdi}}
DATOS DEL EMISORDATOS DEL RECEPTOR
{{$emisor->nombre}}
RFC: {{$emisor->rfc}}
{{$serie->calle}} {{$serie->noext}} {{$serie->noint}}
{{$serie->colonia}} {{$serie->localidad}},
{{$serie->municipio}}, {{$serie->estado}}, CP: {{$serie->cp}}
País: {{$emisor->codigoPais}}:{{$emisor->pais}}
Régimen Fiscal:{{$emisor->c_regimen}} {{$emisor->regimen}}
TEL: {{$emisor->telefono}}
CORREO: {{$emisor->correo}}
{{$receptor->nombre}}
RFC: {{$receptor->rfc}}
Uso de CFDi: {{$usoCfdi->clave}} {{$usoCfdi->descripcion}}
Régimen Fiscal: {{$regimenFiscalCliente->c_regimen}} {{$regimenFiscalCliente->descripcion}}

count($request->input("concepto")['descripcion']) @for($i = 1; $i <= count($request->input("concepto")['descripcion']); $i++) @endfor
CANT. CÓDIGO UNIDAD CLAVE PRODUCTO/SERVICIO CLAVE SAT DESCRIPCIÓN P. UNITARIO DESCUENTO IMPUESTOS IMPORTE
{{$request->input("concepto")['cantidad'][$i]}} {{mb_strtoupper($request->input("concepto")['codigo'][$i], 'UTF-8')}} {{mb_strtoupper($request->input("concepto")['unidad'][$i], 'UTF-8')}} {{$request->input("concepto")['productoSat'][$i]}} {{$request->input("concepto")['unidadSat'][$i]}} {{$request->input("concepto")}} * * * *
SUBTOTAL
DESCUENTO #
IVA 16% #
TOTAL IMPUESTOS TRASLADADOS #
TOTAL IMPUESTOS RETENIDOS #
TOTAL #
TOTAL EN LETRA CIENTO DIECISEIS PESOS 00/100 M.N. T.C. 1.00
FORMA DE PAGO #asdsadsa MÉTODO DE PAGO #asdasda
SELLO DIGITAL EMISOR
xxxx
SELLO SAT
xxxx
CADENA ORIGINAL DEL COMPLEMENTO DE CERTIFICACION DIGITAL DEL SAT
xxxxxx

ESTE DOCUMENTO ES UNA REPRESENTACION IMPRESA DE UN CFDI 4.0

public function generateFacturaPDF($timbrado, $xml){ // $this->request = $timbrado->request; // $this->data = $timbrado->datos; // $this->emisor = $timbrado->emisor; // $this->serie = $timbrado->serie; // $this->receptor = $timbrado->receptor; // $this->xml = $xml; // $this->doc = $timbrado->doc; // $idPersona = $this->request->input('factura')['cliente']; // $this->regimenFiscalCliente = PersonaClienteProveedor::getRegimenFiscal($idPersona); // Log::info('ID PERSONA 2: '. $idPersona); // Log::info('REGIMEN FISCAL DEL CLIENTE 2: '); // Log::info($this->regimenFiscalCliente); // if ($this->emisor->logo == null) // $this->urlLogo = \URL::to('/') . '/img/logo.png'; // else // $this->urlLogo = $this->receptor->usar_alternativo == '1' ? \URL::to('/') . '/../storage/app/' . $this->emisor->logo_alternativo : \URL::to('/') . '/../storage/app/' . $this->emisor->logo; // $urlPdf = 'clientes/' . $this->emisor->id_usuario . '/facturas/' . $this->data["factura"]["serie"] . $this->data["factura"]["folio"] . '.pdf'; // // PDF::Output(storage_path() . '/app/clientes/' . $this->emisor->id_usuario . '/facturas/' . $this->data["factura"]["serie"] . $this->data["factura"]["folio"] . '.pdf', 'F'); // // PDF::reset(); // // $this->urlPdf = 'clientes/' . $this->emisor->id_usuario . '/facturas/' . $this->data["factura"]["serie"] . $this->data["factura"]["folio"] . '.pdf'; // // $this->urlXml = 'clientes/' . $this->emisor->id_usuario . '/facturas/' . $this->data["factura"]["serie"] . $this->data["factura"]["folio"] . '.xml'; // // dd($this->request->input("concepto")['descripcion']); // $pdf = PDF::loadView('pdfs.factura', [ // 'request' => $this->request, // 'data' => $this->data, // 'emisor' => $this->emisor, // 'serie' => $this->serie, // 'receptor' => $this->receptor, // 'xml' => $this->xml, // 'doc' => $this->doc, // 'regimenFiscalCliente' =>$this->regimenFiscalCliente, // ]); // $pdfStorage = Storage::put('app/'.$urlPdf, $pdf->output()); // dd("Ok"); // dd($timbrado->datos->input('receptor')); $objeto = json_decode(json_encode($timbrado->datos)); // dd(gettype($objeto)); // dd($objeto->conceptos); // $this->request = $timbrado->request; // $this->data = json_decode(json_encode($timbrado->datos)); $this->request = $timbrado->request; $this->data = $timbrado->datos; $this->emisor = $timbrado->emisor; $this->serie = $timbrado->serie; $this->receptor = $timbrado->receptor; $this->xml = $xml; $this->doc = $timbrado->doc; $idPersona = $this->request->input('factura')['cliente']; // $idPersona = 44603; $this->regimenFiscalCliente = PersonaClienteProveedor::getRegimenFiscal($idPersona); Log::info('ID PERSONA 2: '. $idPersona); Log::info('REGIMEN FISCAL DEL CLIENTE 2: '); Log::info($this->regimenFiscalCliente); if ($this->emisor->logo == null) $this->urlLogo = \URL::to('/') . '/img/logo.png'; else $this->urlLogo = $this->receptor->usar_alternativo == '1' ? \URL::to('/') . '/../storage/app/' . $this->emisor->logo_alternativo : \URL::to('/') . '/../storage/app/' . $this->emisor->logo; $urlPdf = 'clientes/' . $this->emisor->id_usuario . '/facturas/' . $this->data["factura"]["serie"] . $this->data["factura"]["folio"] ; // PDF::Output(storage_path() . '/app/clientes/' . $this->emisor->id_usuario . '/facturas/' . $this->data["factura"]["serie"] . $this->data["factura"]["folio"] . '.pdf', 'F'); // PDF::reset(); // $this->urlPdf = 'clientes/' . $this->emisor->id_usuario . '/facturas/' . $this->data["factura"]["serie"] . $this->data["factura"]["folio"] . '.pdf'; // $this->urlXml = 'clientes/' . $this->emisor->id_usuario . '/facturas/' . $this->data["factura"]["serie"] . $this->data["factura"]["folio"] . '.xml'; // dd($this->request->input("concepto")['descripcion']); $datosss= json_encode($timbrado->datos) ; $file_path = storage_path('app/'.$urlPdf.'datos.txt'); // Ruta completa al archivo file_put_contents($file_path, $datosss); dd($datosss); dd([ 'request' => $this->request, 'data' => $this->data, 'emisor' => $this->emisor, 'serie' => $this->serie, 'receptor' => $this->receptor, 'xml' => $this->xml, 'doc' => $this->doc, 'regimenFiscalCliente' =>$this->regimenFiscalCliente, ]); $pdf = PDF::loadView('pdfs.factura', [ 'request' => $this->request, 'data' => $this->data, 'emisor' => $this->emisor, 'serie' => $this->serie, 'receptor' => $this->receptor, 'xml' => $this->xml, 'doc' => $this->doc, 'regimenFiscalCliente' =>$this->regimenFiscalCliente, ]); $pdfStorage = Storage::put('app/'.$urlPdf, $pdf->output()); dd("Ok"); }