42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
if (!defined('_PS_VERSION_')) {
|
|
exit;
|
|
}
|
|
|
|
class O2wFacturas extends Module
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this->name = 'o2wfacturas';
|
|
$this->tab = 'billing_invoicing';
|
|
$this->version = '1.0.0';
|
|
$this->author = 'Kaloyan - O2W';
|
|
$this->bootstrap = true;
|
|
|
|
parent::__construct();
|
|
|
|
$this->displayName = $this->l('O2W Facturas ERP');
|
|
$this->description = $this->l('Añade un botón en los detalles del pedido para descargar la factura del ERP.');
|
|
}
|
|
|
|
public function install()
|
|
{
|
|
return parent::install() && $this->registerHook('displayOrderDetail');
|
|
}
|
|
|
|
public function uninstall()
|
|
{
|
|
return parent::uninstall();
|
|
}
|
|
|
|
public function hookDisplayOrderDetail($params)
|
|
{
|
|
$url_erp = 'https://demo.erp.one/public/ventas/facturas/e03bbecc-0512-4281-92ac-2d80843deed6';
|
|
|
|
$this->context->smarty->assign(array(
|
|
'url_factura_erp' => $url_erp
|
|
));
|
|
|
|
return $this->display(__FILE__, 'views/templates/hook/boton_factura.tpl');
|
|
}
|
|
} |