Skip to content

Commit

Permalink
Added get invoice html
Browse files Browse the repository at this point in the history
  • Loading branch information
J. Marcelo Aviles Paco authored and J. Marcelo Aviles Paco committed May 20, 2023
1 parent 80106e7 commit 71ce52e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Classes/MonoInvoicesApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,4 +304,23 @@ public function listadoPuntosVenta(int $sucursal = 0, int $page = 1, int $limit

return $res->json()->data;
}
/**
*
* @param int $id
* @param string $tpl Plantilla de la factura pagina|rollo
* @throws ExceptionApi
* @return mixed
*/
public function obtenerHtml(int $id, $tpl = null)
{
$this->validateToken();
$endpoint = $this->baseUrl . '/invoices/'. $id .'/html';
if( $tpl )
$endpoint .= '?tpl=' . $tpl;

$res = $this->getRequest()->get($endpoint);
if( $res->statusCode != 200 )
throw new ExceptionApi('Error obtiendo el HTML de la factura', $res);
return $res->json();
}
}

0 comments on commit 71ce52e

Please sign in to comment.