mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'dev/new_lp' into 'main'
Dev/new lp See merge request jjimenez/safekat!109
This commit is contained in:
4
ci4/.env
4
ci4/.env
@ -22,8 +22,8 @@ CI_ENVIRONMENT = development
|
|||||||
# APP
|
# APP
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
# app.baseURL = 'https://sk-jjo.imnavajas.es'
|
app.baseURL = 'https://sk-jjo.imnavajas.es'
|
||||||
app.baseURL = 'https://sk-imn.imnavajas.es'
|
# app.baseURL = 'https://sk-imn.imnavajas.es'
|
||||||
# app.baseURL = "http://safekat.test/"
|
# app.baseURL = "http://safekat.test/"
|
||||||
# app.forceGlobalSecureRequests = false
|
# app.forceGlobalSecureRequests = false
|
||||||
|
|
||||||
|
|||||||
@ -11,6 +11,7 @@ use App\Models\Presupuestos\PresupuestoDireccionesModel;
|
|||||||
use App\Models\Configuracion\PapelGenericoModel;
|
use App\Models\Configuracion\PapelGenericoModel;
|
||||||
use App\Models\Configuracion\TipoPresupuestoModel;
|
use App\Models\Configuracion\TipoPresupuestoModel;
|
||||||
use App\Models\Presupuestos\PresupuestoModel;
|
use App\Models\Presupuestos\PresupuestoModel;
|
||||||
|
use App\Models\Presupuestos\PresupuestoLineaModel;
|
||||||
|
|
||||||
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
|
use App\Models\Presupuestos\PresupuestoEncuadernacionesModel;
|
||||||
use App\Models\Presupuestos\PresupuestoAcabadosModel;
|
use App\Models\Presupuestos\PresupuestoAcabadosModel;
|
||||||
@ -144,13 +145,16 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
endif; // ($requestMethod === 'post')
|
endif; // ($requestMethod === 'post')
|
||||||
|
|
||||||
|
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
||||||
$this->viewData['presupuestoEntity'] = isset($sanitizedData) ? new PresupuestoEntity($sanitizedData) : new PresupuestoEntity();
|
$this->viewData['presupuestoEntity'] = isset($sanitizedData) ? new PresupuestoEntity($sanitizedData) : new PresupuestoEntity();
|
||||||
|
$this->viewData['isCosido'] = (new TipoPresupuestoModel())->get_isCosido($this->viewData['tipo_impresion_id']);
|
||||||
|
|
||||||
$this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null);
|
$this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null);
|
||||||
$this->viewData['incReiList'] = array('incidencia' => lang('Presupuestos.incidencia'), 'reimpresion' => lang('Presupuestos.reimpresion'), 'sin_cargo' => lang('Presupuestos.sinCargo'));
|
$this->viewData['incReiList'] = array('incidencia' => lang('Presupuestos.incidencia'), 'reimpresion' => lang('Presupuestos.reimpresion'), 'sin_cargo' => lang('Presupuestos.sinCargo'));
|
||||||
$this->viewData['paisList'] = $this->getPaisListItems();
|
$this->viewData['paisList'] = $this->getPaisListItems();
|
||||||
$this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null);
|
$this->viewData['papelFormatoList'] = $this->getPapelFormatoListItems($presupuestoEntity->papel_formato_id ?? null);
|
||||||
|
|
||||||
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
|
||||||
|
|
||||||
$this->viewData['formAction'] = route_to('createCosidotapablanda');
|
$this->viewData['formAction'] = route_to('createCosidotapablanda');
|
||||||
|
|
||||||
@ -303,7 +307,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
$this->viewData['papelGenericoRotativaColorList'] = $this->getPapelGenericoRotativaColor();
|
$this->viewData['papelGenericoRotativaColorList'] = $this->getPapelGenericoRotativaColor();
|
||||||
|
|
||||||
// Lineas Presupuesto
|
// Lineas Presupuesto
|
||||||
$this->viewData['lineasPresupuesto'] = $this->getLineasPresupuestoActivas($id);
|
$this->viewData['lineasPresupuesto'] = (new PresupuestoLineaModel())->getLineasPresupuesto($id);
|
||||||
|
|
||||||
// Tarifas
|
// Tarifas
|
||||||
$this->viewData['serviciosAcabado'] = $this->getServiciosAcabado();
|
$this->viewData['serviciosAcabado'] = $this->getServiciosAcabado();
|
||||||
@ -524,11 +528,14 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
if($tipo=='lineasPresupuesto'){
|
if($tipo=='lineasPresupuesto'){
|
||||||
|
|
||||||
|
$model = model('App\Models\Presupuestos\PresupuestoLineaModel');
|
||||||
|
|
||||||
$datos = $reqData['datos'] ?? null;
|
$datos = $reqData['datos'] ?? null;
|
||||||
$presupuesto_id = $reqData['presupuesto_id'] ?? -1;
|
$presupuesto_id = $reqData['presupuesto_id'] ?? -1;
|
||||||
|
|
||||||
if($datos != null){
|
if($datos != null){
|
||||||
$this->updateLineasPresupuestoActivas($presupuesto_id, $datos);
|
|
||||||
|
$model->insertLineasPresupuesto($presupuesto_id, $datos);
|
||||||
}
|
}
|
||||||
$newTokenHash = csrf_hash();
|
$newTokenHash = csrf_hash();
|
||||||
$csrfTokenName = csrf_token();
|
$csrfTokenName = csrf_token();
|
||||||
@ -648,11 +655,15 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$linea['fields']['precio_hora'] = $precio_hora;
|
$linea['fields']['tipo_maquina'] = $maquina->is_tinta?'inkjet':'toner';
|
||||||
|
$linea['fields']['precio_hora'] = $precio_hora*$margen_precio_hora/100.0;
|
||||||
$linea['fields']['precio_hora_margen'] = $margen_precio_hora;
|
$linea['fields']['precio_hora_margen'] = $margen_precio_hora;
|
||||||
$linea['fields']['horas_maquina'] = $tiempo;
|
$linea['fields']['horas_maquina'] = $tiempo;
|
||||||
$linea['fields']['precio_impresion_horas'] = $precio_hora*$tiempo*1.0;
|
$linea['fields']['precio_impresion_horas'] = $precio_hora*$tiempo*1.0;
|
||||||
$linea['fields']['margen_impresion_horas'] = $precio_hora*$tiempo*1.0*$margen_precio_hora/100.0;
|
$linea['fields']['margen_impresion_horas'] = $precio_hora*$tiempo*1.0*$margen_precio_hora/100.0;
|
||||||
|
|
||||||
|
$linea['fields']['total_impresion'] = $linea['fields']['precio_pedido'] + // papel
|
||||||
|
$linea['fields']['precio_impresion_horas']; // impresion
|
||||||
|
|
||||||
array_push($lineas, $linea);
|
array_push($lineas, $linea);
|
||||||
}
|
}
|
||||||
@ -766,6 +777,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
$linea['fields']['maquina'] = $maquina->maquina;
|
$linea['fields']['maquina'] = $maquina->maquina;
|
||||||
$linea['fields']['maquina_id'] = $maquina->maquina_id;
|
$linea['fields']['maquina_id'] = $maquina->maquina_id;
|
||||||
$linea['fields']['maquina_velocidad'] = $maquina->velocidad;
|
$linea['fields']['maquina_velocidad'] = $maquina->velocidad;
|
||||||
|
$linea['fields']['tipo_maquina'] = 'inkjet';
|
||||||
$linea['fields']['papel_impresion'] = $papel->nombre;
|
$linea['fields']['papel_impresion'] = $papel->nombre;
|
||||||
$linea['fields']['papel_impresion_id'] = $papel->id;
|
$linea['fields']['papel_impresion_id'] = $papel->id;
|
||||||
$linea['fields']['paginas'] = $datosPedido->paginas;
|
$linea['fields']['paginas'] = $datosPedido->paginas;
|
||||||
@ -808,7 +820,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$linea['fields']['precio_hora'] = $precio_hora;
|
$linea['fields']['precio_hora'] = $precio_hora*$margen_precio_hora/100.0;
|
||||||
$linea['fields']['precio_hora_margen'] = $margen_precio_hora;
|
$linea['fields']['precio_hora_margen'] = $margen_precio_hora;
|
||||||
$linea['fields']['horas_maquina'] = $tiempo;
|
$linea['fields']['horas_maquina'] = $tiempo;
|
||||||
$linea['fields']['precio_impresion_horas'] = $precio_hora*$tiempo*1.0;
|
$linea['fields']['precio_impresion_horas'] = $precio_hora*$tiempo*1.0;
|
||||||
@ -1066,7 +1078,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
protected function getPapelGenericoCubierta()
|
protected function getPapelGenericoCubierta()
|
||||||
{
|
{
|
||||||
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
||||||
$data = $model->getPapelForComparador('color', true, false);
|
$data = $model->getPapelForComparador('colorhq', true, false);
|
||||||
array_unshift($data, (object)array(
|
array_unshift($data, (object)array(
|
||||||
"id" => 0,
|
"id" => 0,
|
||||||
"nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
|
"nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
|
||||||
@ -1077,7 +1089,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
protected function getPapelGenericoSobreCubierta()
|
protected function getPapelGenericoSobreCubierta()
|
||||||
{
|
{
|
||||||
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
||||||
$data = $model->getPapelForComparador('color', false, true);
|
$data = $model->getPapelForComparador('colorhq', false, true);
|
||||||
array_unshift($data, (object)array(
|
array_unshift($data, (object)array(
|
||||||
"id" => 0,
|
"id" => 0,
|
||||||
"nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
|
"nombre" => lang('Basic.global.pleaseSelectA', [mb_strtolower(lang('Presupuestos.papel'))])
|
||||||
@ -1129,27 +1141,6 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getLineasPresupuestoActivas($presupuesto_id)
|
|
||||||
{
|
|
||||||
$model = model('App\Models\Presupuestos\PresupuestoLineaModel');
|
|
||||||
$data = $model->getLineasPresupuesto($presupuesto_id);
|
|
||||||
|
|
||||||
$papel_imp_model = model('App\Models\Configuracion\PapelImpresionModel');
|
|
||||||
$maquina_model = model('App\Models\Configuracion\MaquinaModel');
|
|
||||||
|
|
||||||
foreach($data as $linea){
|
|
||||||
$linea->papel_impresion_nombre = $papel_imp_model->getNombre($linea->papel_impresion_id)[0]->text;
|
|
||||||
$linea->maquina_nombre = $maquina_model->getNombre($linea->maquina_id)[0]->text;
|
|
||||||
}
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function updateLineasPresupuestoActivas($presupuesto_id, $datos)
|
|
||||||
{
|
|
||||||
$model = model('App\Models\Presupuestos\PresupuestoLineaModel');
|
|
||||||
return $model->updateLineasPresupuesto($presupuesto_id, $datos);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getPOD()
|
protected function getPOD()
|
||||||
{
|
{
|
||||||
$model = model('App\Models\Configuracion\ConfiguracionSistemaModel');
|
$model = model('App\Models\Configuracion\ConfiguracionSistemaModel');
|
||||||
|
|||||||
@ -155,6 +155,13 @@ class Test extends BaseController
|
|||||||
var_dump($data);
|
var_dump($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getPapelesCubierta(){
|
||||||
|
$model = model('App\Models\Configuracion\PapelGenericoModel');
|
||||||
|
$data = $model->getPapelForComparador('colorhq', true, false);
|
||||||
|
|
||||||
|
var_dump($data);
|
||||||
|
}
|
||||||
|
|
||||||
public function getGramaje(){
|
public function getGramaje(){
|
||||||
$model = new PapelGenericoModel();
|
$model = new PapelGenericoModel();
|
||||||
$data = $model->getGramajeComparador("AHUESADO OFFSET", "bnhq" );
|
$data = $model->getGramajeComparador("AHUESADO OFFSET", "bnhq" );
|
||||||
|
|||||||
@ -29,6 +29,7 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"precio" => null,
|
"precio" => null,
|
||||||
"total_papel_pedido" => null,
|
"total_papel_pedido" => null,
|
||||||
"margen_papel_pedido" => null,
|
"margen_papel_pedido" => null,
|
||||||
|
"margen_impresion" => null,
|
||||||
"rotativa_impresion" => null,
|
"rotativa_impresion" => null,
|
||||||
"rotativa_pag_color" => 0,
|
"rotativa_pag_color" => 0,
|
||||||
"rotativa_set_values" => false,
|
"rotativa_set_values" => false,
|
||||||
@ -65,9 +66,15 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"rotativa_tiempo_corte" => 0,
|
"rotativa_tiempo_corte" => 0,
|
||||||
"rotativa_precio_hora_corte" => 0,
|
"rotativa_precio_hora_corte" => 0,
|
||||||
"rotativa_total_corte" => 0,
|
"rotativa_total_corte" => 0,
|
||||||
"isActiva" => false,
|
|
||||||
"check_impresion_total" => false,
|
"check_impresion_total" => false,
|
||||||
"check_papel_total" => false,
|
"check_papel_total" => false,
|
||||||
|
"maquina" => null,
|
||||||
|
"papel_impresion" => null,
|
||||||
|
"maquina_tipo" => 'toner',
|
||||||
|
"horas_maquina" => 0,
|
||||||
|
"precio_hora" => 0,
|
||||||
|
"precio_impresion" => 0,
|
||||||
|
"total_linea" => 0,
|
||||||
];
|
];
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
"presupuesto_id" => "int",
|
"presupuesto_id" => "int",
|
||||||
@ -89,6 +96,7 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"precio" => "?float",
|
"precio" => "?float",
|
||||||
"total_papel_pedido" => "?float",
|
"total_papel_pedido" => "?float",
|
||||||
"margen_papel_pedido" => "?float",
|
"margen_papel_pedido" => "?float",
|
||||||
|
"margen_impresion" => "?float",
|
||||||
"rotativa_pag_color" => "int",
|
"rotativa_pag_color" => "int",
|
||||||
"rotativa_set_values" => "boolean",
|
"rotativa_set_values" => "boolean",
|
||||||
"rotativa_negro" => "float",
|
"rotativa_negro" => "float",
|
||||||
@ -124,8 +132,11 @@ class PresupuestoLineaEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"rotativa_tiempo_corte" => "float",
|
"rotativa_tiempo_corte" => "float",
|
||||||
"rotativa_precio_hora_corte" => "float",
|
"rotativa_precio_hora_corte" => "float",
|
||||||
"rotativa_total_corte" => "float",
|
"rotativa_total_corte" => "float",
|
||||||
"isActiva" => "boolean",
|
|
||||||
"check_impresion_total" => "boolean",
|
"check_impresion_total" => "boolean",
|
||||||
"check_papel_total" => "boolean",
|
"check_papel_total" => "boolean",
|
||||||
|
"horas_maquina" => "double",
|
||||||
|
"precio_hora" => "double",
|
||||||
|
"precio_impresion" => "double",
|
||||||
|
"total_linea" => "double",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,12 +76,14 @@ return [
|
|||||||
'click' => 'Click',
|
'click' => 'Click',
|
||||||
'totalClicks' => 'Total clicks',
|
'totalClicks' => 'Total clicks',
|
||||||
'horas' => 'Machine hours',
|
'horas' => 'Machine hours',
|
||||||
|
'precioHora' => 'Price hour',
|
||||||
'precioImpresion' => 'Print price',
|
'precioImpresion' => 'Print price',
|
||||||
'precioPagNegro' => 'Pages black price',
|
'precioPagNegro' => 'Pages black price',
|
||||||
'precioPagColor' => 'Pages color price',
|
'precioPagColor' => 'Pages color price',
|
||||||
'totalTinta' => 'Total ink',
|
'totalTinta' => 'Total ink',
|
||||||
'totalCorte' => 'Total cut',
|
'totalCorte' => 'Total cut',
|
||||||
'total' => 'Total',
|
'total' => 'Total',
|
||||||
|
'totalLinea' => 'Row Total',
|
||||||
'aFavorFibra' => 'In fiber direction',
|
'aFavorFibra' => 'In fiber direction',
|
||||||
'cubierta' => 'Cover',
|
'cubierta' => 'Cover',
|
||||||
'sobrecubierta' => 'Dust jacket',
|
'sobrecubierta' => 'Dust jacket',
|
||||||
|
|||||||
@ -69,18 +69,20 @@ return [
|
|||||||
'pliegosPedido' => 'Pliegos pedido',
|
'pliegosPedido' => 'Pliegos pedido',
|
||||||
'precioPliego' => 'Precio pliegos',
|
'precioPliego' => 'Precio pliegos',
|
||||||
'libro' => 'Libro',
|
'libro' => 'Libro',
|
||||||
'totalPapelPedido' => 'Total papel pedido',
|
'totalPapelPedido' => 'Papel pedido',
|
||||||
'lomo' => 'Lomo',
|
'lomo' => 'Lomo',
|
||||||
'peso' => 'Peso',
|
'peso' => 'Peso',
|
||||||
'click' => 'Click',
|
'click' => 'Click',
|
||||||
'totalClicks' => 'Total clicks',
|
'totalClicks' => 'Total clicks',
|
||||||
'horas' => 'Horas máquina',
|
'horas' => 'Horas máquina',
|
||||||
|
'precioHora' => 'Precio hora',
|
||||||
'precioImpresion' => 'Precio impresión',
|
'precioImpresion' => 'Precio impresión',
|
||||||
'precioPagNegro' => 'Precio pág. negro',
|
'precioPagNegro' => 'Precio pág. negro',
|
||||||
'precioPagColor' => 'Precio pág. color',
|
'precioPagColor' => 'Precio pág. color',
|
||||||
'totalTinta' => 'Total tinta',
|
'totalTinta' => 'Total tinta',
|
||||||
'totalCorte' => 'Total corte',
|
'totalCorte' => 'Total corte',
|
||||||
'total' => 'Total',
|
'total' => 'Total',
|
||||||
|
'totalLinea' => 'Total Precio Línea',
|
||||||
'aFavorFibra' => 'A favor de fibra',
|
'aFavorFibra' => 'A favor de fibra',
|
||||||
'cubierta' => 'Cubierta',
|
'cubierta' => 'Cubierta',
|
||||||
'sobrecubierta' => 'Sobrecubierta',
|
'sobrecubierta' => 'Sobrecubierta',
|
||||||
@ -106,7 +108,7 @@ return [
|
|||||||
|
|
||||||
'porDefecto' => 'Por defecto',
|
'porDefecto' => 'Por defecto',
|
||||||
'tipoImpresion' => 'Impresion',
|
'tipoImpresion' => 'Impresion',
|
||||||
'numPagColor' => 'Nº Paginas Color',
|
'numPagColor' => 'Nº Pag. Color',
|
||||||
'saturacion' => 'Saturación',
|
'saturacion' => 'Saturación',
|
||||||
'cobNegro' => 'Cob. % Negro',
|
'cobNegro' => 'Cob. % Negro',
|
||||||
'cobCyan' => 'Cob. % Cyan',
|
'cobCyan' => 'Cob. % Cyan',
|
||||||
|
|||||||
@ -353,7 +353,7 @@ class MaquinaModel extends \App\Models\GoBaseModel
|
|||||||
->groupEnd();
|
->groupEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $uso_tarifa = 'interior', $tirada, $papel_impresion_id = -1)
|
public function getMaquinaImpresionForPresupuesto($is_rotativa, $tarifa_tipo, $uso_tarifa , $tirada, $papel_impresion_id = -1)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
1.-> tarifa_Tipo impresion
|
1.-> tarifa_Tipo impresion
|
||||||
|
|||||||
@ -93,7 +93,7 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getPapelForComparador($tipo, $is_cubierta = null, $is_sobrecubierta = null, $rotativa = null)
|
public function getPapelForComparador($tipo, $is_cubierta = false, $is_sobrecubierta = false, $rotativa = false)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
1.-> Tipo impresion
|
1.-> Tipo impresion
|
||||||
@ -105,6 +105,7 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
|||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->select(
|
->select(
|
||||||
"t1.id as id, t1.nombre AS nombre"
|
"t1.id as id, t1.nombre AS nombre"
|
||||||
|
// for debug, t2.nombre AS nombre_papel_impresion, t4.nombre AS maquina_nombre, t5.uso AS tarifa_uso, t5.tipo AS tarifa_tipo"
|
||||||
)
|
)
|
||||||
->distinct('t1.id')
|
->distinct('t1.id')
|
||||||
->join("lg_papel_impresion t2", "t2.papel_generico_id = t1.id", "left")
|
->join("lg_papel_impresion t2", "t2.papel_generico_id = t1.id", "left")
|
||||||
@ -114,36 +115,48 @@ class PapelGenericoModel extends \App\Models\GoBaseModel
|
|||||||
|
|
||||||
->where("t1.is_deleted", 0)
|
->where("t1.is_deleted", 0)
|
||||||
->where("t2.is_deleted", 0)
|
->where("t2.is_deleted", 0)
|
||||||
|
->where("t2.isActivo", 1)
|
||||||
->where("t3.active", 1)
|
->where("t3.active", 1)
|
||||||
->where("t4.is_deleted", 0)
|
->where("t4.is_deleted", 0)
|
||||||
->where("t4.tipo", "impresion")
|
->where("t4.tipo", "impresion")
|
||||||
|
->where("t5.is_deleted", 0)
|
||||||
->where("t5.tipo", $tipo);
|
->where("t5.tipo", $tipo);
|
||||||
|
|
||||||
if(!is_null($is_cubierta)){
|
if($is_cubierta==true){
|
||||||
if($is_cubierta==true){
|
|
||||||
$builder->where("t2.cubierta", 1);
|
$builder->where("t2.cubierta", 1);
|
||||||
}
|
$builder->where("t5.uso", 'cubierta');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$builder->where("t2.cubierta", 0);
|
||||||
|
$builder->where("t5.uso", 'interior');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_null($is_sobrecubierta)){
|
if($is_sobrecubierta==true){
|
||||||
if($is_sobrecubierta==true){
|
|
||||||
$builder->where("t2.sobrecubierta", 1);
|
$builder->where("t2.sobrecubierta", 1);
|
||||||
}
|
$builder->where("t5.uso", 'sobrecubierta');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$builder->where("t2.sobrecubierta", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!is_null($rotativa)){
|
if($is_cubierta==false && $is_sobrecubierta==false){
|
||||||
if($rotativa==true){
|
$builder->where("t5.uso", 'interior');
|
||||||
|
}
|
||||||
|
|
||||||
|
if($rotativa==true){
|
||||||
$builder->where("t2.rotativa", 1);
|
$builder->where("t2.rotativa", 1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
|
$data = $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
|
||||||
|
//var_dump($this->db->getLastQuery());
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getGramajeComparador(string $papel_generico_nombre="", $uso="")
|
public function getGramajeComparador(string $papel_generico_nombre="", $uso="")
|
||||||
{
|
{
|
||||||
if($uso == 'cubierta' || $uso == 'sobrecubierta')
|
if($uso == 'cubierta' || $uso == 'sobrecubierta')
|
||||||
$tipo = 'color';
|
$tipo = 'colorhq';
|
||||||
else
|
else
|
||||||
$tipo=$uso; // color y colorhq valen para los dos
|
$tipo=$uso; // color y colorhq valen para los dos
|
||||||
if($uso == 'bn')
|
if($uso == 'bn')
|
||||||
|
|||||||
@ -35,6 +35,7 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
|
|||||||
"precio",
|
"precio",
|
||||||
"total_papel_pedido",
|
"total_papel_pedido",
|
||||||
"margen_papel_pedido",
|
"margen_papel_pedido",
|
||||||
|
"margen_impresion",
|
||||||
"rotativa_impresion",
|
"rotativa_impresion",
|
||||||
"rotativa_pag_color",
|
"rotativa_pag_color",
|
||||||
"rotativa_set_values",
|
"rotativa_set_values",
|
||||||
@ -73,7 +74,13 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
|
|||||||
"rotativa_total_corte",
|
"rotativa_total_corte",
|
||||||
'check_impresion_total',
|
'check_impresion_total',
|
||||||
'check_papel_total',
|
'check_papel_total',
|
||||||
"isActiva",
|
"maquina",
|
||||||
|
"papel_impresion",
|
||||||
|
"maquina_tipo",
|
||||||
|
"horas_maquina",
|
||||||
|
"precio_hora",
|
||||||
|
"precio_impresion",
|
||||||
|
"total_linea",
|
||||||
];
|
];
|
||||||
protected $returnType = "App\Entities\Presupuestos\PresupuestoLineaEntity";
|
protected $returnType = "App\Entities\Presupuestos\PresupuestoLineaEntity";
|
||||||
|
|
||||||
@ -322,22 +329,28 @@ class PresupuestoLineaModel extends \App\Models\GoBaseModel
|
|||||||
->select(
|
->select(
|
||||||
"*"
|
"*"
|
||||||
)
|
)
|
||||||
->where("t1.presupuesto_id", $presupuesto_id)
|
->where("t1.presupuesto_id", $presupuesto_id);
|
||||||
->where("t1.isActiva", 1);
|
|
||||||
|
|
||||||
|
|
||||||
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
return $builder->orderBy("t1.id", "asc")->get()->getResultObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateLineasPresupuesto($presupuesto_id = -1, $datos=[])
|
public function deleteLineasPresupuesto($presupuesto_id){
|
||||||
|
$this->db
|
||||||
|
->table($this->table . " t1")
|
||||||
|
->where("presupuesto_id", $presupuesto_id)
|
||||||
|
->delete();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function insertLineasPresupuesto($presupuesto_id = -1, $datos=[])
|
||||||
{
|
{
|
||||||
|
$this->deleteLineasPresupuesto($presupuesto_id);
|
||||||
|
|
||||||
foreach($datos as $linea){
|
foreach($datos as $linea){
|
||||||
|
|
||||||
$this->db
|
$this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->where("t1.presupuesto_id", $presupuesto_id)
|
->where("t1.presupuesto_id", $presupuesto_id)
|
||||||
->where("t1.tipo", $linea["tipo"])
|
->insert($linea);
|
||||||
->update($linea);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,10 +135,6 @@ $(document).on('click', '.btn-edit-add', function(e) {
|
|||||||
$('#add_entregaPieCalle').prop('checked', data.entregaPieCalle==1?true:false)
|
$('#add_entregaPieCalle').prop('checked', data.entregaPieCalle==1?true:false)
|
||||||
|
|
||||||
$newAddDialog.modal('show')
|
$newAddDialog.modal('show')
|
||||||
|
|
||||||
|
|
||||||
console.log(data)
|
|
||||||
console.log()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -281,7 +281,7 @@ function calcular_mermas(){
|
|||||||
const tirada = parseInt($('#tirada').val())
|
const tirada = parseInt($('#tirada').val())
|
||||||
var merma = 0
|
var merma = 0
|
||||||
|
|
||||||
if(tirada>POD){
|
if(tirada><?php echo $POD; ?>){
|
||||||
merma = tirada*0.1<=30 ? tirada*0.1 : 30
|
merma = tirada*0.1<=30 ? tirada*0.1 : 30
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@ -1076,10 +1076,12 @@
|
|||||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||||
$('#total_comp_rot').html("0.00");
|
$('#total_comp_rot').html("0.00");
|
||||||
|
|
||||||
if($('#tipoImpresion').select2('data')[0].id == 'negro'){
|
|
||||||
$('#compPaginasColor').val('0')
|
$('#compPaginasColor').val('0')
|
||||||
$('#compPaginasNegro').val($('#paginas').val())
|
$('#compPaginasColorhq').val('0')
|
||||||
}
|
$('#compPaginasNegrohq').val('0');
|
||||||
|
$('#compPaginasNegro').val($('#paginas').val())
|
||||||
|
|
||||||
|
|
||||||
if( $('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
if( $('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||||
$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||||
@ -1095,12 +1097,11 @@
|
|||||||
$('#tableCompIntRotativa').DataTable().clear().draw();
|
$('#tableCompIntRotativa').DataTable().clear().draw();
|
||||||
$('#total_comp_rot').html("0.00");
|
$('#total_comp_rot').html("0.00");
|
||||||
|
|
||||||
if($('#tipoImpresion').select2('data')[0].id == 'negrohq'){
|
$('#compPaginasColorhq').val('0')
|
||||||
$('#compPaginasColorhq').val('0')
|
$('#compPaginasColor').val('0')
|
||||||
$('#compPaginasNegrohq').val($('#paginas').val())
|
$('#compPaginasNegro').val('0')
|
||||||
$('#compGramajeNegohq').change().trigger()
|
$('#compPaginasNegrohq').val($('#paginas').val())
|
||||||
}
|
|
||||||
|
|
||||||
if($('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
if($('#tableCompIntPlana').DataTable().rows().count() > 0 &&
|
||||||
!$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
!$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) {
|
||||||
|
|
||||||
@ -1112,7 +1113,7 @@
|
|||||||
|
|
||||||
$('#tipoImpresion').on("select2:close", function () {
|
$('#tipoImpresion').on("select2:close", function () {
|
||||||
|
|
||||||
$('#paginas').change(),trigger();
|
$('#paginas').change()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -249,8 +249,6 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const POD = <?php echo $POD; ?>;
|
|
||||||
|
|
||||||
$('#serv_default').on('click', function(){
|
$('#serv_default').on('click', function(){
|
||||||
get_tarifas_enc('default').then(
|
get_tarifas_enc('default').then(
|
||||||
get_tarifas_manipulado('default')
|
get_tarifas_manipulado('default')
|
||||||
@ -390,7 +388,7 @@
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
datos: datosAcabado,
|
datos: datosAcabado,
|
||||||
tirada: tirada,
|
tirada: tirada,
|
||||||
POD: POD,
|
POD: <?php echo $POD; ?>,
|
||||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
@ -415,7 +413,7 @@
|
|||||||
paginas: paginas,
|
paginas: paginas,
|
||||||
ancho: dimension.ancho,
|
ancho: dimension.ancho,
|
||||||
alto: dimension.alto,
|
alto: dimension.alto,
|
||||||
POD: POD,
|
POD: <?php echo $POD; ?>,
|
||||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
@ -448,7 +446,7 @@
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
datos: datosManipulado,
|
datos: datosManipulado,
|
||||||
tirada: tirada,
|
tirada: tirada,
|
||||||
POD: POD,
|
POD: <?php echo $POD; ?>,
|
||||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
@ -575,7 +573,7 @@
|
|||||||
var datos = {
|
var datos = {
|
||||||
tarifa_acabado_id : tarifa_id,
|
tarifa_acabado_id : tarifa_id,
|
||||||
tirada: tirada,
|
tirada: tirada,
|
||||||
POD: POD,
|
POD: <?php echo $POD; ?>,
|
||||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -813,7 +811,7 @@
|
|||||||
ancho: dimension.ancho,
|
ancho: dimension.ancho,
|
||||||
alto: dimension.alto,
|
alto: dimension.alto,
|
||||||
proveedor_id: parseInt($('#' + this.id).select2('data')[0].id),
|
proveedor_id: parseInt($('#' + this.id).select2('data')[0].id),
|
||||||
POD: POD,
|
POD: <?php echo $POD; ?>,
|
||||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -875,7 +873,7 @@
|
|||||||
tirada: tirada,
|
tirada: tirada,
|
||||||
ancho: dimension.ancho,
|
ancho: dimension.ancho,
|
||||||
alto: dimension.alto,
|
alto: dimension.alto,
|
||||||
POD: POD,
|
POD: <?php echo $POD; ?>,
|
||||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1090,7 +1088,7 @@
|
|||||||
var datos = {
|
var datos = {
|
||||||
tarifa_manipulado_id : tarifa_id,
|
tarifa_manipulado_id : tarifa_id,
|
||||||
tirada: tirada,
|
tirada: tirada,
|
||||||
POD: POD,
|
POD: <?php echo $POD; ?>,
|
||||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@
|
|||||||
<?php if(str_contains($formAction,'edit')): ?>
|
<?php if(str_contains($formAction,'edit')): ?>
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems") ?>
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems") ?>
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems") ?>
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_lineasPresupuestoItems") ?>
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_previewItems") ?>
|
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems") ?>
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems") ?>
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosEnvios") ?>
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosEnvios") ?>
|
||||||
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_comentariosItems") ?>
|
<?= view("themes/backend/vuexy/form/presupuestos/cosidotapablanda/_comentariosItems") ?>
|
||||||
@ -109,8 +109,6 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,7 @@ table.dataTable.table-hover>tbody>tr.selected:hover>* {
|
|||||||
padding-top: 2px;
|
padding-top: 2px;
|
||||||
padding-bottom: 2px;
|
padding-bottom: 2px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size:0.8rem !important;
|
/*font-size:0.8rem !important;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.lp-td {
|
.lp-td {
|
||||||
@ -83,7 +83,7 @@ table.dataTable.table-hover>tbody>tr.selected:hover>* {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lp-button{
|
.lp-button{
|
||||||
font-size: 1.1em;
|
/*font-size: 1.1em;*/
|
||||||
padding-left: 3px;
|
padding-left: 3px;
|
||||||
padding-right: 3px;
|
padding-right: 3px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
Reference in New Issue
Block a user