Merge branch 'feat/update-ot-flow' into 'main'

Feat/update ot flow

See merge request jjimenez/safekat!821
This commit is contained in:
Alvaro
2025-05-22 16:41:34 +00:00
26 changed files with 685 additions and 381 deletions

View File

@ -646,6 +646,8 @@ $routes->group('messages', ['namespace' => 'App\Controllers\Chat'], function ($r
$routes->get('datatable/pedido', 'ChatController::datatable_pedido_messages', ['as' => 'getDatatablePedidoMessages']); $routes->get('datatable/pedido', 'ChatController::datatable_pedido_messages', ['as' => 'getDatatablePedidoMessages']);
$routes->get('datatable/factura', 'ChatController::datatable_factura_messages', ['as' => 'getDatatableFacturaMessages']); $routes->get('datatable/factura', 'ChatController::datatable_factura_messages', ['as' => 'getDatatableFacturaMessages']);
$routes->get('datatable/ots', 'ChatController::datatable_ot_messages', ['as' => 'getDatatableOtMessages']); $routes->get('datatable/ots', 'ChatController::datatable_ot_messages', ['as' => 'getDatatableOtMessages']);
$routes->get('datatable/direct', 'ChatController::datatable_direct_messages', ['as' => 'getDatatableDirectMessages']);
$routes->post('direct', 'ChatController::store_new_direct_message', ['as' => 'storeNewDirectMessage']); $routes->post('direct', 'ChatController::store_new_direct_message', ['as' => 'storeNewDirectMessage']);
$routes->post('direct/client', 'ChatController::store_new_direct_message_client', ['as' => 'storeNewDirectMessageClient']); $routes->post('direct/client', 'ChatController::store_new_direct_message_client', ['as' => 'storeNewDirectMessageClient']);

View File

@ -363,14 +363,13 @@ class ChatController extends BaseController
$query = $this->userModel->builder()->select( $query = $this->userModel->builder()->select(
[ [
"id", "id",
"CONCAT(first_name,' ',last_name,'(',username,')') as name" "CONCAT(first_name,' ',last_name) as name"
] ]
) )
->where("deleted_at", null) ->where("deleted_at", null)
->whereNotIn("id", [auth()->user()->id]); ->whereNotIn("id", [auth()->user()->id]);
if ($this->request->getGet("q")) { if ($this->request->getGet("q")) {
$query->groupStart() $query->groupStart()
->orLike("users.username", $this->request->getGet("q"))
->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q")) ->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q"))
->groupEnd(); ->groupEnd();
} }
@ -538,6 +537,23 @@ class ChatController extends BaseController
->toJson(true); ->toJson(true);
} }
public function datatable_direct_messages()
{
$auth_user_id = auth()->user()->id;
$isAdmin = auth()->user()->inGroup('admin');
$query = $this->chatModel->getQueryDatatableDirectMessages($auth_user_id);
return DataTable::of($query)
->edit('created_at', fn($q) => $q->created_at ? Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i") : "")
->edit('updated_at', fn($q) => $q->updated_at ? Time::createFromFormat('Y-m-d H:i:s', $q->updated_at)->format("d/m/Y H:i") : "")
->edit("creator",fn($q) => $q->userId == $auth_user_id ? '<span class="badge text-bg-success w-100">'.lang("App.me").'</span>' : $q->creator)
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->chatMessageId))
->add("action", fn($q) => ["type" => "direct", "modelId" => $q->id, "isAdmin" => $isAdmin,"chatMessageId" => $q->chatMessageId, "lang" => [
"view_chat" => lang('Chat.view_chat'),
"view_by_alt_message" => lang('Chat.view_by_alt_message')
]])
->toJson(true);
}
public function get_notifications_not_viewed_from_message(int $chat_message_id) public function get_notifications_not_viewed_from_message(int $chat_message_id)
{ {
$unviewedNotifications = $this->chatModel->getUsersNotificationNotViewedFromChat($chat_message_id); $unviewedNotifications = $this->chatModel->getUsersNotificationNotViewedFromChat($chat_message_id);
@ -605,14 +621,13 @@ class ChatController extends BaseController
$query = $this->userModel->builder()->select( $query = $this->userModel->builder()->select(
[ [
"id", "id",
"CONCAT(first_name,' ',last_name,'(',username,')') as name" "CONCAT(first_name,' ',last_name) as name"
] ]
) )
->where("deleted_at", null) ->where("deleted_at", null)
->whereNotIn("id", $chat_users_id); ->whereNotIn("id", $chat_users_id);
if ($this->request->getGet("q")) { if ($this->request->getGet("q")) {
$query->groupStart() $query->groupStart()
->orLike("users.username", $this->request->getGet("q"))
->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q")) ->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q"))
->groupEnd(); ->groupEnd();
} }

View File

@ -707,7 +707,7 @@ class Ordentrabajo extends BaseController
$r = $this->produccionService->storeOrdenTrabajoTareaProgressDate($validatedData); $r = $this->produccionService->storeOrdenTrabajoTareaProgressDate($validatedData);
$otTareaEntity = $this->otTarea->find($validatedData['ot_tarea_id']); $otTareaEntity = $this->otTarea->find($validatedData['ot_tarea_id']);
$data = [ $data = [
"tiempo_trabajado" => float_seconds_to_hhmm_string($otTareaEntity->tiempo_real), "tiempo_trabajado" => float_seconds_to_hhmmss_string($otTareaEntity->tiempo_real),
"tarea" => $otTareaEntity, "tarea" => $otTareaEntity,
"estado" => $validatedData['estado'], "estado" => $validatedData['estado'],
]; ];
@ -728,7 +728,7 @@ class Ordentrabajo extends BaseController
{ {
$otTareaEntity = $this->otTarea->find($orden_trabajo_tarea_id); $otTareaEntity = $this->otTarea->find($orden_trabajo_tarea_id);
$data = [ $data = [
"tiempo_trabajado" => float_seconds_to_hhmm_string($otTareaEntity->tiempo_trabajado()), "tiempo_trabajado" => float_seconds_to_hhmmss_string($otTareaEntity->tiempo_trabajado()),
"progress_dates" => $otTareaEntity->progress_dates(), "progress_dates" => $otTareaEntity->progress_dates(),
]; ];
return $this->response->setJSON($data); return $this->response->setJSON($data);

View File

@ -0,0 +1,26 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class AddAliasOtColumnMaquinasTable extends Migration
{
protected array $COLUMNS = [
"alias_ot" => [
"type" => "VARCHAR",
"constraint" => 255,
"null" => true
],
];
public function up()
{
$this->forge->addColumn('lg_maquinas', $this->COLUMNS);
}
public function down()
{
$this->forge->dropColumn('lg_maquinas', array_keys($this->COLUMNS));
}
}

View File

@ -23,6 +23,11 @@ class DefaultConfigVariablesSeeder extends Seeder
"value" => 6000, "value" => 6000,
"description" => "Número de libros máximos que se puede producir al día" "description" => "Número de libros máximos que se puede producir al día"
], ],
[
"name" => "maquina_guillotina_id_default",
"value" => 20,
"description" => "ID de máquina que se asigna a tareas de corte tras impresión"
]
]; ];
public function run() public function run()
{ {

View File

@ -0,0 +1,40 @@
<?php
namespace App\Database\Seeds;
use App\Models\Configuracion\MaquinaModel;
use CodeIgniter\Database\Seeder;
class MaquinaAliasOtSeeder extends Seeder
{
public function run()
{
$m = model(MaquinaModel::class);
$data = [
[
"value" => "6136p",
"alias" => "6136p"
],
[
"value" => "c6100",
"alias" => "c6100"
],
[
"value" => "2250p",
"alias" => "2250p"
],
[
"value" => "C14 000",
"alias" => "C14 000"
],
[
"value" => "IX",
"alias" => "IX"
]
];
foreach ($data as $key => $row) {
$m->like('nombre', $row['value'])->set(['alias_ot' => $row['alias']])->update();
}
}
}

View File

@ -42,7 +42,8 @@ class Maquina extends \CodeIgniter\Entity\Entity
"updated_at" => null, "updated_at" => null,
"user_created_id" => 0, "user_created_id" => 0,
"user_updated_id" => 0, "user_updated_id" => 0,
"etiqueta_envio" => false "etiqueta_envio" => false,
"alias_ot" => null,
]; ];
protected $casts = [ protected $casts = [
"is_padre" => "boolean", "is_padre" => "boolean",
@ -70,6 +71,7 @@ class Maquina extends \CodeIgniter\Entity\Entity
"is_deleted" => "int", "is_deleted" => "int",
"user_created_id" => "int", "user_created_id" => "int",
"user_updated_id" => "int", "user_updated_id" => "int",
"alias_ot" => "?string"
]; ];
public function papeles_impresion() : ?array public function papeles_impresion() : ?array

View File

@ -248,6 +248,10 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
return in_array($this->attributes['tipo'], ["lp_bn", "lp_bnhq", "lp_rot_bn"]); return in_array($this->attributes['tipo'], ["lp_bn", "lp_bnhq", "lp_rot_bn"]);
} }
public function isImpresionInteriorPlana():bool
{
return in_array($this->attributes['tipo'], ["lp_bn", "lp_bnhq", "lp_colorhq","lp_color"]);
}
public function tinta(): string public function tinta(): string
{ {
$tinta = ""; $tinta = "";

View File

@ -29,6 +29,7 @@ return [
'min' => 'Min POD', 'min' => 'Min POD',
'moduleTitle' => 'Machines', 'moduleTitle' => 'Machines',
'nombre' => 'Name', 'nombre' => 'Name',
'alias_ot' => 'Alias',
'observaciones' => 'Remarks', 'observaciones' => 'Remarks',
'ordenPlanning' => 'Planning order', 'ordenPlanning' => 'Planning order',
'padreId' => 'Variante', 'padreId' => 'Variante',

View File

@ -60,6 +60,7 @@ return [
"subscribe_admin_chat_wrong" => "Tienes que seleccionar un usuario.", "subscribe_admin_chat_wrong" => "Tienes que seleccionar un usuario.",
"help_select_chat_department_user" => "Solamente son listados los usuarios que pertenecen al personal. Los clientes no son listados, para añadirlos a la conversación se realiza desde la sección de mensajería de las diferentes secciones(presupuesto,pedido,factura ...)", "help_select_chat_department_user" => "Solamente son listados los usuarios que pertenecen al personal. Los clientes no son listados, para añadirlos a la conversación se realiza desde la sección de mensajería de las diferentes secciones(presupuesto,pedido,factura ...)",
"store_department" => "Crear departamento", "store_department" => "Crear departamento",
"direct_messsages" => "Mensajes directos",
"mail" => [ "mail" => [
"mail_subject" => "Nuevo mensaje" "mail_subject" => "Nuevo mensaje"
] ]

View File

@ -30,6 +30,7 @@ return [
'min' => 'POD Min', 'min' => 'POD Min',
'moduleTitle' => 'Máquinas', 'moduleTitle' => 'Máquinas',
'nombre' => 'Nombre', 'nombre' => 'Nombre',
'alias_ot' => 'Alias',
'observaciones' => 'Observaciones', 'observaciones' => 'Observaciones',
'ordenPlanning' => 'Orden Planning', 'ordenPlanning' => 'Orden Planning',
'padreId' => 'Variante', 'padreId' => 'Variante',
@ -99,7 +100,7 @@ return [
], ],
'metrosxminuto' => [ 'metrosxminuto' => [
'max_length' => 'El campo {field} no puede exeder de {param} caracteres de longitud.', 'max_length' => 'El campo {field} no puede exceder de {param} caracteres de longitud.',
'required' => 'El campo {field} es obligatorio.', 'required' => 'El campo {field} es obligatorio.',
], ],
@ -111,13 +112,16 @@ return [
], ],
'nombre' => [ 'nombre' => [
'max_length' => 'El campo {field} no puede exeder de {param} caracteres de longitud.', 'max_length' => 'El campo {field} no puede exceder de {param} caracteres de longitud.',
'required' => 'El campo {field} es obligatorio.', 'required' => 'El campo {field} es obligatorio.',
], ],
'alias' => [
'max_length' => 'El campo {field} no puede exceder de {param} caracteres de longitud.',
],
'observaciones' => [ 'observaciones' => [
'max_length' => 'El campo {field} no puede exeder de {param} caracteres de longitud.', 'max_length' => 'El campo {field} no puede exceder de {param} caracteres de longitud.',
'required' => 'El campo {field} es obligatorio.', 'required' => 'El campo {field} es obligatorio.',
], ],

View File

@ -202,5 +202,10 @@ return [
"tareas_finalizadas" => "Las tareas de esta OT y máquina están marcadas como finalizadas", "tareas_finalizadas" => "Las tareas de esta OT y máquina están marcadas como finalizadas",
"ot_not_found" => "La orden de trabajo número {ot_id} no existe" "ot_not_found" => "La orden de trabajo número {ot_id} no existe"
] ],
'hunkeler' => "Corte HUNKELER",
'tecnau' => "Corte TECNAU",
'end_cut' => "Corte final",
"interior_cut" => "Preparación interior",
"cover_cut" => "Preparación cubierta"
]; ];

View File

@ -381,8 +381,7 @@ class ChatModel extends Model
$row->title = $row->facturaId; $row->title = $row->facturaId;
$rows_new[] = $row; $rows_new[] = $row;
} } elseif ($row->ordenTrabajoId) {
elseif ($row->ordenTrabajoId) {
// $row->model = $facturaModel->find($row->facturaId); // $row->model = $facturaModel->find($row->facturaId);
$row->uri = "/chat/ot/" . $row->ordenTrabajoId . "#accordionChatOrdenTrabajo"; $row->uri = "/chat/ot/" . $row->ordenTrabajoId . "#accordionChatOrdenTrabajo";
$row->avatar = "OT"; $row->avatar = "OT";
@ -439,8 +438,7 @@ class ChatModel extends Model
$row->chatDisplay .= "[INTERNAL]"; $row->chatDisplay .= "[INTERNAL]";
$row->title = $row->facturaId; $row->title = $row->facturaId;
$rows_new[] = $row; $rows_new[] = $row;
} } elseif ($row->ordenTrabajoId) {
elseif ($row->ordenTrabajoId) {
$row->uri = "/produccion/ordentrabajo/edit/" . $row->ordenTrabajoId . "#accordionChatOrdenTrabajo"; $row->uri = "/produccion/ordentrabajo/edit/" . $row->ordenTrabajoId . "#accordionChatOrdenTrabajo";
$row->avatar = "OT"; $row->avatar = "OT";
$row->chatDisplay .= "[INTERNAL]"; $row->chatDisplay .= "[INTERNAL]";
@ -944,6 +942,38 @@ class ChatModel extends Model
} }
return $query->groupBy('chatMessageId'); return $query->groupBy('chatMessageId');
} }
public function getQueryDatatableDirectMessages(): BaseBuilder
{
$query = $this->builder()
->select([
"chats.id",
"cm.id as chatMessageId",
"u.id as userId",
"cm.message",
"chats.created_at",
"
(
SELECT cm2.updated_at
FROM chat_messages cm2
WHERE cm2.chat_id = chats.id
ORDER BY cm2.updated_at DESC LIMIT 1
) as updated_at",
"CONCAT(u.first_name,' ',u.last_name) as creator",
"chats.title as title",
])
->join("chat_messages cm", "chats.id = cm.chat_id", "left")
->join("users u", "u.id = cm.sender_id", 'left')
->where("chats.presupuesto_id", NULL)
->where("chats.pedido_id", NULL)
->where("chats.factura_id", NULL)
->where("chats.orden_trabajo_id", NULL)
->groupStart()
->orWhere("cm.receiver_id",auth()->user()->id)
->orWhere("cm.sender_id",auth()->user()->id)
->groupEnd();
return $query->groupBy('chatMessageId');
}
public function createNewDirectChat(string $title, string $message, array $users) public function createNewDirectChat(string $title, string $message, array $users)
{ {
$chatMessageModel = model(ChatMessageModel::class); $chatMessageModel = model(ChatMessageModel::class);

View File

@ -54,6 +54,7 @@ class MaquinaModel extends \App\Models\BaseModel
"user_created_id", "user_created_id",
"user_updated_id", "user_updated_id",
"etiqueta_envio", "etiqueta_envio",
"alias_ot",
]; ];
protected $returnType = "App\Entities\Configuracion\Maquina"; protected $returnType = "App\Entities\Configuracion\Maquina";
@ -149,6 +150,10 @@ class MaquinaModel extends \App\Models\BaseModel
"label" => "Maquinas.velocidadCorte", "label" => "Maquinas.velocidadCorte",
"rules" => "decimal", "rules" => "decimal",
], ],
"alias_ot" => [
"label" => "Maquinas.alias_ot",
"rules" => "trim|max_length[255]",
],
]; ];
protected $validationMessages = [ protected $validationMessages = [
@ -196,6 +201,9 @@ class MaquinaModel extends \App\Models\BaseModel
"max_length" => "Maquinas.validation.nombre.max_length", "max_length" => "Maquinas.validation.nombre.max_length",
"required" => "Maquinas.validation.nombre.required", "required" => "Maquinas.validation.nombre.required",
], ],
"alias_ot" => [
"max_length" => "Maquinas.validation.alias.max_length"
],
"observaciones" => [ "observaciones" => [
"max_length" => "Maquinas.validation.observaciones.max_length", "max_length" => "Maquinas.validation.observaciones.max_length",
//"required" => "Maquinas.validation.observaciones.required", //"required" => "Maquinas.validation.observaciones.required",

View File

@ -84,6 +84,7 @@ class ProductionService extends BaseService
* @var string * @var string
*/ */
public string $statusColor; public string $statusColor;
public int $guillotinaMaquinaId;
/** /**
* Valor límite del POD * Valor límite del POD
* *
@ -212,6 +213,7 @@ class ProductionService extends BaseService
$this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"]; $this->statusColor = $this->ordenTrabajoConfig->OT_COLORS["sin_imprimir"];
$this->configVariableModel = model(ConfigVariableModel::class); $this->configVariableModel = model(ConfigVariableModel::class);
$this->podValue = $this->configVariableModel->getVariable('POD')->value; $this->podValue = $this->configVariableModel->getVariable('POD')->value;
$this->guillotinaMaquinaId = $this->configVariableModel->getVariable('maquina_guillotina_id_default')->value;
$this->OT_TAREA_STATUS_TITLE = [ $this->OT_TAREA_STATUS_TITLE = [
"P" => lang('Produccion.tarea_estados.P'), "P" => lang('Produccion.tarea_estados.P'),
"F" => lang('Produccion.tarea_estados.F'), "F" => lang('Produccion.tarea_estados.F'),
@ -368,6 +370,8 @@ class ProductionService extends BaseService
$this->storeOrdenTrabajoManipuladoTareas(); $this->storeOrdenTrabajoManipuladoTareas();
// $this->storeOrdenTrabajoPreimpresionTareas(); // $this->storeOrdenTrabajoPreimpresionTareas();
$this->storeOrdenTrabajoEncuadernacionTareas(); $this->storeOrdenTrabajoEncuadernacionTareas();
$this->storeTareaCorteFinal();
// $this->storeOrdenTrabajoExtraTareas(); // $this->storeOrdenTrabajoExtraTareas();
} }
/** /**
@ -408,10 +412,36 @@ class ProductionService extends BaseService
$ot_tareas["tiempo_real"] = 0; $ot_tareas["tiempo_real"] = 0;
$insert_query_result = $this->otTarea->insert($ot_tareas); $insert_query_result = $this->otTarea->insert($ot_tareas);
$ot_tareas = []; $ot_tareas = [];
$this->storeTareaCorteBloque($p_linea);
$this->storeTareaCorte($p_linea); $this->storeTareaCorte($p_linea);
} }
return $insert_query_result; return $insert_query_result;
} }
/**
* Inserta una tarea de corte si la impresion es en `rotativa`
*
* @return OrdenTrabajoTareaEntity|null
*/
protected function storeTareaCorteFinal(): ?OrdenTrabajoTareaEntity
{
$presupuestoLineaImpresion = $this->presupuesto->presupuestoLineaImpresion();
$data = [
'orden_trabajo_id' => $this->ot->id,
'presupuesto_linea_id' => $presupuestoLineaImpresion->id,
'nombre' => lang('Produccion.end_cut'),
'maquina_id' => $this->defaultMaquinaCorte->id,
'orden' => $this->defaultMaquinaCorte->orden_planning,
'tiempo_estimado' => 0,
'tiempo_real' => 0,
'is_corte' => true,
'tipo_corte' => "bobina",
];
$tareaId = $this->otTarea->insert($data);
$otCorte = $this->otTarea->find($tareaId);
return $otCorte;
}
/** /**
* Inserta una tarea de corte si la impresion es en `rotativa` * Inserta una tarea de corte si la impresion es en `rotativa`
* *
@ -421,23 +451,64 @@ class ProductionService extends BaseService
protected function storeTareaCorte(PresupuestoLineaEntity $pLinea): ?OrdenTrabajoTareaEntity protected function storeTareaCorte(PresupuestoLineaEntity $pLinea): ?OrdenTrabajoTareaEntity
{ {
$otCorte = null; $otCorte = null;
$presupuestoTipo = $this->presupuesto->tipo_presupuesto()->codigo;
$isRusticaFresado = str_contains($presupuestoTipo, "Fresado");
$data = [
'orden_trabajo_id' => $this->ot->id,
'presupuesto_linea_id' => $pLinea->id,
'nombre' => 'Corte',
'maquina_id' => $this->guillotinaMaquinaId,
'orden' => $pLinea->maquina()->orden_planning + 1,
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
'tiempo_real' => 0,
'is_corte' => true,
'tipo_corte' => "prep",
];
if ($pLinea->isCubierta()) {
$data['nombre'] = lang('Produccion.cover_cut');
$tareaId = $this->otTarea->insert($data);
$otCorte = $this->otTarea->find($tareaId);
}
if ($pLinea->isImpresionInteriorPlana() || $pLinea->isRotativa()) {
$data['nombre'] = lang('Produccion.interior_cut');
//* Si es rustica fresado y rotativa no se añade preparación de interior en guillotina
if (!$isRusticaFresado && !$pLinea->isRotativa()) {
$tareaId = $this->otTarea->insert($data);
$otCorte = $this->otTarea->find($tareaId);
return $otCorte;
}
}
return $otCorte;
}
/**
* Inserta una tarea de corte a bloque
* Se añade después de una tarea de impresión interior en rotativa.
*
*
* @param PresupuestoLineaEntity $pLinea
* @return OrdenTrabajoTareaEntity|null
*/
protected function storeTareaCorteBloque(PresupuestoLineaEntity $pLinea)
{
$otCorte = null;
$name = $this->cosido() ? lang('Produccion.hunkeler') : lang('Produccion.tecnau');
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' => $name,
'maquina_id' => $this->defaultMaquinaCorte->id, 'maquina_id' => $this->defaultMaquinaCorte->id,
'orden' => $this->defaultMaquinaCorte->orden_planning, 'orden' => $pLinea->maquina()->orden_planning + 1,
'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60, 'tiempo_estimado' => $pLinea->rotativa_tiempo_corte * 60,
'tiempo_real' => 0, 'tiempo_real' => 0,
'is_corte' => true, 'is_corte' => true,
'tipo_corte' => "bobina", 'tipo_corte' => "bloque",
]); ]);
$otCorte = $this->otTarea->find($tareaId); $otCorte = $this->otTarea->find($tareaId);
} }
return $otCorte; return $otCorte;
} }
/** /**
* General las tareas de acabado segun las líneas de presupuesto_acabados * General las tareas de acabado segun las líneas de presupuesto_acabados
* *
@ -1329,7 +1400,7 @@ class ProductionService extends BaseService
public function tareaUpdateMaquinaCorte($orden_trabajo_id): bool public function tareaUpdateMaquinaCorte($orden_trabajo_id): bool
{ {
$cvm = model(ConfigVariableModel::class); $cvm = model(ConfigVariableModel::class);
$otTarea = $this->otTarea->where('orden_trabajo_id', $orden_trabajo_id)->where('is_corte', true)->first(); $otTarea = $this->otTarea->where('orden_trabajo_id', $orden_trabajo_id)->where('is_corte', true)->whereIn('tipo_corte', ['bobina', 'guillotina'])->first();
$toggleCorte = "bobina"; $toggleCorte = "bobina";
if ($otTarea->tipo_corte == "bobina") { if ($otTarea->tipo_corte == "bobina") {
$maquina_id = $cvm->where('name', "id_maquina_guillotina_corte_ot_tarea")->first()["value"]; $maquina_id = $cvm->where('name', "id_maquina_guillotina_corte_ot_tarea")->first()["value"];

View File

@ -6,6 +6,13 @@
</label> </label>
<input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control" <input type="text" id="nombre" name="nombre" required maxLength="255" class="form-control"
value="<?= old('nombre', $maquina->nombre) ?>"> value="<?= old('nombre', $maquina->nombre) ?>">
</div>
<div class="col-md-3">
<label for="alias" class="form-label">
<?= lang('Maquinas.alias_ot') ?>*
</label>
<input type="text" id="alias" name="alias_ot" required maxLength="255" class="form-control"
value="<?= old('alias_ot', $maquina->alias_ot) ?>">
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<label for="min" class="form-label"> <label for="min" class="form-label">

View File

@ -17,6 +17,9 @@ use Config\App;
<li class="nav-item"> <li class="nav-item">
<button type="button" class="nav-link active" role="tab" id="navs-top-align-all-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-all"><?= lang('App.global_all') ?></button> <button type="button" class="nav-link active" role="tab" id="navs-top-align-all-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-all"><?= lang('App.global_all') ?></button>
</li> </li>
<li class="nav-item">
<button type="button" class="nav-link" role="tab" id="navs-top-align-direct-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-direct"><?= lang('Chat.direct_messsages') ?></button>
</li>
<li class="nav-item"> <li class="nav-item">
<button type="button" class="nav-link" role="tab" id="navs-top-align-presupuestos-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-presupuestos"><?= lang('App.permisos_presupuestos') ?></button> <button type="button" class="nav-link" role="tab" id="navs-top-align-presupuestos-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-presupuestos"><?= lang('App.permisos_presupuestos') ?></button>
</li> </li>
@ -35,6 +38,10 @@ use Config\App;
<div class="tab-pane fade show active" id="navs-top-align-all"> <div class="tab-pane fade show active" id="navs-top-align-all">
<?= view("themes/vuexy/components/tables/messages_table", ["id" => "tableAllMessages"]) ?> <?= view("themes/vuexy/components/tables/messages_table", ["id" => "tableAllMessages"]) ?>
</div> </div>
<div class="tab-pane fade show" id="navs-top-align-direct">
<button class="btn-primary btn" id="btn-new-message"><span><?= lang('Chat.modal.new_message') ?></span></button>
<?= view("themes/vuexy/components/tables/messages_table", ["id" => "tableDirectMessages"]) ?>
</div>
<div class="tab-pane fade show" id="navs-top-align-presupuestos"> <div class="tab-pane fade show" id="navs-top-align-presupuestos">
<?= view("themes/vuexy/components/tables/messages_table", ["id" => "tablePresupuestoMessages"]) ?> <?= view("themes/vuexy/components/tables/messages_table", ["id" => "tablePresupuestoMessages"]) ?>
</div> </div>
@ -70,7 +77,8 @@ use Config\App;
<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/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script> <script src="<?= site_url("themes/vuexy/vendor/libs/formvalidation/dist/js/plugins/AutoFocus.min.js") ?>"></script>
<script type="module" src="<?= site_url('assets/js/safekat/pages/configuracion/messages/index.js') ?>"> <script type="module" src="<?= site_url('assets/js/safekat/pages/configuracion/messages/index.js') ?>">
<script src="<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>"></script> < script src = "<?= site_url('themes/vuexy/vendor/libs/sweetalert2/sweetalert2.js') ?>" >
</script>
</script> </script>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,9 +1,7 @@
<table> <table>
<tr class="encuadernacion"> <tr class="encuadernacion">
<th >Encuadernacion</th> <th >Encuadernacion</th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50"></th>
<th class="cell-50">Sobrecubierta</th> <th class="cell-50">Sobrecubierta</th>
<th class="cell-50">Guardas</th> <th class="cell-50">Guardas</th>
<th class="cell-50">Retractilado</th> <th class="cell-50">Retractilado</th>
@ -12,9 +10,7 @@
<?php if (count($encuadernaciones) > 0): ?> <?php if (count($encuadernaciones) > 0): ?>
<tr style="color: red;"> <tr style="color: red;">
<td><?= $encuadernacion->tarifa()->nombre ?></td> <td><?= $encuadernacion->tarifa()->nombre ?></td>
<td></td>
<td></td>
<td></td>
<td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></td> <td><?= $presupuesto->hasSobrecubierta() ? "SI" : "NO" ?></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>

View File

@ -56,13 +56,13 @@ $settings = $session->get('settings');
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;"> <div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span> <span><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span> <span>Comercial: <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div> </div>
</div> </div>
<div class="col-4"> <div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100"> <div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;"> <span class="w-100 text-center code-title" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?> <?php if ($isPOD): ?>
<strong>POD</strong> <strong>POD</strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?> <?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
@ -70,18 +70,17 @@ $settings = $session->get('settings');
<?php else: ?> <?php else: ?>
<strong>GENERAL</strong> <strong>GENERAL</strong>
<?php endif; ?> <?php endif; ?>
</span> </span>
</div> </div>
</div> </div>
</div> </div>
<div class="row p-2"> <div class="row p-2">
<div class="col-3 h-100"> <div class="col-3 h-100">
<div class="row text-center">
<span id="fecha_encuadernado_at" class="fs-large fw-bold" style="color:<?= $colors["general"]["color"] ?>;"><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></span>
</div>
<div class="row px-2 mt-2 h-100"> <div class="row px-2 mt-2 h-100">
<table class="h-100 bg-white"> <table class="h-100 bg-white" style="font-size: small;">
<tr> <tr>
<th class="bg-white">IN</th> <th class="bg-white">IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td> <td class="t-cell bg-white"><?= $ubicacion ?></td>
@ -103,26 +102,27 @@ $settings = $session->get('settings');
<td class="t-cell bg-white"><?= $ubicacion ?></td> <td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<div class="col-5"> <div class="col-5 h-100">
<div class="row"> <div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;"> <div class="col-12 w-50 text-center code-title fw-bold" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= $encuadernacionCode ?></strong> <?= $encuadernacionCode ?>
</div> </div>
</div> </div>
<div class="row h-75"> <div class="row h-75">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;"> <div class="col-6 square text-center code-title" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?> <?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div> </div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>"> <div class="col-6 square text-center code-title <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?> <?= $tiempo_impresion ?>
</div> </div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;"> <div class="col-6 square text-center code-title" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?> <?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div> </div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;"> <div class="col-6 square text-center code-title" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?> <?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div> </div>
<?php foreach ($acabados as $key => $acabado): ?> <?php foreach ($acabados as $key => $acabado): ?>
@ -137,7 +137,7 @@ $settings = $session->get('settings');
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>"> <div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100"> <div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center"> <div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span> <span class="ot-code" style="color:<?= $colors["ot"]["color"] ?>;"><?= $ot->id ?></span>
</div> </div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white"> <div class="col-12 h-50 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" /> <img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
@ -151,32 +151,30 @@ $settings = $session->get('settings');
</div> </div>
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<table class="h-50"> <table class="h-100">
<tr> <tr>
<th>IDSK</th> <th class="al">IDSK</th>
<td class="t-cell"> <td class="t-cell"></td>
</td>
</tr> </tr>
<tr> <tr>
<th>CLIENTE</th> <th class="al">CLIENTE</th>
<td class="t-cell"> <td class="t-cell">
<?= $cliente->alias ?> <?= $cliente->alias ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>TITULO</th> <th class="al">TITULO</th>
<td class="t-cell"> <td class="t-cell">
<?= $presupuesto->titulo ?> <?= $presupuesto->titulo ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>ISBN</th> <th class="al">ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td> <td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr> </tr>
<tr> <tr>
<th>PEDIDO CLIENTE</th> <th class="al">PEDIDO</th>
<td class="t-cell"><?= $pedido->id ?></td> <td class="t-cell"><?= $pedido->id ?></td>
</tr> </tr>
</table> </table>
@ -184,12 +182,10 @@ $settings = $session->get('settings');
<div class="col-4"> <div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%"> <div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?> <?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?> <?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?> <?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="col-12"> <div class="col-12">
<div class="imposicion"> <div class="imposicion">
@ -204,19 +200,31 @@ $settings = $session->get('settings');
</div> </div>
</div> </div>
<div class="row mb-2"> <div class="row mb-2">
<div class="d-flex flex-row gap-2 justify-content-start">
<div class="section-title impresion">IMP. INTERIOR</div> <div class="section-title impresion">IMP. INTERIOR</div>
<?php if ($pedido->fecha_impresion): ?>
<div class="section-title "><?= Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_impresion)->format('d/m/Y') ?></div>
<?php endif; ?>
</div>
<div class="col-12"> <div class="col-12">
<div> <div>
<table> <table class="">
<tr> <tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th> <th class="t-header"><?= lang('Produccion.size') ?></th>
<th class="t-header"><?= lang('Produccion.ejemplares') ?></th>
<th class="t-header"><?= lang('Produccion.tipo') ?></th>
<th class="t-header"><?= lang('Produccion.lomo') ?></th>
</tr>
<tr>
<?php if ($presupuesto->papel_formato_personalizado): ?>
<td class="t-cell text-center"> <?= $presupuesto->papel_formato_ancho ?>x<?= $presupuesto->papel_formato_alto ?> </td>
<?php else: ?>
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td> <td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th> <?php endif; ?>
<td class="t-cell text-center"> 1 </td> <td class="t-cell text-center"> 1 </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td> <td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td> <td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr> </tr>
</table> </table>
<table> <table>
@ -262,7 +270,12 @@ $settings = $session->get('settings');
</div> </div>
</div> </div>
<div class="row mb-2"> <div class="row mb-2">
<div class="d-flex flex-row justify-content-start w-100 gap-2">
<div class="section-title">LOGISTICA</div> <div class="section-title">LOGISTICA</div>
<?php if ($pedido->fecha_entrega_real): ?>
<div class="section-title "><?= Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_entrega_real)->format('d/m/Y') ?></div>
<?php endif; ?>
</div>
<div class="col-12"> <div class="col-12">
<table> <table>
<tr> <tr>

View File

@ -48,27 +48,25 @@ $settings = $session->get('settings');
<img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" /> <img class="portada-img border-secondary img-thumbnail img-fluid" src="<?= $ot->full_path ? "data:image/png;base64," . base64_encode(file_get_contents($ot->full_path)) : '/assets/img/portada_not_found.png' ?>" />
<?php else: ?> <?php else: ?>
<img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" /> <img class="portada-img border-secondary img-thumbnail img-fluid" src="/assets/img/portada_not_found.png" />
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;"> <div class="col-10 py-2 rounded border-1 border-secondary" style="background-color: <?= $colors["general"]["bg"] ?>;color:<?= $colors["general"]["color"] ?>;">
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;"> <div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span> <span class="fs-large"><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span> <span class="fs-large">Comercial: <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div> </div>
</div> </div>
<div class="col-4"> <div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100"> <div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;"> <span class="w-100 text-center code-title" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?> <?php if ($isPOD): ?>
<strong>POD</strong> <strong><?= $linea_impresion->maquina()->alias_ot ?? "POD" ?></strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?> <?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
<strong>ROTATIVA</strong> <strong>ROTATIVA</strong>
<?php else: ?> <?php else: ?>
<strong>GENERAL</strong> <strong><?= $linea_impresion->maquina()->alias_ot ?? "GENERAL" ?></strong>
<?php endif; ?> <?php endif; ?>
@ -79,13 +77,11 @@ $settings = $session->get('settings');
<div class="row p-2"> <div class="row p-2">
<div class="col-3 h-100"> <div class="col-3 h-100">
<div class="row px-2 d-flex flex justify-content-between align-items-center"> <div class="row text-center">
<div class="col-6 w-100 text-center"> <span id="fecha_encuadernado_at" class="fs-large fw-bold" style="color:<?= $colors["general"]["color"] ?>;"><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></span>
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
</div>
</div> </div>
<div class="row px-2 mt-2 h-100"> <div class="row px-2 mt-2 h-100">
<table class="h-100 bg-white"> <table class="h-100 bg-white" style="font-size: small;">
<tr> <tr>
<th class="bg-white">IN</th> <th class="bg-white">IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td> <td class="t-cell bg-white"><?= $ubicacion ?></td>
@ -110,23 +106,23 @@ $settings = $session->get('settings');
</div> </div>
</div> </div>
<div class="col-5"> <div class="col-5 h-100">
<div class="row"> <div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;"> <div class="col-12 w-50 text-center code-title fw-bold" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= $encuadernacionCode ?></strong> <?= $encuadernacionCode ?>
</div> </div>
</div> </div>
<div class="row h-75"> <div class="row h-100">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;"> <div class="col-6 square text-center code-title" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?> <?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div> </div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>"> <div class="col-6 square text-center code-title <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?> <?= $tiempo_impresion ?>
</div> </div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;"> <div class="col-6 square text-center code-title" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?> <?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div> </div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;"> <div class="col-6 square text-center code-title" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?> <?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div> </div>
<?php foreach ($acabados as $key => $acabado): ?> <?php foreach ($acabados as $key => $acabado): ?>
@ -141,7 +137,7 @@ $settings = $session->get('settings');
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>"> <div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100"> <div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center"> <div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span> <span class="ot-code" style="color:<?= $colors["ot"]["color"] ?>;"><?= $ot->id ?></span>
</div> </div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white"> <div class="col-12 h-50 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" /> <img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
@ -155,32 +151,32 @@ $settings = $session->get('settings');
</div> </div>
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<table class="h-50"> <table class="h-100">
<tr> <tr>
<th>IDSK</th> <th class="al">IDSK</th>
<td class="t-cell"> <td class="t-cell w-75">
</td> </td>
</tr> </tr>
<tr> <tr>
<th>CLIENTE</th> <th class="al">CLIENTE</th>
<td class="t-cell"> <td class="t-cell">
<?= $cliente->alias ?> <?= $cliente->alias ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>TITULO</th> <th class="al">TITULO</th>
<td class="t-cell"> <td class="t-cell">
<?= $presupuesto->titulo ?> <?= $presupuesto->titulo ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>ISBN</th> <th class="al">ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td> <td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr> </tr>
<tr> <tr>
<th>PEDIDO CLIENTE</th> <th class="al">PEDIDO</th>
<td class="t-cell"><?= $pedido->id ?></td> <td class="t-cell"><?= $pedido->id ?></td>
</tr> </tr>
</table> </table>
@ -188,7 +184,6 @@ $settings = $session->get('settings');
<div class="col-4"> <div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%"> <div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?> <?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?> <?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?> <?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?> <?php endif; ?>
@ -208,19 +203,31 @@ $settings = $session->get('settings');
</div> </div>
</div> </div>
<div class="row mb-2"> <div class="row mb-2">
<div class="d-flex flex-row gap-2 justify-content-start">
<div class="section-title impresion">IMP. INTERIOR</div> <div class="section-title impresion">IMP. INTERIOR</div>
<?php if ($pedido->fecha_impresion): ?>
<div class="section-title "><?= Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_impresion)->format('d/m/Y') ?></div>
<?php endif; ?>
</div>
<div class="col-12"> <div class="col-12">
<div> <div>
<table> <table class="">
<tr> <tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th> <th class="t-header"><?= lang('Produccion.size') ?></th>
<th class="t-header"><?= lang('Produccion.ejemplares') ?></th>
<th class="t-header"><?= lang('Produccion.tipo') ?></th>
<th class="t-header"><?= lang('Produccion.lomo') ?></th>
</tr>
<tr>
<?php if ($presupuesto->papel_formato_personalizado): ?>
<td class="t-cell text-center"> <?= $presupuesto->papel_formato_ancho ?>x<?= $presupuesto->papel_formato_alto ?> </td>
<?php else: ?>
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td> <td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th> <?php endif; ?>
<td class="t-cell text-center"> <?= $presupuesto->tirada ?> + <?= $presupuesto->merma ?> </td> <td class="t-cell text-center"> <?= $presupuesto->tirada ?> + <?= $presupuesto->merma ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td> <td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td> <td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr> </tr>
</table> </table>
<table> <table>
@ -235,12 +242,12 @@ $settings = $session->get('settings');
<th>Tiempo</th> <th>Tiempo</th>
</tr> </tr>
<tr> <tr>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro --> <td><?= number_format($presupuesto->paginas, 0, ',', '.') ?></td> <!-- Páginas libro -->
<td><?= $presupuesto->tirada ?> </td> <td><?= number_format($presupuesto->tirada, 0, ',', '.') ?> </td>
<td><?= $linea_impresion->tinta() ?></td> <td><?= $linea_impresion->tinta() ?></td>
<td><?= json_decode($linea_impresion->formas)->formas ?></td> <td><?= json_decode($linea_impresion->formas)->formas ?></td>
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td> <td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
<td><?= $linea_impresion->rotativa_clicks_total ?></td> <td><?= number_format($linea_impresion->rotativa_clicks_total, 0, ',', '.') ?></td>
<td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td> <td><?= float_seconds_to_hhmm_string($linea_impresion->horas_maquina * 3600) ?></td>
</tr> </tr>
<tr> <tr>
@ -256,7 +263,7 @@ $settings = $session->get('settings');
</table> </table>
</div> </div>
<div class="comments <?= $ot->comment_interior ? '' : 'd-none' ?>"> <div class="comments <?= $ot->comment_interior ? '' : 'd-none' ?>">
<div class="flex-row impresion"><?= lang('Produccion.comentariosImpresionInterior') ?></div> <div class="flex-row "><?= lang('Produccion.comentariosImpresionInterior') ?></div>
<div class=" w-100"> <div class=" w-100">
<p> <p>
<?= $ot->comment_interior ?> <?= $ot->comment_interior ?>
@ -270,7 +277,7 @@ $settings = $session->get('settings');
<div class="section-title cubierta">IMP. CUBIERTA</div> <div class="section-title cubierta">IMP. CUBIERTA</div>
<div class="col-12"> <div class="col-12">
<table> <table class="">
<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>
<th>Tintas</th> <th>Tintas</th>
@ -308,12 +315,19 @@ $settings = $session->get('settings');
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="row"> <div class="row">
<div class="d-flex flex-row justify-content-start w-100 gap-2">
<div class="section-title encuadernacion">ACABADOS/ENCUADERNACIÓN</div> <div class="section-title encuadernacion">ACABADOS/ENCUADERNACIÓN</div>
<div class="col-12"> <?php if ($pedido->fecha_encuadernado): ?>
<div class="col-1 w-10 mb-2 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;"> <div class="section-title "><?= Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') ?></div>
<span class="fs-bold"><?= $encuadernacionCode ?></span> <?php endif; ?>
</div> </div>
<table> <div class="col-12">
<div class="row">
<div class="col-3 mb-2 text-center code-title fw-bold" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<?= $encuadernacionCode ?>
</div>
</div>
<table class="">
<?php foreach ($acabados as $key => $acabado): ?> <?php foreach ($acabados as $key => $acabado): ?>
<tr> <tr>
<td class="w-10 encuadernacion">Plastificado</td> <td class="w-10 encuadernacion">Plastificado</td>
@ -345,7 +359,8 @@ $settings = $session->get('settings');
} }
} catch (\Throwable $th) { } catch (\Throwable $th) {
$error_message = $th->getMessage(); $error_message = $th->getMessage();
echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>"; // echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
// echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>";
// echo "<br><span style='color:red'>$error_message</span>"; // echo "<br><span style='color:red'>$error_message</span>";
} }
} }
@ -366,20 +381,23 @@ $settings = $session->get('settings');
</div> </div>
<div class="row mb-2"> <div class="row mb-2">
<div class="d-flex flex-row justify-content-start w-100 gap-2">
<div class="section-title">LOGISTICA</div> <div class="section-title">LOGISTICA</div>
<?php if ($pedido->fecha_entrega_real): ?>
<div class="section-title "><?= Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_entrega_real)->format('d/m/Y') ?></div>
<?php endif; ?>
</div>
<div class="col-12"> <div class="col-12">
<table> <table class="">
<tr> <tr>
<th>Peso Unidad</th> <th>Peso Unidad</th>
<th>Peso Pedido</th> <th>Peso Pedido</th>
<th>Cajas</th> <th>Cajas</th>
<th>Corte Pie</th>
</tr> </tr>
<tr> <tr>
<td><?= number_format($peso_unidad, 2, ',', '.') ?> gr</td> <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><?= $peso_pedido > 1000 ? number_format($peso_pedido / 1000, 2, ',', '.') . " kg" : number_format($peso_pedido, 2, ',', '.') . " gr" ?> </td>
<td>-</td> <td>-</td>
<td>-</td>
</tr> </tr>
</table> </table>
<div class="comments <?= $ot->comment_logistica ? '' : 'd-none' ?>"> <div class="comments <?= $ot->comment_logistica ? '' : 'd-none' ?>">

View File

@ -56,13 +56,13 @@ $settings = $session->get('settings');
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;"> <div class="px-2 d-flex flex justify-content-between align-items-center" style="background-color: <?= $colors["week_day"]["bg"] ?>;color:<?= $colors["week_day"]["color"] ?>;">
<span><strong><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></strong></span> <span><?= $pedido->fecha_encuadernado ? week_day_humanize(Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->getDayOfWeek() - 1, true) : "" ?></span>
<span><strong>Comercial:</strong> <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span> <span>Comercial: <?= $cliente->first_name . " " . $cliente->comercial()->last_name ?> </span>
</div> </div>
</div> </div>
<div class="col-4"> <div class="col-4">
<div class="px-2 d-flex flex justify-content-center align-items-center w-100"> <div class="px-2 d-flex flex justify-content-center align-items-center w-100">
<span class="w-100 text-center" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;"> <span class="w-100 text-center code-title" style="background-color: <?= $colors["impresion_interior_ppal"]["bg"] ?>;color:<?= $colors["impresion_interior_ppal"]["color"] ?>;">
<?php if ($isPOD): ?> <?php if ($isPOD): ?>
<strong>POD</strong> <strong>POD</strong>
<?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?> <?php elseif ($presupuesto->presupuestoLineaImpresion()->isRotativa()): ?>
@ -70,22 +70,17 @@ $settings = $session->get('settings');
<?php else: ?> <?php else: ?>
<strong>GENERAL</strong> <strong>GENERAL</strong>
<?php endif; ?> <?php endif; ?>
</span> </span>
</div> </div>
</div> </div>
</div> </div>
<div class="row p-2"> <div class="row p-2">
<div class="col-3 h-100"> <div class="col-3 h-100">
<div class="row px-2 d-flex flex justify-content-between align-items-center"> <div class="row text-center">
<div class="col-6 w-100 text-center"> <span id="fecha_encuadernado_at" class="fs-large fw-bold" style="color:<?= $colors["general"]["color"] ?>;"><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></span>
<span id="fecha_encuadernado_at" style="color:<?= $colors["general"]["color"] ?>;"><strong><?= $pedido->fecha_encuadernado ? Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') : "" ?></strong></span>
</div>
</div> </div>
<div class="row px-2 mt-2 h-100"> <div class="row px-2 mt-2 h-100">
<table class="h-100 bg-white"> <table class="h-100 bg-white" style="font-size: small;">
<tr> <tr>
<th class="bg-white">IN</th> <th class="bg-white">IN</th>
<td class="t-cell bg-white"><?= $ubicacion ?></td> <td class="t-cell bg-white"><?= $ubicacion ?></td>
@ -107,26 +102,27 @@ $settings = $session->get('settings');
<td class="t-cell bg-white"><?= $ubicacion ?></td> <td class="t-cell bg-white"><?= $ubicacion ?></td>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
<div class="col-5"> <div class="col-5 h-100">
<div class="row"> <div class="row">
<div class="col-12 w-50 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;"> <div class="col-12 w-50 text-center code-title fw-bold" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<strong><?= $encuadernacionCode ?></strong> <?= $encuadernacionCode ?>
</div> </div>
</div> </div>
<div class="row h-75"> <div class="row h-75">
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;"> <div class="col-6 square text-center code-title" style="background-color: <?= $colors["papel_interior"]["bg"] ?>;color:<?= $colors["papel_interior"]["color"] ?>;">
<?= $linea_impresion?->papel_impresion()->papel_code_ot ?> <?= $linea_impresion?->papel_impresion()->papel_code_ot ?>
</div> </div>
<div class="col-6 square text-center <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>"> <div class="col-6 square text-center code-title <?= $linea_impresion->isColor() ? "cmyk" : "bn" ?>">
<?= $tiempo_impresion ?> <?= $tiempo_impresion ?>
</div> </div>
<div class="col-6 square text-center" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;"> <div class="col-6 square text-center code-title" style="background-color: <?= $colors["papel_cubierta"]["bg"] ?>;color:<?= $colors["papel_cubierta"]["color"] ?>;">
<?= $linea_cubierta?->papel_impresion()->papel_code_ot ?> <?= $linea_cubierta?->papel_impresion()->papel_code_ot ?>
</div> </div>
<div class="col-6 square text-center" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;"> <div class="col-6 square text-center code-title" style="background-color: <?= $colors["plastificado"]["bg"] ?>;color:<?= $colors["plastificado"]["color"] ?>;">
<?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?> <?= isset($acabados[0]) ? $acabados[0]->tarifa()->code : "" ?>
</div> </div>
<?php foreach ($acabados as $key => $acabado): ?> <?php foreach ($acabados as $key => $acabado): ?>
@ -141,7 +137,7 @@ $settings = $session->get('settings');
<div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>"> <div class="col-4" style="background-color: <?= $colors["ot"]["bg"] ?>">
<div class="row h-100"> <div class="row h-100">
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center"> <div class="col-12 h-50 d-flex flex align-items-center justify-content-center">
<span class="fs-large" style="color:<?= $colors["ot"]["color"] ?>;"><strong><?= $ot->id ?></strong></span> <span class="ot-code" style="color:<?= $colors["ot"]["color"] ?>;"><?= $ot->id ?></span>
</div> </div>
<div class="col-12 h-50 d-flex flex align-items-center justify-content-center bg-white"> <div class="col-12 h-50 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" /> <img class="img-fluid" src="data:image/png;base64,<?= $ot->bar_code ?>" alt="barcode" />
@ -155,32 +151,30 @@ $settings = $session->get('settings');
</div> </div>
<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
<table class="h-50"> <table class="h-100">
<tr> <tr>
<th>IDSK</th> <th class="al">IDSK</th>
<td class="t-cell"> <td class="t-cell"></td>
</td>
</tr> </tr>
<tr> <tr>
<th>CLIENTE</th> <th class="al">CLIENTE</th>
<td class="t-cell"> <td class="t-cell">
<?= $cliente->alias ?> <?= $cliente->alias ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>TITULO</th> <th class="al">TITULO</th>
<td class="t-cell"> <td class="t-cell">
<?= $presupuesto->titulo ?> <?= $presupuesto->titulo ?>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>ISBN</th> <th class="al">ISBN</th>
<td class="t-cell"><?= $presupuesto->isbn ?></td> <td class="t-cell"><?= $presupuesto->isbn ?></td>
</tr> </tr>
<tr> <tr>
<th>PEDIDO CLIENTE</th> <th class="al">PEDIDO</th>
<td class="t-cell"><?= $pedido->id ?></td> <td class="t-cell"><?= $pedido->id ?></td>
</tr> </tr>
</table> </table>
@ -188,12 +182,10 @@ $settings = $session->get('settings');
<div class="col-4"> <div class="col-4">
<div class="col-12 d-flex justify-content-center" style="width: 100%"> <div class="col-12 d-flex justify-content-center" style="width: 100%">
<?php if ($imposicion): ?> <?php if ($imposicion): ?>
<?php if ($imposicion->imposicion_esquema()): ?> <?php if ($imposicion->imposicion_esquema()): ?>
<?= $imposicion->imposicion_esquema()->svg_schema ?> <?= $imposicion->imposicion_esquema()->svg_schema ?>
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="col-12"> <div class="col-12">
<div class="imposicion"> <div class="imposicion">
@ -208,19 +200,31 @@ $settings = $session->get('settings');
</div> </div>
</div> </div>
<div class="row mb-2"> <div class="row mb-2">
<div class="d-flex flex-row gap-2 justify-content-start">
<div class="section-title impresion">IMP. INTERIOR</div> <div class="section-title impresion">IMP. INTERIOR</div>
<?php if ($pedido->fecha_impresion): ?>
<div class="section-title "><?= Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_impresion)->format('d/m/Y') ?></div>
<?php endif; ?>
</div>
<div class="col-12"> <div class="col-12">
<div> <div>
<table> <table class="">
<tr> <tr>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.size') ?></th> <th class="t-header"><?= lang('Produccion.size') ?></th>
<th class="t-header"><?= lang('Produccion.ejemplares') ?></th>
<th class="t-header"><?= lang('Produccion.tipo') ?></th>
<th class="t-header"><?= lang('Produccion.lomo') ?></th>
</tr>
<tr>
<?php if ($presupuesto->papel_formato_personalizado): ?>
<td class="t-cell text-center"> <?= $presupuesto->papel_formato_ancho ?>x<?= $presupuesto->papel_formato_alto ?> </td>
<?php else: ?>
<td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td> <td class="t-cell text-center"> <?= $papel_formato->ancho ?>x<?= $papel_formato->alto ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.ejemplares') ?></th> <?php endif; ?>
<td class="t-cell text-center"> <?= $presupuesto->tirada/$presupuesto->tirada ?> </td> <td class="t-cell text-center"> 1 </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.tipo') ?></th>
<td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td> <td class="t-cell text-center"> <?= $presupuesto->tipo_presupuesto()?->codigo ?? "" ?> </td>
<th class="t-header" style="width: 10%;"><?= lang('Produccion.lomo') ?></th>
<td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td> <td class="t-cell text-center"> <?= number_format($presupuesto->lomo_cubierta, 2, ',', '.') ?> </td>
</tr> </tr>
</table> </table>
<table> <table>
@ -236,7 +240,7 @@ $settings = $session->get('settings');
</tr> </tr>
<tr> <tr>
<td><?= $presupuesto->paginas ?></td> <!-- Páginas libro --> <td><?= $presupuesto->paginas ?></td> <!-- Páginas libro -->
<td><?= $presupuesto->tirada / $presupuesto->tirada ?> </td> <td> 1 </td>
<td><?= $linea_impresion->tinta() ?></td> <td><?= $linea_impresion->tinta() ?></td>
<td><?= json_decode($linea_impresion->formas)->formas ?></td> <td><?= json_decode($linea_impresion->formas)->formas ?></td>
<td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td> <td><strong><?= $linea_impresion->maquina()->nombre ?></strong></td>
@ -256,7 +260,7 @@ $settings = $session->get('settings');
</table> </table>
</div> </div>
<div class="comments <?= $ot->comment_interior ? '' : 'd-none' ?>"> <div class="comments <?= $ot->comment_interior ? '' : 'd-none' ?>">
<div class="flex-row impresion"><?= lang('Produccion.comentariosImpresionInterior') ?></div> <div class="flex-row impresion">Comentarios impresión interior</div>
<div class="comment-content w-100"> <div class="comment-content w-100">
<p> <p>
<?= $ot->comment_interior ?> <?= $ot->comment_interior ?>
@ -308,10 +312,17 @@ $settings = $session->get('settings');
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="row mb-2"> <div class="row mb-2">
<div class="d-flex flex-row justify-content-start w-100 gap-2">
<div class="section-title encuadernacion">ACABADOS/ENCUADERNACIÓN</div> <div class="section-title encuadernacion">ACABADOS/ENCUADERNACIÓN</div>
<?php if ($pedido->fecha_encuadernado): ?>
<div class="section-title "><?= Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_encuadernado)->format('d/m/Y') ?></div>
<?php endif; ?>
</div>
<div class="col-12"> <div class="col-12">
<div class="col-1 w-10 mb-2 text-center" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;"> <div class="row">
<span class="fs-bold"><?= $encuadernacionCode ?></span> <div class="col-3 mb-2 text-center code-title fw-bold" style="background-color: <?= $colors["ot"]["bg"] ?>;color:<?= $colors["ot"]["color"] ?>;">
<?= $encuadernacionCode ?>
</div>
</div> </div>
<table> <table>
<?php foreach ($acabados as $key => $acabado): ?> <?php foreach ($acabados as $key => $acabado): ?>
@ -345,7 +356,8 @@ $settings = $session->get('settings');
} }
} catch (\Throwable $th) { } catch (\Throwable $th) {
$error_message = $th->getMessage(); $error_message = $th->getMessage();
echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>"; // echo view("/themes/vuexy/pdfs/encuadernados/default.php", ["encuadernacion" => $encuadernacion]);
// echo "<span style='color:red'>No se ha podido renderizar la tabla de encuadernación</span>";
// echo "<br><span style='color:red'>$error_message</span>"; // echo "<br><span style='color:red'>$error_message</span>";
} }
} }
@ -366,7 +378,12 @@ $settings = $session->get('settings');
</div> </div>
<div class="row mb-2"> <div class="row mb-2">
<div class="d-flex flex-row justify-content-start w-100 gap-2">
<div class="section-title">LOGISTICA</div> <div class="section-title">LOGISTICA</div>
<?php if ($pedido->fecha_entrega_real): ?>
<div class="section-title "><?= Time::createFromFormat("Y-m-d H:i:s", $pedido->fecha_entrega_real)->format('d/m/Y') ?></div>
<?php endif; ?>
</div>
<div class="col-12"> <div class="col-12">
<table> <table>
<tr> <tr>
@ -380,9 +397,8 @@ $settings = $session->get('settings');
<td>-</td> <td>-</td>
</tr> </tr>
</table> </table>
<div class="comments"> <div class="comments <?= $ot->comment_logistica ? '' : 'd-none' ?>">
<div class="flex-row logistica"><?= lang('Produccion.comentariosLogistica') ?></div> <div class="flex-row">Comentarios logistica:</div>
<div class="comment-content"> <div class="comment-content">
<p> <p>
<?= $ot->comment_logistica ?> <?= $ot->comment_logistica ?>

View File

@ -650,9 +650,6 @@ class Chat {
<div class="chat-contact-info flex-grow-1 ms-2"> <div class="chat-contact-info flex-grow-1 ms-2">
<h6 class="chat-contact-name text-truncate m-0">${contact?.first_name ?? "" + " " + <h6 class="chat-contact-name text-truncate m-0">${contact?.first_name ?? "" + " " +
contact?.last_name ?? ""}</h6> contact?.last_name ?? ""}</h6>
<p class="chat-contact-status text-muted text-truncate mb-0">
${contact?.cliente_id ? "[CLIENTE]" : ""}${contact.username}
</p>
</div> </div>
</div> </div>
</li> </li>

View File

@ -8,6 +8,8 @@ class MessagesDatatable {
this.datatablePedidoMessageItem = this.item.find("#tablePedidoMessages") this.datatablePedidoMessageItem = this.item.find("#tablePedidoMessages")
this.datatableFacturaMessageItem = this.item.find("#tableFacturaMessages") this.datatableFacturaMessageItem = this.item.find("#tableFacturaMessages")
this.datatableOtMessageItem = this.item.find("#tableOtMessages") this.datatableOtMessageItem = this.item.find("#tableOtMessages")
this.datatableDirectMessageItem = this.item.find("#tableDirectMessages")
this.focusTable = this.datatableItem this.focusTable = this.datatableItem
this.columnDefs = [ this.columnDefs = [
@ -152,6 +154,25 @@ class MessagesDatatable {
columns: this.datatableColumns, columns: this.datatableColumns,
ajax: '/messages/datatable/ots' ajax: '/messages/datatable/ots'
}); });
this.datatableDirectMessage = this.datatableDirectMessageItem.DataTable({
processing: true,
order: [[1, 'desc']],
columnDefs: this.columnDefs,
orderCellsTop: true,
layout: {
topStart: 'pageLength',
topEnd: 'search',
bottomStart: 'info',
bottomEnd: 'paging'
},
serverSide: true,
pageLength: 10,
language: {
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
},
columns: this.datatableColumns,
ajax: '/messages/datatable/direct'
});
this.datatablePresupuestoMessageItem.on("keyup", ".datatable-message-filter", (event) => { this.datatablePresupuestoMessageItem.on("keyup", ".datatable-message-filter", (event) => {
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name")) let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
this.datatablePresupuestoMessage.column(columnIndex).search($(event.currentTarget).val()).draw() this.datatablePresupuestoMessage.column(columnIndex).search($(event.currentTarget).val()).draw()
@ -166,7 +187,11 @@ class MessagesDatatable {
}) })
this.datatableOtMessageItem.on("keyup", ".datatable-message-filter", (event) => { this.datatableOtMessageItem.on("keyup", ".datatable-message-filter", (event) => {
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name")) let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
this.datatableFacturaMessage.column(columnIndex).search($(event.currentTarget).val()).draw() this.datatableOtMessage.column(columnIndex).search($(event.currentTarget).val()).draw()
})
this.datatableDirectMessageItem.on("keyup", ".datatable-message-filter", (event) => {
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
this.datatableDirectMessage.column(columnIndex).search($(event.currentTarget).val()).draw()
}) })
} }
@ -197,17 +222,14 @@ class MessagesDatatable {
} }
} }
handleDropUpError() { } handleDropUpError() { }
addDropUpItem(user) addDropUpItem(user) {
{
return ` return `
<li > <li >
<a type="button" class="d-flex flex-row justify-content-between align-items-center dropdown-item px-2 gap-2" href="javascript:void(0);" > <a type="button" class="d-flex flex-row justify-content-between align-items-center dropdown-item px-2 gap-2" href="javascript:void(0);" >
<span> ${user.userFullName ?? user.userName} </span> <span> ${user.userFullName ?? user.userName} </span>
<span class="badge badge-center rounded-pill text-bg-${ <span class="badge badge-center rounded-pill text-bg-${user.viewed == 1 ? 'success' : 'danger'
user.viewed == 1 ? 'success' : 'danger'
}"> }">
<i class="ti ti-xs ti-${ <i class="ti ti-xs ti-${user.viewed == 1 ? 'eye-check' : 'eye-off'
user.viewed == 1 ? 'eye-check' : 'eye-off'
} "></i> } "></i>
</span> </span>
</a> </a>

View File

@ -58,6 +58,10 @@ class MessagePage {
this.messageDatatable.datatableOtMessage.ajax.reload() this.messageDatatable.datatableOtMessage.ajax.reload()
this.messageDatatable.focusTable = this.messageDatatable.datatableOtMessageItem this.messageDatatable.focusTable = this.messageDatatable.datatableOtMessageItem
}) })
$("#navs-top-align-direct-tab").on("click", () => {
this.messageDatatable.datatableDirectMessage.ajax.reload()
this.messageDatatable.focusTable = this.messageDatatable.datatableDirectMessageItem
})
} }
openNewMessageModal() { openNewMessageModal() {

View File

@ -4,7 +4,7 @@ $(() => {
filename: $(".pdf-wrapper").data("id") + ".pdf", filename: $(".pdf-wrapper").data("id") + ".pdf",
image: { type: 'jpeg', quality: 1 }, image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 4 }, html2canvas: { scale: 4 },
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' } jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
}; };
let elementToPdf = $('body')[0] let elementToPdf = $('body')[0]
html2pdf().set(opt).from(elementToPdf).save() html2pdf().set(opt).from(elementToPdf).save()

View File

@ -3,22 +3,23 @@
margin: 0; margin: 0;
} }
@media print { @media print {
.page, .page {
{
width: 210mm; width: 210mm;
height: 297mm; height: 297mm;
max-width: 210mm; max-width: 210mm;
max-height: 297mm; max-height: 297mm;
print-color-adjust: exact; print-color-adjust: exact;
} }
/* ... the rest of the rules ... */ /* ... the rest of the rules ... */
} }
html { html,body {
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: 8px; width: 100%;
font-size: 14px;
max-height: 297mm; max-height: 297mm;
background-color: white; background-color: white;
} }
@ -27,6 +28,7 @@ html {
border: 0px solid; border: 0px solid;
padding: 10px; padding: 10px;
margin: 10px; margin: 10px;
width: 100%;
max-width: 210mm; max-width: 210mm;
max-height: 297mm; max-height: 297mm;
background-color: white; background-color: white;
@ -37,11 +39,11 @@ html {
border: 2px solid; border: 2px solid;
} }
.square { .square {
height : 75px;
align-items: center; align-items: center;
align-content: center; align-content: center;
justify-content: center; justify-content: center;
font-weight: bold; font-weight: bold;
font-size: 14px;
} }
.esquema { .esquema {
} }
@ -92,6 +94,7 @@ html {
} }
.section-title { .section-title {
font-weight: bold; font-weight: bold;
font-size: 1.2em;
margin-bottom: 4px; margin-bottom: 4px;
} }
.cubierta { .cubierta {
@ -120,23 +123,25 @@ html {
table { table {
width: 100%; width: 100%;
margin-bottom: 2px; margin-bottom: 2px;
font-size: 10px; font-size: 1.2em;
} }
th, td {
border: 0.01px solid black; th,
td {
border-width : 1px;
border-color : black;
} }
table td { table td {
text-align: center; text-align: center;
} }
table th { table th {
font-weight: bold; font-weight: bold;
color: black; color: black;
text-align: center; text-align: center;
} }
table td { .al{
font-weight: bold; text-align:left;
} }
.t-header { .t-header {
@ -149,7 +154,7 @@ table td {
padding-left: 0.2rem; padding-left: 0.2rem;
} }
.t-row { .t-row {
font-size: 8px; font-size: 14px;
width: 100%; width: 100%;
} }
.bicolor { .bicolor {
@ -173,9 +178,7 @@ table td {
background: black; background: black;
color: white; color: white;
} }
.footer {
font-size: 10px;
}
.bg-encuadernacion { .bg-encuadernacion {
background-color: #bbd8a3; background-color: #bbd8a3;
} }
@ -185,3 +188,9 @@ table td {
.cell-50 { .cell-50 {
width: 50px; width: 50px;
} }
.ot-code {
font-size: 4em;
}
.code-title {
font-size: 1.5em;
}