diff --git a/ci4/app/Controllers/Test.php b/ci4/app/Controllers/Test.php index 93c983c9..f6f20f20 100644 --- a/ci4/app/Controllers/Test.php +++ b/ci4/app/Controllers/Test.php @@ -4,6 +4,7 @@ namespace App\Controllers; use App\Controllers\BaseController; use App\Models\Configuracion\MaquinasTarifasImpresionModel; +use App\Models\Configuracion\PapelGenericoModel; use App\Models\Configuracion\MaquinaModel; use App\Services\PresupuestoService; @@ -16,7 +17,21 @@ class Test extends BaseController public function index() { - $this->testLineasCubierta(); + $this->testLineasIntPlana(); + } + + public function getPapelesHQ(){ + $model = model('App\Models\Configuracion\PapelGenericoModel'); + $data = $model->getPapelForComparador('colorhq', false, false); + + var_dump($data); + } + + public function getGramaje(){ + $model = new PapelGenericoModel(); + $data = $model->getGramajeComparador("AHUESADO OFFSET", "bnhq" ); + + var_dump($data); } public function testGetPrecioPliegoRotativa() @@ -58,8 +73,8 @@ class Test extends BaseController public static function testLineasIntPlana() { - $uso = 'negro'; - $tipo = 'color'; + $uso = 'interior'; + $tipo = 'colorhq'; $datosPedido = (object)array( 'paginas' => 200, 'tirada' => 500, @@ -73,7 +88,7 @@ class Test extends BaseController $maquina_model = new \App\Models\Configuracion\MaquinaModel(); $opciones_papel = array( - 'bn' => 1, + 'color' => 1, 'cubierta' => 0, 'sobrecubierta' => 0, 'rotativa' => 0, @@ -88,7 +103,7 @@ class Test extends BaseController echo '-------------------------------'; $maquinas = $maquina_model->getMaquinaImpresionForPresupuesto( is_rotativa: $papel->rotativa, - tarifa_tipo: 'negro', + tarifa_tipo: 'colorhq', tirada: $datosPedido->tirada + $datosPedido->merma, papel_impresion_id: $papel->id, ); diff --git a/ci4/app/Language/en/Presupuestos.php b/ci4/app/Language/en/Presupuestos.php index f19e9034..dc64feb9 100644 --- a/ci4/app/Language/en/Presupuestos.php +++ b/ci4/app/Language/en/Presupuestos.php @@ -99,7 +99,43 @@ return [ 'rotativa' => 'rotary', 'lineasPresupuesto' => 'Budget Lines', 'tiempo' => 'Time', - + + 'porDefecto' => 'Deafult', + 'tipoImpresion' => 'Print', + 'numPagColor' => 'No Color Pages', + 'saturacion' => 'Saturation', + 'cobNegro' => 'Cov. % Black', + 'cobCyan' => 'Cov. % Cyan', + 'cobMagenta' => 'Cov. % Magenta', + 'cobAmarillo' => 'Cov. % Yellow', + 'gotaNegro' => 'Black drop', + 'gotaColor' => 'Color drop', + 'totalLinea' => 'TOTAL LINE', + 'verCalculos' => 'Calculations', + 'metrosMinuto' => 'Meters x min.', + 'resolucion' => 'Resolution (dpi)', + 'areaPaginas' => 'Pages area (in)', + 'gotasNegro' => 'No black drops', + 'gotasCyan' => 'No color drops', + 'gotasMagenta' => 'No magenta drops', + 'gotasAmarillo' => 'No yellow drops', + 'precioPagNegro' => 'Price black pages', + 'precioPagColor' => 'Price color pages', + 'factorAltura' => 'Height factor', + 'factorAnchura' => 'Width factor', + 'paginasPliego' => 'Pages/sheet', + 'metrosPapelLibro' => 'M. Paper Book', + 'metrosPapelTotal' => 'M. Paper Total', + 'clicksLibro' => 'Clicks/Book', + 'gTintaNegro' => 'G. Black Ink', + 'gTintaCyan' => 'G. Cyan Ink', + 'gTintaMagenta' => 'G. Magenta Ink', + 'gTintaAmarillo' => 'G. Yellow Ink', + 'clicksPedido' => 'Clicks Order', + 'totalClicks' => 'Total Clicks', + 'totalTinta' => 'Total Ink', + 'totalCorte' => 'Total Cut', + 'totalImpresion' => 'TOTAL PRINT', /* '4x0' => '4x0', '4x4' => '4x4', diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php index 3f5e4f2b..c576203b 100644 --- a/ci4/app/Language/es/Presupuestos.php +++ b/ci4/app/Language/es/Presupuestos.php @@ -78,7 +78,7 @@ return [ 'totalTinta' => 'Total tinta', 'totalCorte' => 'Total corte', 'total' => 'Total', - 'aFavorFibra' => 'A favor fibra', + 'aFavorFibra' => 'A favor de fibra', 'cubierta' => 'Cubierta', 'sobrecubierta' => 'Sobrecubierta', 'encuadernacion' => 'Encuadernación', @@ -98,6 +98,50 @@ return [ 'rotativa' => 'rotativa', 'lineasPresupuesto' => 'Líneas Presupuesto', 'tiempo' => 'Tiempo', + + 'porDefecto' => 'Por defecto', + 'tipoImpresion' => 'Impresion', + 'numPagColor' => 'Nº Paginas Color', + 'saturacion' => 'Saturación', + 'cobNegro' => 'Cob. % Negro', + 'cobCyan' => 'Cob. % Cyan', + 'cobMagenta' => 'Cob. % Magenta', + 'cobAmarillo' => 'Cob. % Amarillo', + 'gotaNegro' => 'Gota negro', + 'gotaColor' => 'Gota color', + 'totalLinea' => 'TOTAL LÍNEA', + 'verCalculos' => 'Cálculos', + 'metrosMinuto' => 'Metros x min.', + 'resolucion' => 'Resolución (dpi)', + 'areaPaginas' => 'Área páginas (in)', + 'gotasNegro' => 'Nº gotas negro', + 'gotasCyan' => 'Nº gotas cyan', + 'gotasMagenta' => 'Nº gotas magenta', + 'gotasAmarillo' => 'Nº gotas amarillo', + 'precioPagNegro' => 'Precio pág. Negro', + 'precioPagColor' => 'Precio pág. Color', + 'factorAltura' => 'Factor altura', + 'factorAnchura' => 'Factor anchura', + 'paginasPliego' => 'Páginas/pliego', + 'metrosPapelLibro' => 'M. Papel Libro', + 'metrosPapelTotal' => 'M. Papel Total', + 'clicksLibro' => 'Clicks/Libro', + 'gTintaNegro' => 'G. tinta Negro', + 'gTintaCyan' => 'G. tinta Cyan', + 'gTintaMagenta' => 'G. tinta Magenta', + 'gTintaAmarillo' => 'G. tinta Amarillo', + 'clicksPedido' => 'Clicks Pedido', + 'totalClicks' => 'Total Clicks', + 'totalTinta' => 'Total Tinta', + 'totalCorte' => 'Total Corte', + 'totalImpresion' => 'TOTAL IMPRES.', + 'velocidadCorte' => 'Velocidad corte', + 'precioHoraCorte' => 'Precio hora corte', + 'tiempoCorte' => 'Tiempo corte', + 'gTintaNegroPed' => 'G.T. Negro Ped.', + 'gTintaCyanPed' => 'G.T. Cyan Ped.', + 'gTintaMagentaPed' => 'G.T. Magenta Ped.', + 'gTintaAmarilloPed' => 'G.T. Amarillo Ped.', 'servicioAcabado' => 'Servicio de acabado', 'servicioPreimpresion' => 'Servicio de preimpresión', diff --git a/ci4/app/Models/Configuracion/PapelGenericoModel.php b/ci4/app/Models/Configuracion/PapelGenericoModel.php index 32bddfeb..eb971ea2 100644 --- a/ci4/app/Models/Configuracion/PapelGenericoModel.php +++ b/ci4/app/Models/Configuracion/PapelGenericoModel.php @@ -114,6 +114,7 @@ class PapelGenericoModel extends \App\Models\GoBaseModel ->where("t1.is_deleted", 0) ->where("t2.is_deleted", 0) + ->where("t3.active", 1) ->where("t4.is_deleted", 0) ->where("t4.tipo", "impresion") ->where("t5.tipo", $tipo); @@ -134,21 +135,34 @@ class PapelGenericoModel extends \App\Models\GoBaseModel public function getGramajeComparador(string $papel_generico_nombre="", $uso="") { + $tipo=$uso; // color y colorhq valen para los dos + if($uso == 'bn') + $tipo="negro"; + if($uso == 'bnhq') + $tipo="negrohq"; + $builder = $this->db ->table($this->table . " t1") ->select( "t2.gramaje AS text" ) ->join("lg_papel_impresion t2", "t2.papel_generico_id = t1.id", "left") + ->join("lg_maquina_papel_impresion t3", "t3.papel_impresion_id = t2.id", "left") + ->join("lg_maquinas t4", "t3.maquina_id = t4.id", "left") + ->join("lg_maquinas_tarifas_impresion t5", "t5.maquina_id = t4.id", "left") ->where("t1.is_deleted", 0) ->where("t2.is_deleted", 0) ->where("t2.isActivo", 1) + ->where("t3.active", 1) + ->where("t4.is_deleted", 0) + ->where("t4.tipo", "impresion") + ->where("t5.tipo", $tipo) ->where("t1.nombre", $papel_generico_nombre); - if($uso == 'bn') + if($uso == 'bn' || $uso == 'bnhq') $builder->where("t2.bn", 1); - else if ($uso == 'color') + else if ($uso == 'color' || $uso == 'colorhq') $builder->where("t2.color", 1); else if ($uso == 'cubierta') $builder->where("t2.cubierta", 1); diff --git a/ci4/app/Services/PresupuestoService.php b/ci4/app/Services/PresupuestoService.php index 14d4a374..c3a05d5c 100644 --- a/ci4/app/Services/PresupuestoService.php +++ b/ci4/app/Services/PresupuestoService.php @@ -361,10 +361,18 @@ class PresupuestoService extends BaseService } public static function getTiempoMaquina($totalClicks, $precioClick, $velocidadMaquina) { + try { + + if($precioClick>0 && $velocidadMaquina>0) + $minutos = (1.0*$totalClicks/$precioClick)/$velocidadMaquina; + else + $minutos = 0; - $minutos = (1.0*$totalClicks/$precioClick)/$velocidadMaquina; - - return gmdate("H:i:s", round($minutos*60,0)); + return gmdate("H:i:s", round($minutos*60,0)); + + } catch (Exception $e) { + return gmdate("H:i:s", round(0,0)); + } } diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php index e5fef0a9..88cd20a4 100644 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems.php @@ -12,27 +12,784 @@