mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Compare commits
2 Commits
feat/tarea
...
dev/import
| Author | SHA1 | Date | |
|---|---|---|---|
| ed587f1cd0 | |||
| 04dde010f4 |
@ -39,13 +39,13 @@ $routes->group('tarifas', ['namespace' => 'App\Controllers\Tarifas'], function (
|
|||||||
|
|
||||||
/* Cliente */
|
/* Cliente */
|
||||||
$routes->group('acabados', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
|
$routes->group('acabados', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
|
||||||
|
|
||||||
$routes->get('', 'TarifaAcabados::index', ['as' => 'tarifaAcabadoList']);
|
$routes->get('', 'TarifaAcabados::index', ['as' => 'tarifaAcabadoList']);
|
||||||
$routes->match(['get', 'post'], 'add', 'TarifaAcabados::add', ['as' => 'tarifaAcabadoAdd']);
|
$routes->match(['get', 'post'], 'add', 'TarifaAcabados::add', ['as' => 'tarifaAcabadoAdd']);
|
||||||
$routes->match(['get', 'post'], 'edit/(:num)', 'TarifaAcabados::edit/$1', ['as' => 'tarifaAcabadoEdit']);
|
$routes->match(['get', 'post'], 'edit/(:num)', 'TarifaAcabados::edit/$1', ['as' => 'tarifaAcabadoEdit']);
|
||||||
$routes->get('delete/(:num)', 'TarifaAcabados::delete/$1', ['as' => 'tarifaAcabadoDelete']);
|
$routes->get('delete/(:num)', 'TarifaAcabados::delete/$1', ['as' => 'tarifaAcabadoDelete']);
|
||||||
$routes->post('datatable', 'TarifaAcabados::datatable', ['as' => 'tarifaAcabadoDT']);
|
$routes->post('datatable', 'TarifaAcabados::datatable', ['as' => 'tarifaAcabadoDT']);
|
||||||
$routes->get('select','TarifaAcabados::show_select',["as" => "showSelectTarifaAcabado"]);
|
|
||||||
$routes->group('lineas', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
|
$routes->group('lineas', ['namespace' => 'App\Controllers\Tarifas\Acabados'], function ($routes) {
|
||||||
$routes->post('datatable', 'TarifaAcabadosLineas::datatable', ['as' => 'tarifaAcabadoLineasDT']);
|
$routes->post('datatable', 'TarifaAcabadosLineas::datatable', ['as' => 'tarifaAcabadoLineasDT']);
|
||||||
$routes->post('datatable_editor', 'TarifaAcabadosLineas::datatable_editor', ['as' => 'tarifaAcabadoLineasDTE']);
|
$routes->post('datatable_editor', 'TarifaAcabadosLineas::datatable_editor', ['as' => 'tarifaAcabadoLineasDTE']);
|
||||||
@ -92,14 +92,6 @@ $routes->group('configuracion', ['namespace' => 'App\Controllers\Configuracion']
|
|||||||
$routes->get('datatable', 'ConfigErrores::datatable', ['as' => 'erroresPresupuestoDatatable']);
|
$routes->get('datatable', 'ConfigErrores::datatable', ['as' => 'erroresPresupuestoDatatable']);
|
||||||
$routes->post('edit/(:num)', 'ConfigErrores::update_error_presupuesto/$1', ['as' => 'erroresPresupuestoUpdate']);
|
$routes->post('edit/(:num)', 'ConfigErrores::update_error_presupuesto/$1', ['as' => 'erroresPresupuestoUpdate']);
|
||||||
});
|
});
|
||||||
$routes->group("servicios", ["namespace" => 'App\Controllers\Configuracion'], function ($routes) {
|
|
||||||
$routes->get('', 'ServicioCliente::index', ['as' => 'servicioClienteList']);
|
|
||||||
$routes->get('(:num)', 'ServicioCliente::show/$1', ['as' => 'servicioClienteShow']);
|
|
||||||
$routes->post('(:num)', 'ServicioCliente::store/$1', ['as' => 'servicioClienteStore']);
|
|
||||||
$routes->post('update/(:num)', 'ServicioCliente::update_servicio_cliente/$1', ['as' => 'updateServicioCliente']);
|
|
||||||
$routes->get('edit/(:num)', 'ServicioCliente::viewForm/$1', ['as' => 'servicioClienteViewForm']);
|
|
||||||
$routes->get('datatable', 'ServicioCliente::datatable', ['as' => 'servicioClienteDatatable']);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -167,8 +159,6 @@ $routes->group('tarifasmanipulado', ['namespace' => 'App\Controllers\Tarifas'],
|
|||||||
$routes->post('datatable', 'Tarifasmanipulado::datatable', ['as' => 'dataTableOfTarifasManipulado']);
|
$routes->post('datatable', 'Tarifasmanipulado::datatable', ['as' => 'dataTableOfTarifasManipulado']);
|
||||||
$routes->post('allmenuitems', 'Tarifasmanipulado::allItemsSelect', ['as' => 'select2ItemsOfTarifasManipulado']);
|
$routes->post('allmenuitems', 'Tarifasmanipulado::allItemsSelect', ['as' => 'select2ItemsOfTarifasManipulado']);
|
||||||
$routes->post('menuitems', 'Tarifasmanipulado::menuItems', ['as' => 'menuItemsOfTarifasManipulado']);
|
$routes->post('menuitems', 'Tarifasmanipulado::menuItems', ['as' => 'menuItemsOfTarifasManipulado']);
|
||||||
$routes->get('select','Tarifasmanipulado::show_select',["as" => "showSelectTarifaManipulado"]);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
$routes->resource('tarifasmanipulado', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifasmanipulado', 'except' => 'show,new,create,update']);
|
$routes->resource('tarifasmanipulado', ['namespace' => 'App\Controllers\Tarifas', 'controller' => 'Tarifasmanipulado', 'except' => 'show,new,create,update']);
|
||||||
|
|
||||||
@ -404,9 +394,6 @@ $routes->group('clientes', ['namespace' => 'App\Controllers\Clientes'], function
|
|||||||
$routes->group('clienteprecios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
$routes->group('clienteprecios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
||||||
$routes->post('datatable', 'ClientePrecios::datatable', ['as' => 'dataTableOfClienteprecios']);
|
$routes->post('datatable', 'ClientePrecios::datatable', ['as' => 'dataTableOfClienteprecios']);
|
||||||
$routes->post('datatable_editor', 'ClientePrecios::datatable_editor', ['as' => 'editorOfClienteprecios']);
|
$routes->post('datatable_editor', 'ClientePrecios::datatable_editor', ['as' => 'editorOfClienteprecios']);
|
||||||
$routes->post('changeplantilla', 'ClientePrecios::updatePlantilla', ['as' => 'changePlantillaOfClienteprecios']);
|
|
||||||
$routes->get('getplantilla', 'ClientePrecios::getCurrentPlantilla', ['as' => 'getPlantillaOfClienteprecios']);
|
|
||||||
$routes->post('update', 'ClientePrecios::updatePlantilla', ['as' => 'updateClienteprecios']);
|
|
||||||
});
|
});
|
||||||
$routes->resource('clienteprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'ClientePrecios', 'except' => 'show,new,create,update']);
|
$routes->resource('clienteprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'ClientePrecios', 'except' => 'show,new,create,update']);
|
||||||
|
|
||||||
@ -416,13 +403,11 @@ $routes->group('clienteplantillaprecios', ['namespace' => 'App\Controllers\Clien
|
|||||||
$routes->get('add', 'Clienteplantillaprecios::add', ['as' => 'newClienteplantillaprecios']);
|
$routes->get('add', 'Clienteplantillaprecios::add', ['as' => 'newClienteplantillaprecios']);
|
||||||
$routes->post('add', 'Clienteplantillaprecios::add', ['as' => 'createClienteplantillaprecios']);
|
$routes->post('add', 'Clienteplantillaprecios::add', ['as' => 'createClienteplantillaprecios']);
|
||||||
$routes->post('edit/(:num)', 'Clienteplantillaprecios::edit/$1', ['as' => 'updateClienteplantillaprecios']);
|
$routes->post('edit/(:num)', 'Clienteplantillaprecios::edit/$1', ['as' => 'updateClienteplantillaprecios']);
|
||||||
$routes->get('edit/(:num)', 'Clienteplantillaprecios::edit/$1', ['as' => 'updateClienteplantillaprecios']);
|
|
||||||
$routes->get('delete/(:num)', 'Clienteplantillaprecios::delete/$1', ['as' => 'deleteClienteplantillaprecios']);
|
$routes->get('delete/(:num)', 'Clienteplantillaprecios::delete/$1', ['as' => 'deleteClienteplantillaprecios']);
|
||||||
$routes->post('datatable', 'Clienteplantillaprecios::datatable', ['as' => 'dataTableOfClientesplantillaprecios']);
|
$routes->post('datatable', 'Clienteplantillaprecios::datatable', ['as' => 'dataTableOfClientesplantillaprecios']);
|
||||||
$routes->get('menuitems', 'Clienteplantillaprecios::menuItems', ['as' => 'menuItemsOfClienteplantillaprecios']);
|
$routes->post('menuitems', 'Clienteplantillaprecios::menuItems', ['as' => 'menuItemsOfClienteplantillaprecios']);
|
||||||
$routes->post('update/(:num)', 'Clienteplantillaprecios::update/$1', ['as' => 'updateClienteplantillaprecios']);
|
|
||||||
});
|
});
|
||||||
$routes->resource('clienteplantillaprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clienteplantillaprecios', 'except' => 'show,new,create']);
|
$routes->resource('clienteplantillaprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clienteplantillaprecios', 'except' => 'show,new,create,update']);
|
||||||
|
|
||||||
|
|
||||||
$routes->group('clienteplantillaprecioslineas', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
$routes->group('clienteplantillaprecioslineas', ['namespace' => 'App\Controllers\Clientes'], function ($routes) {
|
||||||
@ -599,7 +584,6 @@ $routes->group('presupuestocliente', ['namespace' => 'App\Controllers\Presupuest
|
|||||||
$routes->get('cargar/(:num)', 'Presupuestocliente::cargar/$1', ['as' => 'cargarPresupuesto']);
|
$routes->get('cargar/(:num)', 'Presupuestocliente::cargar/$1', ['as' => 'cargarPresupuesto']);
|
||||||
$routes->post('duplicarPresupuesto', 'Presupuestocliente::duplicarPresupuesto', ['as' => 'duplicarPresupuesto']);
|
$routes->post('duplicarPresupuesto', 'Presupuestocliente::duplicarPresupuesto', ['as' => 'duplicarPresupuesto']);
|
||||||
$routes->post('calcular', 'Presupuestocliente::calcular', ['as' => 'calcularPresupuesto']);
|
$routes->post('calcular', 'Presupuestocliente::calcular', ['as' => 'calcularPresupuesto']);
|
||||||
$routes->post('calcularsolapas', 'Presupuestocliente::calcularMaxSolapas', ['as' => 'calcularSolapas']);
|
|
||||||
});
|
});
|
||||||
$routes->resource('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestocliente', 'except' => 'show,new,create,update']);
|
$routes->resource('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestocliente', 'except' => 'show,new,create,update']);
|
||||||
|
|
||||||
@ -776,36 +760,9 @@ $routes->group('mensajes', ['namespace' => 'App\Controllers\Mensajeria'], functi
|
|||||||
$routes->get('delete/(:num)', 'TarifaAcabados::delete/$1', ['as' => 'tarifaAcabadoDelete']);
|
$routes->get('delete/(:num)', 'TarifaAcabados::delete/$1', ['as' => 'tarifaAcabadoDelete']);
|
||||||
$routes->post('datatable', 'TarifaAcabados::datatable', ['as' => 'tarifaAcabadoDT']);*/
|
$routes->post('datatable', 'TarifaAcabados::datatable', ['as' => 'tarifaAcabadoDT']);*/
|
||||||
});
|
});
|
||||||
});
|
|
||||||
$routes->group('messages', ['namespace' => 'App\Controllers\Chat'], function ($routes) {
|
|
||||||
$routes->get('datatable', 'ChatController::datatable_messages', ['as' => 'getDatatableMessages']);
|
|
||||||
$routes->get('datatable/presupuesto', 'ChatController::datatable_presupuesto_messages', ['as' => 'getDatatablePresupuestoMessages']);
|
|
||||||
$routes->get('datatable/pedido', 'ChatController::datatable_pedido_messages', ['as' => 'getDatatablePedidoMessages']);
|
|
||||||
$routes->get('datatable/factura', 'ChatController::datatable_factura_messages', ['as' => 'getDatatableFacturaMessages']);
|
|
||||||
|
|
||||||
$routes->post('direct', 'ChatController::store_new_direct_message', ['as' => 'storeNewDirectMessage']);
|
|
||||||
$routes->post('direct/client', 'ChatController::store_new_direct_message_client', ['as' => 'storeNewDirectMessageClient']);
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
$routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($routes) {
|
$routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($routes) {
|
||||||
|
|
||||||
$routes->get('direct/(:num)', 'ChatController::get_chat_direct_view/$1', ['as' => 'getChatDirectView']);
|
|
||||||
$routes->get('presupuesto/(:num)', 'ChatController::get_chat_presupuesto_view/$1', ['as' => 'getChatPresupuestoView']);
|
|
||||||
$routes->get('pedido/(:num)', 'ChatController::get_chat_pedido_view/$1', ['as' => 'getChatPedidoView']);
|
|
||||||
$routes->get('factura/(:num)', 'ChatController::get_chat_factura_view/$1', ['as' => 'getChatFacturaView']);
|
|
||||||
|
|
||||||
$routes->get('direct/conversation/(:num)', 'ChatController::get_chat_direct/$1', ['as' => 'getChatDirect']);
|
|
||||||
$routes->get('direct/users/select/(:num)', 'ChatController::get_chat_direct_select_users/$1', ['as' => 'getChatDirectSelectUsers']);
|
|
||||||
$routes->get('direct/users/(:num)', 'ChatController::get_chat_direct_users', ['as' => 'getChatDirectUsers']);
|
|
||||||
$routes->post('direct/users/(:num)', 'ChatController::store_chat_direct_users/$1', ['as' => 'storeChatDirectUsers']);
|
|
||||||
$routes->get('direct/messages/(:num)', 'ChatController::get_chat_direct_messages/$1', ['as' => 'getChatDirectMessages']);
|
|
||||||
$routes->post('direct/messages/(:num)', 'ChatController::store_chat_direct_message/$1', ['as' => 'storeChatDirectMessages']);
|
|
||||||
$routes->post('direct/messages/unread/(:num)', 'ChatController::update_chat_direct_message_unread/$1', ['as' => 'updateChatDirectMessageUnread']);
|
|
||||||
|
|
||||||
|
|
||||||
$routes->get('departments', 'ChatController::get_chat_departments', ['as' => 'getChatDepartments']);
|
$routes->get('departments', 'ChatController::get_chat_departments', ['as' => 'getChatDepartments']);
|
||||||
$routes->get('departments/select', 'ChatController::get_chat_department_select', ['as' => 'getChatDepartmentSelect']);
|
|
||||||
$routes->get('department/presupuesto/(:num)/(:num)', 'ChatController::get_chat_presupuesto/$1/$2', ['as' => 'getChatPresupuesto']);
|
$routes->get('department/presupuesto/(:num)/(:num)', 'ChatController::get_chat_presupuesto/$1/$2', ['as' => 'getChatPresupuesto']);
|
||||||
$routes->get('department/pedido/(:num)/(:num)', 'ChatController::get_chat_pedido/$1/$2', ['as' => 'getChatPedido']);
|
$routes->get('department/pedido/(:num)/(:num)', 'ChatController::get_chat_pedido/$1/$2', ['as' => 'getChatPedido']);
|
||||||
$routes->get('department/factura/(:num)/(:num)', 'ChatController::get_chat_factura/$1/$2', ['as' => 'getChatFactura']);
|
$routes->get('department/factura/(:num)/(:num)', 'ChatController::get_chat_factura/$1/$2', ['as' => 'getChatFactura']);
|
||||||
@ -822,8 +779,6 @@ $routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($route
|
|||||||
$routes->get('contact/(:num)/messages', 'ChatController::get_chat_internal_messages/$1', ['as' => 'getChatInternalMessages']);
|
$routes->get('contact/(:num)/messages', 'ChatController::get_chat_internal_messages/$1', ['as' => 'getChatInternalMessages']);
|
||||||
$routes->get('notifications', 'ChatController::get_chat_cliente/$1', ['as' => 'getChatCliente']);
|
$routes->get('notifications', 'ChatController::get_chat_cliente/$1', ['as' => 'getChatCliente']);
|
||||||
$routes->get('users/internal', 'ChatController::get_chat_users_internal', ['as' => 'getChatUsersInternal']);
|
$routes->get('users/internal', 'ChatController::get_chat_users_internal', ['as' => 'getChatUsersInternal']);
|
||||||
$routes->get('users/all', 'ChatController::get_chat_users_all', ['as' => 'getChatUsersAll']);
|
|
||||||
|
|
||||||
$routes->post('hebra/presupuesto', 'ChatController::store_hebra_presupuesto', ['as' => 'storeHebraPresupuesto']);
|
$routes->post('hebra/presupuesto', 'ChatController::store_hebra_presupuesto', ['as' => 'storeHebraPresupuesto']);
|
||||||
$routes->post('hebra/pedido', 'ChatController::store_hebra_pedido', ['as' => 'storeHebraPedido']);
|
$routes->post('hebra/pedido', 'ChatController::store_hebra_pedido', ['as' => 'storeHebraPedido']);
|
||||||
$routes->post('hebra/factura', 'ChatController::store_hebra_factura', ['as' => 'storeHebraFactura']);
|
$routes->post('hebra/factura', 'ChatController::store_hebra_factura', ['as' => 'storeHebraFactura']);
|
||||||
@ -834,14 +789,6 @@ $routes->group('chat', ['namespace' => 'App\Controllers\Chat'], function ($route
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
|
||||||
$routes->group('ordentrabajo', ['namespace' => 'App\Controllers\Produccion'], function ($routes) {
|
|
||||||
$routes->get('', 'Ordentrabajo::index', ['as' => 'viewOrdenTrabajoIndex']);
|
|
||||||
$routes->get('edit/$1', 'Ordentrabajo::edit/$1', ['as' => 'viewOrdenTrabajoEdit']);
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
/*
|
/*
|
||||||
* --------------------------------------------------------------------
|
* --------------------------------------------------------------------
|
||||||
* APIs Route Definitions
|
* APIs Route Definitions
|
||||||
|
|||||||
@ -11,13 +11,10 @@ use App\Models\ChatNotification;
|
|||||||
use App\Models\ChatUser;
|
use App\Models\ChatUser;
|
||||||
use App\Models\Clientes\ClienteModel;
|
use App\Models\Clientes\ClienteModel;
|
||||||
use App\Models\Usuarios\UserModel;
|
use App\Models\Usuarios\UserModel;
|
||||||
use App\Services\MessageService;
|
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\Log\Logger;
|
use CodeIgniter\Log\Logger;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Hermawan\DataTables\DataTable;
|
|
||||||
use CodeIgniter\I18n\Time;
|
|
||||||
|
|
||||||
class ChatController extends BaseController
|
class ChatController extends BaseController
|
||||||
{
|
{
|
||||||
@ -29,8 +26,8 @@ class ChatController extends BaseController
|
|||||||
protected ClienteModel $clienteModel;
|
protected ClienteModel $clienteModel;
|
||||||
protected ChatUser $chatUserModel;
|
protected ChatUser $chatUserModel;
|
||||||
protected ChatNotification $chatNotificationModel;
|
protected ChatNotification $chatNotificationModel;
|
||||||
protected array $viewData;
|
|
||||||
protected static $viewPath = 'themes/vuexy/form/mensajes/';
|
|
||||||
|
|
||||||
|
|
||||||
public function initController(
|
public function initController(
|
||||||
@ -49,6 +46,8 @@ class ChatController extends BaseController
|
|||||||
$this->clienteModel = model(ClienteModel::class);
|
$this->clienteModel = model(ClienteModel::class);
|
||||||
$this->chatUserModel = model(ChatUser::class);
|
$this->chatUserModel = model(ChatUser::class);
|
||||||
$this->chatNotificationModel = model(ChatNotification::class);
|
$this->chatNotificationModel = model(ChatNotification::class);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
public function index() {}
|
public function index() {}
|
||||||
public function get_chat_departments()
|
public function get_chat_departments()
|
||||||
@ -57,10 +56,6 @@ class ChatController extends BaseController
|
|||||||
$data = $this->chatDeparmentModel->getChatDepartments();
|
$data = $this->chatDeparmentModel->getChatDepartments();
|
||||||
return $this->response->setJSON($data);
|
return $this->response->setJSON($data);
|
||||||
}
|
}
|
||||||
public function get_chat_department_select(){
|
|
||||||
$query = $this->chatDeparmentModel->getChatDepartmentSelect($this->request->getGet("q"));
|
|
||||||
return $this->response->setJSON($query->get()->getResultObject());
|
|
||||||
}
|
|
||||||
public function get_chat_presupuesto(int $chat_department_id, int $presupuesto_id)
|
public function get_chat_presupuesto(int $chat_department_id, int $presupuesto_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -91,6 +86,7 @@ class ChatController extends BaseController
|
|||||||
$data["messages"] = $this->chatMessageModel->get_chat_messages($chat->id);
|
$data["messages"] = $this->chatMessageModel->get_chat_messages($chat->id);
|
||||||
$this->chatMessageModel->set_chat_department_messages_as_read($chat->id);
|
$this->chatMessageModel->set_chat_department_messages_as_read($chat->id);
|
||||||
$data["count"] = count($data["messages"]);
|
$data["count"] = count($data["messages"]);
|
||||||
|
|
||||||
}
|
}
|
||||||
$data["chat"] = $chat;
|
$data["chat"] = $chat;
|
||||||
return $this->response->setJSON($data);
|
return $this->response->setJSON($data);
|
||||||
@ -112,76 +108,6 @@ class ChatController extends BaseController
|
|||||||
$data["chat"] = $chat;
|
$data["chat"] = $chat;
|
||||||
return $this->response->setJSON($data);
|
return $this->response->setJSON($data);
|
||||||
}
|
}
|
||||||
public function get_chat_direct_view($chat_id)
|
|
||||||
{
|
|
||||||
$chat = $this->chatModel->find($chat_id);
|
|
||||||
$this->viewData['breadcrumb'] = [
|
|
||||||
['title' => lang("Chat.chat"), 'route' => route_to("mensajeriaView"), 'active' => false],
|
|
||||||
['title' => $chat->title, 'route' => 'javascript:void(0);', 'active' => true]
|
|
||||||
];
|
|
||||||
$this->viewData["chatId"] = $chat_id;
|
|
||||||
$auth_user = auth()->user();
|
|
||||||
$this->chatModel->setAsViewedChatUserNotifications($chat_id, $auth_user->id);
|
|
||||||
$this->chatModel->setAsUnviewedChatUserMessages($chat_id, $auth_user->id);
|
|
||||||
|
|
||||||
return view(static::$viewPath . 'messageChat', $this->viewData);
|
|
||||||
}
|
|
||||||
public function get_chat_presupuesto_view($chat_id)
|
|
||||||
{
|
|
||||||
$chat = $this->chatModel->find($chat_id);
|
|
||||||
$this->viewData['breadcrumb'] = [
|
|
||||||
['title' => lang("Chat.chat"), 'route' => route_to("mensajeriaView"), 'active' => false],
|
|
||||||
['title' => $chat->title, 'route' => 'javascript:void(0);', 'active' => true]
|
|
||||||
];
|
|
||||||
$this->viewData["modelId"] = $chat->presupuesto_id;
|
|
||||||
$this->viewData["type"] = "presupuesto";
|
|
||||||
$auth_user = auth()->user();
|
|
||||||
$this->chatModel->setAsViewedChatUserNotifications($chat_id, $auth_user->id);
|
|
||||||
$this->chatModel->setAsUnviewedChatUserMessages($chat_id, $auth_user->id);
|
|
||||||
|
|
||||||
if($chat->chat_department_id){
|
|
||||||
return view(static::$viewPath . 'messageChatPresupuesto', $this->viewData);
|
|
||||||
}else{
|
|
||||||
return view(static::$viewPath . 'messageChatInternal', $this->viewData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public function get_chat_pedido_view($chat_id)
|
|
||||||
{
|
|
||||||
$chat = $this->chatModel->find($chat_id);
|
|
||||||
$this->viewData['breadcrumb'] = [
|
|
||||||
['title' => lang("Chat.chat"), 'route' => route_to("mensajeriaView"), 'active' => false],
|
|
||||||
['title' => $chat->title, 'route' => 'javascript:void(0);', 'active' => true]
|
|
||||||
];
|
|
||||||
$this->viewData["modelId"] = $chat->pedido_id;
|
|
||||||
$this->viewData["type"] = "pedido";
|
|
||||||
$auth_user = auth()->user();
|
|
||||||
$this->chatModel->setAsViewedChatUserNotifications($chat_id, $auth_user->id);
|
|
||||||
$this->chatModel->setAsUnviewedChatUserMessages($chat_id, $auth_user->id);
|
|
||||||
if($chat->chat_department_id ){
|
|
||||||
return view(static::$viewPath . 'messageChatPedido', $this->viewData);
|
|
||||||
}else{
|
|
||||||
return view(static::$viewPath . 'messageChatInternal', $this->viewData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public function get_chat_factura_view($chat_id)
|
|
||||||
{
|
|
||||||
$chat = $this->chatModel->find($chat_id);
|
|
||||||
$this->viewData['breadcrumb'] = [
|
|
||||||
['title' => lang("Chat.chat"), 'route' => route_to("mensajeriaView"), 'active' => false],
|
|
||||||
['title' => $chat->title, 'route' => 'javascript:void(0);', 'active' => true]
|
|
||||||
];
|
|
||||||
$this->viewData["modelId"] = $chat->factura_id;
|
|
||||||
$this->viewData["type"] = "factura";
|
|
||||||
$auth_user = auth()->user();
|
|
||||||
$this->chatModel->setAsViewedChatUserNotifications($chat_id, $auth_user->id);
|
|
||||||
$this->chatModel->setAsUnviewedChatUserMessages($chat_id, $auth_user->id);
|
|
||||||
|
|
||||||
if($chat->chat_department_id){
|
|
||||||
return view(static::$viewPath . 'messageChatFactura', $this->viewData);
|
|
||||||
}else{
|
|
||||||
return view(static::$viewPath . 'messageChatInternal', $this->viewData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public function get_chat(int $chat_id)
|
public function get_chat(int $chat_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -202,12 +128,6 @@ class ChatController extends BaseController
|
|||||||
}
|
}
|
||||||
$chat_message_id = $this->chatMessageModel->insert(["chat_id" => $chatId, "sender_id" => auth()->user()->id, "message" => $data["message"]]);
|
$chat_message_id = $this->chatMessageModel->insert(["chat_id" => $chatId, "sender_id" => auth()->user()->id, "message" => $data["message"]]);
|
||||||
$dataResponse = $this->chatMessageModel->find($chat_message_id);
|
$dataResponse = $this->chatMessageModel->find($chat_message_id);
|
||||||
$chatDepartmentUsers = $this->chatDeparmentModel->getChatDepartmentUsers($data["chat_department_id"]);
|
|
||||||
foreach ($chatDepartmentUsers as $user) {
|
|
||||||
if ($user->id != auth()->user()->id) {
|
|
||||||
$this->chatNotificationModel->insert(["chat_message_id" => $chat_message_id, "user_id" => $user->id]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->response->setJSON($dataResponse);
|
return $this->response->setJSON($dataResponse);
|
||||||
}
|
}
|
||||||
public function store_chat_message_pedido()
|
public function store_chat_message_pedido()
|
||||||
@ -223,12 +143,6 @@ class ChatController extends BaseController
|
|||||||
}
|
}
|
||||||
$chat_message_id = $this->chatMessageModel->insert(["chat_id" => $chatId, "sender_id" => auth()->user()->id, "message" => $data["message"]]);
|
$chat_message_id = $this->chatMessageModel->insert(["chat_id" => $chatId, "sender_id" => auth()->user()->id, "message" => $data["message"]]);
|
||||||
$dataResponse = $this->chatMessageModel->find($chat_message_id);
|
$dataResponse = $this->chatMessageModel->find($chat_message_id);
|
||||||
$chatDepartmentUsers = $this->chatDeparmentModel->getChatDepartmentUsers($data["chat_department_id"]);
|
|
||||||
foreach ($chatDepartmentUsers as $user) {
|
|
||||||
if ($user->id != auth()->user()->id) {
|
|
||||||
$this->chatNotificationModel->insert(["chat_message_id" => $chat_message_id, "user_id" => $user->id]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->response->setJSON($dataResponse);
|
return $this->response->setJSON($dataResponse);
|
||||||
}
|
}
|
||||||
public function store_chat_message_factura()
|
public function store_chat_message_factura()
|
||||||
@ -244,12 +158,6 @@ class ChatController extends BaseController
|
|||||||
}
|
}
|
||||||
$chat_message_id = $this->chatMessageModel->insert(["chat_id" => $chatId, "sender_id" => auth()->user()->id, "message" => $data["message"]]);
|
$chat_message_id = $this->chatMessageModel->insert(["chat_id" => $chatId, "sender_id" => auth()->user()->id, "message" => $data["message"]]);
|
||||||
$dataResponse = $this->chatMessageModel->find($chat_message_id);
|
$dataResponse = $this->chatMessageModel->find($chat_message_id);
|
||||||
$chatDepartmentUsers = $this->chatDeparmentModel->getChatDepartmentUsers($data["chat_department_id"]);
|
|
||||||
foreach ($chatDepartmentUsers as $user) {
|
|
||||||
if ($user->id != auth()->user()->id) {
|
|
||||||
$this->chatNotificationModel->insert(["chat_message_id" => $chat_message_id, "user_id" => $user->id]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this->response->setJSON($dataResponse);
|
return $this->response->setJSON($dataResponse);
|
||||||
}
|
}
|
||||||
public function store_chat_message_single()
|
public function store_chat_message_single()
|
||||||
@ -270,7 +178,7 @@ class ChatController extends BaseController
|
|||||||
"receiver_id" => $data["receiver_id"],
|
"receiver_id" => $data["receiver_id"],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
$this->chatNotificationModel->insert(["chat_message_id" => $chat_message_id, "user_id" => $data["receiver_id"]]);
|
$this->chatNotificationModel->insert(["chat_message_id" => $chat_message_id,"user_id" =>$data["receiver_id"]]);
|
||||||
$dataResponse = $this->chatMessageModel->find($chat_message_id);
|
$dataResponse = $this->chatMessageModel->find($chat_message_id);
|
||||||
return $this->response->setJSON($dataResponse);
|
return $this->response->setJSON($dataResponse);
|
||||||
}
|
}
|
||||||
@ -279,11 +187,11 @@ class ChatController extends BaseController
|
|||||||
$auth_user = auth()->user();
|
$auth_user = auth()->user();
|
||||||
if ($auth_user->cliente_id) {
|
if ($auth_user->cliente_id) {
|
||||||
$users = $this->chatModel->getOpenChatCliente($auth_user->id);
|
$users = $this->chatModel->getOpenChatCliente($auth_user->id);
|
||||||
} else {
|
}else{
|
||||||
$users = $this->userModel->builder()
|
$users = $this->userModel->builder()
|
||||||
->whereNotIn("id", [$auth_user->id])
|
->whereNotIn("id", [$auth_user->id])
|
||||||
->where("deleted_at", null)
|
->where("deleted_at", null)
|
||||||
->get()->getResultObject();
|
->get()->getResultObject();
|
||||||
}
|
}
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
$user->unreadMessages = $this->chatMessageModel->get_chat_messages_count($user->id);
|
$user->unreadMessages = $this->chatMessageModel->get_chat_messages_count($user->id);
|
||||||
@ -367,26 +275,7 @@ class ChatController extends BaseController
|
|||||||
]
|
]
|
||||||
)->where("cliente_id", null)
|
)->where("cliente_id", null)
|
||||||
->where("deleted_at", null)
|
->where("deleted_at", null)
|
||||||
->whereNotIn("id", [auth()->user()->id]);
|
->whereNotIn("id",[auth()->user()->id]);
|
||||||
if ($this->request->getGet("q")) {
|
|
||||||
$query->groupStart()
|
|
||||||
->orLike("users.username", $this->request->getGet("q"))
|
|
||||||
->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q"))
|
|
||||||
->groupEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->response->setJSON($query->get()->getResultObject());
|
|
||||||
}
|
|
||||||
public function get_chat_users_all()
|
|
||||||
{
|
|
||||||
$query = $this->userModel->builder()->select(
|
|
||||||
[
|
|
||||||
"id",
|
|
||||||
"CONCAT(first_name,' ',last_name,'(',username,')') as name"
|
|
||||||
]
|
|
||||||
)
|
|
||||||
->where("deleted_at", null)
|
|
||||||
->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("users.username", $this->request->getGet("q"))
|
||||||
@ -398,7 +287,6 @@ class ChatController extends BaseController
|
|||||||
}
|
}
|
||||||
public function store_hebra_presupuesto()
|
public function store_hebra_presupuesto()
|
||||||
{
|
{
|
||||||
$auth_user = auth()->user();
|
|
||||||
$bodyData = $this->request->getPost();
|
$bodyData = $this->request->getPost();
|
||||||
$chat_id = $this->chatModel->insert([
|
$chat_id = $this->chatModel->insert([
|
||||||
"presupuesto_id" => $bodyData["modelId"],
|
"presupuesto_id" => $bodyData["modelId"],
|
||||||
@ -407,19 +295,17 @@ class ChatController extends BaseController
|
|||||||
$chatMessageId = $this->chatMessageModel->insert([
|
$chatMessageId = $this->chatMessageModel->insert([
|
||||||
"chat_id" => $chat_id,
|
"chat_id" => $chat_id,
|
||||||
"message" => $bodyData["message"],
|
"message" => $bodyData["message"],
|
||||||
"sender_id" => $auth_user->id
|
"sender_id" => auth()->user()->id
|
||||||
]);
|
]);
|
||||||
if (isset($bodyData["users"])) {
|
if(isset($bodyData["users"])){
|
||||||
$bodyData["users"][] = $auth_user->id;
|
$chatUserData = array_map(fn($x) => ["user_id" => $x,"chat_id" => $chat_id],$bodyData["users"]);
|
||||||
$chatUserData = array_map(fn($x) => ["user_id" => $x, "chat_id" => $chat_id], $bodyData["users"]);
|
|
||||||
$this->chatUserModel->insertBatch($chatUserData);
|
$this->chatUserModel->insertBatch($chatUserData);
|
||||||
foreach ($bodyData["users"] as $userId) {
|
foreach ($bodyData["users"] as $userId) {
|
||||||
$this->chatNotificationModel->insert(
|
$this->chatNotificationModel->insert(
|
||||||
["chat_message_id" => $chatMessageId, "user_id" => $userId]
|
["chat_message_id" => $chatMessageId,"user_id" => $userId]);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->response->setJSON(["message" => "Hebra creada correctamente", "status" => true]);
|
return $this->response->setJSON(["message" => "Hebra creada correctamente","status" => true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store_hebra_pedido()
|
public function store_hebra_pedido()
|
||||||
@ -435,16 +321,15 @@ class ChatController extends BaseController
|
|||||||
"message" => $bodyData["message"],
|
"message" => $bodyData["message"],
|
||||||
"sender_id" => auth()->user()->id
|
"sender_id" => auth()->user()->id
|
||||||
]);
|
]);
|
||||||
if (isset($bodyData["users"])) {
|
if(isset($bodyData["users"])){
|
||||||
$chatUserData = array_map(fn($x) => ["user_id" => $x, "chat_id" => $chat_id], $bodyData["users"]);
|
$chatUserData = array_map(fn($x) => ["user_id" => $x,"chat_id" => $chat_id],$bodyData["users"]);
|
||||||
$this->chatUserModel->insertBatch($chatUserData);
|
$this->chatUserModel->insertBatch($chatUserData);
|
||||||
foreach ($bodyData["users"] as $userId) {
|
foreach ($bodyData["users"] as $userId) {
|
||||||
$this->chatNotificationModel->insert(
|
$this->chatNotificationModel->insert(
|
||||||
["chat_message_id" => $chatMessageId, "user_id" => $userId]
|
["chat_message_id" => $chatMessageId,"user_id" => $userId]);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->response->setJSON(["message" => "Hebra creada correctamente", "status" => true]);
|
return $this->response->setJSON(["message" => "Hebra creada correctamente","status" => true]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store_hebra_factura()
|
public function store_hebra_factura()
|
||||||
@ -459,242 +344,89 @@ class ChatController extends BaseController
|
|||||||
"message" => $bodyData["message"],
|
"message" => $bodyData["message"],
|
||||||
"sender_id" => auth()->user()->id
|
"sender_id" => auth()->user()->id
|
||||||
]);
|
]);
|
||||||
if (isset($bodyData["users"])) {
|
if(isset($bodyData["users"])){
|
||||||
$chatUserData = array_map(fn($x) => ["user_id" => $x, "chat_id" => $chat_id], $bodyData["users"]);
|
$chatUserData = array_map(fn($x) => ["user_id" => $x,"chat_id" => $chat_id],$bodyData["users"]);
|
||||||
$this->chatUserModel->insertBatch($chatUserData);
|
$this->chatUserModel->insertBatch($chatUserData);
|
||||||
foreach ($bodyData["users"] as $userId) {
|
foreach ($bodyData["users"] as $userId) {
|
||||||
$this->chatNotificationModel->insert(
|
$this->chatNotificationModel->insert(
|
||||||
["chat_message_id" => $chatMessageId, "user_id" => $userId]
|
["chat_message_id" => $chatMessageId,"user_id" => $userId]);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->response->setJSON(["message" => "Hebra creada correctamente", "status" => true]);
|
return $this->response->setJSON(["message" => "Hebra creada correctamente","status" => true]);
|
||||||
|
|
||||||
}
|
}
|
||||||
public function update_hebra($chat_id)
|
public function update_hebra($chat_id)
|
||||||
{
|
{
|
||||||
$bodyData = $this->request->getPost();
|
$bodyData = $this->request->getPost();
|
||||||
$chatMessageId = $this->chatMessageModel->insert([
|
$chatMessageId = $this->chatMessageModel->insert([
|
||||||
"chat_id" => $chat_id,
|
"chat_id" => $chat_id,
|
||||||
"message" => $bodyData["message"],
|
"message" => $bodyData["message"],
|
||||||
"sender_id" => auth()->user()->id
|
"sender_id" => auth()->user()->id
|
||||||
]);
|
]);
|
||||||
$actualUsers = $this->chatUserModel->builder()->select("user_id")->where("chat_id", $chat_id)->get()->getResultArray();
|
$actualUsers = $this->chatUserModel->builder()->select("user_id")->where("chat_id",$chat_id)->get()->getResultArray();
|
||||||
$actualUsersArray = array_map(fn($x) => $x["user_id"], $actualUsers);
|
$actualUsersArray = array_map(fn($x) => $x["user_id"],$actualUsers);
|
||||||
foreach ($actualUsersArray as $key => $user_id) {
|
foreach ($actualUsersArray as $key => $user_id) {
|
||||||
$this->chatNotificationModel->insert(
|
$this->chatNotificationModel->insert(
|
||||||
["chat_message_id" => $chatMessageId, "user_id" => $user_id]
|
["chat_message_id" => $chatMessageId,"user_id" => $user_id]);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (isset($bodyData["users"])) {
|
if(isset($bodyData["users"])){
|
||||||
foreach ($bodyData["users"] as $userId) {
|
foreach ($bodyData["users"] as $userId) {
|
||||||
if (in_array($userId, $actualUsersArray) == false) {
|
if(in_array($userId,$actualUsersArray) == false){
|
||||||
$chatUserData = ["user_id" => $userId, "chat_id" => $chat_id];
|
$chatUserData = ["user_id" => $userId,"chat_id" => $chat_id];
|
||||||
$this->chatUserModel->insert($chatUserData);
|
$this->chatUserModel->insert($chatUserData);
|
||||||
|
|
||||||
}
|
}
|
||||||
$this->chatNotificationModel->insert(
|
$this->chatNotificationModel->insert(
|
||||||
["chat_message_id" => $chatMessageId, "user_id" => $userId]
|
["chat_message_id" => $chatMessageId,"user_id" => $userId]);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->response->setJSON(["message" => "Hebra actualizada correctamente", "status" => true]);
|
return $this->response->setJSON(["message" => "Hebra actualizada correctamente","status" => true]);
|
||||||
}
|
}
|
||||||
public function get_hebra_presupuesto($presupuesto_id)
|
public function get_hebra_presupuesto($presupuesto_id){
|
||||||
{
|
|
||||||
$data = $this->chatModel->getPresupuestoHebras($presupuesto_id);
|
$data = $this->chatModel->getPresupuestoHebras($presupuesto_id);
|
||||||
$notifications = $this->chatModel->builder()->select([
|
$notifications = $this->chatModel->builder()->select([
|
||||||
"chat_notifications.id"
|
"chat_notifications.id"
|
||||||
])
|
])
|
||||||
->join("chat_messages", "chat_messages.chat_id = chats.id", "left")
|
->join("chat_messages","chat_messages.chat_id = chats.id","left")
|
||||||
->join("chat_notifications", "chat_notifications.chat_message_id = chat_messages.id", "left")
|
->join("chat_notifications","chat_notifications.chat_message_id = chat_messages.id","left")
|
||||||
->where("chats.presupuesto_id", $presupuesto_id)
|
->where("chats.presupuesto_id",$presupuesto_id)
|
||||||
->where("chat_notifications.user_id", auth()->user()->id)
|
->where("chat_notifications.user_id",auth()->user()->id)
|
||||||
->get()->getResultArray();
|
->get()->getResultArray();
|
||||||
foreach ($notifications as $notification) {
|
foreach ($notifications as $notification) {
|
||||||
$this->chatNotificationModel->update($notification["id"], ["viewed" => true]);
|
$this->chatNotificationModel->update($notification["id"],["viewed" => true]);
|
||||||
}
|
}
|
||||||
return $this->response->setJSON($data);
|
return $this->response->setJSON($data);
|
||||||
}
|
}
|
||||||
public function get_hebra_pedido($pedido_id)
|
public function get_hebra_pedido($pedido_id){
|
||||||
{
|
|
||||||
$data = $this->chatModel->getPedidoHebras($pedido_id);
|
$data = $this->chatModel->getPedidoHebras($pedido_id);
|
||||||
$notifications = $this->chatModel->builder()->select([
|
$notifications = $this->chatModel->builder()->select([
|
||||||
"chat_notifications.id"
|
"chat_notifications.id"
|
||||||
])
|
])
|
||||||
->join("chat_messages", "chat_messages.chat_id = chats.id", "left")
|
->join("chat_messages","chat_messages.chat_id = chats.id","left")
|
||||||
->join("chat_notifications", "chat_notifications.chat_message_id = chat_messages.id", "left")
|
->join("chat_notifications","chat_notifications.chat_message_id = chat_messages.id","left")
|
||||||
->where("chats.pedido_id", $pedido_id)
|
->where("chats.pedido_id",$pedido_id)
|
||||||
->where("chat_notifications.user_id", auth()->user()->id)
|
->where("chat_notifications.user_id",auth()->user()->id)
|
||||||
->get()->getResultArray();
|
->get()->getResultArray();
|
||||||
foreach ($notifications as $notification) {
|
foreach ($notifications as $notification) {
|
||||||
$this->chatNotificationModel->update($notification["id"], ["viewed" => true]);
|
$this->chatNotificationModel->update($notification["id"],["viewed" => true]);
|
||||||
}
|
}
|
||||||
return $this->response->setJSON($data);
|
return $this->response->setJSON($data);
|
||||||
}
|
}
|
||||||
public function get_hebra_factura($factura_id)
|
public function get_hebra_factura($factura_id){
|
||||||
{
|
|
||||||
$data = $this->chatModel->getFacturaHebras($factura_id);
|
$data = $this->chatModel->getFacturaHebras($factura_id);
|
||||||
$notifications = $this->chatModel->builder()->select([
|
$notifications = $this->chatModel->builder()->select([
|
||||||
"chat_notifications.id"
|
"chat_notifications.id"
|
||||||
])
|
])
|
||||||
->join("chat_messages", "chat_messages.chat_id = chats.id", "left")
|
->join("chat_messages","chat_messages.chat_id = chats.id","left")
|
||||||
->join("chat_notifications", "chat_notifications.chat_message_id = chat_messages.id", "left")
|
->join("chat_notifications","chat_notifications.chat_message_id = chat_messages.id","left")
|
||||||
->where("chats.factura_id", $factura_id)
|
->where("chats.factura_id",$factura_id)
|
||||||
->where("chat_notifications.user_id", auth()->user()->id)
|
->where("chat_notifications.user_id",auth()->user()->id)
|
||||||
->get()->getResultArray();
|
->get()->getResultArray();
|
||||||
foreach ($notifications as $notification) {
|
foreach ($notifications as $notification) {
|
||||||
$this->chatNotificationModel->update($notification["id"], ["viewed" => true]);
|
$this->chatNotificationModel->update($notification["id"],["viewed" => true]);
|
||||||
}
|
}
|
||||||
return $this->response->setJSON($data);
|
return $this->response->setJSON($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function datatable_messages()
|
|
||||||
{
|
|
||||||
$auth_user_id = auth()->user()->id;
|
|
||||||
$query = $this->chatModel->getQueryDatatable($auth_user_id);
|
|
||||||
return DataTable::of($query)
|
|
||||||
->edit('created_at', fn($q) => Time::createFromFormat('Y-m-d H:i:s', $q->created_at)->format("d/m/Y H:i"))
|
|
||||||
->edit('updated_at', fn($q) => Time::createFromFormat('Y-m-d H:i:s', $q->updated_at)->format("d/m/Y H:i"))
|
|
||||||
->add("creator", fn($q) => $this->chatModel->getChatFirstUser($q->id)->userFullName)
|
|
||||||
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->id, $auth_user_id))
|
|
||||||
->add("action", fn($q) => ["type" => "direct","modelId" => $q->id])
|
|
||||||
->toJson(true);
|
|
||||||
}
|
|
||||||
public function datatable_presupuesto_messages()
|
|
||||||
{
|
|
||||||
$auth_user_id = auth()->user()->id;
|
|
||||||
$query = $this->chatModel->getQueryDatatableMessagePresupuesto($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") : "")
|
|
||||||
->add("creator", fn($q) => $this->chatModel->getChatFirstUser($q->id)->userFullName)
|
|
||||||
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->id, $auth_user_id))
|
|
||||||
->add("action", fn($q) => ["type" => "presupuesto","modelId" => $q->id])
|
|
||||||
->toJson(true);
|
|
||||||
}
|
|
||||||
public function datatable_pedido_messages()
|
|
||||||
{
|
|
||||||
$auth_user_id = auth()->user()->id;
|
|
||||||
$query = $this->chatModel->getQueryDatatableMessagePedido($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") : "")
|
|
||||||
->add("creator", fn($q) => $this->chatModel->getChatFirstUser($q->id)->userFullName)
|
|
||||||
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->id, $auth_user_id))
|
|
||||||
->add("action", fn($q) => ["type" => "pedido","modelId" => $q->id])
|
|
||||||
|
|
||||||
->toJson(true);
|
|
||||||
}
|
|
||||||
public function datatable_factura_messages()
|
|
||||||
{
|
|
||||||
$auth_user_id = auth()->user()->id;
|
|
||||||
$query = $this->chatModel->getQueryDatatableMessageFactura($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") : "")
|
|
||||||
->add("creator", fn($q) => $this->chatModel->getChatFirstUser($q->id)->userFullName)
|
|
||||||
->add("viewed", fn($q) => $this->chatModel->isMessageChatViewed($q->id, $auth_user_id))
|
|
||||||
->add("action", fn($q) => ["type" => "factura","modelId" => $q->id])
|
|
||||||
|
|
||||||
->toJson(true);
|
|
||||||
}
|
|
||||||
public function store_new_direct_message()
|
|
||||||
{
|
|
||||||
$bodyData = $this->request->getPost();
|
|
||||||
$rules = [
|
|
||||||
"title" => "required|string",
|
|
||||||
"message" => "required|string",
|
|
||||||
"users" => "required",
|
|
||||||
|
|
||||||
];
|
|
||||||
if (!$this->validate($rules)) {
|
|
||||||
return $this->response->setStatusCode(400)->setJSON([
|
|
||||||
'message' => lang('App.global_alert_save_error'),
|
|
||||||
'status' => 'error',
|
|
||||||
'errors' => $this->validator->getErrors(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
$this->chatModel->createNewDirectChat(...$bodyData);
|
|
||||||
return $this->response->setJSON(["message" => lang("Chat.new_message_ok"), "status" => true]);
|
|
||||||
}
|
|
||||||
public function store_new_direct_message_client()
|
|
||||||
{
|
|
||||||
$bodyData = $this->request->getPost();
|
|
||||||
$rules = [
|
|
||||||
"title" => "required|string",
|
|
||||||
"message" => "required|string",
|
|
||||||
"chat_department_id" => "required",
|
|
||||||
|
|
||||||
];
|
|
||||||
if (!$this->validate($rules)) {
|
|
||||||
return $this->response->setStatusCode(400)->setJSON([
|
|
||||||
'message' => lang('App.global_alert_save_error'),
|
|
||||||
'status' => 'error',
|
|
||||||
'errors' => $this->validator->getErrors(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
$users = $this->chatDeparmentModel->getChatDepartmentUsers($bodyData["chat_department_id"]);
|
|
||||||
$bodyData["users"] = array_map(fn($q) => $q->id,$users);
|
|
||||||
dd(1);
|
|
||||||
$this->chatModel->createNewDirectChat(...$bodyData);
|
|
||||||
return $this->response->setJSON(["message" => lang("Chat.new_message_ok"), "status" => true]);
|
|
||||||
}
|
|
||||||
public function get_chat_direct($chat_id)
|
|
||||||
{
|
|
||||||
$chatData = $this->chatModel->getChatDirect($chat_id);
|
|
||||||
return $this->response->setJSON($chatData);
|
|
||||||
}
|
|
||||||
public function get_chat_direct_select_users($chat_id)
|
|
||||||
{
|
|
||||||
$chat_users_id = $this->chatUserModel->getChatUserArrayId($chat_id);
|
|
||||||
|
|
||||||
$query = $this->userModel->builder()->select(
|
|
||||||
[
|
|
||||||
"id",
|
|
||||||
"CONCAT(first_name,' ',last_name,'(',username,')') as name"
|
|
||||||
]
|
|
||||||
)
|
|
||||||
->where("deleted_at", null)
|
|
||||||
->whereNotIn("id", $chat_users_id);
|
|
||||||
if ($this->request->getGet("q")) {
|
|
||||||
$query->groupStart()
|
|
||||||
->orLike("users.username", $this->request->getGet("q"))
|
|
||||||
->orLike("CONCAT(first_name,' ',last_name)", $this->request->getGet("q"))
|
|
||||||
->groupEnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->response->setJSON($query->get()->getResultObject());
|
|
||||||
}
|
|
||||||
public function store_chat_direct_users($chat_id)
|
|
||||||
{
|
|
||||||
$bodyData = $this->request->getPost();
|
|
||||||
$chat_users = [];
|
|
||||||
foreach ($bodyData["users"] as $user_id) {
|
|
||||||
$chat_users[] = ["chat_id" => $chat_id, "user_id" => $user_id];
|
|
||||||
if ($bodyData["notification"]) {
|
|
||||||
$this->chatModel->createNotificationsToNewChatUser($chat_id, $user_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->chatUserModel->insertBatch($chat_users);
|
|
||||||
return $this->response->setJSON(["message" => "ok", "status" => true]);
|
|
||||||
}
|
|
||||||
public function store_chat_direct_message(int $chat_id)
|
|
||||||
{
|
|
||||||
$bodyData = $this->request->getPost();
|
|
||||||
$auth_user = auth()->user();
|
|
||||||
$bodyData["sender_id"] = $auth_user->id;
|
|
||||||
$chat_message_id = $this->chatMessageModel->insert($bodyData);
|
|
||||||
$users_id = $this->chatUserModel->getChatUserArrayId($chat_id);
|
|
||||||
foreach ($users_id as $user_id) {
|
|
||||||
if ($user_id != $auth_user->id) {
|
|
||||||
$this->chatNotificationModel->insert(["chat_message_id" => $chat_message_id, "user_id" => $user_id]);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
$message = $this->chatMessageModel->get_chat_message($chat_message_id);
|
|
||||||
return $this->response->setJSON($message);
|
|
||||||
}
|
|
||||||
public function update_chat_direct_message_unread($chat_id)
|
|
||||||
{
|
|
||||||
$this->chatModel->setAsUnviewedChatUserNotifications($chat_id, auth()->user()->id);
|
|
||||||
return $this->response->setJSON(["message" => "ok", "status" => true]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php namespace App\Controllers\Clientes;
|
||||||
namespace App\Controllers\Clientes;
|
|
||||||
|
|
||||||
|
|
||||||
use App\Controllers\BaseResourceController;
|
use App\Controllers\BaseResourceController;
|
||||||
@ -46,36 +45,40 @@ class ClientePrecios extends \App\Controllers\BaseResourceController
|
|||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updatePlantilla()
|
public function update($requestedId = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->getPost()) :
|
||||||
|
|
||||||
|
if ($requestedId == null) :
|
||||||
|
return;
|
||||||
|
endif;
|
||||||
|
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getJSON();
|
||||||
|
|
||||||
$cliente_id = $postData['cliente_id'] ?? -1;
|
|
||||||
$plantilla_id = $postData['plantilla_id'] ?? -1;
|
|
||||||
|
|
||||||
|
$plantilla_id = $postData->plantilla_id ?? -1;
|
||||||
|
|
||||||
// Se ha actualizado un registro por lo que no es una plantilla
|
// Se ha actualizado un registro por lo que no es una plantilla
|
||||||
if ($plantilla_id == -1) {
|
if($plantilla_id == -1){
|
||||||
$this->model->clean_plantilla_id($cliente_id);
|
$this->model->clean_plantilla_id($requestedId);
|
||||||
} else if ($cliente_id == -1) { // actualizar todos los clientes que usan una plantilla
|
|
||||||
$this->model->update_from_plantilla($plantilla_id);
|
|
||||||
} else {
|
|
||||||
$this->model->copy_from_plantilla($cliente_id, $plantilla_id);
|
|
||||||
}
|
}
|
||||||
|
else if($requestedId== -1){ // actualizar todos los clientes que usan una plantilla
|
||||||
|
$this->model->update_from_plantilla($plantilla_id);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$this->model->copy_from_plantilla($requestedId, $plantilla_id);
|
||||||
|
}
|
||||||
|
|
||||||
$newTokenHash = csrf_hash();
|
$newTokenHash = csrf_hash();
|
||||||
$csrfTokenName = csrf_token();
|
$csrfTokenName = csrf_token();
|
||||||
$data = [
|
$data = [
|
||||||
$csrfTokenName => $newTokenHash
|
$csrfTokenName => $newTokenHash
|
||||||
];
|
];
|
||||||
|
|
||||||
return $this->respond($data);
|
return $this->respond($data);
|
||||||
|
|
||||||
} else {
|
endif; // ($requestMethod === 'post')
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -90,114 +93,92 @@ class ClientePrecios extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
$start = $reqData['start'] ?? 0;
|
$start = $reqData['start'] ?? 0;
|
||||||
$length = $reqData['length'] ?? 5;
|
$length = $reqData['length'] ?? 5;
|
||||||
|
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
|
||||||
$requestedOrder = $reqData['order'] ?? [];
|
$requestedOrder2 = $reqData['order']['1']['column'] ?? $requestedOrder;
|
||||||
|
$requestedOrder3 = $reqData['order']['2']['column'] ?? $requestedOrder;
|
||||||
$searchValues = get_filter_datatables_columns($reqData);
|
$requestedOrder4 = $reqData['order']['3']['column'] ?? $requestedOrder;
|
||||||
|
$requestedOrder5 = $reqData['order']['4']['column'] ?? $requestedOrder;
|
||||||
|
$order = ClientePreciosModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 0];
|
||||||
|
$order2 = ClientePreciosModel::SORTABLE[$requestedOrder2 >= 0 ? $requestedOrder2 : $requestedOrder];
|
||||||
|
$order3 = ClientePreciosModel::SORTABLE[$requestedOrder3 >= 0 ? $requestedOrder3 : $requestedOrder];
|
||||||
|
$order4 = ClientePreciosModel::SORTABLE[$requestedOrder4 >= 0 ? $requestedOrder4 : $requestedOrder];
|
||||||
|
$order5 = ClientePreciosModel::SORTABLE[$requestedOrder4 >= 0 ? $requestedOrder5 : $requestedOrder];
|
||||||
|
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||||
|
$dir2 = $reqData['order']['1']['dir'] ?? $dir;
|
||||||
|
$dir3 = $reqData['order']['2']['dir'] ?? $dir;
|
||||||
|
$dir4= $reqData['order']['3']['dir'] ?? $dir;
|
||||||
|
$dir5= $reqData['order']['4']['dir'] ?? $dir;
|
||||||
|
|
||||||
$cliente_id = $reqData['cliente_id'] ?? 0;
|
$cliente_id = $reqData['cliente_id'] ?? 0;
|
||||||
|
|
||||||
$resourceData = $this->model->getResource($searchValues, $cliente_id);
|
$resourceData = $this->model->getResource($cliente_id)
|
||||||
foreach ($requestedOrder as $order) {
|
->orderBy($order, $dir)->orderBy($order2, $dir2)->orderBy($order3, $dir3)->orderBy($order4, $dir4)->orderBy($order5, $dir5)
|
||||||
$column = $order['column'] ?? 0;
|
->limit($length, $start)->get()->getResultObject();
|
||||||
$dir = $order['dir'] ?? 'asc';
|
|
||||||
$orderColumn = ClientePreciosModel::SORTABLE[$column] ?? null;
|
|
||||||
if ($orderColumn) {
|
|
||||||
$resourceData->orderBy($orderColumn, $dir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$resourceData = $resourceData->limit($length, $start)->get()->getResultObject();
|
|
||||||
|
|
||||||
return $this->respond(Collection::datatable(
|
return $this->respond(Collection::datatable(
|
||||||
$resourceData,
|
$resourceData,
|
||||||
$this->model->getResource($searchValues, $cliente_id)->countAllResults(),
|
$this->model->getResource($cliente_id)->countAllResults(),
|
||||||
$this->model->getResource($searchValues, $cliente_id)->countAllResults()
|
$this->model->getResource($cliente_id)->countAllResults()
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function datatable_editor()
|
public function datatable_editor() {
|
||||||
{
|
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|
||||||
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
include(APPPATH . "ThirdParty/DatatablesEditor/DataTables.php");
|
||||||
|
|
||||||
|
|
||||||
// Build our Editor instance and process the data coming from _POST
|
// Build our Editor instance and process the data coming from _POST
|
||||||
$response = Editor::inst($db, 'cliente_precios')
|
$response = Editor::inst( $db, 'cliente_precios' )
|
||||||
->fields(
|
->fields(
|
||||||
Field::inst('plantilla_id'),
|
Field::inst( 'plantilla_id' ),
|
||||||
Field::inst('cliente_id'),
|
Field::inst( 'cliente_id' ),
|
||||||
Field::inst('tipo'),
|
Field::inst( 'tipo' ),
|
||||||
Field::inst('tipo_maquina'),
|
Field::inst( 'tipo_maquina' ),
|
||||||
Field::inst('tipo_impresion'),
|
Field::inst( 'tipo_impresion' ),
|
||||||
Field::inst('user_updated_id'),
|
Field::inst( 'user_updated_id' ),
|
||||||
Field::inst('updated_at'),
|
Field::inst( 'updated_at' ),
|
||||||
Field::inst('is_deleted'),
|
Field::inst( 'is_deleted' ),
|
||||||
Field::inst('tiempo_min')
|
Field::inst( 'tiempo_min' )
|
||||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||||
->validator(
|
->validator( 'Validate::notEmpty',array(
|
||||||
'Validate::notEmpty',
|
'message' => lang('ClientePrecios.validation.required'))
|
||||||
array(
|
|
||||||
'message' => lang('ClientePrecios.validation.required')
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
->validator(
|
->validator('Validate::numeric', array(
|
||||||
'Validate::numeric',
|
|
||||||
array(
|
|
||||||
"decimal" => ',',
|
"decimal" => ',',
|
||||||
'message' => lang('ClientePrecios.validation.decimal')
|
'message' => lang('ClientePrecios.validation.decimal'))
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
|
||||||
Field::inst('tiempo_max')
|
Field::inst( 'tiempo_max' )
|
||||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||||
->validator(
|
->validator( 'Validate::notEmpty',array(
|
||||||
'Validate::notEmpty',
|
'message' => lang('ClientePrecios.validation.required'))
|
||||||
array(
|
|
||||||
'message' => lang('ClientePrecios.validation.required')
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
->validator(
|
->validator('Validate::numeric', array(
|
||||||
'Validate::numeric',
|
"decimal" => ',',
|
||||||
array(
|
'message' => lang('ClientePrecios.validation.decimal'))
|
||||||
"decimal" => ',',
|
|
||||||
'message' => lang('ClientePrecios.validation.decimal')
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
|
||||||
Field::inst('precio_hora')
|
Field::inst( 'precio_hora' )
|
||||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||||
->validator(
|
->validator( 'Validate::notEmpty',array(
|
||||||
'Validate::notEmpty',
|
'message' => lang('ClientePrecios.validation.required'))
|
||||||
array(
|
|
||||||
'message' => lang('ClientePrecios.validation.required')
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
->validator(
|
->validator('Validate::numeric', array(
|
||||||
'Validate::numeric',
|
"decimal" => ',',
|
||||||
array(
|
'message' => lang('ClientePrecios.validation.decimal'))
|
||||||
"decimal" => ',',
|
|
||||||
'message' => lang('ClientePrecios.validation.decimal')
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
|
||||||
Field::inst('margen')
|
Field::inst( 'margen' )
|
||||||
->getFormatter('Format::toDecimalChar')->setFormatter('Format::fromDecimalChar')
|
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||||
->validator(
|
->validator( 'Validate::notEmpty',array(
|
||||||
'Validate::notEmpty',
|
'message' => lang('ClientePrecios.validation.required'))
|
||||||
array(
|
|
||||||
'message' => lang('ClientePrecios.validation.required')
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
->validator(
|
->validator('Validate::numeric', array(
|
||||||
'Validate::numeric',
|
|
||||||
array(
|
|
||||||
"decimal" => ',',
|
"decimal" => ',',
|
||||||
'message' => lang('ClientePrecios.validation.decimal')
|
'message' => lang('ClientePrecios.validation.decimal'))
|
||||||
)
|
|
||||||
),
|
),
|
||||||
|
|
||||||
)
|
)
|
||||||
@ -222,19 +203,21 @@ class ClientePrecios extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
->on('preCreate', function ($editor, &$values) {
|
->on('preCreate', function ($editor, &$values) {
|
||||||
|
$session = session();
|
||||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||||
$editor
|
$editor
|
||||||
->field('user_updated_id')
|
->field('user_updated_id')
|
||||||
->setValue(auth()->user()->id);
|
->setValue($session->id_user);
|
||||||
$editor
|
$editor
|
||||||
->field('updated_at')
|
->field('updated_at')
|
||||||
->setValue($datetime->format('Y-m-d H:i:s'));
|
->setValue($datetime->format('Y-m-d H:i:s'));
|
||||||
})
|
})
|
||||||
->on('preEdit', function ($editor, &$values) {
|
->on('preEdit', function ($editor, &$values) {
|
||||||
|
$session = session();
|
||||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||||
$editor
|
$editor
|
||||||
->field('user_updated_id')
|
->field('user_updated_id')
|
||||||
->setValue(auth()->user()->id);
|
->setValue($session->id_user);
|
||||||
$editor
|
$editor
|
||||||
->field('updated_at')
|
->field('updated_at')
|
||||||
->setValue($datetime->format('Y-m-d H:i:s'));
|
->setValue($datetime->format('Y-m-d H:i:s'));
|
||||||
@ -255,16 +238,4 @@ class ClientePrecios extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCurrentPlantilla()
|
|
||||||
{
|
|
||||||
|
|
||||||
if ($this->request->isAJAX()) {
|
|
||||||
$cliente_id = $this->request->getGet('cliente_id');
|
|
||||||
$plantilla = $this->model->getPlantilla($cliente_id);
|
|
||||||
return $this->respond($plantilla);
|
|
||||||
} else {
|
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php namespace App\Controllers\Clientes;
|
||||||
namespace App\Controllers\Clientes;
|
|
||||||
|
|
||||||
|
|
||||||
use App\Controllers\BaseResourceController;
|
use App\Controllers\BaseResourceController;
|
||||||
@ -71,48 +70,51 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
|||||||
// plantilla desde la lista
|
// plantilla desde la lista
|
||||||
public function update($requestedId = null)
|
public function update($requestedId = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if ($requestedId == null):
|
if ($this->request->getPost()) :
|
||||||
return;
|
|
||||||
endif;
|
if ($requestedId == null) :
|
||||||
$model = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
|
return;
|
||||||
$model->delete_values($requestedId);
|
endif;
|
||||||
|
$model = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
|
||||||
$newTokenHash = csrf_hash();
|
$model->delete_values($requestedId);
|
||||||
$csrfTokenName = csrf_token();
|
|
||||||
$data = [
|
$newTokenHash = csrf_hash();
|
||||||
$csrfTokenName => $newTokenHash
|
$csrfTokenName = csrf_token();
|
||||||
];
|
$data = [
|
||||||
|
$csrfTokenName => $newTokenHash
|
||||||
return $this->respond($data);
|
];
|
||||||
|
|
||||||
|
return $this->respond($data);
|
||||||
|
|
||||||
|
endif; // ($requestMethod === 'post')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($this->request->getPost()) :
|
||||||
if ($this->request->getPost()):
|
|
||||||
|
|
||||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||||
|
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
$cliente_id = $postData['cliente_id'] ?? -1;
|
$cliente_id = $postData['cliente_id'] ?? -1;
|
||||||
$from_client_data = $postData['from_client_data'] ?? 0;
|
|
||||||
|
|
||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
$sanitizedData['user_created_id'] = auth()->user()->id;
|
$sanitizedData['user_created_id'] = auth()->user()->id;
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
|
|
||||||
|
|
||||||
if ($this->canValidate()):
|
if ($this->canValidate()) :
|
||||||
try {
|
try {
|
||||||
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->save($sanitizedData);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -124,27 +126,24 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
|||||||
$this->session->setFlashdata('formErrors', $this->model->errors());
|
$this->session->setFlashdata('formErrors', $this->model->errors());
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
if ($from_client_data == 1) {
|
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
||||||
$thenRedirect = false;
|
|
||||||
} else {
|
|
||||||
$thenRedirect = true; // Change this to false if you want your user to stay on the form after submission
|
|
||||||
}
|
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult):
|
if ($noException && $successfulResult) :
|
||||||
|
|
||||||
$id = $this->model->db->insertID();
|
$id = $this->model->db->insertID();
|
||||||
|
|
||||||
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
|
|
||||||
if ($cliente_id != -1) {
|
if($cliente_id != -1){
|
||||||
$modelLineas = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
|
$modelLineas = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
|
||||||
$modelLineas->copy_from_cliente($cliente_id, $id);
|
$modelLineas->copy_from_cliente($cliente_id, $id);
|
||||||
$modelClientePrecios = model('App\Models\Clientes\ClientePreciosModel');
|
$modelClientePrecios = model('App\Models\Clientes\ClientePreciosModel');
|
||||||
$modelClientePrecios->set_plantilla_id($cliente_id, $id);
|
$modelClientePrecios->set_plantilla_id($cliente_id, $id);
|
||||||
return $this->respond(['status' => 'success', 'id' => $id]);
|
return ;
|
||||||
} else {
|
}
|
||||||
if ($thenRedirect):
|
else{
|
||||||
if (!empty($this->indexRoute)):
|
if ($thenRedirect) :
|
||||||
|
if (!empty($this->indexRoute)) :
|
||||||
//return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
//return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||||
return redirect()->to(site_url('/clientes/clienteplantillaprecios/edit/' . $id))->with('message', $message);
|
return redirect()->to(site_url('/clientes/clienteplantillaprecios/edit/' . $id))->with('message', $message);
|
||||||
else:
|
else:
|
||||||
@ -172,35 +171,35 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if ($requestedId == null):
|
if ($requestedId == null) :
|
||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
endif;
|
endif;
|
||||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||||
$clientePlantillaPreciosEntity = $this->model->find($id);
|
$clientePlantillaPreciosEntity = $this->model->find($id);
|
||||||
|
|
||||||
if ($clientePlantillaPreciosEntity == false):
|
if ($clientePlantillaPreciosEntity == false) :
|
||||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Clientes.cliente')), $id]);
|
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Clientes.cliente')), $id]);
|
||||||
return $this->redirect2listView('sweet-error', $message);
|
return $this->redirect2listView('sweet-error', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ($this->request->getPost()) :
|
||||||
if ($this->request->getPost()):
|
|
||||||
|
|
||||||
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||||
|
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
$sanitizedData['user_updated_id'] = auth()->user()->id;
|
$sanitizedData['user_updated_id'] = auth()->user()->id;
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()): // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
|
|
||||||
|
|
||||||
if ($this->canValidate()):
|
if ($this->canValidate()) :
|
||||||
try {
|
try {
|
||||||
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
$successfulResult = $this->model->skipValidation(true)->update($id, $sanitizedData);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -217,12 +216,12 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
$thenRedirect = false;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult):
|
if ($noException && $successfulResult) :
|
||||||
$id = $clientePlantillaPreciosEntity->id ?? $id;
|
$id = $clientePlantillaPreciosEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
|
|
||||||
if ($thenRedirect):
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)):
|
if (!empty($this->indexRoute)) :
|
||||||
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
return redirect()->to(route_to($this->indexRoute))->with('sweet-success', $message);
|
||||||
else:
|
else:
|
||||||
return $this->redirect2listView('sweet-success', $message);
|
return $this->redirect2listView('sweet-success', $message);
|
||||||
@ -237,7 +236,7 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
|||||||
//var_dump($clientePlantillaPreciosEntity); dd();
|
//var_dump($clientePlantillaPreciosEntity); dd();
|
||||||
|
|
||||||
$this->viewData['clienteplantillapreciosEntity'] = $clientePlantillaPreciosEntity;
|
$this->viewData['clienteplantillapreciosEntity'] = $clientePlantillaPreciosEntity;
|
||||||
|
|
||||||
$this->viewData['formAction'] = route_to('updateClienteplantillaprecios', $id);
|
$this->viewData['formAction'] = route_to('updateClienteplantillaprecios', $id);
|
||||||
|
|
||||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Clientes.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Clientes.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
||||||
@ -247,23 +246,6 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
|||||||
} // end function edit(...)
|
} // end function edit(...)
|
||||||
|
|
||||||
|
|
||||||
public function updatePlantillaEnCliente(){
|
|
||||||
|
|
||||||
if ($this->request->isAJAX()) {
|
|
||||||
|
|
||||||
$reqData = $this->request->getPost();
|
|
||||||
$plantilla_id = $reqData['plantilla_id'] ?? -1;
|
|
||||||
|
|
||||||
$model = model('App\Models\Clientes\ClientePreciosModel');
|
|
||||||
$model->update_plantilla_id($plantilla_id);
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function datatable()
|
public function datatable()
|
||||||
{
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
@ -275,16 +257,16 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
$start = $reqData['start'] ?? 0;
|
$start = $reqData['start'] ?? 0;
|
||||||
$length = $reqData['length'] ?? 5;
|
$length = $reqData['length'] ?? 5;
|
||||||
$searchValues = get_filter_datatables_columns($reqData);
|
$search = $reqData['search']['value'];
|
||||||
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
|
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
|
||||||
$order = ClientePlantillaPreciosModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 0];
|
$order = ClientePlantillaPreciosModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 0];
|
||||||
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||||
|
|
||||||
$resourceData = $this->model->getResource($searchValues)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||||
return $this->respond(Collection::datatable(
|
return $this->respond(Collection::datatable(
|
||||||
$resourceData,
|
$resourceData,
|
||||||
$this->model->getResource()->countAllResults(),
|
$this->model->getResource()->countAllResults(),
|
||||||
$this->model->getResource($searchValues)->countAllResults()
|
$this->model->getResource($search)->countAllResults()
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
@ -293,32 +275,34 @@ class Clienteplantillaprecios extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
public function menuItems()
|
public function menuItems()
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
$query = $this->model->builder()->select(
|
$searchStr = goSanitize($this->request->getPost('searchTerm'))[0];
|
||||||
[
|
$reqId = goSanitize($this->request->getPost('id'))[0];
|
||||||
"id",
|
$reqText = goSanitize($this->request->getPost('text'))[0];
|
||||||
"nombre as name"
|
$onlyActiveOnes = false;
|
||||||
]
|
$columns2select = [$reqId ?? 'id', $reqText ?? 'nombre'];
|
||||||
)->where("deleted_at", null);
|
$onlyActiveOnes = false;
|
||||||
if ($this->request->getGet("q")) {
|
try{
|
||||||
$query->groupStart()
|
$menu = $this->model->getSelect2MenuItems($columns2select, $columns2select[1], $onlyActiveOnes, $searchStr, true);
|
||||||
->orLike("cliente_plantilla_precios.nombre", $this->request->getGet("q"))
|
$nonItem = new \stdClass;
|
||||||
->groupEnd();
|
$nonItem->id = '';
|
||||||
|
$nonItem->text = '- ' . lang('Basic.global.None') . ' -';
|
||||||
|
array_unshift($menu, $nonItem);
|
||||||
|
}
|
||||||
|
catch(Exception $e){
|
||||||
|
$menu = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$items = $query->get()->getResultObject();
|
$newTokenHash = csrf_hash();
|
||||||
// add a custom item at the beginning
|
$csrfTokenName = csrf_token();
|
||||||
$customItem = new \stdClass;
|
$data = [
|
||||||
$customItem->id = 0;
|
'menu' => $menu,
|
||||||
$customItem->name = "Personalizado";
|
$csrfTokenName => $newTokenHash
|
||||||
array_unshift($items, $customItem);
|
];
|
||||||
|
return $this->respond($data);
|
||||||
return $this->response->setJSON($items);
|
|
||||||
} else {
|
} else {
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,27 +93,31 @@ class Clienteplantillaprecioslineas extends \App\Controllers\BaseResourceControl
|
|||||||
}
|
}
|
||||||
$start = $reqData['start'] ?? 0;
|
$start = $reqData['start'] ?? 0;
|
||||||
$length = $reqData['length'] ?? 5;
|
$length = $reqData['length'] ?? 5;
|
||||||
|
$requestedOrder = $reqData['order']['0']['column'] ?? 0;
|
||||||
$requestedOrder = $reqData['order'] ?? [];
|
$requestedOrder2 = $reqData['order']['1']['column'] ?? $requestedOrder;
|
||||||
$searchValues = get_filter_datatables_columns($reqData);
|
$requestedOrder3 = $reqData['order']['2']['column'] ?? $requestedOrder;
|
||||||
|
$requestedOrder4 = $reqData['order']['3']['column'] ?? $requestedOrder;
|
||||||
|
$requestedOrder5 = $reqData['order']['4']['column'] ?? $requestedOrder;
|
||||||
|
$order = ClientePlantillaPreciosLineasModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 0];
|
||||||
|
$order2 = ClientePlantillaPreciosLineasModel::SORTABLE[$requestedOrder2 >= 0 ? $requestedOrder2 : $requestedOrder];
|
||||||
|
$order3 = ClientePlantillaPreciosLineasModel::SORTABLE[$requestedOrder3 >= 0 ? $requestedOrder3 : $requestedOrder];
|
||||||
|
$order4 = ClientePlantillaPreciosLineasModel::SORTABLE[$requestedOrder4 >= 0 ? $requestedOrder4 : $requestedOrder];
|
||||||
|
$order5 = ClientePlantillaPreciosLineasModel::SORTABLE[$requestedOrder4 >= 0 ? $requestedOrder5 : $requestedOrder];
|
||||||
|
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||||
|
$dir2 = $reqData['order']['1']['dir'] ?? $dir;
|
||||||
|
$dir3 = $reqData['order']['2']['dir'] ?? $dir;
|
||||||
|
$dir4= $reqData['order']['3']['dir'] ?? $dir;
|
||||||
|
$dir5= $reqData['order']['4']['dir'] ?? $dir;
|
||||||
|
|
||||||
$plantilla_id = $reqData['plantilla_id'] ?? 0;
|
$plantilla_id = $reqData['plantilla_id'] ?? 0;
|
||||||
|
|
||||||
$resourceData = $this->model->getResource($searchValues, $plantilla_id);
|
$resourceData = $this->model->getResource($plantilla_id)
|
||||||
foreach ($requestedOrder as $order) {
|
->orderBy($order, $dir)->orderBy($order2, $dir2)->orderBy($order3, $dir3)->orderBy($order4, $dir4)->orderBy($order5, $dir5)
|
||||||
$column = $order['column'] ?? 0;
|
->limit($length, $start)->get()->getResultObject();
|
||||||
$dir = $order['dir'] ?? 'asc';
|
|
||||||
$orderColumn = ClientePlantillaPreciosLineasModel::SORTABLE[$column] ?? null;
|
|
||||||
if ($orderColumn) {
|
|
||||||
$resourceData->orderBy($orderColumn, $dir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$resourceData = $resourceData->limit($length, $start)->get()->getResultObject();
|
|
||||||
|
|
||||||
return $this->respond(Collection::datatable(
|
return $this->respond(Collection::datatable(
|
||||||
$resourceData,
|
$resourceData,
|
||||||
$this->model->getResource([], $plantilla_id)->countAllResults(),
|
$this->model->getResource($plantilla_id)->countAllResults(),
|
||||||
$this->model->getResource($searchValues, $plantilla_id)->countAllResults()
|
$this->model->getResource($plantilla_id)->countAllResults()
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
@ -134,8 +138,6 @@ class Clienteplantillaprecioslineas extends \App\Controllers\BaseResourceControl
|
|||||||
Field::inst( 'tipo_maquina' ),
|
Field::inst( 'tipo_maquina' ),
|
||||||
Field::inst( 'tipo_impresion' ),
|
Field::inst( 'tipo_impresion' ),
|
||||||
Field::inst( 'user_updated_id' ),
|
Field::inst( 'user_updated_id' ),
|
||||||
Field::inst( 'deleted_at' ),
|
|
||||||
Field::inst( 'is_deleted' ),
|
|
||||||
Field::inst( 'updated_at' ),
|
Field::inst( 'updated_at' ),
|
||||||
Field::inst( 'tiempo_min' )
|
Field::inst( 'tiempo_min' )
|
||||||
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
->getFormatter( 'Format::toDecimalChar')->setFormatter( 'Format::fromDecimalChar')
|
||||||
@ -199,20 +201,21 @@ class Clienteplantillaprecioslineas extends \App\Controllers\BaseResourceControl
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
->on('preCreate', function ($editor, &$values) {
|
->on('preCreate', function ($editor, &$values) {
|
||||||
|
$session = session();
|
||||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||||
$editor
|
$editor
|
||||||
->field('user_updated_id')
|
->field('user_updated_id')
|
||||||
->setValue(auth()->user()->id);
|
->setValue($session->id_user);
|
||||||
$editor
|
$editor
|
||||||
->field('updated_at')
|
->field('updated_at')
|
||||||
->setValue($datetime->format('Y-m-d H:i:s'));
|
->setValue($datetime->format('Y-m-d H:i:s'));
|
||||||
})
|
})
|
||||||
->on('preEdit', function ($editor, &$values) {
|
->on('preEdit', function ($editor, &$values) {
|
||||||
|
$session = session();
|
||||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||||
$editor
|
$editor
|
||||||
->field('user_updated_id')
|
->field('user_updated_id')
|
||||||
->setValue(auth()->user()->id);
|
->setValue($session->id_user);
|
||||||
$editor
|
$editor
|
||||||
->field('updated_at')
|
->field('updated_at')
|
||||||
->setValue($datetime->format('Y-m-d H:i:s'));
|
->setValue($datetime->format('Y-m-d H:i:s'));
|
||||||
|
|||||||
@ -298,24 +298,11 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
|
|||||||
{
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|
||||||
$tirada = goSanitize($this->request->getGet('tirada'))[0] ?? null;
|
|
||||||
$POD = null;
|
|
||||||
if($tirada != null){
|
|
||||||
$POD_value = model('App\Models\Configuracion\ConfiguracionSistemaModel')->getPOD();
|
|
||||||
if(intval($tirada) <= intval($POD_value)){
|
|
||||||
$POD = true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$POD = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$tipo = goSanitize($this->request->getGet('tipo'))[0];
|
$tipo = goSanitize($this->request->getGet('tipo'))[0];
|
||||||
$selected_papel = goSanitize($this->request->getGet('papel'))[0] ?? null;
|
$selected_papel = goSanitize($this->request->getGet('papel'))[0] ?? null;
|
||||||
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
|
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
|
||||||
$tapa_dura = goSanitize($this->request->getGet('tapa_dura'))[0] ?? null;
|
$menu = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, false);
|
||||||
|
$menu2 = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, true);
|
||||||
$menu = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $tapa_dura, false, $POD);
|
|
||||||
$menu2 = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $tapa_dura, true, $POD);
|
|
||||||
|
|
||||||
$newTokenHash = csrf_hash();
|
$newTokenHash = csrf_hash();
|
||||||
$csrfTokenName = csrf_token();
|
$csrfTokenName = csrf_token();
|
||||||
@ -336,21 +323,10 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
|
|
||||||
$tirada = goSanitize($this->request->getGet('tirada'))[0] ?? null;
|
|
||||||
$POD = null;
|
|
||||||
if($tirada != null){
|
|
||||||
$POD_value = model('App\Models\Configuracion\ConfiguracionSistemaModel')->getPOD();
|
|
||||||
if(intval($tirada) <= intval($POD_value)){
|
|
||||||
$POD = true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$POD = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$tipo = goSanitize($this->request->getGet('tipo'))[0];
|
$tipo = goSanitize($this->request->getGet('tipo'))[0];
|
||||||
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
|
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
|
||||||
|
|
||||||
$items = $this->model->getPapelCliente($tipo, $cubierta, null, true, $POD);
|
$items = $this->model->getPapelCliente($tipo, $cubierta, null, true);
|
||||||
$items = array_map(function ($item) {
|
$items = array_map(function ($item) {
|
||||||
return [
|
return [
|
||||||
'id' => $item->id,
|
'id' => $item->id,
|
||||||
|
|||||||
@ -175,7 +175,7 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
if ($this->request->getPost()) :
|
if ($this->request->getPost()) :
|
||||||
|
|
||||||
$nullIfEmpty = false; // !(phpversion() >= '8.1');
|
$nullIfEmpty = true; // !(phpversion() >= '8.1');
|
||||||
|
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
@ -200,9 +200,6 @@ class Papelesimpresion extends \App\Controllers\BaseResourceController
|
|||||||
if ($this->request->getPost('cubierta') == null) {
|
if ($this->request->getPost('cubierta') == null) {
|
||||||
$sanitizedData['cubierta'] = false;
|
$sanitizedData['cubierta'] = false;
|
||||||
}
|
}
|
||||||
if ($this->request->getPost('use_for_tapa_dura') == null) {
|
|
||||||
$sanitizedData['use_for_tapa_dura'] = false;
|
|
||||||
}
|
|
||||||
if ($this->request->getPost('sobrecubierta') == null) {
|
if ($this->request->getPost('sobrecubierta') == null) {
|
||||||
$sanitizedData['sobrecubierta'] = false;
|
$sanitizedData['sobrecubierta'] = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,89 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers\Configuracion;
|
|
||||||
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
use App\Models\Configuracion\ServicioClienteModel;
|
|
||||||
use CodeIgniter\HTTP\Response;
|
|
||||||
use Hermawan\DataTables\DataTable;
|
|
||||||
use CodeIgniter\I18n\Time;
|
|
||||||
|
|
||||||
class ServicioCliente extends BaseController
|
|
||||||
{
|
|
||||||
|
|
||||||
protected ServicioClienteModel $servicioClienteModel;
|
|
||||||
protected $format = 'json';
|
|
||||||
protected array $viewData = [];
|
|
||||||
|
|
||||||
|
|
||||||
protected static $viewPath = 'themes/vuexy/form/configuracion/servicios_cliente/';
|
|
||||||
protected static $controllerSlug = "servicios";
|
|
||||||
protected $indexRoute = 'viewServicioCliente';
|
|
||||||
protected $editRoute = 'ServicioClienteEdit';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
|
||||||
{
|
|
||||||
parent::initController($request, $response, $logger);
|
|
||||||
$this->servicioClienteModel = model(ServicioClienteModel::class);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
$this->viewData['breadcrumb'] = [
|
|
||||||
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
|
|
||||||
['title' => lang("App.menu_servicios_cliente"), 'route' => site_url('configuracion/servicios'), 'active' => true]
|
|
||||||
];
|
|
||||||
return view(static::$viewPath . $this->indexRoute, $this->viewData);
|
|
||||||
}
|
|
||||||
public function viewForm(int $servicio_cliente_id)
|
|
||||||
{
|
|
||||||
$servicioCliente = $this->servicioClienteModel->find($servicio_cliente_id);
|
|
||||||
$this->viewData['breadcrumb'] = [
|
|
||||||
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
|
|
||||||
['title' => lang("App.menu_servicios_cliente"), 'route' => site_url('configuracion/servicios'), 'active' => false],
|
|
||||||
['title' => $servicioCliente->nombre, 'route' => site_url('configuracion/servicios/edit/' . $servicio_cliente_id), 'active' => true]
|
|
||||||
];
|
|
||||||
$this->viewData["model"] = $servicioCliente;
|
|
||||||
|
|
||||||
return view(static::$viewPath . 'ServicioClienteEdit', $this->viewData);
|
|
||||||
}
|
|
||||||
public function show(int $id)
|
|
||||||
{
|
|
||||||
$data = $this->servicioClienteModel->find($id)->withAllTarifas();
|
|
||||||
return $this->response->setJSON($data);
|
|
||||||
}
|
|
||||||
public function update_servicio_cliente(int $id)
|
|
||||||
{
|
|
||||||
$data = $this->request->getPost();
|
|
||||||
$status = $this->servicioClienteModel->update($id, [
|
|
||||||
"nombre" => $data["nombre"],
|
|
||||||
"code" => $data["code"]
|
|
||||||
]);
|
|
||||||
if (isset($data["tarifa_manipulado_id"])) {
|
|
||||||
$this->servicioClienteModel->upsertTarifaManipulado($id, $data["tarifa_manipulado_id"]);
|
|
||||||
}else if(isset($data["tarifa_acabado_id"])) {
|
|
||||||
|
|
||||||
$this->servicioClienteModel->upsertTarifaAcabado($id, $data["tarifa_acabado_id"]);
|
|
||||||
}else{
|
|
||||||
$this->servicioClienteModel->detachTarifas($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->response->setJSON(["message" => lang("App.global_success"), "status" => $status]);
|
|
||||||
}
|
|
||||||
public function store()
|
|
||||||
{
|
|
||||||
// $this->servicioClienteModel->update($id,[$this->request->getPost()]);
|
|
||||||
return $this->response->setJSON([]);
|
|
||||||
}
|
|
||||||
public function datatable()
|
|
||||||
{
|
|
||||||
$query = $this->servicioClienteModel->getQueryDatatable()->orderBy("created_at", "DESC");
|
|
||||||
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") : "")
|
|
||||||
->add("action", fn($q) => $q->id)
|
|
||||||
->toJson(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -265,7 +265,7 @@ class Users extends \App\Controllers\GoBaseController
|
|||||||
foreach ($chatDepartments as $chatDepartment) {
|
foreach ($chatDepartments as $chatDepartment) {
|
||||||
$this->chat_department_user_model->insert([
|
$this->chat_department_user_model->insert([
|
||||||
"user_id" => $id,
|
"user_id" => $id,
|
||||||
"chat_department_id" => $this->chat_department_model->where("name", $chatDepartment)->first()->id
|
"chat_department_id" => $this->chat_department_model->where("name", $chatDepartment)->first()["id"]
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
$id = $user->id ?? $id;
|
$id = $user->id ?? $id;
|
||||||
|
|||||||
@ -21,22 +21,9 @@ class Language extends BaseController
|
|||||||
public function getTranslation()
|
public function getTranslation()
|
||||||
{
|
{
|
||||||
$translationFile = $this->request->getPost('translationFile');
|
$translationFile = $this->request->getPost('translationFile');
|
||||||
$data = [];
|
$locale = $this->request->getPost('locale');
|
||||||
if(is_array($translationFile)){
|
$path = "Language/{$locale}/$translationFile.php";
|
||||||
foreach($translationFile as $file){
|
$lang = require APPPATH.$path;
|
||||||
$locale = $this->request->getPost('locale');
|
return json_encode($lang);
|
||||||
$path = "Language/{$locale}/$file.php";
|
|
||||||
$lang = require APPPATH.$path;
|
|
||||||
$data[$file] = $lang;
|
|
||||||
}
|
|
||||||
return json_encode($data);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$locale = $this->request->getPost('locale');
|
|
||||||
$path = "Language/{$locale}/$translationFile.php";
|
|
||||||
$lang = require APPPATH.$path;
|
|
||||||
return json_encode($lang);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -388,9 +388,5 @@ class Pedido extends \App\Controllers\BaseResourceController
|
|||||||
// $xml_service = new PedidoXMLService($this->model);
|
// $xml_service = new PedidoXMLService($this->model);
|
||||||
return $this->respond($data);
|
return $this->respond($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function pedidoToProduction(int $pedido_id){
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,10 +324,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
// Cubierta
|
// Cubierta
|
||||||
$cubierta = [
|
$cubierta = [
|
||||||
'papel_generico_cubierta' => $modelPapelGenerico->where('id', $cubierta['papelCubierta'])->first()->toArray(),
|
'papel_generico_cubierta' => $modelPapelGenerico->getIdFromCode($cubierta['papelCubierta']),
|
||||||
'gramajeCubierta' => intval($cubierta['gramajeCubierta']),
|
'gramajeCubierta' => intval($cubierta['gramajeCubierta']),
|
||||||
'carasCubierta' => intval($cubierta['carasImpresion'] ?? 0),
|
'carasCubierta' => intval($cubierta['carasImpresion'] ?? 0),
|
||||||
'solapasCubierta' => intval($cubierta['solapas'] ?? 0) == 1 ? intval($cubierta['tamanioSolapas']) : 0,
|
'solapasCubierta' => intval($cubierta['solapas'] ?? 0),
|
||||||
'acabadosCubierta' => $cubierta['acabados'] ?? 0,
|
'acabadosCubierta' => $cubierta['acabados'] ?? 0,
|
||||||
'lomoRedondo' => $lomoRedondo,
|
'lomoRedondo' => $lomoRedondo,
|
||||||
];
|
];
|
||||||
@ -471,99 +471,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function calcularMaxSolapas()
|
|
||||||
{
|
|
||||||
if ($this->request->isAJAX()) {
|
|
||||||
|
|
||||||
$reqData = $this->request->getPost();
|
|
||||||
$modelPapelGenerico = new PapelGenericoModel();
|
|
||||||
|
|
||||||
$POD = model('App\Models\Configuracion\ConfiguracionSistemaModel')->getPOD();
|
|
||||||
|
|
||||||
$cliente_id = $reqData['clienteId'] ?? -1;
|
|
||||||
|
|
||||||
$tirada = $reqData['tirada'] ?? 0;
|
|
||||||
$tamanio = $reqData['tamanio'];
|
|
||||||
$paginas = $reqData['paginas'] ?? 0;
|
|
||||||
$paginas_color = $reqData['paginasColor'] ?? 0;
|
|
||||||
$papelInteriorDiferente = intval($reqData['papelInteriorDiferente']) ?? null;
|
|
||||||
$excluirRotativa = $reqData['excluirRotativa'] ?? 0;
|
|
||||||
$excluirRotativa = intval($excluirRotativa);
|
|
||||||
|
|
||||||
$tipo = $reqData['tipo'];
|
|
||||||
$tipoCubierta = 'blanda'; // solapas sólo tapa blanda y sobre cubierta
|
|
||||||
|
|
||||||
$isColor = intval($reqData['isColor']) ?? 0;
|
|
||||||
$isHq = intval($reqData['isHq']) ?? 0;
|
|
||||||
|
|
||||||
$tipo_impresion_id = $this->getTipoImpresion($tipo, $tipoCubierta);
|
|
||||||
$is_cosido = (new TipoPresupuestoModel())->get_isCosido($tipo_impresion_id);
|
|
||||||
|
|
||||||
$interior = $reqData['interior'] ?? [];
|
|
||||||
|
|
||||||
if ($papelInteriorDiferente) {
|
|
||||||
$papel['negro'] = $modelPapelGenerico->where('id', $interior['papelInterior']['negro'])->first()->toArray();
|
|
||||||
$papel['color'] = $modelPapelGenerico->where('id', $interior['papelInterior']['color'])->first()->toArray();
|
|
||||||
$gramaje['negro'] = intval($interior['gramajeInterior']['negro']);
|
|
||||||
$gramaje['color'] = intval($interior['gramajeInterior']['color']);
|
|
||||||
} else {
|
|
||||||
$papel = $modelPapelGenerico->where('id', $interior['papelInterior'])->first()->toArray();
|
|
||||||
$gramaje = intval($interior['gramajeInterior']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$datosPedido = (object) array(
|
|
||||||
'paginas' => $paginas,
|
|
||||||
'tirada' => $tirada[0],
|
|
||||||
'merma' => $tirada[0] > $POD ? $this->calcular_merma($tirada[0], $POD) : 0,
|
|
||||||
'ancho' => intval($tamanio['ancho']) ?? 100000,
|
|
||||||
'alto' => intval($tamanio['alto']) ?? 100000,
|
|
||||||
'isCosido' => $is_cosido,
|
|
||||||
'a_favor_fibra' => 1,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Para POD siempre es HQ
|
|
||||||
if ($tirada[0] <= $POD) {
|
|
||||||
$isHq = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$input_data = array(
|
|
||||||
'uso' => 'interior',
|
|
||||||
'tipo_impresion_id' => $tipo_impresion_id,
|
|
||||||
'datosPedido' => $datosPedido,
|
|
||||||
'papel_generico' => $papel,
|
|
||||||
'gramaje' => $gramaje,
|
|
||||||
'isColor' => $isColor,
|
|
||||||
'isHq' => $isHq,
|
|
||||||
'cliente_id' => $cliente_id,
|
|
||||||
'paginas_color' => $paginas_color,
|
|
||||||
'excluirRotativa' => $excluirRotativa,
|
|
||||||
'papelInteriorDiferente' => $papelInteriorDiferente
|
|
||||||
);
|
|
||||||
|
|
||||||
$interior = PresupuestoClienteService::obtenerInterior($input_data);
|
|
||||||
if ($interior == null) {
|
|
||||||
return $this->failServerError('Error al calcular el interior');
|
|
||||||
}
|
|
||||||
$anchoTotal = $interior[0]['mano'];
|
|
||||||
// le añadimos 2*ancho libro
|
|
||||||
$anchoTotal += 2 * $datosPedido->ancho;
|
|
||||||
// le añadimos los dobleces de las solapas
|
|
||||||
$anchoTotal += 6;
|
|
||||||
// le añadimos la sangre
|
|
||||||
$anchoTotal += PresupuestoService::SANGRE_FORMAS;
|
|
||||||
// 863 es el ancho máximo permitido por las máquinas
|
|
||||||
$maxSolapa = (865 - floor($anchoTotal)) / 2;
|
|
||||||
$maxSolapa = min($maxSolapa, 0.75 * $datosPedido->ancho);
|
|
||||||
return $this->respond($maxSolapa);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function getDireccionesCliente()
|
public function getDireccionesCliente()
|
||||||
{
|
{
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
@ -581,7 +488,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
'menu' => $data,
|
'menu' => $data,
|
||||||
$csrfTokenName => $newTokenHash
|
$csrfTokenName => $newTokenHash
|
||||||
]);
|
]);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
}
|
}
|
||||||
@ -790,10 +696,10 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
// Cubierta
|
// Cubierta
|
||||||
$cubierta = [
|
$cubierta = [
|
||||||
'papel_generico_cubierta' => $modelPapelGenerico->where('id', $cubierta['papelCubierta'])->first()->toArray(),
|
'papel_generico_cubierta' => $modelPapelGenerico->getIdFromCode($cubierta['papelCubierta']),
|
||||||
'gramajeCubierta' => intval($cubierta['gramajeCubierta']),
|
'gramajeCubierta' => intval($cubierta['gramajeCubierta']),
|
||||||
'carasCubierta' => intval($cubierta['carasImpresion'] ?? 0),
|
'carasCubierta' => intval($cubierta['carasImpresion'] ?? 0),
|
||||||
'solapasCubierta' => intval($cubierta['solapas'] ?? 0) == 1 ? intval($cubierta['tamanioSolapas']) : 0,
|
'solapasCubierta' => intval($cubierta['solapas'] ?? 0),
|
||||||
'acabadosCubierta' => $cubierta['acabados'] ?? 0,
|
'acabadosCubierta' => $cubierta['acabados'] ?? 0,
|
||||||
'lomoRedondo' => $cubierta['lomoRedondo'] ?? 0,
|
'lomoRedondo' => $cubierta['lomoRedondo'] ?? 0,
|
||||||
'cabezada' => $cubierta['cabezada'] ?? 'WHI',
|
'cabezada' => $cubierta['cabezada'] ?? 'WHI',
|
||||||
@ -1007,9 +913,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
} else if ($servicio->tarifa_id == 62) {
|
} else if ($servicio->tarifa_id == 62) {
|
||||||
// Servicios manipulado
|
// Servicios manipulado
|
||||||
$this->guardarServicio($id, $servicio, 'manipulado');
|
$this->guardarServicio($id, $servicio, 'manipulado');
|
||||||
} else if ($servicio->tarifa_id == 73) {
|
|
||||||
// Servicios manipulado
|
|
||||||
$this->guardarServicio($id, $servicio, 'manipulado');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1110,9 +1013,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
$data['sobrecubierta']['solapas'] = $presupuesto->solapas_sobrecubierta ? 1 : 0;
|
$data['sobrecubierta']['solapas'] = $presupuesto->solapas_sobrecubierta ? 1 : 0;
|
||||||
$data['sobrecubierta']['solapas_ancho'] = $presupuesto->solapas_ancho_sobrecubierta;
|
$data['sobrecubierta']['solapas_ancho'] = $presupuesto->solapas_ancho_sobrecubierta;
|
||||||
$data['sobrecubierta']['plastificado'] = $modelAcabado->getCodeFromId($presupuesto->acabado_sobrecubierta_id);
|
$data['sobrecubierta']['plastificado'] = $modelAcabado->getCodeFromId($presupuesto->acabado_sobrecubierta_id);
|
||||||
if ($data['sobrecubierta']['plastificado'] == '') {
|
|
||||||
$data['sobrecubierta']['plastificado'] = 'NONE';
|
|
||||||
}
|
|
||||||
|
|
||||||
$data['guardas'] = array_key_exists('guardas', $datos_papel) ? $datos_papel['guardas'] : [];
|
$data['guardas'] = array_key_exists('guardas', $datos_papel) ? $datos_papel['guardas'] : [];
|
||||||
|
|
||||||
@ -1514,11 +1414,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
$info['merma'] = $datosPedido->merma;
|
$info['merma'] = $datosPedido->merma;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Para POD siempre es HQ
|
|
||||||
if ($tirada[$t] <= $POD) {
|
|
||||||
$isHq = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$input_data = array(
|
$input_data = array(
|
||||||
'uso' => 'interior',
|
'uso' => 'interior',
|
||||||
'tipo_impresion_id' => $tipo_impresion_id,
|
'tipo_impresion_id' => $tipo_impresion_id,
|
||||||
@ -1901,9 +1796,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
'solapas' => intval($solapasCubierta) > 0 ? 1 : 0,
|
'solapas' => intval($solapasCubierta) > 0 ? 1 : 0,
|
||||||
'paginasCuadernillo' => $paginasCuadernillo,
|
'paginasCuadernillo' => $paginasCuadernillo,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$costeServiciosDefecto = 0.0;
|
$costeServiciosDefecto = 0.0;
|
||||||
foreach ($servDefecto as $servicio) {
|
foreach ($servDefecto as $servicio) {
|
||||||
if ($servicio->total <= 0) {
|
if ($servicio->total <= 0) {
|
||||||
@ -1937,14 +1829,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Servicios
|
// Servicios
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
'retractilado' => 3,
|
|
||||||
'prototipo' => 9,
|
|
||||||
*/
|
|
||||||
$serviciosAutomaticos = [];
|
|
||||||
$servicios = [];
|
|
||||||
// se comprueba si $datos guardas es un array
|
// se comprueba si $datos guardas es un array
|
||||||
if (is_array($datos_guardas)) {
|
if (is_array($datos_guardas)) {
|
||||||
if (count($datos_guardas) > 0) {
|
if (count($datos_guardas) > 0) {
|
||||||
@ -1955,6 +1839,13 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
array_push($servicios, 62); // Plegado de guardas
|
array_push($servicios, 62); // Plegado de guardas
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
'retractilado' => 3,
|
||||||
|
'prototipo' => 9,
|
||||||
|
*/
|
||||||
|
$serviciosAutomaticos = [];
|
||||||
|
$servicios = [];
|
||||||
if ($datos_entrada['servicios']['retractilado']) // acabado
|
if ($datos_entrada['servicios']['retractilado']) // acabado
|
||||||
array_push($servicios, 3);
|
array_push($servicios, 3);
|
||||||
if ($datos_entrada['servicios']['retractilado5']) // acabado
|
if ($datos_entrada['servicios']['retractilado5']) // acabado
|
||||||
@ -1982,7 +1873,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
$errorModel->insertError(
|
$errorModel->insertError(
|
||||||
$datos_entrada['id'],
|
$datos_entrada['id'],
|
||||||
auth()->user()->id,
|
auth()->user()->id,
|
||||||
'No se puede obtener servicio con id ' . ((string) $servicio),
|
'No se puede obtener servicio con id ' . ((string)$servicio),
|
||||||
$input_data
|
$input_data
|
||||||
);
|
);
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@ -2010,7 +1901,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
$errorModel->insertError(
|
$errorModel->insertError(
|
||||||
$datos_entrada['id'],
|
$datos_entrada['id'],
|
||||||
auth()->user()->id,
|
auth()->user()->id,
|
||||||
'No se puede obtener servicio con id ' . ((string) $servicio),
|
'No se puede obtener servicio con id ' . ((string)$servicio),
|
||||||
$input_data
|
$input_data
|
||||||
);
|
);
|
||||||
$return_data = [
|
$return_data = [
|
||||||
@ -2030,45 +1921,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Plegado de solapas grandes
|
|
||||||
if (
|
|
||||||
(intval($solapasCubierta) > 0 && intval($cubierta['dimension_desarrollo']['ancho']) > 630) ||
|
|
||||||
(is_array($sobreCubierta) && ($sobreCubierta['solapas'] > 0 && intval($linea_sobrecubierta['dimension_desarrollo']['ancho']) > 630))
|
|
||||||
) {
|
|
||||||
|
|
||||||
// Servicios acabado
|
|
||||||
$resultado = PresupuestoCLienteService::getServiciosManipulado([
|
|
||||||
'tarifa_id' => 73,
|
|
||||||
'tirada' => $datosPedido->tirada,
|
|
||||||
'POD' => $POD,
|
|
||||||
]);
|
|
||||||
array_push($serviciosAutomaticos, $resultado[0]);
|
|
||||||
|
|
||||||
if ($resultado[0]->total <= 0) {
|
|
||||||
|
|
||||||
$errorModel = new ErrorPresupuesto();
|
|
||||||
$errorModel->insertError(
|
|
||||||
$datos_entrada['id'],
|
|
||||||
auth()->user()->id,
|
|
||||||
'No se puede obtener servicio de manupulado con id ' . ((string) $servicio),
|
|
||||||
$input_data
|
|
||||||
);
|
|
||||||
$return_data = [
|
|
||||||
'errors' => (object) ([
|
|
||||||
'status' => 1
|
|
||||||
]),
|
|
||||||
];
|
|
||||||
return $return_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
$coste_servicios += floatval($resultado[0]->total);
|
|
||||||
if ($extra_info) {
|
|
||||||
$totalServicios += floatval($resultado[0]->total);
|
|
||||||
$margenServicios += floatval($resultado[0]->total) * floatval($resultado[0]->margen) / 100.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
array_push($precio_u, round(($costeInterior + $coste_cubierta + $coste_sobrecubierta + $costeServiciosDefecto + $coste_servicios) / $tirada[$t], 4));
|
array_push($precio_u, round(($costeInterior + $coste_cubierta + $coste_sobrecubierta + $costeServiciosDefecto + $coste_servicios) / $tirada[$t], 4));
|
||||||
array_push($peso, round($peso_interior + $peso_cubierta + $peso_sobrecubierta + $peso_guardas, 2));
|
array_push($peso, round($peso_interior + $peso_cubierta + $peso_sobrecubierta + $peso_guardas, 2));
|
||||||
|
|
||||||
|
|||||||
@ -2,34 +2,18 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Produccion;
|
namespace App\Controllers\Produccion;
|
||||||
use App\Controllers\BaseController;
|
use App\Controllers\BaseController;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
|
|
||||||
class Ordentrabajo extends BaseController
|
class Ordentrabajo extends BaseController
|
||||||
{
|
{
|
||||||
protected $format = 'json';
|
function __construct()
|
||||||
protected array $viewData = [];
|
{
|
||||||
|
|
||||||
|
|
||||||
protected static $viewPath = 'themes/vuexy/form/produccion/';
|
|
||||||
protected static $controllerSlug = "orden-trabajo";
|
|
||||||
protected $indexRoute = 'viewOrdenTrabajoList';
|
|
||||||
protected $editRoute = 'viewOrdenTrabajoEdit';
|
|
||||||
|
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
|
||||||
{
|
|
||||||
parent::initController($request, $response, $logger);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
// Breadcrumbs
|
echo 'Orden trabajo';
|
||||||
$this->viewData['breadcrumb'] = [
|
|
||||||
['title' => lang("App.orden_trabajo"), 'route' => "javascript:void(0);", 'active' => false],
|
|
||||||
['title' => "Table", 'route' => site_url('produccion/ordentrabajo'), 'active' => true]
|
|
||||||
];
|
|
||||||
return view(static::$viewPath . $this->indexRoute, $this->viewData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete()
|
public function delete()
|
||||||
@ -42,14 +26,9 @@ class Ordentrabajo extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($orden_trabajo_id)
|
public function edit()
|
||||||
{
|
{
|
||||||
// Breadcrumbs
|
|
||||||
$this->viewData['breadcrumb'] = [
|
|
||||||
['title' => lang("App.orden_trabajo"), 'route' => "javascript:void(0);", 'active' => false],
|
|
||||||
['title' => "Table", 'route' => site_url('produccion/ordentrabajo'), 'active' => true]
|
|
||||||
];
|
|
||||||
return view(static::$viewPath . $this->editRoute, $this->viewData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cien()
|
public function cien()
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
<?php
|
<?php namespace App\Controllers\Tarifas\Acabados;
|
||||||
|
|
||||||
namespace App\Controllers\Tarifas\Acabados;
|
|
||||||
|
|
||||||
use App\Controllers\BaseResourceController;
|
use App\Controllers\BaseResourceController;
|
||||||
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
||||||
@ -24,7 +22,7 @@ class TarifaAcabados extends BaseResourceController
|
|||||||
|
|
||||||
protected static $controllerSlug = 'tarifasacabado';
|
protected static $controllerSlug = 'tarifasacabado';
|
||||||
|
|
||||||
protected static $viewPath = 'themes/vuexy/form/tarifas/acabado/';
|
protected static $viewPath = 'themes/vuexy/form/tarifas/acabado/';
|
||||||
|
|
||||||
protected $indexRoute = 'tarifaAcabadoList';
|
protected $indexRoute = 'tarifaAcabadoList';
|
||||||
|
|
||||||
@ -135,7 +133,7 @@ class TarifaAcabados extends BaseResourceController
|
|||||||
|
|
||||||
endif; // ($requestMethod === 'post')
|
endif; // ($requestMethod === 'post')
|
||||||
|
|
||||||
$this->viewData['proveedores'] = $this->getProveedores();
|
$this->viewData['proveedores'] = $this->getProveedores();
|
||||||
|
|
||||||
$this->viewData['tarifaacabadoEntity'] = isset($sanitizedData) ? new TarifaAcabadoEntity($sanitizedData) : new TarifaAcabadoEntity();
|
$this->viewData['tarifaacabadoEntity'] = isset($sanitizedData) ? new TarifaAcabadoEntity($sanitizedData) : new TarifaAcabadoEntity();
|
||||||
$this->viewData['formAction'] = route_to('tarifaAcabadoAdd');
|
$this->viewData['formAction'] = route_to('tarifaAcabadoAdd');
|
||||||
@ -171,7 +169,7 @@ class TarifaAcabados extends BaseResourceController
|
|||||||
|
|
||||||
// JJO
|
// JJO
|
||||||
$sanitizedData['user_updated_id'] = auth()->user()->id;
|
$sanitizedData['user_updated_id'] = auth()->user()->id;
|
||||||
|
|
||||||
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
if ($this->request->getPost('mostrar_en_presupuesto') == null) {
|
||||||
$sanitizedData['mostrar_en_presupuesto'] = false;
|
$sanitizedData['mostrar_en_presupuesto'] = false;
|
||||||
}
|
}
|
||||||
@ -183,7 +181,7 @@ class TarifaAcabados extends BaseResourceController
|
|||||||
if ($this->request->getPost('acabado_sobrecubierta') == null) {
|
if ($this->request->getPost('acabado_sobrecubierta') == null) {
|
||||||
$sanitizedData['acabado_sobrecubierta'] = false;
|
$sanitizedData['acabado_sobrecubierta'] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$noException = true;
|
$noException = true;
|
||||||
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
if ($successfulResult = $this->canValidate()) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
|
||||||
@ -209,7 +207,7 @@ class TarifaAcabados extends BaseResourceController
|
|||||||
|
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $tarifaacabadoEntity->id ?? $id;
|
$id = $tarifaacabadoEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) .'.';
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
if (!empty($this->indexRoute)) :
|
if (!empty($this->indexRoute)) :
|
||||||
@ -314,26 +312,12 @@ class TarifaAcabados extends BaseResourceController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getProveedores()
|
private function getProveedores(){
|
||||||
{
|
|
||||||
$provTipoModel = new ProveedorTipoModel();
|
$provTipoModel = new ProveedorTipoModel();
|
||||||
$provModel = new ProveedorModel();
|
$provModel = new ProveedorModel();
|
||||||
|
|
||||||
$tipoId = $provTipoModel->getTipoId("Acabados");
|
$tipoId = $provTipoModel->getTipoId("Acabados");
|
||||||
return $provModel->getProvList($tipoId);
|
return $provModel->getProvList($tipoId);
|
||||||
}
|
}
|
||||||
public function show_select()
|
|
||||||
{
|
|
||||||
$query = $this->model->builder()
|
|
||||||
->select(
|
|
||||||
["id", "nombre as name", "code as description"]
|
|
||||||
)
|
|
||||||
->where("deleted_at",null);
|
|
||||||
if ($this->request->getGet("q")) {
|
|
||||||
$query->groupStart()
|
|
||||||
->orLike("nombre", $this->request->getGet("q"))
|
|
||||||
->groupEnd();
|
|
||||||
}
|
|
||||||
return $this->response->setJSON($query->get()->getResultObject());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
<?php
|
<?php namespace App\Controllers\Tarifas;
|
||||||
|
|
||||||
namespace App\Controllers\Tarifas;
|
|
||||||
|
|
||||||
|
|
||||||
use App\Controllers\BaseResourceController;
|
use App\Controllers\BaseResourceController;
|
||||||
@ -132,7 +130,7 @@ class Tarifasmanipulado extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
$this->viewData['tarifaManipuladoEntity'] = isset($sanitizedData) ? new TarifaManipuladoEntity($sanitizedData) : new TarifaManipuladoEntity();
|
$this->viewData['tarifaManipuladoEntity'] = isset($sanitizedData) ? new TarifaManipuladoEntity($sanitizedData) : new TarifaManipuladoEntity();
|
||||||
|
|
||||||
$this->viewData['formAction'] = site_url('tarifas/tarifasmanipulado/add'); //route_to('createTarifaManipulado');
|
$this->viewData['formAction'] = site_url('tarifas/tarifasmanipulado/add');//route_to('createTarifaManipulado');
|
||||||
|
|
||||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Tarifamanipulado.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('Tarifamanipulado.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
||||||
|
|
||||||
@ -155,7 +153,7 @@ class Tarifasmanipulado extends \App\Controllers\BaseResourceController
|
|||||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Tarifamanipulado.tarifamanipulado')), $id]);
|
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Tarifamanipulado.tarifamanipulado')), $id]);
|
||||||
return $this->redirect2listView('sweet-error', $message);
|
return $this->redirect2listView('sweet-error', $message);
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
|
||||||
if ($this->request->getPost()) :
|
if ($this->request->getPost()) :
|
||||||
|
|
||||||
@ -295,19 +293,5 @@ class Tarifasmanipulado extends \App\Controllers\BaseResourceController
|
|||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function show_select()
|
|
||||||
{
|
|
||||||
$query = $this->model->builder()
|
|
||||||
->select(
|
|
||||||
["id", "nombre as name", "code as description"]
|
|
||||||
)
|
|
||||||
->where("deleted_at", null);
|
|
||||||
|
|
||||||
if ($this->request->getGet("q")) {
|
|
||||||
$query->groupStart()
|
|
||||||
->orLike("nombre", $this->request->getGet("q"))
|
|
||||||
->groupEnd();
|
|
||||||
}
|
|
||||||
return $this->response->setJSON($query->get()->getResultObject());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,8 @@ class Test extends BaseController
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function echo(){
|
public function echo()
|
||||||
|
{
|
||||||
|
|
||||||
echo "echo";
|
echo "echo";
|
||||||
|
|
||||||
@ -26,29 +27,63 @@ class Test extends BaseController
|
|||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
/*
|
echo "index_test";
|
||||||
$model = model("\App\Models\Pedidos\PedidoLineaModel");
|
|
||||||
$data = $model->obtenerLineasPedidoSinFacturar(999);
|
|
||||||
*/
|
|
||||||
|
|
||||||
xdebug_info();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function clonar_tarifa_encuadernacion($teOrigen, $teDestino){
|
|
||||||
|
public function import_users()
|
||||||
|
{
|
||||||
|
$users = auth()->getProvider();
|
||||||
|
$oldUsersModel = model("\\App\\Models\\UsersImportModel");
|
||||||
|
|
||||||
|
// Definir el ID inicial y el ID final
|
||||||
|
$startId = 601; // Cambia esto por tu ID inicial
|
||||||
|
$endId = 700; // Cambia esto por tu ID final
|
||||||
|
|
||||||
|
|
||||||
|
// Obtener usuarios en el rango actual
|
||||||
|
$oldUsers = $oldUsersModel
|
||||||
|
->where('id >=', $startId)
|
||||||
|
->where('id <=', $endId)
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
foreach ($oldUsers as $user) {
|
||||||
|
echo '<pre>' . json_encode($user, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . '</pre>';
|
||||||
|
|
||||||
|
// Crear el usuario si pasa la validación
|
||||||
|
$user_tmp = new \CodeIgniter\Shield\Entities\User([
|
||||||
|
'username' => $user->email,
|
||||||
|
'first_name' => $user->name,
|
||||||
|
'last_name' => $user->lastname,
|
||||||
|
'cliente_id' => $user->customer_id,
|
||||||
|
'comments' => $user->description,
|
||||||
|
'email' => $user->email,
|
||||||
|
'password' => 'Safekat2024',
|
||||||
|
'status' => 0,
|
||||||
|
'active' => $user->active,
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Agregar el usuario al sistema
|
||||||
|
$users->save($user_tmp);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function clonar_tarifa_encuadernacion($teOrigen, $teDestino)
|
||||||
|
{
|
||||||
|
|
||||||
$tet_model = model('App\Models\Tarifas\TarifaEncuadernacionTiradaModel');
|
$tet_model = model('App\Models\Tarifas\TarifaEncuadernacionTiradaModel');
|
||||||
$tel_model = model('App\Models\Tarifas\TarifaEncuadernacionLineaModel');
|
$tel_model = model('App\Models\Tarifas\TarifaEncuadernacionLineaModel');
|
||||||
|
|
||||||
$tarifasTiradas = $tet_model->asObject()->where('tarifa_encuadernacion_id',$teOrigen)->findAll();
|
$tarifasTiradas = $tet_model->asObject()->where('tarifa_encuadernacion_id', $teOrigen)->findAll();
|
||||||
|
|
||||||
foreach ($tarifasTiradas as $tarifasTirada){
|
foreach ($tarifasTiradas as $tarifasTirada) {
|
||||||
|
|
||||||
echo "--->" . $tarifasTirada->id . "<br>";
|
echo "--->" . $tarifasTirada->id . "<br>";
|
||||||
|
|
||||||
$tarifasLineas = $tel_model->asObject()->where('tirada_encuadernacion_id',$tarifasTirada->id)->findAll();
|
$tarifasLineas = $tel_model->asObject()->where('tirada_encuadernacion_id', $tarifasTirada->id)->findAll();
|
||||||
|
|
||||||
// Prepare the data
|
// Prepare the data
|
||||||
unset($tarifasTirada->id);
|
unset($tarifasTirada->id);
|
||||||
@ -61,7 +96,7 @@ class Test extends BaseController
|
|||||||
$tet_model->insert($tarifasTirada);
|
$tet_model->insert($tarifasTirada);
|
||||||
$inserted_id = $tet_model->insertID();
|
$inserted_id = $tet_model->insertID();
|
||||||
|
|
||||||
foreach ($tarifasLineas as $tarifasLinea){
|
foreach ($tarifasLineas as $tarifasLinea) {
|
||||||
|
|
||||||
echo "------>" . $tarifasLinea->id . "<br>";
|
echo "------>" . $tarifasLinea->id . "<br>";
|
||||||
|
|
||||||
@ -81,7 +116,6 @@ class Test extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private function test_get_tirada_alt($tirada, $merma, $tipo_impresion_id,
|
private function test_get_tirada_alt($tirada, $merma, $tipo_impresion_id,
|
||||||
$json_data, $cliente_id, $ancho, $alto,
|
$json_data, $cliente_id, $ancho, $alto,
|
||||||
$solapas_cubierta, $solapas_ancho_cubierta, $solapas_sobrecubierta, $solapas_ancho_sobrecubierta, $lomo)
|
$solapas_cubierta, $solapas_ancho_cubierta, $solapas_sobrecubierta, $solapas_ancho_sobrecubierta, $lomo)
|
||||||
@ -168,7 +202,6 @@ class Test extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$opciones_papel = PresupuestoService::get_opciones_papel($uso, $isColor);
|
$opciones_papel = PresupuestoService::get_opciones_papel($uso, $isColor);
|
||||||
|
|
||||||
$datosTipolog = $linea['gotaNegro'] ?? null;
|
$datosTipolog = $linea['gotaNegro'] ?? null;
|
||||||
@ -222,7 +255,7 @@ class Test extends BaseController
|
|||||||
|
|
||||||
// Previo a ejecutar, vaciar la tabla clientes_precios (ojo si hay customizaciones)
|
// Previo a ejecutar, vaciar la tabla clientes_precios (ojo si hay customizaciones)
|
||||||
|
|
||||||
$db = \Config\Database::connect();
|
$db = \Config\Database::connect();
|
||||||
$builder = $db->table('cliente_precios');
|
$builder = $db->table('cliente_precios');
|
||||||
|
|
||||||
$plantillaDefectoId = 5;
|
$plantillaDefectoId = 5;
|
||||||
@ -533,7 +566,6 @@ class Test extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function testLineasIntRotativa()
|
public static function testLineasIntRotativa()
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -541,7 +573,6 @@ class Test extends BaseController
|
|||||||
$tipo = 'negro';
|
$tipo = 'negro';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$datosPedido = (object)array(
|
$datosPedido = (object)array(
|
||||||
'paginas' => 240,
|
'paginas' => 240,
|
||||||
'tirada' => 100,
|
'tirada' => 100,
|
||||||
@ -554,8 +585,8 @@ class Test extends BaseController
|
|||||||
|
|
||||||
$parametrosRotativa = (object)array(
|
$parametrosRotativa = (object)array(
|
||||||
'a_favor_fibra' => 0,
|
'a_favor_fibra' => 0,
|
||||||
'bnPages' => 240,
|
'bnPages' => 240,
|
||||||
'colorPages' => 0,
|
'colorPages' => 0,
|
||||||
'rotativa_gota_negro' => 0,
|
'rotativa_gota_negro' => 0,
|
||||||
'rotativa_gota_color' => 0,
|
'rotativa_gota_color' => 0,
|
||||||
);
|
);
|
||||||
@ -587,12 +618,12 @@ class Test extends BaseController
|
|||||||
var_dump($datosTipologias);
|
var_dump($datosTipologias);
|
||||||
echo '</pre>';
|
echo '</pre>';
|
||||||
|
|
||||||
$parametrosRotativa->rotativa_gota_negro = $datosTipologias[0]->gota_negro;
|
$parametrosRotativa->rotativa_gota_negro = $datosTipologias[0]->gota_negro;
|
||||||
$parametrosRotativa->rotativa_gota_color = $datosTipologias[0]->gota_color;
|
$parametrosRotativa->rotativa_gota_color = $datosTipologias[0]->gota_color;
|
||||||
$parametrosRotativa->rotativa_negro = $datosTipologias[0]->negro;
|
$parametrosRotativa->rotativa_negro = $datosTipologias[0]->negro;
|
||||||
$parametrosRotativa->rotativa_cyan = $datosTipologias[0]->cyan;
|
$parametrosRotativa->rotativa_cyan = $datosTipologias[0]->cyan;
|
||||||
$parametrosRotativa->rotativa_magenta = $datosTipologias[0]->magenta;
|
$parametrosRotativa->rotativa_magenta = $datosTipologias[0]->magenta;
|
||||||
$parametrosRotativa->rotativa_amarillo = $datosTipologias[0]->amarillo;
|
$parametrosRotativa->rotativa_amarillo = $datosTipologias[0]->amarillo;
|
||||||
|
|
||||||
echo '-------------------------------';
|
echo '-------------------------------';
|
||||||
$maquinas = $maquina_model->getMaquinaImpresionForPresupuesto(
|
$maquinas = $maquina_model->getMaquinaImpresionForPresupuesto(
|
||||||
@ -604,7 +635,6 @@ class Test extends BaseController
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach ($maquinas as $maquina) {
|
foreach ($maquinas as $maquina) {
|
||||||
|
|
||||||
echo '----------------------------<br>';
|
echo '----------------------------<br>';
|
||||||
|
|||||||
@ -1,320 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Controllers;
|
|
||||||
|
|
||||||
use App\Controllers\BaseController;
|
|
||||||
use App\Models\Configuracion\MaquinasTarifasImpresionModel;
|
|
||||||
use App\Models\Configuracion\PapelGenericoModel;
|
|
||||||
use App\Models\Configuracion\MaquinaModel;
|
|
||||||
use App\Models\Presupuestos\PresupuestoModel;
|
|
||||||
use App\Models\Usuarios\GroupModel;
|
|
||||||
use App\Models\Usuarios\PermisosModel;
|
|
||||||
use App\Services\PresupuestoService;
|
|
||||||
use CodeIgniter\Shield\Entities\User;
|
|
||||||
|
|
||||||
class Utiles extends BaseController
|
|
||||||
{
|
|
||||||
function __construct()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function echo()
|
|
||||||
{
|
|
||||||
|
|
||||||
echo "echo";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function index()
|
|
||||||
{
|
|
||||||
echo "ok";
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function get_tarifas_encuadernacion()
|
|
||||||
{
|
|
||||||
// Llamar al modelo
|
|
||||||
$model = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
|
||||||
|
|
||||||
// Obtener todos los resultados
|
|
||||||
$results = $model->where(['is_deleted' => 0])->findAll();
|
|
||||||
|
|
||||||
// Iterar sobre cada entidad
|
|
||||||
echo '<pre>';
|
|
||||||
foreach ($results as $result) {
|
|
||||||
// Cada $result es una instancia de una entidad
|
|
||||||
print_r($result->toArray()); // Convierte la entidad a un array para imprimir sus valores
|
|
||||||
}
|
|
||||||
echo '</pre>';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get_tarifa_encuadernacion($tarifaEncuadernacionId)
|
|
||||||
{
|
|
||||||
// Llamar a los modelos
|
|
||||||
$modelTE = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
|
||||||
$modelTELineas = model('App\Models\Tarifas\TarifaEncuadernacionLineaModel');
|
|
||||||
$modelTELineasHoras = model('App\Models\Tarifas\TarifaEncuadernacionLineaHorasModel');
|
|
||||||
$modelTETiradas = model('App\Models\Tarifas\TarifaEncuadernacionTiradaModel');
|
|
||||||
|
|
||||||
|
|
||||||
// Obtener el registro principal de tarifa_encuadernacion
|
|
||||||
$tarifas_encuadernacion = $modelTE->where([
|
|
||||||
'id' => $tarifaEncuadernacionId,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
// Verificar si se encontró la tarifa
|
|
||||||
if (empty($tarifas_encuadernacion)) {
|
|
||||||
echo "No se encontraron datos para la tarifa de encuadernación con ID: $tarifaEncuadernacionId.";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Imprimir la tarifa de encuadernación principal
|
|
||||||
echo "<h3>---------------------- DATO TARIFA ENCUADERNACION ----------------------</h3>";
|
|
||||||
foreach ($tarifas_encuadernacion as $tarifa_encuadernacion) {
|
|
||||||
echo "<strong>ID Tarifa: </strong>" . $tarifa_encuadernacion->id . "<br>";
|
|
||||||
echo "<strong>Nombre: </strong>" . $tarifa_encuadernacion->nombre . "<br>";
|
|
||||||
echo "<hr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Obtener las tiradas asociadas a esta tarifa de encuadernación
|
|
||||||
$tarifas_encuadernacion_tiradas = $modelTETiradas->where([
|
|
||||||
'tarifa_encuadernacion_id' => $tarifaEncuadernacionId,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
// Verificar si existen tiradas para la tarifa de encuadernación
|
|
||||||
if (empty($tarifas_encuadernacion_tiradas)) {
|
|
||||||
echo "No hay tiradas asociadas a esta tarifa de encuadernación.";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Imprimir las tiradas asociadas
|
|
||||||
echo "<h3>---------------------- DATO TARIFA ENCUADERNACION (TIRADAS) -------------</h3>";
|
|
||||||
foreach ($tarifas_encuadernacion_tiradas as $tarifa_encuadernacion_tirada) {
|
|
||||||
echo "<strong>ID Tirada: </strong>" . $tarifa_encuadernacion_tirada->id . "<br>";
|
|
||||||
echo "<strong>Tirada Min: </strong>" . $tarifa_encuadernacion_tirada->tirada_min . "<br>";
|
|
||||||
echo "<strong>Tirada Max: </strong>" . $tarifa_encuadernacion_tirada->tirada_max . "<br>";
|
|
||||||
|
|
||||||
// Obtener las líneas asociadas a esta tirada
|
|
||||||
$tarifas_encuadernacion_lineas = $modelTELineas->where([
|
|
||||||
'tirada_encuadernacion_id' => $tarifa_encuadernacion_tirada->id,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
// Verificar si existen líneas asociadas a la tirada
|
|
||||||
if (empty($tarifas_encuadernacion_lineas)) {
|
|
||||||
echo "No hay líneas asociadas a esta tirada de encuadernación.<br>";
|
|
||||||
} else {
|
|
||||||
// Imprimir las líneas asociadas
|
|
||||||
echo "<ul>";
|
|
||||||
foreach ($tarifas_encuadernacion_lineas as $tarifa_encuadernacion_linea) {
|
|
||||||
echo "<li><strong>ID Línea: </strong>" . $tarifa_encuadernacion_linea->id . "<br>";
|
|
||||||
}
|
|
||||||
echo "</ul>";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Obtener las líneas y horas asociadas a esta tirada
|
|
||||||
$tarifas_encuadernacion_lineas_horas = $modelTELineasHoras->where([
|
|
||||||
'tirada_encuadernacion_id' => $tarifa_encuadernacion_tirada->id,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
// Verificar si existen líneas y horas asociadas a la tirada
|
|
||||||
if (empty($tarifas_encuadernacion_lineas_horas)) {
|
|
||||||
echo "No hay líneas y horas asociadas a esta tirada de encuadernación.<br>";
|
|
||||||
} else {
|
|
||||||
// Imprimir las líneas asociadas
|
|
||||||
echo "<ul>";
|
|
||||||
foreach ($tarifas_encuadernacion_lineas_horas as $tarifas_encuadernacion_linea_hora) {
|
|
||||||
echo "<li><strong>ID Línea/Hora: </strong>" . $tarifas_encuadernacion_linea_hora->id . "<br>";
|
|
||||||
}
|
|
||||||
echo "</ul>";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "<hr>";
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "<h3>---------------------- FIN DE DATO TARIFA ENCUADERNACION ----------------------</h3>";
|
|
||||||
}
|
|
||||||
|
|
||||||
public function delete_tarifa_encuadernacion($tarifaEncuadernacionId)
|
|
||||||
{
|
|
||||||
// Llamar a los modelos
|
|
||||||
$modelTE = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
|
||||||
$modelTELineas = model('App\Models\Tarifas\TarifaEncuadernacionLineaModel');
|
|
||||||
$modelTELineasHoras = model('App\Models\Tarifas\TarifaEncuadernacionLineaHorasModel');
|
|
||||||
$modelTETiradas = model('App\Models\Tarifas\TarifaEncuadernacionTiradaModel');
|
|
||||||
|
|
||||||
// Obtener el registro principal de tarifa_encuadernacion
|
|
||||||
$tarifas_encuadernacion = $modelTE->where([
|
|
||||||
'id' => $tarifaEncuadernacionId,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
// Verificar si se encontró la tarifa
|
|
||||||
if (empty($tarifas_encuadernacion)) {
|
|
||||||
echo "No se encontró la tarifa de encuadernación con ID: $tarifaEncuadernacionId.";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Iniciar eliminación de datos asociados
|
|
||||||
echo "Eliminando datos asociados a la tarifa de encuadernación ID: $tarifaEncuadernacionId...<br>";
|
|
||||||
|
|
||||||
// Eliminar las tiradas asociadas a la tarifa de encuadernación
|
|
||||||
$tarifas_encuadernacion_tiradas = $modelTETiradas->where([
|
|
||||||
'tarifa_encuadernacion_id' => $tarifaEncuadernacionId,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
if (!empty($tarifas_encuadernacion_tiradas)) {
|
|
||||||
foreach ($tarifas_encuadernacion_tiradas as $tarifa_encuadernacion_tirada) {
|
|
||||||
// Eliminar las líneas de horas asociadas a cada tirada
|
|
||||||
$tarifas_encuadernacion_lineas_horas = $modelTELineasHoras->where([
|
|
||||||
'tirada_encuadernacion_id' => $tarifa_encuadernacion_tirada->id,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
if (!empty($tarifas_encuadernacion_lineas_horas)) {
|
|
||||||
foreach ($tarifas_encuadernacion_lineas_horas as $tarifa_encuadernacion_linea_hora) {
|
|
||||||
$modelTELineasHoras->delete($tarifa_encuadernacion_linea_hora->id); // Eliminar la línea/hora
|
|
||||||
echo "===sk >-Eliminando Línea/Hora ID: " . $tarifa_encuadernacion_linea_hora->id . "<br>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Eliminar las líneas asociadas a cada tirada
|
|
||||||
$tarifas_encuadernacion_lineas = $modelTELineas->where([
|
|
||||||
'tirada_encuadernacion_id' => $tarifa_encuadernacion_tirada->id,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
if (!empty($tarifas_encuadernacion_lineas)) {
|
|
||||||
foreach ($tarifas_encuadernacion_lineas as $tarifa_encuadernacion_linea) {
|
|
||||||
$modelTELineas->delete($tarifa_encuadernacion_linea->id); // Eliminar la línea
|
|
||||||
echo "===>-Eliminando Línea ID: " . $tarifa_encuadernacion_linea->id . "<br>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Eliminar la tirada
|
|
||||||
$modelTETiradas->delete($tarifa_encuadernacion_tirada->id); // Eliminar la tirada
|
|
||||||
echo "=>-Eliminando Tirada ID: " . $tarifa_encuadernacion_tirada->id . "<br>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
echo " *** Proceso de eliminación completado. ***<br><br>";
|
|
||||||
}
|
|
||||||
|
|
||||||
public function clone_tarifa_encuadernacion($origenId, $destinoId)
|
|
||||||
{
|
|
||||||
// Llamar a los modelos
|
|
||||||
$modelTETiradas = model('App\Models\Tarifas\TarifaEncuadernacionTiradaModel');
|
|
||||||
$modelTELineas = model('App\Models\Tarifas\TarifaEncuadernacionLineaModel');
|
|
||||||
$modelTELineasHoras = model('App\Models\Tarifas\TarifaEncuadernacionLineaHorasModel');
|
|
||||||
|
|
||||||
// 1. Eliminar el contenido asociado de la tarifa destino
|
|
||||||
$this->delete_tarifa_encuadernacion($destinoId);
|
|
||||||
|
|
||||||
// 2. Obtener las tiradas asociadas a la tarifa origen
|
|
||||||
$tiradasOrigen = $modelTETiradas->where([
|
|
||||||
'tarifa_encuadernacion_id' => $origenId,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
foreach ($tiradasOrigen as $tiradaOrigen) {
|
|
||||||
// Crear un nuevo registro para la tirada en la tarifa destino
|
|
||||||
$nuevaTirada = [
|
|
||||||
'tarifa_encuadernacion_id' => (int) $destinoId,
|
|
||||||
'proveedor_id' => (int) $tiradaOrigen->proveedor_id,
|
|
||||||
'importe_fijo' => (float) $tiradaOrigen->importe_fijo,
|
|
||||||
'tirada_min' => (int) $tiradaOrigen->tirada_min,
|
|
||||||
'tirada_max' => (int) $tiradaOrigen->tirada_max,
|
|
||||||
'user_created_id' => (int) auth()->id(),
|
|
||||||
'is_deleted' => 0
|
|
||||||
];
|
|
||||||
|
|
||||||
try {
|
|
||||||
$nuevaTiradaId = $modelTETiradas->insert($nuevaTirada);
|
|
||||||
if (!$nuevaTiradaId) {
|
|
||||||
throw new \Exception("Error al insertar el registro.");
|
|
||||||
}
|
|
||||||
echo "<br>==>+Tirada creada con ID: " . $nuevaTiradaId;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
echo "Error: " . $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. Clonar las líneas asociadas a esta tirada
|
|
||||||
$lineasOrigen = $modelTELineas->where([
|
|
||||||
'tirada_encuadernacion_id' => $tiradaOrigen->id,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
foreach ($lineasOrigen as $lineaOrigen) {
|
|
||||||
$nuevaLinea = [
|
|
||||||
'tirada_encuadernacion_id' => (int) $nuevaTiradaId,
|
|
||||||
'paginas_libro_min' => (float) $lineaOrigen->paginas_libro_min,
|
|
||||||
'paginas_libro_max' => (float) $lineaOrigen->paginas_libro_max,
|
|
||||||
'dimensiones_id' => (int) $lineaOrigen->dimensiones_id,
|
|
||||||
'precio_min' => (float) $lineaOrigen->precio_min,
|
|
||||||
'precio_max' => (float) $lineaOrigen->precio_max,
|
|
||||||
'tirada_min' => (float) $lineaOrigen->tirada_min,
|
|
||||||
'tirada_max' => (float) $lineaOrigen->tirada_max,
|
|
||||||
'total_min' => (float) $lineaOrigen->total_min,
|
|
||||||
'margen' => (float) $lineaOrigen->margen,
|
|
||||||
'user_created_id' => (int) auth()->id(),
|
|
||||||
'is_deleted' => 0
|
|
||||||
];
|
|
||||||
|
|
||||||
try {
|
|
||||||
$nuevaLineaId = $modelTELineas->insert($nuevaLinea);
|
|
||||||
if (!$nuevaLineaId) {
|
|
||||||
throw new \Exception("Error al insertar el registro.");
|
|
||||||
}
|
|
||||||
echo "<br>====>+Linea creada con ID: " . $nuevaLineaId;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
echo "Error: " . $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 4. Clonar las líneas y horas asociadas a esta tirada
|
|
||||||
$lineasHorasOrigen = $modelTELineasHoras->where([
|
|
||||||
'tirada_encuadernacion_id' => $tiradaOrigen->id,
|
|
||||||
'is_deleted' => 0
|
|
||||||
])->findAll();
|
|
||||||
|
|
||||||
foreach ($lineasHorasOrigen as $lineaHoraOrigen) {
|
|
||||||
$nuevaLineaHora = [
|
|
||||||
'tirada_encuadernacion_id' => (int) $nuevaTiradaId,
|
|
||||||
'tiempo_min' => (float) $lineaHoraOrigen->tiempo_min,
|
|
||||||
'tiempo_max' => (float) $lineaHoraOrigen->tiempo_max,
|
|
||||||
'precio_hora' => (float) $lineaHoraOrigen->precio_hora,
|
|
||||||
'total_min' => (float) $lineaHoraOrigen->total_min,
|
|
||||||
'margen' => (float) $lineaHoraOrigen->margen,
|
|
||||||
'user_created_id' => (int) auth()->id(),
|
|
||||||
'is_deleted' => 0
|
|
||||||
];
|
|
||||||
|
|
||||||
try {
|
|
||||||
$nuevaLineaHoraId = $modelTELineasHoras->insert($nuevaLineaHora);
|
|
||||||
if (!$nuevaLineaHoraId) {
|
|
||||||
throw new \Exception("Error al insertar el registro.");
|
|
||||||
}
|
|
||||||
echo "<br>====>+Linea/Hora creado con ID: " . $nuevaLineaHoraId;
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
echo "Error: " . $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "<br> *** Proceso de clonacion completado. ***<br><br>";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
|
||||||
|
|
||||||
class AddTickTapaDuraPapelImp extends Migration
|
|
||||||
{
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$fields = [
|
|
||||||
'use_for_tapa_dura' => [
|
|
||||||
'type' => 'TINYINT',
|
|
||||||
'constraint' => 1,
|
|
||||||
'null' => false,
|
|
||||||
'default' => 0,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
|
|
||||||
$this->forge->addColumn('lg_papel_impresion', $fields);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
$this->forge->dropColumn('lg_papel_impresion', 'use_for_tapa_dura');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,68 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
|
||||||
use CodeIgniter\Database\RawSql;
|
|
||||||
|
|
||||||
class ServicioClienteTareas extends Migration
|
|
||||||
{
|
|
||||||
protected array $COLUMNS = [
|
|
||||||
"id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"auto_increment" => true
|
|
||||||
],
|
|
||||||
"servicio_cliente_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"comment" => "Servicio cliente asociado"
|
|
||||||
],
|
|
||||||
"tarifa_acabado_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"null" => true,
|
|
||||||
"comment" => "Tarifa de acabado asociada a servicio"
|
|
||||||
],
|
|
||||||
"tarifa_manipulado_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"null" => true,
|
|
||||||
"comment" => "Tarifa de manipulado asociada a servicio",
|
|
||||||
|
|
||||||
]
|
|
||||||
];
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$this->forge->addField($this->COLUMNS);
|
|
||||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
|
||||||
$this->forge->addField([
|
|
||||||
"created_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"default" => $currenttime,
|
|
||||||
|
|
||||||
],
|
|
||||||
"updated_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
"deleted_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
$this->forge->addPrimaryKey("id");
|
|
||||||
$this->forge->addForeignKey('servicio_cliente_id','servicios_cliente','id');
|
|
||||||
$this->forge->addForeignKey('tarifa_acabado_id','lg_tarifa_acabado','id');
|
|
||||||
$this->forge->addForeignKey('tarifa_manipulado_id','lg_tarifa_manipulado','id');
|
|
||||||
|
|
||||||
$this->forge->createTable("servicio_cliente_tareas", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
$this->forge->dropTable("servicio_cliente_tareas");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,299 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
|
||||||
use CodeIgniter\Database\RawSql;
|
|
||||||
|
|
||||||
class OrdenTrabajoTable extends Migration
|
|
||||||
{
|
|
||||||
protected array $COLUMNS = [
|
|
||||||
"id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"auto_increment" => true
|
|
||||||
],
|
|
||||||
"pedido_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
"comment" => "Pedido asociado",
|
|
||||||
],
|
|
||||||
"user_created_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"user_update_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"maquina_orden_negro_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
"null" => true
|
|
||||||
],
|
|
||||||
"maquina_orden_color_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
"null" => true
|
|
||||||
|
|
||||||
],
|
|
||||||
"maquina_orden_portada_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
"null" => true
|
|
||||||
|
|
||||||
],
|
|
||||||
"maquina_orden_cubierta_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
"null" => true
|
|
||||||
|
|
||||||
],
|
|
||||||
"negro_forma_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
"null" => true
|
|
||||||
|
|
||||||
],
|
|
||||||
"color_forma_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
"null" => true
|
|
||||||
|
|
||||||
],
|
|
||||||
"portada_forma_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
"null" => true
|
|
||||||
|
|
||||||
],
|
|
||||||
"cubierta_forma_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
"null" => true
|
|
||||||
|
|
||||||
],
|
|
||||||
"tirada" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
],
|
|
||||||
"negro_pliegos_pedido" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
"null" => true
|
|
||||||
],
|
|
||||||
"color_pliegos_pedido" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
"null" => true
|
|
||||||
],
|
|
||||||
"portada_pliegos_pedido" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
"null" => true
|
|
||||||
],
|
|
||||||
"cubierta_pliegos_pedido" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
"null" => true
|
|
||||||
],
|
|
||||||
"negro_clicks_pedido" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
],
|
|
||||||
"color_clicks_pedido" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
],
|
|
||||||
"portada_clicks_pedido" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
],
|
|
||||||
"cubierta_clicks_pedido" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
],
|
|
||||||
"pliegos1" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 11,
|
|
||||||
],
|
|
||||||
"paginas1" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 11,
|
|
||||||
],
|
|
||||||
"pliegos2" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 11,
|
|
||||||
],
|
|
||||||
"paginas2" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 11,
|
|
||||||
],
|
|
||||||
"negro_proveedor_nombre" => [
|
|
||||||
"type" => "VARCHAR",
|
|
||||||
"constraint" => 225
|
|
||||||
],
|
|
||||||
"color_proveedor_nombre" => [
|
|
||||||
"type" => "VARCHAR",
|
|
||||||
"constraint" => 225
|
|
||||||
],
|
|
||||||
"portada_proveedor_nombre" => [
|
|
||||||
"type" => "VARCHAR",
|
|
||||||
"constraint" => 225
|
|
||||||
],
|
|
||||||
"corte_pie" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
],
|
|
||||||
"lomo" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 11,
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"tipo_entrada" => [
|
|
||||||
"type" => "ENUM",
|
|
||||||
"constraint" => ["in", "out"],
|
|
||||||
"default" => "out"
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"fecha_entrega_real_warning" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => false,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"fecha_entrega_warning" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => false
|
|
||||||
],
|
|
||||||
"fecha_entrega_warning_revised" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => false
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"ferro_disponible" => [
|
|
||||||
"type" => "TINYINT",
|
|
||||||
"constraint" => 4,
|
|
||||||
],
|
|
||||||
"ferro_disponible_thread_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"ferro_cp" => [
|
|
||||||
"type" => "VARCHAR",
|
|
||||||
"constraint" => 10,
|
|
||||||
"null" => true
|
|
||||||
],
|
|
||||||
"ferro_proveedor" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"ferro_tracking" => [
|
|
||||||
"type" => "VARCHAR",
|
|
||||||
"constraint" => 100,
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pre_formato" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => false
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
"pre_lomo" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => 0,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
"pre_solapa" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => 0,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
"pre_isbn" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => 0,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pre_codbarras" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => 0,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
"pre_imposicion" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => 0,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
"pre_imprimir" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => 0,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pre_faltan_materiales" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => 0,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pre_faltan_materiales_note" => [
|
|
||||||
"type" => "TEXT",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"progreso" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
"default" => 0.00,
|
|
||||||
],
|
|
||||||
"message_production_send" => [
|
|
||||||
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => 0,
|
|
||||||
],
|
|
||||||
"finalizado" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => 0,
|
|
||||||
],
|
|
||||||
"comentarios" => [
|
|
||||||
"type" => "TEXT",
|
|
||||||
"null" => true,
|
|
||||||
]
|
|
||||||
];
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$this->forge->addField($this->COLUMNS);
|
|
||||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
|
||||||
$this->forge->addField([
|
|
||||||
"created_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"default" => $currenttime,
|
|
||||||
|
|
||||||
],
|
|
||||||
"updated_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
"deleted_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
$this->forge->addPrimaryKey("id");
|
|
||||||
// $this->forge->addForeignKey(["maquina_orden_portada_id"],"lg_maquinas",["id"]);
|
|
||||||
// $this->forge->addForeignKey(["maquina_orden_negro_id"],"lg_maquinas",["id"]);
|
|
||||||
// $this->forge->addForeignKey(["maquina_orden_cubierta_id"],"lg_maquinas",["id"]);
|
|
||||||
// $this->forge->addForeignKey(["maquina_orden_color_id"],"lg_maquinas",["id"]);
|
|
||||||
$this->forge->createTable("ordenes_trabajo", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
$this->forge->dropTable("ordenes_trabajo");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
|
||||||
use CodeIgniter\Database\RawSql;
|
|
||||||
|
|
||||||
class OrdenTrabajoTareasTable extends Migration
|
|
||||||
{
|
|
||||||
protected array $COLUMNS = [
|
|
||||||
"id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"autoincrement" => true
|
|
||||||
],
|
|
||||||
"tarea_servicio_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
],
|
|
||||||
"orden_trabajo_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
];
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$this->forge->addField($this->COLUMNS);
|
|
||||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
|
||||||
$this->forge->addField([
|
|
||||||
"created_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"default" => $currenttime,
|
|
||||||
|
|
||||||
],
|
|
||||||
"updated_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
"deleted_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
// $this->forge->addPrimaryKey("id");
|
|
||||||
// $this->forge->addForeignKey("orden_trabajo_id","ordenes_trabajo","id");
|
|
||||||
// $this->forge->addForeignKey("tarea_servicio_id","tareas_servicio","id");
|
|
||||||
$this->forge->createTable("orden_trabajo_tareas", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
$this->forge->dropTable("orden_trabajo_tareas");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,171 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
|
||||||
use CodeIgniter\Database\RawSql;
|
|
||||||
|
|
||||||
class OrdenTrabajoDatesTable extends Migration
|
|
||||||
{
|
|
||||||
protected array $COLUMNS = [
|
|
||||||
"fecha_entrada_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"fecha_entrega_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"fecha_entrega_change_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
"fecha_entrega_real_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"fecha_entrega_real_warning" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => false,
|
|
||||||
],
|
|
||||||
"fecha_impresion_at" => [
|
|
||||||
"type" => "DATE",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"fecha_encuardernado_at" => [
|
|
||||||
"type" => "DATE",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"fecha_externo_at" => [
|
|
||||||
"type" => "DATE",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"fecha_entrega_warning" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => false
|
|
||||||
],
|
|
||||||
"fecha_entrega_warning_revised" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => false
|
|
||||||
],
|
|
||||||
|
|
||||||
"pendiente_ferro_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"ferro_en_cliente_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"ferro_ok_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"interior_bn_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"interior_color_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"preparacion_interiores_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"cubierta_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"plastificado_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"encuadernacion_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"corte_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"embalaje_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"envio_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"entrada_manipulado_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
"ferro_disponible_hecho_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
"ferro_disponible_ok_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
"ferro_entregado_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"pre_formato_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pre_lomo_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pre_solapa_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pre_codbarras_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pre_imposicion_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$this->forge->addField($this->COLUMNS);
|
|
||||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
|
||||||
$this->forge->addField([
|
|
||||||
"created_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"default" => $currenttime,
|
|
||||||
],
|
|
||||||
"updated_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"deleted_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
$this->forge->createTable("orden_trabajo_dates", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
$this->forge->dropTable("orden_trabajo_dates");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,190 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
|
||||||
use CodeIgniter\Database\RawSql;
|
|
||||||
|
|
||||||
class OrdenTrabajoUsers extends Migration
|
|
||||||
{
|
|
||||||
protected array $COLUMNS = [
|
|
||||||
|
|
||||||
|
|
||||||
"user_created_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"user_update_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"inaplazable_revised_change_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
"ferro_disponible_hecho_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
|
|
||||||
"ferro_disponible_ok_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"ferro_entregado_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pendiente_ferro_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"ferro_en_cliente_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"ferro_ok_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"interior_bn_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"interior_color_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"preparacion_interior_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"cubierda_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"plastificado_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"encuadernacion_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"corte_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"embalaje_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"envio_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"entrada_manipulado_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
"pre_formato_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
"pre_lomo_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pre_solapa_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
|
|
||||||
|
|
||||||
"pre_codbarras_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
|
|
||||||
"pre_imposicion_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"pre_imprimir_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"pre_imprimir_user_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$this->forge->addField($this->COLUMNS);
|
|
||||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
|
||||||
$this->forge->addField([
|
|
||||||
"created_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"default" => $currenttime,
|
|
||||||
|
|
||||||
],
|
|
||||||
"updated_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
"deleted_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
foreach ($this->COLUMNS as $key => $value) {
|
|
||||||
$this->forge->addForeignKey([$key],"users",["id"]);
|
|
||||||
}
|
|
||||||
$this->forge->createTable("orden_trabajo_users", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
$this->forge->dropTable("orden_trabajo_users");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
|
||||||
use CodeIgniter\Database\RawSql;
|
|
||||||
|
|
||||||
class OrdenTrabajoMaquetacionesTable extends Migration
|
|
||||||
{
|
|
||||||
protected array $COLUMNS = [
|
|
||||||
"id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"auto_increment" => true
|
|
||||||
],
|
|
||||||
"pedido_maquetacion_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"user_created_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"user_update_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"constraint" => 10,
|
|
||||||
],
|
|
||||||
"entrada_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"default" => null
|
|
||||||
],
|
|
||||||
"salida_at" => [
|
|
||||||
"type" => "DATETIME",
|
|
||||||
"default" => null
|
|
||||||
],
|
|
||||||
"progreso" => [
|
|
||||||
"type" => "DOUBLE",
|
|
||||||
"default" => 0
|
|
||||||
],
|
|
||||||
"finalizado" => [
|
|
||||||
"type" => "BOOLEAN",
|
|
||||||
"default" => 0
|
|
||||||
]
|
|
||||||
];
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$this->forge->addField($this->COLUMNS);
|
|
||||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
|
||||||
$this->forge->addField([
|
|
||||||
"created_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"default" => $currenttime,
|
|
||||||
|
|
||||||
],
|
|
||||||
"updated_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
"deleted_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
$this->forge->addPrimaryKey("id");
|
|
||||||
$this->forge->createTable("orden_trabajo_maquetaciones", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
$this->forge->dropTable("orden_trabajo_maquetaciones");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,63 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
|
||||||
use CodeIgniter\Database\RawSql;
|
|
||||||
|
|
||||||
class OrdenTrabajoMaquetacionMovimientosTable extends Migration
|
|
||||||
{
|
|
||||||
protected array $COLUMNS = [
|
|
||||||
"id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"auto_increment" => true
|
|
||||||
],
|
|
||||||
"orden_trabajo_maquetacion_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
"orden_trabajo_maquetacion_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
"file_id" => [
|
|
||||||
"type" => "INT",
|
|
||||||
"unsigned" => true,
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$this->forge->addField($this->COLUMNS);
|
|
||||||
$currenttime = new RawSql("CURRENT_TIMESTAMP");
|
|
||||||
$this->forge->addField([
|
|
||||||
"created_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"default" => $currenttime,
|
|
||||||
|
|
||||||
],
|
|
||||||
"updated_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
"deleted_at" => [
|
|
||||||
"type" => "TIMESTAMP",
|
|
||||||
"null" => true,
|
|
||||||
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
$this->forge->addPrimaryKey("id");
|
|
||||||
$this->forge->createTable("orden_trabajo_maquetacion_movimientos", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
$this->forge->dropTable("orden_trabajo_maquetacion_movimientos");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Database\Migrations;
|
|
||||||
|
|
||||||
use CodeIgniter\Database\Migration;
|
|
||||||
|
|
||||||
class AlterColumnServiciosCliente extends Migration
|
|
||||||
{
|
|
||||||
protected array $ALTER_COLUMNS = [
|
|
||||||
"deleted_at" => [
|
|
||||||
"name" => "deleted_at",
|
|
||||||
"type" => "datetime",
|
|
||||||
"default" => null,
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
"updated_at" => [
|
|
||||||
"name" => "updated_at",
|
|
||||||
"type" => "datetime",
|
|
||||||
"default" => null,
|
|
||||||
"null" => true,
|
|
||||||
],
|
|
||||||
];
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
$this->forge->modifyColumn("servicios_cliente", $this->ALTER_COLUMNS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
$this->forge->addField([
|
|
||||||
"is_deleted" => [
|
|
||||||
"type" => "boolean",
|
|
||||||
"default" => false,
|
|
||||||
"null" => false,
|
|
||||||
]
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,52 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Database\Seeds;
|
|
||||||
|
|
||||||
use App\Models\Chat\ChatDeparmentModel;
|
|
||||||
use App\Models\Chat\ChatDeparmentUserModel;
|
|
||||||
use App\Models\Chat\ChatMessageModel;
|
|
||||||
use App\Models\Chat\ChatModel;
|
|
||||||
use App\Models\ChatNotification;
|
|
||||||
use CodeIgniter\Database\Seeder;
|
|
||||||
use App\Models\Usuarios\UserModel;
|
|
||||||
|
|
||||||
class MessageSeeder extends Seeder
|
|
||||||
{
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
|
|
||||||
$data = [
|
|
||||||
"title" => "Message Test",
|
|
||||||
"messages" => [
|
|
||||||
[
|
|
||||||
"sender_id" => 1,
|
|
||||||
"receiver_id" => 127,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
"sender_id" => 127,
|
|
||||||
"receiver_id" => 1,
|
|
||||||
]
|
|
||||||
]
|
|
||||||
];
|
|
||||||
$chatModel = model(ChatModel::class);
|
|
||||||
$chatMessageModel = model(ChatMessageModel::class);
|
|
||||||
$chatNotificationModel = model(ChatNotification::class);
|
|
||||||
$userModel = model(UserModel::class);
|
|
||||||
foreach (range(1,100) as $key => $value) {
|
|
||||||
$chat_id = $chatModel->insert(["title" => $data["title"]." ".$value]);
|
|
||||||
foreach ($data["messages"] as $key => $value) {
|
|
||||||
$first_name = $userModel->find($value["receiver_id"])?->first_name;
|
|
||||||
$chat_message_id = $chatMessageModel->insert([
|
|
||||||
"chat_id" => $chat_id,
|
|
||||||
"sender_id" => $value["sender_id"],
|
|
||||||
"receiver_id" => $value["receiver_id"],
|
|
||||||
"message" => "Hola"." ".$first_name
|
|
||||||
]);
|
|
||||||
$chatNotificationModel->insert([
|
|
||||||
"chat_message_id" => $chat_message_id,
|
|
||||||
"user_id" => $value["receiver_id"]
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -25,7 +25,6 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity
|
|||||||
"rotativa" => false,
|
"rotativa" => false,
|
||||||
"isActivo" => true,
|
"isActivo" => true,
|
||||||
"use_in_client" => false,
|
"use_in_client" => false,
|
||||||
"use_for_tapa_dura" => false,
|
|
||||||
"is_deleted" => 0,
|
"is_deleted" => 0,
|
||||||
"created_at" => null,
|
"created_at" => null,
|
||||||
"updated_at" => null,
|
"updated_at" => null,
|
||||||
@ -46,7 +45,6 @@ class PapelImpresion extends \CodeIgniter\Entity\Entity
|
|||||||
"rotativa" => "boolean",
|
"rotativa" => "boolean",
|
||||||
"isActivo" => "boolean",
|
"isActivo" => "boolean",
|
||||||
"use_in_client" => "boolean",
|
"use_in_client" => "boolean",
|
||||||
"use_for_tapa_dura" => "boolean",
|
|
||||||
"is_deleted" => "int",
|
"is_deleted" => "int",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,59 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Entities\Configuracion;
|
|
||||||
|
|
||||||
use CodeIgniter\Entity\Entity;
|
|
||||||
use App\Entities\Tarifas\Acabados\TarifaAcabadoEntity;
|
|
||||||
use App\Entities\Tarifas\TarifaManipuladoEntity;
|
|
||||||
use App\Models\Configuracion\ServicioClienteModel;
|
|
||||||
use CodeIgniter\Database\MySQLi\Result;
|
|
||||||
|
|
||||||
class ServicioClienteEntity extends Entity
|
|
||||||
{
|
|
||||||
protected $attributes = [
|
|
||||||
"nombre" => null,
|
|
||||||
"code" => null,
|
|
||||||
];
|
|
||||||
protected $casts = [
|
|
||||||
"nombre" => "string",
|
|
||||||
"code" => "string",
|
|
||||||
];
|
|
||||||
|
|
||||||
public function withManipuladoTarifas()
|
|
||||||
{
|
|
||||||
$this->attributes["tarifas_manipulado"] = $this->getManipuladoTarifas();
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
public function withAcabadoTarifas()
|
|
||||||
{
|
|
||||||
$this->attributes["tarifas_acabado"] = $this->getAcabadoTarifas();
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
public function withAllTarifas(){
|
|
||||||
$this->withManipuladoTarifas();
|
|
||||||
$this->withAcabadoTarifas();
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
public function getManipuladoTarifas(): ?object
|
|
||||||
{
|
|
||||||
$model = model(ServicioClienteModel::class);
|
|
||||||
return $model->builder()->select("lg_tarifa_manipulado.*")
|
|
||||||
->join("servicio_cliente_tareas","servicio_cliente_tareas.servicio_cliente_id = servicios_cliente.id",'left')
|
|
||||||
->join("lg_tarifa_manipulado","lg_tarifa_manipulado.id = servicio_cliente_tareas.tarifa_manipulado_id",'left')
|
|
||||||
->where("servicio_cliente_tareas.servicio_cliente_id",$this->attributes["id"])
|
|
||||||
->where("lg_tarifa_manipulado.id IS NOT NULL",NULL,FALSE)
|
|
||||||
->where("servicio_cliente_tareas.deleted_at", NULL) // Exclude soft-deleted rows
|
|
||||||
->get()->getFirstRow();
|
|
||||||
}
|
|
||||||
public function getAcabadoTarifas(): ?object
|
|
||||||
{
|
|
||||||
$model = model(ServicioClienteModel::class);
|
|
||||||
return $model->builder()->select("lg_tarifa_acabado.*")
|
|
||||||
->join("servicio_cliente_tareas","servicio_cliente_tareas.servicio_cliente_id = servicios_cliente.id",'left')
|
|
||||||
->join("lg_tarifa_acabado","lg_tarifa_acabado.id = servicio_cliente_tareas.tarifa_acabado_id",'left')
|
|
||||||
->where("servicio_cliente_tareas.servicio_cliente_id",$this->attributes["id"])
|
|
||||||
->where("servicio_cliente_tareas.deleted_at", NULL) // Exclude soft-deleted rows
|
|
||||||
->where("lg_tarifa_acabado.id IS NOT NULL",NULL,FALSE)
|
|
||||||
->get()->getFirstRow();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,114 +0,0 @@
|
|||||||
<?php
|
|
||||||
namespace App\Entities\Produccion;
|
|
||||||
|
|
||||||
use CodeIgniter\Entity\Entity;
|
|
||||||
|
|
||||||
|
|
||||||
class OrdenTrabajoEntity extends Entity
|
|
||||||
{
|
|
||||||
protected $attributes = [
|
|
||||||
"pedido_id" => null,
|
|
||||||
"maquina_orden_negro_id" => null,
|
|
||||||
"maquina_orden_color_id" => null,
|
|
||||||
"maquina_orden_portada_id" => null,
|
|
||||||
"maquina_orden_cubierta_id" => null,
|
|
||||||
"negro_forma_id" => null,
|
|
||||||
"color_forma_id" => null,
|
|
||||||
"portada_forma_id" => null,
|
|
||||||
"cubierta_forma_id" => null,
|
|
||||||
"tirada" => null,
|
|
||||||
"negro_pliegos_pedido" => null,
|
|
||||||
"color_pliegos_pedido" => null,
|
|
||||||
"portada_pliegos_pedido" => null,
|
|
||||||
"cubierta_pliegos_pedido" => null,
|
|
||||||
"negro_clicks_pedido" => null,
|
|
||||||
"color_clicks_pedido" => null,
|
|
||||||
"portada_clicks_pedido" => null,
|
|
||||||
"cubierta_clicks_pedido" => null,
|
|
||||||
"pliegos1" => null,
|
|
||||||
"paginas1" => null,
|
|
||||||
"pliegos2" => null,
|
|
||||||
"paginas2" => null,
|
|
||||||
"negro_proveedor_nombre" => null,
|
|
||||||
"color_proveedor_nombre" => null,
|
|
||||||
"portada_proveedor_nombre" => null,
|
|
||||||
"corte_pie" => null,
|
|
||||||
"lomo" => null,
|
|
||||||
"tipo_entrada" => null,
|
|
||||||
"fecha_entrega_real_warning" => null,
|
|
||||||
"fecha_entrega_warning" => null,
|
|
||||||
"fecha_entrega_warning_revised" => null,
|
|
||||||
"ferro_disponible" => null,
|
|
||||||
"ferro_disponible_thread_id" => null,
|
|
||||||
"ferro_cp" => null,
|
|
||||||
"ferro_proveedor" => null,
|
|
||||||
"ferro_tracking" => null,
|
|
||||||
"pre_formato" => null,
|
|
||||||
"pre_lomo" => null,
|
|
||||||
"pre_solapa" => null,
|
|
||||||
"pre_isbn" => null,
|
|
||||||
"pre_codbarras" => null,
|
|
||||||
"pre_imposicion" => null,
|
|
||||||
"pre_imprimir" => null,
|
|
||||||
"pre_faltan_materiales" => null,
|
|
||||||
"pre_faltan_materiales_note" => null,
|
|
||||||
"progreso" => null,
|
|
||||||
"message_production_send" => null,
|
|
||||||
"finalizado" => null,
|
|
||||||
"comentarios" => null
|
|
||||||
];
|
|
||||||
protected $casts = [
|
|
||||||
"pedido_id" => 'integer',
|
|
||||||
"maquina_orden_negro_id" => '?integer',
|
|
||||||
"maquina_orden_color_id" => '?integer',
|
|
||||||
"maquina_orden_portada_id" => '?integer',
|
|
||||||
"maquina_orden_cubierta_id" => '?integer',
|
|
||||||
"negro_forma_id" => '?integer',
|
|
||||||
"color_forma_id" => '?integer',
|
|
||||||
"portada_forma_id" => '?integer',
|
|
||||||
"cubierta_forma_id" => '?integer',
|
|
||||||
"tirada" => 'integer',
|
|
||||||
"negro_pliegos_pedido" => '?integer',
|
|
||||||
"color_pliegos_pedido" => 'string',
|
|
||||||
"portada_pliegos_pedido" => 'string',
|
|
||||||
"cubierta_pliegos_pedido" => 'string',
|
|
||||||
"negro_clicks_pedido" => '?integer',
|
|
||||||
"color_clicks_pedido" => '?integer',
|
|
||||||
"portada_clicks_pedido" => '?integer',
|
|
||||||
"cubierta_clicks_pedido" => null,
|
|
||||||
"pliegos1" => '?integer',
|
|
||||||
"paginas1" => '?integer',
|
|
||||||
"pliegos2" => '?integer',
|
|
||||||
"paginas2" => '?integer',
|
|
||||||
"negro_proveedor_nombre" => null,
|
|
||||||
"color_proveedor_nombre" => null,
|
|
||||||
"portada_proveedor_nombre" => null,
|
|
||||||
"corte_pie" => null,
|
|
||||||
"lomo" => null,
|
|
||||||
"tipo_entrada" => 'string',
|
|
||||||
"fecha_entrega_real_warning" => 'boolean',
|
|
||||||
"fecha_entrega_warning" => 'boolean',
|
|
||||||
"fecha_entrega_warning_revised" => 'boolean',
|
|
||||||
"ferro_disponible" => 'boolean',
|
|
||||||
"ferro_disponible_thread_id" => '?integer',
|
|
||||||
"ferro_cp" => '?string',
|
|
||||||
"ferro_proveedor" => '?string',
|
|
||||||
"ferro_tracking" => '?string',
|
|
||||||
"pre_formato" => '?string',
|
|
||||||
"pre_lomo" => '?string',
|
|
||||||
"pre_solapa" => '?string',
|
|
||||||
"pre_isbn" => '?string',
|
|
||||||
"pre_codbarras" => '?string',
|
|
||||||
"pre_imposicion" => '?string',
|
|
||||||
"pre_imprimir" => 'boolean',
|
|
||||||
"pre_faltan_materiales" => 'boolean',
|
|
||||||
"pre_faltan_materiales_note" => '?string',
|
|
||||||
"progreso" => 'float',
|
|
||||||
"message_production_send" => 'boolean',
|
|
||||||
"finalizado" => 'boolean',
|
|
||||||
"comentarios" => 'string'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
"ot" => "Orden de trabajo",
|
|
||||||
"ots" => "Órdenes de trabajo",
|
|
||||||
"btn_pedido_produccion_accion" => "Pasar a producción",
|
|
||||||
"datatable" => [
|
|
||||||
"pedido_id"=> "Order ID",
|
|
||||||
"fecha_encuadernacion"=> "Bookbinding date",
|
|
||||||
"cliente"=> "Client",
|
|
||||||
"titulo"=> "Title",
|
|
||||||
"ubicacion"=> "Location",
|
|
||||||
"tirada"=> "Runs",
|
|
||||||
"impresion"=> "Printing",
|
|
||||||
]
|
|
||||||
];
|
|
||||||
@ -695,7 +695,6 @@ return [
|
|||||||
"menu_papelgenerico" => "Papel generico",
|
"menu_papelgenerico" => "Papel generico",
|
||||||
"menu_papelimpresion" => "Papel impresión",
|
"menu_papelimpresion" => "Papel impresión",
|
||||||
"menu_series_facturas" => "Series facturas",
|
"menu_series_facturas" => "Series facturas",
|
||||||
"menu_servicios_cliente" => "Servicios cliente",
|
|
||||||
"menu_ubicaciones" => "Ubicaciones",
|
"menu_ubicaciones" => "Ubicaciones",
|
||||||
"menu_serviciocliente" => "Servicio cliente",
|
"menu_serviciocliente" => "Servicio cliente",
|
||||||
"menu_tamanioformatos" => "Tamaño formatos",
|
"menu_tamanioformatos" => "Tamaño formatos",
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
return [
|
return [
|
||||||
"chat" => "Mensajería",
|
"chat" => "Mensajería",
|
||||||
"messages" => "Mensajes",
|
"messages" => "Mensajes",
|
||||||
"message" => "Mensaje",
|
|
||||||
"modal" => [
|
"modal" => [
|
||||||
"new_hebra" => "Nuevo hilo",
|
"new_hebra" => "Nuevo hilo",
|
||||||
"title" => "Título",
|
"title" => "Título",
|
||||||
@ -11,23 +10,5 @@ return [
|
|||||||
"new_receivers" => "Nuevos participantes",
|
"new_receivers" => "Nuevos participantes",
|
||||||
"btn_send" => "Enviar",
|
"btn_send" => "Enviar",
|
||||||
"btn_send_update" => "Enviar"
|
"btn_send_update" => "Enviar"
|
||||||
],
|
]
|
||||||
"datatable_messages" => [
|
|
||||||
"created_at" => "Fecha creación",
|
|
||||||
"updated_at" => "Fecha actualización",
|
|
||||||
"title" => "Título",
|
|
||||||
"creator" => "Creador",
|
|
||||||
"viewed" => "Leído",
|
|
||||||
|
|
||||||
],
|
|
||||||
"new_message_ok" => "Mensaje enviado correctamente",
|
|
||||||
"participants" => "Participantes",
|
|
||||||
"choose_department" => "Elige un departamento",
|
|
||||||
"new_participant" => "Añadir nuevos participantes",
|
|
||||||
"write_message_placeholder" => "Escriba aquí su mensaje...",
|
|
||||||
"add_notification" => "Notificación",
|
|
||||||
"check_as_unviewed" => "Marcar como no leídos",
|
|
||||||
"add_notification_message" => "Envía a los usuarios añadidos una notificación con los mensajes presentes en el chat.",
|
|
||||||
"chat_title_presupuesto" => 'Presupuesto[{title,string,0}][{id}]',
|
|
||||||
"no_messages_notification" => 'No hay mensajes que revisar por el momento'
|
|
||||||
];
|
];
|
||||||
@ -10,7 +10,6 @@ return [
|
|||||||
'color' => 'Color',
|
'color' => 'Color',
|
||||||
'createdAt' => 'Creado en',
|
'createdAt' => 'Creado en',
|
||||||
'cubierta' => 'Cubierta',
|
'cubierta' => 'Cubierta',
|
||||||
'use_for_tapa_dura' => 'Papel tapa dura',
|
|
||||||
'sobrecubierta' => 'Sobrecubierta',
|
'sobrecubierta' => 'Sobrecubierta',
|
||||||
'guardas' => 'Guardas',
|
'guardas' => 'Guardas',
|
||||||
'defecto' => 'Por defecto',
|
'defecto' => 'Por defecto',
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
return [
|
|
||||||
"datatable" => [
|
|
||||||
"pedido_id"=> "Pedido ID",
|
|
||||||
"fecha_encuadernacion"=> "Fecha encuadernación",
|
|
||||||
"cliente"=> "Cliente",
|
|
||||||
"titulo"=> "Título",
|
|
||||||
"ubicacion"=> "Ubicación",
|
|
||||||
"tirada"=> "Tirada",
|
|
||||||
"impresion"=> "Impresión",
|
|
||||||
]
|
|
||||||
];
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
|
|
||||||
return [
|
|
||||||
"cardTitle" => "Servicios cliente",
|
|
||||||
"infoTarifaManipulado" => "La tarifa seleccionada estará asociada al servicio.",
|
|
||||||
"infoTarifaAcabado" => "La tarifa seleccionada estará asociada al servicio.",
|
|
||||||
|
|
||||||
"datatable" => [
|
|
||||||
"nombre" => "Nombre",
|
|
||||||
"code" => "Código",
|
|
||||||
"created_at" => "Fecha creación",
|
|
||||||
]
|
|
||||||
];
|
|
||||||
@ -10,7 +10,7 @@ class ChatDeparmentModel extends Model
|
|||||||
protected $table = 'chat_departments';
|
protected $table = 'chat_departments';
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
protected $useAutoIncrement = true;
|
protected $useAutoIncrement = true;
|
||||||
protected $returnType = 'object';
|
protected $returnType = 'array';
|
||||||
protected $useSoftDeletes = false;
|
protected $useSoftDeletes = false;
|
||||||
protected $protectFields = true;
|
protected $protectFields = true;
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
@ -126,21 +126,4 @@ class ChatDeparmentModel extends Model
|
|||||||
->get()->getResultObject();
|
->get()->getResultObject();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
public function getDisplay(int $chat_deparment_id) : string
|
|
||||||
{
|
|
||||||
return $this->find($chat_deparment_id)->display;
|
|
||||||
}
|
|
||||||
public function getChatDepartmentSelect(string $query = null)
|
|
||||||
{
|
|
||||||
$q = $this->builder()->select([
|
|
||||||
"id",
|
|
||||||
"display as name",
|
|
||||||
"description"
|
|
||||||
]);
|
|
||||||
if($query){
|
|
||||||
$q->orLike("display",$query)
|
|
||||||
->orLike("name",$query);
|
|
||||||
}
|
|
||||||
return $q;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,15 +5,14 @@ namespace App\Models\Chat;
|
|||||||
use App\Models\ChatNotification;
|
use App\Models\ChatNotification;
|
||||||
use App\Models\Usuarios\UserModel;
|
use App\Models\Usuarios\UserModel;
|
||||||
use CodeIgniter\Model;
|
use CodeIgniter\Model;
|
||||||
use CodeIgniter\Database\BaseBuilder;
|
|
||||||
|
|
||||||
class ChatMessageModel extends Model
|
class ChatMessageModel extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'chat_messages';
|
protected $table = 'chat_messages';
|
||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
protected $useAutoIncrement = true;
|
protected $useAutoIncrement = true;
|
||||||
protected $returnType = 'object';
|
protected $returnType = 'array';
|
||||||
protected $useSoftDeletes = true;
|
protected $useSoftDeletes = false;
|
||||||
protected $protectFields = true;
|
protected $protectFields = true;
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
"message",
|
"message",
|
||||||
@ -30,7 +29,7 @@ class ChatMessageModel extends Model
|
|||||||
protected array $castHandlers = [];
|
protected array $castHandlers = [];
|
||||||
|
|
||||||
// Dates
|
// Dates
|
||||||
protected $useTimestamps = true;
|
protected $useTimestamps = false;
|
||||||
protected $dateFormat = 'datetime';
|
protected $dateFormat = 'datetime';
|
||||||
protected $createdField = 'created_at';
|
protected $createdField = 'created_at';
|
||||||
protected $updatedField = 'updated_at';
|
protected $updatedField = 'updated_at';
|
||||||
@ -73,23 +72,6 @@ class ChatMessageModel extends Model
|
|||||||
}
|
}
|
||||||
return $messages;
|
return $messages;
|
||||||
}
|
}
|
||||||
public function get_chat_message(int $chat_message_id): object
|
|
||||||
{
|
|
||||||
$user = model(UserModel::class);
|
|
||||||
$auth_user = auth()->user();
|
|
||||||
$message = $this->find($chat_message_id);
|
|
||||||
$message->pos = $auth_user->id == $message->sender_id ? "right" : "left";
|
|
||||||
if ($auth_user->id == $message->sender_id) {
|
|
||||||
$message->sender_first_name = $auth_user->first_name;
|
|
||||||
$message->sender_last_name = $auth_user->last_name;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
$sender_user = $user->find($message->sender_id);
|
|
||||||
$message->sender_first_name = $sender_user->first_name;
|
|
||||||
$message->sender_last_name = $sender_user->last_name;
|
|
||||||
}
|
|
||||||
return $message;
|
|
||||||
}
|
|
||||||
public function get_chat_contact_messages(int $receiver_id): array
|
public function get_chat_contact_messages(int $receiver_id): array
|
||||||
{
|
{
|
||||||
$conversationArray = [];
|
$conversationArray = [];
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -47,16 +47,4 @@ class ChatNotification extends Model
|
|||||||
protected $afterFind = [];
|
protected $afterFind = [];
|
||||||
protected $beforeDelete = [];
|
protected $beforeDelete = [];
|
||||||
protected $afterDelete = [];
|
protected $afterDelete = [];
|
||||||
|
|
||||||
public function isChatMessageViewed(int $chat_message_id) : bool
|
|
||||||
{
|
|
||||||
$status = false;
|
|
||||||
$count = $this->where("chat_message_id",$chat_message_id)->where("viewed",false)->countAllResults();
|
|
||||||
if($count>0){
|
|
||||||
$status = false;
|
|
||||||
}else{
|
|
||||||
$status = true;
|
|
||||||
}
|
|
||||||
return $status;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class ChatUser extends Model
|
|||||||
protected $primaryKey = 'id';
|
protected $primaryKey = 'id';
|
||||||
protected $useAutoIncrement = true;
|
protected $useAutoIncrement = true;
|
||||||
protected $returnType = 'array';
|
protected $returnType = 'array';
|
||||||
protected $useSoftDeletes = true;
|
protected $useSoftDeletes = false;
|
||||||
protected $protectFields = true;
|
protected $protectFields = true;
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
"user_id",
|
"user_id",
|
||||||
@ -24,7 +24,7 @@ class ChatUser extends Model
|
|||||||
protected array $castHandlers = [];
|
protected array $castHandlers = [];
|
||||||
|
|
||||||
// Dates
|
// Dates
|
||||||
protected $useTimestamps = true;
|
protected $useTimestamps = false;
|
||||||
protected $dateFormat = 'datetime';
|
protected $dateFormat = 'datetime';
|
||||||
protected $createdField = 'created_at';
|
protected $createdField = 'created_at';
|
||||||
protected $updatedField = 'updated_at';
|
protected $updatedField = 'updated_at';
|
||||||
@ -46,12 +46,4 @@ class ChatUser extends Model
|
|||||||
protected $afterFind = [];
|
protected $afterFind = [];
|
||||||
protected $beforeDelete = [];
|
protected $beforeDelete = [];
|
||||||
protected $afterDelete = [];
|
protected $afterDelete = [];
|
||||||
public function getChatUserArrayId(int $chat_id) : array
|
|
||||||
{
|
|
||||||
$queryResult = $this->builder()
|
|
||||||
->select(['chat_users.user_id'])
|
|
||||||
->where("chat_users.chat_id",$chat_id)
|
|
||||||
->get()->getResultObject();
|
|
||||||
return array_map(fn($q) => $q->user_id,$queryResult);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,16 +7,14 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
|
|||||||
protected $table = "cliente_plantilla_precios_lineas";
|
protected $table = "cliente_plantilla_precios_lineas";
|
||||||
|
|
||||||
const SORTABLE = [
|
const SORTABLE = [
|
||||||
0 => "t1.id",
|
0 => "t1.tipo",
|
||||||
1 => "t1.tipo",
|
1 => "t1.tipo_maquina",
|
||||||
2 => "t1.tipo_maquina",
|
2 => "t1.tipo_impresion",
|
||||||
3 => "t1.tipo_impresion",
|
3 => "t1.tiempo_min",
|
||||||
4 => "t1.tiempo_min",
|
4 => "t1.tiempo_max",
|
||||||
5 => "t1.tiempo_max",
|
5 => "t1.precio_hora",
|
||||||
6 => "t1.precio_hora",
|
6 => "t1.margen",
|
||||||
7 => "t1.margen",
|
|
||||||
8 => "CONCAT(t2.first_name, ' ', t2.last_name)",
|
|
||||||
9 => "t1.updated_at",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -115,20 +113,10 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
|
|||||||
|
|
||||||
|
|
||||||
function delete_values($plantilla_id = 0){
|
function delete_values($plantilla_id = 0){
|
||||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
|
||||||
$date_value = $datetime->format('Y-m-d H:i:s');
|
|
||||||
|
|
||||||
$this->db
|
$this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->where('t1.plantilla_id', $plantilla_id)
|
->where('t1.plantilla_id', $plantilla_id)
|
||||||
->set('is_deleted', 1)
|
->set('is_deleted', 1)
|
||||||
->set('deleted_at', $date_value)
|
|
||||||
->update();
|
|
||||||
|
|
||||||
$this->db
|
|
||||||
->table('cliente_precios' . " t1")
|
|
||||||
->where('t1.plantilla_id', $plantilla_id)
|
|
||||||
->set('plantilla_id', null)
|
|
||||||
->update();
|
->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,15 +127,14 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
|
|||||||
*
|
*
|
||||||
* @return \CodeIgniter\Database\BaseBuilder
|
* @return \CodeIgniter\Database\BaseBuilder
|
||||||
*/
|
*/
|
||||||
public function getResource($search = [], $plantilla_id = -1)
|
public function getResource($plantilla_id = -1)
|
||||||
{
|
{
|
||||||
$builder = $this->db
|
$builder = $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->select(
|
->select(
|
||||||
"t1.id as id, t1.tipo AS tipo, t1.tipo_maquina AS tipo_maquina, t1.tipo_impresion AS tipo_impresion,
|
"t1.id as id, t1.tipo AS tipo, t1.tipo_maquina AS tipo_maquina, t1.tipo_impresion AS tipo_impresion,
|
||||||
t1.tiempo_min AS tiempo_min, t1.tiempo_max AS tiempo_max, t1.precio_hora AS precio_hora, t1.margen AS margen,
|
t1.tiempo_min AS tiempo_min, t1.tiempo_max AS tiempo_max, t1.precio_hora AS precio_hora, t1.margen AS margen,
|
||||||
t1.user_updated_id AS user_updated_id, t1.updated_at AS updated_at, CONCAT(t2.first_name, ' ', t2.last_name) AS user_updated,
|
t1.user_updated_id AS user_updated_id, t1.updated_at AS updated_at, CONCAT(t2.first_name, ' ', t2.last_name) AS user_updated"
|
||||||
t1.id AS DT_RowId"
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$builder->join("users t2", "t1.user_updated_id = t2.id", "left");
|
$builder->join("users t2", "t1.user_updated_id = t2.id", "left");
|
||||||
@ -155,19 +142,8 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
|
|||||||
$builder->where('t1.is_deleted', 0);
|
$builder->where('t1.is_deleted', 0);
|
||||||
$builder->where('t1.plantilla_id', $plantilla_id);
|
$builder->where('t1.plantilla_id', $plantilla_id);
|
||||||
|
|
||||||
if (empty($search))
|
|
||||||
return $builder;
|
return $builder;
|
||||||
else {
|
|
||||||
$builder->groupStart();
|
|
||||||
foreach ($search as $col_search) {
|
|
||||||
if ($col_search[1] > 0 && $col_search[0] < 4)
|
|
||||||
$builder->where(self::SORTABLE[$col_search[0]], $col_search[2]);
|
|
||||||
else
|
|
||||||
$builder->like(self::SORTABLE[$col_search[0]], $col_search[2]);
|
|
||||||
}
|
|
||||||
$builder->groupEnd();
|
|
||||||
return $builder;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkIntervals($data = [], $id_linea = null, $plantilla_id = null){
|
public function checkIntervals($data = [], $id_linea = null, $plantilla_id = null){
|
||||||
@ -207,13 +183,14 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
|
|||||||
|
|
||||||
function copy_from_cliente($cliente_id = 0, $plantilla_id = 0){
|
function copy_from_cliente($cliente_id = 0, $plantilla_id = 0){
|
||||||
|
|
||||||
|
$session = session();
|
||||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||||
$date_value = $datetime->format('Y-m-d H:i:s');
|
$date_value = $datetime->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
|
||||||
// Se cargan los valores en la plantilla
|
// Se cargan los valores en la plantilla
|
||||||
$clientePreciosModel = model('App\Models\Clientes\ClientePreciosModel');
|
$clientePreciosModel = model('App\Models\Clientes\ClientePreciosModel');
|
||||||
$values = $clientePreciosModel->getResource([], $cliente_id)->get()->getResultObject();
|
$values = $clientePreciosModel->getResource($cliente_id)->get()->getResultObject();
|
||||||
foreach ($values as $value) {
|
foreach ($values as $value) {
|
||||||
$this->db
|
$this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
@ -224,7 +201,7 @@ class ClientePlantillaPreciosLineasModel extends \App\Models\BaseModel
|
|||||||
->set('tiempo_min', $value->tiempo_min)
|
->set('tiempo_min', $value->tiempo_min)
|
||||||
->set('tiempo_max', $value->tiempo_max)
|
->set('tiempo_max', $value->tiempo_max)
|
||||||
->set('margen', $value->margen)
|
->set('margen', $value->margen)
|
||||||
->set('user_updated_id', auth()->user()->id)
|
->set('user_updated_id', $session->id_user)
|
||||||
->set('updated_at', $date_value)
|
->set('updated_at', $date_value)
|
||||||
->insert();
|
->insert();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,8 +7,7 @@ class ClientePlantillaPreciosModel extends \App\Models\BaseModel
|
|||||||
protected $table = "cliente_plantilla_precios";
|
protected $table = "cliente_plantilla_precios";
|
||||||
|
|
||||||
const SORTABLE = [
|
const SORTABLE = [
|
||||||
0 => "t1.id",
|
0 => "t1.nombre",
|
||||||
1 => "t1.nombre",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,11 +48,11 @@ class ClientePlantillaPreciosModel extends \App\Models\BaseModel
|
|||||||
/**
|
/**
|
||||||
* Get resource data.
|
* Get resource data.
|
||||||
*
|
*
|
||||||
* @param array $search
|
* @param string $search
|
||||||
*
|
*
|
||||||
* @return \CodeIgniter\Database\BaseBuilder
|
* @return \CodeIgniter\Database\BaseBuilder
|
||||||
*/
|
*/
|
||||||
public function getResource($search = [])
|
public function getResource(string $search = "", $cliente_id = -1)
|
||||||
{
|
{
|
||||||
$builder = $this->db
|
$builder = $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
@ -62,17 +61,14 @@ class ClientePlantillaPreciosModel extends \App\Models\BaseModel
|
|||||||
);
|
);
|
||||||
|
|
||||||
$builder->where('t1.is_deleted', 0);
|
$builder->where('t1.is_deleted', 0);
|
||||||
|
|
||||||
|
|
||||||
if (empty($search))
|
return empty($search)
|
||||||
return $builder;
|
? $builder
|
||||||
else {
|
: $builder
|
||||||
$builder->groupStart();
|
->groupStart()
|
||||||
foreach ($search as $col_search) {
|
->like("t1.nombre", $search)
|
||||||
$builder->like(self::SORTABLE[$col_search[0]], $col_search[2]);
|
->groupEnd();
|
||||||
}
|
|
||||||
$builder->groupEnd();
|
|
||||||
return $builder;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,14 +14,14 @@ class ClientePreciosModel extends \App\Models\BaseModel
|
|||||||
protected $useAutoIncrement = true;
|
protected $useAutoIncrement = true;
|
||||||
|
|
||||||
const SORTABLE = [
|
const SORTABLE = [
|
||||||
0 => "t1.id",
|
0 => "t1.tipo",
|
||||||
1 => "t1.tipo",
|
1 => "t1.tipo_maquina",
|
||||||
2 => "t1.tipo_maquina",
|
2 => "t1.tipo_impresion",
|
||||||
3 => "t1.tipo_impresion",
|
3 => "t1.tiempo_min",
|
||||||
4 => "t1.tiempo_min",
|
4 => "t1.tiempo_max",
|
||||||
5 => "t1.tiempo_max",
|
5 => "t1.precio_hora",
|
||||||
6 => "t1.precio_hora",
|
6 => "t1.margen",
|
||||||
7 => "t1.margen",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $allowedFields = [
|
protected $allowedFields = [
|
||||||
@ -153,7 +153,7 @@ class ClientePreciosModel extends \App\Models\BaseModel
|
|||||||
|
|
||||||
// Se cargan los valores de la plantilla
|
// Se cargan los valores de la plantilla
|
||||||
$plantillaModel = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
|
$plantillaModel = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
|
||||||
$values = $plantillaModel->getResource([],$plantilla_id)->get()->getResultObject();
|
$values = $plantillaModel->getResource($plantilla_id)->get()->getResultObject();
|
||||||
foreach ($values as $value) {
|
foreach ($values as $value) {
|
||||||
$this->db
|
$this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
@ -178,6 +178,7 @@ class ClientePreciosModel extends \App\Models\BaseModel
|
|||||||
|
|
||||||
function update_from_plantilla($plantilla_id = 0){
|
function update_from_plantilla($plantilla_id = 0){
|
||||||
|
|
||||||
|
$session = session();
|
||||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||||
$date_value = $datetime->format('Y-m-d H:i:s');
|
$date_value = $datetime->format('Y-m-d H:i:s');
|
||||||
|
|
||||||
@ -186,7 +187,6 @@ class ClientePreciosModel extends \App\Models\BaseModel
|
|||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->select("t1.cliente_id AS id")
|
->select("t1.cliente_id AS id")
|
||||||
->where('t1.plantilla_id', $plantilla_id)
|
->where('t1.plantilla_id', $plantilla_id)
|
||||||
->where('t1.is_deleted', 0)
|
|
||||||
->distinct()
|
->distinct()
|
||||||
->get()->getResultObject();
|
->get()->getResultObject();
|
||||||
|
|
||||||
@ -200,7 +200,7 @@ class ClientePreciosModel extends \App\Models\BaseModel
|
|||||||
|
|
||||||
// Se cargan los valores de la plantilla
|
// Se cargan los valores de la plantilla
|
||||||
$plantillaModel = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
|
$plantillaModel = model('App\Models\Clientes\ClientePlantillaPreciosLineasModel');
|
||||||
$values = $plantillaModel->getResource([], $plantilla_id)->get()->getResultObject();
|
$values = $plantillaModel->getResource($plantilla_id)->get()->getResultObject();
|
||||||
foreach ($values as $value) {
|
foreach ($values as $value) {
|
||||||
$this->db
|
$this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
@ -215,7 +215,7 @@ class ClientePreciosModel extends \App\Models\BaseModel
|
|||||||
->set('margen', $value->margen)
|
->set('margen', $value->margen)
|
||||||
->set('user_updated_id', $value->user_updated_id)
|
->set('user_updated_id', $value->user_updated_id)
|
||||||
->set('updated_at', $value->updated_at)
|
->set('updated_at', $value->updated_at)
|
||||||
->set('user_created_id', auth()->user()->id)
|
->set('user_created_id', $session->id_user)
|
||||||
->set('created_at', $date_value)
|
->set('created_at', $date_value)
|
||||||
->insert();
|
->insert();
|
||||||
}
|
}
|
||||||
@ -256,7 +256,7 @@ class ClientePreciosModel extends \App\Models\BaseModel
|
|||||||
*
|
*
|
||||||
* @return \CodeIgniter\Database\BaseBuilder
|
* @return \CodeIgniter\Database\BaseBuilder
|
||||||
*/
|
*/
|
||||||
public function getResource($search = [], $cliente_id = -1)
|
public function getResource($cliente_id = -1)
|
||||||
{
|
{
|
||||||
$builder = $this->db
|
$builder = $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
@ -271,44 +271,12 @@ class ClientePreciosModel extends \App\Models\BaseModel
|
|||||||
|
|
||||||
$builder->where('t1.is_deleted', 0);
|
$builder->where('t1.is_deleted', 0);
|
||||||
$builder->where('t1.cliente_id', $cliente_id);
|
$builder->where('t1.cliente_id', $cliente_id);
|
||||||
|
|
||||||
if (empty($search))
|
|
||||||
return $builder;
|
|
||||||
else {
|
|
||||||
$builder->groupStart();
|
|
||||||
foreach ($search as $col_search) {
|
|
||||||
if ($col_search[0] > 0 && $col_search[0] < 4)
|
|
||||||
$builder->where(self::SORTABLE[$col_search[0]], $col_search[2]);
|
|
||||||
else
|
|
||||||
$builder->like(self::SORTABLE[$col_search[0]], $col_search[2]);
|
|
||||||
}
|
|
||||||
$builder->groupEnd();
|
|
||||||
return $builder;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getPlantilla($cliente_id = -1){
|
|
||||||
$builder = $this->db
|
|
||||||
->table($this->table . " t1")
|
|
||||||
->select(
|
|
||||||
"t1.plantilla_id AS id, t2.nombre AS nombre"
|
|
||||||
);
|
|
||||||
|
|
||||||
$builder->where('t1.is_deleted', 0);
|
|
||||||
$builder->where('t1.cliente_id', $cliente_id);
|
|
||||||
$builder->join("cliente_plantilla_precios t2", "t1.plantilla_id = t2.id", "left");
|
|
||||||
$builder->limit(1);
|
|
||||||
|
|
||||||
$values = $builder->get()->getResultArray();
|
return $builder;
|
||||||
if(count($values)>0){
|
|
||||||
return $values[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
return [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function checkIntervals($data = [], $id_linea = null, $cliente_id = null){
|
public function checkIntervals($data = [], $id_linea = null, $cliente_id = null){
|
||||||
|
|
||||||
helper('general');
|
helper('general');
|
||||||
|
|||||||
@ -313,7 +313,7 @@ class PapelGenericoModel extends \App\Models\BaseModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getPapelCliente($tipo, $is_cubierta = false, $selected_papel_id = null, $tapa_dura = null, $papel_especial = false, $POD = null)
|
public function getPapelCliente($tipo, $is_cubierta = false, $selected_papel_id = null, $papel_especial = false)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
1.-> Tipo impresion
|
1.-> Tipo impresion
|
||||||
@ -322,13 +322,6 @@ class PapelGenericoModel extends \App\Models\BaseModel
|
|||||||
4.-> papeles genericos que aparecen en esos papeles impresion
|
4.-> papeles genericos que aparecen en esos papeles impresion
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($POD == true && ($tipo == 'color' || $tipo == 'negro')) {
|
|
||||||
if($tipo == 'color')
|
|
||||||
$tipo = 'colorhq';
|
|
||||||
else if($tipo == 'negro')
|
|
||||||
$tipo = 'negrohq';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($selected_papel_id != null) {
|
if ($selected_papel_id != null) {
|
||||||
$builder = $this->db
|
$builder = $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
@ -389,9 +382,6 @@ class PapelGenericoModel extends \App\Models\BaseModel
|
|||||||
if ($is_cubierta == true) {
|
if ($is_cubierta == true) {
|
||||||
$builder->where("t2.cubierta", 1);
|
$builder->where("t2.cubierta", 1);
|
||||||
$builder->where("t5.uso", 'cubierta');
|
$builder->where("t5.uso", 'cubierta');
|
||||||
if($tapa_dura == true){
|
|
||||||
$builder->where("t2.use_for_tapa_dura", 1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$builder->where("t2.interior", 1);
|
$builder->where("t2.interior", 1);
|
||||||
$builder->where("t5.uso", 'interior');
|
$builder->where("t5.uso", 'interior');
|
||||||
@ -404,21 +394,10 @@ class PapelGenericoModel extends \App\Models\BaseModel
|
|||||||
if ($papel_especial == true) {
|
if ($papel_especial == true) {
|
||||||
$builder->where("t1.show_in_client_special", 1);
|
$builder->where("t1.show_in_client_special", 1);
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
$builder->where("t1.show_in_client_special", 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($tipo == 'colorhq' || $tipo == 'negrohq') {
|
if ($tipo == 'colorhq' || $tipo == 'negrohq') {
|
||||||
$builder->where("t2.rotativa", 0);
|
$builder->where("t2.rotativa", 0);
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
if($POD == false){
|
|
||||||
$builder->where("t2.rotativa", 1);
|
|
||||||
}
|
|
||||||
else if ($POD == true){
|
|
||||||
$builder->where("t2.rotativa", 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ($selected_papel_id != null)
|
if ($selected_papel_id != null)
|
||||||
|
|||||||
@ -20,13 +20,12 @@ class PapelImpresionModel extends \App\Models\BaseModel
|
|||||||
4 => "t1.bn",
|
4 => "t1.bn",
|
||||||
5 => "t1.color",
|
5 => "t1.color",
|
||||||
6 => "t1.cubierta",
|
6 => "t1.cubierta",
|
||||||
7 => "t1.use_for_tapa_dura",
|
7 => "t1.sobrecubierta",
|
||||||
8 => "t1.sobrecubierta",
|
8 => "t1.guardas",
|
||||||
9 => "t1.guardas",
|
9 => "t1.inkjet",
|
||||||
10 => "t1.inkjet",
|
10 => "t1.rotativa",
|
||||||
11 => "t1.rotativa",
|
11 => "t1.isActivo",
|
||||||
12 => "t1.isActivo",
|
12 => "t1.use_in_client",
|
||||||
13 => "t1.use_in_client",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -49,7 +48,6 @@ class PapelImpresionModel extends \App\Models\BaseModel
|
|||||||
"rotativa",
|
"rotativa",
|
||||||
"isActivo",
|
"isActivo",
|
||||||
"use_in_client",
|
"use_in_client",
|
||||||
"use_for_tapa_dura",
|
|
||||||
"deleted_at",
|
"deleted_at",
|
||||||
"is_deleted",
|
"is_deleted",
|
||||||
"user_updated_id",
|
"user_updated_id",
|
||||||
@ -154,8 +152,7 @@ class PapelImpresionModel extends \App\Models\BaseModel
|
|||||||
->select(
|
->select(
|
||||||
"t1.id AS id, t1.nombre AS nombre, t1.defecto AS defecto, t1.referencia AS referencia, t1.mano AS mano,
|
"t1.id AS id, t1.nombre AS nombre, t1.defecto AS defecto, t1.referencia AS referencia, t1.mano AS mano,
|
||||||
t1.espesor AS espesor, t1.gramaje AS gramaje, t1.interior AS interior, t1.precio_tonelada AS precio_tonelada,
|
t1.espesor AS espesor, t1.gramaje AS gramaje, t1.interior AS interior, t1.precio_tonelada AS precio_tonelada,
|
||||||
t1.bn AS bn, t1.color AS color, t1.cubierta AS cubierta, t1.use_for_tapa_dura AS use_for_tapa_dura,
|
t1.bn AS bn, t1.color AS color, t1.cubierta AS cubierta, t1.sobrecubierta AS sobrecubierta, t1.guardas AS guardas,
|
||||||
t1.sobrecubierta AS sobrecubierta, t1.guardas AS guardas,
|
|
||||||
t1.inkjet AS inkjet, t1.rotativa AS rotativa,
|
t1.inkjet AS inkjet, t1.rotativa AS rotativa,
|
||||||
t1.isActivo AS isActivo, t2.nombre AS papel_generico_id,
|
t1.isActivo AS isActivo, t2.nombre AS papel_generico_id,
|
||||||
t1.use_in_client AS use_in_client"
|
t1.use_in_client AS use_in_client"
|
||||||
|
|||||||
@ -1,143 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models\Configuracion;
|
|
||||||
|
|
||||||
use App\Entities\Configuracion\ServicioClienteEntity;
|
|
||||||
use CodeIgniter\Database\BaseBuilder;
|
|
||||||
use CodeIgniter\Model;
|
|
||||||
|
|
||||||
class ServicioClienteModel extends Model
|
|
||||||
{
|
|
||||||
|
|
||||||
protected $table = 'servicios_cliente';
|
|
||||||
protected $primaryKey = 'id';
|
|
||||||
protected $useAutoIncrement = true;
|
|
||||||
protected $returnType = ServicioClienteEntity::class;
|
|
||||||
protected $useSoftDeletes = true;
|
|
||||||
protected $protectFields = true;
|
|
||||||
protected $allowedFields = [
|
|
||||||
"nombre",
|
|
||||||
"code",
|
|
||||||
];
|
|
||||||
|
|
||||||
protected bool $allowEmptyInserts = false;
|
|
||||||
protected bool $updateOnlyChanged = true;
|
|
||||||
|
|
||||||
protected array $casts = [];
|
|
||||||
protected array $castHandlers = [];
|
|
||||||
|
|
||||||
// Dates
|
|
||||||
protected $useTimestamps = true;
|
|
||||||
protected $dateFormat = 'datetime';
|
|
||||||
protected $createdField = 'created_at';
|
|
||||||
protected $updatedField = 'updated_at';
|
|
||||||
protected $deletedField = 'deleted_at';
|
|
||||||
|
|
||||||
// Validation
|
|
||||||
protected $validationRules = [];
|
|
||||||
protected $validationMessages = [];
|
|
||||||
protected $skipValidation = false;
|
|
||||||
protected $cleanValidationRules = true;
|
|
||||||
|
|
||||||
// Callbacks
|
|
||||||
protected $allowCallbacks = true;
|
|
||||||
protected $beforeInsert = [];
|
|
||||||
protected $afterInsert = [];
|
|
||||||
protected $beforeUpdate = [];
|
|
||||||
protected $afterUpdate = [];
|
|
||||||
protected $beforeFind = [];
|
|
||||||
protected $afterFind = [];
|
|
||||||
protected $beforeDelete = [];
|
|
||||||
protected $afterDelete = [];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query para datatable
|
|
||||||
*
|
|
||||||
* @return BaseBuilder
|
|
||||||
*/
|
|
||||||
public function getQueryDatatable(): BaseBuilder
|
|
||||||
{
|
|
||||||
$q = $this->builder()->select(["id", "nombre", "code", "created_at"])->where("deleted_at", null);
|
|
||||||
return $q;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Actualiza la tarifa de acabado `lg_tarifas_acabado` si ya existe una asociada o inserta si ya no existe.
|
|
||||||
*
|
|
||||||
* @param integer $servicio_cliente_id
|
|
||||||
* @param integer $tarifa_acabado_id
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function upsertTarifaAcabado(int $servicio_cliente_id, int $tarifa_acabado_id): bool
|
|
||||||
{
|
|
||||||
$servicioClienteTareaModel = model(ServicioClienteTareaModel::class);
|
|
||||||
$q = $servicioClienteTareaModel
|
|
||||||
->where("servicio_cliente_id", $servicio_cliente_id);
|
|
||||||
if ($q->countAllResults() > 0) {
|
|
||||||
$this->detachTarifas($servicio_cliente_id);
|
|
||||||
}
|
|
||||||
$r = $this->attachTarifaAcabado($servicio_cliente_id, $tarifa_acabado_id);
|
|
||||||
return $r;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Actualiza la tarifa de manipulado `lg_tarifas_manipulado` si ya existe una asociada o inserta si ya no existe.
|
|
||||||
*
|
|
||||||
* @param integer $servicio_cliente_id
|
|
||||||
* @param integer $tarifa_manipulado_id
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function upsertTarifaManipulado(int $servicio_cliente_id, int $tarifa_manipulado_id): bool
|
|
||||||
{
|
|
||||||
$servicioClienteTareaModel = model(ServicioClienteTareaModel::class);
|
|
||||||
$q = $servicioClienteTareaModel
|
|
||||||
->where("servicio_cliente_id", $servicio_cliente_id);
|
|
||||||
if ($q->countAllResults() > 0) {
|
|
||||||
$this->detachTarifas($servicio_cliente_id);
|
|
||||||
}
|
|
||||||
$r = $this->attachTarifaManipulado($servicio_cliente_id, $tarifa_manipulado_id);
|
|
||||||
return $r;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Asocia tarifa de acabado a servicio cliente
|
|
||||||
*
|
|
||||||
* @param integer $servicio_cliente_id
|
|
||||||
* @param integer $tarifa_acabado_id
|
|
||||||
* @return integer
|
|
||||||
*/
|
|
||||||
public function attachTarifaAcabado(int $servicio_cliente_id, int $tarifa_acabado_id): int
|
|
||||||
{
|
|
||||||
$servicioClienteTareaModel = model(ServicioClienteTareaModel::class);
|
|
||||||
$id = $servicioClienteTareaModel->insert([
|
|
||||||
"servicio_cliente_id" => $servicio_cliente_id,
|
|
||||||
"tarifa_acabado_id" => $tarifa_acabado_id
|
|
||||||
]);
|
|
||||||
return $id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Asocia tarifa de manipulado a servicio cliente
|
|
||||||
*
|
|
||||||
* @param integer $servicio_cliente_id
|
|
||||||
* @param integer $tarifa_manipulado_id
|
|
||||||
* @return integer
|
|
||||||
*/
|
|
||||||
public function attachTarifaManipulado(int $servicio_cliente_id, int $tarifa_manipulado_id): int
|
|
||||||
{
|
|
||||||
$servicioClienteTareaModel = model(ServicioClienteTareaModel::class);
|
|
||||||
$id = $servicioClienteTareaModel->insert([
|
|
||||||
"servicio_cliente_id" => $servicio_cliente_id,
|
|
||||||
"tarifa_manipulado_id" => $tarifa_manipulado_id
|
|
||||||
]);
|
|
||||||
return $id;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Elimina todas las tarifas asociadas a un servicio cliente
|
|
||||||
*
|
|
||||||
* @param integer $servicio_cliente_id
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function detachTarifas(int $servicio_cliente_id): bool
|
|
||||||
{
|
|
||||||
$servicioClienteTareaModel = model(ServicioClienteTareaModel::class);
|
|
||||||
$s = $servicioClienteTareaModel->where("servicio_cliente_id", $servicio_cliente_id)->delete();
|
|
||||||
return $s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models\Configuracion;
|
|
||||||
|
|
||||||
use CodeIgniter\Database\BaseBuilder;
|
|
||||||
use CodeIgniter\Model;
|
|
||||||
|
|
||||||
class ServicioClienteTareaModel extends Model
|
|
||||||
{
|
|
||||||
protected $table = 'servicio_cliente_tareas';
|
|
||||||
protected $primaryKey = 'id';
|
|
||||||
protected $useAutoIncrement = true;
|
|
||||||
protected $returnType = 'array';
|
|
||||||
protected $useSoftDeletes = true;
|
|
||||||
protected $protectFields = true;
|
|
||||||
protected $allowedFields = [
|
|
||||||
"servicio_cliente_id",
|
|
||||||
"tarifa_acabado_id",
|
|
||||||
"tarifa_manipulado_id",
|
|
||||||
];
|
|
||||||
|
|
||||||
protected bool $allowEmptyInserts = false;
|
|
||||||
protected bool $updateOnlyChanged = true;
|
|
||||||
|
|
||||||
protected array $casts = [];
|
|
||||||
protected array $castHandlers = [];
|
|
||||||
|
|
||||||
// Dates
|
|
||||||
protected $useTimestamps = true;
|
|
||||||
protected $dateFormat = 'datetime';
|
|
||||||
protected $createdField = 'created_at';
|
|
||||||
protected $updatedField = 'updated_at';
|
|
||||||
protected $deletedField = 'deleted_at';
|
|
||||||
|
|
||||||
// Validation
|
|
||||||
protected $validationRules = [];
|
|
||||||
protected $validationMessages = [];
|
|
||||||
protected $skipValidation = false;
|
|
||||||
protected $cleanValidationRules = true;
|
|
||||||
|
|
||||||
// Callbacks
|
|
||||||
protected $allowCallbacks = true;
|
|
||||||
protected $beforeInsert = [];
|
|
||||||
protected $afterInsert = [];
|
|
||||||
protected $beforeUpdate = [];
|
|
||||||
protected $afterUpdate = [];
|
|
||||||
protected $beforeFind = [];
|
|
||||||
protected $afterFind = [];
|
|
||||||
protected $beforeDelete = [];
|
|
||||||
protected $afterDelete = [];
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,124 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models\OrdenTrabajo;
|
|
||||||
|
|
||||||
use App\Entities\Presupuestos\OrdenTrabajoEntity;
|
|
||||||
use CodeIgniter\Database\BaseBuilder;
|
|
||||||
use CodeIgniter\Model;
|
|
||||||
class OrdenTrabajoModel extends Model
|
|
||||||
{
|
|
||||||
protected $table = 'ordenes_trabajo';
|
|
||||||
protected $primaryKey = 'id';
|
|
||||||
protected $useAutoIncrement = true;
|
|
||||||
protected $returnType = OrdenTrabajoEntity::class;
|
|
||||||
protected $useSoftDeletes = true;
|
|
||||||
protected $protectFields = true;
|
|
||||||
protected $allowedFields = [
|
|
||||||
"pedido_id",
|
|
||||||
"maquina_orden_negro_id",
|
|
||||||
"maquina_orden_color_id",
|
|
||||||
"maquina_orden_portada_id",
|
|
||||||
"maquina_orden_cubierta_id",
|
|
||||||
"negro_forma_id",
|
|
||||||
"color_forma_id",
|
|
||||||
"portada_forma_id",
|
|
||||||
"cubierta_forma_id",
|
|
||||||
"tirada",
|
|
||||||
"negro_pliegos_pedido",
|
|
||||||
"color_pliegos_pedido",
|
|
||||||
"portada_pliegos_pedido",
|
|
||||||
"cubierta_pliegos_pedido",
|
|
||||||
"negro_clicks_pedido",
|
|
||||||
"color_clicks_pedido",
|
|
||||||
"portada_clicks_pedido",
|
|
||||||
"cubierta_clicks_pedido",
|
|
||||||
"pliegos1",
|
|
||||||
"paginas1",
|
|
||||||
"pliegos2",
|
|
||||||
"paginas2",
|
|
||||||
"negro_proveedor_nombre",
|
|
||||||
"color_proveedor_nombre",
|
|
||||||
"portada_proveedor_nombre",
|
|
||||||
"corte_pie",
|
|
||||||
"lomo",
|
|
||||||
"tipo_entrada",
|
|
||||||
"fecha_entrega_real_warning",
|
|
||||||
"fecha_entrega_warning",
|
|
||||||
"fecha_entrega_warning_revised",
|
|
||||||
"ferro_disponible",
|
|
||||||
"ferro_disponible_thread_id",
|
|
||||||
"ferro_cp",
|
|
||||||
"ferro_proveedor",
|
|
||||||
"ferro_tracking",
|
|
||||||
"pre_formato",
|
|
||||||
"pre_lomo",
|
|
||||||
"pre_solapa",
|
|
||||||
"pre_isbn",
|
|
||||||
"pre_codbarras",
|
|
||||||
"pre_imposicion",
|
|
||||||
"pre_imprimir",
|
|
||||||
"pre_faltan_materiales",
|
|
||||||
"pre_faltan_materiales_note",
|
|
||||||
"progreso",
|
|
||||||
"message_production_send",
|
|
||||||
"finalizado",
|
|
||||||
"comentarios"
|
|
||||||
];
|
|
||||||
|
|
||||||
protected bool $allowEmptyInserts = false;
|
|
||||||
protected bool $updateOnlyChanged = true;
|
|
||||||
|
|
||||||
protected array $casts = [];
|
|
||||||
protected array $castHandlers = [];
|
|
||||||
|
|
||||||
// Dates
|
|
||||||
protected $useTimestamps = true;
|
|
||||||
protected $dateFormat = 'datetime';
|
|
||||||
protected $createdField = 'created_at';
|
|
||||||
protected $updatedField = 'updated_at';
|
|
||||||
protected $deletedField = 'deleted_at';
|
|
||||||
|
|
||||||
// Validation
|
|
||||||
protected $validationRules = [];
|
|
||||||
protected $validationMessages = [];
|
|
||||||
protected $skipValidation = false;
|
|
||||||
protected $cleanValidationRules = true;
|
|
||||||
|
|
||||||
// Callbacks
|
|
||||||
protected $allowCallbacks = true;
|
|
||||||
protected $beforeInsert = [];
|
|
||||||
protected $afterInsert = [];
|
|
||||||
protected $beforeUpdate = [];
|
|
||||||
protected $afterUpdate = [];
|
|
||||||
protected $beforeFind = [];
|
|
||||||
protected $afterFind = [];
|
|
||||||
protected $beforeDelete = [];
|
|
||||||
protected $afterDelete = [];
|
|
||||||
|
|
||||||
public function getDatatableQuery() : BaseBuilder
|
|
||||||
{
|
|
||||||
$q = $this->builder("ordenes_trabajo ot")
|
|
||||||
->select([
|
|
||||||
"pedidos.id",
|
|
||||||
"orden_trabajo_dates.fecha_encuadernado_at",
|
|
||||||
"clientes.nombre as client_name",
|
|
||||||
"presupuestos.titulo as presupuesto_title",
|
|
||||||
"tp.codigo as tipo_presupuesto_impresion",
|
|
||||||
"ubicaciones.nombre as ubicacion_name",
|
|
||||||
])
|
|
||||||
->join("orden_trabajo_dates otdates","otdates.orden_trabajo_id = ot.id","left")
|
|
||||||
->join("pedidos","pedidos.id = ot.pedido_id","left")
|
|
||||||
->join("pedidos_linea","pedidos.id = pedidos_linea.pedido_id","left")
|
|
||||||
->join("presupuestos","presupuestos.id = pedidos_linea.presupuesto_id","left")
|
|
||||||
->join("clientes","clientes.id = presupuestos.cliente_id","left")
|
|
||||||
->join("tipos_presupuestos tp","presupuestos.tipo_impresion_id = tp.id","left")
|
|
||||||
->join("ubicaciones","ubicaciones.id = pedidos_linea.ubicacion_id","left")
|
|
||||||
->groupBy("ot.id");
|
|
||||||
return $q;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function updateMaquinas(OrdenTrabajoEntity $ot)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Models\Pedidos;
|
namespace App\Models\Pedidos;
|
||||||
|
|
||||||
use App\Entities\Presupuestos\OrdenTrabajoEntity;
|
|
||||||
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
|
||||||
|
|
||||||
use function PHPSTORM_META\map;
|
use function PHPSTORM_META\map;
|
||||||
|
|
||||||
class PedidoModel extends \App\Models\BaseModel
|
class PedidoModel extends \App\Models\BaseModel
|
||||||
@ -93,7 +90,7 @@ class PedidoModel extends \App\Models\BaseModel
|
|||||||
|
|
||||||
return $lineasPresupuesto;
|
return $lineasPresupuesto;
|
||||||
}
|
}
|
||||||
public function getPedidoPresupuestoTipoImpresion(int $presupuesto_id): array|object|null
|
public function getPedidoPresupuestoTipoImpresion(int $presupuesto_id) : array|object|null
|
||||||
{
|
{
|
||||||
$q = $this->db->table($this->table)
|
$q = $this->db->table($this->table)
|
||||||
->select(
|
->select(
|
||||||
@ -188,51 +185,15 @@ class PedidoModel extends \App\Models\BaseModel
|
|||||||
public function getPedidoPresupuestoFicheros($pedido_id)
|
public function getPedidoPresupuestoFicheros($pedido_id)
|
||||||
{
|
{
|
||||||
$query = $this->db->table($this->table)
|
$query = $this->db->table($this->table)
|
||||||
->select([
|
->select([
|
||||||
'presupuesto_ficheros.nombre as fileName',
|
'presupuesto_ficheros.nombre as fileName',
|
||||||
'presupuesto_ficheros.file_path as filePath'
|
'presupuesto_ficheros.file_path as filePath'
|
||||||
])
|
])
|
||||||
->join('pedidos_linea', 'pedidos_linea.id = pedidos.id', 'left')
|
->join('pedidos_linea', 'pedidos_linea.id = pedidos.id', 'left')
|
||||||
->join('presupuestos', 'presupuestos.id = pedidos_linea.presupuesto_id', 'left')
|
->join('presupuestos', 'presupuestos.id = pedidos_linea.presupuesto_id', 'left')
|
||||||
->join('presupuesto_ficheros', 'presupuesto_ficheros.presupuesto_id = presupuestos.id', 'left')
|
->join('presupuesto_ficheros', 'presupuesto_ficheros.presupuesto_id = presupuestos.id', 'left')
|
||||||
->where('pedidos.id', $pedido_id);
|
->where('pedidos.id', $pedido_id);
|
||||||
$presupuesto_ficheros = $query->get()->getFirstRow();
|
$presupuesto_ficheros = $query->get()->getFirstRow();
|
||||||
return $presupuesto_ficheros;
|
return $presupuesto_ficheros;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Crea una orden de trabajo asociada al pedido
|
|
||||||
*
|
|
||||||
* @param integer $pedido_id
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function createOrdenTrabajo(int $pedido_id)
|
|
||||||
{
|
|
||||||
$otModel = model(OrdenTrabajoModel::class);
|
|
||||||
$ot = new OrdenTrabajoEntity(["pedido_id" => $pedido_id]);
|
|
||||||
$existOt = $this->hasOrdenTrabajo($pedido_id);
|
|
||||||
if ($existOt) {
|
|
||||||
$ot = $otModel->find($pedido_id);
|
|
||||||
return $ot;
|
|
||||||
}
|
|
||||||
$otModel->updateMaquinas($ot);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Comprueba si el pedido tiene ya una orden de trabajo asociada
|
|
||||||
*
|
|
||||||
* @param integer $pedido_id
|
|
||||||
* @return boolean
|
|
||||||
*/
|
|
||||||
public function hasOrdenTrabajo(int $pedido_id): bool
|
|
||||||
{
|
|
||||||
$hasOrdenTrabajo = false;
|
|
||||||
$q = $this->builder()->select("orden_trabajo.pedido_id")
|
|
||||||
->join("ordenes_trabajo", "ordenes_trabajo.pedido_id = pedidos.id", "left")
|
|
||||||
->where("ordenes_trabajo.pedido_id", $pedido_id)->countAllResults();
|
|
||||||
if ($q > 0) {
|
|
||||||
$hasOrdenTrabajo = true;
|
|
||||||
}
|
|
||||||
return $hasOrdenTrabajo;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -248,7 +248,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\BaseModel
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPrecioTarifaHoras($tarifa_encuadernacion_id, $paginas, $tirada, $proveedor_id, $POD, $paginas_cuadernillo = 32){
|
public function getPrecioTarifaHoras($tarifa_encuadernacion_id, $paginas, $tirada, $proveedor_id, $POD, $paginas_cuadernillo = null){
|
||||||
|
|
||||||
$modelTarifa = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
$modelTarifa = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
||||||
|
|
||||||
|
|||||||
@ -426,7 +426,7 @@ class PresupuestoModel extends \App\Models\BaseModel
|
|||||||
'solapas' => $data['cubierta']['solapasCubierta'] == 0 ? 0 : 1,
|
'solapas' => $data['cubierta']['solapasCubierta'] == 0 ? 0 : 1,
|
||||||
'lomo_redondo' => $data['cubierta']['lomoRedondo'] == 0 ? 0 : 1,
|
'lomo_redondo' => $data['cubierta']['lomoRedondo'] == 0 ? 0 : 1,
|
||||||
'cabezada' => $data['cubierta']['cabezada'] == 0 ? 0 : 1,
|
'cabezada' => $data['cubierta']['cabezada'] == 0 ? 0 : 1,
|
||||||
'solapas_ancho' => $data['cubierta']['solapasCubierta'] > 0 ? $data['cubierta']['solapasCubierta'] : 0,
|
'solapas_ancho' => $data['cubierta']['solapasCubierta'] == 0 ? $data['cubierta']['solapasCubierta'] : 0,
|
||||||
'solapas_sobrecubierta' => !$data['sobrecubierta'] ? 0 : 1,
|
'solapas_sobrecubierta' => !$data['sobrecubierta'] ? 0 : 1,
|
||||||
'solapas_ancho_sobrecubierta' => !$data['sobrecubierta'] ? 0 : $data['sobrecubierta']['solapas'],
|
'solapas_ancho_sobrecubierta' => !$data['sobrecubierta'] ? 0 : $data['sobrecubierta']['solapas'],
|
||||||
'cosido' => $is_cosido,
|
'cosido' => $is_cosido,
|
||||||
|
|||||||
@ -79,7 +79,6 @@ class TipoPresupuestoServiciosDefectoModel extends \App\Models\BaseModel
|
|||||||
$where = "(t1.solapas IS NULL OR t1.solapas='" . $solapas . "')";
|
$where = "(t1.solapas IS NULL OR t1.solapas='" . $solapas . "')";
|
||||||
$builder->where($where);
|
$builder->where($where);
|
||||||
|
|
||||||
$builder->where("t1.is_deleted", 0);
|
|
||||||
$builder->where("t2.is_deleted", 0);
|
$builder->where("t2.is_deleted", 0);
|
||||||
$builder->select("t1.tarifa_id AS tarifa_id, t2.nombre AS tarifa_nombre");
|
$builder->select("t1.tarifa_id AS tarifa_id, t2.nombre AS tarifa_nombre");
|
||||||
|
|
||||||
|
|||||||
@ -91,4 +91,5 @@ class UserModel extends ShieldUserModel
|
|||||||
return $result === null;
|
return $result === null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
18
ci4/app/Models/UsersImportModel.php
Normal file
18
ci4/app/Models/UsersImportModel.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Models\BaseModel;
|
||||||
|
|
||||||
|
class UsersImportModel extends BaseModel
|
||||||
|
{
|
||||||
|
protected $table = 'users_old';
|
||||||
|
protected $primaryKey = 'id';
|
||||||
|
|
||||||
|
// Método para asegurar que los resultados se devuelvan como objetos
|
||||||
|
protected $returnType = 'object'; // Esto hace que todas las consultas devuelvan objetos por defecto
|
||||||
|
|
||||||
|
// Habilitar SoftDeletes
|
||||||
|
protected $useSoftDeletes = true;
|
||||||
|
protected $deletedField = 'deleted_at';
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,14 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Services;
|
|
||||||
|
|
||||||
use App\Models\Presupuestos\PresupuestoModel;
|
|
||||||
use CodeIgniter\Config\BaseService;
|
|
||||||
|
|
||||||
class MessageService extends BaseService
|
|
||||||
{
|
|
||||||
public static function get_chat_title_from_presupuesto(int $presuesto_id,?string $department_name = null) : string
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -416,17 +416,6 @@ class PresupuestoClienteService extends BaseService
|
|||||||
return $values;
|
return $values;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getServiciosManipuladoDefault($data)
|
|
||||||
{
|
|
||||||
|
|
||||||
$tirada = $data['tirada'] ?? -1;
|
|
||||||
$anchoDesarrollo = $data['anchoDesarrollo'] ?? -1;
|
|
||||||
|
|
||||||
/*$model = model('App\Models\Presupuestos\PresupuestoEncuadernacionesModel');
|
|
||||||
$values = $model->initPresupuesto($tipo_impresion_id, $solapas, $tirada, $paginas, $ancho, $alto, $POD, $paginasCuadernillo);*/
|
|
||||||
//return $values;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getServiciosManipulado($data)
|
public static function getServiciosManipulado($data)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -523,11 +512,6 @@ class PresupuestoClienteService extends BaseService
|
|||||||
$linea_rotativa = array_merge($linea_rotativa, $lineas);
|
$linea_rotativa = array_merge($linea_rotativa, $lineas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$linea_rotativa = array_filter($linea_rotativa, function($item) {
|
|
||||||
return count($item['fields']['num_formas']) > 1;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (count($linea_rotativa) > 0) {
|
if (count($linea_rotativa) > 0) {
|
||||||
|
|
||||||
usort(
|
usort(
|
||||||
|
|||||||
@ -639,11 +639,11 @@ class PresupuestoService extends BaseService
|
|||||||
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h1_temp);
|
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h1_temp);
|
||||||
// Si son mas de 2 formas
|
// Si son mas de 2 formas
|
||||||
if (count($calles) > 0)
|
if (count($calles) > 0)
|
||||||
$h1 = ($h1_temp * $anchoForCalculo + 2 * $calles[0]->externas + ($h1_temp - 1) * $calles[0]->internas < (floatval($maquina->ancho))) ? $h1_temp : $h1_temp - 1;
|
$h1 = ($h1_temp * $anchoForCalculo + 2 * $calles[0]->externas + ($h1_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h1_temp : $h1_temp - 1;
|
||||||
else
|
else
|
||||||
$h1 = $h1_temp;
|
$h1 = $h1_temp;
|
||||||
|
|
||||||
$v1 = floor(floatval($maquina->alto_click) / $altoForCalculo);
|
$v1 = floor($maquina->alto_click / $altoForCalculo);
|
||||||
$formas_h = $h1 * $v1; //p1
|
$formas_h = $h1 * $v1; //p1
|
||||||
}
|
}
|
||||||
// verticales
|
// verticales
|
||||||
@ -651,10 +651,10 @@ class PresupuestoService extends BaseService
|
|||||||
|
|
||||||
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h2_temp);
|
$calles = (new \App\Models\Configuracion\MaquinasCallesModel())->getCallesForMaquina($maquina->maquina_id, $h2_temp);
|
||||||
if (count($calles) > 0)
|
if (count($calles) > 0)
|
||||||
$h2 = ($h2_temp * $altoForCalculo + 2 * $calles[0]->externas + ($h2_temp - 1) * $calles[0]->internas < (floatval($maquina->ancho))) ? $h2_temp : $h2_temp - 1;
|
$h2 = ($h2_temp * $altoForCalculo + 2 * $calles[0]->externas + ($h2_temp - 1) * $calles[0]->internas < ($maquina->ancho)) ? $h2_temp : $h2_temp - 1;
|
||||||
else
|
else
|
||||||
$h2 = $h2_temp;
|
$h2 = $h2_temp;
|
||||||
$v2 = floor(floatval($maquina->alto_click) / $anchoForCalculo);
|
$v2 = floor($maquina->alto_click / $anchoForCalculo);
|
||||||
$formas_v = $h2 * $v2; //p2
|
$formas_v = $h2 * $v2; //p2
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1061,16 +1061,16 @@ class PresupuestoService extends BaseService
|
|||||||
),
|
),
|
||||||
'cliente_id' => ($input_data['presupuesto'])->cliente_id,
|
'cliente_id' => ($input_data['presupuesto'])->cliente_id,
|
||||||
'datosTipolog' => [
|
'datosTipolog' => [
|
||||||
(object) array(
|
(object) array(
|
||||||
'negro' => $linea->rotativa_negro,
|
'negro' => $linea->rotativa_negro,
|
||||||
'cyan' => $linea->rotativa_cyan,
|
'cyan' => $linea->rotativa_cyan,
|
||||||
'magenta' => $linea->rotativa_magenta,
|
'magenta' => $linea->rotativa_magenta,
|
||||||
'amarillo' => $linea->rotativa_amarillo,
|
'amarillo' => $linea->rotativa_amarillo,
|
||||||
'cg' => $linea->rotativa_cg,
|
'cg' => $linea->rotativa_cg,
|
||||||
'gota_negro' => $linea->rotativa_gota_negro,
|
'gota_negro' => $linea->rotativa_gota_negro,
|
||||||
'gota_color' => $linea->rotativa_gota_color,
|
'gota_color' => $linea->rotativa_gota_color,
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
$comp_data = PresupuestoService::obtenerComparadorRotativa($datos);
|
$comp_data = PresupuestoService::obtenerComparadorRotativa($datos);
|
||||||
@ -1479,7 +1479,7 @@ class PresupuestoService extends BaseService
|
|||||||
// con el mismo proveedor
|
// con el mismo proveedor
|
||||||
else {
|
else {
|
||||||
if ($tarifaModel->isTarifaPorHoras($servicio->tarifa_encuadernado_id)) {
|
if ($tarifaModel->isTarifaPorHoras($servicio->tarifa_encuadernado_id)) {
|
||||||
$paginas_cuadernillo = $servicio->paginas_por_cuadernillo ?? 32;
|
$paginas_cuadernillo = $servicio->paginas_por_cuadernillo ?? null;
|
||||||
$nueva_tarifa = $model->getPrecioTarifaHoras(
|
$nueva_tarifa = $model->getPrecioTarifaHoras(
|
||||||
$servicio->tarifa_encuadernado_id,
|
$servicio->tarifa_encuadernado_id,
|
||||||
$input_data['paginas'],
|
$input_data['paginas'],
|
||||||
@ -1815,12 +1815,6 @@ class PresupuestoService extends BaseService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($uso == 'cubierta' || $uso == 'sobrecubierta') {
|
|
||||||
|
|
||||||
$linea['fields']['dimension_desarrollo']['ancho'] = $datosPedido->anchoExteriores;
|
|
||||||
$linea['fields']['dimension_desarrollo']['alto'] = $datosPedido->altoExteriores;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!array_key_exists('tipo_linea', $linea['fields'])) {
|
if (!array_key_exists('tipo_linea', $linea['fields'])) {
|
||||||
if ($isColor) {
|
if ($isColor) {
|
||||||
if ($isHq)
|
if ($isHq)
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
<div class="alert alert-success d-flex align-items-baseline d-none" role="alert" id="<?= $id ?>">
|
|
||||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
|
||||||
<i class="ti ti-sm icon-alert"></i>
|
|
||||||
</span>
|
|
||||||
<div class="d-flex flex-column ps-1">
|
|
||||||
<h5 class="alert-heading mb-2"></h5>
|
|
||||||
<div class="alert-body">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,153 +0,0 @@
|
|||||||
<div class="col-md-12" id="chat-direct-message" data-id="<?= $modelId ?>" data-user-id="<?= $userId ?>">
|
|
||||||
<div class="app-chat card overflow-hidden">
|
|
||||||
|
|
||||||
<div class="row g-0">
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Chat & Contacts -->
|
|
||||||
<div class="col app-chat-contacts app-sidebar flex-grow-0 overflow-hidden border-end"
|
|
||||||
id="app-chat-contacts">
|
|
||||||
|
|
||||||
<div class="sidebar-header">
|
|
||||||
|
|
||||||
<div class="d-flex align-items-center me-3 me-lg-0">
|
|
||||||
<?php if (auth()->user()->inGroup('admin')) { ?>
|
|
||||||
<div class="flex-shrink-0 avatar me-3">
|
|
||||||
<button title="<?= lang("Chat.new_participant") ?>" class="btn btn-primary btn-icon me-2 rounded-circle" id="btn-chat-add-participant"><span class="ti ti-sm ti-user-plus"></span></button>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<div class="flex-grow-1 input-group input-group-merge rounded-pill">
|
|
||||||
<span class="input-group-text" id="basic-addon-search31">
|
|
||||||
<i class="ti ti-search"></i>
|
|
||||||
</span>
|
|
||||||
<input type="text" class="form-control chat-search-input"
|
|
||||||
placeholder="Buscar..." aria-label="Buscar..."
|
|
||||||
aria-describedby="basic-addon-search31" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- <i class="ti ti-x cursor-pointer d-lg-none d-block position-absolute mt-2 me-1 top-0 end-0"
|
|
||||||
data-overlay data-bs-toggle="sidebar" data-target="#app-chat-contacts"></i> -->
|
|
||||||
</div>
|
|
||||||
<div class="sidebar-body">
|
|
||||||
|
|
||||||
<!-- CLIENTES -->
|
|
||||||
<ul class="list-unstyled chat-contact-list mb-0">
|
|
||||||
|
|
||||||
<li class="chat-contact-list-item chat-contact-list-item-title">
|
|
||||||
<h5 class="text-primary mb-0"><?= lang("Chat.participants") ?></h5>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<ul class="list-unstyled chat-contact-list mb-0" id="contact-list">
|
|
||||||
|
|
||||||
<div class="d-flex justify-content-center chat-loader">
|
|
||||||
<div class="sk-wave sk-primary ">
|
|
||||||
<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 class="sk-wave-rect"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- <li class="chat-contact-list-item">
|
|
||||||
<a class="d-flex align-items-center">
|
|
||||||
<div class="avatar d-block flex-shrink-0">
|
|
||||||
<span class="avatar-initial rounded-circle bg-label-primary">JJ</span>
|
|
||||||
</div>
|
|
||||||
<div class="chat-contact-info flex-grow-1 ms-2">
|
|
||||||
<h6 class="chat-contact-name text-truncate m-0">Jaime Jimenez</h6>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</li> -->
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /Chat contacts -->
|
|
||||||
|
|
||||||
<!-- Chat History -->
|
|
||||||
<div class="col app-chat-history bg-body">
|
|
||||||
<div class="chat-history-wrapper ">
|
|
||||||
<div class="chat-history-header border-bottom">
|
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
|
||||||
<div class="d-flex overflow-hidden align-items-center">
|
|
||||||
<i class="ti ti-menu-2 ti-sm cursor-pointer d-lg-none d-block me-2"
|
|
||||||
data-bs-toggle="sidebar" data-overlay
|
|
||||||
data-target="#app-chat-contacts"></i>
|
|
||||||
<h5 class="text-primary mb-0" id="chat-direct-title"><br></h5>
|
|
||||||
<div class="chat-contact-info flex-grow-1 ms-2">
|
|
||||||
<h6 class="m-0"></h6>
|
|
||||||
<small class="user-status text-muted"></small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="d-flex align-items-center">
|
|
||||||
<div class="dropdown d-flex align-self-center">
|
|
||||||
<button class="btn p-0" type="button" id="chat-header-actions"
|
|
||||||
data-bs-toggle="dropdown" aria-haspopup="true"
|
|
||||||
aria-expanded="false">
|
|
||||||
<i class="ti ti-dots-vertical"></i>
|
|
||||||
</button>
|
|
||||||
<div class="dropdown-menu dropdown-menu-end"
|
|
||||||
aria-labelledby="chat-header-actions">
|
|
||||||
<a class="dropdown-item" id="update-message-unviewed" href="javascript:void(0);"><?= lang("Chat.check_as_unviewed") ?></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="chat-history-body bg-body ">
|
|
||||||
<div class="d-flex justify-content-center chat-loader">
|
|
||||||
<div class="sk-wave sk-primary ">
|
|
||||||
<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 class="sk-wave-rect"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ul class="list-unstyled chat-history" id="chat-conversation">
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<!-- Chat message form -->
|
|
||||||
<div class="chat-history-footer shadow-sm">
|
|
||||||
<div
|
|
||||||
class="form-send-message d-flex justify-content-between align-items-center">
|
|
||||||
<input class="form-control message-input border-0 me-3 shadow-none"
|
|
||||||
placeholder="<?= lang("Chat.write_message_placeholder") ?>" />
|
|
||||||
<div class="message-actions d-flex align-items-center">
|
|
||||||
|
|
||||||
<div class="message-actions d-flex align-items-center">
|
|
||||||
<a class="btn btn-primary d-flex send-msg-btn" style="color:white"
|
|
||||||
id="send-msg-btn-direct">
|
|
||||||
<i class="ti ti-send me-md-1 me-0"></i>
|
|
||||||
<span class="align-middle d-md-inline-block"><?= lang("Chat.modal.btn_send") ?></span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- /Chat History -->
|
|
||||||
|
|
||||||
<div class="app-overlay"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?= view("themes/vuexy/components/modals/modalAddNewChatParticipant") ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('css') ?>
|
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<!------------------------------------------------------->
|
|
||||||
<!-- Código JS logica -->
|
|
||||||
<!------------------------------------------------------->
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
|
||||||
<script type="module" src="<?= site_url('assets/js/safekat/pages/messages/directMessagePage.js') ?>"></script>
|
|
||||||
<script src="<?= site_url('themes/vuexy/vendor/libs/perfect-scrollbar/perfect-scrollbar.js') ?>"></script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<div class="col-md-12" id="chat-factura" data-id="<?= $modelId ?>">
|
<div class="container-xxl flex-grow-1 container-p-y" id="chat-factura" data-id="<?= $modelId ?>">
|
||||||
<div class="app-chat card overflow-hidden">
|
<div class="app-chat card overflow-hidden">
|
||||||
<div class="row g-0">
|
<div class="row g-0">
|
||||||
|
|
||||||
@ -30,10 +30,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Chats -->
|
<!-- Chats -->
|
||||||
<ul class="list-unstyled chat-contact-list" id="chat-list">
|
<ul class="list-unstyled chat-contact-list" id="chat-list">
|
||||||
<div class="d-flex justify-content-center chat-loader">
|
<li class="chat-contact-list-item chat-list-item-0 d-none">
|
||||||
|
<h6 class="text-muted mb-0">No Chats Found</h6>
|
||||||
</div>
|
</li>
|
||||||
|
|
||||||
<!-- CHAT LIST -->
|
<!-- CHAT LIST -->
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@ -77,15 +76,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-history-body bg-body ">
|
<div class="chat-history-body bg-body ">
|
||||||
<div class="d-flex justify-content-center chat-loader">
|
|
||||||
<div class="sk-wave sk-primary ">
|
|
||||||
<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 class="sk-wave-rect"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ul class="list-unstyled chat-history" id="chat-conversation">
|
<ul class="list-unstyled chat-history" id="chat-conversation">
|
||||||
|
|
||||||
|
|
||||||
@ -122,7 +112,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= $this->section('css') ?>
|
<?= $this->section('css') ?>
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
<!------------------------------------------------------->
|
<!------------------------------------------------------->
|
||||||
|
|||||||
@ -137,7 +137,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->section('css') ?>
|
<?= $this->section('css') ?>
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
<!------------------------------------------------------->
|
<!------------------------------------------------------->
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<div class="col-md-12" id="chat-pedido" data-id="<?= $modelId ?>">
|
<div class="container-xxl flex-grow-1 container-p-y" id="chat-pedido" data-id="<?= $modelId ?>">
|
||||||
|
|
||||||
<div class="app-chat card overflow-hidden">
|
<div class="app-chat card overflow-hidden">
|
||||||
<div class="row g-0">
|
<div class="row g-0">
|
||||||
@ -31,8 +31,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Chats -->
|
<!-- Chats -->
|
||||||
<ul class="list-unstyled chat-contact-list" id="chat-list">
|
<ul class="list-unstyled chat-contact-list" id="chat-list">
|
||||||
|
<li class="chat-contact-list-item chat-list-item-0 d-none">
|
||||||
|
<h6 class="text-muted mb-0">No Chats Found</h6>
|
||||||
|
</li>
|
||||||
<!-- CHAT LIST -->
|
<!-- CHAT LIST -->
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@ -75,15 +76,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-history-body bg-body ">
|
<div class="chat-history-body bg-body ">
|
||||||
<div class="d-flex justify-content-center chat-loader">
|
|
||||||
<div class="sk-wave sk-primary ">
|
|
||||||
<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 class="sk-wave-rect"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ul class="list-unstyled chat-history" id="chat-conversation">
|
<ul class="list-unstyled chat-history" id="chat-conversation">
|
||||||
|
|
||||||
|
|
||||||
@ -121,7 +113,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<?= $this->section('css') ?>
|
<?= $this->section('css') ?>
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
<!------------------------------------------------------->
|
<!------------------------------------------------------->
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<div class="col-md-12" id="chat-presupuesto" data-id="<?= $modelId ?>">
|
<div id="chat-presupuesto" data-id="<?= $modelId ?>">
|
||||||
<div class="app-chat card overflow-hidden">
|
<div class="app-chat card overflow-hidden">
|
||||||
<div class="row g-0">
|
<div class="row g-0">
|
||||||
|
|
||||||
@ -30,8 +30,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- Chats -->
|
<!-- Chats -->
|
||||||
<ul class="list-unstyled chat-contact-list" id="chat-list">
|
<ul class="list-unstyled chat-contact-list" id="chat-list">
|
||||||
|
<li class="chat-contact-list-item chat-list-item-0 d-none">
|
||||||
|
<h6 class="text-muted mb-0">No Chats Found</h6>
|
||||||
|
</li>
|
||||||
<!-- CHAT LIST -->
|
<!-- CHAT LIST -->
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@ -75,17 +76,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="chat-history-body bg-body ">
|
<div class="chat-history-body bg-body ">
|
||||||
<div class="d-flex justify-content-center chat-loader">
|
|
||||||
<div class="sk-wave sk-primary ">
|
|
||||||
<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 class="sk-wave-rect"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<ul class="list-unstyled chat-history" id="chat-conversation">
|
<ul class="list-unstyled chat-history" id="chat-conversation">
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!-- Chat message form -->
|
<!-- Chat message form -->
|
||||||
@ -119,7 +112,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= $this->section('css') ?>
|
<?= $this->section('css') ?>
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/spinkit/spinkit.css') ?>" />
|
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/css/pages/app-chat.css') ?>">
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
<!------------------------------------------------------->
|
<!------------------------------------------------------->
|
||||||
|
|||||||
@ -1,61 +0,0 @@
|
|||||||
<form class="form-control" id="<?= $id ?>" data-id="<?= $model->id ?>">
|
|
||||||
<div class="row mb-2">
|
|
||||||
<!-- Servicio cliente nombre-->
|
|
||||||
<div class="col-xs-12 col-md-6 col-lg-6 mb-2">
|
|
||||||
<label for="servicio-cliente-nombre" class="form-label"><?= @lang("ServicioCliente.datatable.nombre") ?></label>
|
|
||||||
<input type="text" class="form-control" name="nombre" id="servicio-cliente-nombre">
|
|
||||||
</div>
|
|
||||||
<!-- Servicio cliente code-->
|
|
||||||
<div class="col-xs-12 col-md-6 col-lg-6 mb-2">
|
|
||||||
<label for="servicio-cliente-code" class="form-label"><?= @lang("ServicioCliente.datatable.code") ?></label>
|
|
||||||
<input type="text" class="form-control" name="code" id="servicio-cliente-code">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- Tarifa acabado asociada a servicio -->
|
|
||||||
<div class="col-xs-12 col-md-8 col-lg-6 mb-2" id="container-tarifa-acabado-select">
|
|
||||||
<label for="servicio-cliente-tarifa-acabado" class="form-label"><?= @lang("Tarifaacabado.tarifaacabado") ?></label>
|
|
||||||
<select class="select2 form-select" name="tarifa_acabado_id" id="servicio-cliente-tarifa-acabado" placeholder="<?= @lang("Tarifaacabado.tarifasacabado") ?>">
|
|
||||||
</select>
|
|
||||||
<div class="form-text"><?= @lang("ServicioCliente.infoTarifaAcabado") ?></div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- Tarifa manipulado asociada a servicio-->
|
|
||||||
<div class="col-xs-12 col-md-8 col-lg-6 mb-2 d-none" id="container-tarifa-manipulado-select">
|
|
||||||
<label for="servicio-cliente-tarifa-manipulado" class="form-label"><?= @lang("Tarifamanipulado.tarifamanipulado") ?></label>
|
|
||||||
<select class="select2 form-select" name="tarifa_manipulado_id" id="servicio-cliente-tarifa-manipulado" placeholder="<?= @lang("Tarifamanipulado.tarifasmanipulado") ?>">
|
|
||||||
</select>
|
|
||||||
<div class="form-text"><?= @lang("ServicioCliente.infoTarifaManipulado") ?></div>
|
|
||||||
</div>
|
|
||||||
<!-- Check tarifa acabado o manipulado -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-6 mb-2">
|
|
||||||
<div class="text-light small fw-medium mb-2">Seleccione tipo de tarifa</div>
|
|
||||||
<div class="switches-stacked">
|
|
||||||
<label class="switch">
|
|
||||||
<input type="radio" class="switch-input" id="check-tarifa-acabado" name="switches-stacked-radio" checked />
|
|
||||||
<span class="switch-toggle-slider">
|
|
||||||
<span class="switch-on"></span>
|
|
||||||
<span class="switch-off"></span>
|
|
||||||
</span>
|
|
||||||
<span class="switch-label"><?= @lang("Tarifaacabado.tarifasacabado") ?></span>
|
|
||||||
</label>
|
|
||||||
<label class="switch">
|
|
||||||
<input type="radio" class="switch-input" id="check-tarifa-manipulado" name="switches-stacked-radio" />
|
|
||||||
<span class="switch-toggle-slider">
|
|
||||||
<span class="switch-on"></span>
|
|
||||||
<span class="switch-off"></span>
|
|
||||||
</span>
|
|
||||||
<span class="switch-label"><?= @lang("Tarifamanipulado.tarifasmanipulado") ?></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mb-2">
|
|
||||||
<div class="col-md-12 d-flex justify-content-start gap-4">
|
|
||||||
<button type="button" class="btn btn-primary btn-md d-none" id="btn-new-servicio-cliente"><?= lang("App.global_save") ?></button>
|
|
||||||
<button type="button" class="btn btn-primary btn-md d-none" id="btn-update-servicio-cliente"><?= lang("App.global_save") ?></button>
|
|
||||||
<button type="button" class="btn btn-secondary btn-md"><?= lang("App.global_come_back") ?></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
<!-- Modal -->
|
|
||||||
<div class="modal fade" id="modalAddNewChatParticipant" tabindex="-1" aria-hidden="true">
|
|
||||||
<div class="modal-dialog" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title" id="exampleModalLabel1"><?= lang('Chat.modal.new_receivers') ?></h5>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="col-12 mb-0">
|
|
||||||
<?= view("themes/vuexy/components/alerts/alert", ["id" => "alertNewParticipant"]) ?>
|
|
||||||
</div>
|
|
||||||
<form id="formNewParticipant">
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-12 mb-2">
|
|
||||||
<label for="select-users" class="required form-label"><?= lang('Chat.modal.new_receivers') ?></label>
|
|
||||||
<select id="select-users" name="users" class="select2 form-control" multiple required>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 mb-2">
|
|
||||||
<div class="text-light small fw-medium mb-2"><?= lang("Chat.add_notification") ?></div>
|
|
||||||
<label class="switch">
|
|
||||||
<input type="checkbox" class="switch-input" name="notification" id="checkbox-notification-chat" checked />
|
|
||||||
<span class="switch-toggle-slider">
|
|
||||||
<span class="switch-on"></span>
|
|
||||||
<span class="switch-off"></span>
|
|
||||||
</span>
|
|
||||||
<span class="switch-label"><?= lang("Chat.add_notification_message") ?></span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.global_come_back') ?></button>
|
|
||||||
<button type="button" id="btn-chat-add-participant-submit" class="btn btn-primary d-none"><?= lang('App.global_save') ?></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
<!-- Modal -->
|
|
||||||
<div class="modal fade" id="modalNewDirectMessage" tabindex="-1" aria-hidden="true">
|
|
||||||
<div class="modal-dialog" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<h5 class="modal-title" id="exampleModalLabel1"><?= lang('Chat.modal.new_message') ?></h5>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="col-12 mb-0">
|
|
||||||
<?= view("themes/vuexy/components/alerts/alert", ["id" => "alertDirectMessage"]) ?>
|
|
||||||
</div>
|
|
||||||
<form id="formNewDirectMessage">
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col-12 mb-0">
|
|
||||||
<label for="new-direct-message-title" class="form-label"><?= lang('Chat.modal.title') ?></label>
|
|
||||||
<input type="input" rows="4" cols="10" id="new-direct-message-title" name="title" placeholder="Escriba un título" name="title" class="form-control" required />
|
|
||||||
</div>
|
|
||||||
<div class="col-12 mb-0">
|
|
||||||
<label for="description" class="required form-label"><?= lang('Chat.modal.new_message') ?></label>
|
|
||||||
<textarea type="input" rows="4" cols="10" id="new-direct-message-text" name="message" placeholder="Escribe el mensaje ..." name="message" class="form-control" required></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="col-12 mb-0">
|
|
||||||
<label for="select-users" class="required form-label"><?= lang('Chat.modal.new_receivers') ?></label>
|
|
||||||
<select id="select-users" name="users" class="form-control" multiple required>
|
|
||||||
<option value="0"></option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.global_come_back') ?></button>
|
|
||||||
<?php if (auth()->user()->inGroup('admin')) { ?>
|
|
||||||
<button type="button" id="submit-new-direct-message" class="btn btn-primary"><?= lang('Chat.modal.btn_send') ?></button>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><?= lang('Chat.datatable_messages.created_at') ?></th>
|
|
||||||
<th><?= lang('Chat.datatable_messages.updated_at') ?></th>
|
|
||||||
<th><?= lang('Chat.datatable_messages.title') ?></th>
|
|
||||||
<th><?= lang('Chat.datatable_messages.creator') ?></th>
|
|
||||||
<th><?= lang('Chat.datatable_messages.viewed') ?></th>
|
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><?= lang('Produccion.datatable.pedido_id') ?></th>
|
|
||||||
<th><?= lang('Produccion.datatable.fecha_encuadernacion') ?></th>
|
|
||||||
<th><?= lang('Produccion.datatable.cliente') ?></th>
|
|
||||||
<th><?= lang('Produccion.datatable.titulo') ?></th>
|
|
||||||
<th><?= lang('Produccion.datatable.ubicacion') ?></th>
|
|
||||||
<th><?= lang('Produccion.datatable.tirada') ?></th>
|
|
||||||
<th><?= lang('Produccion.datatable.impresion') ?></th>
|
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th><?= lang('ServicioCliente.datatable.nombre') ?></th>
|
|
||||||
<th><?= lang('ServicioCliente.datatable.code') ?></th>
|
|
||||||
<th><?= lang('ServicioCliente.datatable.created_at') ?></th>
|
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
@ -561,6 +561,7 @@
|
|||||||
|
|
||||||
<?php if ($formAction !== route_to('clienteAdd')){ ?>
|
<?php if ($formAction !== route_to('clienteAdd')){ ?>
|
||||||
<div class="tab-pane fade" id="tarifascliente" role="tabpanel">
|
<div class="tab-pane fade" id="tarifascliente" role="tabpanel">
|
||||||
|
<?= view("themes/vuexy/form/clientes/cliente/convert2templateModal") ?>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class="col-md-12 col-lg-4 px-4">
|
<div class="col-md-12 col-lg-4 px-4">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
@ -583,7 +584,6 @@
|
|||||||
<table id="tableOfPrecios" class="table table-striped table-hover" style="width: 100%;">
|
<table id="tableOfPrecios" class="table table-striped table-hover" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
|
||||||
<th><?= lang('ClientePrecios.tipo') ?></th>
|
<th><?= lang('ClientePrecios.tipo') ?></th>
|
||||||
<th><?= lang('ClientePrecios.tipo_maquina') ?></th>
|
<th><?= lang('ClientePrecios.tipo_maquina') ?></th>
|
||||||
<th><?= lang('ClientePrecios.tipo_impresion') ?></th>
|
<th><?= lang('ClientePrecios.tipo_impresion') ?></th>
|
||||||
@ -591,10 +591,10 @@
|
|||||||
<th><?= lang('ClientePrecios.tiempo_max') ?></th>
|
<th><?= lang('ClientePrecios.tiempo_max') ?></th>
|
||||||
<th><?= lang('ClientePrecios.precio_hora') ?></th>
|
<th><?= lang('ClientePrecios.precio_hora') ?></th>
|
||||||
<th><?= lang('ClientePrecios.margen') ?></th>
|
<th><?= lang('ClientePrecios.margen') ?></th>
|
||||||
<th class="noFilter"><?= lang('ClientePrecios.user_updated_id') ?></th>
|
<th><?= lang('ClientePrecios.user_updated_id') ?></th>
|
||||||
<th class="noFilter"><?= lang('ClientePrecios.updated_at') ?></th>
|
<th><?= lang('ClientePrecios.updated_at') ?></th>
|
||||||
<th class="noFilter noVis">plantilla_id</th>
|
<th>plantilla_id</th>
|
||||||
<th class="text-nowrap noFilter noVis" style="min-width:100px"><?= lang('Basic.global.Action') ?></th>
|
<th class="text-nowrap" style="min-width:100px"><?= lang('Basic.global.Action') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -880,6 +880,345 @@ $(document).on('click', '.btn-remove', function(e) {
|
|||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
|
/**************************************
|
||||||
|
Tarifas cliente
|
||||||
|
***************************************/
|
||||||
|
|
||||||
|
$('#plantillas').select2({
|
||||||
|
allowClear: false,
|
||||||
|
ajax: {
|
||||||
|
url: '<?= route_to("menuItemsOfClienteplantillaprecios") ?>',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
id: 'id',
|
||||||
|
text: 'nombre',
|
||||||
|
searchTerm: params.term,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
};
|
||||||
|
},
|
||||||
|
delay: 60,
|
||||||
|
processResults: function (response) {
|
||||||
|
|
||||||
|
yeniden(response.<?= csrf_token() ?>);
|
||||||
|
|
||||||
|
return {
|
||||||
|
results: response.menu
|
||||||
|
};
|
||||||
|
},
|
||||||
|
|
||||||
|
cache: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const lastColNr_lineas = $('#tableOfPrecios').find("tr:first th").length - 1;
|
||||||
|
|
||||||
|
const actionBtns_lineas = function(data) {
|
||||||
|
return `
|
||||||
|
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
|
||||||
|
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||||
|
<span class="cancel"></span>
|
||||||
|
`;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const tipo_linea = [
|
||||||
|
{label:'<?= lang('ClientePrecios.interior') ?>', value:'interior'},
|
||||||
|
{label:'<?= lang('ClientePrecios.cubierta') ?>', value: 'cubierta'},
|
||||||
|
{label:'<?= lang('ClientePrecios.sobrecubierta') ?>', value: 'sobrecubierta'}
|
||||||
|
];
|
||||||
|
|
||||||
|
const tipo_maquina = [
|
||||||
|
{label: '<?= lang('ClientePrecios.toner') ?>', value:'toner'},
|
||||||
|
{label: '<?= lang('ClientePrecios.inkjet') ?>', value:'inkjet'},
|
||||||
|
];
|
||||||
|
|
||||||
|
const tipo_impresion = [
|
||||||
|
{label: '<?= lang('ClientePrecios.negro') ?>', value:'negro'},
|
||||||
|
{label: '<?= lang('ClientePrecios.negrohq') ?>', value:'negrohq'},
|
||||||
|
{label: '<?= lang('ClientePrecios.color') ?>', value:'color'},
|
||||||
|
{label: '<?= lang('ClientePrecios.colorhq') ?>', value:'colorhq'},
|
||||||
|
];
|
||||||
|
|
||||||
|
var editorPrecios = new $.fn.dataTable.Editor( {
|
||||||
|
ajax: {
|
||||||
|
url: "<?= route_to('editorOfClienteprecios') ?>",
|
||||||
|
headers: {
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
table : "#tableOfPrecios",
|
||||||
|
idSrc: 'id',
|
||||||
|
fields: [ {
|
||||||
|
name: "tipo",
|
||||||
|
type: "select",
|
||||||
|
options: tipo_linea
|
||||||
|
}, {
|
||||||
|
name: "tipo_maquina",
|
||||||
|
type: "select",
|
||||||
|
options: tipo_maquina
|
||||||
|
}, {
|
||||||
|
name: "tipo_impresion",
|
||||||
|
type: "select",
|
||||||
|
options: tipo_impresion
|
||||||
|
}, {
|
||||||
|
name: "tiempo_min"
|
||||||
|
}, {
|
||||||
|
name: "tiempo_max"
|
||||||
|
}, {
|
||||||
|
name: "precio_hora"
|
||||||
|
}, {
|
||||||
|
name: "margen"
|
||||||
|
}, {
|
||||||
|
name: "user_updated_id",
|
||||||
|
type:'hidden',
|
||||||
|
|
||||||
|
}, {
|
||||||
|
name: "updated_at",
|
||||||
|
type:'hidden',
|
||||||
|
|
||||||
|
}, {
|
||||||
|
"name": "plantilla_id",
|
||||||
|
"type": "hidden"
|
||||||
|
},{
|
||||||
|
"name": "cliente_id",
|
||||||
|
"type": "hidden"
|
||||||
|
},{
|
||||||
|
"name": "deleted_at",
|
||||||
|
"type": "hidden"
|
||||||
|
},{
|
||||||
|
"name": "is_deleted",
|
||||||
|
"type": "hidden"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
} );
|
||||||
|
|
||||||
|
editorPrecios.on( 'preSubmit', function ( e, d, type ) {
|
||||||
|
if ( type === 'create'){
|
||||||
|
d.data[0]['cliente_id'] = id;
|
||||||
|
}
|
||||||
|
else if(type === 'edit' ) {
|
||||||
|
for (v in d.data){
|
||||||
|
d.data[v]['cliente_id'] = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
editorPrecios.on( 'postSubmit', function ( e, json, data, action ) {
|
||||||
|
|
||||||
|
yeniden(json.<?= csrf_token() ?>);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
editorPrecios.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||||
|
|
||||||
|
theTablePrecios.clearPipeline();
|
||||||
|
theTablePrecios.draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
editorPrecios.on ('postEdit', function ( e, json, data, action ) {
|
||||||
|
const domain = window.location.origin
|
||||||
|
fetch(domain + "/clientes/clienteprecios/update/" + id , {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Content-type": "application/json; charset=UTF-8"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
editorPrecios.on ('postCreate', function ( e, json, data, action ) {
|
||||||
|
const domain = window.location.origin
|
||||||
|
fetch(domain + "/clientes/clienteprecios/update/" + id , {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Content-type": "application/json; charset=UTF-8"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
var theTablePrecios = $('#tableOfPrecios').DataTable( {
|
||||||
|
serverSide: true,
|
||||||
|
processing: true,
|
||||||
|
autoWidth: true,
|
||||||
|
responsive: true,
|
||||||
|
lengthMenu: [ 10, 25, 50, 100],
|
||||||
|
order: [[ 0, "asc" ], [ 1, "asc" ], [ 2, "asc" ], [ 3, "asc" ]],
|
||||||
|
pageLength: 50,
|
||||||
|
lengthChange: true,
|
||||||
|
searching: false,
|
||||||
|
paging: true,
|
||||||
|
info: false,
|
||||||
|
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||||
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
|
url: '<?= route_to('dataTableOfClienteprecios') ?>',
|
||||||
|
data: {
|
||||||
|
cliente_id: id,
|
||||||
|
},
|
||||||
|
method: 'POST',
|
||||||
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
|
async: true,
|
||||||
|
}),
|
||||||
|
columns: [
|
||||||
|
{ 'data': 'tipo' ,
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
if(data=='interior')
|
||||||
|
return '<?= lang('ClientePrecios.interior') ?>';
|
||||||
|
else if(data=='cubierta')
|
||||||
|
return '<?= lang('ClientePrecios.cubierta') ?>';
|
||||||
|
else if(data=='sobrecubierta')
|
||||||
|
return '<?= lang('ClientePrecios.sobrecubierta') ?>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'tipo_maquina',
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
if(data=='toner')
|
||||||
|
return '<?= lang('ClientePrecios.toner') ?>';
|
||||||
|
else if(data=='inkjet')
|
||||||
|
return '<?= lang('ClientePrecios.inkjet') ?>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'tipo_impresion',
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
if(data=='negro')
|
||||||
|
return '<?= lang('ClientePrecios.negro') ?>';
|
||||||
|
else if(data=='negrohq')
|
||||||
|
return '<?= lang('ClientePrecios.negrohq') ?>';
|
||||||
|
else if(data=='color')
|
||||||
|
return '<?= lang('ClientePrecios.color') ?>';
|
||||||
|
else if(data=='colorhq')
|
||||||
|
return '<?= lang('ClientePrecios.colorhq') ?>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'tiempo_min' },
|
||||||
|
{ 'data': 'tiempo_max' },
|
||||||
|
{ 'data': 'precio_hora' },
|
||||||
|
{ 'data': 'margen' },
|
||||||
|
{ 'data': 'user_updated_id',
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
return row.user_updated
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'updated_at' },
|
||||||
|
{ 'data': 'plantilla_id' },
|
||||||
|
{
|
||||||
|
data: actionBtns_lineas,
|
||||||
|
className: 'row-edit dt-center'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
target: 9,
|
||||||
|
orderable: false,
|
||||||
|
visible: false,
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
orderable: false,
|
||||||
|
searchable: false,
|
||||||
|
targets: [lastColNr_lineas]
|
||||||
|
},
|
||||||
|
{"orderData": [ 0, 1 ], "targets": 0 },
|
||||||
|
|
||||||
|
],
|
||||||
|
language: {
|
||||||
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
|
},
|
||||||
|
buttons: [ {
|
||||||
|
className: 'btn btn-primary me-sm-3 me-1',
|
||||||
|
extend: "createInline",
|
||||||
|
editor: editorPrecios,
|
||||||
|
formOptions: {
|
||||||
|
submitTrigger: -1,
|
||||||
|
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||||
|
}
|
||||||
|
} ]
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
const initPrecioTemplate = <?php echo json_encode($precioTemplate);?>;
|
||||||
|
if(initPrecioTemplate != null){
|
||||||
|
var newOption = new Option(initPrecioTemplate.label, initPrecioTemplate.value, false, false);
|
||||||
|
$('#plantillas').append(newOption);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Activate an inline edit on click of a table cell
|
||||||
|
$('#tableOfPrecios').on( 'click', 'tbody span.edit', function (e) {
|
||||||
|
editorPrecios.inline(
|
||||||
|
theTablePrecios.cells(this.parentNode.parentNode, '*').nodes(),
|
||||||
|
{
|
||||||
|
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
|
||||||
|
cancelTrigger: 'span.cancel',
|
||||||
|
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||||
|
submitTrigger: 'span.edit',
|
||||||
|
submit: 'allIfChanged'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
// Delete row
|
||||||
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
|
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||||
|
$(".btn-remove").attr('table-id', '#tableOfPrecios');
|
||||||
|
$(".btn-remove").attr('row', $(this).closest('tr')[0]._DT_RowIndex);
|
||||||
|
});
|
||||||
|
|
||||||
|
function delete_precio(dataId, row){
|
||||||
|
if ($.isNumeric(dataId)) {
|
||||||
|
editorPrecios
|
||||||
|
.create( false )
|
||||||
|
.edit( theTablePrecios.rows(row), false)
|
||||||
|
.set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') )
|
||||||
|
.set( 'is_deleted', 1 )
|
||||||
|
.submit();
|
||||||
|
$('#confirm2delete').modal('toggle');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$('#plantillas').on('change.select2', function(){
|
||||||
|
const data = $('#plantillas').select2('data');
|
||||||
|
if(data.length>0){
|
||||||
|
const domain = window.location.origin
|
||||||
|
fetch(domain + "/clientes/clienteprecios/update/" + id , {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
plantilla_id: data[0].id,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Content-type": "application/json; charset=UTF-8"
|
||||||
|
}
|
||||||
|
}).then(function(){
|
||||||
|
theTablePrecios.clearPipeline();
|
||||||
|
theTablePrecios.draw();
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#convert2template').on('click', function(){
|
||||||
|
var newAddDialog = $('#convert2Template')
|
||||||
|
newAddDialog.modal("show");
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section("additionalInlineJs") ?>
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
/****************************************
|
/****************************************
|
||||||
Direcciones cliente
|
Direcciones cliente
|
||||||
|
|||||||
@ -0,0 +1,65 @@
|
|||||||
|
<div id="convert2Template" class="modal fade addModal">
|
||||||
|
<div class="modal-dialog modal-lg modal-simple">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 id="labelTitleConfirmDialog" class="modal-title"><?= lang('ClientePrecios.convertir2plantilla') ?></h4>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div id='error-nombre'></div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<p><?= lang('ClientePrecios.convertir2plantillaText') ?></p>
|
||||||
|
<p><?= lang('ClientePrecios.convertir2plantillaText2') ?></p>
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="nombre_plantilla" class="form-label">
|
||||||
|
<?= lang('ClientePrecios.nombrePlantilla') ?>
|
||||||
|
</label>
|
||||||
|
<input type="text" id="nombre_plantilla" maxLength="100" class="form-control new-address">
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button id="saveTemplate"
|
||||||
|
type="button"
|
||||||
|
class="btn btn-primary"
|
||||||
|
><?= lang('App.global_save') ?></button>
|
||||||
|
<button id="cancelTemplate"
|
||||||
|
type="button"
|
||||||
|
class="btn btn-default"
|
||||||
|
><?= lang('App.user_delete_btn_cancel') ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
|
$('#saveTemplate').on('click', function(){
|
||||||
|
if($('#nombre_plantilla').val().length == 0){
|
||||||
|
popErrorAlert('<?= lang('ClientePrecios.errors.error_nombre_template') ?>', 'error-nombre')
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
data = new FormData();
|
||||||
|
data.append('cliente_id', id)
|
||||||
|
data.append('nombre', $('#nombre_plantilla').val())
|
||||||
|
data.append('<?= csrf_token() ?? "token" ?>', <?= csrf_token() ?>v)
|
||||||
|
fetch('<?= route_to("createClienteplantillaprecios");?>' , {
|
||||||
|
method: "POST",
|
||||||
|
body: data,
|
||||||
|
})
|
||||||
|
.then(data => {
|
||||||
|
$('#convert2Template').modal("hide");
|
||||||
|
var newOption = new Option($('#nombre_plantilla').val(), "", false, false);
|
||||||
|
$('#plantillas').append(newOption);
|
||||||
|
$('#nombre_plantilla').val("");
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
$('#cancelTemplate').on('click', function(){
|
||||||
|
$('#convert2Template').modal("hide");
|
||||||
|
})
|
||||||
|
<?=$this->endSection() ?>
|
||||||
@ -1,7 +1,6 @@
|
|||||||
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
||||||
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||||
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
<?= $this->include("themes/_commonPartialsBs/sweetalert") ?>
|
||||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
|
||||||
<?=$this->extend('themes/vuexy/main/defaultlayout') ?>
|
<?=$this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||||
|
|
||||||
<?= $this->section("content") ?>
|
<?= $this->section("content") ?>
|
||||||
@ -44,8 +43,5 @@
|
|||||||
|
|
||||||
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
<?= $this->section("additionalExternalJs") ?>
|
||||||
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.colVis.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.print.min.js") ?>"></script>
|
|
||||||
<script type="module" src="<?= site_url('assets/js/safekat/pages/cliente/cliente.js?'. 'token' . '='. (csrf_token() ?? "token")) ?>"></script>
|
<script type="module" src="<?= site_url('assets/js/safekat/pages/cliente/cliente.js?'. 'token' . '='. (csrf_token() ?? "token")) ?>"></script>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -16,8 +16,12 @@
|
|||||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||||
<?= view("themes/vuexy/form/clientes/plantillaprecios/_ClienteplantillapreciosFormItems") ?>
|
<?= view("themes/vuexy/form/clientes/plantillaprecios/_ClienteplantillapreciosFormItems") ?>
|
||||||
<div class="pt-4">
|
<div class="pt-4">
|
||||||
<input type="submit" class="btn btn-primary float-start me-sm-3 me-1" name="save"
|
<input
|
||||||
value="<?= lang("Basic.global.Save") ?>" />
|
type="submit"
|
||||||
|
class="btn btn-primary float-start me-sm-3 me-1"
|
||||||
|
name="save"
|
||||||
|
value="<?= lang("Basic.global.Save") ?>"
|
||||||
|
/>
|
||||||
<?= anchor(route_to("clienteplantillapreciosList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
<?= anchor(route_to("clienteplantillapreciosList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary"]) ?>
|
||||||
|
|
||||||
</div><!-- /.card-footer -->
|
</div><!-- /.card-footer -->
|
||||||
@ -27,32 +31,22 @@
|
|||||||
</div><!--//.row -->
|
</div><!--//.row -->
|
||||||
|
|
||||||
|
|
||||||
<?php if (str_contains($formAction, 'edit')): ?>
|
<?php if(str_contains($formAction,'edit')): ?>
|
||||||
|
|
||||||
<div class="accordion mt-3" id="accordionPreciosLineas">
|
<div class="accordion mt-3" id="accordionPreciosLineas">
|
||||||
|
|
||||||
<div class="card accordion-item active">
|
<div class="card accordion-item active">
|
||||||
<h2 class="accordion-header" id="headingOne">
|
<h2 class="accordion-header" id="headingOne">
|
||||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip1"
|
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionTip1" aria-expanded="false" aria-controls="accordionTip1">
|
||||||
aria-expanded="false" aria-controls="accordionTip1">
|
|
||||||
<h3><?= lang("MaquinasTarifasImpresions.moduleTitle") ?></h3>
|
<h3><?= lang("MaquinasTarifasImpresions.moduleTitle") ?></h3>
|
||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionPreciosLineas">
|
<div id="accordionTip1" class="accordion-collapse collapse show" data-bs-parent="#accordionPreciosLineas">
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
|
|
||||||
<button id="btnApply" type="button" class="btn btn-primary d-none">
|
|
||||||
Guardar y aplicar a clientes
|
|
||||||
</button>
|
|
||||||
<button id="btnUndo" type="button" class="btn btn-secondary d-none">
|
|
||||||
Descartar cambios
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<table id="tableOfPlantillasPreciosLineas" class="table table-striped table-hover" style="width: 100%;">
|
<table id="tableOfPlantillasPreciosLineas" class="table table-striped table-hover" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
|
||||||
<th><?= lang('ClientePrecios.tipo') ?></th>
|
<th><?= lang('ClientePrecios.tipo') ?></th>
|
||||||
<th><?= lang('ClientePrecios.tipo_maquina') ?></th>
|
<th><?= lang('ClientePrecios.tipo_maquina') ?></th>
|
||||||
<th><?= lang('ClientePrecios.tipo_impresion') ?></th>
|
<th><?= lang('ClientePrecios.tipo_impresion') ?></th>
|
||||||
@ -61,51 +55,308 @@
|
|||||||
<th><?= lang('ClientePrecios.precio_hora') ?></th>
|
<th><?= lang('ClientePrecios.precio_hora') ?></th>
|
||||||
<th><?= lang('ClientePrecios.margen') ?></th>
|
<th><?= lang('ClientePrecios.margen') ?></th>
|
||||||
<th><?= lang('ClientePrecios.user_updated_id') ?></th>
|
<th><?= lang('ClientePrecios.user_updated_id') ?></th>
|
||||||
<th class="noFilter"><?= lang('ClientePrecios.updated_at') ?></th>
|
<th><?= lang('ClientePrecios.updated_at') ?></th>
|
||||||
<th class="text-nowrap noFilter" style="min-width:100px"><?= lang('Basic.global.Action') ?>
|
<th class="text-nowrap" style="min-width:100px"><?= lang('Basic.global.Action') ?></th>
|
||||||
</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> <!-- //.accordion -->
|
</div> <!-- //.accordion -->
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('css') ?>
|
<?php if(str_contains($formAction,'edit')): ?>
|
||||||
<link rel="stylesheet"
|
<?=$this->section('additionalInlineJs') ?>
|
||||||
href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
|
||||||
<link rel="stylesheet"
|
const lastColNr_lineas = $('#tableOfPlantillasPreciosLineas').find("tr:first th").length - 1;
|
||||||
href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
|
||||||
<?= $this->endSection() ?>
|
const url = window.location.href;
|
||||||
|
const url_parts = url.split('/');
|
||||||
|
|
||||||
|
let id = -1;
|
||||||
|
if(url_parts[url_parts.length-2] == 'edit'){
|
||||||
|
id = url_parts[url_parts.length-1];
|
||||||
|
}
|
||||||
|
|
||||||
|
const actionBtns_lineas = function(data) {
|
||||||
|
return `
|
||||||
|
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
|
||||||
|
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||||
|
<span class="cancel"></span>
|
||||||
|
`;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const tipo_linea = [
|
||||||
|
{label:'<?= lang('ClientePrecios.interior') ?>', value:'interior'},
|
||||||
|
{label:'<?= lang('ClientePrecios.cubierta') ?>', value: 'cubierta'},
|
||||||
|
{label:'<?= lang('ClientePrecios.sobrecubierta') ?>', value: 'sobrecubierta'}
|
||||||
|
];
|
||||||
|
|
||||||
|
const tipo_maquina = [
|
||||||
|
{label: '<?= lang('ClientePrecios.toner') ?>', value:'toner'},
|
||||||
|
{label: '<?= lang('ClientePrecios.inkjet') ?>', value:'inkjet'},
|
||||||
|
];
|
||||||
|
|
||||||
|
const tipo_impresion = [
|
||||||
|
{label: '<?= lang('ClientePrecios.negro') ?>', value:'negro'},
|
||||||
|
{label: '<?= lang('ClientePrecios.negrohq') ?>', value:'negrohq'},
|
||||||
|
{label: '<?= lang('ClientePrecios.color') ?>', value:'color'},
|
||||||
|
{label: '<?= lang('ClientePrecios.colorhq') ?>', value:'colorhq'},
|
||||||
|
];
|
||||||
|
|
||||||
|
var editor = new $.fn.dataTable.Editor( {
|
||||||
|
ajax: {
|
||||||
|
url: "<?= route_to('editorOfClienteplantillaprecioslineas') ?>",
|
||||||
|
headers: {
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
table : "#tableOfPlantillasPreciosLineas",
|
||||||
|
idSrc: 'id',
|
||||||
|
fields: [ {
|
||||||
|
name: "tipo",
|
||||||
|
type: "select",
|
||||||
|
options: tipo_linea
|
||||||
|
}, {
|
||||||
|
name: "tipo_maquina",
|
||||||
|
type: "select",
|
||||||
|
options: tipo_maquina
|
||||||
|
}, {
|
||||||
|
name: "tipo_impresion",
|
||||||
|
type: "select",
|
||||||
|
options: tipo_impresion
|
||||||
|
}, {
|
||||||
|
name: "tiempo_min"
|
||||||
|
}, {
|
||||||
|
name: "tiempo_max"
|
||||||
|
}, {
|
||||||
|
name: "precio_hora"
|
||||||
|
}, {
|
||||||
|
name: "margen"
|
||||||
|
}, {
|
||||||
|
name: "user_updated_id",
|
||||||
|
type:'hidden',
|
||||||
|
|
||||||
|
}, {
|
||||||
|
name: "updated_at",
|
||||||
|
type:'hidden',
|
||||||
|
|
||||||
|
}, {
|
||||||
|
"name": "plantilla_id",
|
||||||
|
"type": "hidden"
|
||||||
|
},{
|
||||||
|
"name": "deleted_at",
|
||||||
|
"type": "hidden"
|
||||||
|
},{
|
||||||
|
"name": "is_deleted",
|
||||||
|
"type": "hidden"
|
||||||
|
},
|
||||||
|
]
|
||||||
|
} );
|
||||||
|
|
||||||
|
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||||
|
if ( type === 'create'){
|
||||||
|
d.data[0]['plantilla_id'] = id;
|
||||||
|
}
|
||||||
|
else if(type === 'edit' ) {
|
||||||
|
for (v in d.data){
|
||||||
|
d.data[v]['plantilla_id'] = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
editor.on( 'postSubmit', function ( e, json, data, action ) {
|
||||||
|
|
||||||
|
yeniden(json.<?= csrf_token() ?>);
|
||||||
|
|
||||||
|
const domain = window.location.origin
|
||||||
|
fetch(domain + "/clientes/clienteprecios/update/" + -1 , {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
plantilla_id: id,
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Content-type": "application/json; charset=UTF-8"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
editor.on( 'submitSuccess', function ( e, json, data, action ) {
|
||||||
|
|
||||||
|
theTable.clearPipeline();
|
||||||
|
theTable.draw();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var theTable = $('#tableOfPlantillasPreciosLineas').DataTable( {
|
||||||
|
serverSide: true,
|
||||||
|
processing: true,
|
||||||
|
autoWidth: true,
|
||||||
|
responsive: true,
|
||||||
|
lengthMenu: [ 10, 25, 50, 100],
|
||||||
|
order: [[ 0, "asc" ], [ 1, "asc" ], [ 2, "asc" ], [ 3, "asc" ]],
|
||||||
|
pageLength: 50,
|
||||||
|
lengthChange: true,
|
||||||
|
searching: false,
|
||||||
|
paging: true,
|
||||||
|
info: false,
|
||||||
|
dom: '<"mt-4"><"float-end"B><"float-start"l><t><"mt-4 mb-3"p>',
|
||||||
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
|
url: '<?= route_to('dataTableOfClientesplantillaprecioslineas') ?>',
|
||||||
|
data: {
|
||||||
|
plantilla_id: id,
|
||||||
|
},
|
||||||
|
method: 'POST',
|
||||||
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
|
async: true,
|
||||||
|
}),
|
||||||
|
columns: [
|
||||||
|
{ 'data': 'tipo' ,
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
if(data=='interior')
|
||||||
|
return '<?= lang('ClientePrecios.interior') ?>';
|
||||||
|
else if(data=='cubierta')
|
||||||
|
return '<?= lang('ClientePrecios.cubierta') ?>';
|
||||||
|
else if(data=='sobrecubierta')
|
||||||
|
return '<?= lang('ClientePrecios.sobrecubierta') ?>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'tipo_maquina',
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
if(data=='toner')
|
||||||
|
return '<?= lang('ClientePrecios.toner') ?>';
|
||||||
|
else if(data=='inkjet')
|
||||||
|
return '<?= lang('ClientePrecios.inkjet') ?>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'tipo_impresion',
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
if(data=='negro')
|
||||||
|
return '<?= lang('ClientePrecios.negro') ?>';
|
||||||
|
else if(data=='negrohq')
|
||||||
|
return '<?= lang('ClientePrecios.negrohq') ?>';
|
||||||
|
else if(data=='color')
|
||||||
|
return '<?= lang('ClientePrecios.color') ?>';
|
||||||
|
else if(data=='colorhq')
|
||||||
|
return '<?= lang('ClientePrecios.colorhq') ?>';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'tiempo_min' },
|
||||||
|
{ 'data': 'tiempo_max' },
|
||||||
|
{ 'data': 'precio_hora' },
|
||||||
|
{ 'data': 'margen' },
|
||||||
|
{ 'data': 'user_updated_id',
|
||||||
|
'render': function ( data, type, row, meta ) {
|
||||||
|
return row.user_updated
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ 'data': 'updated_at' },
|
||||||
|
{
|
||||||
|
data: actionBtns_lineas,
|
||||||
|
className: 'row-edit dt-center'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
orderable: false,
|
||||||
|
searchable: false,
|
||||||
|
targets: [lastColNr_lineas]
|
||||||
|
},
|
||||||
|
{"orderData": [ 0, 1 ], "targets": 0 },
|
||||||
|
|
||||||
|
],
|
||||||
|
language: {
|
||||||
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
|
},
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
extend: 'collection',
|
||||||
|
text: 'Exportar',
|
||||||
|
buttons:[
|
||||||
|
'copy', 'csv', 'excel', 'print', {
|
||||||
|
extend: 'pdfHtml5',
|
||||||
|
orientation: 'landscape',
|
||||||
|
pageSize: 'A4'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
className: 'btn btn-primary me-sm-3 me-1',
|
||||||
|
extend: "createInline",
|
||||||
|
editor: editor,
|
||||||
|
formOptions: {
|
||||||
|
submitTrigger: -1,
|
||||||
|
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>'
|
||||||
|
}
|
||||||
|
} ]
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Activate an inline edit on click of a table cell
|
||||||
|
$('#tableOfPlantillasPreciosLineas').on( 'click', 'tbody span.edit', function (e) {
|
||||||
|
editor.inline(
|
||||||
|
theTable.cells(this.parentNode.parentNode, '*').nodes(),
|
||||||
|
{
|
||||||
|
cancelHtml: '<a href="javascript:void(0);"><i class="ti ti-x"></i></a>',
|
||||||
|
cancelTrigger: 'span.cancel',
|
||||||
|
submitHtml: '<a href="javascript:void(0);"><i class="ti ti-device-floppy"></i></a>',
|
||||||
|
submitTrigger: 'span.edit',
|
||||||
|
submit: 'allIfChanged'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
// Delete row
|
||||||
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
|
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-remove', function(e) {
|
||||||
|
const dataId = $(this).attr('data-id');
|
||||||
|
const row = $(this).closest('tr');
|
||||||
|
if ($.isNumeric(dataId)) {
|
||||||
|
$.ajax({
|
||||||
|
url: `/clientes/clienteplantillaprecioslineas/delete/${dataId}`,
|
||||||
|
method: 'GET',
|
||||||
|
}).done((data, textStatus, jqXHR) => {
|
||||||
|
$('#confirm2delete').modal('toggle');
|
||||||
|
theTable.clearPipeline();
|
||||||
|
theTable.row($(row)).invalidate().draw();
|
||||||
|
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||||
|
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||||
|
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?=$this->section('css') ?>
|
||||||
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.dataTables.min.css') ?>">
|
||||||
|
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||||
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('additionalExternalJs') ?>
|
<?= $this->section('additionalExternalJs') ?>
|
||||||
<script
|
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/dataTables.buttons.min.js") ?>"></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
|
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.html5.min.js") ?>"></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.print.min.js") ?>"></script>
|
||||||
<script
|
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></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/pdfmake/pdfmake.min.js") ?>" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<script
|
<script src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/pdfmake/vfs_fonts.js") ?>"></script>
|
||||||
src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.print.min.js") ?>"></script>
|
<script src="<?= site_url('themes/vuexy/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
||||||
<script
|
<?=$this->endSection() ?>
|
||||||
src="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/jszip/jszip.min.js") ?>"></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/js/datatables-editor/dataTables.editor.min.js') ?>"></script>
|
|
||||||
<?php if (str_contains($formAction, 'edit')): ?>
|
|
||||||
<script type="module"
|
|
||||||
src="<?= site_url('assets/js/safekat/pages/plantillasTarifasCliente/edit.js') ?>"></script>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
|
|||||||
@ -10,16 +10,14 @@
|
|||||||
<h3 class="card-title"><?=lang('ClientePrecios.plantillaPrecios_list') ?></h3>
|
<h3 class="card-title"><?=lang('ClientePrecios.plantillaPrecios_list') ?></h3>
|
||||||
<?=anchor(route_to('newClienteplantillaprecios'), lang('Basic.global.addNew').' '.lang('ClientePrecios.plantillaPrecios_name'), ['class'=>'btn btn-primary float-end']); ?>
|
<?=anchor(route_to('newClienteplantillaprecios'), lang('Basic.global.addNew').' '.lang('ClientePrecios.plantillaPrecios_name'), ['class'=>'btn btn-primary float-end']); ?>
|
||||||
</div><!--//.card-header -->
|
</div><!--//.card-header -->
|
||||||
<?= csrf_field() ?>
|
<div class="card-body">
|
||||||
<div class="card-body">
|
|
||||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||||
|
|
||||||
<table id="tableOfClienteplantillaprecios" class="table table-striped table-hover using-exportable-data-table" style="width: 100%;">
|
<table id="tableOfClienteplantillaprecios" class="table table-striped table-hover using-exportable-data-table" style="width: 100%;">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
|
||||||
<th><?= lang('ClientePrecios.nombre') ?></th>
|
<th><?= lang('ClientePrecios.nombre') ?></th>
|
||||||
<th class="noFilter text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -52,6 +50,100 @@
|
|||||||
|
|
||||||
<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 type="module" src="<?= site_url('assets/js/safekat/pages/plantillasTarifasCliente/list.js') ?>"></script>
|
|
||||||
|
|
||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
|
<?=$this->section('additionalInlineJs') ?>
|
||||||
|
|
||||||
|
const lastColNr2 = $(".using-exportable-data-table").find("tr:first th").length - 1;
|
||||||
|
const actionBtns2 = function(data) {
|
||||||
|
return `
|
||||||
|
<span class="edit"><a href="javascript:void(0);"><i class="ti ti-pencil ti-sm btn-edit mx-2" data-id="${data.id}"></i></a></span>
|
||||||
|
<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete mx-2" data-id="${data.id}" data-bs-toggle="modal" data-bs-target="#confirm2delete"></i></a>
|
||||||
|
<span class="cancel"></span>
|
||||||
|
`;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-edit', function(e) {
|
||||||
|
window.location.href = `/clientes/clienteplantillaprecios/edit/${$(this).attr('data-id')}`;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// Delete row
|
||||||
|
$(document).on('click', '.btn-delete', function(e) {
|
||||||
|
$(".btn-remove").attr('data-id', $(this).attr('data-id'));
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('click', '.btn-remove', function(e) {
|
||||||
|
const dataId = $(this).attr('data-id');
|
||||||
|
const row = $(this).closest('tr');
|
||||||
|
if ($.isNumeric(dataId)) {
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: `/clientes/clienteplantillaprecios/delete/${dataId}`,
|
||||||
|
method: 'GET',
|
||||||
|
}).done((data, textStatus, jqXHR) => {
|
||||||
|
$('#confirm2delete').modal('toggle');
|
||||||
|
tablePLantillaPrecios.clearPipeline();
|
||||||
|
tablePLantillaPrecios.row($(row)).invalidate().draw();
|
||||||
|
|
||||||
|
// Se borran las lineas asociadas
|
||||||
|
const domain = window.location.origin
|
||||||
|
fetch(domain + "/clientes/clienteplantillaprecios/update/" + dataId , {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify({
|
||||||
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
|
}),
|
||||||
|
headers: {
|
||||||
|
"Content-type": "application/json; charset=UTF-8"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
popSuccessAlert(data.msg ?? jqXHR.statusText);
|
||||||
|
}).fail((jqXHR, textStatus, errorThrown) => {
|
||||||
|
popErrorAlert(jqXHR.responseJSON.messages.error)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
var tablePLantillaPrecios = $('#tableOfClienteplantillaprecios').DataTable( {
|
||||||
|
serverSide: true,
|
||||||
|
processing: true,
|
||||||
|
autoWidth: true,
|
||||||
|
responsive: true,
|
||||||
|
lengthMenu: [ 5, 10, 25, 50, 75, 100, 250],
|
||||||
|
order: [[ 0, "asc" ]],
|
||||||
|
pageLength: 25,
|
||||||
|
lengthChange: true,
|
||||||
|
searching: true,
|
||||||
|
paging: true,
|
||||||
|
info: true,
|
||||||
|
stateSave: true,
|
||||||
|
dom: "lftp",
|
||||||
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
|
url: '<?= route_to('dataTableOfClientesplantillaprecios') ?>',
|
||||||
|
method: 'POST',
|
||||||
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
|
async: true,
|
||||||
|
}),
|
||||||
|
columns: [
|
||||||
|
{ data: 'nombre'},
|
||||||
|
{ data: actionBtns2,
|
||||||
|
className: 'row-edit dt-center'}
|
||||||
|
],
|
||||||
|
columnDefs: [
|
||||||
|
{
|
||||||
|
orderable: false,
|
||||||
|
targets: [lastColNr2]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
searchable: false,
|
||||||
|
targets: [lastColNr2]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
language: {
|
||||||
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
<?=$this->endSection() ?>
|
||||||
@ -99,17 +99,6 @@
|
|||||||
</div><!--//.form-check -->
|
</div><!--//.form-check -->
|
||||||
</div><!--//.mb-3 -->
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<div class="form-check">
|
|
||||||
|
|
||||||
<label for="use_for_tapa_dura" class="form-check-label">
|
|
||||||
<input <?= $papelImpresion->cubierta? ' ' : 'disabled ' ?> type="checkbox" id="useForTapaDura" name="use_for_tapa_dura" value="1" class="form-check-input"
|
|
||||||
<?= $papelImpresion->use_for_tapa_dura == true ? 'checked' : ''; ?>>
|
|
||||||
<?= lang('PapelImpresion.use_for_tapa_dura') ?>
|
|
||||||
</label>
|
|
||||||
</div><!--//.form-check -->
|
|
||||||
</div><!--//.mb-3 -->
|
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<div class="form-check">
|
<div class="form-check">
|
||||||
|
|
||||||
|
|||||||
@ -403,16 +403,6 @@
|
|||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
$('#cubierta').on('change', function() {
|
|
||||||
if($(this).is(':checked')) {
|
|
||||||
$('#useForTapaDura').prop('disabled', false);
|
|
||||||
$('#useForTapaDura').prop('checked', false);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
$('#useForTapaDura').prop('disabled', true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
// Etiquetas para las tipologias
|
// Etiquetas para las tipologias
|
||||||
const tipoTypes = [
|
const tipoTypes = [
|
||||||
|
|||||||
@ -25,7 +25,6 @@
|
|||||||
<th><?= lang('PapelImpresion.bn') ?></th>
|
<th><?= lang('PapelImpresion.bn') ?></th>
|
||||||
<th><?= lang('PapelImpresion.color') ?></th>
|
<th><?= lang('PapelImpresion.color') ?></th>
|
||||||
<th><?= lang('PapelImpresion.cubierta') ?></th>
|
<th><?= lang('PapelImpresion.cubierta') ?></th>
|
||||||
<th><?= lang('PapelImpresion.use_for_tapa_dura') ?></th>
|
|
||||||
<th><?= lang('PapelImpresion.sobrecubierta') ?></th>
|
<th><?= lang('PapelImpresion.sobrecubierta') ?></th>
|
||||||
<th><?= lang('PapelImpresion.guardas') ?></th>
|
<th><?= lang('PapelImpresion.guardas') ?></th>
|
||||||
<th><?= lang('PapelImpresion.inkjet') ?></th>
|
<th><?= lang('PapelImpresion.inkjet') ?></th>
|
||||||
@ -105,7 +104,6 @@
|
|||||||
{ 'data': 'bn' },
|
{ 'data': 'bn' },
|
||||||
{ 'data': 'color' },
|
{ 'data': 'color' },
|
||||||
{ 'data': 'cubierta' },
|
{ 'data': 'cubierta' },
|
||||||
{ 'data': 'use_for_tapa_dura'},
|
|
||||||
{ 'data': 'sobrecubierta' },
|
{ 'data': 'sobrecubierta' },
|
||||||
{ 'data': 'guardas' },
|
{ 'data': 'guardas' },
|
||||||
{ 'data': 'inkjet' },
|
{ 'data': 'inkjet' },
|
||||||
@ -118,7 +116,7 @@
|
|||||||
|
|
||||||
|
|
||||||
theTable.on( 'draw.dt', function () {
|
theTable.on( 'draw.dt', function () {
|
||||||
const boolCols = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
|
const boolCols = [3, 4, 5, 6, 7, 8, 9, 10, 11];
|
||||||
for (let coln of boolCols) {
|
for (let coln of boolCols) {
|
||||||
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
|
||||||
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
cell.innerHTML = cell.innerHTML == '1' ? '<i class="ti ti-check"></i>' : '';
|
||||||
|
|||||||
@ -1,37 +0,0 @@
|
|||||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
|
||||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
|
||||||
|
|
||||||
<?= $this->section('content'); ?>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
|
|
||||||
<div class="card card-info">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3 class="card-title"><?= lang('ServicioCliente.cardTitle') ?></h3>
|
|
||||||
</div>
|
|
||||||
<!--//.card-header -->
|
|
||||||
<div class="card-body" id="serviciosClienteCard">
|
|
||||||
|
|
||||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
|
||||||
|
|
||||||
<?= view('themes/vuexy/components/forms/servicio_cliente', ["id" => "formServicioCliente"]); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!--//.card-body -->
|
|
||||||
<div class="card-footer">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!--//.card-footer -->
|
|
||||||
</div>
|
|
||||||
<!--//.card -->
|
|
||||||
</div>
|
|
||||||
<!--//.col -->
|
|
||||||
</div>
|
|
||||||
<!--//.row -->
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
|
||||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/configuracion/servicio_cliente/edit.js") ?>">
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
|
||||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
|
||||||
|
|
||||||
<?= $this->section('content'); ?>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
|
|
||||||
<div class="card card-info">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3 class="card-title"><?= lang('ServicioCliente.cardTitle') ?></h3>
|
|
||||||
</div>
|
|
||||||
<!--//.card-header -->
|
|
||||||
<div class="card-body" id="serviciosClienteCard">
|
|
||||||
|
|
||||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
|
||||||
|
|
||||||
<?= view('themes/vuexy/components/tables/servicios_cliente_table', ["id" => "tableServiciosCliente"]); ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!--//.card-body -->
|
|
||||||
<div class="card-footer">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!--//.card-footer -->
|
|
||||||
</div>
|
|
||||||
<!--//.card -->
|
|
||||||
</div>
|
|
||||||
<!--//.col -->
|
|
||||||
</div>
|
|
||||||
<!--//.row -->
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
|
||||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/configuracion/servicio_cliente/index.js") ?>">
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,73 +1,10 @@
|
|||||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
<?= $this->include("themes/_commonPartialsBs/select2bs5") ?>
|
||||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
<?= $this->include("themes/_commonPartialsBs/datatables") ?>
|
||||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
|
||||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('content'); ?>
|
<?= $this->section('content'); ?>
|
||||||
<!--Content Body-->
|
<!--Content Body-->
|
||||||
<div class="row">
|
<div class="container-xxl flex-grow-1 container-p-y">
|
||||||
<div class="col-md-12">
|
<?= view("themes/vuexy/components/chat_general", data: ["modelId" => null]) ?>
|
||||||
<div class="nav-tabs-shadow nav-align-top">
|
|
||||||
<ul class="nav nav-tabs" role="tablist">
|
|
||||||
<li class="nav-item">
|
|
||||||
<button type="button" class="nav-link active" role="tab" id="navs-top-align-directos-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-directos">Directos</button>
|
|
||||||
</li>
|
|
||||||
<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">Presupuestos</button>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-pedidos-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-pedidos">Pedidos</button>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<button type="button" class="nav-link" role="tab" id="navs-top-align-facturas-tab" data-bs-toggle="tab" data-bs-target="#navs-top-align-facturas">Facturas</button>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
<div class="tab-content" id="message-datatables-container">
|
|
||||||
<div class="tab-pane fade show active" id="navs-top-align-directos">
|
|
||||||
<?php if (auth()->user()->inGroup('admin')) { ?>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12 d-flex justify-content-start">
|
|
||||||
<button class="btn btn-primary" id="btn-new-message"><span class="ti ti-md ti-plus"></span>Nuevo mensaje</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?= view("themes/vuexy/components/tables/messages_table", ["id" => "tableMessages"]) ?>
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane fade show" id="navs-top-align-presupuestos">
|
|
||||||
<?= view("themes/vuexy/components/tables/messages_table", ["id" => "tablePresupuestoMessages"]) ?>
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane fade show" id="navs-top-align-pedidos">
|
|
||||||
<?= view("themes/vuexy/components/tables/messages_table", ["id" => "tablePedidoMessages"]) ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="tab-pane fade show" id="navs-top-align-facturas">
|
|
||||||
<?= view("themes/vuexy/components/tables/messages_table", ["id" => "tableFacturaMessages"]) ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--//.card -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--//.col -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= view("themes/vuexy/components/modals/modalNewDirectMessage") ?>
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $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/css/pages/app-chat.css') ?>">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
|
||||||
<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/AutoFocus.min.js") ?>"></script>
|
|
||||||
<script type="module" src="<?= site_url('assets/js/safekat/pages/configuracion/messages/index.js') ?>">
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,27 +0,0 @@
|
|||||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
|
||||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('content'); ?>
|
|
||||||
<!--Content Body-->
|
|
||||||
<div class="row">
|
|
||||||
<?= view("themes/vuexy/components/chat_direct",["modelId" => $chatId,"userId" => auth()->user()->id]) ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $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/css/pages/app-chat.css') ?>">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
|
||||||
<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/AutoFocus.min.js") ?>"></script>
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
|
||||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('content'); ?>
|
|
||||||
<!--Content Body-->
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
|
|
||||||
<?= view("themes/vuexy/components/chat_factura",["modelId" => $modelId]) ?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $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/css/pages/app-chat.css') ?>">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
|
||||||
<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/AutoFocus.min.js") ?>"></script>
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
|
||||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('content'); ?>
|
|
||||||
<!--Content Body-->
|
|
||||||
<div class="row">
|
|
||||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => $type]) ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $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/css/pages/app-chat.css') ?>">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
|
||||||
<script type="module" src="<?= site_url("assets/js/safekat/pages/messages/internalMessagePage.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/AutoFocus.min.js") ?>"></script>
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
|
||||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('content'); ?>
|
|
||||||
<!--Content Body-->
|
|
||||||
<div class="row">
|
|
||||||
<?= view("themes/vuexy/components/chat_pedido",["modelId" => $modelId]) ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $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/css/pages/app-chat.css') ?>">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
|
||||||
<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/AutoFocus.min.js") ?>"></script>
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
<?= $this->include('themes/_commonPartialsBs/select2bs5') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/datatables') ?>
|
|
||||||
<?= $this->include('themes/_commonPartialsBs/_confirm2delete') ?>
|
|
||||||
<?= $this->extend('themes/vuexy/main/defaultlayout') ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->section('content'); ?>
|
|
||||||
<!--Content Body-->
|
|
||||||
<div class="row">
|
|
||||||
<?= view("themes/vuexy/components/chat_presupuesto", ["modelId" => $modelId]) ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $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/css/pages/app-chat.css') ?>">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
<?= $this->section("additionalExternalJs") ?>
|
|
||||||
<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/AutoFocus.min.js") ?>"></script>
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -19,24 +19,15 @@
|
|||||||
<?= view("themes/vuexy/form/pedidos/_cabeceraItems") ?>
|
<?= view("themes/vuexy/form/pedidos/_cabeceraItems") ?>
|
||||||
<?= view("themes/vuexy/form/pedidos/_lineasItems") ?>
|
<?= view("themes/vuexy/form/pedidos/_lineasItems") ?>
|
||||||
<?php if (!(auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor'))) : ?>
|
<?php if (!(auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor'))) : ?>
|
||||||
<?= view("themes/vuexy/form/pedidos/_albaranesItems") ?>
|
<?= view("themes/vuexy/form/pedidos/_albaranesItems") ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?= view("themes/vuexy/form/pedidos/_facturasItems") ?>
|
<?= view("themes/vuexy/form/pedidos/_facturasItems") ?>
|
||||||
<?= view("themes/vuexy/components/chat_internal_pedido", data: ["modelId" => $pedidoEntity->id, "type" => "pedido"]) ?>
|
<?= view("themes/vuexy/components/chat_internal_pedido", data: ["modelId" => $pedidoEntity->id,"type" => "pedido"]) ?>
|
||||||
</div><!-- /.card-body -->
|
</div><!-- /.card-body -->
|
||||||
|
<div class="pt-4">
|
||||||
|
<?= anchor(route_to("listaPresupuestos"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
||||||
|
</div><!-- /.card-footer -->
|
||||||
</form>
|
</form>
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12 d-flex justify-content-between">
|
|
||||||
<div class="pt-4">
|
|
||||||
<?= anchor(route_to("listaPresupuestos"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start"]) ?>
|
|
||||||
</div><!-- /.card-footer -->
|
|
||||||
<div class="pt-4">
|
|
||||||
<button class="btn btn-primary btn-md"><span> <i class="ti ti-building-factory-2 ti-xs"></i> <?= lang("Produccion.btn_pedido_produccion_accion") ?> </span></button>
|
|
||||||
</div><!-- /.card-footer -->
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div><!-- //.card -->
|
</div><!-- //.card -->
|
||||||
</div>
|
</div>
|
||||||
<!--//.col -->
|
<!--//.col -->
|
||||||
|
|||||||
@ -777,7 +777,7 @@ function convertirTiempo(horas){
|
|||||||
// se convierte a formato hh:mm:ss
|
// se convierte a formato hh:mm:ss
|
||||||
const h = Math.floor(seconds / 3600);
|
const h = Math.floor(seconds / 3600);
|
||||||
const minutos = Math.floor((seconds % 3600) / 60);
|
const minutos = Math.floor((seconds % 3600) / 60);
|
||||||
const segundos = Math.round(seconds % 60, 0);
|
const segundos = round(seconds % 60, 0);
|
||||||
return h + ':' + minutos + ':' + segundos;
|
return h + ':' + minutos + ':' + segundos;
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@ -318,8 +318,6 @@
|
|||||||
|
|
||||||
init_servicio_extra()
|
init_servicio_extra()
|
||||||
|
|
||||||
/* ELIMINADO PARA COMPROBAR EL MAXIMO DE SOLAPAS DESDE EL BACKEND
|
|
||||||
PENDIENTE
|
|
||||||
$('.solapas_cubierta').on('change', function(){
|
$('.solapas_cubierta').on('change', function(){
|
||||||
|
|
||||||
const ancho_libro = getDimensionLibro().ancho;
|
const ancho_libro = getDimensionLibro().ancho;
|
||||||
@ -339,7 +337,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#compGramajeCubierta').trigger('change')
|
$('#compGramajeCubierta').trigger('change')
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -363,7 +360,5 @@
|
|||||||
|
|
||||||
$('#compGramajeSobrecubierta').trigger('change')
|
$('#compGramajeSobrecubierta').trigger('change')
|
||||||
})
|
})
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|||||||
@ -54,7 +54,7 @@
|
|||||||
<label <?= (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) ? " hidden" : "" ?> id="label_clienteId" for="clienteId" class="form-label">
|
<label <?= (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) ? " hidden" : "" ?> id="label_clienteId" for="clienteId" class="form-label">
|
||||||
Cliente*
|
Cliente*
|
||||||
</label>
|
</label>
|
||||||
<select <?= (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) ? " hidden" : "" ?> id="clienteId" name="cliente_id" class="form-control select2bs2 calcular-presupuesto calcular-solapas"
|
<select <?= (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) ? " hidden" : "" ?> id="clienteId" name="cliente_id" class="form-control select2bs2 calcular-presupuesto"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
<?php if (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')): ?>
|
<?php if (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')): ?>
|
||||||
<option value="<?= $clienteId ?>" selected>cliente</option>
|
<option value="<?= $clienteId ?>" selected>cliente</option>
|
||||||
@ -63,10 +63,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="divExcluirRotativa"
|
<div
|
||||||
class="col-sm-5 mb-3 d-flex flex-column align-items-center <?= (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) ? " d-none" : "" ?>">
|
class="col-sm-5 mb-3 d-flex flex-column align-items-center <?= (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) ? " d-none" : "" ?>">
|
||||||
<div class="form-check form-switch mb-2">
|
<div class="form-check form-switch mb-2">
|
||||||
<input <?= (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) ? " hidden" : "" ?> class=" calcular-solapas calcular-presupuesto form-check-input" type="checkbox" id="excluirRotativa"
|
<input <?= (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) ? " hidden" : "" ?> class="calcular-presupuesto form-check-input" type="checkbox" id="excluirRotativa"
|
||||||
name="excluir_rotativa" value="1">
|
name="excluir_rotativa" value="1">
|
||||||
<label <?= (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) ? " hidden" : "" ?> class="form-check-label" for="excluirRotativa">Excluir rotativa</label>
|
<label <?= (auth()->user()->inGroup('cliente-admin') || auth()->user()->inGroup('cliente-editor')) ? " hidden" : "" ?> class="form-check-label" for="excluirRotativa">Excluir rotativa</label>
|
||||||
</div>
|
</div>
|
||||||
@ -78,7 +78,7 @@
|
|||||||
<label for="tirada" class="form-label">
|
<label for="tirada" class="form-label">
|
||||||
<?= lang('Presupuestos.tirada') ?> 1*
|
<?= lang('Presupuestos.tirada') ?> 1*
|
||||||
</label>
|
</label>
|
||||||
<input type="number" class="calcular-presupuesto calcular-solapas form-control text-center num-input" id="tirada"
|
<input type="number" class="calcular-presupuesto form-control text-center num-input" id="tirada"
|
||||||
name="tirada" step="1" value="50">
|
name="tirada" step="1" value="50">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -86,7 +86,7 @@
|
|||||||
<label for="tirada2" class="form-label">
|
<label for="tirada2" class="form-label">
|
||||||
<?= lang('Presupuestos.tirada') ?> 2
|
<?= lang('Presupuestos.tirada') ?> 2
|
||||||
</label>
|
</label>
|
||||||
<input type="number" class="calcular-presupuesto calcular-solapas form-control text-center num-input" id="tirada2"
|
<input type="number" class="calcular-presupuesto form-control text-center num-input" id="tirada2"
|
||||||
name="tirada2" step="1" value="">
|
name="tirada2" step="1" value="">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -94,7 +94,7 @@
|
|||||||
<label for="tirada3" class="form-label">
|
<label for="tirada3" class="form-label">
|
||||||
<?= lang('Presupuestos.tirada') ?> 3
|
<?= lang('Presupuestos.tirada') ?> 3
|
||||||
</label>
|
</label>
|
||||||
<input type="number" class="calcular-presupuesto calcular-solapas form-control text-center num-input" id="tirada3"
|
<input type="number" class="calcular-presupuesto form-control text-center num-input" id="tirada3"
|
||||||
name="tirada3" step="1" value="">
|
name="tirada3" step="1" value="">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -102,7 +102,7 @@
|
|||||||
<label for="tirada4" class="form-label">
|
<label for="tirada4" class="form-label">
|
||||||
<?= lang('Presupuestos.tirada') ?> 4
|
<?= lang('Presupuestos.tirada') ?> 4
|
||||||
</label>
|
</label>
|
||||||
<input type="number" class="calcular-presupuesto calcular-solapas form-control text-center num-input" id="tirada4"
|
<input type="number" class="calcular-presupuesto form-control text-center num-input" id="tirada4"
|
||||||
name="tirada4" step="1" value="">
|
name="tirada4" step="1" value="">
|
||||||
</div>
|
</div>
|
||||||
</div> <!--//.row -->
|
</div> <!--//.row -->
|
||||||
@ -113,7 +113,7 @@
|
|||||||
<label id="label_papelFormatoId" for="papelFormatoId" class="form-label">
|
<label id="label_papelFormatoId" for="papelFormatoId" class="form-label">
|
||||||
Formato Libro*
|
Formato Libro*
|
||||||
</label>
|
</label>
|
||||||
<select id="papelFormatoId" name="papel_formato_id" class="form-control select2bs2 calcular-presupuesto calcular-solapas"
|
<select id="papelFormatoId" name="papel_formato_id" class="form-control select2bs2 calcular-presupuesto"
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -123,20 +123,20 @@
|
|||||||
<div class="col-sm-3 mb-1 mx-1 div-num-input">
|
<div class="col-sm-3 mb-1 mx-1 div-num-input">
|
||||||
<label class="form-label" for="papelFormatoAncho">Ancho Libro*</label>
|
<label class="form-label" for="papelFormatoAncho">Ancho Libro*</label>
|
||||||
<input type="number" id="papelFormatoAncho" name="papel_formato_ancho" step="1"
|
<input type="number" id="papelFormatoAncho" name="papel_formato_ancho" step="1"
|
||||||
class="form-control formato_libro calcular-presupuesto calcular-solapas num-input" min="110" value="110">
|
class="form-control formato_libro calcular-presupuesto num-input" min="110" value="110">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-sm-3 mb-1 mx-1 div-num-input">
|
<div class="col-sm-3 mb-1 mx-1 div-num-input">
|
||||||
<label class="form-label" for="papelFormatoAlto">Alto Libro*</label>
|
<label class="form-label" for="papelFormatoAlto">Alto Libro*</label>
|
||||||
<input type="number" id="papelFormatoAlto" name="papel_formato_alto" step="1"
|
<input type="number" id="papelFormatoAlto" name="papel_formato_alto" step="1"
|
||||||
class="form-control formato_libro calcular-presupuesto calcular-solapas num-input" min="170" value="170">
|
class="form-control formato_libro calcular-presupuesto num-input" min="170" value="170">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row col-sm-4 mb-3 d-flex flex-column align-items-center">
|
<div class="row col-sm-4 mb-3 d-flex flex-column align-items-center">
|
||||||
<div class="form-check form-switch mb-2">
|
<div class="form-check form-switch mb-2">
|
||||||
<input class="calcular-presupuesto calcular-solapas form-check-input" type="checkbox" id="papelFormatoPersonalizado"
|
<input class="calcular-presupuesto form-check-input" type="checkbox" id="papelFormatoPersonalizado"
|
||||||
name="papel_formato_personalizado" value="1">
|
name="papel_formato_personalizado" value="1">
|
||||||
<label class="form-check-label"
|
<label class="form-check-label"
|
||||||
for="papelFormatoPersonalizado"><?= lang('Presupuestos.papelFormatoPersonalizado') ?></label>
|
for="papelFormatoPersonalizado"><?= lang('Presupuestos.papelFormatoPersonalizado') ?></label>
|
||||||
@ -153,7 +153,7 @@
|
|||||||
<label for="paginasColor" class="form-label">
|
<label for="paginasColor" class="form-label">
|
||||||
<?= lang('Presupuestos.paginasColor') ?>
|
<?= lang('Presupuestos.paginasColor') ?>
|
||||||
</label>
|
</label>
|
||||||
<input type="number" class="form-control calcular-presupuesto calcular-solapas input-paginas num-input" id="paginasColor"
|
<input type="number" class="form-control calcular-presupuesto input-paginas num-input" id="paginasColor"
|
||||||
name="paginasColor" step="1" value="0">
|
name="paginasColor" step="1" value="0">
|
||||||
|
|
||||||
<div class="form-text">
|
<div class="form-text">
|
||||||
@ -166,7 +166,7 @@
|
|||||||
<label for="paginasNegro" class="form-label">
|
<label for="paginasNegro" class="form-label">
|
||||||
<?= lang('Presupuestos.paginasNegro') ?>
|
<?= lang('Presupuestos.paginasNegro') ?>
|
||||||
</label>
|
</label>
|
||||||
<input type="number" class="form-control calcular-presupuesto calcular-solapas input-paginas num-input" id="paginasNegro"
|
<input type="number" class="form-control calcular-presupuesto input-paginas num-input" id="paginasNegro"
|
||||||
name="paginasNegro" step="1" value="32">
|
name="paginasNegro" step="1" value="32">
|
||||||
|
|
||||||
<div class="form-text">
|
<div class="form-text">
|
||||||
@ -179,7 +179,7 @@
|
|||||||
<label for="paginas" class="form-label">
|
<label for="paginas" class="form-label">
|
||||||
<?= lang('Presupuestos.totalPaginas') ?>
|
<?= lang('Presupuestos.totalPaginas') ?>
|
||||||
</label>
|
</label>
|
||||||
<input disabled class="form-control" id="paginas" name="paginas" step="1"
|
<input disabled class="form-control calcular-presupuesto" id="paginas" name="paginas" step="1"
|
||||||
value="32">
|
value="32">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -234,28 +234,28 @@
|
|||||||
|
|
||||||
<div id="divTipoLibro" name="div_tipo_libro" class="row col-sm-10 mb-3 justify-content-center">
|
<div id="divTipoLibro" name="div_tipo_libro" class="row col-sm-10 mb-3 justify-content-center">
|
||||||
|
|
||||||
<div id="fresado" class="tipo-libro calcular-solapas calcular-presupuesto imagen-selector image-container">
|
<div id="fresado" class="tipo-libro calcular-presupuesto imagen-selector image-container">
|
||||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/fresado.png") ?>"
|
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/fresado.png") ?>"
|
||||||
alt="Fresado">
|
alt="Fresado">
|
||||||
<div class="form-text text-center">
|
<div class="form-text text-center">
|
||||||
Fresado (a partir de 32 páginas)
|
Fresado (a partir de 32 páginas)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="grapado" class="tipo-libro calcular-solapas calcular-presupuesto imagen-selector image-container">
|
<div id="grapado" class="tipo-libro calcular-presupuesto imagen-selector image-container">
|
||||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/grapado.png") ?>"
|
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/grapado.png") ?>"
|
||||||
alt="Grapado">
|
alt="Grapado">
|
||||||
<div class="form-text text-center">
|
<div class="form-text text-center">
|
||||||
Grapado (entre 12 y 40 páginas)
|
Grapado (entre 12 y 40 páginas)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="espiral" class="tipo-libro calcular-solapas calcular-presupuesto imagen-selector image-container">
|
<div id="espiral" class="tipo-libro calcular-presupuesto imagen-selector image-container">
|
||||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/espiral.png") ?>"
|
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/espiral.png") ?>"
|
||||||
alt="Espiral">
|
alt="Espiral">
|
||||||
<div class="form-text text-center">
|
<div class="form-text text-center">
|
||||||
Espiral
|
Espiral
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="cosido" class="tipo-libro calcular-solapas calcular-presupuesto imagen-selector image-container">
|
<div id="cosido" class="tipo-libro calcular-presupuesto imagen-selector image-container">
|
||||||
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/cosido.png") ?>"
|
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/cosido.png") ?>"
|
||||||
alt="Cosido">
|
alt="Cosido">
|
||||||
<div class="form-text text-center">
|
<div class="form-text text-center">
|
||||||
|
|||||||
@ -91,7 +91,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<input id="solapasCubierta" name="solapas_cubierta" type="number"
|
<input id="solapasCubierta" name="solapas_cubierta" type="number"
|
||||||
class="calcular-presupuesto form-control text-center num-input" min="60" max="120" step="1" value="60">
|
class="calcular-presupuesto form-control text-center num-input" min="60" max="120" step="1" value="60">
|
||||||
<div id="textoSolapasCubierta" class="form-text">
|
<div class="form-text">
|
||||||
Entre 60 y 120 mm
|
Entre 60 y 120 mm
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -138,29 +138,101 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="textoPapelCubierta" class="col-sm-8 mb-3 d-flex flex-column align-items-center d-none">
|
<div class="col-sm-8 mb-3 d-flex flex-column align-items-center">
|
||||||
<h3 class="mb-1 fw-bold"> Papel cubierta </h3>
|
<h3 class="mb-1 fw-bold"> Papel cubierta </h3>
|
||||||
</div><!--//.mb-3 -->
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
<div id="divPapelCubierta" name="div_papel_cubierta" class="row col-sm-10 mb-5 justify-content-center">
|
<div id="divPapelCubierta" name="div_papel_cubierta" class="row col-sm-10 mb-5 justify-content-center">
|
||||||
</div>
|
|
||||||
|
|
||||||
|
<div id="cartulinaEstucada" cod="CAR1"
|
||||||
<div id="divPapelEspecialCubierta" name="div_papel_especial_cubierta"
|
class="calcular-presupuesto min-width-fit d-flex flex-column align-items-center justify-content-center papel-cubierta imagen-selector image-container">
|
||||||
class="row col-sm-10 mb-3 justify-content-center d-none">
|
<img class="image-presupuesto" src="<?= site_url("assets/img/presupuestoCliente/cartulina-grafica.png") ?>"
|
||||||
<div class="col-sm-5 mb-0">
|
alt="Cartulina estucada">
|
||||||
<label for="titulo" class="form-label">
|
<label class="form-label">
|
||||||
Seleccione el papel especial
|
Cartulina gráfica estucada a una cara
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="estucadoMate" cod="EST2"
|
||||||
|
class="calcular-presupuesto min-width-fit d-flex flex-column align-items-center justify-content-center papel-cubierta imagen-selector image-container">
|
||||||
|
<img class="image-presupuesto"
|
||||||
|
src="<?= site_url("assets/img/presupuestoCliente/estucado-mate-cubierta.png") ?>" alt="Estucado mate">
|
||||||
|
<label class="form-label">
|
||||||
|
Estucado Mate
|
||||||
</label>
|
</label>
|
||||||
<select id="papelEspecialCubiertaSel" name="papel_especial_cubierta"
|
|
||||||
class="form-control select2bs2 calcular-presupuesto col-5 mb-0">
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="divGramajeCubierta" name="div_gramaje_cubierta" class="row col-sm-10 mb-3 justify-content-center d-none">
|
<div id="divGramajeCubierta" name="div_gramaje_cubierta" class="row col-sm-10 mb-3 justify-content-center d-none">
|
||||||
|
|
||||||
|
|
||||||
|
<div id="divGramaje170Cubierta" class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||||
|
<div class="form-check custom-option custom-option-icon gramaje-cubierta">
|
||||||
|
<label class="form-check-label custom-option-content" for="gramaje170Cubierta">
|
||||||
|
<span class="custom-option-body">
|
||||||
|
<span class="custom-option-title"> 170 gr </span>
|
||||||
|
</span>
|
||||||
|
<input id="gramaje170Cubierta" name="gramajeCubiertaRadio" data-value="170"
|
||||||
|
class="check-gramaje-cubierta calcular-presupuesto form-check-input" type="radio" value="170" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="divGramaje250Cubierta" class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||||
|
<div class="form-check custom-option custom-option-icon gramaje-cubierta">
|
||||||
|
<label class="form-check-label custom-option-content" for="gramaje250Cubierta">
|
||||||
|
<span class="custom-option-body">
|
||||||
|
<span class="custom-option-title"> 250 gr </span>
|
||||||
|
</span>
|
||||||
|
<input id="gramaje250Cubierta" name="gramajeCubiertaRadio" data-value="250"
|
||||||
|
class="check-gramaje-cubierta calcular-presupuesto form-check-input" type="radio" value="250" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="divGramaje270Cubierta" class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||||
|
<div class="form-check custom-option custom-option-icon gramaje-cubierta">
|
||||||
|
<label class="form-check-label custom-option-content" for="gramaje270Cubierta">
|
||||||
|
<span class="custom-option-body">
|
||||||
|
<span class="custom-option-title"> 270 gr </span>
|
||||||
|
</span>
|
||||||
|
<input id="gramaje270Cubierta" name="gramajeCubiertaRadio" data-value="270"
|
||||||
|
class="check-gramaje-cubierta calcular-presupuesto form-check-input" type="radio" value="270" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="divGramaje300Cubierta" class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||||
|
<div class="form-check custom-option custom-option-icon gramaje-cubierta">
|
||||||
|
<label class="form-check-label custom-option-content" for="gramaje300Cubierta">
|
||||||
|
<span class="custom-option-body">
|
||||||
|
<span class="custom-option-title"> 300 gr </span>
|
||||||
|
</span>
|
||||||
|
<input id="gramaje300Cubierta" name="gramajeCubiertaRadio" data-value="300"
|
||||||
|
class="check-gramaje-cubierta calcular-presupuesto form-check-input" type="radio" value="300" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-text">
|
||||||
|
Recomendado
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="divGramaje350Cubierta" class="checkbox-presupuesto-container col-md mb-md-0 mb-2">
|
||||||
|
<div class="form-check custom-option custom-option-icon gramaje-cubierta">
|
||||||
|
<label class="form-check-label custom-option-content" for="gramaje350Cubierta">
|
||||||
|
<span class="custom-option-body">
|
||||||
|
<span class="custom-option-title"> 350 gr </span>
|
||||||
|
</span>
|
||||||
|
<input id="gramaje350Cubierta" name="gramajeCubiertaRadio" data-value="350"
|
||||||
|
class="check-gramaje-cubierta calcular-presupuesto form-check-input" type="radio" value="350" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<hr class="col-sm-10 my-10">
|
<hr class="col-sm-10 my-10">
|
||||||
|
|
||||||
<div class="col-sm-8 mb-3 d-flex flex-column align-items-center">
|
<div class="col-sm-8 mb-3 d-flex flex-column align-items-center">
|
||||||
@ -261,7 +333,7 @@
|
|||||||
<input id="solapasSobrecubierta" name="solapas_sobrecubierta" type="number"
|
<input id="solapasSobrecubierta" name="solapas_sobrecubierta" type="number"
|
||||||
class="calcular-presupuesto form-control text-center num-input" min="60" max="120" step="1"
|
class="calcular-presupuesto form-control text-center num-input" min="60" max="120" step="1"
|
||||||
value="60">
|
value="60">
|
||||||
<div id="textoLimitesSolapasSobrecubierta" class="form-text">
|
<div class="form-text">
|
||||||
Entre 60 y 120 mm
|
Entre 60 y 120 mm
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -65,7 +65,7 @@
|
|||||||
Seleccione el papel especial
|
Seleccione el papel especial
|
||||||
</label>
|
</label>
|
||||||
<select id="papelEspecialInterior" name="papel_especial_interior"
|
<select id="papelEspecialInterior" name="papel_especial_interior"
|
||||||
class="form-control select2bs2 calcular-solapas calcular-presupuesto col-5 mb-0">
|
class="form-control select2bs2 calcular-presupuesto col-5 mb-0">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -120,7 +120,7 @@
|
|||||||
Seleccione el papel especial
|
Seleccione el papel especial
|
||||||
</label>
|
</label>
|
||||||
<select id="papelEspecialInteriorColor" name="papel_especial_interior_color"
|
<select id="papelEspecialInteriorColor" name="papel_especial_interior_color"
|
||||||
class="form-control select2bs2 calcular-solapas calcular-presupuesto col-5 mb-0">
|
class="form-control select2bs2 calcular-presupuesto col-5 mb-0">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
<div class="cold-md-12 mt-3">
|
|
||||||
<!-- Comment text area-->
|
|
||||||
<label for="ot-comment" class="form-label"><h4><?= @lang("ot.comment") ?></h4></label>
|
|
||||||
<textarea rows=5 cols="10" type="text" class="form-control w-100" id="ot-comment"></textarea>
|
|
||||||
</div>
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
<div class="accordion accordion-bordered mt-3" id="accordionOtCost">
|
|
||||||
<div class="card accordion-item active">
|
|
||||||
<h2 class="accordion-header">
|
|
||||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtCostTip" aria-expanded="false" aria-controls="accordionOtCostTip">
|
|
||||||
|
|
||||||
<h4> <i class="tf-icon ti-receipt ti-xs ti">Costes producción</i> </h4>
|
|
||||||
</button>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<div id="accordionOtCostTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtCost">
|
|
||||||
<div class="accordion-body">
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
<div class="accordion accordion-bordered mt-3" id="accordionOtDates">
|
|
||||||
<div class="card accordion-item active">
|
|
||||||
<h2 class="accordion-header">
|
|
||||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtDatesTip" aria-expanded="false" aria-controls="accordionOtDatesTip">
|
|
||||||
|
|
||||||
<h4> <i class="tf-icon ti-calendar ti-xs ti">Fechas</i> </h4>
|
|
||||||
</button>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<div id="accordionOtDatesTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtDates">
|
|
||||||
<div class="accordion-body">
|
|
||||||
<div class="row">
|
|
||||||
<!-- Date 1-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("ot.tiempo_procesamiento") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-tiempo-procesamiento" disabled>
|
|
||||||
</div>
|
|
||||||
<!-- Date 2-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("ot.fecha_impresion") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-fecha-impresion">
|
|
||||||
</div>
|
|
||||||
<!-- Date 2-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("ot.fecha_encuadernado") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-fecha-encuadernado">
|
|
||||||
</div>
|
|
||||||
<!-- Date 4-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("ot.fecha_entrega_externo") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-fecha-entrega-externo">
|
|
||||||
</div>
|
|
||||||
<!-- Date 5-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("ot.fecha_entrega_real") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-fecha-entrega-real">
|
|
||||||
</div>
|
|
||||||
<!-- Date 6-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-fecha-entrega" class="form-label"><?= @lang("fecha_entrega_estimada") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-fecha-entrega-estimada">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
<div class="accordion accordion-bordered mt-3" id="accordionOtDetails">
|
|
||||||
<div class="card accordion-item active">
|
|
||||||
<h2 class="accordion-header">
|
|
||||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtDetailsTip" aria-expanded="false" aria-controls="accordionOtDetailsTip">
|
|
||||||
|
|
||||||
<h4> <i class="tf-icon ti-file-info ti-xs ti">Detalles</i> </h4>
|
|
||||||
</button>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<div id="accordionOtDetailsTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtDetails">
|
|
||||||
<div class="accordion-body">
|
|
||||||
<div class="row">
|
|
||||||
<!-- Detail 1-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
|
||||||
<label for="ot-formato" class="form-label"><?= @lang("ot.formato") ?></label>
|
|
||||||
<input type="text" class="form-control" id="ot-formato" disabled>
|
|
||||||
</div>
|
|
||||||
<!-- Detail 2-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
|
||||||
<label for="ot-paginas" class="form-label"><?= @lang("ot.paginas") ?></label>
|
|
||||||
<input type="text" class="form-control" id="ot-paginas" disabled>
|
|
||||||
</div>
|
|
||||||
<!-- Detail 3-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
|
||||||
<label for="ot-solapa" class="form-label"><?= @lang("ot.solapa") ?></label>
|
|
||||||
<input type="text" class="form-control" id="ot-solapa" disabled>
|
|
||||||
</div>
|
|
||||||
<!-- Detail 4-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
|
||||||
<label for="ot-tirada" class="form-label"><?= @lang("ot.tirada") ?></label>
|
|
||||||
<input type="text" class="form-control" id="ot-tirada" disabled>
|
|
||||||
</div>
|
|
||||||
<!-- Detail 5-->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-2 mb-2">
|
|
||||||
<label for="ot-merma" class="form-label"><?= @lang("ot.merma") ?></label>
|
|
||||||
<input type="text" class="form-control" id="ot-merma" disabled>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,77 +0,0 @@
|
|||||||
<div class="row mt-3">
|
|
||||||
<div class="col-md-4 text-start">
|
|
||||||
<label for="text-avisar-comercial">
|
|
||||||
<h4>Gestión de ferros</h4>
|
|
||||||
</label>
|
|
||||||
<p class="text-start">Indica si tiene ferro y las horas de entrega del mismo. Se le enviará un mensaje a comercial asociado indicando cuando estará disponible el ferro.</p>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<div class="row mb-1">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<label for="select-ferro-option" class="form-label">Gestión de envíos</label>
|
|
||||||
<select name="ferro_option" id="select-ferro-option" class="form-control">
|
|
||||||
<option value="0">Sin ferro</option>
|
|
||||||
<option value="1">24h</option>
|
|
||||||
<option value="2">48h</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1">
|
|
||||||
<div class="col-md-2">
|
|
||||||
<label for="codigo-postal" class="form-label">CP</label>
|
|
||||||
<input class="form-control" type="text" name="cp" id="codigo-postal">
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<label for="codigo-seguimiento" class="form-label">Código seguimiento</label>
|
|
||||||
<input class="form-control" type="text" name="codigo_seguimiento" id="codigo-seguimiento">
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<label for="select-empresa-envio-ferro" class="form-label">Empresa envío</label>
|
|
||||||
<select name="empresa_envio" id="select-empresa-envio-ferro" class="form-control">
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mt-3">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<button type="button" class="btn btn-success btn-md w-100">Confirmar envío ferro</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mt-3">
|
|
||||||
<hr>
|
|
||||||
<div class="col-md-4 text-start">
|
|
||||||
<label for="text-avisar-comercial">
|
|
||||||
<h4>Gestión de envíos</h4>
|
|
||||||
</label>
|
|
||||||
<p class="text-start">Introduce el número de seguimiento de envío. Se le enviará un mensaje al cliente asociado indicando el envío y el tracking.</p>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<div class="row mb-1">
|
|
||||||
<div class="col-md-2">
|
|
||||||
<label for="codigo-postal-envio" class="form-label">CP</label>
|
|
||||||
<input class="form-control" type="text" name="cp-envio" id="codigo-postal-envio">
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<label for="n-bultos" class="form-label">N bultos</label>
|
|
||||||
<input class="form-control" min="0" type="number" name="n_bultos" id="n-bultos">
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4">
|
|
||||||
<label for="select-empresa-envio-envio" class="form-label">Empresa envío</label>
|
|
||||||
<select name="empresa_envio" id="select-empresa-envio-envio" class="form-control">
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mt-3">
|
|
||||||
<div class="col-md-6">
|
|
||||||
<button type="button" class="btn btn-primary btn-md w-100">Etiqueda proveedor</button>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<button type="button" class="btn btn-success btn-md w-100">Confirmar envío</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,121 +0,0 @@
|
|||||||
<div class="col-sm-4">
|
|
||||||
<div class="text-light small fw-medium mb-4 text-start">Revisión</div>
|
|
||||||
<div class="d-flex flex-column justify-content-start text-start gap-2">
|
|
||||||
<label class="switch switch-md">
|
|
||||||
<input type="checkbox" class="switch-input" />
|
|
||||||
<span class="switch-toggle-slider">
|
|
||||||
<span class="switch-on">
|
|
||||||
<i class="ti ti-check"></i>
|
|
||||||
</span>
|
|
||||||
<span class="switch-off">
|
|
||||||
<i class="ti ti-x"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span class="switch-label">Revisar formato</span>
|
|
||||||
</label>
|
|
||||||
<label class="switch switch-md">
|
|
||||||
<input type="checkbox" class="switch-input" />
|
|
||||||
<span class="switch-toggle-slider">
|
|
||||||
<span class="switch-on">
|
|
||||||
<i class="ti ti-check"></i>
|
|
||||||
</span>
|
|
||||||
<span class="switch-off">
|
|
||||||
<i class="ti ti-x"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span class="switch-label">Revisar lomo</span>
|
|
||||||
</label>
|
|
||||||
<label class="switch switch-md">
|
|
||||||
<input type="checkbox" class="switch-input" />
|
|
||||||
<span class="switch-toggle-slider">
|
|
||||||
<span class="switch-on">
|
|
||||||
<i class="ti ti-check"></i>
|
|
||||||
</span>
|
|
||||||
<span class="switch-off">
|
|
||||||
<i class="ti ti-x"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span class="switch-label">Revisar solapa</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-4">
|
|
||||||
<div class="text-light small fw-medium mb-4 text-start"> </div>
|
|
||||||
<div class="d-flex flex-column justify-content-start text-start gap-2">
|
|
||||||
<label class="switch switch-md">
|
|
||||||
<input type="checkbox" class="switch-input" />
|
|
||||||
<span class="switch-toggle-slider">
|
|
||||||
<span class="switch-on">
|
|
||||||
<i class="ti ti-check"></i>
|
|
||||||
</span>
|
|
||||||
<span class="switch-off">
|
|
||||||
<i class="ti ti-x"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span class="switch-label">Revisar ISBN,D.L.</span>
|
|
||||||
</label>
|
|
||||||
<label class="switch switch-md">
|
|
||||||
<input type="checkbox" class="switch-input" />
|
|
||||||
<span class="switch-toggle-slider">
|
|
||||||
<span class="switch-on">
|
|
||||||
<i class="ti ti-check"></i>
|
|
||||||
</span>
|
|
||||||
<span class="switch-off">
|
|
||||||
<i class="ti ti-x"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span class="switch-label">Revisar código de barras</span>
|
|
||||||
</label>
|
|
||||||
<label class="switch switch-md">
|
|
||||||
<input type="checkbox" class="switch-input" />
|
|
||||||
<span class="switch-toggle-slider">
|
|
||||||
<span class="switch-on">
|
|
||||||
<i class="ti ti-check"></i>
|
|
||||||
</span>
|
|
||||||
<span class="switch-off">
|
|
||||||
<i class="ti ti-x"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span class="switch-label">Realizar imposición</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
<div class="text-light small fw-medium mb-4 text-start"> </div>
|
|
||||||
<div class="d-flex flex-column justify-content-start text-start gap-2">
|
|
||||||
<label class="switch switch-md">
|
|
||||||
<input type="checkbox" class="switch-input" />
|
|
||||||
<span class="switch-toggle-slider">
|
|
||||||
<span class="switch-on">
|
|
||||||
<i class="ti ti-check"></i>
|
|
||||||
</span>
|
|
||||||
<span class="switch-off">
|
|
||||||
<i class="ti ti-x"></i>
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span class="switch-label">Enviar a imprimir</span>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mt-3">
|
|
||||||
<hr>
|
|
||||||
<div class="col-md-6 text-start">
|
|
||||||
<label for="text-avisar-comercial">
|
|
||||||
<h4>Avisar comercial</h4>
|
|
||||||
</label>
|
|
||||||
<p class="text-start">Enviar un mensaje al comercial indicando que faltan materiales.
|
|
||||||
La orden se marcará y aparecerá en el listado: OTs pendientes de material</p>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-6">
|
|
||||||
<div class="row text-start">
|
|
||||||
<label for="comercial-message" class="form-label">Mensaje al comercial</label>
|
|
||||||
<textarea class="form-control" rows="5" cols="5" style="resize: none;" placeholder="Escriba un mensaje"></textarea>
|
|
||||||
</div>
|
|
||||||
<div class="row mt-3">
|
|
||||||
<button type="button" class="btn btn-primary btn-md p-2">Avisar comercial</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
<div class="accordion accordion-bordered mt-3" id="accordionOtProgress">
|
|
||||||
<div class="card accordion-item active">
|
|
||||||
<h2 class="accordion-header">
|
|
||||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtProgressTip" aria-expanded="false" aria-controls="accordionOtProgressTip">
|
|
||||||
|
|
||||||
<h4> <i class="tf-icon ti-hourglass ti-xs ti">Progreso</i> </h4>
|
|
||||||
</button>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<div id="accordionOtProgressTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtProgress">
|
|
||||||
<div class="accordion-body">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12 mb-3">
|
|
||||||
<label class="form-label" for="ot-progress-bar-parent"><?=@lang("App.progress") ?></label>
|
|
||||||
<div class="progress" id="ot-progress-bar-parent">
|
|
||||||
<div id="ot-progress-bar" class="progress-bar" role="progressbar" style="width: 75%;" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100">75%</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-pendiente-ferro" class="form-label"><?= @lang("ot.pendiente_ferro") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-pendiente-ferro">
|
|
||||||
</div>
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-ferro-cliente" class="form-label"><?= @lang("ot.ferro_cliente") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-ferro-cliente">
|
|
||||||
</div>
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-ferro-ok" class="form-label"><?= @lang("ot.ferro_ok") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-ferro-ok">
|
|
||||||
</div>
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-plakene-traslucido" class="form-label"><?= @lang("ot.plakene_traslucido") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-plakene-traslucido">
|
|
||||||
</div>
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-impresion-color" class="form-label"><?= @lang("ot.impresion_color") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-impresion-color">
|
|
||||||
</div>
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-portada" class="form-label"><?= @lang("ot.portada") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-portada">
|
|
||||||
</div>
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-plastificado-mate" class="form-label"><?= @lang("ot.plastificado_mate") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-plastificado-mate">
|
|
||||||
</div>
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-prep-guillotina" class="form-label"><?= @lang("ot.portada") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-prep-guillotina">
|
|
||||||
</div>
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-espiral" class="form-label"><?= @lang("ot.espiral") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-espiral">
|
|
||||||
</div>
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-embalaje" class="form-label"><?= @lang("ot.embalaje") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-embalaje">
|
|
||||||
</div>
|
|
||||||
<!-- Progress -->
|
|
||||||
<div class="col-xs-12 col-md-4 col-lg-4 mb-2">
|
|
||||||
<label for="ot-envio" class="form-label"><?= @lang("ot.envio") ?></label>
|
|
||||||
<input type="button" class="form-control" placeholder="YYYY-MM-DD" id="ot-envio">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="row">
|
|
||||||
<p><?= @lang("ot.tiempo_estimado") ?> :</p>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<p><?= @lang("ot.tiempo_consumido") ?> :</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="d-grip">
|
|
||||||
<button type="button" class="btn btn-primary btn-block w-100"><?=@lang("ot.finalizar_orden")?></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@ -1,62 +0,0 @@
|
|||||||
<div class="accordion accordion-bordered mt-3" id="accordionOtTasks">
|
|
||||||
<div class="card accordion-item active">
|
|
||||||
<h2 class="accordion-header">
|
|
||||||
<button type="button" class="accordion-button" data-bs-toggle="collapse" data-bs-target="#accordionOtTasksTip" aria-expanded="false" aria-controls="accordionOtTasksTip">
|
|
||||||
|
|
||||||
<h4> <i class="tf-icon ti-list-check ti-xs ti">Tareas</i> </h4>
|
|
||||||
</button>
|
|
||||||
</h2>
|
|
||||||
|
|
||||||
<div id="accordionOtTasksTip" class="accordion-collapse collapse show" data-bs-parent="#accordionOtTasks">
|
|
||||||
<div class="accordion-body">
|
|
||||||
<div class="card text-center">
|
|
||||||
<div class="card-header">
|
|
||||||
<div class="nav-align-top">
|
|
||||||
<ul class="nav nav-pills" role="tablist">
|
|
||||||
<li class="nav-item">
|
|
||||||
<button type="button" class="nav-link d-flex flex-column gap-1 active" role="tab" data-bs-toggle="tab" data-bs-target="#nav-ot-task-general" aria-controls="nav-ot-task-general-active" aria-selected="true">Tareas</button>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<button type="button" class="nav-link d-flex flex-column gap-1" role="tab" data-bs-toggle="tab" data-bs-target="#nav-ot-task-preimpresion" aria-controls="nav-ot-task-preimpresion" aria-selected="false">Preimpresion</button>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<button type="button" class="nav-link d-flex flex-column gap-1" role="tab" data-bs-toggle="tab" data-bs-target="#nav-ot-task-ferro-envio" aria-controls="nav-ot-task-ferro-envio" aria-selected="false">Ferros y envíos</button>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<button type="button" class="nav-link d-flex flex-column gap-1" role="tab" data-bs-toggle="tab" data-bs-target="#nav-ot-task-messages" aria-controls="nav-ot-task-messages" aria-selected="false">Mensajes</button>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- CARD BODY -->
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="tab-content p-0">
|
|
||||||
<!-- TAREAS -->
|
|
||||||
<div class="tab-pane fade show active" id="nav-ot-task-general" role="tabpanel">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<!-- PREIMPRESION -->
|
|
||||||
<div class="tab-pane fade" id="nav-ot-task-preimpresion" role="tabpanel">
|
|
||||||
<div class="row text-start">
|
|
||||||
<?= view("themes/vuexy/form/produccion/ot/otPreimpresionReview") ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- FERROS Y ENVIOS -->
|
|
||||||
<div class="tab-pane fade" id="nav-ot-task-ferro-envio" role="tabpanel">
|
|
||||||
<div class="row text-start">
|
|
||||||
<?= view("themes/vuexy/form/produccion/ot/otFerrosEnvios") ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- MENSAJES -->
|
|
||||||
<div class="tab-pane fade" id="nav-ot-task-messages" role="tabpanel">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user