xml service

This commit is contained in:
amazuecos
2024-08-12 08:02:14 +02:00
parent a91685747c
commit 5648f43413
4 changed files with 199 additions and 10 deletions

View File

@ -5,7 +5,7 @@ use App\Controllers\BaseController;
use App\Entities\Pedidos\PedidoEntity;
use App\Models\Collection;
use App\Models\Pedidos\PedidoModel;
use App\Services\PedidoXMLService;
class Pedido extends \App\Controllers\BaseResourceController
{
@ -21,7 +21,6 @@ class Pedido extends \App\Controllers\BaseResourceController
protected $indexRoute = 'pedidoList';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
$this->viewData['pageTitle'] = lang('Pedidos.moduleTitle');
@ -327,5 +326,13 @@ class Pedido extends \App\Controllers\BaseResourceController
$pedidoEntity->fecha_encuadernado_text = $pedidoEntity->fecha_encuadernado ? date('d/m/Y', strtotime($pedidoEntity->fecha_encuadernado)) : '';
$pedidoEntity->fecha_entrega_externo_text = $pedidoEntity->fecha_entrega_externo ? date('d/m/Y', strtotime($pedidoEntity->fecha_entrega_externo)) : '';
}
public function get_xml_pedido($pedido_id)
{
$data_pedido = $this->model->getPedidoClientePresupuesto($pedido_id);
$data_pedido_presupuesto = $this->model->getPedidoPresupuestoLineas($pedido_id);
// PedidoXMLService::generate_xml($data);
// $xml_service = new PedidoXMLService($this->model);
return $this->respond(["pedido_presupuesto" => $data_pedido,"pedido_presupuesto_linea" => $data_pedido_presupuesto]);
}
}