mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into feat/maquinas-corte-ot
This commit is contained in:
@ -822,6 +822,7 @@ $routes->group('produccion', ['namespace' => 'App\Controllers\Produccion'], func
|
|||||||
$routes->get('rotativa', 'Ordentrabajo::index_planning_rotativa');
|
$routes->get('rotativa', 'Ordentrabajo::index_planning_rotativa');
|
||||||
$routes->get('papel/datatable', 'Ordentrabajo::papel_gramaje_datatable');
|
$routes->get('papel/datatable', 'Ordentrabajo::papel_gramaje_datatable');
|
||||||
$routes->get('papel/plana/datatable', 'Ordentrabajo::papel_pliego_datatable');
|
$routes->get('papel/plana/datatable', 'Ordentrabajo::papel_pliego_datatable');
|
||||||
|
$routes->get('maquina/plana/datatable', 'Ordentrabajo::maquina_plana_datatable');
|
||||||
$routes->get('rotativa/datatable', 'Ordentrabajo::planning_rotativa_datatable');
|
$routes->get('rotativa/datatable', 'Ordentrabajo::planning_rotativa_datatable');
|
||||||
$routes->get('plana/datatable', 'Ordentrabajo::planning_plana_datatable');
|
$routes->get('plana/datatable', 'Ordentrabajo::planning_plana_datatable');
|
||||||
$routes->post('tarea/toggle/corte/(:num)', 'Ordentrabajo::tarea_toggle_corte/$1');
|
$routes->post('tarea/toggle/corte/(:num)', 'Ordentrabajo::tarea_toggle_corte/$1');
|
||||||
|
|||||||
@ -31,6 +31,9 @@ $routes->group('presupuestoadmin', ['namespace' => 'App\Controllers\Presupuestos
|
|||||||
$routes->get('presupuestosCliente', 'Presupuestoadmin::tablaClienteForm');
|
$routes->get('presupuestosCliente', 'Presupuestoadmin::tablaClienteForm');
|
||||||
$routes->get('getSumCliente/(:num)', 'Presupuestoadmin::obtenerTotalPresupuestosCliente/$1');
|
$routes->get('getSumCliente/(:num)', 'Presupuestoadmin::obtenerTotalPresupuestosCliente/$1');
|
||||||
|
|
||||||
|
$routes->get('hasFiles', 'Presupuestoadmin::hasFiles');
|
||||||
|
$routes->post('reprint', 'Presupuestoadmin::reprintPresupuesto');
|
||||||
|
|
||||||
$routes->post('download_zip', 'Presupuestocliente::download_zip', ['as' => 'descargarAdminArchivos']);
|
$routes->post('download_zip', 'Presupuestocliente::download_zip', ['as' => 'descargarAdminArchivos']);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -130,11 +130,10 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$POD = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
|
$POD = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
|
||||||
$ancho = 0;
|
$ancho = 0;
|
||||||
$alto = 0;
|
$alto = 0;
|
||||||
if(isset($sanitizedData['papel_formato_personalizado']) && $sanitizedData['papel_formato_personalizado'] == '1'){
|
if (isset($sanitizedData['papel_formato_personalizado']) && $sanitizedData['papel_formato_personalizado'] == '1') {
|
||||||
$ancho = $sanitizedData['papel_formato_ancho'];
|
$ancho = $sanitizedData['papel_formato_ancho'];
|
||||||
$alto = $sanitizedData['papel_formato_alto'];
|
$alto = $sanitizedData['papel_formato_alto'];
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$papelFormatoModel = new PapelFormatoModel();
|
$papelFormatoModel = new PapelFormatoModel();
|
||||||
$papelFormato = $papelFormatoModel->find($sanitizedData['papel_formato_id']);
|
$papelFormato = $papelFormatoModel->find($sanitizedData['papel_formato_id']);
|
||||||
$ancho = $papelFormato->ancho;
|
$ancho = $papelFormato->ancho;
|
||||||
@ -152,7 +151,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$model = new PresupuestoEncuadernacionesModel();
|
$model = new PresupuestoEncuadernacionesModel();
|
||||||
foreach($servDefectoEnc as $servicio){
|
foreach ($servDefectoEnc as $servicio) {
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'presupuesto_id' => $id,
|
'presupuesto_id' => $id,
|
||||||
@ -238,12 +237,14 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
$postData['updated_at'] = gmdate('Y-m-d H:m:s', time());
|
$postData['updated_at'] = gmdate('Y-m-d H:m:s', time());
|
||||||
|
|
||||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||||
$sanitizedData['user_updated_id'] = auth()->user()->id;
|
$sanitizedData['user_updated_id'] = auth()->user()->id;
|
||||||
|
|
||||||
if(isset($sanitizedData['total_aceptado_revisado']) && $sanitizedData['total_aceptado_revisado'] != 0
|
if (
|
||||||
&& $sanitizedData['total_aceptado_revisado'] != null && $sanitizedData['total_aceptado_revisado'] != ""){
|
isset($sanitizedData['total_aceptado_revisado']) && $sanitizedData['total_aceptado_revisado'] != 0
|
||||||
|
&& $sanitizedData['total_aceptado_revisado'] != null && $sanitizedData['total_aceptado_revisado'] != ""
|
||||||
|
) {
|
||||||
$sanitizedData['aprobado_at'] = $sanitizedData['updated_at'];
|
$sanitizedData['aprobado_at'] = $sanitizedData['updated_at'];
|
||||||
$sanitizedData['aprobado_user_id'] = $sanitizedData['user_updated_id'];
|
$sanitizedData['aprobado_user_id'] = $sanitizedData['user_updated_id'];
|
||||||
}
|
}
|
||||||
@ -369,9 +370,9 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// modificar los datos del pedido y de la factura si no está la factura validada
|
// modificar los datos del pedido y de la factura si no está la factura validada
|
||||||
if ($presupuestoEntity->estado_id == 2){
|
if ($presupuestoEntity->estado_id == 2) {
|
||||||
$facturaModel = model('App\Models\Facturas\FacturaModel');
|
$facturaModel = model('App\Models\Facturas\FacturaModel');
|
||||||
if(!$facturaModel->presupuestoHasFacturaValidada($id)){
|
if (!$facturaModel->presupuestoHasFacturaValidada($id)) {
|
||||||
// se actualiza primero el pedido
|
// se actualiza primero el pedido
|
||||||
$pedidoModel = model('App\Models\Pedidos\PedidoLineaModel');
|
$pedidoModel = model('App\Models\Pedidos\PedidoLineaModel');
|
||||||
$pedidoLineaId = $pedidoModel->where('presupuesto_id', $id)->first()->id;
|
$pedidoLineaId = $pedidoModel->where('presupuesto_id', $id)->first()->id;
|
||||||
@ -437,7 +438,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$this->viewData['POD'] = $this->getPOD();
|
$this->viewData['POD'] = $this->getPOD();
|
||||||
|
|
||||||
$this->viewData['no_envio_base'] = model('App\Models\Clientes\ClienteModel')->where('id', $presupuestoEntity->cliente_id)->first();
|
$this->viewData['no_envio_base'] = model('App\Models\Clientes\ClienteModel')->where('id', $presupuestoEntity->cliente_id)->first();
|
||||||
if($this->viewData['no_envio_base'])
|
if ($this->viewData['no_envio_base'])
|
||||||
$this->viewData['no_envio_base'] = $this->viewData['no_envio_base']->no_envio_base;
|
$this->viewData['no_envio_base'] = $this->viewData['no_envio_base']->no_envio_base;
|
||||||
|
|
||||||
$this->viewData['serviciosAutomaticos'] = [
|
$this->viewData['serviciosAutomaticos'] = [
|
||||||
@ -465,11 +466,11 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
$modelPedidoLinea = new \App\Models\Pedidos\PedidoLineaModel();
|
$modelPedidoLinea = new \App\Models\Pedidos\PedidoLineaModel();
|
||||||
$linea = $modelPedidoLinea->where('presupuesto_id', $id)->first();
|
$linea = $modelPedidoLinea->where('presupuesto_id', $id)->first();
|
||||||
if($linea){
|
if ($linea) {
|
||||||
$this->viewData['pedido_id'] = $linea->pedido_id;
|
$this->viewData['pedido_id'] = $linea->pedido_id;
|
||||||
$modelOrden = new \App\Models\OrdenTrabajo\OrdenTrabajoModel();
|
$modelOrden = new \App\Models\OrdenTrabajo\OrdenTrabajoModel();
|
||||||
$orden = $modelOrden->where('pedido_id', $linea->pedido_id)->first();
|
$orden = $modelOrden->where('pedido_id', $linea->pedido_id)->first();
|
||||||
if($orden){
|
if ($orden) {
|
||||||
$this->viewData['orden_id'] = $orden->id;
|
$this->viewData['orden_id'] = $orden->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -639,7 +640,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$data['comparador']['json_data'] = json_decode($presupuesto->comparador_json_data, true);
|
$data['comparador']['json_data'] = json_decode($presupuesto->comparador_json_data, true);
|
||||||
if ($data['comparador']['json_data'] != null) {
|
if ($data['comparador']['json_data'] != null) {
|
||||||
foreach ($data['comparador']['json_data'] as &$item) {
|
foreach ($data['comparador']['json_data'] as &$item) {
|
||||||
if(intval($item['papel_id'])>0)
|
if (intval($item['papel_id']) > 0)
|
||||||
$item['papel_nombre'] = $modelPapelGenerico->getNombre($item['papel_id'])['nombre'];
|
$item['papel_nombre'] = $modelPapelGenerico->getNombre($item['papel_id'])['nombre'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -663,7 +664,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$data['comentarios_pdf'] = $presupuesto->comentarios_pdf;
|
$data['comentarios_pdf'] = $presupuesto->comentarios_pdf;
|
||||||
$data['comentarios_presupuesto'] = $presupuesto->comentarios_presupuesto;
|
$data['comentarios_presupuesto'] = $presupuesto->comentarios_presupuesto;
|
||||||
$data['comentarios_produccion'] = $presupuesto->comentarios_produccion;
|
$data['comentarios_produccion'] = $presupuesto->comentarios_produccion;
|
||||||
|
|
||||||
|
|
||||||
$data['tiradasAlternativas'] = json_decode($presupuesto->tirada_alternativa_json_data);
|
$data['tiradasAlternativas'] = json_decode($presupuesto->tirada_alternativa_json_data);
|
||||||
|
|
||||||
@ -694,9 +695,9 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$data['resumen']['total_factor_ponderado'] = is_numeric($presupuesto->total_factor_ponderado) ? $presupuesto->total_factor_ponderado : 0;
|
$data['resumen']['total_factor_ponderado'] = is_numeric($presupuesto->total_factor_ponderado) ? $presupuesto->total_factor_ponderado : 0;
|
||||||
|
|
||||||
$data['total_aceptado_revisado'] = $presupuesto->total_aceptado_revisado;
|
$data['total_aceptado_revisado'] = $presupuesto->total_aceptado_revisado;
|
||||||
$data['aprobado_by_at'] = ($presupuesto->aprobado_user_id != null)?
|
$data['aprobado_by_at'] = ($presupuesto->aprobado_user_id != null) ?
|
||||||
model('App\Models\Usuarios\UserModel')->getFullName($presupuesto->aprobado_user_id) . ', '
|
model('App\Models\Usuarios\UserModel')->getFullName($presupuesto->aprobado_user_id) . ', '
|
||||||
. date('d/m/Y H:i:s', strtotime($presupuesto->aprobado_at)):'';
|
. date('d/m/Y H:i:s', strtotime($presupuesto->aprobado_at)) : '';
|
||||||
|
|
||||||
|
|
||||||
$data['resumen']['iva_reducido'] = $presupuesto->iva_reducido;
|
$data['resumen']['iva_reducido'] = $presupuesto->iva_reducido;
|
||||||
@ -817,7 +818,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$paginas_color = $sobrecubierta['datosPedido']['paginas'] ?? 0;
|
$paginas_color = $sobrecubierta['datosPedido']['paginas'] ?? 0;
|
||||||
$tipo_impresion_id = $sobrecubierta['tipo_impresion_id'];
|
$tipo_impresion_id = $sobrecubierta['tipo_impresion_id'];
|
||||||
$faja = intval($sobrecubierta['faja'] ?? 0);
|
$faja = intval($sobrecubierta['faja'] ?? 0);
|
||||||
$uso = $faja==1? 'faja' : $sobrecubierta['uso'];
|
$uso = $faja == 1 ? 'faja' : $sobrecubierta['uso'];
|
||||||
|
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
@ -1082,20 +1083,22 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
$resourceData = PresupuestoService::obtenerComparadorPlana($input_data);
|
$resourceData = PresupuestoService::obtenerComparadorPlana($input_data);
|
||||||
|
|
||||||
if($calcular_merma == 1 && count($resourceData) > 0 &&
|
if (
|
||||||
count($resourceData[0]['fields']) >0 && $resourceData[0]['fields']['num_formas'] > 0) {
|
$calcular_merma == 1 && count($resourceData) > 0 &&
|
||||||
|
count($resourceData[0]['fields']) > 0 && $resourceData[0]['fields']['num_formas'] > 0
|
||||||
|
) {
|
||||||
|
|
||||||
usort($resourceData, function ($a, $b) {
|
usort($resourceData, function ($a, $b) {
|
||||||
return $b['fields']['total_impresion'] <=> $a['fields']['total_impresion'];
|
return $b['fields']['total_impresion'] <=> $a['fields']['total_impresion'];
|
||||||
});
|
});
|
||||||
|
|
||||||
$num_formas = [];
|
$num_formas = [];
|
||||||
$formas_linea = $datosPedido->isCosido ? intval($resourceData[0]['fields']['num_formas']['value']) / 2 :
|
$formas_linea = $datosPedido->isCosido ? intval($resourceData[0]['fields']['num_formas']['value']) / 2 :
|
||||||
intval($resourceData[0]['fields']['num_formas']['value']);
|
intval($resourceData[0]['fields']['num_formas']['value']);
|
||||||
array_push($num_formas, $formas_linea);
|
array_push($num_formas, $formas_linea);
|
||||||
|
|
||||||
$POD = $this->getPOD();
|
$POD = $this->getPOD();
|
||||||
$datosPedido->merma = PresupuestoService::calcular_merma($datosPedido->tirada,$POD, $num_formas);
|
$datosPedido->merma = PresupuestoService::calcular_merma($datosPedido->tirada, $POD, $num_formas);
|
||||||
|
|
||||||
$resourceData = PresupuestoService::obtenerComparadorPlana($input_data);
|
$resourceData = PresupuestoService::obtenerComparadorPlana($input_data);
|
||||||
}
|
}
|
||||||
@ -1132,20 +1135,22 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
$resourceData = PresupuestoService::obtenerComparadorRotativa($input_data);
|
$resourceData = PresupuestoService::obtenerComparadorRotativa($input_data);
|
||||||
|
|
||||||
if($calcular_merma == 1 && count($resourceData) > 0 &&
|
if (
|
||||||
count($resourceData[0]['fields']) >0 && $resourceData[0]['fields']['num_formas'] > 0) {
|
$calcular_merma == 1 && count($resourceData) > 0 &&
|
||||||
|
count($resourceData[0]['fields']) > 0 && $resourceData[0]['fields']['num_formas'] > 0
|
||||||
|
) {
|
||||||
|
|
||||||
usort($resourceData, function ($a, $b) {
|
usort($resourceData, function ($a, $b) {
|
||||||
return $b['fields']['total_impresion'] <=> $a['fields']['total_impresion'];
|
return $b['fields']['total_impresion'] <=> $a['fields']['total_impresion'];
|
||||||
});
|
});
|
||||||
|
|
||||||
$num_formas = [];
|
$num_formas = [];
|
||||||
$formas_linea = $datosPedido->isCosido ? intval($resourceData[0]['fields']['num_formas']['value']) / 2 :
|
$formas_linea = $datosPedido->isCosido ? intval($resourceData[0]['fields']['num_formas']['value']) / 2 :
|
||||||
intval($resourceData[0]['fields']['num_formas']['value']);
|
intval($resourceData[0]['fields']['num_formas']['value']);
|
||||||
array_push($num_formas, $formas_linea);
|
array_push($num_formas, $formas_linea);
|
||||||
|
|
||||||
$POD = $this->getPOD();
|
$POD = $this->getPOD();
|
||||||
$datosPedido->merma = PresupuestoService::calcular_merma($datosPedido->tirada,$POD, $num_formas);
|
$datosPedido->merma = PresupuestoService::calcular_merma($datosPedido->tirada, $POD, $num_formas);
|
||||||
|
|
||||||
$resourceData = PresupuestoService::obtenerComparadorRotativa($input_data);
|
$resourceData = PresupuestoService::obtenerComparadorRotativa($input_data);
|
||||||
}
|
}
|
||||||
@ -1215,7 +1220,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
return $this->respond($data);
|
return $this->respond($data);
|
||||||
} else if ($tipo == 'duplicar') {
|
} else if ($tipo == 'duplicar') {
|
||||||
$presupuesto_id = $reqData['presupuesto_id'] ?? -1;
|
$presupuesto_id = $reqData['presupuesto_id'] ?? -1;
|
||||||
$result = $this->duplicarPresupuesto($presupuesto_id);
|
$result = PresupuestoService::duplicarPresupuesto($presupuesto_id);
|
||||||
$newTokenHash = csrf_hash();
|
$newTokenHash = csrf_hash();
|
||||||
$csrfTokenName = csrf_token();
|
$csrfTokenName = csrf_token();
|
||||||
if ($result['success']) {
|
if ($result['success']) {
|
||||||
@ -1271,12 +1276,12 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$cubierta = false;
|
$cubierta = false;
|
||||||
if ($uso == 'cubierta') {
|
if ($uso == 'cubierta') {
|
||||||
$cubierta = true;
|
$cubierta = true;
|
||||||
$anchoLibro = 2* $ancho + 2 * $solapas + $lomo;
|
$anchoLibro = 2 * $ancho + 2 * $solapas + $lomo;
|
||||||
}
|
}
|
||||||
$sobrecubierta = false;
|
$sobrecubierta = false;
|
||||||
if ($uso == 'sobrecubierta') {
|
if ($uso == 'sobrecubierta') {
|
||||||
$sobrecubierta = true;
|
$sobrecubierta = true;
|
||||||
$anchoLibro = 2* $ancho + 2 * $solapas + $lomo;
|
$anchoLibro = 2 * $ancho + 2 * $solapas + $lomo;
|
||||||
}
|
}
|
||||||
$guardas = false;
|
$guardas = false;
|
||||||
if ($uso == 'guardas') {
|
if ($uso == 'guardas') {
|
||||||
@ -1300,7 +1305,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$isPOD,
|
$isPOD,
|
||||||
$anchoLibro,
|
$anchoLibro,
|
||||||
$alto,
|
$alto,
|
||||||
$tirada);
|
$tirada
|
||||||
|
);
|
||||||
if ($this->request->getGet("q")) {
|
if ($this->request->getGet("q")) {
|
||||||
$query->groupStart()
|
$query->groupStart()
|
||||||
->orLike("t1.nombre", $this->request->getGet("q"))
|
->orLike("t1.nombre", $this->request->getGet("q"))
|
||||||
@ -1339,12 +1345,12 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$cubierta = false;
|
$cubierta = false;
|
||||||
if ($uso == 'cubierta') {
|
if ($uso == 'cubierta') {
|
||||||
$cubierta = true;
|
$cubierta = true;
|
||||||
$anchoLibro = 2* $ancho + 2 * $solapas + $lomo;
|
$anchoLibro = 2 * $ancho + 2 * $solapas + $lomo;
|
||||||
}
|
}
|
||||||
$sobrecubierta = false;
|
$sobrecubierta = false;
|
||||||
if ($uso == 'sobrecubierta') {
|
if ($uso == 'sobrecubierta') {
|
||||||
$sobrecubierta = true;
|
$sobrecubierta = true;
|
||||||
$anchoLibro = 2* $ancho + 2 * $solapas + $lomo;
|
$anchoLibro = 2 * $ancho + 2 * $solapas + $lomo;
|
||||||
}
|
}
|
||||||
$guardas = false;
|
$guardas = false;
|
||||||
if ($uso == 'guardas') {
|
if ($uso == 'guardas') {
|
||||||
@ -1356,7 +1362,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
||||||
$query = $model->getGramajeForComparador($tipo,
|
$query = $model->getGramajeForComparador(
|
||||||
|
$tipo,
|
||||||
$papel_generico_id,
|
$papel_generico_id,
|
||||||
$cubierta,
|
$cubierta,
|
||||||
$sobrecubierta,
|
$sobrecubierta,
|
||||||
@ -1366,7 +1373,8 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$isPOD,
|
$isPOD,
|
||||||
$anchoLibro,
|
$anchoLibro,
|
||||||
$alto,
|
$alto,
|
||||||
$tirada);
|
$tirada
|
||||||
|
);
|
||||||
if ($this->request->getGet("q")) {
|
if ($this->request->getGet("q")) {
|
||||||
$query->groupStart()
|
$query->groupStart()
|
||||||
->orLike("t2.gramaje", $this->request->getGet("q"))
|
->orLike("t2.gramaje", $this->request->getGet("q"))
|
||||||
@ -1599,81 +1607,6 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Duplica un presupuesto dado por su ID.
|
|
||||||
*
|
|
||||||
* Esta función duplica un presupuesto y todas sus entidades relacionadas como acabados, encuadernaciones, manipulados,
|
|
||||||
* preimpresiones, direcciones y lineas. El presupuesto duplicado se marca como tal y a su título se le añade
|
|
||||||
* una cadena 'duplicado'. La función devuelve un array con un estado de éxito y el ID del nuevo presupuesto.
|
|
||||||
*
|
|
||||||
* @param int $id El ID del presupuesto a duplicar.
|
|
||||||
* @return array Un array asociativo que contiene una clave 'success' que indica el estado de éxito de la operación,
|
|
||||||
* y una clave 'id' que contiene el ID del nuevo presupuesto si la operación fue exitosa.
|
|
||||||
* Si ocurre una excepción, la clave 'success' será false y una clave 'message' contendrá el mensaje de la excepción.
|
|
||||||
* @throws \Exception Si ocurre un error durante la operación.
|
|
||||||
*/
|
|
||||||
private function duplicarPresupuesto($id)
|
|
||||||
{
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
$presupuesto = $this->model->find($id);
|
|
||||||
$presupuesto->titulo = $presupuesto->titulo . ' - ' . lang('Presupuestos.duplicado');
|
|
||||||
$presupuesto->is_duplicado = 1;
|
|
||||||
$presupuesto->estado_id = 1;
|
|
||||||
$new_id = $this->model->insert($presupuesto);
|
|
||||||
|
|
||||||
$presupuestoAcabadosModel = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
|
||||||
foreach ($presupuestoAcabadosModel->where('presupuesto_id', $presupuesto->id)->findAll() as $acabado) {
|
|
||||||
$acabado->presupuesto_id = $new_id;
|
|
||||||
$presupuestoAcabadosModel->insert($acabado);
|
|
||||||
}
|
|
||||||
|
|
||||||
$presupuestoEncuadernacionesModel = model('App\Models\Presupuestos\PresupuestoEncuadernacionesModel');
|
|
||||||
foreach ($presupuestoEncuadernacionesModel->where('presupuesto_id', $presupuesto->id)->findAll() as $encuadernacion) {
|
|
||||||
$encuadernacion->presupuesto_id = $new_id;
|
|
||||||
$presupuestoEncuadernacionesModel->insert($encuadernacion);
|
|
||||||
}
|
|
||||||
|
|
||||||
$presupuestoManipuladosModel = model('App\Models\Presupuestos\PresupuestoManipuladosModel');
|
|
||||||
foreach ($presupuestoManipuladosModel->where('presupuesto_id', $presupuesto->id)->findAll() as $manipulado) {
|
|
||||||
$manipulado->presupuesto_id = $new_id;
|
|
||||||
$presupuestoManipuladosModel->insert($manipulado);
|
|
||||||
}
|
|
||||||
|
|
||||||
$presupuestoPreimpresionesModel = model('App\Models\Presupuestos\PresupuestoPreimpresionesModel');
|
|
||||||
foreach ($presupuestoPreimpresionesModel->where('presupuesto_id', $presupuesto->id)->findAll() as $preimpresion) {
|
|
||||||
$preimpresion->presupuesto_id = $new_id;
|
|
||||||
$presupuestoPreimpresionesModel->insert($preimpresion);
|
|
||||||
}
|
|
||||||
|
|
||||||
$presupuestoServiciosExtraModel = model('App\Models\Presupuestos\PresupuestoServiciosExtraModel');
|
|
||||||
foreach ($presupuestoServiciosExtraModel->where('presupuesto_id', $presupuesto->id)->findAll() as $servicioExtra) {
|
|
||||||
$servicioExtra->presupuesto_id = $new_id;
|
|
||||||
$presupuestoServiciosExtraModel->insert($servicioExtra);
|
|
||||||
}
|
|
||||||
|
|
||||||
$presupuestoDireccionesModel = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
|
||||||
foreach ($presupuestoDireccionesModel->where('presupuesto_id', $presupuesto->id)->findAll() as $direccion) {
|
|
||||||
$direccion->presupuesto_id = $new_id;
|
|
||||||
$presupuestoDireccionesModel->insert($direccion);
|
|
||||||
}
|
|
||||||
|
|
||||||
$presupuestoLineaModel = model('App\Models\Presupuestos\PresupuestoLineaModel');
|
|
||||||
$presupuestoLineaModel->duplicateLineasPresupuesto($presupuesto->id, $new_id);
|
|
||||||
|
|
||||||
return [
|
|
||||||
'success' => true,
|
|
||||||
'id' => $new_id
|
|
||||||
];
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
return [
|
|
||||||
'success' => false,
|
|
||||||
'message' => $e->getMessage()
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function allItemsSelect()
|
public function allItemsSelect()
|
||||||
{
|
{
|
||||||
@ -1812,10 +1745,11 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$result = DataTable::of($q)
|
$result = DataTable::of($q)
|
||||||
->edit(
|
->edit(
|
||||||
'fecha',
|
'fecha',
|
||||||
fn($q) => $q->fecha?Time::createFromFormat("Y-m-d H:i:s", $q->fecha)->format("d/m/Y"):""
|
fn($q) => $q->fecha ? Time::createFromFormat("Y-m-d H:i:s", $q->fecha)->format("d/m/Y") : ""
|
||||||
)
|
)
|
||||||
->edit(
|
->edit(
|
||||||
'estado', fn($q) => match ($q->estado) {
|
'estado',
|
||||||
|
fn($q) => match ($q->estado) {
|
||||||
"1" => lang('Presupuestos.borrador'),
|
"1" => lang('Presupuestos.borrador'),
|
||||||
"2" => lang('Presupuestos.confirmado'),
|
"2" => lang('Presupuestos.confirmado'),
|
||||||
default => '--'
|
default => '--'
|
||||||
@ -1826,13 +1760,14 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
<a href="javascript:void(0);"><i class="ti ti-eye ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
|
<a href="javascript:void(0);"><i class="ti ti-eye ti-sm btn-edit mx-2" data-id="' . $q->id . '"></i></a>
|
||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return $result->toJson(returnAsObject: true) ;
|
return $result->toJson(returnAsObject: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function obtenerTotalPresupuestosCliente($cliente_id){
|
public function obtenerTotalPresupuestosCliente($cliente_id)
|
||||||
|
{
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
$result = [
|
$result = [
|
||||||
@ -1843,17 +1778,17 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
->where('presupuestos.cliente_id', $cliente_id)
|
->where('presupuestos.cliente_id', $cliente_id)
|
||||||
->select('SUM(presupuestos.total_aceptado) as total')
|
->select('SUM(presupuestos.total_aceptado) as total')
|
||||||
->groupBy('presupuestos.cliente_id')->get()->getResultObject();
|
->groupBy('presupuestos.cliente_id')->get()->getResultObject();
|
||||||
if(count($data) > 0){
|
if (count($data) > 0) {
|
||||||
$result['total_impresion'] = round(floatval($data[0]->total), 2);
|
$result['total_impresion'] = round(floatval($data[0]->total), 2);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
$result['total'] = $result['total_impresion'] + $result['total_maquetacion'];
|
$result['total'] = $result['total_impresion'] + $result['total_maquetacion'];
|
||||||
return $this->respond(['status' => $error?'error':'success', 'totales' => $result]);
|
return $this->respond(['status' => $error ? 'error' : 'success', 'totales' => $result]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function obtenerTotalPedidosCliente($cliente_id){
|
public function obtenerTotalPedidosCliente($cliente_id)
|
||||||
|
{
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
$result = [
|
$result = [
|
||||||
@ -1866,14 +1801,58 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
->join('pedidos_linea', 'pedidos_linea.pedido_id = pedidos.id')
|
->join('pedidos_linea', 'pedidos_linea.pedido_id = pedidos.id')
|
||||||
->join('presupuestos', 'presupuestos.id = pedidos_linea.presupuesto_id')
|
->join('presupuestos', 'presupuestos.id = pedidos_linea.presupuesto_id')
|
||||||
->groupBy('presupuestos.cliente_id')->get()->getResultObject();
|
->groupBy('presupuestos.cliente_id')->get()->getResultObject();
|
||||||
if(count($data) > 0){
|
if (count($data) > 0) {
|
||||||
$result['total_impresion'] = round(floatval($data[0]->total), 2);
|
$result['total_impresion'] = round(floatval($data[0]->total), 2);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$error = true;
|
$error = true;
|
||||||
}
|
}
|
||||||
$result['total'] = $result['total_impresion'] + $result['total_maquetacion'];
|
$result['total'] = $result['total_impresion'] + $result['total_maquetacion'];
|
||||||
return $this->respond(['status' => $error?'error':'success', 'totales' => $result]);
|
return $this->respond(['status' => $error ? 'error' : 'success', 'totales' => $result]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function hasFiles()
|
||||||
|
{
|
||||||
|
|
||||||
|
if ($this->request->isAJAX()) {
|
||||||
|
$id = $this->request->getGet('id');
|
||||||
|
$presupuesto = $this->model->find($id);
|
||||||
|
if (!$presupuesto) {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'error',
|
||||||
|
'message' => lang('Presupuestos.presupuestoNotFound'),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$files = $presupuesto->files() ?? [];
|
||||||
|
if (count($files) == 0) {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'hasFiles' => false,
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
return $this->respond([
|
||||||
|
'status' => 'success',
|
||||||
|
'hasFiles' => true,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reprintPresupuesto()
|
||||||
|
{
|
||||||
|
|
||||||
|
if ($this->request->isAJAX()) {
|
||||||
|
$id = $this->request->getPost('id');
|
||||||
|
$duplicateFiles = $this->request->getPost('duplicateFiles') ?? false;
|
||||||
|
$response = PresupuestoService::duplicarPresupuesto($id, true, $duplicateFiles);
|
||||||
|
return $this->respond($response);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1903,7 +1882,7 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
$modelPapel = new PapelGenericoModel();
|
$modelPapel = new PapelGenericoModel();
|
||||||
foreach ($lineas as $linea) {
|
foreach ($lineas as $linea) {
|
||||||
$linea->papel_generico = (new PapelGenericoModel())->find($linea->papel_id)->nombre;
|
$linea->papel_generico = (new PapelGenericoModel())->find($linea->papel_id)->nombre;
|
||||||
if($linea->tipo == 'lp_faja'){
|
if ($linea->tipo == 'lp_faja') {
|
||||||
$linea->alto_faja = $presupuestoEntity->alto_faja_color;
|
$linea->alto_faja = $presupuestoEntity->alto_faja_color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1972,4 +1951,6 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
|||||||
|
|
||||||
return $direcciones;
|
return $direcciones;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -372,6 +372,15 @@ class Ordentrabajo extends BaseController
|
|||||||
->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_paper'), 'data' => $q])
|
->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_paper'), 'data' => $q])
|
||||||
->toJson(true);
|
->toJson(true);
|
||||||
}
|
}
|
||||||
|
public function maquina_plana_datatable()
|
||||||
|
{
|
||||||
|
// return $this->response->setStatusCode(400);
|
||||||
|
$q = $this->produccionService->maquinaPlanaDatatableQuery();
|
||||||
|
return DataTable::of($q)
|
||||||
|
->edit("tiempoReal", fn($q) => $q->tiempoReal)
|
||||||
|
->add("action", fn($q) => ["title" => lang('Produccion.datatable.filter_by_machine'), 'data' => $q])
|
||||||
|
->toJson(true);
|
||||||
|
}
|
||||||
public function reset_tareas(int $orden_trabajo_id)
|
public function reset_tareas(int $orden_trabajo_id)
|
||||||
{
|
{
|
||||||
$r = $this->produccionService->init($orden_trabajo_id)->resetAllTareas();
|
$r = $this->produccionService->init($orden_trabajo_id)->resetAllTareas();
|
||||||
@ -513,7 +522,8 @@ class Ordentrabajo extends BaseController
|
|||||||
public function select_maquina_planning_plana()
|
public function select_maquina_planning_plana()
|
||||||
{
|
{
|
||||||
$q = $this->request->getGet('q');
|
$q = $this->request->getGet('q');
|
||||||
$result = $this->produccionService->querySelectMaquinaPlanningPlana($q);
|
$padreId = $this->request->getGet('padre_id');
|
||||||
|
$result = $this->produccionService->querySelectMaquinaPlanningPlana($q,$padreId);
|
||||||
return $this->response->setJSON($result);
|
return $this->response->setJSON($result);
|
||||||
}
|
}
|
||||||
public function select_maquina_padre_planning_plana()
|
public function select_maquina_padre_planning_plana()
|
||||||
|
|||||||
@ -363,6 +363,9 @@ return [
|
|||||||
'borrador' => 'Borrador',
|
'borrador' => 'Borrador',
|
||||||
'confirmado' => 'Confirmado',
|
'confirmado' => 'Confirmado',
|
||||||
|
|
||||||
|
'reprint' => 'Reimpresión',
|
||||||
|
'presupuestoGenerado' => 'Presupuesto generado con éxito',
|
||||||
|
|
||||||
'files' => 'Ficheros',
|
'files' => 'Ficheros',
|
||||||
'titulos' => [
|
'titulos' => [
|
||||||
'libroFresadoTapaDura' => 'Rústica Fresado tapa dura',
|
'libroFresadoTapaDura' => 'Rústica Fresado tapa dura',
|
||||||
@ -402,6 +405,7 @@ return [
|
|||||||
],
|
],
|
||||||
|
|
||||||
'errores' => [
|
'errores' => [
|
||||||
|
'presupuestoNotFound' => 'Presupuesto no encontrado',
|
||||||
'paginas' => 'El campo páginas tiene que ser mayor que cero',
|
'paginas' => 'El campo páginas tiene que ser mayor que cero',
|
||||||
'paginasLP' => 'El número de páginas no coincide con el total',
|
'paginasLP' => 'El número de páginas no coincide con el total',
|
||||||
'tiradas' => 'El campo tiradas tiene que ser mayor que cero',
|
'tiradas' => 'El campo tiradas tiene que ser mayor que cero',
|
||||||
|
|||||||
@ -13,6 +13,7 @@ return [
|
|||||||
'prod' => 'Producción'
|
'prod' => 'Producción'
|
||||||
],
|
],
|
||||||
"datatable" => [
|
"datatable" => [
|
||||||
|
"nombre" => "Nombre",
|
||||||
"ot_id" => "OT ID",
|
"ot_id" => "OT ID",
|
||||||
"barcode" => "Código",
|
"barcode" => "Código",
|
||||||
"pedido_id" => "Pedido ID",
|
"pedido_id" => "Pedido ID",
|
||||||
@ -38,6 +39,7 @@ return [
|
|||||||
"progreso" => "Progreso",
|
"progreso" => "Progreso",
|
||||||
"logo" => "Logo impresion",
|
"logo" => "Logo impresion",
|
||||||
"filter_by_task" => "Filtrar por tarea",
|
"filter_by_task" => "Filtrar por tarea",
|
||||||
|
"filter_by_machine" => "Filtrar por máquina",
|
||||||
"filter_by_paper" => "Filtrar por papel",
|
"filter_by_paper" => "Filtrar por papel",
|
||||||
"metros" => "Metros",
|
"metros" => "Metros",
|
||||||
"corte" => "Corte",
|
"corte" => "Corte",
|
||||||
@ -141,7 +143,7 @@ return [
|
|||||||
"attr_not_exist" => "El atributo {0,string} no pertenece al modelo Pedido"
|
"attr_not_exist" => "El atributo {0,string} no pertenece al modelo Pedido"
|
||||||
|
|
||||||
],
|
],
|
||||||
|
"maquinas_planas" => "Máquinas planas",
|
||||||
"progress_ferro" => "Ferro",
|
"progress_ferro" => "Ferro",
|
||||||
"progress_preimpresion" => "Preimpresión",
|
"progress_preimpresion" => "Preimpresión",
|
||||||
"progress_logistica" => "Logística",
|
"progress_logistica" => "Logística",
|
||||||
|
|||||||
@ -24,10 +24,11 @@ class PresupuestoFicheroModel extends \App\Models\BaseModel
|
|||||||
public static $labelField = "nombre";
|
public static $labelField = "nombre";
|
||||||
|
|
||||||
|
|
||||||
public function saveFileInBBDD($presupuesto_id, $filename, $extension ,$user_id) {
|
public function saveFileInBBDD($presupuesto_id, $filename, $extension, $user_id)
|
||||||
try{
|
{
|
||||||
|
try {
|
||||||
$new_filename = $this->generateFileHash($filename) . '.' . $extension;
|
$new_filename = $this->generateFileHash($filename) . '.' . $extension;
|
||||||
|
|
||||||
$this->db->table($this->table . " t1")
|
$this->db->table($this->table . " t1")
|
||||||
->set('presupuesto_id', $presupuesto_id)
|
->set('presupuesto_id', $presupuesto_id)
|
||||||
->set('nombre', $filename)
|
->set('nombre', $filename)
|
||||||
@ -42,13 +43,14 @@ class PresupuestoFicheroModel extends \App\Models\BaseModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteFiles($presupuesto_id, $old_files = []){
|
public function deleteFiles($presupuesto_id, $old_files = [])
|
||||||
|
{
|
||||||
|
|
||||||
$files = $this->db
|
$files = $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->where('presupuesto_id', $presupuesto_id)->get()->getResult();
|
->where('presupuesto_id', $presupuesto_id)->get()->getResult();
|
||||||
if($files){
|
if ($files) {
|
||||||
foreach($files as $file){
|
foreach ($files as $file) {
|
||||||
|
|
||||||
// se comprueba que el $file->nombre no sea igual a ninguno de los elementos del array $old_files
|
// se comprueba que el $file->nombre no sea igual a ninguno de los elementos del array $old_files
|
||||||
if (!in_array($file->nombre, $old_files)) {
|
if (!in_array($file->nombre, $old_files)) {
|
||||||
@ -67,21 +69,52 @@ class PresupuestoFicheroModel extends \App\Models\BaseModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getFiles($presupuesto_id){
|
public function copyFiles($presupuesto_id_origen, $presupuesto_id_destino)
|
||||||
|
{
|
||||||
|
|
||||||
|
$files = $this->db
|
||||||
|
->table($this->table . " t1")
|
||||||
|
->where('presupuesto_id', $presupuesto_id_origen)->get()->getResult();
|
||||||
|
if ($files) {
|
||||||
|
|
||||||
|
foreach ($files as $file) {
|
||||||
|
|
||||||
|
$hash = $this->generateFileHash($file->nombre);
|
||||||
|
|
||||||
|
// se copia el fichero a la nueva ubicación
|
||||||
|
if (!file_exists(WRITEPATH . $file->file_path)) {
|
||||||
|
copy($file->file_path, WRITEPATH . 'uploads/presupuestos/' . $hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->db->table($this->table . " t1")
|
||||||
|
->set('presupuesto_id', $presupuesto_id_destino)
|
||||||
|
->set('nombre', $file->nombre)
|
||||||
|
->set('file_path', WRITEPATH . 'uploads/presupuestos/' . $hash)
|
||||||
|
->set('upload_by', auth()->user()->id)
|
||||||
|
->set('upload_at', date('Y-m-d H:i:s'))
|
||||||
|
->insert();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getFiles($presupuesto_id)
|
||||||
|
{
|
||||||
return $this->db
|
return $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->where('presupuesto_id', $presupuesto_id)->get()->getResult();
|
->where('presupuesto_id', $presupuesto_id)->get()->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Función para convertir el nombre y extensión de un fichero en un hash único
|
* Función para convertir el nombre y extensión de un fichero en un hash único
|
||||||
* usando cifrado simétrico.
|
* usando cifrado simétrico.
|
||||||
*
|
*
|
||||||
* @param string $filename Nombre del fichero con extensión
|
* @param string $filename Nombre del fichero con extensión
|
||||||
* @return string Hash encriptado del fichero
|
* @return string Hash encriptado del fichero
|
||||||
*/
|
*/
|
||||||
private function generateFileHash($filename) {
|
private function generateFileHash($filename)
|
||||||
|
{
|
||||||
return hash('sha256', $filename);
|
return hash('sha256', $filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2077,7 +2077,10 @@ class PresupuestoService extends BaseService
|
|||||||
|
|
||||||
$merma = 0;
|
$merma = 0;
|
||||||
|
|
||||||
if ($tirada > $POD) {
|
if ($tirada == 0) {
|
||||||
|
$merma = 0;
|
||||||
|
}
|
||||||
|
else if ($tirada > $POD) {
|
||||||
$merma = $tirada * 0.1;
|
$merma = $tirada * 0.1;
|
||||||
} else {
|
} else {
|
||||||
$merma_lineas = [];
|
$merma_lineas = [];
|
||||||
@ -2105,4 +2108,93 @@ class PresupuestoService extends BaseService
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function duplicarPresupuesto($id = null, $is_reimpresion = false, $copy_files = false)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
|
||||||
|
$modelPresupuesto = model('App\Models\Presupuestos\PresupuestoModel');
|
||||||
|
$presupuesto = $modelPresupuesto->find($id);
|
||||||
|
if (!$presupuesto || $id == null) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'message' => lang('Presupuestos.presupuestoNotFound'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$presupuesto->titulo = $presupuesto->titulo . ' - ' . lang('Presupuestos.duplicado');
|
||||||
|
$presupuesto->is_duplicado = 1;
|
||||||
|
$presupuesto->estado_id = 1;
|
||||||
|
if($is_reimpresion && boolval($copy_files)){
|
||||||
|
$presupuesto->inc_rei = "reimpresion";
|
||||||
|
$modelPedidoLinea = model('App\Models\Pedidos\PedidoLineaModel');
|
||||||
|
$pedido_linea = $modelPedidoLinea->where('presupuesto_id', $id)->first();
|
||||||
|
if($pedido_linea){
|
||||||
|
$text = "REIMPRESION [" . date('Y-m-d H:i:s') . "] - PEDIDO: " . $pedido_linea->pedido_id .
|
||||||
|
"\n================================================\n";
|
||||||
|
$presupuesto->comentarios_safekat = $presupuesto->comentarios_safekat . $text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$presupuesto->inc_rei = null;
|
||||||
|
}
|
||||||
|
$new_id = $modelPresupuesto->insert($presupuesto);
|
||||||
|
|
||||||
|
$presupuestoAcabadosModel = model('App\Models\Presupuestos\PresupuestoAcabadosModel');
|
||||||
|
foreach ($presupuestoAcabadosModel->where('presupuesto_id', $presupuesto->id)->findAll() as $acabado) {
|
||||||
|
$acabado->presupuesto_id = $new_id;
|
||||||
|
$presupuestoAcabadosModel->insert($acabado);
|
||||||
|
}
|
||||||
|
|
||||||
|
$presupuestoEncuadernacionesModel = model('App\Models\Presupuestos\PresupuestoEncuadernacionesModel');
|
||||||
|
foreach ($presupuestoEncuadernacionesModel->where('presupuesto_id', $presupuesto->id)->findAll() as $encuadernacion) {
|
||||||
|
$encuadernacion->presupuesto_id = $new_id;
|
||||||
|
$presupuestoEncuadernacionesModel->insert($encuadernacion);
|
||||||
|
}
|
||||||
|
|
||||||
|
$presupuestoManipuladosModel = model('App\Models\Presupuestos\PresupuestoManipuladosModel');
|
||||||
|
foreach ($presupuestoManipuladosModel->where('presupuesto_id', $presupuesto->id)->findAll() as $manipulado) {
|
||||||
|
$manipulado->presupuesto_id = $new_id;
|
||||||
|
$presupuestoManipuladosModel->insert($manipulado);
|
||||||
|
}
|
||||||
|
|
||||||
|
$presupuestoPreimpresionesModel = model('App\Models\Presupuestos\PresupuestoPreimpresionesModel');
|
||||||
|
foreach ($presupuestoPreimpresionesModel->where('presupuesto_id', $presupuesto->id)->findAll() as $preimpresion) {
|
||||||
|
$preimpresion->presupuesto_id = $new_id;
|
||||||
|
$presupuestoPreimpresionesModel->insert($preimpresion);
|
||||||
|
}
|
||||||
|
|
||||||
|
$presupuestoServiciosExtraModel = model('App\Models\Presupuestos\PresupuestoServiciosExtraModel');
|
||||||
|
foreach ($presupuestoServiciosExtraModel->where('presupuesto_id', $presupuesto->id)->findAll() as $servicioExtra) {
|
||||||
|
$servicioExtra->presupuesto_id = $new_id;
|
||||||
|
$presupuestoServiciosExtraModel->insert($servicioExtra);
|
||||||
|
}
|
||||||
|
|
||||||
|
$presupuestoDireccionesModel = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||||
|
foreach ($presupuestoDireccionesModel->where('presupuesto_id', $presupuesto->id)->findAll() as $direccion) {
|
||||||
|
$direccion->presupuesto_id = $new_id;
|
||||||
|
$presupuestoDireccionesModel->insert($direccion);
|
||||||
|
}
|
||||||
|
|
||||||
|
$presupuestoLineaModel = model('App\Models\Presupuestos\PresupuestoLineaModel');
|
||||||
|
$presupuestoLineaModel->duplicateLineasPresupuesto($presupuesto->id, $new_id);
|
||||||
|
|
||||||
|
|
||||||
|
if (boolval($copy_files)== true) {
|
||||||
|
$presupuestoFilesModel = model('App\Models\Presupuestos\PresupuestoFicheroModel');
|
||||||
|
$presupuestoFilesModel->copyFiles($presupuesto->id, $new_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'success' => true,
|
||||||
|
'id' => $new_id,
|
||||||
|
'message' => lang('Presupuestos.presupuestoGenerado'),
|
||||||
|
];
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return [
|
||||||
|
'success' => false,
|
||||||
|
'message' => $e->getMessage()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -924,6 +924,29 @@ class ProductionService extends BaseService
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return $q;
|
||||||
|
}
|
||||||
|
public function maquinaPlanaDatatableQuery()
|
||||||
|
{
|
||||||
|
$q = $this->otModel->builder()->select([
|
||||||
|
"lg_maquinas.nombre as maquinaNombre",
|
||||||
|
"lg_maquinas.id as maquinaId",
|
||||||
|
"COUNT(orden_trabajo_tareas.id) as tareasCount",
|
||||||
|
"presupuesto_linea.pliegos_pedido as pliegosPedido",
|
||||||
|
"SUM(ordenes_trabajo.total_tirada) as totalTirada",
|
||||||
|
"SUM(orden_trabajo_tareas.tiempo_real) as tiempoReal"
|
||||||
|
])
|
||||||
|
->join("orden_trabajo_tareas", "orden_trabajo_tareas.orden_trabajo_id = ordenes_trabajo.id", "left")
|
||||||
|
->join("presupuesto_linea", "presupuesto_linea.id = orden_trabajo_tareas.presupuesto_linea_id", "left")
|
||||||
|
->join("presupuestos", "presupuestos.id = presupuesto_linea.presupuesto_id", "right")
|
||||||
|
->join('lg_maquinas',"lg_maquinas.id = orden_trabajo_tareas.maquina_id","left")
|
||||||
|
->where("orden_trabajo_tareas.deleted_at", null)
|
||||||
|
->where("orden_trabajo_tareas.presupuesto_linea_id IS NOT NULL", NULL, FALSE)
|
||||||
|
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||||
|
->groupBy('lg_maquinas.id');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $q;
|
return $q;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -1334,13 +1357,14 @@ class ProductionService extends BaseService
|
|||||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
|
->whereIn("presupuesto_linea.tipo", $this->TIPOS_ROTATIVA)
|
||||||
->where('lg_maquinas.is_rotativa', true)
|
->where('lg_maquinas.is_rotativa', true)
|
||||||
->where("orden_trabajo_tareas.deleted_at", null)
|
->where("orden_trabajo_tareas.deleted_at", null)
|
||||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
->orderBy("orden_trabajo_tareas.orden", "ASC")
|
||||||
|
->groupBy('lg_maquinas.id');
|
||||||
if ($q) {
|
if ($q) {
|
||||||
$query->like('lg_maquinas.nombre', $q);
|
$query->like('lg_maquinas.nombre', $q);
|
||||||
}
|
}
|
||||||
return $query->get()->getResultArray();
|
return $query->get()->getResultArray();
|
||||||
}
|
}
|
||||||
public function querySelectMaquinaPlanningPlana($q)
|
public function querySelectMaquinaPlanningPlana($q,?string $padreId)
|
||||||
{
|
{
|
||||||
$query = $this->otModel->builder()->select([
|
$query = $this->otModel->builder()->select([
|
||||||
"orden_trabajo_tareas.maquina_id as id",
|
"orden_trabajo_tareas.maquina_id as id",
|
||||||
@ -1352,10 +1376,14 @@ class ProductionService extends BaseService
|
|||||||
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
->whereIn("presupuesto_linea.tipo", $this->TIPOS_PLANA)
|
||||||
->where('lg_maquinas.is_rotativa', false)
|
->where('lg_maquinas.is_rotativa', false)
|
||||||
->where("orden_trabajo_tareas.deleted_at", null)
|
->where("orden_trabajo_tareas.deleted_at", null)
|
||||||
->orderBy("orden_trabajo_tareas.orden", "ASC");
|
->orderBy("orden_trabajo_tareas.orden", "ASC")
|
||||||
|
->groupBy('lg_maquinas.id');
|
||||||
if ($q) {
|
if ($q) {
|
||||||
$query->like('lg_maquinas.nombre', $q);
|
$query->like('lg_maquinas.nombre', $q);
|
||||||
}
|
}
|
||||||
|
if($padreId){
|
||||||
|
$query->where('lg_maquinas.padre_id',$padreId);
|
||||||
|
}
|
||||||
return $query->get()->getResultArray();
|
return $query->get()->getResultArray();
|
||||||
}
|
}
|
||||||
public function querySelectMaquinaPadrePlanningPlana($q)
|
public function querySelectMaquinaPadrePlanningPlana($q)
|
||||||
|
|||||||
28
ci4/app/Views/themes/vuexy/components/tables/planning_maquina_table.php
Executable file
28
ci4/app/Views/themes/vuexy/components/tables/planning_maquina_table.php
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
<div class="table-responsive">
|
||||||
|
|
||||||
|
<table id="<?= $id ?>" class="table table-striped table-hover" style="width: 100%;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><?= lang('Produccion.datatable.nombre') ?></th>
|
||||||
|
<th><?= lang('Produccion.datatable.tareas') ?></th>
|
||||||
|
<th><?= lang('Produccion.datatable.tirada') ?></th>
|
||||||
|
<th><?= lang('Produccion.datatable.pliegos_libro') ?></th>
|
||||||
|
<th><?= lang('Produccion.datatable.tiempo') ?>(HH:MM)</th>
|
||||||
|
<th></th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<th colspan="3" style="text-align:right">Total:</th>
|
||||||
|
<th><span id="total-pliegos-maquina"></span></th>
|
||||||
|
<th id="total-tiempo-pliego-maquina"></th>
|
||||||
|
<th></th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
@ -93,11 +93,19 @@
|
|||||||
<?php if (str_contains($formAction, 'edit')): ?>
|
<?php if (str_contains($formAction, 'edit')): ?>
|
||||||
<?= anchor(route_to("presupuestoToPdf", $presupuestoId), lang("Basic.global.Print"), ["class" => "btn btn-dark float-start me-sm-3 me-1",'target' => '_blank']) ?>
|
<?= anchor(route_to("presupuestoToPdf", $presupuestoId), lang("Basic.global.Print"), ["class" => "btn btn-dark float-start me-sm-3 me-1",'target' => '_blank']) ?>
|
||||||
<input type="button"
|
<input type="button"
|
||||||
class="btn btn-info float-start me-sm-3 me-1"
|
class="btn btn-primary float-start me-sm-3 me-1"
|
||||||
name="clone"
|
name="clone"
|
||||||
id="cloneForm"
|
id="cloneForm"
|
||||||
value="<?= lang("Basic.global.Clone") ?>"
|
value="<?= lang("Basic.global.Clone") ?>"
|
||||||
/>
|
/>
|
||||||
|
<?php if($presupuestoEntity->estado_id == 2): ?>
|
||||||
|
<input type="button"
|
||||||
|
class="btn btn-primary float-start me-sm-3 me-1"
|
||||||
|
name="reprint"
|
||||||
|
id="reprint"
|
||||||
|
value="<?= lang("Presupuestos.reprint") ?>"
|
||||||
|
/>
|
||||||
|
<?php endif; ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?= anchor(route_to("presupuestoAdminList", $tipo_impresion_id), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
|
<?= anchor(route_to("presupuestoAdminList", $tipo_impresion_id), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -76,14 +76,17 @@
|
|||||||
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
<button type="button" class="accordion-button" data-bs-toggle="collapse"
|
||||||
data-bs-target="#accordionPapelPliegoContainer" aria-expanded="false"
|
data-bs-target="#accordionPapelPliegoContainer" aria-expanded="false"
|
||||||
aria-controls="accordionPapelPliegoContainer">
|
aria-controls="accordionPapelPliegoContainer">
|
||||||
<h4><?= lang("Produccion.papel_gramajes") ?></h4>
|
<h4><?= lang("Produccion.maquinas_planas") ?></h4>
|
||||||
</button>
|
</button>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
<div id="accordionPapelPliegoContainer" class="accordion-collapse collapse show"
|
<div id="accordionPapelPliegoContainer" class="accordion-collapse collapse show"
|
||||||
data-bs-parent="#accordionPapelPliego">
|
data-bs-parent="#accordionPapelPliego">
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
<?= view("themes/vuexy/components/tables/planning_papel_pliego_table.php", ["id" => "planning-pliego-datatable"]) ?>
|
<div class="d-none">
|
||||||
|
<?= view("themes/vuexy/components/tables/planning_papel_pliego_table.php", ["id" => "planning-pliego-datatable"]) ?>
|
||||||
|
</div>
|
||||||
|
<?= view("themes/vuexy/components/tables/planning_maquina_table.php", ["id" => "planning-maquina-datatable"]) ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -162,7 +162,12 @@ class PresupuestoAdminAdd {
|
|||||||
const POD = parseInt($('#POD').val());
|
const POD = parseInt($('#POD').val());
|
||||||
let merma = 0;
|
let merma = 0;
|
||||||
|
|
||||||
merma = tirada * 0.1 <= POD ? tirada * 0.1 : POD;
|
if (tirada == 1) {
|
||||||
|
merma = 0;
|
||||||
|
}
|
||||||
|
else if (tirada > POD) {
|
||||||
|
merma = tirada * 0.1 <= POD ? tirada * 0.1 : POD;
|
||||||
|
}
|
||||||
|
|
||||||
$('#mermacubierta').val(parseInt(merma))
|
$('#mermacubierta').val(parseInt(merma))
|
||||||
$('#merma').val(parseInt(merma))
|
$('#merma').val(parseInt(merma))
|
||||||
|
|||||||
@ -180,6 +180,7 @@ class PresupuestoAdminEdit {
|
|||||||
this.fileUploadDropzone.init()
|
this.fileUploadDropzone.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#reprint').on('click', this.reprintPresupuesto.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -401,12 +402,12 @@ class PresupuestoAdminEdit {
|
|||||||
self.tipo_impresion.val(response.data.tipo_impresion);
|
self.tipo_impresion.val(response.data.tipo_impresion);
|
||||||
self.POD.val(response.data.POD);
|
self.POD.val(response.data.POD);
|
||||||
|
|
||||||
const totalAceptadoRevisado = response.data.total_aceptado_revisado != null ?
|
const totalAceptadoRevisado = response.data.total_aceptado_revisado != null ?
|
||||||
response.data.total_aceptado_revisado : response.data.resumen.total_aceptado;
|
response.data.total_aceptado_revisado : response.data.resumen.total_aceptado;
|
||||||
AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]).set(totalAceptadoRevisado);
|
AutoNumeric.getAutoNumericElement($('#total_aceptado_revisado')[0]).set(totalAceptadoRevisado);
|
||||||
|
|
||||||
$('#aprobado_by_at').html(response.data.aprobado_by_at);
|
$('#aprobado_by_at').html(response.data.aprobado_by_at);
|
||||||
|
|
||||||
$('#created_by').html(response.data.created_by);
|
$('#created_by').html(response.data.created_by);
|
||||||
$('#updated_by').html(response.data.updated_by);
|
$('#updated_by').html(response.data.updated_by);
|
||||||
$('#created_at').html(response.data.created_at);
|
$('#created_at').html(response.data.created_at);
|
||||||
@ -677,6 +678,53 @@ class PresupuestoAdminEdit {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reprintPresupuesto() {
|
||||||
|
|
||||||
|
const id = window.location.href.split("/").pop();
|
||||||
|
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Reimpresion',
|
||||||
|
text: "¿Quiere usar los mismos ficheros para la reimpresión?\n(Si no usa los mismos, deberá subir unos nuevos)",
|
||||||
|
icon: 'warning',
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: 'Usar los MISMOS',
|
||||||
|
cancelButtonText: 'Cancelar',
|
||||||
|
denyButtonText: "Usar OTROS",
|
||||||
|
customClass: {
|
||||||
|
confirmButton: 'btn btn-primary me-1',
|
||||||
|
denyButton: 'btn btn-primary me-1',
|
||||||
|
cancelButton: 'btn btn-secondary'
|
||||||
|
},
|
||||||
|
buttonsStyling: false
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isDenied || result.isConfirmed) {
|
||||||
|
new Ajax('/presupuestoadmin/reprint',
|
||||||
|
{ id: id, duplicateFiles: result.isConfirmed ? 1 : 0 }, {},
|
||||||
|
function (response) {
|
||||||
|
if (response.success === true) {
|
||||||
|
Swal.fire({
|
||||||
|
text: response.message,
|
||||||
|
icon: 'success',
|
||||||
|
confirmButtonColor: '#3085d6',
|
||||||
|
confirmButtonText: 'Ok',
|
||||||
|
customClass: {
|
||||||
|
confirmButton: 'btn btn-primary me-1',
|
||||||
|
},
|
||||||
|
buttonsStyling: false
|
||||||
|
})
|
||||||
|
window.open('/presupuestoadmin/edit/' + response.id, '_blank');
|
||||||
|
} else {
|
||||||
|
popErrorAlert(response.mensaje);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function (error) {
|
||||||
|
popErrorAlert(error);
|
||||||
|
}
|
||||||
|
).post();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
@ -704,4 +752,5 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
console.log("Error getting translations:", error);
|
console.log("Error getting translations:", error);
|
||||||
}
|
}
|
||||||
).post();
|
).post();
|
||||||
|
|
||||||
});
|
});
|
||||||
@ -623,7 +623,10 @@ class DatosLibro {
|
|||||||
let merma = 0;
|
let merma = 0;
|
||||||
let htmlString = '';
|
let htmlString = '';
|
||||||
|
|
||||||
if (tirada > POD) {
|
if (tirada == 1) {
|
||||||
|
merma = 0;
|
||||||
|
}
|
||||||
|
else if (tirada > POD) {
|
||||||
merma = tirada * 0.1 <= POD ? tirada * 0.1 : POD;
|
merma = tirada * 0.1 <= POD ? tirada * 0.1 : POD;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -10,6 +10,7 @@ class PlanningRotativa {
|
|||||||
this.tablePlanningPlana = this.item.find("#planning-plana-datatable")
|
this.tablePlanningPlana = this.item.find("#planning-plana-datatable")
|
||||||
this.papelGramajeTablePlanning = this.item.find("#planning-papel-datatable")
|
this.papelGramajeTablePlanning = this.item.find("#planning-papel-datatable")
|
||||||
this.papelPliegoTablePlanning = this.item.find("#planning-pliego-datatable")
|
this.papelPliegoTablePlanning = this.item.find("#planning-pliego-datatable")
|
||||||
|
this.maquinaTablePlanning = this.item.find("#planning-maquina-datatable")
|
||||||
this.papelImpresionHeader = this.item.find('#papel-impresion-name-header')
|
this.papelImpresionHeader = this.item.find('#papel-impresion-name-header')
|
||||||
this.papelImpresionPlanaHeader = this.item.find('#papel-impresion-name-plana-header')
|
this.papelImpresionPlanaHeader = this.item.find('#papel-impresion-name-plana-header')
|
||||||
|
|
||||||
@ -27,7 +28,7 @@ class PlanningRotativa {
|
|||||||
{ data: 'papel_ancho', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
{ data: 'papel_ancho', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||||
{ data: 'papel_alto', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
{ data: 'papel_alto', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||||
{ data: 'papel_impresion', searchable: false, sortable: false },
|
{ data: 'papel_impresion', searchable: false, sortable: false },
|
||||||
{ data: 'papel_gramaje',name:"presupuesto_linea.gramaje", searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
{ data: 'papel_gramaje', name: "presupuesto_linea.gramaje", searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||||
{ data: 'corte', searchable: false, sortable: false, render: this.renderCorteImage.bind(this), width: "10rem" },
|
{ data: 'corte', searchable: false, sortable: false, render: this.renderCorteImage.bind(this), width: "10rem" },
|
||||||
{ data: 'metros_check', searchable: false, sortable: false, render: d => `<input class="form-check-input metros-check" data-id="${d}" type="checkbox" value="" />` },
|
{ data: 'metros_check', searchable: false, sortable: false, render: d => `<input class="form-check-input metros-check" data-id="${d}" type="checkbox" value="" />` },
|
||||||
{ data: 'metros', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
{ data: 'metros', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||||
@ -44,10 +45,10 @@ class PlanningRotativa {
|
|||||||
{ data: 'papel_ancho', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
{ data: 'papel_ancho', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||||
{ data: 'papel_alto', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
{ data: 'papel_alto', searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||||
{ data: 'papel_impresion', searchable: false, sortable: false },
|
{ data: 'papel_impresion', searchable: false, sortable: false },
|
||||||
{ data: 'papel_gramaje', name:"presupuesto_linea.gramaje", searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
{ data: 'papel_gramaje', name: "presupuesto_linea.gramaje", searchable: false, sortable: false, width: "5rem", render: d => `<span class="autonumeric">${d}</span>` },
|
||||||
{ data: 'pliegos_check', searchable: false, sortable: false, render: d => `<input class="form-check-input pliegos-check" data-id="${d}" type="checkbox" value="" />` },
|
{ data: 'pliegos_check', searchable: false, sortable: false, render: d => `<input class="form-check-input pliegos-check" data-id="${d}" type="checkbox" value="" />` },
|
||||||
{ data: 'pliegosPedido', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
{ data: 'pliegosPedido', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||||
{ data: 'tiempo_real_sum', searchable: false, sortable: false,render: d => this.formatSeconds(parseFloat(d))},
|
{ data: 'tiempo_real_sum', searchable: false, sortable: false, render: d => this.formatSeconds(parseFloat(d)) },
|
||||||
{ data: 'action', searchable: false, sortable: false, render: this._renderBtnAction },
|
{ data: 'action', searchable: false, sortable: false, render: this._renderBtnAction },
|
||||||
|
|
||||||
]
|
]
|
||||||
@ -65,6 +66,20 @@ class PlanningRotativa {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
this.maquinaPlanaDatatableColumns = [
|
||||||
|
{ data: 'maquinaNombre', searchable: true, sortable: true },
|
||||||
|
{ data: 'tareasCount', searchable: true, sortable: true },
|
||||||
|
{ data: 'totalTirada', searchable: false, sortable: false },
|
||||||
|
{ data: 'pliegosPedido', searchable: false, sortable: false, render: d => `<span class="autonumeric">${d}</span>` },
|
||||||
|
{ data: 'tiempoReal', searchable: false, sortable: false, render: d => this.formatSeconds(d) },
|
||||||
|
{
|
||||||
|
data: 'action', searchable: false, sortable: false, render: (d) => {
|
||||||
|
return `<button type="button" class="btn btn-primary btn-sm w-100 maquina-planning-btn" data-id="${d.data.maquinaId}" data-bs-toggle="button">${d.title}</button>`
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
this.papelPliegoDatatableColumns = [
|
this.papelPliegoDatatableColumns = [
|
||||||
{ data: 'papelImpresionNombre', searchable: true, sortable: true },
|
{ data: 'papelImpresionNombre', searchable: true, sortable: true },
|
||||||
@ -86,11 +101,12 @@ class PlanningRotativa {
|
|||||||
`/produccion/ordentrabajo/planning/select/maquina/rotativa`,
|
`/produccion/ordentrabajo/planning/select/maquina/rotativa`,
|
||||||
"Seleccione una maquina",
|
"Seleccione una maquina",
|
||||||
true, {
|
true, {
|
||||||
dropdownCssClass: "h-2"
|
dropdownCssClass: "h-2"
|
||||||
}, $('body'));
|
}, $('body'));
|
||||||
this.papelImpresionFilter = new ClassSelect(this.tablePlanningRot.find(".planning-papel-select"), `/produccion/ordentrabajo/planning/select/papel/rotativa`, "Seleccione un papel", true, {}, $('body'));
|
this.papelImpresionFilter = new ClassSelect(this.tablePlanningRot.find(".planning-papel-select"), `/produccion/ordentrabajo/planning/select/papel/rotativa`, "Seleccione un papel", true, {}, $('body'));
|
||||||
this.maquinaSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-select"), `/produccion/ordentrabajo/planning/select/maquina/plana`, "Seleccione una maquina", true, {}, $('body'));
|
|
||||||
this.maquinaPadreSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-padre-select"), `/produccion/ordentrabajo/planning/select/maquina/padre/plana`, "Máquina padre", true, {}, $('body'));
|
this.maquinaPadreSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-padre-select"), `/produccion/ordentrabajo/planning/select/maquina/padre/plana`, "Máquina padre", true, {}, $('body'));
|
||||||
|
this.maquinaSelectFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-maquina-select"), `/produccion/ordentrabajo/planning/select/maquina/plana`, "Seleccione una maquina", true, {
|
||||||
|
}, $('body'));
|
||||||
this.papelImpresionFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-papel-select"), `/produccion/ordentrabajo/planning/select/papel/plana`, "Seleccione un papel", true, {}, $('body'));
|
this.papelImpresionFilterPlana = new ClassSelect(this.tablePlanningPlana.find(".planning-papel-select"), `/produccion/ordentrabajo/planning/select/papel/plana`, "Seleccione un papel", true, {}, $('body'));
|
||||||
this.maquinaSelectFilter.config.dropdownParent = this.item
|
this.maquinaSelectFilter.config.dropdownParent = this.item
|
||||||
}
|
}
|
||||||
@ -116,6 +132,7 @@ class PlanningRotativa {
|
|||||||
this.totalMetros = new AutoNumeric(this.item.find('#total-metros')[0], autoNumericOptions);
|
this.totalMetros = new AutoNumeric(this.item.find('#total-metros')[0], autoNumericOptions);
|
||||||
this.totalMetrosSel = new AutoNumeric(this.item.find('#metros-sel-total')[0], autoNumericOptions);
|
this.totalMetrosSel = new AutoNumeric(this.item.find('#metros-sel-total')[0], autoNumericOptions);
|
||||||
this.totalPliegos = new AutoNumeric(this.item.find('#total-pliegos')[0], autoNumericPliegosOptions);
|
this.totalPliegos = new AutoNumeric(this.item.find('#total-pliegos')[0], autoNumericPliegosOptions);
|
||||||
|
this.totalMaquinaPliegos = new AutoNumeric(this.item.find('#total-pliegos-maquina')[0], autoNumericPliegosOptions);
|
||||||
this.totalPliegosSel = new AutoNumeric(this.item.find('#pliegos-sel-total')[0], autoNumericPliegosOptions);
|
this.totalPliegosSel = new AutoNumeric(this.item.find('#pliegos-sel-total')[0], autoNumericPliegosOptions);
|
||||||
|
|
||||||
this.maquinaSelectFilter.init()
|
this.maquinaSelectFilter.init()
|
||||||
@ -123,6 +140,10 @@ class PlanningRotativa {
|
|||||||
this.maquinaSelectFilterPlana.init()
|
this.maquinaSelectFilterPlana.init()
|
||||||
this.papelImpresionFilterPlana.init()
|
this.papelImpresionFilterPlana.init()
|
||||||
this.maquinaPadreSelectFilterPlana.init();
|
this.maquinaPadreSelectFilterPlana.init();
|
||||||
|
this.maquinaPadreSelectFilterPlana.onChange(() => {
|
||||||
|
const params = {padre_id : this.maquinaPadreSelectFilterPlana.getVal()}
|
||||||
|
this.maquinaSelectFilterPlana.params = {...params}
|
||||||
|
})
|
||||||
this.checkAllMetros.on('change', () => {
|
this.checkAllMetros.on('change', () => {
|
||||||
let isChecked = this.checkAllMetros.prop('checked')
|
let isChecked = this.checkAllMetros.prop('checked')
|
||||||
this.item.find(".metros-check").prop('checked', isChecked).trigger("change")
|
this.item.find(".metros-check").prop('checked', isChecked).trigger("change")
|
||||||
@ -133,7 +154,8 @@ class PlanningRotativa {
|
|||||||
})
|
})
|
||||||
this.papelGramajeTablePlanning.on('click', '.papel-gramaje-btn', this.filterPapelGramaje.bind(this))
|
this.papelGramajeTablePlanning.on('click', '.papel-gramaje-btn', this.filterPapelGramaje.bind(this))
|
||||||
this.papelPliegoTablePlanning.on('click', '.papel-pliego-btn', this.filterPapelGramajePlana.bind(this))
|
this.papelPliegoTablePlanning.on('click', '.papel-pliego-btn', this.filterPapelGramajePlana.bind(this))
|
||||||
|
this.maquinaTablePlanning.on('click', '.maquina-planning-btn', this.filterMaquinaPlana.bind(this))
|
||||||
|
//!AÑADIR MAQUINA
|
||||||
this.papelImpresionFilter.onChange(() => {
|
this.papelImpresionFilter.onChange(() => {
|
||||||
this.papelImpresionHeader.text(this.papelImpresionFilter.getText())
|
this.papelImpresionHeader.text(this.papelImpresionFilter.getText())
|
||||||
})
|
})
|
||||||
@ -151,8 +173,8 @@ class PlanningRotativa {
|
|||||||
language: {
|
language: {
|
||||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
},
|
},
|
||||||
createdRow: (row,data,dataIndex) => {
|
createdRow: (row, data, dataIndex) => {
|
||||||
this.getColorOtStatus(row,data)
|
this.getColorOtStatus(row, data)
|
||||||
},
|
},
|
||||||
columns: this.datatableColumns,
|
columns: this.datatableColumns,
|
||||||
ajax: '/produccion/ordentrabajo/planning/rotativa/datatable'
|
ajax: '/produccion/ordentrabajo/planning/rotativa/datatable'
|
||||||
@ -168,13 +190,13 @@ class PlanningRotativa {
|
|||||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
},
|
},
|
||||||
columns: this.datatablePlanaColumns,
|
columns: this.datatablePlanaColumns,
|
||||||
createdRow: (row,data,dataIndex) => {
|
createdRow: (row, data, dataIndex) => {
|
||||||
this.getColorOtStatus(row,data)
|
this.getColorOtStatus(row, data)
|
||||||
},
|
},
|
||||||
ajax: {
|
ajax: {
|
||||||
url : '/produccion/ordentrabajo/planning/plana/datatable',
|
url: '/produccion/ordentrabajo/planning/plana/datatable',
|
||||||
data : d => {
|
data: d => {
|
||||||
if(this.maquinaPadreSelectFilterPlana.getVal()){
|
if (this.maquinaPadreSelectFilterPlana.getVal()) {
|
||||||
d.padre_id = this.maquinaPadreSelectFilterPlana.getVal()
|
d.padre_id = this.maquinaPadreSelectFilterPlana.getVal()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -206,11 +228,23 @@ class PlanningRotativa {
|
|||||||
columns: this.papelPliegoDatatableColumns,
|
columns: this.papelPliegoDatatableColumns,
|
||||||
ajax: '/produccion/ordentrabajo/planning/papel/plana/datatable'
|
ajax: '/produccion/ordentrabajo/planning/papel/plana/datatable'
|
||||||
});
|
});
|
||||||
|
this.maquinaPlanaDatatable = this.maquinaTablePlanning.DataTable({
|
||||||
|
processing: true,
|
||||||
|
orderCellsTop: true,
|
||||||
|
dom: 'lrtip',
|
||||||
|
serverSide: true,
|
||||||
|
responsive: true,
|
||||||
|
pageLength: 10,
|
||||||
|
language: {
|
||||||
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
|
},
|
||||||
|
columns: this.maquinaPlanaDatatableColumns,
|
||||||
|
ajax: '/produccion/ordentrabajo/planning/maquina/plana/datatable'
|
||||||
|
});
|
||||||
/**
|
/**
|
||||||
* PLANNING ROTATIVA
|
* PLANNING ROTATIVA
|
||||||
*/
|
*/
|
||||||
this.tablePlanningRot.on("keyup", ".planning-filter", (event) => {
|
this.tablePlanningRot.on("keyup", ".planning-filter", (event) => {
|
||||||
console.log(this.datatablePlanningRot.column($(event.currentTarget).attr("name")))
|
|
||||||
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
let columnIndex = this.datatableColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
||||||
this.datatablePlanningRot.column(columnIndex).search($(event.currentTarget).val()).draw()
|
this.datatablePlanningRot.column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||||
})
|
})
|
||||||
@ -225,12 +259,11 @@ class PlanningRotativa {
|
|||||||
this.papelGramajeDatatable.on('draw', this.addTotalFooter.bind(this))
|
this.papelGramajeDatatable.on('draw', this.addTotalFooter.bind(this))
|
||||||
|
|
||||||
this.tablePlanningRot.on('change', ".metros-check", this.calcMetrosCheck.bind(this))
|
this.tablePlanningRot.on('change', ".metros-check", this.calcMetrosCheck.bind(this))
|
||||||
this.tablePlanningRot.on("click",'.change-corte',this.toggleCorte.bind(this))
|
this.tablePlanningRot.on("click", '.change-corte', this.toggleCorte.bind(this))
|
||||||
/**
|
/**
|
||||||
* PLANNING PLANA
|
* PLANNING PLANA
|
||||||
*/
|
*/
|
||||||
this.tablePlanningPlana.on("keyup", ".planning-filter", (event) => {
|
this.tablePlanningPlana.on("keyup", ".planning-filter", (event) => {
|
||||||
console.log(this.datatablePlanningRot.column($(event.currentTarget).attr("name")))
|
|
||||||
let columnIndex = this.datatablePlanaColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
let columnIndex = this.datatablePlanaColumns.findIndex((element) => element.data == $(event.currentTarget).attr("name"))
|
||||||
this.datatablePlanningPlana.column(columnIndex).search($(event.currentTarget).val()).draw()
|
this.datatablePlanningPlana.column(columnIndex).search($(event.currentTarget).val()).draw()
|
||||||
})
|
})
|
||||||
@ -246,7 +279,7 @@ class PlanningRotativa {
|
|||||||
this.datatablePlanningPlana.ajax.reload();
|
this.datatablePlanningPlana.ajax.reload();
|
||||||
})
|
})
|
||||||
this.papelPliegoDatatable.on('draw', this.addTotalFooterPliego.bind(this))
|
this.papelPliegoDatatable.on('draw', this.addTotalFooterPliego.bind(this))
|
||||||
|
this.maquinaPlanaDatatable.on('draw', this.addTotalFooterMaquinaPlana.bind(this))
|
||||||
this.tablePlanningPlana.on('change', ".pliegos-check", this.calcPliegosCheck.bind(this))
|
this.tablePlanningPlana.on('change', ".pliegos-check", this.calcPliegosCheck.bind(this))
|
||||||
}
|
}
|
||||||
_renderBtnAction(d) {
|
_renderBtnAction(d) {
|
||||||
@ -254,7 +287,6 @@ class PlanningRotativa {
|
|||||||
}
|
}
|
||||||
_columnFiltering() {
|
_columnFiltering() {
|
||||||
this.api().columns()
|
this.api().columns()
|
||||||
console.log(this.api().columns())
|
|
||||||
}
|
}
|
||||||
filterPapelGramaje(event) {
|
filterPapelGramaje(event) {
|
||||||
const papelImpresionId = $(event.currentTarget).data('id')
|
const papelImpresionId = $(event.currentTarget).data('id')
|
||||||
@ -264,6 +296,10 @@ class PlanningRotativa {
|
|||||||
const papelImpresionId = $(event.currentTarget).data('id')
|
const papelImpresionId = $(event.currentTarget).data('id')
|
||||||
this.getPapelImpresionPlana(papelImpresionId)
|
this.getPapelImpresionPlana(papelImpresionId)
|
||||||
}
|
}
|
||||||
|
filterMaquinaPlana(event) {
|
||||||
|
const maquinaId = $(event.currentTarget).data('id')
|
||||||
|
this.getMaquinaPlana(maquinaId)
|
||||||
|
}
|
||||||
getPapelImpresion(papelImpresionId) {
|
getPapelImpresion(papelImpresionId) {
|
||||||
let ajax = new Ajax('/configuracion/papelesimpresion/show/' + papelImpresionId,
|
let ajax = new Ajax('/configuracion/papelesimpresion/show/' + papelImpresionId,
|
||||||
null,
|
null,
|
||||||
@ -282,6 +318,15 @@ class PlanningRotativa {
|
|||||||
)
|
)
|
||||||
ajax.get()
|
ajax.get()
|
||||||
}
|
}
|
||||||
|
getMaquinaPlana(maquinaId) {
|
||||||
|
let ajax = new Ajax('/configuracion/maquinas/' + maquinaId,
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
this.getMaquinaPlanaSuccess.bind(this),
|
||||||
|
this.getMaquinaPlanaError.bind(this)
|
||||||
|
)
|
||||||
|
ajax.get()
|
||||||
|
}
|
||||||
getPapelImpresionSuccess(response) {
|
getPapelImpresionSuccess(response) {
|
||||||
this.papelImpresionFilter.setOption(response.id, response.nombre)
|
this.papelImpresionFilter.setOption(response.id, response.nombre)
|
||||||
this.tablePlanningRot.find('input[name=papel_gramaje]').val(response.gramaje).trigger("change")
|
this.tablePlanningRot.find('input[name=papel_gramaje]').val(response.gramaje).trigger("change")
|
||||||
@ -293,7 +338,18 @@ class PlanningRotativa {
|
|||||||
this.tablePlanningPlana.find('input[name=papel_gramaje]').val(response.gramaje).trigger("change")
|
this.tablePlanningPlana.find('input[name=papel_gramaje]').val(response.gramaje).trigger("change")
|
||||||
this.papelImpresionPlanaHeader.text(response.nombre)
|
this.papelImpresionPlanaHeader.text(response.nombre)
|
||||||
}
|
}
|
||||||
|
getMaquinaPlanaSuccess(response) {
|
||||||
|
if (response.is_padre != 0) {
|
||||||
|
this.maquinaSelectFilterPlana.setOption(response.id, response.nombre)
|
||||||
|
this.tablePlanningPlana.find('input[name=maquina_planning_nombre]').val(response.nombre).trigger("change")
|
||||||
|
} else {
|
||||||
|
this.maquinaPadreSelectFilterPlana.setOption(response.id, response.nombre)
|
||||||
|
this.tablePlanningPlana.find('input[name=lg_maquinas.padre_id]').val(response.nombre).trigger("change")
|
||||||
|
}
|
||||||
|
this.papelImpresionPlanaHeader.text(response.nombre)
|
||||||
|
}
|
||||||
getPapelImpresionPlanaError(response) { }
|
getPapelImpresionPlanaError(response) { }
|
||||||
|
getMaquinaPlanaError(response) { }
|
||||||
formatSeconds(s) {
|
formatSeconds(s) {
|
||||||
const hours = Math.floor(s / 60 / 60)
|
const hours = Math.floor(s / 60 / 60)
|
||||||
const minutes = Math.floor(s / 60 % 60)
|
const minutes = Math.floor(s / 60 % 60)
|
||||||
@ -316,8 +372,14 @@ class PlanningRotativa {
|
|||||||
const pliegos = this.papelPliegoDatatable.column(4).data().map((e) => parseFloat(e))
|
const pliegos = this.papelPliegoDatatable.column(4).data().map((e) => parseFloat(e))
|
||||||
$('#total-tiempo-pliego').text(this.formatSeconds(seconds))
|
$('#total-tiempo-pliego').text(this.formatSeconds(seconds))
|
||||||
this.totalPliegos.set(pliegos.reduce((a, b) => a + b, 0))
|
this.totalPliegos.set(pliegos.reduce((a, b) => a + b, 0))
|
||||||
|
}
|
||||||
|
addTotalFooterMaquinaPlana() {
|
||||||
|
const seconds = this.maquinaPlanaDatatable.column(4).data().reduce((a, b) => {
|
||||||
|
return parseFloat(a) + parseFloat(b)
|
||||||
|
}, 0)
|
||||||
|
const pliegos = this.maquinaPlanaDatatable.column(3).data().map((e) => parseFloat(e))
|
||||||
|
$('#total-tiempo-pliego-maquina').text(this.formatSeconds(seconds))
|
||||||
|
this.totalMaquinaPliegos.set(pliegos.reduce((a, b) => a + b, 0))
|
||||||
}
|
}
|
||||||
calcMetrosCheck() {
|
calcMetrosCheck() {
|
||||||
const metros_sel = this.datatablePlanningRot.rows((idx, data, node) => {
|
const metros_sel = this.datatablePlanningRot.rows((idx, data, node) => {
|
||||||
@ -334,15 +396,13 @@ class PlanningRotativa {
|
|||||||
return $(node).find('input[type="checkbox"]').prop('checked');
|
return $(node).find('input[type="checkbox"]').prop('checked');
|
||||||
}).data().toArray().map((e) => parseFloat(e.tiempo_real_sum))
|
}).data().toArray().map((e) => parseFloat(e.tiempo_real_sum))
|
||||||
this.totalPliegosSel.set(metros_sel.reduce((a, b) => a + b, 0))
|
this.totalPliegosSel.set(metros_sel.reduce((a, b) => a + b, 0))
|
||||||
const totalSeconds = tiempo_total_sel.reduce((a,b) => a+b,0)
|
const totalSeconds = tiempo_total_sel.reduce((a, b) => a + b, 0)
|
||||||
console.log("Total seconds",totalSeconds);
|
|
||||||
this.tiempoPlanaTotal.text(this.formatSeconds(totalSeconds))
|
this.tiempoPlanaTotal.text(this.formatSeconds(totalSeconds))
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
renderCorteImage(data) {
|
renderCorteImage(data) {
|
||||||
const tipo_corte = data.tipo_corte == "bobina" ? "cortadora_bobinas" : "guillotina";
|
const tipo_corte = data.tipo_corte == "bobina" ? "cortadora_bobinas" : "guillotina";
|
||||||
console.log(data.tipo_corte)
|
|
||||||
return `
|
return `
|
||||||
<a type="button" class="btn btn-outline-secondary bg-white btn-xs change-corte" data-id=${data.otId}>
|
<a type="button" class="btn btn-outline-secondary bg-white btn-xs change-corte" data-id=${data.otId}>
|
||||||
<div class="avatar avatar-size-xs">
|
<div class="avatar avatar-size-xs">
|
||||||
@ -351,7 +411,7 @@ class PlanningRotativa {
|
|||||||
</a>
|
</a>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
toggleCorte(event){
|
toggleCorte(event) {
|
||||||
let otId = $(event.currentTarget).data('id')
|
let otId = $(event.currentTarget).data('id')
|
||||||
let ajax = new Ajax("/produccion/ordentrabajo/planning/tarea/toggle/corte/" + otId,
|
let ajax = new Ajax("/produccion/ordentrabajo/planning/tarea/toggle/corte/" + otId,
|
||||||
null,
|
null,
|
||||||
@ -361,18 +421,18 @@ class PlanningRotativa {
|
|||||||
)
|
)
|
||||||
ajax.post()
|
ajax.post()
|
||||||
}
|
}
|
||||||
toggleCorteSuccess(response){
|
toggleCorteSuccess(response) {
|
||||||
this.datatablePlanningRot.ajax.reload()
|
this.datatablePlanningRot.ajax.reload()
|
||||||
alertSuccess(response.message).fire()
|
alertSuccess(response.message).fire()
|
||||||
}
|
}
|
||||||
toggleCorteError(){
|
toggleCorteError() {
|
||||||
}
|
}
|
||||||
getColorOtStatus(row,data){
|
getColorOtStatus(row, data) {
|
||||||
let ajax = new Ajax("/produccion/ordentrabajo/color/"+data.otId,null,null,
|
let ajax = new Ajax("/produccion/ordentrabajo/color/" + data.otId, null, null,
|
||||||
(response) => {
|
(response) => {
|
||||||
$(row).css("border-left",`10px solid ${response.color}`)
|
$(row).css("border-left", `10px solid ${response.color}`)
|
||||||
$(row).css("border-right",`10px solid ${response.color}`)
|
$(row).css("border-right", `10px solid ${response.color}`)
|
||||||
},null
|
}, null
|
||||||
)
|
)
|
||||||
ajax.get()
|
ajax.get()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user