mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into fix/ot-tareas-table-fk
This commit is contained in:
@ -330,7 +330,7 @@ $routes->group('maquinas', ['namespace' => 'App\Controllers\Configuracion'], fun
|
|||||||
$routes->post('allmenuitems', 'Maquinas::allItemsSelect', ['as' => 'select2ItemsOfMaquinas']);
|
$routes->post('allmenuitems', 'Maquinas::allItemsSelect', ['as' => 'select2ItemsOfMaquinas']);
|
||||||
$routes->post('menuitems', 'Maquinas::menuItems', ['as' => 'menuItemsOfMaquinas']);
|
$routes->post('menuitems', 'Maquinas::menuItems', ['as' => 'menuItemsOfMaquinas']);
|
||||||
$routes->post('duplicate/(:num)', 'Maquinas::duplicate/$1', ['as' => 'duplicateMaquina']);
|
$routes->post('duplicate/(:num)', 'Maquinas::duplicate/$1', ['as' => 'duplicateMaquina']);
|
||||||
|
$routes->get('(:num)','Maquinas::find_maquina/$1',['as' => 'findMaquina']);
|
||||||
$routes->get('select', 'Maquinas::select', ['as' => 'selectMaquinas']);
|
$routes->get('select', 'Maquinas::select', ['as' => 'selectMaquinas']);
|
||||||
});
|
});
|
||||||
$routes->resource('maquinas', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Maquinas', 'except' => 'show,new,create,update']);
|
$routes->resource('maquinas', ['namespace' => 'App\Controllers\Configuracion', 'controller' => 'Maquinas', 'except' => 'show,new,create,update']);
|
||||||
@ -659,6 +659,9 @@ $routes->group('presupuestoadmin', ['namespace' => 'App\Controllers\Presupuestos
|
|||||||
$routes->get('maquinas', 'Presupuestoadmin::getMaquinas');
|
$routes->get('maquinas', 'Presupuestoadmin::getMaquinas');
|
||||||
$routes->post('getlinea', 'Presupuestoadmin::getLineaPresupuesto');
|
$routes->post('getlinea', 'Presupuestoadmin::getLineaPresupuesto');
|
||||||
$routes->post('clone', 'Presupuestoadmin::datatable_2');
|
$routes->post('clone', 'Presupuestoadmin::datatable_2');
|
||||||
|
|
||||||
|
$routes->get('presupuestosCliente', 'Presupuestoadmin::tablaClienteForm');
|
||||||
|
$routes->get('getSumCliente/(:num)', 'Presupuestoadmin::obtenerTotalPresupuestosCliente/$1');
|
||||||
});
|
});
|
||||||
$routes->resource('presupuestoadmin', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestoadmin', 'except' => 'show,new,create,update']);
|
$routes->resource('presupuestoadmin', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestoadmin', 'except' => 'show,new,create,update']);
|
||||||
|
|
||||||
@ -757,6 +760,8 @@ $routes->group('pedidos', ['namespace' => 'App\Controllers\Pedidos'], function (
|
|||||||
$routes->post('insertfactura', 'Pedido::addFactura');
|
$routes->post('insertfactura', 'Pedido::addFactura');
|
||||||
$routes->get('xml/(:num)', 'Pedido::get_xml_pedido/$1', ['as' => 'getXMLPedido']);
|
$routes->get('xml/(:num)', 'Pedido::get_xml_pedido/$1', ['as' => 'getXMLPedido']);
|
||||||
$routes->post('produccion/(:num)', 'Pedido::to_produccion/$1', ['as' => 'toProduccion']);
|
$routes->post('produccion/(:num)', 'Pedido::to_produccion/$1', ['as' => 'toProduccion']);
|
||||||
|
$routes->get('pedidosCliente', 'Pedido::tablaClienteForm');
|
||||||
|
$routes->get('getSumCliente/(:num)', 'Pedido::obtenerTotalPedidosCliente/$1');
|
||||||
});
|
});
|
||||||
$routes->resource('pedidos', ['namespace' => 'App\Controllers\Pedidos', 'controller' => 'Pedido', 'except' => 'show,new,create,update']);
|
$routes->resource('pedidos', ['namespace' => 'App\Controllers\Pedidos', 'controller' => 'Pedido', 'except' => 'show,new,create,update']);
|
||||||
|
|
||||||
@ -797,6 +802,7 @@ $routes->group('facturas', ['namespace' => 'App\Controllers\Facturacion'], funct
|
|||||||
$routes->post('datatablePagos/(:any)', 'FacturasPagos::datatable/$1', ['as' => 'dataTableOfPagosFacturas']);
|
$routes->post('datatablePagos/(:any)', 'FacturasPagos::datatable/$1', ['as' => 'dataTableOfPagosFacturas']);
|
||||||
$routes->post('editorPagos', 'FacturasPagos::datatable_editor', ['as' => 'editorOfPagosFacturas']);
|
$routes->post('editorPagos', 'FacturasPagos::datatable_editor', ['as' => 'editorOfPagosFacturas']);
|
||||||
$routes->post('datatablePedidos', 'Facturas::datatablePedidos', ['as' => 'dataTableOfFacturasPedido']);
|
$routes->post('datatablePedidos', 'Facturas::datatablePedidos', ['as' => 'dataTableOfFacturasPedido']);
|
||||||
|
$routes->get('getdatoscliente/(:any)', 'Facturas::getDatosFacturacionClienteForm/$1');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -992,6 +998,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
|||||||
$routes->post("update/user", 'Ordentrabajo::update_orden_trabajo_user');
|
$routes->post("update/user", 'Ordentrabajo::update_orden_trabajo_user');
|
||||||
$routes->post("update", 'Ordentrabajo::update_orden_trabajo');
|
$routes->post("update", 'Ordentrabajo::update_orden_trabajo');
|
||||||
$routes->post("upload/portada", 'Ordentrabajo::upload_orden_trabajo_portada');
|
$routes->post("upload/portada", 'Ordentrabajo::upload_orden_trabajo_portada');
|
||||||
|
$routes->delete("portada/(:num)", 'Ordentrabajo::delete_orden_trabajo_portada/$1');
|
||||||
|
|
||||||
/**======================
|
/**======================
|
||||||
* PDF
|
* PDF
|
||||||
@ -999,11 +1006,17 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
|||||||
$routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1');
|
$routes->get('pdf/(:num)', 'Ordentrabajo::get_pdf/$1');
|
||||||
$routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1');
|
$routes->get('portada/(:num)', 'Ordentrabajo::get_portada_img/$1');
|
||||||
$routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
$routes->group('planning', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
||||||
|
$routes->get('select/maquina/rotativa','Ordentrabajo::select_maquina_planning_rot');
|
||||||
|
$routes->get('select/papel/rotativa','Ordentrabajo::select_papel_planning_rot');
|
||||||
|
$routes->get('select/maquina/plana','Ordentrabajo::select_maquina_planning_plana');
|
||||||
|
$routes->get('select/papel/plana','Ordentrabajo::select_papel_planning_plana');
|
||||||
$routes->get('rotativa', 'Ordentrabajo::index_planning_rotativa');
|
$routes->get('rotativa', 'Ordentrabajo::index_planning_rotativa');
|
||||||
$routes->get('papel/datatable', 'Ordentrabajo::papel_gramaje_datatable');
|
$routes->get('papel/datatable', 'Ordentrabajo::papel_gramaje_datatable');
|
||||||
$routes->get('papel/plana/datatable', 'Ordentrabajo::papel_pliego_datatable');
|
$routes->get('papel/plana/datatable', 'Ordentrabajo::papel_pliego_datatable');
|
||||||
$routes->get('rotativa/datatable', 'Ordentrabajo::planning_rotativa_datatable');
|
$routes->get('rotativa/datatable', 'Ordentrabajo::planning_rotativa_datatable');
|
||||||
$routes->get('plana/datatable', 'Ordentrabajo::planning_plana_datatable');
|
$routes->get('plana/datatable', 'Ordentrabajo::planning_plana_datatable');
|
||||||
|
$routes->post('tarea/toggle/corte/(:num)', 'Ordentrabajo::tarea_toggle_corte/$1');
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -363,6 +363,7 @@ class Maquinas extends \App\Controllers\BaseResourceController
|
|||||||
$r = $this->model->getSelectQuery($this->request->getGet("q"));
|
$r = $this->model->getSelectQuery($this->request->getGet("q"));
|
||||||
return $this->response->setJSON($r);
|
return $this->response->setJSON($r);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getMaquinaListItems($selId = null)
|
protected function getMaquinaListItems($selId = null)
|
||||||
{
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Maquinas.maquina'))])];
|
||||||
@ -402,5 +403,9 @@ class Maquinas extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public function find_maquina(int $maquina_id){
|
||||||
|
$maquinaEntity = $this->model->find($maquina_id);
|
||||||
|
return $this->response->setJSON($maquinaEntity);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -236,13 +236,16 @@ class Facturas extends \App\Controllers\BaseResourceController
|
|||||||
public function datatable()
|
public function datatable()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$dataForClienteForm = false;
|
||||||
if (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) {
|
if (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) {
|
||||||
// Se obtiene el cliente ID a partir del usuario de la sesion
|
// Se obtiene el cliente ID a partir del usuario de la sesion
|
||||||
$model_user = model('App\Models\Usuarios\UserModel');
|
$model_user = model('App\Models\Usuarios\UserModel');
|
||||||
$user = $model_user->find(auth()->user()->id);
|
$user = $model_user->find(auth()->user()->id);
|
||||||
$clienteId = $user->cliente_id;
|
$clienteId = $user->cliente_id;
|
||||||
} else {
|
} else {
|
||||||
$clienteId = -1;
|
$temp = $this->request->getGet('cliente_id');
|
||||||
|
$clienteId = ($temp && $temp != null && $temp != "") ? $temp : -1;
|
||||||
|
$dataForClienteForm = ($temp && $temp != null && $temp != "") ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$model = model(FacturaModel::class);
|
$model = model(FacturaModel::class);
|
||||||
@ -342,8 +345,10 @@ class Facturas extends \App\Controllers\BaseResourceController
|
|||||||
if ($clienteId != -1) {
|
if ($clienteId != -1) {
|
||||||
$result->hide('cliente');
|
$result->hide('cliente');
|
||||||
$result->hide('creditoAsegurado');
|
$result->hide('creditoAsegurado');
|
||||||
$result->hide('estado');
|
if(!$dataForClienteForm){
|
||||||
$result->hide('estado_pago');
|
$result->hide('estado');
|
||||||
|
$result->hide('estado_pago');
|
||||||
|
}
|
||||||
$result->hide('forma_pago');
|
$result->hide('forma_pago');
|
||||||
$result->hide('vencimiento');
|
$result->hide('vencimiento');
|
||||||
$result->hide('dias_vencimiento');
|
$result->hide('dias_vencimiento');
|
||||||
@ -352,6 +357,11 @@ class Facturas extends \App\Controllers\BaseResourceController
|
|||||||
return $result->toJson(returnAsObject: true);
|
return $result->toJson(returnAsObject: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDatosFacturacionClienteForm($cliente_id){
|
||||||
|
|
||||||
|
return $this->respond($this->model->getSumatoriosFacturacionCliente($cliente_id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function datatablePedidos()
|
public function datatablePedidos()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -8,6 +8,8 @@ use App\Models\Collection;
|
|||||||
use App\Models\Pedidos\PedidoModel;
|
use App\Models\Pedidos\PedidoModel;
|
||||||
use App\Services\PedidoXMLService;
|
use App\Services\PedidoXMLService;
|
||||||
use App\Services\ProductionService;
|
use App\Services\ProductionService;
|
||||||
|
use Hermawan\DataTables\DataTable;
|
||||||
|
use CodeIgniter\I18n\Time;
|
||||||
|
|
||||||
class Pedido extends \App\Controllers\BaseResourceController
|
class Pedido extends \App\Controllers\BaseResourceController
|
||||||
{
|
{
|
||||||
@ -34,6 +36,7 @@ class Pedido extends \App\Controllers\BaseResourceController
|
|||||||
$this->viewData['breadcrumb'] = [
|
$this->viewData['breadcrumb'] = [
|
||||||
['title' => lang("App.menu_pedidos"), 'route' => "javascript:void(0);", 'active' => false],
|
['title' => lang("App.menu_pedidos"), 'route' => "javascript:void(0);", 'active' => false],
|
||||||
];
|
];
|
||||||
|
helper("time");
|
||||||
|
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
|
|
||||||
@ -371,6 +374,96 @@ class Pedido extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function tablaClienteForm()
|
||||||
|
{
|
||||||
|
|
||||||
|
$clienteId = $this->request->getGet('cliente_id') ?? -1;
|
||||||
|
|
||||||
|
$q = $this->model->getPedidosClienteForm($clienteId);
|
||||||
|
|
||||||
|
$searchValue = $this->request->getGet('fecha') ?? '';
|
||||||
|
if (!empty($searchValue)) {
|
||||||
|
// Extraer las fechas del formato "YYYY-MM-DD|YYYY-MM-DD"
|
||||||
|
$dates = explode('|', $searchValue);
|
||||||
|
if (count($dates) == 2) {
|
||||||
|
$q->where('p.created_at >=', $dates[0] . ' 00:00:00')
|
||||||
|
->where('p.created_at <=', $dates[1] . ' 23:59:59');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$searchValue = $this->request->getGet('fecha_entrega') ?? '';
|
||||||
|
if (!empty($searchValue)) {
|
||||||
|
// Extraer las fechas del formato "YYYY-MM-DD|YYYY-MM-DD"
|
||||||
|
$dates = explode('|', $searchValue);
|
||||||
|
if (count($dates) == 2) {
|
||||||
|
$q->where('p.fecha_entrega_real >=', $dates[0] . ' 00:00:00')
|
||||||
|
->where('p.fecha_entrega_real <=', $dates[1] . ' 23:59:59');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$result = DataTable::of($q)
|
||||||
|
->edit(
|
||||||
|
'fecha',
|
||||||
|
fn($q) => $q->fecha?Time::createFromFormat("Y-m-d H:i:s", $q->fecha)->format("d/m/Y"):""
|
||||||
|
)
|
||||||
|
->edit(
|
||||||
|
'fecha_entrega',
|
||||||
|
fn($q) => $q->fecha_entrega?Time::createFromFormat("Y-m-d H:i:s", $q->fecha_entrega)->format("d/m/Y"):""
|
||||||
|
)
|
||||||
|
->edit(
|
||||||
|
"estado",
|
||||||
|
function ($row, $meta) {
|
||||||
|
switch ($row->estado) {
|
||||||
|
case "validacion":
|
||||||
|
return lang('Pedidos.validacion');
|
||||||
|
case "produccion":
|
||||||
|
return lang('Pedidos.produccion');
|
||||||
|
case "finalizado":
|
||||||
|
return lang('Pedidos.finalizado');
|
||||||
|
case "enviado":
|
||||||
|
return lang('Pedidos.enviado');
|
||||||
|
case "cancelado":
|
||||||
|
return lang('Pedidos.cancelado');
|
||||||
|
default:
|
||||||
|
return '--'; // Debug
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
->add("action", callback: function ($q) {
|
||||||
|
return '
|
||||||
|
<div class="btn-group btn-group-sm">
|
||||||
|
<a href="javascript:void(0);"><i class="ti ti-eye ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return $result->toJson(returnAsObject: true) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function obtenerTotalPedidosCliente($cliente_id){
|
||||||
|
|
||||||
|
$error = false;
|
||||||
|
$result = [
|
||||||
|
'total_impresion' => 0,
|
||||||
|
'total_maquetacion' => 0,
|
||||||
|
];
|
||||||
|
$data = $this->model
|
||||||
|
->where('presupuestos.cliente_id', $cliente_id)->whereNotIn('pedidos.estado', ['cancelado'])
|
||||||
|
->select('SUM(pedidos.total_precio) as total')
|
||||||
|
->join('pedidos_linea', 'pedidos_linea.pedido_id = pedidos.id')
|
||||||
|
->join('presupuestos', 'presupuestos.id = pedidos_linea.presupuesto_id')
|
||||||
|
->groupBy('presupuestos.cliente_id')->get()->getResultObject();
|
||||||
|
if(count($data) > 0){
|
||||||
|
$result['total_impresion'] = round(floatval($data[0]->total), 2);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$error = true;
|
||||||
|
}
|
||||||
|
$result['total'] = $result['total_impresion'] + $result['total_maquetacion'];
|
||||||
|
return $this->respond(['status' => $error?'error':'success', 'totales' => $result]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function obtenerPedidosForFacturas(){
|
public function obtenerPedidosForFacturas(){
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|||||||
@ -20,6 +20,8 @@ use App\Models\Presupuestos\PresupuestoPreimpresionesModel;
|
|||||||
use App\Models\Presupuestos\PresupuestoServiciosExtraModel;
|
use App\Models\Presupuestos\PresupuestoServiciosExtraModel;
|
||||||
use App\Services\PresupuestoService;
|
use App\Services\PresupuestoService;
|
||||||
use App\Services\PresupuestoClienteService;
|
use App\Services\PresupuestoClienteService;
|
||||||
|
use Hermawan\DataTables\DataTable;
|
||||||
|
use CodeIgniter\I18n\Time;
|
||||||
use Exception;
|
use Exception;
|
||||||
|
|
||||||
class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||||
@ -1684,6 +1686,91 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function tablaClienteForm()
|
||||||
|
{
|
||||||
|
|
||||||
|
$clienteId = $this->request->getGet('cliente_id') ?? -1;
|
||||||
|
|
||||||
|
$q = $this->model->getPresupuestosClienteForm($clienteId);
|
||||||
|
|
||||||
|
$searchValue = $this->request->getGet('fecha') ?? '';
|
||||||
|
if (!empty($searchValue)) {
|
||||||
|
// Extraer las fechas del formato "YYYY-MM-DD|YYYY-MM-DD"
|
||||||
|
$dates = explode('|', $searchValue);
|
||||||
|
if (count($dates) == 2) {
|
||||||
|
$q->where('p.created_at >=', $dates[0] . ' 00:00:00')
|
||||||
|
->where('p.created_at <=', $dates[1] . ' 23:59:59');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = DataTable::of($q)
|
||||||
|
->edit(
|
||||||
|
'fecha',
|
||||||
|
fn($q) => $q->fecha?Time::createFromFormat("Y-m-d H:i:s", $q->fecha)->format("d/m/Y"):""
|
||||||
|
)
|
||||||
|
->edit(
|
||||||
|
'estado', fn($q) => match ($q->estado) {
|
||||||
|
"1" => lang('Presupuestos.borrador'),
|
||||||
|
"2" => lang('Presupuestos.confirmado'),
|
||||||
|
default => '--'
|
||||||
|
}
|
||||||
|
)->add("action", callback: function ($q) {
|
||||||
|
return '
|
||||||
|
<div class="btn-group btn-group-sm">
|
||||||
|
<a href="javascript:void(0);"><i class="ti ti-eye ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return $result->toJson(returnAsObject: true) ;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function obtenerTotalPresupuestosCliente($cliente_id){
|
||||||
|
|
||||||
|
$error = false;
|
||||||
|
$result = [
|
||||||
|
'total_impresion' => 0,
|
||||||
|
'total_maquetacion' => 0,
|
||||||
|
];
|
||||||
|
$data = $this->model
|
||||||
|
->where('presupuestos.cliente_id', $cliente_id)
|
||||||
|
->select('SUM(presupuestos.total_aceptado) as total')
|
||||||
|
->groupBy('presupuestos.cliente_id')->get()->getResultObject();
|
||||||
|
if(count($data) > 0){
|
||||||
|
$result['total_impresion'] = round(floatval($data[0]->total), 2);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$error = true;
|
||||||
|
}
|
||||||
|
$result['total'] = $result['total_impresion'] + $result['total_maquetacion'];
|
||||||
|
return $this->respond(['status' => $error?'error':'success', 'totales' => $result]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function obtenerTotalPedidosCliente($cliente_id){
|
||||||
|
|
||||||
|
$error = false;
|
||||||
|
$result = [
|
||||||
|
'total_impresion' => 0,
|
||||||
|
'total_maquetacion' => 0,
|
||||||
|
];
|
||||||
|
$data = $this->model
|
||||||
|
->where('presupuestos.cliente_id', $cliente_id)->whereNotIn('pedidos.estado', ['cancelado'])
|
||||||
|
->select('SUM(pedidos.total_precio) as total')
|
||||||
|
->join('pedidos_linea', 'pedidos_linea.pedido_id = pedidos.id')
|
||||||
|
->join('presupuestos', 'presupuestos.id = pedidos_linea.presupuesto_id')
|
||||||
|
->groupBy('presupuestos.cliente_id')->get()->getResultObject();
|
||||||
|
if(count($data) > 0){
|
||||||
|
$result['total_impresion'] = round(floatval($data[0]->total), 2);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$error = true;
|
||||||
|
}
|
||||||
|
$result['total'] = $result['total_impresion'] + $result['total_maquetacion'];
|
||||||
|
return $this->respond(['status' => $error?'error':'success', 'totales' => $result]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getClienteListItems($selId = null)
|
protected function getClienteListItems($selId = null)
|
||||||
{
|
{
|
||||||
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Clientes.cliente'))])];
|
$data = ['' => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Clientes.cliente'))])];
|
||||||
|
|||||||
@ -138,7 +138,7 @@ class Ordentrabajo extends BaseController
|
|||||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||||
->edit(
|
->edit(
|
||||||
"fecha_encuadernado_at",
|
"fecha_encuadernado_at",
|
||||||
fn($q) => Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y")
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
@ -153,7 +153,7 @@ class Ordentrabajo extends BaseController
|
|||||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||||
->edit(
|
->edit(
|
||||||
"fecha_encuadernado_at",
|
"fecha_encuadernado_at",
|
||||||
fn($q) => $q->fecha_encuadernado_at? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y"):""
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
@ -168,7 +168,7 @@ class Ordentrabajo extends BaseController
|
|||||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||||
->edit(
|
->edit(
|
||||||
"fecha_encuadernado_at",
|
"fecha_encuadernado_at",
|
||||||
fn($q) => $q->fecha_encuadernado_at?Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y"):""
|
fn($q) =>$q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
@ -183,7 +183,7 @@ class Ordentrabajo extends BaseController
|
|||||||
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
->add("logo", fn($q) => site_url($logo->get_logo_path($q->presupuesto_linea_tipo)))
|
||||||
->edit(
|
->edit(
|
||||||
"fecha_encuadernado_at",
|
"fecha_encuadernado_at",
|
||||||
fn($q) => Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y")
|
fn($q) => $q->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $q->fecha_encuadernado_at)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->add("action", fn($q) => $q->id)
|
->add("action", fn($q) => $q->id)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
@ -253,6 +253,22 @@ class Ordentrabajo extends BaseController
|
|||||||
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode($th->getCode());
|
return $this->response->setJSON(["message" => "Portada error", "error" => $th->getMessage()])->setStatusCode($th->getCode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public function delete_orden_trabajo_portada($orden_trabajo_id)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
helper('filesystem');
|
||||||
|
$otEntity = $this->otModel->find($orden_trabajo_id);
|
||||||
|
$pathActualFile = $otEntity->portada_path;
|
||||||
|
$fullPath = WRITEPATH . 'uploads/' . $pathActualFile;
|
||||||
|
if(file_exists($fullPath)){
|
||||||
|
delete_files($fullPath);
|
||||||
|
}
|
||||||
|
$r = $this->otModel->update($otEntity->id, ["portada_path" => null]);
|
||||||
|
return $this->response->setJSON(["message" => "Portada eliminada", "data" => $r]);
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
return $this->response->setStatusCode(500)->setJSON(["message" => "Portada error", "error" => $th->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
public function get_portada_img($orden_trabajo_id)
|
public function get_portada_img($orden_trabajo_id)
|
||||||
{
|
{
|
||||||
$ot = $this->otModel->find($orden_trabajo_id);
|
$ot = $this->otModel->find($orden_trabajo_id);
|
||||||
@ -273,8 +289,7 @@ class Ordentrabajo extends BaseController
|
|||||||
return DataTable::of($q)
|
return DataTable::of($q)
|
||||||
->edit("fecha_entrega_real_at", fn($q) => $q->fecha_entrega_real_at ? Time::createFromFormat("Y-m-d", $q->fecha_entrega_real_at)->format("d/m/Y") : "")
|
->edit("fecha_entrega_real_at", fn($q) => $q->fecha_entrega_real_at ? Time::createFromFormat("Y-m-d", $q->fecha_entrega_real_at)->format("d/m/Y") : "")
|
||||||
->add("metros_check", fn($q) => $q->otId)
|
->add("metros_check", fn($q) => $q->otId)
|
||||||
->add("corte", fn($q) => $q->otId)
|
->add("corte", fn($q) => ["otId" => $q->otId,"tipo_corte" => $this->produccionService->ordenTrabajoTareaCorte($q->otId)])
|
||||||
|
|
||||||
->add("action", fn($q) => $q)
|
->add("action", fn($q) => $q)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
@ -287,4 +302,30 @@ class Ordentrabajo extends BaseController
|
|||||||
->add("action", fn($q) => $q)
|
->add("action", fn($q) => $q)
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
|
public function select_maquina_planning_rot(){
|
||||||
|
$q = $this->request->getGet('q');
|
||||||
|
$result = $this->produccionService->querySelectMaquinaPlanningRotativa($q);
|
||||||
|
return $this->response->setJSON($result);
|
||||||
|
}
|
||||||
|
public function select_papel_planning_rot(){
|
||||||
|
$q = $this->request->getGet('q');
|
||||||
|
$result = $this->produccionService->querySelectPapelPlanningRot($q);
|
||||||
|
return $this->response->setJSON($result);
|
||||||
|
}
|
||||||
|
public function select_maquina_planning_plana(){
|
||||||
|
$q = $this->request->getGet('q');
|
||||||
|
$result = $this->produccionService->querySelectMaquinaPlanningPlana($q);
|
||||||
|
return $this->response->setJSON($result);
|
||||||
|
}
|
||||||
|
public function select_papel_planning_plana(){
|
||||||
|
$q = $this->request->getGet('q');
|
||||||
|
$result = $this->produccionService->querySelectPapelPlanningPlana($q);
|
||||||
|
return $this->response->setJSON($result);
|
||||||
|
}
|
||||||
|
public function tarea_toggle_corte($orden_trabajo_id)
|
||||||
|
{
|
||||||
|
$status = $this->produccionService->tareaUpdateMaquinaCorte($orden_trabajo_id);
|
||||||
|
return $this->response->setJSON(["message" => lang("App.global_alert_save_success"), "status" => $status ]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Database\Migrations;
|
||||||
|
|
||||||
|
use App\Models\Configuracion\ConfigVariableModel;
|
||||||
|
use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
||||||
|
use CodeIgniter\Database\Migration;
|
||||||
|
|
||||||
|
class AddColumnIsCorteOrdenTrabajoTarea extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$fields = [
|
||||||
|
'is_corte' => [
|
||||||
|
'type' => 'TINYINT',
|
||||||
|
'constraint' => 1,
|
||||||
|
'null' => false,
|
||||||
|
'default' => 0,
|
||||||
|
],
|
||||||
|
'tipo_corte' => [
|
||||||
|
'type' => 'ENUM',
|
||||||
|
'constraint' => ['bobina','guillotina'],
|
||||||
|
'default' => 'bobina',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
$this->forge->addColumn('orden_trabajo_tareas', $fields);
|
||||||
|
$m = model(OrdenTrabajoTarea::class);
|
||||||
|
$m->where('nombre','Corte')->set(['is_corte' => true,'tipo_corte' => 'bobina'])->update();
|
||||||
|
$cvm = model(ConfigVariableModel::class);
|
||||||
|
$cvm->insert([
|
||||||
|
"name" => "id_maquina_bobina_corte_ot_tarea",
|
||||||
|
"value" => 61,
|
||||||
|
"description" => "Id de máquina por defecto para corte en bobina rotativa. (Asignación máquina orden trabajo tarea)"
|
||||||
|
]);
|
||||||
|
$cvm->insert([
|
||||||
|
"name" => "id_maquina_guillotina_corte_ot_tarea",
|
||||||
|
"value" => 31,
|
||||||
|
"description" => "Id de máquina por defecto para corte guillotina rotativa. (Asignación máquina orden trabajo tarea)"
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
$this->forge->dropColumn('orden_trabajo_tareas', 'is_corte');
|
||||||
|
$this->forge->dropColumn('orden_trabajo_tareas', 'tipo_corte');
|
||||||
|
$cvm = model(ConfigVariableModel::class);
|
||||||
|
$cvm->whereIn('name',["id_maquina_bobina_corte_ot_tarea","id_maquina_guillotina_corte_ot_tarea"])->delete(purge:true);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@
|
|||||||
namespace App\Entities\Presupuestos;
|
namespace App\Entities\Presupuestos;
|
||||||
|
|
||||||
use App\Entities\Tarifas\TarifaEncuadernacionEntity;
|
use App\Entities\Tarifas\TarifaEncuadernacionEntity;
|
||||||
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
use App\Models\Tarifas\Maquinas\TarifaEncuadernacionMaquinaModel;
|
use App\Models\Tarifas\Maquinas\TarifaEncuadernacionMaquinaModel;
|
||||||
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
@ -34,7 +35,13 @@ class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity
|
|||||||
public function maquinas() : array
|
public function maquinas() : array
|
||||||
{
|
{
|
||||||
$m = model(TarifaEncuadernacionMaquinaModel::class);
|
$m = model(TarifaEncuadernacionMaquinaModel::class);
|
||||||
return $m->where("tarifa_encuadernacion_id",$this->attributes["tarifa_encuadernado_id"])->findAll();
|
$tarifa_maquinas = $m->where("tarifa_encuadernacion_id",$this->attributes["tarifa_encuadernado_id"])->findAll();
|
||||||
|
$maquinaModel = model(MaquinaModel::class);
|
||||||
|
$maquinas = [];
|
||||||
|
foreach ($tarifa_maquinas as $key => $tarifa_maquina) {
|
||||||
|
$maquinas[] = $maquinaModel->find($tarifa_maquina->maquina_id);
|
||||||
|
}
|
||||||
|
return $maquinas;
|
||||||
}
|
}
|
||||||
public function tarifa() : TarifaEncuadernacionEntity
|
public function tarifa() : TarifaEncuadernacionEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
namespace App\Entities\Presupuestos;
|
namespace App\Entities\Presupuestos;
|
||||||
|
|
||||||
use App\Entities\Tarifas\TarifaManipuladoEntity;
|
use App\Entities\Tarifas\TarifaManipuladoEntity;
|
||||||
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
use App\Models\Tarifas\Maquinas\TarifaManipuladoMaquinaModel;
|
use App\Models\Tarifas\Maquinas\TarifaManipuladoMaquinaModel;
|
||||||
use App\Models\Tarifas\TarifaManipuladoModel;
|
use App\Models\Tarifas\TarifaManipuladoModel;
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
@ -28,7 +29,13 @@ class PresupuestoManipuladosEntity extends \CodeIgniter\Entity\Entity
|
|||||||
public function maquinas() : array
|
public function maquinas() : array
|
||||||
{
|
{
|
||||||
$m = model(TarifaManipuladoMaquinaModel::class);
|
$m = model(TarifaManipuladoMaquinaModel::class);
|
||||||
return $m->where("tarifa_manipulado_id",$this->attributes["tarifa_manipulado_id"])->findAll();
|
$tarifa_maquinas = $m->where("tarifa_manipulado_id",$this->attributes["tarifa_manipulado_id"])->findAll();
|
||||||
|
$maquinaModel = model(MaquinaModel::class);
|
||||||
|
$maquinas = [];
|
||||||
|
foreach ($tarifa_maquinas as $key => $tarifa_maquina) {
|
||||||
|
$maquinas[] = $maquinaModel->find($tarifa_maquina->maquina_id);
|
||||||
|
}
|
||||||
|
return $maquinas;
|
||||||
}
|
}
|
||||||
public function tarifa() : TarifaManipuladoEntity
|
public function tarifa() : TarifaManipuladoEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
namespace App\Entities\Presupuestos;
|
namespace App\Entities\Presupuestos;
|
||||||
|
|
||||||
use App\Entities\Tarifas\TarifapreimpresionEntity;
|
use App\Entities\Tarifas\TarifapreimpresionEntity;
|
||||||
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
use App\Models\Tarifas\Maquinas\TarifaPreimpresionMaquinaModel;
|
use App\Models\Tarifas\Maquinas\TarifaPreimpresionMaquinaModel;
|
||||||
use App\Models\Tarifas\TarifapreimpresionModel;
|
use App\Models\Tarifas\TarifapreimpresionModel;
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
@ -26,7 +27,13 @@ class PresupuestoPreimpresionesEntity extends \CodeIgniter\Entity\Entity
|
|||||||
public function maquinas() : array
|
public function maquinas() : array
|
||||||
{
|
{
|
||||||
$m = model(TarifaPreimpresionMaquinaModel::class);
|
$m = model(TarifaPreimpresionMaquinaModel::class);
|
||||||
return $m->where("tarifa_preimpresion_id",$this->attributes["tarifa_preimpresion_id"])->findAll();
|
$tarifa_maquinas = $m->where("tarifa_preimpresion_id",$this->attributes["tarifa_preimpresion_id"])->findAll();
|
||||||
|
$maquinaModel = model(MaquinaModel::class);
|
||||||
|
$maquinas = [];
|
||||||
|
foreach ($tarifa_maquinas as $key => $tarifa_maquina) {
|
||||||
|
$maquinas[] = $maquinaModel->find($tarifa_maquina->maquina_id);
|
||||||
|
}
|
||||||
|
return $maquinas;
|
||||||
}
|
}
|
||||||
public function tarifa() : TarifapreimpresionEntity
|
public function tarifa() : TarifapreimpresionEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
namespace App\Entities\Presupuestos;
|
namespace App\Entities\Presupuestos;
|
||||||
|
|
||||||
use App\Entities\Tarifas\TarifaextraEntity;
|
use App\Entities\Tarifas\TarifaextraEntity;
|
||||||
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
use App\Models\Tarifas\Maquinas\TarifaExtraMaquinaModel;
|
use App\Models\Tarifas\Maquinas\TarifaExtraMaquinaModel;
|
||||||
use App\Models\Tarifas\TarifaextraModel;
|
use App\Models\Tarifas\TarifaextraModel;
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
@ -27,7 +28,13 @@ class PresupuestoServiciosExtraEntity extends \CodeIgniter\Entity\Entity
|
|||||||
public function maquinas() : array
|
public function maquinas() : array
|
||||||
{
|
{
|
||||||
$m = model(TarifaExtraMaquinaModel::class);
|
$m = model(TarifaExtraMaquinaModel::class);
|
||||||
return $m->where("tarifa_extra_id",$this->attributes["tarifa_extra_id"])->findAll();
|
$tarifa_maquinas = $m->where("tarifa_extra_id",$this->attributes["tarifa_extra_id"])->findAll();
|
||||||
|
$maquinaModel = model(MaquinaModel::class);
|
||||||
|
$maquinas = [];
|
||||||
|
foreach ($tarifa_maquinas as $key => $tarifa_maquina) {
|
||||||
|
$maquinas[] = $maquinaModel->find($tarifa_maquina->maquina_id);
|
||||||
|
}
|
||||||
|
return $maquinas;
|
||||||
}
|
}
|
||||||
public function tarifa() : TarifaextraEntity
|
public function tarifa() : TarifaextraEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -10,7 +10,8 @@ use App\Models\OrdenTrabajo\OrdenTrabajoTarea;
|
|||||||
use App\Models\OrdenTrabajo\OrdenTrabajoUser;
|
use App\Models\OrdenTrabajo\OrdenTrabajoUser;
|
||||||
use App\Models\Pedidos\PedidoModel;
|
use App\Models\Pedidos\PedidoModel;
|
||||||
use CodeIgniter\Entity\Entity;
|
use CodeIgniter\Entity\Entity;
|
||||||
|
use Picqer\Barcode\Renderers\PngRenderer;
|
||||||
|
use Picqer\Barcode\Types\TypeCode128;
|
||||||
|
|
||||||
class OrdenTrabajoEntity extends Entity
|
class OrdenTrabajoEntity extends Entity
|
||||||
{
|
{
|
||||||
@ -101,4 +102,11 @@ class OrdenTrabajoEntity extends Entity
|
|||||||
$this->attributes["dates"] = $ot_dates->fill($data);
|
$this->attributes["dates"] = $ot_dates->fill($data);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
public function getBarCode() : string
|
||||||
|
{
|
||||||
|
$barcode = new TypeCode128();
|
||||||
|
$renderer = new PngRenderer();
|
||||||
|
$barcodeData = $barcode->getBarcode($this->pedido()->presupuesto()->id);
|
||||||
|
return base64_encode($renderer->render($barcodeData,200, 50));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,8 @@ class OrdenTrabajoTareaEntity extends Entity
|
|||||||
"imposicion_id" => null,
|
"imposicion_id" => null,
|
||||||
"tiempo_estimado" => null,
|
"tiempo_estimado" => null,
|
||||||
"tiempo_real" => null,
|
"tiempo_real" => null,
|
||||||
|
"is_corte" => null,
|
||||||
|
"tipo_corte" => null,
|
||||||
"comment" => null,
|
"comment" => null,
|
||||||
];
|
];
|
||||||
protected $datamap = [];
|
protected $datamap = [];
|
||||||
@ -39,6 +41,8 @@ class OrdenTrabajoTareaEntity extends Entity
|
|||||||
"imposicion_id" => "?integer",
|
"imposicion_id" => "?integer",
|
||||||
"tiempo_estimado" => "?float",
|
"tiempo_estimado" => "?float",
|
||||||
"tiempo_real" => "?float",
|
"tiempo_real" => "?float",
|
||||||
|
"is_corte" => "boolean",
|
||||||
|
"tipo_corte" => "string",
|
||||||
"comment" => "?string"
|
"comment" => "?string"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Entities\Produccion;
|
namespace App\Entities\Produccion;
|
||||||
|
|
||||||
|
use App\Entities\Usuarios\UserEntity;
|
||||||
|
use App\Models\Usuarios\UserModel;
|
||||||
use CodeIgniter\Entity\Entity;
|
use CodeIgniter\Entity\Entity;
|
||||||
|
|
||||||
class OrdenTrabajoUserEntity extends Entity
|
class OrdenTrabajoUserEntity extends Entity
|
||||||
@ -10,30 +12,30 @@ class OrdenTrabajoUserEntity extends Entity
|
|||||||
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||||
|
|
||||||
protected $attributes = [
|
protected $attributes = [
|
||||||
"orden_trabajo_id"=> null,
|
"orden_trabajo_id" => null,
|
||||||
"user_created_id"=> null,
|
"user_created_id" => null,
|
||||||
"user_update_id"=> null,
|
"user_update_id" => null,
|
||||||
"inaplazable_revised_change_user_id"=> null,
|
"inaplazable_revised_change_user_id" => null,
|
||||||
"ferro_disponible_hecho_user_id"=> null,
|
"ferro_disponible_hecho_user_id" => null,
|
||||||
"ferro_disponible_ok_user_id"=> null,
|
"ferro_disponible_ok_user_id" => null,
|
||||||
"ferro_entregado_user_id"=> null,
|
"ferro_entregado_user_id" => null,
|
||||||
"pendiente_ferro_user_id"=> null,
|
"pendiente_ferro_user_id" => null,
|
||||||
"ferro_en_cliente_user_id"=> null,
|
"ferro_en_cliente_user_id" => null,
|
||||||
"ferro_ok_user_id"=> null,
|
"ferro_ok_user_id" => null,
|
||||||
"interior_bn_user_id"=> null,
|
"interior_bn_user_id" => null,
|
||||||
"interior_color_user_id"=> null,
|
"interior_color_user_id" => null,
|
||||||
"preparacion_interior_user_id"=> null,
|
"preparacion_interior_user_id" => null,
|
||||||
"cubierta_user_id"=> null,
|
"cubierta_user_id" => null,
|
||||||
"plastificado_user_id"=> null,
|
"plastificado_user_id" => null,
|
||||||
"encuadernacion_user_id"=> null,
|
"encuadernacion_user_id" => null,
|
||||||
"corte_user_id"=> null,
|
"corte_user_id" => null,
|
||||||
"embalaje_user_id"=> null,
|
"embalaje_user_id" => null,
|
||||||
"entrada_manipulado_user_id"=> null,
|
"entrada_manipulado_user_id" => null,
|
||||||
"pre_formato_user_id"=> null,
|
"pre_formato_user_id" => null,
|
||||||
"pre_lomo_user_id"=> null,
|
"pre_lomo_user_id" => null,
|
||||||
"pre_solapa_user_id"=> null,
|
"pre_solapa_user_id" => null,
|
||||||
"pre_codbarras_user_id"=> null,
|
"pre_codbarras_user_id" => null,
|
||||||
"pre_imposicion_user_id"=> null,
|
"pre_imposicion_user_id" => null,
|
||||||
"pre_imprimir_user_id" => null
|
"pre_imprimir_user_id" => null
|
||||||
];
|
];
|
||||||
// protected array $casts = [
|
// protected array $casts = [
|
||||||
@ -63,4 +65,21 @@ class OrdenTrabajoUserEntity extends Entity
|
|||||||
// "pre_imposicion_user_id" => "?integer",
|
// "pre_imposicion_user_id" => "?integer",
|
||||||
// "pre_imprimir_user_id" => "?integer"
|
// "pre_imprimir_user_id" => "?integer"
|
||||||
// ];
|
// ];
|
||||||
|
|
||||||
|
protected function userBy(string $key): ?UserEntity
|
||||||
|
{
|
||||||
|
$user = null;
|
||||||
|
if (isset($this->attributes[$key])) {
|
||||||
|
|
||||||
|
if ($this->attributes[$key]) {
|
||||||
|
$m = model(UserModel::class);
|
||||||
|
$user = $m->find($this->attributes[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $user;
|
||||||
|
}
|
||||||
|
public function getPlastificadoBy() : ?UserEntity
|
||||||
|
{
|
||||||
|
return $this->userBy('plastificado_user_id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace App\Entities\Tarifas\Acabados;
|
namespace App\Entities\Tarifas\Acabados;
|
||||||
|
|
||||||
|
use App\Entities\Tarifas\Maquinas\TarifaAcabadoMaquinaEntity;
|
||||||
|
use App\Models\Tarifas\Maquinas\TarifaAcabadoMaquinaModel;
|
||||||
use CodeIgniter\Entity;
|
use CodeIgniter\Entity;
|
||||||
|
|
||||||
class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
|
class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
|
||||||
@ -32,4 +34,15 @@ class TarifaAcabadoEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"user_updated_id" => "int",
|
"user_updated_id" => "int",
|
||||||
"is_deleted" => "int",
|
"is_deleted" => "int",
|
||||||
];
|
];
|
||||||
|
/**
|
||||||
|
* Devuelve las maquinas asociadas a esta tarifa de acabado
|
||||||
|
*
|
||||||
|
* @return array<MaquinaEntity>
|
||||||
|
*/
|
||||||
|
public function maquinas() : array
|
||||||
|
{
|
||||||
|
$m = model(TarifaAcabadoMaquinaModel::class);
|
||||||
|
$ta_maquinas = $m->where('tarifa_acabado_id',$this->attributes['id'])->findAll();
|
||||||
|
return array_map(fn(TarifaAcabadoMaquinaEntity $ta_maquina) => $ta_maquina->maquina(),$ta_maquinas);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
namespace App\Entities\Tarifas\Maquinas;
|
namespace App\Entities\Tarifas\Maquinas;
|
||||||
|
|
||||||
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
||||||
|
use App\Entities\Configuracion\Maquina;
|
||||||
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
use App\Models\Tarifas\Acabados\TarifaAcabadoModel;
|
use App\Models\Tarifas\Acabados\TarifaAcabadoModel;
|
||||||
use CodeIgniter\Entity\Entity;
|
use CodeIgniter\Entity\Entity;
|
||||||
|
|
||||||
@ -27,4 +29,10 @@ class TarifaAcabadoMaquinaEntity extends Entity
|
|||||||
$m = model(TarifaAcabadoModel::class);
|
$m = model(TarifaAcabadoModel::class);
|
||||||
return $m->find($this->attributes["tarifa_acabado_id"]);
|
return $m->find($this->attributes["tarifa_acabado_id"]);
|
||||||
}
|
}
|
||||||
|
public function maquina() : Maquina
|
||||||
|
{
|
||||||
|
$m = model(MaquinaModel::class);
|
||||||
|
return $m->find($this->attributes["maquina_id"]);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Entities\Tarifas\Maquinas;
|
namespace App\Entities\Tarifas\Maquinas;
|
||||||
|
|
||||||
|
use App\Entities\Configuracion\Maquina;
|
||||||
use App\Entities\Tarifas\TarifaEncuadernacionEntity;
|
use App\Entities\Tarifas\TarifaEncuadernacionEntity;
|
||||||
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
||||||
use CodeIgniter\Entity\Entity;
|
use CodeIgniter\Entity\Entity;
|
||||||
|
|
||||||
@ -31,4 +33,9 @@ class TarifaEncuadernacionMaquinaEntity extends Entity
|
|||||||
$m = model(TarifaEncuadernacionModel::class);
|
$m = model(TarifaEncuadernacionModel::class);
|
||||||
return $m->find($this->attributes["tarifa_encuadernacion_id"]);
|
return $m->find($this->attributes["tarifa_encuadernacion_id"]);
|
||||||
}
|
}
|
||||||
|
public function maquina(): ?Maquina
|
||||||
|
{
|
||||||
|
$m = model(MaquinaModel::class);
|
||||||
|
return $m->find($this->attributes['maquina_id']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,7 +6,8 @@ use App\Entities\Tarifas\TarifaextraEntity;
|
|||||||
use App\Models\Tarifas\Acabados\TarifaAcabadoModel;
|
use App\Models\Tarifas\Acabados\TarifaAcabadoModel;
|
||||||
use App\Models\Tarifas\TarifaextraModel;
|
use App\Models\Tarifas\TarifaextraModel;
|
||||||
use CodeIgniter\Entity\Entity;
|
use CodeIgniter\Entity\Entity;
|
||||||
|
use App\Entities\Configuracion\Maquina;
|
||||||
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
|
|
||||||
class TarifaExtraMaquinaEntity extends Entity
|
class TarifaExtraMaquinaEntity extends Entity
|
||||||
{
|
{
|
||||||
@ -29,4 +30,9 @@ class TarifaExtraMaquinaEntity extends Entity
|
|||||||
$m = model(TarifaextraModel::class);
|
$m = model(TarifaextraModel::class);
|
||||||
return $m->find($this->attributes["tarifa_extra_id"]);
|
return $m->find($this->attributes["tarifa_extra_id"]);
|
||||||
}
|
}
|
||||||
|
public function maquina(): ?Maquina
|
||||||
|
{
|
||||||
|
$m = model(MaquinaModel::class);
|
||||||
|
return $m->find($this->attributes['maquina_id']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,8 @@ namespace App\Entities\Tarifas\Maquinas;
|
|||||||
use App\Entities\Tarifas\TarifaManipuladoEntity;
|
use App\Entities\Tarifas\TarifaManipuladoEntity;
|
||||||
use App\Models\Tarifas\TarifaManipuladoModel;
|
use App\Models\Tarifas\TarifaManipuladoModel;
|
||||||
use CodeIgniter\Entity\Entity;
|
use CodeIgniter\Entity\Entity;
|
||||||
|
use App\Entities\Configuracion\Maquina;
|
||||||
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
|
|
||||||
class TarifaManipuladoMaquinaEntity extends Entity
|
class TarifaManipuladoMaquinaEntity extends Entity
|
||||||
{
|
{
|
||||||
@ -28,4 +29,9 @@ class TarifaManipuladoMaquinaEntity extends Entity
|
|||||||
$m = model(TarifaManipuladoModel::class);
|
$m = model(TarifaManipuladoModel::class);
|
||||||
return $m->find($this->attributes["tarifa_manipulado_id"]);
|
return $m->find($this->attributes["tarifa_manipulado_id"]);
|
||||||
}
|
}
|
||||||
|
public function maquina(): ?Maquina
|
||||||
|
{
|
||||||
|
$m = model(MaquinaModel::class);
|
||||||
|
return $m->find($this->attributes['maquina_id']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,8 @@ namespace App\Entities\Tarifas\Maquinas;
|
|||||||
use App\Entities\Tarifas\TarifapreimpresionEntity;
|
use App\Entities\Tarifas\TarifapreimpresionEntity;
|
||||||
use App\Models\Tarifas\TarifapreimpresionModel;
|
use App\Models\Tarifas\TarifapreimpresionModel;
|
||||||
use CodeIgniter\Entity\Entity;
|
use CodeIgniter\Entity\Entity;
|
||||||
|
use App\Entities\Configuracion\Maquina;
|
||||||
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
|
|
||||||
class TarifaPreimpresionMaquinaEntity extends Entity
|
class TarifaPreimpresionMaquinaEntity extends Entity
|
||||||
{
|
{
|
||||||
@ -28,4 +29,9 @@ class TarifaPreimpresionMaquinaEntity extends Entity
|
|||||||
$m = model(TarifapreimpresionModel::class);
|
$m = model(TarifapreimpresionModel::class);
|
||||||
return $m->find($this->attributes["tarifa_preimpresion_id"]);
|
return $m->find($this->attributes["tarifa_preimpresion_id"]);
|
||||||
}
|
}
|
||||||
|
public function maquina(): ?Maquina
|
||||||
|
{
|
||||||
|
$m = model(MaquinaModel::class);
|
||||||
|
return $m->find($this->attributes['maquina_id']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,6 +74,9 @@ return [
|
|||||||
"ejemplares" => "Ejemplares",
|
"ejemplares" => "Ejemplares",
|
||||||
"addPago" => "Añadir Pago",
|
"addPago" => "Añadir Pago",
|
||||||
"facturaPagada" => "Factura rectificativa ya abonada",
|
"facturaPagada" => "Factura rectificativa ya abonada",
|
||||||
|
|
||||||
|
"acumuladoFacturacion" => "Acumulado Facturación",
|
||||||
|
"totalPendientePago" => "Pendiente de pago",
|
||||||
|
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'requiredFields' => 'Los campos marcados con * son obligatorios',
|
'requiredFields' => 'Los campos marcados con * son obligatorios',
|
||||||
|
|||||||
@ -16,6 +16,7 @@ return [
|
|||||||
'estado' => 'Estado',
|
'estado' => 'Estado',
|
||||||
'importePendiente' => 'Importe Pendiente',
|
'importePendiente' => 'Importe Pendiente',
|
||||||
|
|
||||||
|
'todos' => 'Todos',
|
||||||
'validacion' => 'Validación',
|
'validacion' => 'Validación',
|
||||||
'produccion' => 'Producción',
|
'produccion' => 'Producción',
|
||||||
'finalizado' => 'Finalizado',
|
'finalizado' => 'Finalizado',
|
||||||
@ -82,6 +83,10 @@ return [
|
|||||||
|
|
||||||
'showTotal' => 'Mostrar totales',
|
'showTotal' => 'Mostrar totales',
|
||||||
|
|
||||||
|
'pedidosImpresion' => 'Pedidos impresión',
|
||||||
|
'pedidosMaquetacion' => 'Pedidos maquetación',
|
||||||
|
'pedidosTotal' => 'Total en pedidos',
|
||||||
|
|
||||||
'validation' => [
|
'validation' => [
|
||||||
'errorCantidadAlbaranes' => 'Total en albaranes {0} no coincide con la tirada {1}',
|
'errorCantidadAlbaranes' => 'Total en albaranes {0} no coincide con la tirada {1}',
|
||||||
|
|
||||||
|
|||||||
@ -349,6 +349,16 @@ return [
|
|||||||
'cubiertaSinAcabado' => 'Cubierta sin acabado',
|
'cubiertaSinAcabado' => 'Cubierta sin acabado',
|
||||||
'cubiertaSinAcabadoText' => 'La falta de plastificado en la cubierta puede comprometer su calidad, ya que aumenta el riesgo de agrietamiento en los pliegues o hendidos, afectando su apariencia y resistencia',
|
'cubiertaSinAcabadoText' => 'La falta de plastificado en la cubierta puede comprometer su calidad, ya que aumenta el riesgo de agrietamiento en los pliegues o hendidos, afectando su apariencia y resistencia',
|
||||||
|
|
||||||
|
|
||||||
|
'presupuestosImpresion' => 'Presupuestos impresión',
|
||||||
|
'presupuestosMaquetacion' => 'Presupuestos maquetación',
|
||||||
|
'presupuestosTotal' => 'Total presupuestos',
|
||||||
|
'fecha' => 'Fecha',
|
||||||
|
'estado' => 'Estado',
|
||||||
|
'todos' => 'Todos',
|
||||||
|
'borrador' => 'Borrador',
|
||||||
|
'confirmado' => 'Confirmado',
|
||||||
|
|
||||||
'files' => 'Ficheros',
|
'files' => 'Ficheros',
|
||||||
'titulos' => [
|
'titulos' => [
|
||||||
'libroFresadoTapaDura' => 'Rústica Fresado tapa dura',
|
'libroFresadoTapaDura' => 'Rústica Fresado tapa dura',
|
||||||
|
|||||||
@ -145,6 +145,40 @@ class FacturaModel extends \App\Models\BaseModel
|
|||||||
return $builder;
|
return $builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getSumatoriosFacturacionCliente($cliente_id = -1){
|
||||||
|
|
||||||
|
if($cliente_id == -1){
|
||||||
|
return [
|
||||||
|
'total_facturacion' => 0,
|
||||||
|
'total_pendiente' => 0
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = [];
|
||||||
|
$data = $this->db->table('facturas f')
|
||||||
|
->select('sum(f.total) as total')
|
||||||
|
->where('f.cliente_id', $cliente_id)
|
||||||
|
->where('f.deleted_at IS NULL')
|
||||||
|
->where('f.estado', 'validada')
|
||||||
|
->get()
|
||||||
|
->getResultObject();
|
||||||
|
$result['total_facturacion'] =
|
||||||
|
round(floatval(($data && $data[0]->total != null) ? $data[0]->total : 0), 2);
|
||||||
|
|
||||||
|
$data = $this->db->table('facturas f')
|
||||||
|
->select('sum(f.pendiente) as pendiente')
|
||||||
|
->where('f.cliente_id', $cliente_id)
|
||||||
|
->where('f.deleted_at IS NULL')
|
||||||
|
->where('f.estado', 'validada')
|
||||||
|
->where('f.estado_pago', 'pendiente')
|
||||||
|
->get()
|
||||||
|
->getResultObject();
|
||||||
|
$result['total_pendiente'] =
|
||||||
|
round(floatval(($data && $data[0]->pendiente != null) ? $data[0]->pendiente : 0), 2);
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get resource data for creating PDFs.
|
* Get resource data for creating PDFs.
|
||||||
|
|||||||
@ -28,6 +28,8 @@ class OrdenTrabajoTarea extends Model
|
|||||||
"imposicion_id",
|
"imposicion_id",
|
||||||
"tiempo_estimado",
|
"tiempo_estimado",
|
||||||
"tiempo_real",
|
"tiempo_real",
|
||||||
|
"is_corte",
|
||||||
|
"tipo_corte",
|
||||||
"comment"
|
"comment"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -232,6 +232,20 @@ class PedidoModel extends \App\Models\BaseModel
|
|||||||
return $presupuesto_ficheros;
|
return $presupuesto_ficheros;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getPedidosClienteForm($cliente_id = -1){
|
||||||
|
$builder = $this->db
|
||||||
|
->table($this->table . " p")
|
||||||
|
->select('p.id, p.created_at as fecha, p.fecha_entrega_real as fecha_entrega,
|
||||||
|
pr.paginas as paginas, p.total_tirada, p.total_precio, p.estado')
|
||||||
|
->join('pedidos_linea pl', 'pl.pedido_id = p.id', 'left')
|
||||||
|
->join('presupuestos pr', 'pr.id = pl.presupuesto_id', 'left')
|
||||||
|
//->where('pr.deleted_at IS NULL')
|
||||||
|
->where('pr.cliente_id', $cliente_id)
|
||||||
|
->groupBy('p.id');
|
||||||
|
return $builder;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crea una orden de trabajo asociada al pedido
|
* Crea una orden de trabajo asociada al pedido
|
||||||
*
|
*
|
||||||
|
|||||||
@ -713,6 +713,19 @@ class PresupuestoModel extends \App\Models\BaseModel
|
|||||||
$servicios['extra'] = $queryExtras->get()->getResultObject();
|
$servicios['extra'] = $queryExtras->get()->getResultObject();
|
||||||
return $servicios;
|
return $servicios;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPresupuestosClienteForm($cliente_id = -1){
|
||||||
|
$builder = $this->db
|
||||||
|
->table($this->table . " pr")
|
||||||
|
->select('pr.id, pr.created_at as fecha, CONCAT(u.first_name, " ", u.last_name) AS comercial, pr.titulo,
|
||||||
|
pr.paginas as paginas, pr.tirada, pr.total_aceptado as total, pr.estado_id as estado')
|
||||||
|
->join ("clientes c", "pr.cliente_id = c.id", "left")
|
||||||
|
->join("users u", "c.comercial_id= u.id", "left")
|
||||||
|
->where('pr.cliente_id', $cliente_id)
|
||||||
|
->groupBy('pr.id');
|
||||||
|
return $builder;
|
||||||
|
}
|
||||||
|
|
||||||
private function generarConceptoLineasPresupuestoLibro($lineas, $presupuesto)
|
private function generarConceptoLineasPresupuestoLibro($lineas, $presupuesto)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
namespace App\Models\Tarifas\Maquinas;
|
namespace App\Models\Tarifas\Maquinas;
|
||||||
|
|
||||||
|
use App\Entities\Configuracion\Maquina;
|
||||||
use App\Entities\Tarifas\Maquinas\TarifaEncuadernacionMaquinaEntity;
|
use App\Entities\Tarifas\Maquinas\TarifaEncuadernacionMaquinaEntity;
|
||||||
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
use CodeIgniter\Database\BaseBuilder;
|
use CodeIgniter\Database\BaseBuilder;
|
||||||
use CodeIgniter\Model;
|
use CodeIgniter\Model;
|
||||||
|
|
||||||
@ -71,4 +72,5 @@ class TarifaEncuadernacionMaquinaModel extends Model
|
|||||||
$query->where("tarifa_encuadernacion_maquinas.tarifa_encuadernacion_id", $tarifa_encuadernacion_id);
|
$query->where("tarifa_encuadernacion_maquinas.tarifa_encuadernacion_id", $tarifa_encuadernacion_id);
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
|
use App\Database\Migrations\ConfigVariablesApp;
|
||||||
use App\Entities\Clientes\ClienteEntity;
|
use App\Entities\Clientes\ClienteEntity;
|
||||||
use App\Entities\Pedidos\PedidoEntity;
|
use App\Entities\Pedidos\PedidoEntity;
|
||||||
use App\Entities\Presupuestos\PresupuestoEntity;
|
use App\Entities\Presupuestos\PresupuestoEntity;
|
||||||
@ -15,6 +16,7 @@ use App\Models\Usuarios\UserModel;
|
|||||||
use CodeIgniter\Config\BaseService;
|
use CodeIgniter\Config\BaseService;
|
||||||
use App\Entities\Configuracion\Maquina as MaquinaEntity;
|
use App\Entities\Configuracion\Maquina as MaquinaEntity;
|
||||||
use App\Entities\Produccion\OrdenTrabajoTareaEntity;
|
use App\Entities\Produccion\OrdenTrabajoTareaEntity;
|
||||||
|
use App\Models\Configuracion\ConfigVariableModel;
|
||||||
use App\Models\Configuracion\MaquinaModel;
|
use App\Models\Configuracion\MaquinaModel;
|
||||||
use CodeIgniter\Database\BaseBuilder;
|
use CodeIgniter\Database\BaseBuilder;
|
||||||
use CodeIgniter\Database\BaseResult;
|
use CodeIgniter\Database\BaseResult;
|
||||||
@ -28,8 +30,8 @@ use Dompdf\Dompdf;
|
|||||||
*/
|
*/
|
||||||
class ProductionService extends BaseService
|
class ProductionService extends BaseService
|
||||||
{
|
{
|
||||||
public array $TIPOS_PLANA = ['lp_bn','lp_color','lp_colorhq'];
|
public array $TIPOS_PLANA = ['lp_bn', 'lp_color', 'lp_colorhq'];
|
||||||
public array $TIPOS_ROTATIVA = ['lp_rot_bn','lp_rot_color'];
|
public array $TIPOS_ROTATIVA = ['lp_rot_bn', 'lp_rot_color'];
|
||||||
|
|
||||||
protected OrdenTrabajoModel $otModel;
|
protected OrdenTrabajoModel $otModel;
|
||||||
|
|
||||||
@ -86,7 +88,7 @@ class ProductionService extends BaseService
|
|||||||
$this->ot = $this->otModel->find($orden_trabajo_id);
|
$this->ot = $this->otModel->find($orden_trabajo_id);
|
||||||
$pedido = $this->ot->pedido();
|
$pedido = $this->ot->pedido();
|
||||||
$this->setPedido($pedido);
|
$this->setPedido($pedido);
|
||||||
$this->defaultMaquinaCorte = $this->maquinaModel->where('nombre',$this->defaultMaquinaCorteName)->first();
|
$this->defaultMaquinaCorte = $this->maquinaModel->where('nombre', $this->defaultMaquinaCorteName)->first();
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -162,7 +164,7 @@ class ProductionService extends BaseService
|
|||||||
"fecha_entrega_externo" => $this->pedido->fecha_entrega_externo,
|
"fecha_entrega_externo" => $this->pedido->fecha_entrega_externo,
|
||||||
];
|
];
|
||||||
$otDateId = $this->otDate->insert($data);
|
$otDateId = $this->otDate->insert($data);
|
||||||
$this->otDate->updateUserDateMap($this->ot->id,$data);
|
$this->otDate->updateUserDateMap($this->ot->id, $data);
|
||||||
return $otDateId;
|
return $otDateId;
|
||||||
}
|
}
|
||||||
protected function storeOrdenTrabajoUsers(): int|bool|string
|
protected function storeOrdenTrabajoUsers(): int|bool|string
|
||||||
@ -176,9 +178,9 @@ class ProductionService extends BaseService
|
|||||||
$this->storeOrdenTrabajoTareas();
|
$this->storeOrdenTrabajoTareas();
|
||||||
$this->storeOrdenTrabajoAcabadoTareas();
|
$this->storeOrdenTrabajoAcabadoTareas();
|
||||||
$this->storeOrdenTrabajoManipuladoTareas();
|
$this->storeOrdenTrabajoManipuladoTareas();
|
||||||
$this->storeOrdenTrabajoPreimpresionTareas();
|
// $this->storeOrdenTrabajoPreimpresionTareas();
|
||||||
$this->storeOrdenTrabajoEncuadernacionTareas();
|
$this->storeOrdenTrabajoEncuadernacionTareas();
|
||||||
$this->storeOrdenTrabajoExtraTareas();
|
// $this->storeOrdenTrabajoExtraTareas();
|
||||||
}
|
}
|
||||||
public function resetAllTareas(): BaseResult|bool
|
public function resetAllTareas(): BaseResult|bool
|
||||||
{
|
{
|
||||||
@ -208,8 +210,8 @@ class ProductionService extends BaseService
|
|||||||
$ot_tareas["orden"] = $p_linea_maquina->orden_planning ?? 0;
|
$ot_tareas["orden"] = $p_linea_maquina->orden_planning ?? 0;
|
||||||
$ot_tareas["maquina_id"] = $p_linea_maquina->id;
|
$ot_tareas["maquina_id"] = $p_linea_maquina->id;
|
||||||
$ot_tareas["imposicion_id"] = null;
|
$ot_tareas["imposicion_id"] = null;
|
||||||
$ot_tareas["tiempo_estimado"] = $p_linea->horas_maquina;
|
$ot_tareas["tiempo_estimado"] = $p_linea->horas_maquina * 3600;
|
||||||
$ot_tareas["tiempo_real"] = $p_linea->horas_maquina; //? Tiempo real se inserta manual?
|
$ot_tareas["tiempo_real"] = $p_linea->horas_maquina * 3600; //? Tiempo real se inserta manual?
|
||||||
$insert_query_result = $this->otTarea->insert($ot_tareas);
|
$insert_query_result = $this->otTarea->insert($ot_tareas);
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
$this->storeTareaCorte($p_linea);
|
$this->storeTareaCorte($p_linea);
|
||||||
@ -219,15 +221,17 @@ class ProductionService extends BaseService
|
|||||||
protected function storeTareaCorte(PresupuestoLineaEntity $pLinea): ?OrdenTrabajoTareaEntity
|
protected function storeTareaCorte(PresupuestoLineaEntity $pLinea): ?OrdenTrabajoTareaEntity
|
||||||
{
|
{
|
||||||
$otCorte = null;
|
$otCorte = null;
|
||||||
if($pLinea->isRotativa()){
|
if ($pLinea->isRotativa()) {
|
||||||
$tareaId = $this->otTarea->insert([
|
$tareaId = $this->otTarea->insert([
|
||||||
'orden_trabajo_id' => $this->ot->id,
|
'orden_trabajo_id' => $this->ot->id,
|
||||||
'presupuesto_linea_id' => $pLinea->id,
|
'presupuesto_linea_id' => $pLinea->id,
|
||||||
'nombre' => 'Corte',
|
'nombre' => 'Corte',
|
||||||
'maquina_id' => $this->defaultMaquinaCorte->id,
|
'maquina_id' => $this->defaultMaquinaCorte->id,
|
||||||
'orden' => $this->defaultMaquinaCorte->orden_planning,
|
'orden' => $this->defaultMaquinaCorte->orden_planning,
|
||||||
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte,
|
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
|
||||||
'tiempo_real' => $pLinea->rotativa_tiempo_corte
|
'tiempo_real' => $pLinea->rotativa_tiempo_corte * 60,
|
||||||
|
'is_corte' => true,
|
||||||
|
'tipo_corte' => "bobina",
|
||||||
]);
|
]);
|
||||||
$otCorte = $this->otTarea->find($tareaId);
|
$otCorte = $this->otTarea->find($tareaId);
|
||||||
}
|
}
|
||||||
@ -241,20 +245,20 @@ class ProductionService extends BaseService
|
|||||||
$p_linea_maquinas = $p_linea->maquinas();
|
$p_linea_maquinas = $p_linea->maquinas();
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
if (count($p_linea_maquinas) > 0) {
|
if (count($p_linea_maquinas) > 0) {
|
||||||
foreach ($p_linea_maquinas as $key => $linea) {
|
$linea_maquina = $p_linea_maquinas[0]; //Se obtiene la primera máquina aunque tenga varias
|
||||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||||
$ot_tareas["presupuesto_acabado_id"] = $p_linea->id;
|
$ot_tareas["presupuesto_acabado_id"] = $p_linea->id;
|
||||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
||||||
$ot_tareas["orden"] = $linea->orden_planning ?? 0;
|
$ot_tareas["orden"] = $linea_maquina->orden_planning ?? 100;
|
||||||
$ot_tareas["maquina_id"] = $linea->id;
|
$ot_tareas["maquina_id"] = $linea_maquina->id;
|
||||||
$ot_tareas["imposicion_id"] = null;
|
$ot_tareas["imposicion_id"] = null;
|
||||||
$this->otTarea->insert($ot_tareas);
|
$this->otTarea->insert($ot_tareas);
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||||
$ot_tareas["presupuesto_acabado_id"] = $p_linea->id;
|
$ot_tareas["presupuesto_acabado_id"] = $p_linea->id;
|
||||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
||||||
|
$ot_tareas["orden"] = 100;
|
||||||
$this->otTarea->insert($ot_tareas);
|
$this->otTarea->insert($ot_tareas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -267,20 +271,20 @@ class ProductionService extends BaseService
|
|||||||
$p_linea_maquinas = $p_linea->maquinas();
|
$p_linea_maquinas = $p_linea->maquinas();
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
if (count($p_linea_maquinas) > 0) {
|
if (count($p_linea_maquinas) > 0) {
|
||||||
foreach ($p_linea_maquinas as $key => $linea) {
|
$linea_maquina = $p_linea_maquinas[0]; //Se obtiene la primera máquina aunque tenga varias
|
||||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||||
$ot_tareas["presupuesto_manipulado_id"] = $p_linea->id;
|
$ot_tareas["presupuesto_manipulado_id"] = $p_linea->id;
|
||||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
||||||
$ot_tareas["orden"] = $linea->orden_planning ?? 0;
|
$ot_tareas["orden"] = $linea_maquina->orden_planning ?? 100;
|
||||||
$ot_tareas["maquina_id"] = $linea->id;
|
$ot_tareas["maquina_id"] = $linea_maquina->id;
|
||||||
$ot_tareas["imposicion_id"] = null;
|
$ot_tareas["imposicion_id"] = null;
|
||||||
$this->otTarea->insert($ot_tareas);
|
$this->otTarea->insert($ot_tareas);
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||||
$ot_tareas["presupuesto_manipulado_id"] = $p_linea->id;
|
$ot_tareas["presupuesto_manipulado_id"] = $p_linea->id;
|
||||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
||||||
|
$ot_tareas["orden"] = 100;
|
||||||
$this->otTarea->insert($ot_tareas);
|
$this->otTarea->insert($ot_tareas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -293,20 +297,20 @@ class ProductionService extends BaseService
|
|||||||
$p_linea_maquinas = $p_linea->maquinas();
|
$p_linea_maquinas = $p_linea->maquinas();
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
if (count($p_linea_maquinas) > 0) {
|
if (count($p_linea_maquinas) > 0) {
|
||||||
foreach ($p_linea_maquinas as $key => $linea) {
|
$linea_maquina = $p_linea_maquinas[0]; //Se obtiene la primera máquina aunque tenga varias
|
||||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||||
$ot_tareas["presupuesto_preimpresion_id"] = $p_linea->id;
|
$ot_tareas["presupuesto_preimpresion_id"] = $p_linea->id;
|
||||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
||||||
$ot_tareas["orden"] = $linea->orden_planning ?? 0;
|
$ot_tareas["orden"] = $linea_maquina->orden_planning ?? 100;
|
||||||
$ot_tareas["maquina_id"] = $linea->id;
|
$ot_tareas["maquina_id"] = $linea_maquina->id;
|
||||||
$ot_tareas["imposicion_id"] = null;
|
$ot_tareas["imposicion_id"] = null;
|
||||||
$this->otTarea->insert($ot_tareas);
|
$this->otTarea->insert($ot_tareas);
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||||
$ot_tareas["presupuesto_preimpresion_id"] = $p_linea->id;
|
$ot_tareas["presupuesto_preimpresion_id"] = $p_linea->id;
|
||||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
||||||
|
$ot_tareas["orden"] = 100;
|
||||||
$this->otTarea->insert($ot_tareas);
|
$this->otTarea->insert($ot_tareas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,20 +323,20 @@ class ProductionService extends BaseService
|
|||||||
$p_linea_maquinas = $p_linea->maquinas();
|
$p_linea_maquinas = $p_linea->maquinas();
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
if (count($p_linea_maquinas) > 0) {
|
if (count($p_linea_maquinas) > 0) {
|
||||||
foreach ($p_linea_maquinas as $key => $linea) {
|
$linea_maquina = $p_linea_maquinas[0]; //Se obtiene la primera máquina aunque tenga varias
|
||||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||||
$ot_tareas["presupuesto_encuadernado_id"] = $p_linea->id;
|
$ot_tareas["presupuesto_encuadernado_id"] = $p_linea->id;
|
||||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
||||||
$ot_tareas["orden"] = $linea->orden_planning ?? 0;
|
$ot_tareas["orden"] = $linea_maquina->orden_planning ?? 110;
|
||||||
$ot_tareas["maquina_id"] = $linea->id;
|
$ot_tareas["maquina_id"] = $linea_maquina->id;
|
||||||
$ot_tareas["imposicion_id"] = null;
|
$ot_tareas["imposicion_id"] = null;
|
||||||
$this->otTarea->insert($ot_tareas);
|
$this->otTarea->insert($ot_tareas);
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||||
$ot_tareas["presupuesto_encuadernado_id"] = $p_linea->id;
|
$ot_tareas["presupuesto_encuadernado_id"] = $p_linea->id;
|
||||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre ?? "";
|
||||||
|
$ot_tareas["orden"] = 110;
|
||||||
$this->otTarea->insert($ot_tareas);
|
$this->otTarea->insert($ot_tareas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -345,16 +349,15 @@ class ProductionService extends BaseService
|
|||||||
$p_linea_maquinas = $p_linea->maquinas();
|
$p_linea_maquinas = $p_linea->maquinas();
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
if (count($p_linea_maquinas) > 0) {
|
if (count($p_linea_maquinas) > 0) {
|
||||||
foreach ($p_linea_maquinas as $key => $linea) {
|
$linea_maquina = $p_linea_maquinas[0]; //Se obtiene la primera máquina aunque tenga varias
|
||||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||||
$ot_tareas["presupuesto_extra_id"] = $p_linea->id;
|
$ot_tareas["presupuesto_extra_id"] = $p_linea->id;
|
||||||
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
$ot_tareas["nombre"] = $p_linea->tarifa()->nombre;
|
||||||
$ot_tareas["orden"] = $linea->orden_planning;
|
$ot_tareas["orden"] = $linea_maquina->orden_planning ?? 0;
|
||||||
$ot_tareas["maquina_id"] = $linea->id;
|
$ot_tareas["maquina_id"] = $linea_maquina->id;
|
||||||
$ot_tareas["imposicion_id"] = null;
|
$ot_tareas["imposicion_id"] = null;
|
||||||
$this->otTarea->insert($ot_tareas);
|
$this->otTarea->insert($ot_tareas);
|
||||||
$ot_tareas = [];
|
$ot_tareas = [];
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
$ot_tareas["orden_trabajo_id"] = $this->ot->id;
|
||||||
$ot_tareas["presupuesto_extra_id"] = $p_linea->id;
|
$ot_tareas["presupuesto_extra_id"] = $p_linea->id;
|
||||||
@ -459,12 +462,12 @@ class ProductionService extends BaseService
|
|||||||
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
|
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
|
||||||
// ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
// ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
|
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
|
||||||
->where('lg_maquinas.is_rotativa',true)
|
->where('lg_maquinas.is_rotativa', true)
|
||||||
->where("orden_trabajo_tareas.deleted_at", null)
|
->where("orden_trabajo_tareas.deleted_at", null)
|
||||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||||
return $q;
|
return $q;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Query para mostrar en datatable
|
* Query para mostrar en datatable
|
||||||
*
|
*
|
||||||
* @return BaseBuilder
|
* @return BaseBuilder
|
||||||
@ -500,7 +503,7 @@ class ProductionService extends BaseService
|
|||||||
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
|
->join("lg_imposiciones", "lg_imposiciones.id = orden_trabajo_tareas.imposicion_id", "left")
|
||||||
// ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
// ->where("orden_trabajo_tareas.orden_trabajo_id", $this->ot->id)
|
||||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||||
->where('lg_maquinas.is_rotativa',false)
|
->where('lg_maquinas.is_rotativa', false)
|
||||||
->where("orden_trabajo_tareas.deleted_at", null)
|
->where("orden_trabajo_tareas.deleted_at", null)
|
||||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||||
return $q;
|
return $q;
|
||||||
@ -716,6 +719,10 @@ class ProductionService extends BaseService
|
|||||||
|
|
||||||
public function updateOrdenTrabajoTarea($tarea_id, $data): bool
|
public function updateOrdenTrabajoTarea($tarea_id, $data): bool
|
||||||
{
|
{
|
||||||
|
if (isset($data['maquina_id'])) {
|
||||||
|
$maquina = model(MaquinaModel::class)->find($data['maquina_id']);
|
||||||
|
$data['orden'] = $maquina->orden_planning;
|
||||||
|
}
|
||||||
return $this->otTarea->update($tarea_id, $data);
|
return $this->otTarea->update($tarea_id, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -725,16 +732,16 @@ class ProductionService extends BaseService
|
|||||||
$otDate = $this->otDate->where('orden_trabajo_id', $this->ot->id)
|
$otDate = $this->otDate->where('orden_trabajo_id', $this->ot->id)
|
||||||
->set([$data['name'] => $data[$data['name']]])
|
->set([$data['name'] => $data[$data['name']]])
|
||||||
->update($data);
|
->update($data);
|
||||||
$this->otDate->updateUserDateMap($this->ot->id,$data);
|
$this->otDate->updateUserDateMap($this->ot->id, $data);
|
||||||
$ot_users = $this->ot->users();
|
$ot_users = $this->ot->users();
|
||||||
if(isset($this->MAPPING_DATE_USER[$data["name"]])){
|
if (isset($this->MAPPING_DATE_USER[$data["name"]])) {
|
||||||
$user_id = $ot_users->{$this->MAPPING_DATE_USER[$data["name"]]};
|
$user_id = $ot_users->{$this->MAPPING_DATE_USER[$data["name"]]};
|
||||||
$user = $this->userModel->find($user_id);
|
$user = $this->userModel->find($user_id);
|
||||||
if($user_id){
|
if ($user_id) {
|
||||||
$result = ["user" => null, "status" => false];
|
$result = ["user" => null, "status" => false];
|
||||||
}
|
}
|
||||||
$result = ["user" => $user, "status" => $otDate];
|
$result = ["user" => $user, "status" => $otDate];
|
||||||
}else{
|
} else {
|
||||||
$result = ["user" => null, "status" => false];
|
$result = ["user" => null, "status" => false];
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
@ -817,4 +824,106 @@ class ProductionService extends BaseService
|
|||||||
{
|
{
|
||||||
return ["title" => lang('ot.filter_by_task'), 'id' => $id];
|
return ["title" => lang('ot.filter_by_task'), 'id' => $id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function querySelectMaquinaPlanningRotativa($q)
|
||||||
|
{
|
||||||
|
$query = $this->otModel->builder()->select([
|
||||||
|
"orden_trabajo_tareas.maquina_id as id",
|
||||||
|
"lg_maquinas.nombre as name",
|
||||||
|
])
|
||||||
|
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||||
|
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||||
|
->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||||
|
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
|
||||||
|
->where('lg_maquinas.is_rotativa', true)
|
||||||
|
->where("orden_trabajo_tareas.deleted_at", null)
|
||||||
|
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||||
|
if ($q) {
|
||||||
|
$query->like('lg_maquinas.nombre', $q);
|
||||||
|
}
|
||||||
|
return $query->get()->getResultArray();
|
||||||
|
}
|
||||||
|
public function querySelectMaquinaPlanningPlana($q)
|
||||||
|
{
|
||||||
|
$query = $this->otModel->builder()->select([
|
||||||
|
"orden_trabajo_tareas.maquina_id as id",
|
||||||
|
"lg_maquinas.nombre as name",
|
||||||
|
])
|
||||||
|
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||||
|
->join("orden_trabajo_dates", "orden_trabajo_dates.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||||
|
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||||
|
->join("lg_maquinas", "lg_maquinas.id = orden_trabajo_tareas.maquina_id", "left")
|
||||||
|
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||||
|
->where('lg_maquinas.is_rotativa', false)
|
||||||
|
->where("orden_trabajo_tareas.deleted_at", null)
|
||||||
|
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
||||||
|
if ($q) {
|
||||||
|
$query->like('lg_maquinas.nombre', $q);
|
||||||
|
}
|
||||||
|
return $query->get()->getResultArray();
|
||||||
|
}
|
||||||
|
public function querySelectPapelPlanningRot(string $q)
|
||||||
|
{
|
||||||
|
$query = $this->otModel->builder()->select([
|
||||||
|
"lg_papel_impresion.id",
|
||||||
|
"lg_papel_impresion.nombre as name",
|
||||||
|
])
|
||||||
|
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||||
|
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||||
|
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
|
||||||
|
->join("lg_papel_impresion", "presupuesto_linea.papel_impresion_id = lg_papel_impresion.id", "left")
|
||||||
|
->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_id", "left")
|
||||||
|
->where("orden_trabajo_tareas.deleted_at", null)
|
||||||
|
->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL, FALSE)
|
||||||
|
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
|
||||||
|
->groupBy('lg_papel_impresion.id');
|
||||||
|
if ($q) {
|
||||||
|
$query->like('lg_papel_impresion.nombre', $q);
|
||||||
|
}
|
||||||
|
return $query->get()->getResultArray();
|
||||||
|
}
|
||||||
|
public function querySelectPapelPlanningPlana($q)
|
||||||
|
{
|
||||||
|
$query = $this->otModel->builder()->select([
|
||||||
|
"lg_papel_impresion.id",
|
||||||
|
"lg_papel_impresion.nombre as name",
|
||||||
|
])
|
||||||
|
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||||
|
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||||
|
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
|
||||||
|
->join("lg_papel_impresion", "presupuesto_linea.papel_impresion_id = lg_papel_impresion.id", "left")
|
||||||
|
->join("lg_papel_formato", "lg_papel_formato.id = presupuestos.papel_formato_id", "left")
|
||||||
|
->where("orden_trabajo_tareas.deleted_at", null)
|
||||||
|
->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL, FALSE)
|
||||||
|
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||||
|
->groupBy('lg_papel_impresion.id');
|
||||||
|
if ($q) {
|
||||||
|
$query->like('lg_papel_impresion.nombre', $q);
|
||||||
|
}
|
||||||
|
return $query->get()->getResultArray();
|
||||||
|
}
|
||||||
|
public function tareaUpdateMaquinaCorte($orden_trabajo_id): bool
|
||||||
|
{
|
||||||
|
$cvm = model(ConfigVariableModel::class);
|
||||||
|
$otTarea = $this->otTarea->where('orden_trabajo_id', $orden_trabajo_id)->where('is_corte', true)->first();
|
||||||
|
$toggleCorte = "bobina";
|
||||||
|
if ($otTarea->tipo_corte == "bobina") {
|
||||||
|
$maquina_id = $cvm->where('name', "id_maquina_guillotina_corte_ot_tarea")->first()["value"];
|
||||||
|
$toggleCorte = "guillotina";
|
||||||
|
} elseif ($otTarea->tipo_corte == "guillotina") {
|
||||||
|
$maquina_id = $cvm->where('name', "id_maquina_bobina_corte_ot_tarea")->first()["value"];
|
||||||
|
$toggleCorte = "bobina";
|
||||||
|
} else {
|
||||||
|
$maquina_id = null;
|
||||||
|
}
|
||||||
|
return $this->otTarea
|
||||||
|
->where('orden_trabajo_id', $orden_trabajo_id)
|
||||||
|
->where('is_corte', true)
|
||||||
|
->set(["maquina_id" => $maquina_id, "tipo_corte" => $toggleCorte])
|
||||||
|
->update();
|
||||||
|
}
|
||||||
|
public function ordenTrabajoTareaCorte(int $ot_id): ?string
|
||||||
|
{
|
||||||
|
return $this->otTarea->where('orden_trabajo_id', $ot_id)->where('is_corte', true)?->first()->tipo_corte ?? null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,19 +56,19 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="nav-link"
|
class="nav-link presupuestos-btn"
|
||||||
role="tab"
|
role="tab"
|
||||||
data-bs-toggle="tab"
|
data-bs-toggle="tab"
|
||||||
data-bs-target="#facturacion"
|
data-bs-target="#presupuestos"
|
||||||
aria-controls="facturacion"
|
aria-controls="presupuestos"
|
||||||
aria-selected="false">
|
aria-selected="false">
|
||||||
Facturación
|
Presupuestos
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="nav-link"
|
class="nav-link pedidos-btn"
|
||||||
role="tab"
|
role="tab"
|
||||||
data-bs-toggle="tab"
|
data-bs-toggle="tab"
|
||||||
data-bs-target="#pedidos"
|
data-bs-target="#pedidos"
|
||||||
@ -77,6 +77,18 @@
|
|||||||
Pedidos
|
Pedidos
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="nav-link facturacion-btn"
|
||||||
|
role="tab"
|
||||||
|
data-bs-toggle="tab"
|
||||||
|
data-bs-target="#facturacion"
|
||||||
|
aria-controls="facturacion"
|
||||||
|
aria-selected="false">
|
||||||
|
Facturación
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -645,12 +657,16 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="tab-pane fade" id="presupuestos" role="tabpanel">
|
||||||
|
<?= view("themes/vuexy/form/clientes/cliente/_presupuestosClienteItems") ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="facturacion" role="tabpanel">
|
<div class="tab-pane fade" id="facturacion" role="tabpanel">
|
||||||
<h3>Proximanente</h3>
|
<?= view("themes/vuexy/form/clientes/cliente/_facturacionClienteItems") ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="pedidos" role="tabpanel">
|
<div class="tab-pane fade" id="pedidos" role="tabpanel">
|
||||||
<h3>Proximanente</h3>
|
<?= view("themes/vuexy/form/clientes/cliente/_pedidosClienteItems") ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane fade" id="usuarios" role="tabpanel">
|
<div class="tab-pane fade" id="usuarios" role="tabpanel">
|
||||||
@ -910,7 +926,6 @@ const actionBtns_add = function(data) {
|
|||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
function saveAdd_callback(){
|
function saveAdd_callback(){
|
||||||
if($('#addressForm').attr('action')=='create'){
|
if($('#addressForm').attr('action')=='create'){
|
||||||
editorAddress
|
editorAddress
|
||||||
@ -1127,9 +1142,11 @@ function delete_direccion_envio(dataId){
|
|||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.bootstrap5.min.css') ?>">
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.bootstrap5.min.css') ?>">
|
||||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-bs5/datatables.bootstrap5.css") ?>">
|
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-bs5/datatables.bootstrap5.css") ?>">
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/bootstrap-daterangepicker/bootstrap-daterangepicker.css') ?>" />
|
||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('additionalExternalJs') ?>
|
<?= $this->section('additionalExternalJs') ?>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/bootstrap-daterangepicker/bootstrap-daterangepicker.js') ?>"></script>
|
||||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></script>
|
||||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.js") ?>"></script>
|
||||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></script>
|
||||||
@ -1138,6 +1155,7 @@ function delete_direccion_envio(dataId){
|
|||||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||||
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||||
|
<script type="module" src="<?= site_url("assets/js/safekat/pages/cliente/clienteFacturacion.js") ?>"></script>
|
||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,55 @@
|
|||||||
|
<div class="row">
|
||||||
|
<div class="col-2">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="acumuladoFacturacion"><?= lang('Facturas.acumuladoFacturacion') ?></label>
|
||||||
|
<input readonly type="text" class="form-control autonumeric-currency-totales" id="acumuladoFacturacion" name="acumulado_facturacion">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="totalPendientePago"><?= lang('Facturas.totalPendientePago') ?></label>
|
||||||
|
<input readonly type="text" class="form-control autonumeric-currency-totales" id="totalPendientePago" name="numero_factura">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<table id="tableOfFacturasCliente" class="table table-striped table-hover" style="width: 100%;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><?= lang('Facturas.numeroFactura') ?></th>
|
||||||
|
<th><?= lang('Facturas.fechaFactura') ?></th>
|
||||||
|
<th><?= lang('Facturas.total') ?></th>
|
||||||
|
<th><?= lang('Facturas.estado') ?></th>
|
||||||
|
<th><?= lang('Facturas.estadoPago') ?></th>
|
||||||
|
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><input type="text" class="form-control factura-filter" name="numero"></th>
|
||||||
|
<th>
|
||||||
|
<input id="fechaFactura" type="text" class="form-control factura-filter" name="fecha_factura_at">
|
||||||
|
</th>
|
||||||
|
<th></th>
|
||||||
|
<th>
|
||||||
|
<?php if(!auth()->user()->inGroup('cliente-admin') && !auth()->user()->inGroup('cliente-editor')): ?>
|
||||||
|
<select class="form-control factura-filter-select" name="estado">
|
||||||
|
<option value=""><?= lang('Facturas.todos') ?></option>
|
||||||
|
<option value="borrador"><?= lang('Facturas.borrador') ?></option>
|
||||||
|
<option value="validada"><?= lang('Facturas.validada') ?></option>
|
||||||
|
</select>
|
||||||
|
<?php endif; ?>
|
||||||
|
</th>
|
||||||
|
<th>
|
||||||
|
<select class="form-control factura-filter-select" name="estado_pago">
|
||||||
|
<option value=""><?= lang('Facturas.todos') ?></option>
|
||||||
|
<option value="pendiente"><?= lang('Facturas.pendiente') ?></option>
|
||||||
|
<option value="pagada"><?= lang('Facturas.pagada') ?></option>
|
||||||
|
<option value="insolvente"><?= lang('Facturas.insolvente') ?></option>
|
||||||
|
</select>
|
||||||
|
</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
<div class="row">
|
||||||
|
<div class="col-2">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="pedidosImpresion"><?= lang('Pedidos.pedidosImpresion') ?></label>
|
||||||
|
<input readonly type="text" class="form-control autonumeric-currency-totales" id="pedidosImpresion"
|
||||||
|
name="pedidos_impresion">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="pedidosMaquetacion"><?= lang('Pedidos.pedidosMaquetacion') ?></label>
|
||||||
|
<input readonly type="text" class="form-control autonumeric-currency-totales" id="pedidosMaquetacion"
|
||||||
|
name="pedidos_maquetacion">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="totalPedidos" class="fw-bold"><?= lang('Pedidos.pedidosTotal') ?></label>
|
||||||
|
<input readonly type="text" class="form-control fw-bold autonumeric-currency-totales" id="totalPedidos"
|
||||||
|
name="total_pedidos">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<table id="tableOfPedidosCliente" class="table table-striped table-hover" style="width: 100%;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><?= lang('Pedidos.id') ?></th>
|
||||||
|
<th><?= lang('Pedidos.fecha') ?></th>
|
||||||
|
<th><?= lang('Pedidos.fecha_entrega') ?></th>
|
||||||
|
<th class='noFilter'><?= lang('Pedidos.num_paginas') ?></th>
|
||||||
|
<th class='totalizador'><?= lang('Pedidos.tiradas') ?></th>
|
||||||
|
<th class='totalizador'><?= lang('Pedidos.total_presupuesto') ?></th>
|
||||||
|
<th><?= lang('Pedidos.estado') ?></th>
|
||||||
|
<th class="noFilter text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><input type="text" class="form-control pedido-filter" name="id"></th>
|
||||||
|
<th><input id="fechaPedido_filter" type="text" class="form-control"
|
||||||
|
name="created_at">
|
||||||
|
</th>
|
||||||
|
<th><input id="fechaEntrega_filter" type="text" class="form-control"
|
||||||
|
name="fecha_entrega_at">
|
||||||
|
</th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
<th>
|
||||||
|
<select class="form-control pedido-filter-select" name="estado">
|
||||||
|
<option value=""><?= lang('Pedidos.todos')?></option>
|
||||||
|
<option value="validacion"><?= lang('Pedidos.validacion') ?></option>
|
||||||
|
<option value="produccion"><?= lang('Pedidos.produccion') ?></option>
|
||||||
|
<option value="finalizado"><?= lang('Pedidos.finalizado') ?></option>
|
||||||
|
<option value="enviado"><?= lang('Pedidos.enviado') ?></option>
|
||||||
|
<option value="cancelado"><?= lang('Pedidos.cancelado') ?></option>
|
||||||
|
</select>
|
||||||
|
</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
<div class="row">
|
||||||
|
<div class="col-2">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="presupuestosImpresion"><?= lang('Presupuestos.presupuestosImpresion') ?></label>
|
||||||
|
<input readonly type="text" class="form-control autonumeric-currency-totales" id="presupuestosImpresion"
|
||||||
|
name="presupuestos_impresion">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="presupuestosMaquetacion"><?= lang('Presupuestos.presupuestosMaquetacion') ?></label>
|
||||||
|
<input readonly type="text" class="form-control autonumeric-currency-totales" id="presupuestosMaquetacion"
|
||||||
|
name="presupuestos_maquetacion">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="totalPresupuestos" class="fw-bold"><?= lang('Presupuestos.presupuestosTotal') ?></label>
|
||||||
|
<input readonly type="text" class="form-control fw-bold autonumeric-currency-totales" id="totalPresupuestos"
|
||||||
|
name="total_presupuestos">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<table id="tableOfPresupuestosCliente" class="table table-striped table-hover" style="width: 100%;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 10%;"><?= lang('Presupuestos.id') ?></th>
|
||||||
|
<th style="width: 10%;"><?= lang('Presupuestos.fecha') ?></th>
|
||||||
|
<th style="width: 12%;"><?= lang('Presupuestos.comercial') ?></th>
|
||||||
|
<th style="width: 18%;"><?= lang('Presupuestos.titulo') ?></th>
|
||||||
|
<th style="width: 10%;"><?= lang('Presupuestos.paginas') ?></th>
|
||||||
|
<th style="width: 10%;"><?= lang('Presupuestos.tirada') ?></th>
|
||||||
|
<th style="width: 10%;"><?= lang('Presupuestos.total') ?></th>
|
||||||
|
<th style="width: 10%;"><?= lang('Presupuestos.estado') ?></th>
|
||||||
|
<th style="width: 10%;" class="noFilter text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><input type="text" class="form-control presupuesto-filter" name="id"></th>
|
||||||
|
<th><input id="fechaPresupuesto_filter" type="text" class="form-control"
|
||||||
|
name="created_at">
|
||||||
|
</th>
|
||||||
|
<th><input type="text" class="form-control presupuesto-filter" name="comercial"></th>
|
||||||
|
<th><input type="text" class="form-control presupuesto-filter" name="titulo"></th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
<th></th>
|
||||||
|
<th>
|
||||||
|
<select class="form-control presupuesto-filter-select" name="estado">
|
||||||
|
<option value=""><?= lang('Presupuestos.todos')?></option>
|
||||||
|
<option value="1"><?= lang('Presupuestos.borrador') ?></option>
|
||||||
|
<option value="2"><?= lang('Presupuestos.confirmado') ?></option>
|
||||||
|
</select>
|
||||||
|
</th>
|
||||||
|
<th></th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
@ -11,7 +11,10 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||||
</div><!--//.card-header -->
|
</div><!--//.card-header -->
|
||||||
<form id="clienteForm" method="post" class="card-body" action="<?= $formAction ?>">
|
<form id="clienteForm" data-cliente="<?=$clienteEntity->id?>"
|
||||||
|
data-url="<?= auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor') ?
|
||||||
|
'/presupuestos/presupuestocliente/edit/' : '/presupuestoadmin/edit//' ?>"
|
||||||
|
method="post" class="card-body" action="<?= $formAction ?>">
|
||||||
<?= csrf_field() ?>
|
<?= csrf_field() ?>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||||
|
|||||||
@ -33,7 +33,7 @@
|
|||||||
<i class="ti ti-box-multiple ti-lg"></i>
|
<i class="ti ti-box-multiple ti-lg"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-info">
|
<div class="card-info">
|
||||||
<h5 class="mb-0" id="ot-paginas"><?=$presupuesto->merma?></h5>
|
<h5 class="mb-0" id="ot-paginas"><?=$presupuesto->paginas?></h5>
|
||||||
<span class="fx-large"><?= @lang("Produccion.paginas") ?></span>
|
<span class="fx-large"><?= @lang("Produccion.paginas") ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
<i class="ti ti-bookmark ti-lg"></i>
|
<i class="ti ti-bookmark ti-lg"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-info">
|
<div class="card-info">
|
||||||
<h5 class="mb-0" id="ot-solapa"><?=$presupuesto->solapas?></h5>
|
<h5 class="mb-0" id="ot-solapa"><?=$presupuesto->solapas > 0 ? $presupuesto->solapas : 0?></h5>
|
||||||
|
|
||||||
<span class="fx-large"><?= @lang("Produccion.solapa") ?></span>
|
<span class="fx-large"><?= @lang("Produccion.solapa") ?></span>
|
||||||
</div>
|
</div>
|
||||||
@ -56,7 +56,7 @@
|
|||||||
<i class="ti ti-books ti-lg"></i>
|
<i class="ti ti-books ti-lg"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-info">
|
<div class="card-info">
|
||||||
<h5 class="mb-0" id="ot-tirada"></h5>
|
<h5 class="mb-0" id="ot-tirada"><?=$presupuesto->tirada?></h5>
|
||||||
|
|
||||||
<span class="fx-large"><?= @lang("Produccion.tirada") ?></span>
|
<span class="fx-large"><?= @lang("Produccion.tirada") ?></span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
<div class="sk-wave-rect"></div>
|
<div class="sk-wave-rect"></div>
|
||||||
<div class="sk-wave-rect"></div>
|
<div class="sk-wave-rect"></div>
|
||||||
</div>
|
</div>
|
||||||
<img class="card-img card-img-left img-thumbnail" id="portada-orden-trabajo" src="" hidden>
|
<img class="card-img card-img-left img-thumbnail" id="portada-orden-trabajo" src="<?=site_url('assets/img/portada_not_found.png')?>" hidden>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|||||||
@ -16,7 +16,11 @@
|
|||||||
<input class="form-control" type="file" id="portada-file-input">
|
<input class="form-control" type="file" id="portada-file-input">
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<button type="button" class="btn btn-primary w-100" id="btn-upload-portada"><i class="ti ti-md ti-upload"></i>Subir portada </button>
|
<div class="d-flex flex-row align-items-center justify-content-start gap-2">
|
||||||
|
<button type="button" class="btn btn-primary" id="btn-upload-portada"><i class="ti ti-md ti-upload"></i>Subir portada </button>
|
||||||
|
<button type="button" class="btn btn-danger" id="btn-delete-portada"><i class="ti ti-md ti-trash"></i>Eliminar </button>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -119,11 +119,13 @@
|
|||||||
|
|
||||||
<?= $this->section('css') ?>
|
<?= $this->section('css') ?>
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/formvalidation/dist/css/formValidation.min.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.css') ?>" />
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
<?= $this->section("additionalExternalJs") ?>
|
||||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/produccion/planning_rotativa/index.js") ?>"></script>
|
<script type="module" src="<?= site_url("assets/js/safekat/pages/produccion/planning_rotativa/index.js") ?>"></script>
|
||||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.js") ?>"></script>
|
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/FormValidation.js") ?>"></script>
|
||||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
|
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/Bootstrap5.min.js") ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script>
|
||||||
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
|
<script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -5,6 +5,7 @@
|
|||||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||||
<?= $this->section('content'); ?>
|
<?= $this->section('content'); ?>
|
||||||
<div id="ot-edit" data-id="<?= $modelId ?>">
|
<div id="ot-edit" data-id="<?= $modelId ?>">
|
||||||
|
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||||
<?= view("themes/vuexy/form/produccion/ot/otHeader") ?>
|
<?= view("themes/vuexy/form/produccion/ot/otHeader") ?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -33,9 +34,11 @@
|
|||||||
</form>
|
</form>
|
||||||
<div class="col-md-12 mt-3">
|
<div class="col-md-12 mt-3">
|
||||||
<div class="d-grip gap-2">
|
<div class="d-grip gap-2">
|
||||||
<a type="button" class="btn btn-primary btn-block w-100 mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>"><?= @lang("Produccion.preview_pdf") ?></a>
|
<a type="button" class="btn btn-outline-danger btn-block mb-1" target="__blank" href="<?= "/produccion/ordentrabajo/pdf/" . $modelId ?>">
|
||||||
<button type="button" class="btn btn-primary btn-block w-100 mb-1"><?= @lang("Produccion.imprimir_ferro") ?></button>
|
<span class="ti-sm ti ti-eye me-1"></span>
|
||||||
<button type="button" class="btn btn-secondary btn-block w-100 mb-1"><?= @lang("Produccion.imprimir_codigo_safekat") ?></button>
|
<?= @lang("Produccion.preview_pdf") ?></a>
|
||||||
|
<button type="button" class="btn btn-primary btn-block mb-1"><?= @lang("Produccion.imprimir_ferro") ?></button>
|
||||||
|
<button type="button" class="btn btn-secondary btn-block mb-1"><?= @lang("Produccion.imprimir_codigo_safekat") ?></button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
356
ci4/app/Views/themes/vuexy/pdfs/orden_trabajo copy.php
Normal file
356
ci4/app/Views/themes/vuexy/pdfs/orden_trabajo copy.php
Normal file
@ -0,0 +1,356 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use CodeIgniter\I18n\Time;
|
||||||
|
|
||||||
|
$session = session();
|
||||||
|
$settings = $session->get('settings');
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html
|
||||||
|
lang="<?= $session->get('lang') ?>"
|
||||||
|
data-assets-path="<?= site_url('themes/vuexy/') ?>"
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<!-- Icons -->
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>" />
|
||||||
|
|
||||||
|
<!-- Core CSS -->
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>" />
|
||||||
|
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/pdf.ot.css') ?>">
|
||||||
|
|
||||||
|
<title><?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>]</title>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="col-md-12" data-id=<?= $ot->id ?>>
|
||||||
|
<div class="header">
|
||||||
|
<div class="title"><?= $presupuesto->titulo ?></div>
|
||||||
|
<div style="font-size: medium;"> <strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></div>
|
||||||
|
</div>
|
||||||
|
<div class="section">
|
||||||
|
<div class="cover">
|
||||||
|
<div class="portada">
|
||||||
|
<img class="portada-img" src="<?= "data:image/png;base64," . base64_encode(file_get_contents(WRITEPATH . "uploads/" . $ot->portada_path)) ?>">
|
||||||
|
</div>
|
||||||
|
<div class="portada-info">
|
||||||
|
<div class="d-flex flex-row justify-content-end">
|
||||||
|
<h1 class="text-success"><?= $presupuesto->presupuestoLineaImpresion()->isRotativa() ? "Rotativa" : "Plana" ?></h1>
|
||||||
|
</div>
|
||||||
|
<div class="portada-row">
|
||||||
|
<span class="portada-text pl-2"><strong><?= $dates->fecha_encuadernado_at ? week_day_humanize(Time::createFromFormat("Y-m-d", $dates->fecha_encuadernado_at)->getDayOfWeek(), true) : "" ?></strong></span>
|
||||||
|
<div class="portada-text pr-2"><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </div>
|
||||||
|
</div>
|
||||||
|
<div class="portada-row-2 <?= $ot->fecha_entrega_warning ? "bg-red" : "bg-white" ?>">
|
||||||
|
<div style="display: flex;flex-direction:column;height:100%;width:25%">
|
||||||
|
<span class="portada-text date <?= $ot->fecha_entrega_warning ? "bg-red" : "bg-white" ?> " id="fecha_encuadernado_at"><?= $dates->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $dates->fecha_encuadernado_at)?->format("d/m/Y") : "" ?></span>
|
||||||
|
<!-- <div style="width: 100%;height: 100%;background-color:white;margin-left:0.5rem;margin-bottom:0.5rem">
|
||||||
|
|
||||||
|
</div> -->
|
||||||
|
<div class="pl-2">
|
||||||
|
<table id="table-portada-ubicacion">
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header">IN</th>
|
||||||
|
<td class="t-cell"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header">PO</th>
|
||||||
|
<td class="t-cell"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header">PL</th>
|
||||||
|
<td class="t-cell"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header">EN</th>
|
||||||
|
<td class="t-cell"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header">MA</th>
|
||||||
|
<td class="t-cell"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="display: flex;flex-direction:column;height:100%;width:10%" class="pt-2">
|
||||||
|
<div class="pl-2 pt-2">
|
||||||
|
<table id="table-portada-ubicacion">
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header" style="font-size: large;">RF</th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="square-wrapper">
|
||||||
|
<div class="square bg-white">
|
||||||
|
BCLF 100
|
||||||
|
</div>
|
||||||
|
<div class="square bg-white">
|
||||||
|
0:3
|
||||||
|
</div>
|
||||||
|
<div class="square bg-gray">
|
||||||
|
EM 300
|
||||||
|
</div>
|
||||||
|
<div class="square bg-blue">
|
||||||
|
BRILLO
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="cod">
|
||||||
|
<div class="code-code">
|
||||||
|
<p style="line-height: 0px;font-size:20px"><?= $ot->id ?></p>
|
||||||
|
</div>
|
||||||
|
<div class="cod-barras">
|
||||||
|
<img src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="section">
|
||||||
|
<div class="flex-row">
|
||||||
|
<div class="flex-col" id="presupuesto-section">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Cliente</th>
|
||||||
|
<td class="t-cell ">
|
||||||
|
<p class="cliente-title"><?= $cliente->nombre ?></p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Titulo</th>
|
||||||
|
<td class="t-cell ">
|
||||||
|
<p class="presupuesto-title"><?= $presupuesto->titulo ?></p>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>ISBN</th>
|
||||||
|
<td class="t-cell"><?= $presupuesto->isbn ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>CIF</th>
|
||||||
|
<td class="t-cell"><?= $cliente->cif ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="esquema-imposicion-wrapper">
|
||||||
|
<div class="esquema">
|
||||||
|
<div class="pagina-imposicion-outer-start">
|
||||||
|
<div class="pagina-imposicion-inner">
|
||||||
|
A
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pagina-imposicion-outer">
|
||||||
|
<div class="pagina-imposicion-inner">
|
||||||
|
A
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pagina-imposicion-outer">
|
||||||
|
<div class="pagina-imposicion-inner">
|
||||||
|
A
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pagina-imposicion-outer-end">
|
||||||
|
<div class="pagina-imposicion-inner">
|
||||||
|
A
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="imposicion">
|
||||||
|
<table style="width: 400%;">
|
||||||
|
<tr>
|
||||||
|
<th>Imposicion</th>
|
||||||
|
<td>400x400</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-title impresion">IMP. INTERIOR</div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||||
|
<th>Páginas</th>
|
||||||
|
<th>Ejemplares</th>
|
||||||
|
<th>Tintas</th>
|
||||||
|
<th>Formas</th>
|
||||||
|
<th>Máquina</th>
|
||||||
|
<th>Clics</th>
|
||||||
|
<th>Tiempo</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?= $presupuesto->paginas ?></td>
|
||||||
|
<td><?= $presupuesto->tirada ?></td>
|
||||||
|
<td>??</td>
|
||||||
|
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
|
||||||
|
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
|
||||||
|
<td><?= $linea_impresion->rotativa_clicks_total ?></td>
|
||||||
|
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
|
||||||
|
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||||
|
<td colspan="2"><?= number_format($linea_impresion->rotativa_metros_total, 2, ',', '.') ?> metros</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="comments">
|
||||||
|
<div class="flex-row impresion">Comentarios impresión interior</div>
|
||||||
|
<div class="comment-content">
|
||||||
|
<p>
|
||||||
|
</p>
|
||||||
|
<br />
|
||||||
|
<p>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-title cubierta">IMP. CUBIERTA</div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||||
|
<th>Tintas</th>
|
||||||
|
<th>Ejemplares</th>
|
||||||
|
<th>Maquina</th>
|
||||||
|
<th>Marcapaginas</th>
|
||||||
|
<th>Tiempo</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>??</td>
|
||||||
|
<td><?= $presupuesto->tirada ?></td>
|
||||||
|
<td><strong><?= $linea_cubierta->maquina()->nombre ?></strong></td>
|
||||||
|
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
|
||||||
|
<td><?= float_seconds_to_hhmm_string($linea_cubierta->horas_maquina * 3600) ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="1"><?= json_decode($linea_cubierta->formas)->maquina_ancho ?>x<?= json_decode($linea_cubierta->formas)->maquina_alto ?></td>
|
||||||
|
<td colspan="1"><?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?></td>
|
||||||
|
<td colspan="2"><?= $linea_cubierta->papel_impresion ?></td>
|
||||||
|
<td colspan="2"><?= $linea_cubierta->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="comments">
|
||||||
|
<div class="flex-row cubierta">Comentarios cubierta</div>
|
||||||
|
<div class="comment-content">
|
||||||
|
<p>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-title encuadernacion">ENCUADERNACIÓN</div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th class="t-header">Plastificado</th>
|
||||||
|
<td class="t-cell"><?= $acabados[0]->tarifa()->nombre ?></td>
|
||||||
|
<th class="t-header" style="width: 10%;">UVI</th>
|
||||||
|
<td class="t-cell"> ?? </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th class="t-header">MAQUINA</th>
|
||||||
|
<td class="t-cell"><?= implode("/", array_map(fn($q) => $q->nombre, $acabados[0]->maquinas())) ?> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th class="t-header">OPERARIO</th>
|
||||||
|
<td class="t-cell"><?= $ot->users()->plastificado_by->getFullName() ?> </td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php if (count($encuadernaciones) > 0): ?>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Encuadernacion</th>
|
||||||
|
<th>Solapas</th>
|
||||||
|
<th>Sobrecubierta</th>
|
||||||
|
<th>Plegado</th>
|
||||||
|
<th>Guardas</th>
|
||||||
|
<th>Retractilado</th>
|
||||||
|
<th>Marcapáginas</th>
|
||||||
|
</tr>
|
||||||
|
<?php foreach ($encuadernaciones as $key => $value): ?>
|
||||||
|
<tr>
|
||||||
|
<td><?= $value->tarifa()->nombre ?></td>
|
||||||
|
<td><?= $presupuesto->solapas ? "SI" : "NO" ?></td>
|
||||||
|
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td>
|
||||||
|
<td> ______ pliegos de ______ </td>
|
||||||
|
<td><?= $presupuesto->guardas ? "SI" : "NO" ?></td>
|
||||||
|
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
|
||||||
|
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
<div class="comments">
|
||||||
|
<div class="flex-row encuadernacion">Comentarios encuadernacion:</div>
|
||||||
|
<div class="comment-content">
|
||||||
|
<p>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="section">
|
||||||
|
<div class="section-title">LOGISTICA</div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Peso Unidad</th>
|
||||||
|
<th>Peso Pedido</th>
|
||||||
|
<th>Cajas</th>
|
||||||
|
<th>Corte Pie</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
|
||||||
|
<td><?= $peso_pedido > 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> </td>
|
||||||
|
<td>-</td>
|
||||||
|
<td>-</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="comments">
|
||||||
|
<div class="flex-row">Comentarios logistica:</div>
|
||||||
|
<div class="comment-content">
|
||||||
|
<p>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
© 2024 SAFEKAT. Todos los derechos reservados.
|
||||||
|
</div>
|
||||||
|
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@ -1,126 +1,161 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use CodeIgniter\I18n\Time;
|
use CodeIgniter\I18n\Time;
|
||||||
|
|
||||||
|
$session = session();
|
||||||
|
$settings = $session->get('settings');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="es">
|
<html
|
||||||
|
lang="<?= $session->get('lang') ?>"
|
||||||
|
data-assets-path="<?= site_url('themes/vuexy/') ?>"
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<!-- Icons -->
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/fontawesome.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/tabler-icons.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/fonts/flag-icons.css') ?>" />
|
||||||
|
|
||||||
|
<!-- Core CSS -->
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/core.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/rtl/theme-semi-dark.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/safekat.css') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.css') ?>" />
|
||||||
|
<link rel="icon" type="image/x-icon" href="<?= site_url('themes/vuexy/img/favicon/favicon.ico') ?>" />
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/pdf.ot.css') ?>">
|
||||||
|
|
||||||
|
<title><?= $presupuesto->titulo ?>[OT:<?= $ot->id ?>]</title>
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/pdf.ot.css') ?>">
|
|
||||||
<title>Rotativa</title>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div>
|
|
||||||
<div class="header">
|
<div class="col-md-12" data-id=<?= $ot->id ?>>
|
||||||
<div class="title"><?= $presupuesto->titulo ?></div>
|
<div class="row">
|
||||||
<div><?= Time::now()->format("d/m/Y H:i:s") ?></div>
|
<div class="col-12 d-flex justify-content-between align-items-center">
|
||||||
|
<h4><?= $presupuesto->titulo ?></h4>
|
||||||
|
<span class="fs-medium"><strong><?= Time::now()->format("d/m/Y H:i:s") ?></strong></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="section">
|
|
||||||
<div class="cover">
|
|
||||||
<div class="portada">
|
|
||||||
<img class="portada-img" src="<?= "data:image/png;base64," . base64_encode(file_get_contents(WRITEPATH . "uploads/" . $ot->portada_path)) ?>">
|
|
||||||
</div>
|
|
||||||
<div class="portada-info">
|
|
||||||
<div class="portada-row">
|
|
||||||
<p class="portada-text pl-2"><strong><?= $dates->fecha_encuadernado_at ? week_day_humanize(Time::createFromFormat("Y-m-d", $dates->fecha_encuadernado_at)->getDayOfWeek(),true) : "" ?></strong></p>
|
|
||||||
<div class="portada-text pr-2"><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </div>
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="row mb-2 d-flex flex align-items-stretch">
|
||||||
|
<div class="col-2">
|
||||||
|
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->portada_path ? "data:image/png;base64,".base64_encode(file_get_contents(WRITEPATH . "uploads/" . $ot->portada_path)): '/assets/img/portada_not_found.png' ?>" />
|
||||||
|
</div>
|
||||||
|
<div class="col-10 <?= $ot->fecha_entrega_warning ? "bg-danger" : "bg-secondary" ?> py-2 rounded border-1 border-secondary">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-8">
|
||||||
|
<div class="px-2 d-flex flex justify-content-between align-items-center mb-2 border boder-1 border-dark bg-primary text-white rounded-pill bordered border-secondary">
|
||||||
|
<span><strong><?= $dates->fecha_encuadernado_at ? week_day_humanize(Time::createFromFormat("Y-m-d", $dates->fecha_encuadernado_at)->getDayOfWeek(), true) : "" ?></strong></span>
|
||||||
|
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
|
||||||
</div>
|
</div>
|
||||||
<div class="portada-row-2">
|
</div>
|
||||||
<div style="display: flex;flex-direction:column;height:100%;width:25%">
|
<div class="col-4">
|
||||||
<p class="portada-text date" id="fecha_encuadernado_at"><?= $dates->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $dates->fecha_encuadernado_at)?->format("d/m/Y") : "" ?></p>
|
<div class="px-2 d-flex flex justify-content-center align-items-center mb-2 border boder-1 border-dark bg-success rounded-pill">
|
||||||
<!-- <div style="width: 100%;height: 100%;background-color:white;margin-left:0.5rem;margin-bottom:0.5rem">
|
<span class="text-white"><strong><?= $presupuesto->presupuestoLineaImpresion()->isRotativa() ? "Rotativa" : "Plana" ?></strong></span>
|
||||||
|
|
||||||
</div> -->
|
|
||||||
<div class="pl-2">
|
|
||||||
<table id="table-portada-ubicacion">
|
|
||||||
<tr class="t-row">
|
|
||||||
<th class="t-header">IN</th>
|
|
||||||
<td class="t-cell"><?= $ubicacion ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="t-row">
|
|
||||||
<th class="t-header">PO</th>
|
|
||||||
<td class="t-cell"><?= $ubicacion ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="t-row">
|
|
||||||
<th class="t-header">PL</th>
|
|
||||||
<td class="t-cell"><?= $ubicacion ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="t-row">
|
|
||||||
<th class="t-header">EN</th>
|
|
||||||
<td class="t-cell"><?= $ubicacion ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="t-row">
|
|
||||||
<th class="t-header">MA</th>
|
|
||||||
<td class="t-cell"><?= $ubicacion ?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div style="display: flex;flex-direction:column;height:100%;width:10%" class="pt-2">
|
|
||||||
<div class="pl-2 pt-2">
|
|
||||||
<table id="table-portada-ubicacion">
|
|
||||||
<tr class="t-row">
|
|
||||||
<th class="t-header" style="font-size: large;">RF</th>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="square-wrapper">
|
|
||||||
<div class="square bg-white">
|
|
||||||
BCLF 100
|
|
||||||
</div>
|
|
||||||
<div class="square bg-white">
|
|
||||||
0:3
|
|
||||||
</div>
|
|
||||||
<div class="square bg-gray">
|
|
||||||
EM 300
|
|
||||||
</div>
|
|
||||||
<div class="square bg-blue">
|
|
||||||
BRILLO
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="cod">
|
|
||||||
<div class="code-code">
|
|
||||||
<p style="line-height: 0px;font-size:20px"><?= $ot->id ?></p>
|
|
||||||
</div>
|
|
||||||
<div class="cod-barras"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="section">
|
|
||||||
<div class="flex-row">
|
|
||||||
<div class="flex-col" id="presupuesto-section">
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<th>Cliente</th>
|
|
||||||
<td class="t-cell ">
|
|
||||||
<p class="cliente-title"><?= $cliente->nombre ?></p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th>Titulo</th>
|
|
||||||
<td class="t-cell ">
|
|
||||||
<p class="presupuesto-title"><?= $presupuesto->titulo ?></p>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
<div class="row p-2">
|
||||||
<tr>
|
<div class="col-4 h-100">
|
||||||
<th>ISBN</th>
|
<div class="row px-2 d-flex flex justify-content-between align-items-center">
|
||||||
<td class="t-cell"><?= $presupuesto->isbn ?></td>
|
<div class="col-6 w-75 border border-1 border-dark text-center <?= $ot->fecha_entrega_warning ? "bg-danger" : "bg-secondary" ?> ">
|
||||||
</tr>
|
<span class="text-white" id="fecha_encuadernado_at"><strong><?= $dates->fecha_encuadernado_at ? Time::createFromFormat("Y-m-d", $dates->fecha_encuadernado_at)?->format("d/m/Y") : "" ?></strong></span>
|
||||||
<tr>
|
</div>
|
||||||
<th>CIF</th>
|
<div class="col-6 w-25 border border-1 border-dark text-center bg-secondary text-white">
|
||||||
<td class="t-cell"><?= $cliente->cif ?></td>
|
<strong>RF</strong>
|
||||||
</tr>
|
</div>
|
||||||
</table>
|
</div>
|
||||||
|
<div class="row px-2 mt-2 h-100">
|
||||||
|
<table class="h-100">
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header">IN</th>
|
||||||
|
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header">PO</th>
|
||||||
|
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header">PL</th>
|
||||||
|
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header">EN</th>
|
||||||
|
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr class="t-row">
|
||||||
|
<th class="t-header">MA</th>
|
||||||
|
<td class="t-cell bg-white"><?= $ubicacion ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<div class="row h-100">
|
||||||
|
<div class="col-6 h-50 square text-center text-dark bg-secondary border border-right border-dark">
|
||||||
|
BCLF 100
|
||||||
|
</div>
|
||||||
|
<div class="col-6 h-50 square text-center text-dark bg-secondary border border-right border-dark">
|
||||||
|
0:3
|
||||||
|
</div>
|
||||||
|
<div class="col-6 h-50 square bg-primary text-center text-white border border-right border-dark">
|
||||||
|
EM 300
|
||||||
|
</div>
|
||||||
|
<div class="col-6 h-50 square bg-blue text-center text-dark bg-secondary border border-right border-dark">
|
||||||
|
BRILLO
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-4 bg-warning border border-dark">
|
||||||
|
<div class="row h-100">
|
||||||
|
<div class="col-12 h-25 d-flex flex align-items-center justify-content-center">
|
||||||
|
<span class="fs-large text-white"><strong><?= $ot->id ?></strong></span>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 h-75 d-flex flex align-items-center justify-content-center bg-white">
|
||||||
|
<img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="col-8">
|
||||||
|
<table class="h-100">
|
||||||
|
<tr>
|
||||||
|
<th>Cliente</th>
|
||||||
|
<td class="t-cell ">
|
||||||
|
<?= $cliente->nombre ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Titulo</th>
|
||||||
|
<td class="t-cell ">
|
||||||
|
<?= $presupuesto->titulo ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>ISBN</th>
|
||||||
|
<td class="t-cell"><?= $presupuesto->isbn ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>CIF</th>
|
||||||
|
<td class="t-cell"><?= $cliente->cif ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="col-4">
|
||||||
|
<div class="col-12 mb-2">
|
||||||
<div class="esquema-imposicion-wrapper">
|
<div class="esquema-imposicion-wrapper">
|
||||||
<div class="esquema">
|
<div class="esquema">
|
||||||
<div class="pagina-imposicion-outer-start">
|
<div class="pagina-imposicion-outer-start">
|
||||||
@ -144,52 +179,56 @@ use CodeIgniter\I18n\Time;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="imposicion">
|
|
||||||
<table style="width: 400%;">
|
|
||||||
<tr>
|
|
||||||
<th>Imposicion</th>
|
|
||||||
<td>400x400</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="imposicion">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>Imposicion</th>
|
||||||
|
<td>??</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="section-title impresion">IMP. INTERIOR</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<div>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||||
|
<th>Páginas</th>
|
||||||
|
<th>Ejemplares</th>
|
||||||
|
<th>Tintas</th>
|
||||||
|
<th>Formas</th>
|
||||||
|
<th>Máquina</th>
|
||||||
|
<th>Clics</th>
|
||||||
|
<th>Tiempo</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><?= $presupuesto->paginas ?></td>
|
||||||
|
<td><?= $presupuesto->tirada ?></td>
|
||||||
|
<td>??</td>
|
||||||
|
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
|
||||||
|
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
|
||||||
|
<td><?= $linea_impresion->rotativa_clicks_total ?></td>
|
||||||
|
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
|
||||||
|
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
|
||||||
|
<td colspan="2"><?= number_format($linea_impresion->rotativa_metros_total, 2, ',', '.') ?> metros</td>
|
||||||
|
|
||||||
<div class="section">
|
</tr>
|
||||||
<div class="section-title impresion">IMP. INTERIOR</div>
|
</table>
|
||||||
<table>
|
</div>
|
||||||
<tr>
|
|
||||||
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_impresion->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
|
||||||
<th>Páginas</th>
|
|
||||||
<th>Ejemplares</th>
|
|
||||||
<th>Tintas</th>
|
|
||||||
<th>Formas</th>
|
|
||||||
<th>Máquina</th>
|
|
||||||
<th>Clics</th>
|
|
||||||
<th>Tiempo</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td><?= $presupuesto->paginas ?></td>
|
|
||||||
<td><?= $presupuesto->tirada ?></td>
|
|
||||||
<td>??</td>
|
|
||||||
<td><?= json_decode($linea_impresion->formas)->formas ?></td>
|
|
||||||
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
|
|
||||||
<td><?= $linea_impresion->rotativa_clicks_total ?></td>
|
|
||||||
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="4"><?= $linea_impresion->papel_impresion ?></td>
|
|
||||||
<td><?= $linea_impresion->papel_impresion()->gramaje . " " . "gr" ?></td>
|
|
||||||
<td colspan="2">_________ metros</td>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div class="comments">
|
<div class="comments">
|
||||||
<div class="flex-row impresion">Comentarios impresión interior</div>
|
<div class="flex-row impresion">Comentarios impresión interior</div>
|
||||||
<div class="comment-content">
|
<div class="comment-content w-100">
|
||||||
<p>
|
<p>
|
||||||
</p>
|
</p>
|
||||||
<br />
|
<br />
|
||||||
@ -198,9 +237,11 @@ use CodeIgniter\I18n\Time;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="section-title cubierta">IMP. CUBIERTA</div>
|
||||||
|
<div class="col-12">
|
||||||
|
|
||||||
<div class="section">
|
|
||||||
<div class="section-title cubierta">IMP. CUBIERTA</div>
|
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
<td rowspan="3" class="row-logo-impresion"><img src="<?= site_url($linea_cubierta->get_impresion_logo()) ?>" width="35px" height="35px"></td>
|
||||||
@ -233,51 +274,53 @@ use CodeIgniter\I18n\Time;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="section">
|
|
||||||
<div class="section-title encuadernacion">ENCUADERNACIÓN</div>
|
</div>
|
||||||
|
<div class="row mb-2">
|
||||||
|
<div class="section-title encuadernacion">ENCUADERNACIÓN</div>
|
||||||
|
<div class="col-12">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="t-header">Plastificado</th>
|
<th class="t-header" style="width: 10%;">Plastificado</th>
|
||||||
<td class="t-cell"><?= $acabados[0]->tarifa()->nombre ?></td>
|
<td class="t-cell"><?= $acabados[0]->tarifa()->nombre ?></td>
|
||||||
<th class="t-header" style="width: 10%;">UVI</th>
|
<th class="t-header" style="width: 10%;">UVI</th>
|
||||||
<td class="t-cell"> ?? </td>
|
<td class="t-cell"> ?? </td>
|
||||||
|
<th class="t-header" style="width: 10%;">Máquina</th>
|
||||||
|
<td class="t-cell"><?= implode("/", array_map(fn($q) => $q->nombre, $acabados[0]->maquinas())) ?> </td>
|
||||||
|
<th class="t-header" style="width: 10%;">Operario</th>
|
||||||
|
<td class="t-cell"><?= $ot->users()->plastificado_by?->getFullName() ?? null ?> </td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="t-header">MAQUINA</th>
|
<th>Encuadernacion</th>
|
||||||
<td class="t-cell"> ?? </td>
|
<th>Solapas</th>
|
||||||
|
<th>Sobrecubierta</th>
|
||||||
|
<th>Plegado</th>
|
||||||
|
<th>Guardas</th>
|
||||||
|
<th>Retractilado</th>
|
||||||
|
<th>Marcapáginas</th>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
<?php if (count($encuadernaciones) > 0): ?>
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<th class="t-header">OPERARIO</th>
|
|
||||||
<td class="t-cell"> ?? </td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<?php if (count($encuadernaciones) > 0): ?>
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<th>Encuadernacion</th>
|
|
||||||
<th>Solapas</th>
|
|
||||||
<th>Sobrecubierta</th>
|
|
||||||
<th>Plegado</th>
|
|
||||||
<th>Guardas</th>
|
|
||||||
<th>Retractilado</th>
|
|
||||||
<th>Marcapáginas</th>
|
|
||||||
</tr>
|
|
||||||
<?php foreach ($encuadernaciones as $key => $value): ?>
|
<?php foreach ($encuadernaciones as $key => $value): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= $value->tarifa()->nombre ?></td>
|
<td><?= $value->tarifa()->nombre ?></td>
|
||||||
<td><?= $presupuesto->solapas ? "SI" : "NO" ?></td>
|
<td><?= $presupuesto->solapas ? "SI" : "NO" ?></td>
|
||||||
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td>
|
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td>
|
||||||
<td> ______ pliegos de ______ </td>
|
<td> <?= $linea_impresion->pliegos_libro?>/<?=$linea_impresion->pliegos_pedido?> </td>
|
||||||
<td><?= $presupuesto->guardas ? "SI" : "NO" ?></td>
|
<td><?= $presupuesto->guardas ? "SI" : "NO" ?></td>
|
||||||
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
|
<td><?= $presupuesto->retractilado ? "SI" : "NO" ?></td>
|
||||||
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
|
<td><?= $presupuesto->marcapaginas ? "SI" : "NO" ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
<?php else: ?>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7">Sin encuadernación</td>
|
||||||
|
</tr>
|
||||||
|
<?php endif; ?>
|
||||||
|
</table>
|
||||||
|
<?php if (count($encuadernaciones) > 0): ?>
|
||||||
|
|
||||||
<div class="comments">
|
<div class="comments">
|
||||||
<div class="flex-row encuadernacion">Comentarios encuadernacion:</div>
|
<div class="flex-row encuadernacion">Comentarios encuadernacion:</div>
|
||||||
<div class="comment-content">
|
<div class="comment-content">
|
||||||
@ -286,10 +329,13 @@ use CodeIgniter\I18n\Time;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="section">
|
</div>
|
||||||
<div class="section-title">LOGISTICA</div>
|
<div class="row mb-2">
|
||||||
|
<div class="section-title">LOGISTICA</div>
|
||||||
|
<div class="col-12">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Peso Unidad</th>
|
<th>Peso Unidad</th>
|
||||||
@ -298,8 +344,8 @@ use CodeIgniter\I18n\Time;
|
|||||||
<th>Corte Pie</th>
|
<th>Corte Pie</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= $peso_unidad ?>gr</td>
|
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td>
|
||||||
<td><?= $peso_pedido ?>gr</td>
|
<td><?= $peso_pedido > 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> </td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
<td>-</td>
|
<td>-</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -312,11 +358,21 @@ use CodeIgniter\I18n\Time;
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer">
|
|
||||||
© 2024 SAFEKAT. Todos los derechos reservados.
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-12 d-flex justify-content-center align-items-center">
|
||||||
|
<span>© 2024 SAFEKAT. Todos los derechos reservados.</span>
|
||||||
|
</div>
|
||||||
|
<script src=<?= site_url("themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js") ?>></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/jquery/jquery.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/popper/popper.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/js/bootstrap.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/flatpickr/flatpickr.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/libs/hammer/hammer.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('themes/vuexy/vendor/js/menu.js') ?>"></script>
|
||||||
|
<script src="<?= site_url('assets/js/safekat/pages/pdf/otDownload.js') ?>"></script>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@ -17,7 +17,8 @@
|
|||||||
"firebase/php-jwt": "^6.10",
|
"firebase/php-jwt": "^6.10",
|
||||||
"hermawan/codeigniter4-datatables": "^0.7.2",
|
"hermawan/codeigniter4-datatables": "^0.7.2",
|
||||||
"nicolab/php-ftp-client": "^2.0",
|
"nicolab/php-ftp-client": "^2.0",
|
||||||
"phpseclib/phpseclib": "~3.0"
|
"phpseclib/phpseclib": "~3.0",
|
||||||
|
"picqer/php-barcode-generator": "^3.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fakerphp/faker": "^1.9",
|
"fakerphp/faker": "^1.9",
|
||||||
|
|||||||
87
ci4/composer.lock
generated
87
ci4/composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "939889ce4de6a8168b475984ff4401bd",
|
"content-hash": "e811712016c9f7c27fff6e0007f6bc44",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "codeigniter4/framework",
|
"name": "codeigniter4/framework",
|
||||||
@ -937,6 +937,87 @@
|
|||||||
],
|
],
|
||||||
"time": "2024-09-16T03:06:04+00:00"
|
"time": "2024-09-16T03:06:04+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "picqer/php-barcode-generator",
|
||||||
|
"version": "v3.2.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/picqer/php-barcode-generator.git",
|
||||||
|
"reference": "3ef0b26ebd3996e8bb9e90fa2059a67d2e482b3e"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/picqer/php-barcode-generator/zipball/3ef0b26ebd3996e8bb9e90fa2059a67d2e482b3e",
|
||||||
|
"reference": "3ef0b26ebd3996e8bb9e90fa2059a67d2e482b3e",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-mbstring": "*",
|
||||||
|
"php": "^8.2"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpstan/phpstan": "^1.10",
|
||||||
|
"phpunit/phpunit": "^9.5"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-bcmath": "Barcode IMB (Intelligent Mail Barcode) needs bcmath extension",
|
||||||
|
"ext-gd": "For JPG and PNG generators, GD or Imagick is required",
|
||||||
|
"ext-imagick": "For JPG and PNG generators, GD or Imagick is required"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Picqer\\Barcode\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"LGPL-3.0-or-later"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Casper Bakker",
|
||||||
|
"email": "info@picqer.com",
|
||||||
|
"homepage": "https://picqer.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Nicola Asuni",
|
||||||
|
"email": "info@tecnick.com",
|
||||||
|
"homepage": "http://nicolaasuni.tecnick.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "An easy to use, non-bloated, barcode generator in PHP. Creates SVG, PNG, JPG and HTML images from the most used 1D barcode standards.",
|
||||||
|
"homepage": "https://github.com/picqer/php-barcode-generator",
|
||||||
|
"keywords": [
|
||||||
|
"CODABAR",
|
||||||
|
"Code11",
|
||||||
|
"Code93",
|
||||||
|
"EAN13",
|
||||||
|
"KIX",
|
||||||
|
"KIXCODE",
|
||||||
|
"MSI",
|
||||||
|
"POSTNET",
|
||||||
|
"Pharma",
|
||||||
|
"Standard 2 of 5",
|
||||||
|
"barcode",
|
||||||
|
"barcode generator",
|
||||||
|
"code128",
|
||||||
|
"code39",
|
||||||
|
"ean",
|
||||||
|
"html",
|
||||||
|
"jpeg",
|
||||||
|
"jpg",
|
||||||
|
"php",
|
||||||
|
"png",
|
||||||
|
"svg",
|
||||||
|
"upc"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/picqer/php-barcode-generator/issues",
|
||||||
|
"source": "https://github.com/picqer/php-barcode-generator/tree/v3.2.0"
|
||||||
|
},
|
||||||
|
"time": "2024-10-01T19:35:25+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/log",
|
"name": "psr/log",
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
@ -3033,12 +3114,12 @@
|
|||||||
],
|
],
|
||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": [],
|
"stability-flags": {},
|
||||||
"prefer-stable": false,
|
"prefer-stable": false,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "^8.2"
|
"php": "^8.2"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": {},
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "2.6.0"
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
httpdocs/assets/img/portada_not_found.png
Normal file
BIN
httpdocs/assets/img/portada_not_found.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
27
httpdocs/assets/js/safekat/api/maquinas.js
Normal file
27
httpdocs/assets/js/safekat/api/maquinas.js
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import Ajax from "../components/ajax.js"
|
||||||
|
|
||||||
|
const opts = {
|
||||||
|
findMaquina: (maquinaId) => {
|
||||||
|
return {
|
||||||
|
url: `/maquinas/${maquinaId}`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const findMaquina = (maquinaId) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
new Ajax(opts.findMaquina(maquinaId),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
(response) => {
|
||||||
|
resolve(response)
|
||||||
|
},
|
||||||
|
(error) => {
|
||||||
|
reject(error)
|
||||||
|
}
|
||||||
|
|
||||||
|
).get()
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
@ -34,7 +34,7 @@ class OrdenTrabajoDatatable {
|
|||||||
render: (d, t) => {
|
render: (d, t) => {
|
||||||
return `<div class="btn-group btn-group-sm">
|
return `<div class="btn-group btn-group-sm">
|
||||||
<a type="button" href="/produccion/ordentrabajo/edit/${d}" class=" btn btn-outline ot-edit"><i class="ti ti-eye ti-sm mx-2"></i></a>
|
<a type="button" href="/produccion/ordentrabajo/edit/${d}" class=" btn btn-outline ot-edit"><i class="ti ti-eye ti-sm mx-2"></i></a>
|
||||||
<a type="button" href="/produccion/ordentrabajo/pdf/${d}" class="btn btn-outline ot-pdf"><i class="ti ti-download ti-sm mx-2"></i></a>
|
<a type="button" target="_blank" href="/produccion/ordentrabajo/pdf/${d}" class="btn btn-outline ot-pdf"><i class="ti ti-download ti-sm mx-2"></i></a>
|
||||||
|
|
||||||
</div>`
|
</div>`
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,9 @@
|
|||||||
import ClassSelect from '../../components/select2.js';
|
import ClassSelect from '../../components/select2.js';
|
||||||
import tarifasClienteView from './tarifasCliente.js';
|
import tarifasClienteView from './tarifasCliente.js';
|
||||||
import ClienteUsuarios from './clienteUsuarios.js';
|
import ClienteUsuarios from './clienteUsuarios.js';
|
||||||
|
import ClienteFacturacion from './clienteFacturacion.js';
|
||||||
|
import ClientePedidos from './clientePedidos.js';
|
||||||
|
import ClientePresupuestos from './clientePresupuestos.js';
|
||||||
|
|
||||||
import Ajax from '../../components/ajax.js';
|
import Ajax from '../../components/ajax.js';
|
||||||
|
|
||||||
@ -23,6 +26,13 @@ class Cliente {
|
|||||||
|
|
||||||
init() {
|
init() {
|
||||||
|
|
||||||
|
AutoNumeric.multiple('.autonumeric-currency-totales',
|
||||||
|
{ decimalPlaces: 2,
|
||||||
|
currencySymbol: '€',
|
||||||
|
currencySymbolPlacement: 's',
|
||||||
|
digitGroupSeparator: '.',
|
||||||
|
decimalCharacter: ',' });
|
||||||
|
|
||||||
// Fuerza el foco en el campo de búsqueda de select2
|
// Fuerza el foco en el campo de búsqueda de select2
|
||||||
$(document).on('select2:open', () => {
|
$(document).on('select2:open', () => {
|
||||||
document.querySelector('.select2-search__field').focus();
|
document.querySelector('.select2-search__field').focus();
|
||||||
@ -55,12 +65,17 @@ class Cliente {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
(new ClienteFacturacion()).init();
|
||||||
|
(new ClientePedidos()).init();
|
||||||
|
(new ClientePresupuestos()).init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
|
||||||
const dropdown = document.querySelector(".dropdown-language");
|
const dropdown = document.querySelector(".dropdown-language");
|
||||||
const activeItem = dropdown.querySelector(".dropdown-menu .dropdown-item");
|
const activeItem = dropdown.querySelector(".dropdown-menu .dropdown-item");
|
||||||
let locale = 'es';
|
let locale = 'es';
|
||||||
@ -68,7 +83,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
locale = activeItem.getAttribute("data-language");
|
locale = activeItem.getAttribute("data-language");
|
||||||
}
|
}
|
||||||
|
|
||||||
new Ajax('/translate/getTranslation', { locale: locale, translationFile: ['ClienteContactos', 'ClientePrecios'] }, {},
|
new Ajax('/translate/getTranslation', { locale: locale, translationFile: ['ClienteContactos', 'ClientePrecios', 'datePicker'] }, {},
|
||||||
function(translations) {
|
function(translations) {
|
||||||
window.language = JSON.parse(translations);
|
window.language = JSON.parse(translations);
|
||||||
new Cliente().init();
|
new Cliente().init();
|
||||||
|
|||||||
156
httpdocs/assets/js/safekat/pages/cliente/clienteFacturacion.js
Normal file
156
httpdocs/assets/js/safekat/pages/cliente/clienteFacturacion.js
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
import Ajax from "../../components/ajax.js";
|
||||||
|
|
||||||
|
class ClienteFacturacion {
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
this.bsRangePickerRange = $('#' + 'fechaFactura');
|
||||||
|
this.clienteId = $('#clienteForm').attr('data-cliente');
|
||||||
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
|
||||||
|
const self = this;
|
||||||
|
|
||||||
|
// select button with data-bs-target="#facturacion"
|
||||||
|
$(document).on('click', '.facturacion-btn', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
$('#tableOfFacturasCliente').DataTable().columns.adjust().draw();
|
||||||
|
$(this).tab('show');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-edit', function (e) {
|
||||||
|
window.location.href = '/facturas/edit/' + $(this).attr('data-id');
|
||||||
|
});
|
||||||
|
|
||||||
|
const lastColNr = $('#tableOfFacturasCliente').find("tr:first th").length - 1;
|
||||||
|
|
||||||
|
let datatableColumns = [];
|
||||||
|
|
||||||
|
datatableColumns = [
|
||||||
|
{ 'data': 'numero' },
|
||||||
|
{ 'data': 'fecha_factura_at', searchable: false },
|
||||||
|
{ 'data': 'total', render: (d) => `<span class="autonumeric">${d}</span>` },
|
||||||
|
{ 'data': 'estado' },
|
||||||
|
{ 'data': 'estado_pago' },
|
||||||
|
{ 'data': 'action' }
|
||||||
|
];
|
||||||
|
|
||||||
|
$('#tableOfFacturasCliente').DataTable({
|
||||||
|
processing: true,
|
||||||
|
serverSide: true,
|
||||||
|
autoWidth: true,
|
||||||
|
responsive: true,
|
||||||
|
scrollX: true,
|
||||||
|
orderCellsTop: true,
|
||||||
|
lengthMenu: [5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500],
|
||||||
|
pageLength: 250,
|
||||||
|
"dom": 'lBrtip',
|
||||||
|
order: [[0, 'asc']],
|
||||||
|
language: {
|
||||||
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
|
},
|
||||||
|
ajax: {
|
||||||
|
url: '/facturas/datatable',
|
||||||
|
type: 'GET',
|
||||||
|
data: function (d) {
|
||||||
|
d.cliente_id = self.clienteId;
|
||||||
|
d.fecha_factura = self.getDate();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
orderable: false,
|
||||||
|
searchable: false,
|
||||||
|
targets: [lastColNr]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
columns: datatableColumns,
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("keyup", ".factura-filter", (event) => {
|
||||||
|
//console.log(this.datatablePlanningRot.column($(event.currentTarget).attr("name")))
|
||||||
|
let columnName = $(event.currentTarget).attr("name");
|
||||||
|
let columnIndex = $('#tableOfFacturasCliente').DataTable().columns().eq(0).filter(function (index) {
|
||||||
|
return $('#tableOfFacturasCliente').DataTable().column(index).dataSrc() === columnName;
|
||||||
|
})[0];
|
||||||
|
$('#tableOfFacturasCliente').DataTable().column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document).on("change", ".factura-filter-select", (event) => {
|
||||||
|
let columnName = $(event.currentTarget).attr("name");
|
||||||
|
let columnIndex = $('#tableOfFacturasCliente').DataTable().columns().eq(0).filter(function (index) {
|
||||||
|
return $('#tableOfFacturasCliente').DataTable().column(index).dataSrc() === columnName;
|
||||||
|
})[0];
|
||||||
|
$('#tableOfFacturasCliente').DataTable().column(columnIndex).search($(event.currentTarget).val()).draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.bsRangePickerRange.daterangepicker({
|
||||||
|
ranges: {
|
||||||
|
[window.language.datePicker.hoy]: [moment(), moment()],
|
||||||
|
[window.language.datePicker.ayer]: [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||||
|
[window.language.datePicker.ultimos7]: [moment().subtract(6, 'days'), moment()],
|
||||||
|
[window.language.datePicker.ultimos30]: [moment().subtract(29, 'days'), moment()],
|
||||||
|
[window.language.datePicker.esteMes]: [moment().startOf('month'), moment().endOf('month')],
|
||||||
|
[window.language.datePicker.ultimoMes]: [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||||
|
},
|
||||||
|
opens: 'right',
|
||||||
|
language: window.language.datePickerLocale,
|
||||||
|
"locale": {
|
||||||
|
"customRangeLabel": window.language.datePicker.rangoPersonalizado,
|
||||||
|
"format": "YYYY-MM-DD",
|
||||||
|
"separator": " ",
|
||||||
|
"applyLabel": window.language.datePicker.aplicar,
|
||||||
|
"cancelLabel": window.language.datePicker.limpiar,
|
||||||
|
|
||||||
|
},
|
||||||
|
"alwaysShowCalendars": true,
|
||||||
|
autoUpdateInput: false,
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.bsRangePickerRange.on('apply.daterangepicker', function(ev, picker) {
|
||||||
|
|
||||||
|
$(this).val(picker.startDate.format('DD/MM/YYYY') + ' ' + picker.endDate.format('DD/MM/YYYY'));
|
||||||
|
let table = $('#tableOfFacturasCliente').DataTable();
|
||||||
|
table.column(2).draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.bsRangePickerRange.on('cancel.daterangepicker', function(ev, picker) {
|
||||||
|
$(this).val('');
|
||||||
|
$('#tableOfFacturasCliente').DataTable().column(2).search('').draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
new Ajax('/facturas/getdatoscliente/'+ this.clienteId,
|
||||||
|
{},
|
||||||
|
{},
|
||||||
|
function (response) {
|
||||||
|
AutoNumeric.getAutoNumericElement('#acumuladoFacturacion').set(response.total_facturacion);
|
||||||
|
AutoNumeric.getAutoNumericElement('#totalPendientePago').set(response.total_pendiente);
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
console.log("Error data:", error);
|
||||||
|
}).get();
|
||||||
|
}
|
||||||
|
|
||||||
|
getDate() {
|
||||||
|
|
||||||
|
let picker = this.bsRangePickerRange.data('daterangepicker');
|
||||||
|
|
||||||
|
if (!picker || !picker.startDate || !picker.endDate || $('#fechaFactura').val() == '') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
let startDate = picker.startDate.format('YYYY-MM-DD');
|
||||||
|
let endDate = picker.endDate.format('YYYY-MM-DD');
|
||||||
|
|
||||||
|
return startDate + "|" + endDate;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ClienteFacturacion;
|
||||||
202
httpdocs/assets/js/safekat/pages/cliente/clientePedidos.js
Normal file
202
httpdocs/assets/js/safekat/pages/cliente/clientePedidos.js
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
import Ajax from "../../components/ajax.js";
|
||||||
|
|
||||||
|
class ClientePedidos {
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
this.clienteId = $('#clienteForm').attr('data-cliente');
|
||||||
|
this.fecha = $('#fechaPedido_filter');
|
||||||
|
this.fechaEntrega = $('#fechaEntrega_filter');
|
||||||
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
|
||||||
|
const self = this;
|
||||||
|
|
||||||
|
$(document).on('click', '.pedidos-btn', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
$('#tableOfPedidosCliente').DataTable().columns.adjust().draw();
|
||||||
|
$(this).tab('show');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-edit', function (e) {
|
||||||
|
window.location.href = '/pedidos/edit/' + $(this).attr('data-id');
|
||||||
|
});
|
||||||
|
|
||||||
|
const lastColNr = $('#tableOfPedidosCliente').find("tr:first th").length - 1;
|
||||||
|
|
||||||
|
let datatableColumns = [];
|
||||||
|
|
||||||
|
datatableColumns = [
|
||||||
|
{ 'data': 'id' },
|
||||||
|
{ 'data': 'fecha' },
|
||||||
|
{ 'data': 'fecha_entrega' },
|
||||||
|
{ 'data': 'paginas', searchable: false },
|
||||||
|
{ 'data': 'total_tirada', searchable: false },
|
||||||
|
{ 'data': 'total_precio', searchable: false },
|
||||||
|
{ 'data': 'estado' },
|
||||||
|
{ 'data': 'action' }
|
||||||
|
];
|
||||||
|
|
||||||
|
$('#tableOfPedidosCliente').DataTable({
|
||||||
|
processing: true,
|
||||||
|
serverSide: true,
|
||||||
|
autoWidth: true,
|
||||||
|
responsive: true,
|
||||||
|
scrollX: true,
|
||||||
|
orderCellsTop: true,
|
||||||
|
lengthMenu: [5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500],
|
||||||
|
pageLength: 250,
|
||||||
|
"dom": 'lBrtip',
|
||||||
|
order: [[0, 'desc']],
|
||||||
|
language: {
|
||||||
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
|
},
|
||||||
|
ajax: {
|
||||||
|
url: '/pedidos/pedidosCliente',
|
||||||
|
type: 'GET',
|
||||||
|
data: function (d) {
|
||||||
|
d.cliente_id = self.clienteId;
|
||||||
|
d.fecha = self.getDate(self.fecha);
|
||||||
|
d.fecha_entrega = self.getDate(self.fechaEntrega);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
orderable: false,
|
||||||
|
searchable: false,
|
||||||
|
targets: [lastColNr]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
columns: datatableColumns,
|
||||||
|
});
|
||||||
|
|
||||||
|
new Ajax('/pedidos/getSumCliente/' + this.clienteId,
|
||||||
|
{},
|
||||||
|
{},
|
||||||
|
function (response) {
|
||||||
|
if (response.status == 'success') {
|
||||||
|
AutoNumeric.getAutoNumericElement('#pedidosImpresion').set(response.totales['total_impresion']);
|
||||||
|
AutoNumeric.getAutoNumericElement('#pedidosMaquetacion').set(response.totales['total_maquetacion']);
|
||||||
|
AutoNumeric.getAutoNumericElement('#totalPedidos').set(response.totales['total']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log("Error data:", response);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
console.log("Error data:", error);
|
||||||
|
}).get();
|
||||||
|
|
||||||
|
$(document).on("change", ".pedido-filter-select", (event) => {
|
||||||
|
let columnName = $(event.currentTarget).attr("name");
|
||||||
|
let columnIndex = $('#tableOfPedidosCliente').DataTable().columns().eq(0).filter(function (index) {
|
||||||
|
return $('#tableOfPedidosCliente').DataTable().column(index).dataSrc() === columnName;
|
||||||
|
})[0];
|
||||||
|
$('#tableOfPedidosCliente').DataTable().column(columnIndex).search($(event.currentTarget).val()).draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("keyup", ".pedido-filter", (event) => {
|
||||||
|
let columnName = $(event.currentTarget).attr("name");
|
||||||
|
let columnIndex = $('#tableOfPedidosCliente').DataTable().columns().eq(0).filter(function (index) {
|
||||||
|
return $('#tableOfPedidosCliente').DataTable().column(index).dataSrc() === columnName;
|
||||||
|
})[0];
|
||||||
|
$('#tableOfPedidosCliente').DataTable().column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||||
|
})
|
||||||
|
|
||||||
|
this.fecha.daterangepicker({
|
||||||
|
ranges: {
|
||||||
|
[window.language.datePicker.hoy]: [moment(), moment()],
|
||||||
|
[window.language.datePicker.ayer]: [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||||
|
[window.language.datePicker.ultimos7]: [moment().subtract(6, 'days'), moment()],
|
||||||
|
[window.language.datePicker.ultimos30]: [moment().subtract(29, 'days'), moment()],
|
||||||
|
[window.language.datePicker.esteMes]: [moment().startOf('month'), moment().endOf('month')],
|
||||||
|
[window.language.datePicker.ultimoMes]: [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||||
|
},
|
||||||
|
opens: 'right',
|
||||||
|
language: window.language.datePickerLocale,
|
||||||
|
"locale": {
|
||||||
|
"customRangeLabel": window.language.datePicker.rangoPersonalizado,
|
||||||
|
"format": "YYYY-MM-DD",
|
||||||
|
"separator": " ",
|
||||||
|
"applyLabel": window.language.datePicker.aplicar,
|
||||||
|
"cancelLabel": window.language.datePicker.limpiar,
|
||||||
|
|
||||||
|
},
|
||||||
|
"alwaysShowCalendars": true,
|
||||||
|
autoUpdateInput: false,
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.fecha.on('apply.daterangepicker', function (ev, picker) {
|
||||||
|
|
||||||
|
$(this).val(picker.startDate.format('DD/MM/YYYY') + ' ' + picker.endDate.format('DD/MM/YYYY'));
|
||||||
|
let table = $('#tableOfPedidosCliente').DataTable();
|
||||||
|
table.column(1).draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.fecha.on('cancel.daterangepicker', function (ev, picker) {
|
||||||
|
$(this).val('');
|
||||||
|
$('#tableOfPedidosCliente').DataTable().column(1).search('').draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.fechaEntrega.daterangepicker({
|
||||||
|
ranges: {
|
||||||
|
[window.language.datePicker.hoy]: [moment(), moment()],
|
||||||
|
[window.language.datePicker.ayer]: [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||||
|
[window.language.datePicker.ultimos7]: [moment().subtract(6, 'days'), moment()],
|
||||||
|
[window.language.datePicker.ultimos30]: [moment().subtract(29, 'days'), moment()],
|
||||||
|
[window.language.datePicker.esteMes]: [moment().startOf('month'), moment().endOf('month')],
|
||||||
|
[window.language.datePicker.ultimoMes]: [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||||
|
},
|
||||||
|
opens: 'right',
|
||||||
|
language: window.language.datePickerLocale,
|
||||||
|
"locale": {
|
||||||
|
"customRangeLabel": window.language.datePicker.rangoPersonalizado,
|
||||||
|
"format": "YYYY-MM-DD",
|
||||||
|
"separator": " ",
|
||||||
|
"applyLabel": window.language.datePicker.aplicar,
|
||||||
|
"cancelLabel": window.language.datePicker.limpiar,
|
||||||
|
|
||||||
|
},
|
||||||
|
"alwaysShowCalendars": true,
|
||||||
|
autoUpdateInput: false,
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.fechaEntrega.on('apply.daterangepicker', function (ev, picker) {
|
||||||
|
|
||||||
|
$(this).val(picker.startDate.format('DD/MM/YYYY') + ' ' + picker.endDate.format('DD/MM/YYYY'));
|
||||||
|
let table = $('#tableOfPedidosCliente').DataTable();
|
||||||
|
table.column(2).draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.fechaEntrega.on('cancel.daterangepicker', function (ev, picker) {
|
||||||
|
$(this).val('');
|
||||||
|
$('#tableOfPedidosCliente').DataTable().column(2).search('').draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getDate(datepicker) {
|
||||||
|
|
||||||
|
let picker = datepicker.data('daterangepicker');
|
||||||
|
|
||||||
|
if (!picker || !picker.startDate || !picker.endDate || datepicker.val() == '') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
let startDate = picker.startDate.format('YYYY-MM-DD');
|
||||||
|
let endDate = picker.endDate.format('YYYY-MM-DD');
|
||||||
|
|
||||||
|
return startDate + "|" + endDate;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ClientePedidos;
|
||||||
161
httpdocs/assets/js/safekat/pages/cliente/clientePresupuestos.js
Normal file
161
httpdocs/assets/js/safekat/pages/cliente/clientePresupuestos.js
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
import Ajax from "../../components/ajax.js";
|
||||||
|
|
||||||
|
class ClientePresupuestos {
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
this.clienteId = $('#clienteForm').attr('data-cliente');
|
||||||
|
this.fecha = $('#fechaPresupuesto_filter');
|
||||||
|
}
|
||||||
|
|
||||||
|
init() {
|
||||||
|
|
||||||
|
const self = this;
|
||||||
|
|
||||||
|
$(document).on('click', '.presupuestos-btn', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
$('#tableOfPresupuestosCliente').DataTable().columns.adjust().draw();
|
||||||
|
$(this).tab('show');
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-edit', function (e) {
|
||||||
|
window.location.href = $('#clienteForm').attr('data-url'); + $(this).attr('data-id');
|
||||||
|
});
|
||||||
|
|
||||||
|
const lastColNr = $('#tableOfPresupuestosCliente').find("tr:first th").length - 1;
|
||||||
|
|
||||||
|
let datatableColumns = [];
|
||||||
|
|
||||||
|
datatableColumns = [
|
||||||
|
{ 'data': 'id' },
|
||||||
|
{ 'data': 'fecha' },
|
||||||
|
{ 'data': 'comercial' },
|
||||||
|
{ 'data': 'titulo', orderable: false },
|
||||||
|
{ 'data': 'paginas', searchable: false },
|
||||||
|
{ 'data': 'tirada', searchable: false },
|
||||||
|
{ 'data': 'total', searchable: false },
|
||||||
|
{ 'data': 'estado' },
|
||||||
|
{ 'data': 'action' }
|
||||||
|
];
|
||||||
|
|
||||||
|
$('#tableOfPresupuestosCliente').DataTable({
|
||||||
|
processing: true,
|
||||||
|
serverSide: true,
|
||||||
|
autoWidth: true,
|
||||||
|
responsive: true,
|
||||||
|
scrollX: true,
|
||||||
|
orderCellsTop: true,
|
||||||
|
lengthMenu: [5, 10, 25, 50, 75, 100, 250, 500, 1000, 2500],
|
||||||
|
pageLength: 250,
|
||||||
|
"dom": 'lBrtip',
|
||||||
|
order: [[0, 'desc']],
|
||||||
|
language: {
|
||||||
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
|
},
|
||||||
|
ajax: {
|
||||||
|
url: '/presupuestoadmin/presupuestosCliente',
|
||||||
|
type: 'GET',
|
||||||
|
data: function (d) {
|
||||||
|
d.cliente_id = self.clienteId;
|
||||||
|
d.fecha = self.getDate(self.fecha);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
orderable: false,
|
||||||
|
searchable: false,
|
||||||
|
targets: [lastColNr]
|
||||||
|
},
|
||||||
|
],
|
||||||
|
columns: datatableColumns,
|
||||||
|
});
|
||||||
|
|
||||||
|
new Ajax('/presupuestoadmin/getSumCliente/' + this.clienteId,
|
||||||
|
{},
|
||||||
|
{},
|
||||||
|
function (response) {
|
||||||
|
if (response.status == 'success') {
|
||||||
|
AutoNumeric.getAutoNumericElement('#presupuestosImpresion').set(response.totales['total_impresion']);
|
||||||
|
AutoNumeric.getAutoNumericElement('#presupuestosMaquetacion').set(response.totales['total_maquetacion']);
|
||||||
|
AutoNumeric.getAutoNumericElement('#totalPresupuestos').set(response.totales['total']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log("Error data:", response);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
console.log("Error data:", error);
|
||||||
|
}).get();
|
||||||
|
|
||||||
|
$(document).on("change", ".presupuesto-filter-select", (event) => {
|
||||||
|
let columnName = $(event.currentTarget).attr("name");
|
||||||
|
let columnIndex = $('#tableOfPresupuestosCliente').DataTable().columns().eq(0).filter(function (index) {
|
||||||
|
return $('#tableOfPresupuestosCliente').DataTable().column(index).dataSrc() === columnName;
|
||||||
|
})[0];
|
||||||
|
$('#tableOfPresupuestosCliente').DataTable().column(columnIndex).search($(event.currentTarget).val()).draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on("keyup", ".presupuesto-filter", (event) => {
|
||||||
|
let columnName = $(event.currentTarget).attr("name");
|
||||||
|
let columnIndex = $('#tableOfPresupuestosCliente').DataTable().columns().eq(0).filter(function (index) {
|
||||||
|
return $('#tableOfPresupuestosCliente').DataTable().column(index).dataSrc() === columnName;
|
||||||
|
})[0];
|
||||||
|
$('#tableOfPresupuestosCliente').DataTable().column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||||
|
})
|
||||||
|
|
||||||
|
this.fecha.daterangepicker({
|
||||||
|
ranges: {
|
||||||
|
[window.language.datePicker.hoy]: [moment(), moment()],
|
||||||
|
[window.language.datePicker.ayer]: [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
|
||||||
|
[window.language.datePicker.ultimos7]: [moment().subtract(6, 'days'), moment()],
|
||||||
|
[window.language.datePicker.ultimos30]: [moment().subtract(29, 'days'), moment()],
|
||||||
|
[window.language.datePicker.esteMes]: [moment().startOf('month'), moment().endOf('month')],
|
||||||
|
[window.language.datePicker.ultimoMes]: [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
|
||||||
|
},
|
||||||
|
opens: 'right',
|
||||||
|
language: window.language.datePickerLocale,
|
||||||
|
"locale": {
|
||||||
|
"customRangeLabel": window.language.datePicker.rangoPersonalizado,
|
||||||
|
"format": "YYYY-MM-DD",
|
||||||
|
"separator": " ",
|
||||||
|
"applyLabel": window.language.datePicker.aplicar,
|
||||||
|
"cancelLabel": window.language.datePicker.limpiar,
|
||||||
|
|
||||||
|
},
|
||||||
|
"alwaysShowCalendars": true,
|
||||||
|
autoUpdateInput: false,
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
this.fecha.on('apply.daterangepicker', function (ev, picker) {
|
||||||
|
|
||||||
|
$(this).val(picker.startDate.format('DD/MM/YYYY') + ' ' + picker.endDate.format('DD/MM/YYYY'));
|
||||||
|
let table = $('#tableOfPresupuestosCliente').DataTable();
|
||||||
|
table.column(1).draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.fecha.on('cancel.daterangepicker', function (ev, picker) {
|
||||||
|
$(this).val('');
|
||||||
|
$('#tableOfPresupuestosCliente').DataTable().column(1).search('').draw();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getDate(datepicker) {
|
||||||
|
|
||||||
|
let picker = datepicker.data('daterangepicker');
|
||||||
|
|
||||||
|
if (!picker || !picker.startDate || !picker.endDate || datepicker.val() == '') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
let startDate = picker.startDate.format('YYYY-MM-DD');
|
||||||
|
let endDate = picker.endDate.format('YYYY-MM-DD');
|
||||||
|
|
||||||
|
return startDate + "|" + endDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ClientePresupuestos;
|
||||||
12
httpdocs/assets/js/safekat/pages/pdf/otDownload.js
Normal file
12
httpdocs/assets/js/safekat/pages/pdf/otDownload.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
$(() => {
|
||||||
|
console.log("PDF")
|
||||||
|
var opt = {
|
||||||
|
margin: 2,
|
||||||
|
filename: "PDF_OrdenTrabajo_" + $(".pdf-wrapper").data("id") + ".pdf",
|
||||||
|
image: { type: 'jpeg', quality: 1 },
|
||||||
|
html2canvas: { scale: 3 },
|
||||||
|
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
|
||||||
|
};
|
||||||
|
let elementToPdf = $('body')[0]
|
||||||
|
html2pdf().set(opt).from(elementToPdf).save()
|
||||||
|
})
|
||||||
@ -95,6 +95,7 @@ class OrdenTrabajo {
|
|||||||
this.tareasTableItem.on("draw.dt", this.createSelectMaquinaTarea.bind(this))
|
this.tareasTableItem.on("draw.dt", this.createSelectMaquinaTarea.bind(this))
|
||||||
this.tareasTableItem.on("xhr.dt", this.unbindEventTareas.bind(this))
|
this.tareasTableItem.on("xhr.dt", this.unbindEventTareas.bind(this))
|
||||||
this.otForm.on("click", "#btn-upload-portada", this.handleUploadPortada.bind(this))
|
this.otForm.on("click", "#btn-upload-portada", this.handleUploadPortada.bind(this))
|
||||||
|
this.otForm.on("click", "#btn-delete-portada", this.handleDeletePortada.bind(this))
|
||||||
this.otForm.on("click", "#btn-finalizar-orden-pedido", this.handleFinalizarPedido.bind(this))
|
this.otForm.on("click", "#btn-finalizar-orden-pedido", this.handleFinalizarPedido.bind(this))
|
||||||
this.tareasTableItem.on("click", ".ot-tarea-btn-delete", this.handleTareaDeleteConfirmation.bind(this))
|
this.tareasTableItem.on("click", ".ot-tarea-btn-delete", this.handleTareaDeleteConfirmation.bind(this))
|
||||||
this.item.on("click", "#btn-reset-tareas", this.handleResetTareasDeleteConfirmation.bind(this))
|
this.item.on("click", "#btn-reset-tareas", this.handleResetTareasDeleteConfirmation.bind(this))
|
||||||
@ -172,16 +173,15 @@ class OrdenTrabajo {
|
|||||||
}
|
}
|
||||||
createSelectMaquinaTarea() {
|
createSelectMaquinaTarea() {
|
||||||
try {
|
try {
|
||||||
this.tareasId.forEach(element => {
|
console.log("Create selects")
|
||||||
let selectItem = this.item.find("#select-maquina-tarea-" + element);
|
this.summaryData.tasks.forEach(element => {
|
||||||
let maquina_id = selectItem.data("maquina-id")
|
let selectItem = this.item.find("#select-maquina-tarea-" + element.id);
|
||||||
let maquinaSelects = new ClassSelect(selectItem, `/maquinas/select`, "Seleccione una maquina", true);
|
if (element.presupuesto_linea_id && element.is_corte == false) this.createSelectMaquinaImpresion(selectItem)
|
||||||
maquinaSelects.init();
|
if (element.presupuesto_acabado_id) this.createSelectMaquinaAcabado(selectItem)
|
||||||
if (maquina_id) {
|
if (element.presupuesto_encuadernado_id) this.createSelectMaquinaEncuadernacion(selectItem)
|
||||||
maquinaSelects.setVal(maquina_id)
|
if (element.presupuesto_manipulado_id || element.is_corte) this.createSelectMaquinaManipulado(selectItem)
|
||||||
} else {
|
if (element.presupuesto_preimpresion_id) this.createSelectMaquinaAll(selectItem)
|
||||||
maquinaSelects.reset()
|
if (element.presupuesto_extra_id) this.createSelectMaquinaAll(selectItem)
|
||||||
}
|
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
} finally {
|
} finally {
|
||||||
@ -190,6 +190,59 @@ class OrdenTrabajo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
createSelectMaquinaAcabado(selectItem) {
|
||||||
|
let maquina_id = selectItem.data("maquina-id")
|
||||||
|
let maquinaSelects = new ClassSelect(selectItem, `/tarifas/maquinas/acabado/select`, "Seleccione una maquina", true);
|
||||||
|
maquinaSelects.init();
|
||||||
|
if (maquina_id) {
|
||||||
|
maquinaSelects.setVal(maquina_id)
|
||||||
|
} else {
|
||||||
|
maquinaSelects.reset()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
createSelectMaquinaManipulado(selectItem) {
|
||||||
|
let maquina_id = selectItem.data("maquina-id")
|
||||||
|
let maquinaSelects = new ClassSelect(selectItem, `/tarifas/maquinas/manipulado/select`, "Seleccione una maquina", true);
|
||||||
|
maquinaSelects.init();
|
||||||
|
if (maquina_id) {
|
||||||
|
maquinaSelects.setVal(maquina_id)
|
||||||
|
} else {
|
||||||
|
maquinaSelects.reset()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
createSelectMaquinaImpresion(selectItem) {
|
||||||
|
let maquina_id = selectItem.data("maquina-id")
|
||||||
|
let maquinaSelects = new ClassSelect(selectItem, `/tarifas/maquinas/impresion/select`, "Seleccione una maquina", true);
|
||||||
|
maquinaSelects.init();
|
||||||
|
if (maquina_id) {
|
||||||
|
maquinaSelects.setVal(maquina_id)
|
||||||
|
} else {
|
||||||
|
maquinaSelects.reset()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
createSelectMaquinaEncuadernacion(selectItem) {
|
||||||
|
let maquina_id = selectItem.data("maquina-id")
|
||||||
|
let maquinaSelects = new ClassSelect(selectItem, `/tarifas/maquinas/encuadernacion/select`, "Seleccione una maquina", true);
|
||||||
|
maquinaSelects.init();
|
||||||
|
if (maquina_id) {
|
||||||
|
maquinaSelects.setVal(maquina_id)
|
||||||
|
} else {
|
||||||
|
maquinaSelects.reset()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
createSelectMaquinaAll(selectItem) {
|
||||||
|
let maquina_id = selectItem.data("maquina-id")
|
||||||
|
let maquinaSelects = new ClassSelect(selectItem, `/maquinas/select`, "Seleccione una maquina", true);
|
||||||
|
maquinaSelects.init();
|
||||||
|
if (maquina_id) {
|
||||||
|
maquinaSelects.setVal(maquina_id)
|
||||||
|
} else {
|
||||||
|
maquinaSelects.reset()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
filterCreatedRow(row, data, dataIndex, cells) {
|
filterCreatedRow(row, data, dataIndex, cells) {
|
||||||
if (data.maquina_tarea.maquina_id == null) {
|
if (data.maquina_tarea.maquina_id == null) {
|
||||||
}
|
}
|
||||||
@ -206,6 +259,7 @@ class OrdenTrabajo {
|
|||||||
this.fillOtDetails()
|
this.fillOtDetails()
|
||||||
this.fillOtDates()
|
this.fillOtDates()
|
||||||
this.fillPreimpresionReview()
|
this.fillPreimpresionReview()
|
||||||
|
this.datatableTareas.ajax.reload()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
@ -217,7 +271,6 @@ class OrdenTrabajo {
|
|||||||
}
|
}
|
||||||
handleSummaryError(error) { }
|
handleSummaryError(error) { }
|
||||||
fillPreimpresionReview() {
|
fillPreimpresionReview() {
|
||||||
console.log(this.summaryData.ot)
|
|
||||||
this.otForm.find("[name=fecha_entrega_warning]").prop("checked", this.summaryData.ot.fecha_entrega_warning)
|
this.otForm.find("[name=fecha_entrega_warning]").prop("checked", this.summaryData.ot.fecha_entrega_warning)
|
||||||
this.otForm.find("[name=fecha_entrega_warning_revised]").prop("checked", this.summaryData.ot.fecha_entrega_warning_revised)
|
this.otForm.find("[name=fecha_entrega_warning_revised]").prop("checked", this.summaryData.ot.fecha_entrega_warning_revised)
|
||||||
this.otForm.find("[name=revisar_formato]").prop("checked", this.summaryData.ot.revisar_formato)
|
this.otForm.find("[name=revisar_formato]").prop("checked", this.summaryData.ot.revisar_formato)
|
||||||
@ -231,10 +284,10 @@ class OrdenTrabajo {
|
|||||||
}
|
}
|
||||||
fillOtDetails() {
|
fillOtDetails() {
|
||||||
const progreso = this.summaryData.ot.progreso
|
const progreso = this.summaryData.ot.progreso
|
||||||
this.otForm.find("#ot-progress-bar").attr('aria-valuenow', progreso).text(progreso + "%").css("width", progreso + "%")
|
// this.otForm.find("#ot-progress-bar").attr('aria-valuenow', progreso).text(progreso + "%").css("width", progreso + "%")
|
||||||
this.otForm.find("#ot-paginas").text(this.summaryData.presupuesto.paginas)
|
// this.otForm.find("#ot-paginas").text(this.summaryData.presupuesto.paginas)
|
||||||
this.otForm.find("#ot-tirada").text(this.summaryData.presupuesto.tirada)
|
// this.otForm.find("#ot-tirada").text(this.summaryData.presupuesto.tirada)
|
||||||
this.otForm.find("#ot-merma").text(this.summaryData.presupuesto.merma)
|
// this.otForm.find("#ot-merma").text(this.summaryData.presupuesto.merma)
|
||||||
}
|
}
|
||||||
fillOtDates() {
|
fillOtDates() {
|
||||||
this.fechaImpresion.setDate(this.summaryData.dates.fecha_impresion_at)
|
this.fechaImpresion.setDate(this.summaryData.dates.fecha_impresion_at)
|
||||||
@ -351,6 +404,7 @@ class OrdenTrabajo {
|
|||||||
|
|
||||||
}
|
}
|
||||||
handlePreimpresionReviewChangeSuccess(response) {
|
handlePreimpresionReviewChangeSuccess(response) {
|
||||||
|
alertSuccess(response.message).fire()
|
||||||
|
|
||||||
}
|
}
|
||||||
handlePreimpresionReviewChangeError(error) {
|
handlePreimpresionReviewChangeError(error) {
|
||||||
@ -374,9 +428,38 @@ class OrdenTrabajo {
|
|||||||
}
|
}
|
||||||
handleUploadPortadaSuccess(response) {
|
handleUploadPortadaSuccess(response) {
|
||||||
this.handleGetPortada()
|
this.handleGetPortada()
|
||||||
|
popSuccessAlert(response.message)
|
||||||
this.otForm.find("#portada-file-input").val(null)
|
this.otForm.find("#portada-file-input").val(null)
|
||||||
}
|
}
|
||||||
handleUploadPortadaError(errors) { }
|
handleUploadPortadaError(errors) {
|
||||||
|
popSuccessAlert(errors?.message)
|
||||||
|
}
|
||||||
|
handleDeletePortada() {
|
||||||
|
this.item.find(".portada-loader").prop("hidden", true);
|
||||||
|
this.item.find("#portada-orden-trabajo").prop("hidden", false);
|
||||||
|
let ajax = new Ajax('/produccion/ordentrabajo/portada/' + this.modelId,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
this.handleDeletePortadaSuccess.bind(this),
|
||||||
|
this.handleGetPortadaError.bind(this),
|
||||||
|
)
|
||||||
|
alertConfirmationDelete("¿Estás seguro de realizar esta acción?")
|
||||||
|
.then(result => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
ajax.delete();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
handleDeletePortadaSuccess(response) {
|
||||||
|
$('#portada-orden-trabajo').attr('src', '/assets/img/portada_not_found.png');
|
||||||
|
this.item.find(".portada-loader").prop("hidden", true);
|
||||||
|
this.item.find("#portada-orden-trabajo").prop("hidden", false);
|
||||||
|
popSuccessAlert(response.message)
|
||||||
|
}
|
||||||
|
handleDeletePortadaError(response) {
|
||||||
|
popErrorAlert(response.error)
|
||||||
|
}
|
||||||
|
|
||||||
handleGetPortada() {
|
handleGetPortada() {
|
||||||
this.item.find(".portada-loader").prop("hidden", false);
|
this.item.find(".portada-loader").prop("hidden", false);
|
||||||
this.item.find("#portada-orden-trabajo").prop("hidden", true);
|
this.item.find("#portada-orden-trabajo").prop("hidden", true);
|
||||||
@ -396,7 +479,11 @@ class OrdenTrabajo {
|
|||||||
this.item.find(".portada-loader").prop("hidden", true);
|
this.item.find(".portada-loader").prop("hidden", true);
|
||||||
this.item.find("#portada-orden-trabajo").prop("hidden", false);
|
this.item.find("#portada-orden-trabajo").prop("hidden", false);
|
||||||
}
|
}
|
||||||
handleGetPortadaError(errors) { }
|
handleGetPortadaError() {
|
||||||
|
this.item.find(".portada-loader").prop("hidden", true);
|
||||||
|
this.item.find("#portada-orden-trabajo").prop("hidden", false);
|
||||||
|
|
||||||
|
}
|
||||||
handleFinalizarPedido() {
|
handleFinalizarPedido() {
|
||||||
const ajax = new Ajax(
|
const ajax = new Ajax(
|
||||||
"/produccion/ordentrabajo/update",
|
"/produccion/ordentrabajo/update",
|
||||||
@ -410,7 +497,8 @@ class OrdenTrabajo {
|
|||||||
);
|
);
|
||||||
ajax.post()
|
ajax.post()
|
||||||
}
|
}
|
||||||
handleEstadoChangeSuccess() {
|
handleEstadoChangeSuccess(response) {
|
||||||
|
popSuccessAlert(response.message)
|
||||||
this.alertOrdenTrabajo.removeClass("alert-info").addClass("alert-success")
|
this.alertOrdenTrabajo.removeClass("alert-info").addClass("alert-success")
|
||||||
this.btnFinalizarPedido.prop("disabled", true);
|
this.btnFinalizarPedido.prop("disabled", true);
|
||||||
}
|
}
|
||||||
@ -437,13 +525,13 @@ class OrdenTrabajo {
|
|||||||
"/produccion/ordentrabajo/reset/tareas/" + this.modelId,
|
"/produccion/ordentrabajo/reset/tareas/" + this.modelId,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
this.handleDeleteTareaSuccess.bind(this),
|
this.handleDeleteResetTareasSuccess.bind(this),
|
||||||
this.handleDeleteTareaError.bind(this)
|
this.handleDeleteResetTareasError.bind(this)
|
||||||
);
|
);
|
||||||
ajax.delete()
|
ajax.delete()
|
||||||
}
|
}
|
||||||
handleDeleteResetTareasSuccess(response) {
|
handleDeleteResetTareasSuccess(response) {
|
||||||
this.datatableTareas.ajax.reload()
|
this._handleGetData()
|
||||||
}
|
}
|
||||||
handleDeleteResetTareasError() { }
|
handleDeleteResetTareasError() { }
|
||||||
handleDeleteTarea(orden_tarea_id) {
|
handleDeleteTarea(orden_tarea_id) {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import ClassSelect from "../../../components/select2.js";
|
import ClassSelect from "../../../components/select2.js";
|
||||||
import Ajax from "../../../components/ajax.js";
|
import Ajax from "../../../components/ajax.js";
|
||||||
|
import { alertError, alertSuccess } from "../../../components/alerts/sweetAlert.js";
|
||||||
|
|
||||||
|
|
||||||
class PlanningRotativa {
|
class PlanningRotativa {
|
||||||
@ -78,14 +79,14 @@ class PlanningRotativa {
|
|||||||
]
|
]
|
||||||
this.maquinaSelectFilter = new ClassSelect(
|
this.maquinaSelectFilter = new ClassSelect(
|
||||||
this.tablePlanningRot.find(".planning-maquina-select"),
|
this.tablePlanningRot.find(".planning-maquina-select"),
|
||||||
`/maquinas/select`,
|
`/produccion/ordentrabajo/planning/select/maquina/rotativa`,
|
||||||
"Seleccione una maquina",
|
"Seleccione una maquina",
|
||||||
true, {
|
true, {
|
||||||
dropdownCssClass: "h-2"
|
dropdownCssClass: "h-2"
|
||||||
}, $('body'));
|
}, $('body'));
|
||||||
this.papelImpresionFilter = new ClassSelect(this.tablePlanningRot.find(".planning-papel-select"), `/papelesimpresion/select`, "Seleccione un papel", true, {}, $('body'));
|
this.papelImpresionFilter = new ClassSelect(this.tablePlanningRot.find(".planning-papel-select"), `/produccion/ordentrabajo/planning/select/papel/rotativa`, "Seleccione un papel", true, {}, $('body'));
|
||||||
this.maquinaSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-select"), `/maquinas/select`, "Seleccione una maquina", true, {}, $('body'));
|
this.maquinaSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-select"), `/produccion/ordentrabajo/planning/select/maquina/plana`, "Seleccione una maquina", true, {}, $('body'));
|
||||||
this.papelImpresionFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-papel-select"), `/papelesimpresion/select`, "Seleccione un papel", true, {}, $('body'));
|
this.papelImpresionFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-papel-select"), `/produccion/ordentrabajo/planning/select/papel/plana`, "Seleccione un papel", true, {}, $('body'));
|
||||||
this.maquinaSelectFilter.config.dropdownParent = this.item
|
this.maquinaSelectFilter.config.dropdownParent = this.item
|
||||||
}
|
}
|
||||||
init() {
|
init() {
|
||||||
@ -204,7 +205,7 @@ class PlanningRotativa {
|
|||||||
this.papelGramajeDatatable.on('draw', this.addTotalFooter.bind(this))
|
this.papelGramajeDatatable.on('draw', this.addTotalFooter.bind(this))
|
||||||
|
|
||||||
this.tablePlanningRot.on('change', ".metros-check", this.calcMetrosCheck.bind(this))
|
this.tablePlanningRot.on('change', ".metros-check", this.calcMetrosCheck.bind(this))
|
||||||
|
this.tablePlanningRot.on("click",'.change-corte',this.toggleCorte.bind(this))
|
||||||
/**
|
/**
|
||||||
* PLANNING PLANA
|
* PLANNING PLANA
|
||||||
*/
|
*/
|
||||||
@ -307,15 +308,34 @@ class PlanningRotativa {
|
|||||||
this.totalPliegosSel.set(metros_sel.reduce((a, b) => a + b, 0))
|
this.totalPliegosSel.set(metros_sel.reduce((a, b) => a + b, 0))
|
||||||
|
|
||||||
}
|
}
|
||||||
renderCorteImage() {
|
renderCorteImage(data) {
|
||||||
|
const tipo_corte = data.tipo_corte == "bobina" ? "cortadora_bobinas" : "guillotina";
|
||||||
|
console.log(data.tipo_corte)
|
||||||
return `
|
return `
|
||||||
<a type="button" class="btn btn-outline-secondary bg-white btn-xs change-corte">
|
<a type="button" class="btn btn-outline-secondary bg-white btn-xs change-corte" data-id=${data.otId}>
|
||||||
<div class="avatar avatar-size-xs">
|
<div class="avatar avatar-size-xs">
|
||||||
<img src="/assets/img/cortadora_bobinas.png" alt="Guillotina" width="10px" height="10px">
|
<img src="/assets/img/${tipo_corte}.png" alt="${data.tipo_corte}" width="10px" height="10px">
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
toggleCorte(event){
|
||||||
|
let otId = $(event.currentTarget).data('id')
|
||||||
|
let ajax = new Ajax("/produccion/ordentrabajo/planning/tarea/toggle/corte/" + otId,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
this.toggleCorteSuccess.bind(this),
|
||||||
|
this.toggleCorteError.bind(this)
|
||||||
|
)
|
||||||
|
ajax.post()
|
||||||
|
}
|
||||||
|
toggleCorteSuccess(response){
|
||||||
|
this.datatablePlanningRot.ajax.reload()
|
||||||
|
alertSuccess(response.message).fire()
|
||||||
|
}
|
||||||
|
toggleCorteError(){
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
348
httpdocs/themes/vuexy/css/pdf.ot copy.css
Normal file
348
httpdocs/themes/vuexy/css/pdf.ot copy.css
Normal file
@ -0,0 +1,348 @@
|
|||||||
|
@page {
|
||||||
|
size: A4;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
@media print {
|
||||||
|
body,html {
|
||||||
|
width: 210mm;
|
||||||
|
height: 297mm;
|
||||||
|
max-width: 210mm;
|
||||||
|
max-height: 297mm;
|
||||||
|
print-color-adjust: exact;
|
||||||
|
}
|
||||||
|
/* ... the rest of the rules ... */
|
||||||
|
}
|
||||||
|
html {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
width: 210mm;
|
||||||
|
height: 297mm;
|
||||||
|
max-width: 210mm;
|
||||||
|
font-size : 11px;
|
||||||
|
max-height: 297mm;
|
||||||
|
background-color: #f9f9f9;
|
||||||
|
}
|
||||||
|
body{
|
||||||
|
border: 0px solid;
|
||||||
|
padding: 20px;
|
||||||
|
max-width: 210mm;
|
||||||
|
max-height: 297mm;
|
||||||
|
|
||||||
|
}
|
||||||
|
.cubierta{
|
||||||
|
color: #007bff;
|
||||||
|
}
|
||||||
|
.encuadernacion{
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
.impresion{
|
||||||
|
color: #ff4000;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
width: 210mm;
|
||||||
|
height: 297mm;
|
||||||
|
background: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
border: 2px solid;
|
||||||
|
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.cover{
|
||||||
|
display: flex;
|
||||||
|
justify-content: start;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.portada-info{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.impresion-tipo-row{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-items: center;
|
||||||
|
justify-content: end;
|
||||||
|
width: 100%;
|
||||||
|
height: 5mm;
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
.portada-row{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
background-color: #4ba0fccc;
|
||||||
|
width: 100%;
|
||||||
|
height: 5mm;
|
||||||
|
border: solid 2px;
|
||||||
|
margin: 2px;
|
||||||
|
border-color: black;
|
||||||
|
|
||||||
|
}
|
||||||
|
.portada-row-2{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-items: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 35mm;
|
||||||
|
margin: 2px;
|
||||||
|
border: 2px solid;
|
||||||
|
border-color: black;
|
||||||
|
|
||||||
|
}
|
||||||
|
.portada{
|
||||||
|
height: 40mm;
|
||||||
|
}
|
||||||
|
.presupuesto-title{
|
||||||
|
color: #007bff;
|
||||||
|
font-size: medium;
|
||||||
|
line-height: 0;
|
||||||
|
}
|
||||||
|
.pl-2{
|
||||||
|
padding-left: 0.5rem;
|
||||||
|
}
|
||||||
|
.pr-2{
|
||||||
|
padding-right: 0.5rem;
|
||||||
|
}
|
||||||
|
.pt-2{
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
}
|
||||||
|
.flex-row{
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
justify-content: start;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
.date{
|
||||||
|
padding-left: 0.5rem;
|
||||||
|
padding-top: 0px;
|
||||||
|
width: 100%;
|
||||||
|
line-height: 0px;
|
||||||
|
stroke-width: 5px;
|
||||||
|
font-size: medium;
|
||||||
|
}
|
||||||
|
#presupuesto-section{
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.flex-col{
|
||||||
|
display: flex;
|
||||||
|
padding: 0;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.cliente-title{
|
||||||
|
color: red;
|
||||||
|
font-size: medium;
|
||||||
|
stroke-width: 10px;
|
||||||
|
line-height: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header .title {
|
||||||
|
font-size: 24px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section {
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
border-top: 1px solid #ddd;
|
||||||
|
padding-top: 0.2rem;
|
||||||
|
}
|
||||||
|
.section-title {
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
table th, table td {
|
||||||
|
border: 2px solid #000000;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
table th {
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
table td{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.comments {
|
||||||
|
color: #555;
|
||||||
|
font-style: italic;
|
||||||
|
margin-top: 0.2rem;
|
||||||
|
}
|
||||||
|
.comment-content {
|
||||||
|
line-height: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
border: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
}
|
||||||
|
.footer {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 0.5rem;
|
||||||
|
|
||||||
|
font-size: 14px;
|
||||||
|
color: #777;
|
||||||
|
}
|
||||||
|
.row-logo-impresion{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.portada-img{
|
||||||
|
border: black;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 2px;
|
||||||
|
height: 40mm;
|
||||||
|
width: 100px;
|
||||||
|
max-width: 30mm;
|
||||||
|
border: 2px solid;
|
||||||
|
border-color: black;
|
||||||
|
border-radius: 5%;
|
||||||
|
}
|
||||||
|
.portada-text{
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.t-header{
|
||||||
|
color: black;
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
.t-cell{
|
||||||
|
background-color: white;
|
||||||
|
color: black;
|
||||||
|
text-align: start;
|
||||||
|
padding-left: 0.2rem;
|
||||||
|
}
|
||||||
|
.t-row{
|
||||||
|
font-size: 10px;
|
||||||
|
}
|
||||||
|
.esquema{
|
||||||
|
display: flex;
|
||||||
|
justify-content:flex-end;
|
||||||
|
width: 100%;
|
||||||
|
justify-items: flex-end;
|
||||||
|
|
||||||
|
}
|
||||||
|
.pagina-imposicion-outer-start{
|
||||||
|
border-top: 2px solid;
|
||||||
|
border-left: 2px solid;
|
||||||
|
border-bottom: 2px solid;
|
||||||
|
width: 50px;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.pagina-imposicion-outer-end{
|
||||||
|
border-top: 2px solid;
|
||||||
|
border-right: 2px solid;
|
||||||
|
border-bottom: 2px solid;
|
||||||
|
width: 50px;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.pagina-imposicion-outer{
|
||||||
|
border-top: 2px solid;
|
||||||
|
border-bottom: 2px solid;
|
||||||
|
width: 50px;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.pagina-imposicion-inner{
|
||||||
|
border: 2px solid;
|
||||||
|
font-size: 25px;
|
||||||
|
width: 40px;
|
||||||
|
height: 90px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
}
|
||||||
|
.square-wrapper{
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2,1fr);
|
||||||
|
margin-left: 5px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.square{
|
||||||
|
width: 100px;
|
||||||
|
height: 50px;
|
||||||
|
font-size: 14px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.cod{
|
||||||
|
width: 150px;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: orange;
|
||||||
|
margin-left : 20px;
|
||||||
|
color: white;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.cod-code{
|
||||||
|
font-weight: bold;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.esquema-imposicion-wrapper{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-left: 2rem;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
.imposicion{
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 200px;
|
||||||
|
}
|
||||||
|
.imposicion td{
|
||||||
|
font-size: large;
|
||||||
|
}
|
||||||
|
.cod-barras{
|
||||||
|
width: 150px;
|
||||||
|
height: 80px;
|
||||||
|
text-align : center;
|
||||||
|
background-color: white;
|
||||||
|
align-content: center;
|
||||||
|
}
|
||||||
|
.cod-barras img {
|
||||||
|
padding : 1px;
|
||||||
|
}
|
||||||
|
.bg-white{
|
||||||
|
background-color: white;
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
.bg-red{
|
||||||
|
background-color: red;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.bg-gray{
|
||||||
|
background-color: gray;
|
||||||
|
color:white
|
||||||
|
}
|
||||||
|
.bg-blue{
|
||||||
|
background-color: blue;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
@ -3,220 +3,49 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
@media print {
|
@media print {
|
||||||
html, body {
|
body,html {
|
||||||
width: 210mm;
|
width: 210mm;
|
||||||
height: 297mm;
|
height: 297mm;
|
||||||
|
max-width: 210mm;
|
||||||
|
max-height: 297mm;
|
||||||
|
print-color-adjust: exact;
|
||||||
}
|
}
|
||||||
/* ... the rest of the rules ... */
|
/* ... the rest of the rules ... */
|
||||||
}
|
}
|
||||||
html,body {
|
html {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
width: 210mm;
|
width: 210mm;
|
||||||
height: 297mm;
|
height: 297mm;
|
||||||
max-width: 210mm;
|
max-width: 210mm;
|
||||||
|
font-size : 11px;
|
||||||
max-height: 297mm;
|
max-height: 297mm;
|
||||||
background-color: #f9f9f9;
|
background-color: white;
|
||||||
}
|
}
|
||||||
body{
|
body{
|
||||||
border: 2px solid;
|
border: 0px solid;
|
||||||
padding: 20px;
|
padding: 10px;
|
||||||
|
max-width: 210mm;
|
||||||
|
max-height: 297mm;
|
||||||
|
background-color : white;
|
||||||
|
|
||||||
}
|
}
|
||||||
.cubierta{
|
|
||||||
color: #007bff;
|
|
||||||
}
|
|
||||||
.encuadernacion{
|
|
||||||
color: green;
|
|
||||||
}
|
|
||||||
.impresion{
|
|
||||||
color: #ff4000;
|
|
||||||
}
|
|
||||||
.container {
|
|
||||||
width: 100%;
|
|
||||||
width: 210mm;
|
|
||||||
height: 297mm;
|
|
||||||
background: #fff;
|
|
||||||
padding: 20px;
|
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
||||||
border: 2px solid;
|
|
||||||
|
|
||||||
}
|
|
||||||
.header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.cover{
|
|
||||||
display: flex;
|
|
||||||
justify-content: start;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
margin-top: 10px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
.portada-info{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.portada-row{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
background-color: #4ba0fccc;
|
|
||||||
width: 100%;
|
|
||||||
height: 5mm;
|
|
||||||
border: solid 2px;
|
|
||||||
margin: 2px;
|
|
||||||
border-color: black;
|
|
||||||
|
|
||||||
}
|
|
||||||
.portada-row-2{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-items: center;
|
|
||||||
background-color: #ff4000;
|
|
||||||
width: 100%;
|
|
||||||
height: 35mm;
|
|
||||||
color: white;
|
|
||||||
margin: 2px;
|
|
||||||
border: 2px solid;
|
|
||||||
border-color: black;
|
|
||||||
|
|
||||||
}
|
|
||||||
.portada{
|
|
||||||
height: 40mm;
|
|
||||||
}
|
|
||||||
.presupuesto-title{
|
|
||||||
color: #007bff;
|
|
||||||
font-size: medium;
|
|
||||||
line-height: 0;
|
|
||||||
}
|
|
||||||
.pl-2{
|
|
||||||
padding-left: 0.5rem;
|
|
||||||
}
|
|
||||||
.pr-2{
|
|
||||||
padding-right: 0.5rem;
|
|
||||||
}
|
|
||||||
.pt-2{
|
|
||||||
padding-top: 0.5rem;
|
|
||||||
}
|
|
||||||
.flex-row{
|
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
justify-content: start;
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
|
||||||
.date{
|
|
||||||
padding-left: 0.5rem;
|
|
||||||
padding-top: 0px;
|
|
||||||
width: 100%;
|
|
||||||
line-height: 0px;
|
|
||||||
stroke-width: 5px;
|
|
||||||
font-size: medium;
|
|
||||||
}
|
|
||||||
#presupuesto-section{
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.flex-col{
|
|
||||||
display: flex;
|
|
||||||
padding: 0;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
.cliente-title{
|
|
||||||
color: red;
|
|
||||||
font-size: medium;
|
|
||||||
stroke-width: 10px;
|
|
||||||
line-height: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.header .title {
|
|
||||||
font-size: 24px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section {
|
|
||||||
margin-top: 0.5rem;
|
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
padding-top: 0.2rem;
|
|
||||||
}
|
|
||||||
.section-title {
|
|
||||||
font-weight: bold;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
table {
|
|
||||||
width: 100%;
|
|
||||||
border-collapse: collapse;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
table th, table td {
|
|
||||||
border: 2px solid #000000;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
table th {
|
|
||||||
background-color: #f4f4f4;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
table td{
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.comments {
|
|
||||||
color: #555;
|
|
||||||
font-style: italic;
|
|
||||||
margin-top: 0.2rem;
|
|
||||||
}
|
|
||||||
.comment-content {
|
|
||||||
line-height: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 50px;
|
|
||||||
border: solid;
|
|
||||||
border-width: 1px;
|
|
||||||
}
|
|
||||||
.footer {
|
|
||||||
text-align: center;
|
|
||||||
margin-top: 0.5rem;
|
|
||||||
font-size: 14px;
|
|
||||||
color: #777;
|
|
||||||
}
|
|
||||||
.row-logo-impresion{
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
.portada-img{
|
.portada-img{
|
||||||
border: black;
|
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 2px;
|
height: 100%;
|
||||||
height: 40mm;
|
|
||||||
width: 100px;
|
|
||||||
max-width: 30mm;
|
|
||||||
border: 2px solid;
|
border: 2px solid;
|
||||||
border-color: black;
|
|
||||||
border-radius: 5%;
|
|
||||||
}
|
}
|
||||||
.portada-text{
|
.square{
|
||||||
color: white;
|
font-size: 14px;
|
||||||
}
|
align-items: center;
|
||||||
|
align-content : center;
|
||||||
.t-header{
|
justify-content: center;
|
||||||
color: black;
|
font-weight: bold;
|
||||||
width: 25%;
|
|
||||||
}
|
|
||||||
.t-cell{
|
|
||||||
background-color: white;
|
|
||||||
color: black;
|
|
||||||
text-align: start;
|
|
||||||
padding-left: 0.2rem;
|
|
||||||
}
|
|
||||||
.t-row{
|
|
||||||
font-size: 10px;
|
|
||||||
}
|
}
|
||||||
.esquema{
|
.esquema{
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content:flex-end;
|
justify-content:center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
justify-items: flex-end;
|
justify-items: center;
|
||||||
|
|
||||||
}
|
}
|
||||||
.pagina-imposicion-outer-start{
|
.pagina-imposicion-outer-start{
|
||||||
@ -258,72 +87,77 @@ table td{
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
}
|
}
|
||||||
.square-wrapper{
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(2,1fr);
|
|
||||||
margin-left: 10px;
|
|
||||||
|
|
||||||
}
|
|
||||||
.square{
|
|
||||||
width: 100px;
|
|
||||||
height: 50px;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.cod{
|
|
||||||
width: 200px;
|
|
||||||
height: 100px;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
background-color: orange;
|
|
||||||
margin-left: 10px;
|
|
||||||
color: white;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.cod-code{
|
|
||||||
font-weight: bold;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.esquema-imposicion-wrapper{
|
.esquema-imposicion-wrapper{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-left: 2rem;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
}
|
||||||
.imposicion{
|
.imposicion{
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
width: 200px;
|
|
||||||
}
|
}
|
||||||
.imposicion td{
|
.section-title {
|
||||||
font-size: large;
|
font-weight: bold;
|
||||||
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
.cod-barras{
|
.cubierta{
|
||||||
width: 190px;
|
color: #007bff;
|
||||||
|
}
|
||||||
|
.encuadernacion{
|
||||||
|
color: green;
|
||||||
|
}
|
||||||
|
.impresion{
|
||||||
|
color: #ff4000;
|
||||||
|
}
|
||||||
|
.comments {
|
||||||
|
color: #555;
|
||||||
|
font-style: italic;
|
||||||
|
margin-top: 0.2rem;
|
||||||
|
}
|
||||||
|
.comment-content {
|
||||||
|
line-height: 0;
|
||||||
|
width: 100%;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
margin: 5px;
|
border: solid;
|
||||||
background-color: white;
|
border-width: 1px;
|
||||||
}
|
}
|
||||||
.bg-white{
|
|
||||||
|
table {
|
||||||
|
width: 100%;
|
||||||
|
border-collapse: collapse;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
table th, table td {
|
||||||
|
border: 2px solid #000000;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
table th {
|
||||||
|
background-color: #f4f4f4;
|
||||||
|
font-weight: bold;
|
||||||
|
color : black;
|
||||||
|
}
|
||||||
|
table td{
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.comments {
|
||||||
|
color: #555;
|
||||||
|
font-style: italic;
|
||||||
|
margin-top: 0.2rem;
|
||||||
|
}
|
||||||
|
.t-header{
|
||||||
|
color: black;
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
.t-cell{
|
||||||
background-color: white;
|
background-color: white;
|
||||||
color: black;
|
color: black;
|
||||||
|
text-align: start;
|
||||||
|
padding-left: 0.2rem;
|
||||||
}
|
}
|
||||||
.bg-red{
|
.t-row{
|
||||||
background-color: red;
|
font-size: 10px;
|
||||||
color: white;
|
width : 100%;
|
||||||
}
|
}
|
||||||
.bg-gray{
|
|
||||||
background-color: gray;
|
|
||||||
color:white
|
|
||||||
}
|
|
||||||
.bg-blue{
|
|
||||||
background-color: blue;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
3
httpdocs/themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js
vendored
Normal file
3
httpdocs/themes/vuexy/vendor/libs/html2pdf/html2pdf.bundle.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user