Open
Description
Type this method
public function createInvoice(): \stdClass
{
/* @var Wsfe $invoice */
$invoice = $this->getAfipWsClass();
$invoice->datos = $this->data;
$result = $invoice->createInvoice();
if ($this->ws === AfipWebServiceLocal::WSMTXCA) {
$comprobanteResponse = $result->comprobanteResponse;
} else {
$comprobanteResponse = $result;
}
$comprobanteResponse->{'observation'} = '';
if (isset($result->arrayObservaciones)) {
$observation = array_map(function ($o) {
return $o->descripcion;
}, (array) $result->arrayObservaciones);
$comprobanteResponse->{'observation'} = json_encode($observation['codigoDescripcion']);
}
return $comprobanteResponse;
}
Y las propiedes utlizadas son
if ($this->ws === 'wsfe') {
return [
'receipt_number' => $comprobanteResponse->CbteDesde,
'cae' => $comprobanteResponse->CAE,
'cae_expiration_date' => $comprobanteResponse->CAEFchVto,
];
}
/* wsmtxca */
return [
'receipt_volume' => $comprobanteResponse->numeroPuntoVenta,
'receipt_number' => $comprobanteResponse->numeroComprobante,
'cae' => $comprobanteResponse->CAE,
'cae_expiration_date' => $comprobanteResponse->fechaVencimientoCAE,
'fiscal_observation' => $comprobanteResponse->observation,
];
Dar acceso a la info original?