mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'fix/papeles_estandar_solo_rot' into 'main'
añadido que si no es pod busca papel rotativa para color y negro See merge request jjimenez/safekat!417
This commit is contained in:
@ -298,13 +298,24 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$tirada = goSanitize($this->request->getGet('tirada'))[0] ?? null;
|
||||
$POD = null;
|
||||
if($tirada != null){
|
||||
$POD_value = model('App\Models\Configuracion\ConfiguracionSistemaModel')->getPOD();
|
||||
if(intval($tirada) <= intval($POD_value)){
|
||||
$POD = true;
|
||||
}
|
||||
else{
|
||||
$POD = false;
|
||||
}
|
||||
}
|
||||
$tipo = goSanitize($this->request->getGet('tipo'))[0];
|
||||
$selected_papel = goSanitize($this->request->getGet('papel'))[0] ?? null;
|
||||
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
|
||||
$tapa_dura = goSanitize($this->request->getGet('tapa_dura'))[0] ?? null;
|
||||
|
||||
$menu = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $tapa_dura, false);
|
||||
$menu2 = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $tapa_dura, true);
|
||||
$menu = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $tapa_dura, false, $POD);
|
||||
$menu2 = $this->model->getPapelCliente($tipo, $cubierta, $selected_papel, $tapa_dura, true, $POD);
|
||||
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
@ -325,10 +336,21 @@ class Papelesgenericos extends \App\Controllers\BaseResourceController
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
$tirada = goSanitize($this->request->getGet('tirada'))[0] ?? null;
|
||||
$POD = null;
|
||||
if($tirada != null){
|
||||
$POD_value = model('App\Models\Configuracion\ConfiguracionSistemaModel')->getPOD();
|
||||
if(intval($tirada) <= intval($POD_value)){
|
||||
$POD = true;
|
||||
}
|
||||
else{
|
||||
$POD = false;
|
||||
}
|
||||
}
|
||||
$tipo = goSanitize($this->request->getGet('tipo'))[0];
|
||||
$cubierta = goSanitize($this->request->getGet('cubierta'))[0] ?? 0;
|
||||
|
||||
$items = $this->model->getPapelCliente($tipo, $cubierta, null, true);
|
||||
$items = $this->model->getPapelCliente($tipo, $cubierta, null, true, $POD);
|
||||
$items = array_map(function ($item) {
|
||||
return [
|
||||
'id' => $item->id,
|
||||
|
||||
@ -313,7 +313,7 @@ class PapelGenericoModel extends \App\Models\BaseModel
|
||||
}
|
||||
|
||||
|
||||
public function getPapelCliente($tipo, $is_cubierta = false, $selected_papel_id = null, $tapa_dura = null, $papel_especial = false)
|
||||
public function getPapelCliente($tipo, $is_cubierta = false, $selected_papel_id = null, $tapa_dura = null, $papel_especial = false, $POD = null)
|
||||
{
|
||||
/*
|
||||
1.-> Tipo impresion
|
||||
@ -404,6 +404,13 @@ class PapelGenericoModel extends \App\Models\BaseModel
|
||||
if ($tipo == 'colorhq' || $tipo == 'negrohq') {
|
||||
$builder->where("t2.rotativa", 0);
|
||||
}
|
||||
else{
|
||||
if($POD == false){
|
||||
if(($tipo == 'color' || $tipo == 'negro')){
|
||||
$builder->where("t2.rotativa", 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($selected_papel_id != null)
|
||||
|
||||
@ -727,6 +727,8 @@ class DatosGenerales {
|
||||
}
|
||||
|
||||
// Para recalcular el presupuesto
|
||||
$('#divGramajeInterior').empty();
|
||||
$('#divGramajeInteriorColor').empty();
|
||||
element.trigger('change');
|
||||
}
|
||||
|
||||
|
||||
@ -42,15 +42,6 @@ class DisenioInterior {
|
||||
this.colorPremium_color = this.domItem.find("#colorPremiumColor");
|
||||
|
||||
this.gramaje_color = this.domItem.find(".check-interior-color-gramaje");
|
||||
this.gramaje70_color = this.domItem.find("#interiorGramaje70Color");
|
||||
this.gramaje80_color = this.domItem.find("#interiorGramaje80Color");
|
||||
this.gramaje90_color = this.domItem.find("#interiorGramaje90Color");
|
||||
this.gramaje100_color = this.domItem.find("#interiorGramaje100Color");
|
||||
this.gramaje115_color = this.domItem.find("#interiorGramaje115Color");
|
||||
this.gramaje120_color = this.domItem.find("#interiorGramaje120Color");
|
||||
this.gramaje135_color = this.domItem.find("#interiorGramaje135Color");
|
||||
this.gramaje150_color = this.domItem.find("#interiorGramaje150Color");
|
||||
this.gramaje170_color = this.domItem.find("#interiorGramaje170Color");
|
||||
|
||||
this.checksGramaje = $('.gramaje-interior');
|
||||
|
||||
@ -121,6 +112,7 @@ class DisenioInterior {
|
||||
new Ajax('/papelesgenericos/getpapelcliente',
|
||||
{
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tirada: $('#tirada').val(),
|
||||
tipo: this.getTipoImpresion(),
|
||||
cubierta: 0,
|
||||
},
|
||||
@ -135,6 +127,7 @@ class DisenioInterior {
|
||||
new Ajax('/papelesgenericos/getpapelcliente',
|
||||
{
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tirada: $('#tirada').val(),
|
||||
tipo: this.getTipoImpresion(),
|
||||
cubierta: 0,
|
||||
},
|
||||
@ -859,6 +852,7 @@ class DisenioInterior {
|
||||
new Ajax('/papelesgenericos/getpapelcliente',
|
||||
{
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tirada: $('#tirada').val(),
|
||||
papel: papel,
|
||||
tipo: tipo,
|
||||
cubierta: 0,
|
||||
@ -886,6 +880,7 @@ class DisenioInterior {
|
||||
new Ajax('/papelesgenericos/getpapelcliente',
|
||||
{
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tirada: $('#tirada').val(),
|
||||
papel: this.papelInterior,
|
||||
tipo: tipo,
|
||||
cubierta: 0,
|
||||
@ -931,6 +926,7 @@ class DisenioInterior {
|
||||
new Ajax('/papelesgenericos/getpapelcliente',
|
||||
{
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tirada: $('#tirada').val(),
|
||||
papel: papel,
|
||||
tipo: tipo,
|
||||
cubierta: 0,
|
||||
@ -954,6 +950,7 @@ class DisenioInterior {
|
||||
new Ajax('/papelesgenericos/getpapelcliente',
|
||||
{
|
||||
[this.csrf_token]: this.csrf_hash,
|
||||
tirada: $('#tirada').val(),
|
||||
papel: this.papelInterior,
|
||||
tipo: tipo,
|
||||
cubierta: 0,
|
||||
|
||||
Reference in New Issue
Block a user