mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
arreglado problema con servicios por defecto
This commit is contained in:
@ -554,8 +554,8 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
return $this->respond(Collection::datatable(
|
return $this->respond(Collection::datatable(
|
||||||
$resourceData,
|
$resourceData,
|
||||||
$this->model->getResource("", $tipo_presupuesto_id)->countAllResults(),
|
$this->model->getResource("", $tipo_impresion_id)->countAllResults(),
|
||||||
$this->model->getResource($search, $tipo_presupuesto_id)->countAllResults()
|
$this->model->getResource($search, $tipo_impresion_id)->countAllResults()
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
return $this->failUnauthorized('Invalid request', 403);
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
|
|||||||
@ -140,8 +140,11 @@ class Presupuestoencuadernaciones extends \App\Controllers\GoBaseResourceControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else{
|
||||||
$values = $this->model->initPresupuesto(4, $solapas, $tirada, $paginas, $ancho, $alto, $POD);
|
$tipo_impresion_id = $reqData['tipo_impresion_id'] ?? 4;
|
||||||
|
$values = $this->model->initPresupuesto($tipo_impresion_id, $solapas, $tirada, $paginas, $ancho, $alto, $POD);
|
||||||
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'values' => $values,
|
'values' => $values,
|
||||||
$csrfTokenName => $newTokenHash
|
$csrfTokenName => $newTokenHash
|
||||||
|
|||||||
@ -104,6 +104,7 @@ class Presupuestomanipulados extends \App\Controllers\GoBaseResourceController
|
|||||||
$POD = $reqData['POD'] ?? 0;
|
$POD = $reqData['POD'] ?? 0;
|
||||||
$tipo = $reqData['tipo'] ?? null;
|
$tipo = $reqData['tipo'] ?? null;
|
||||||
|
|
||||||
|
|
||||||
$newTokenHash = csrf_hash();
|
$newTokenHash = csrf_hash();
|
||||||
$csrfTokenName = csrf_token();
|
$csrfTokenName = csrf_token();
|
||||||
|
|
||||||
@ -112,7 +113,8 @@ class Presupuestomanipulados extends \App\Controllers\GoBaseResourceController
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$solapas = $reqData['solapas'] ?? -1;
|
$solapas = $reqData['solapas'] ?? -1;
|
||||||
$values = $this->model->initPresupuesto(4, $solapas, $tirada, $POD);
|
$tipo_impresion_id = $reqData['tipo_impresion_id'] ?? 4;
|
||||||
|
$values = $this->model->initPresupuesto($tipo_impresion_id, $solapas, $tirada, $POD);
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
|
|||||||
@ -51,12 +51,11 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
public function initPresupuesto($tipo_presupuesto, $solapas, $tirada, $paginas, $ancho, $alto, $POD){
|
public function initPresupuesto($tipo_presupuesto, $solapas, $tirada, $paginas, $ancho, $alto, $POD){
|
||||||
|
|
||||||
$model = model('App\Models\Presupuestos\TipoPresupuestoServiciosDefectoModel');
|
$model = model('App\Models\Presupuestos\TipoPresupuestoServiciosDefectoModel');
|
||||||
$tarifas_procesar = $model->get_tarifas($tipo_presupuesto,$solapas, "encuadernacion");
|
$tarifas_procesar = $model->get_tarifas($tipo_presupuesto, $solapas, "encuadernacion");
|
||||||
|
|
||||||
$modelTarifa = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
$modelTarifa = model('App\Models\Tarifas\TarifaEncuadernacionModel');
|
||||||
$tarifas = [];
|
$tarifas = [];
|
||||||
|
|
||||||
|
|
||||||
foreach($tarifas_procesar as $tarifa){
|
foreach($tarifas_procesar as $tarifa){
|
||||||
|
|
||||||
if($modelTarifa->isTarifaPorHoras($tarifa['tarifa_id'])){
|
if($modelTarifa->isTarifaPorHoras($tarifa['tarifa_id'])){
|
||||||
|
|||||||
@ -34,8 +34,6 @@ class TipoPresupuestoServiciosDefectoModel extends \App\Models\GoBaseModel
|
|||||||
|
|
||||||
public function get_tarifas($tipo_presupuesto=-1, $solapas=0, $tipo=""){
|
public function get_tarifas($tipo_presupuesto=-1, $solapas=0, $tipo=""){
|
||||||
|
|
||||||
$where = "(t1.solapas=2) OR (t1.solapas=" . $solapas . ")";
|
|
||||||
|
|
||||||
$builder = $this->db
|
$builder = $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->where("t1.tipo_presupuesto_id", $tipo_presupuesto);
|
->where("t1.tipo_presupuesto_id", $tipo_presupuesto);
|
||||||
@ -43,42 +41,42 @@ class TipoPresupuestoServiciosDefectoModel extends \App\Models\GoBaseModel
|
|||||||
if(strcmp($tipo, "encuadernacion")==0){
|
if(strcmp($tipo, "encuadernacion")==0){
|
||||||
|
|
||||||
$builder->join("tarifa_encuadernacion t2", "t1.tarifa_id = t2.id", "left");
|
$builder->join("tarifa_encuadernacion t2", "t1.tarifa_id = t2.id", "left");
|
||||||
$builder->where("is_servicio_encuadernacion", 1);
|
$builder->where("t1.is_servicio_encuadernacion", 1);
|
||||||
$builder->where("is_servicio_acabado", 0);
|
$builder->where("t1.is_servicio_acabado", 0);
|
||||||
$builder->where("is_servicio_manipulado", 0);
|
$builder->where("t1.is_servicio_manipulado", 0);
|
||||||
$builder->where("is_servicio_preimpresion", 0);
|
$builder->where("t1.is_servicio_preimpresion", 0);
|
||||||
}
|
}
|
||||||
else if(strcmp($tipo, "acabado")==0){
|
else if(strcmp($tipo, "acabado")==0){
|
||||||
|
|
||||||
$builder->join("lg_tarifa_acabado t2", "t1.tarifa_id = t2.id", "left");
|
$builder->join("lg_tarifa_acabado t2", "t1.tarifa_id = t2.id", "left");
|
||||||
$builder->where("is_servicio_acabado", 1);
|
$builder->where("t1.is_servicio_acabado", 1);
|
||||||
$builder->where("is_servicio_encuadernacion", 0);
|
$builder->where("t1.is_servicio_encuadernacion", 0);
|
||||||
$builder->where("is_servicio_manipulado", 0);
|
$builder->where("t1.is_servicio_manipulado", 0);
|
||||||
$builder->where("is_servicio_preimpresion", 0);
|
$builder->where("t1.is_servicio_preimpresion", 0);
|
||||||
}
|
}
|
||||||
else if(strcmp($tipo, "manipulado")==0){
|
else if(strcmp($tipo, "manipulado")==0){
|
||||||
|
|
||||||
$builder->join("lg_tarifa_manipulado t2", "t1.tarifa_id = t2.id", "left");
|
$builder->join("lg_tarifa_manipulado t2", "t1.tarifa_id = t2.id", "left");
|
||||||
$builder->where("is_servicio_manipulado", 1);
|
$builder->where("t1.is_servicio_manipulado", 1);
|
||||||
$builder->where("is_servicio_encuadernacion", 0);
|
$builder->where("t1.is_servicio_encuadernacion", 0);
|
||||||
$builder->where("is_servicio_acabado", 0);
|
$builder->where("t1.is_servicio_acabado", 0);
|
||||||
$builder->where("is_servicio_preimpresion", 0);
|
$builder->where("t1.is_servicio_preimpresion", 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(strcmp($tipo, "preimpresion")==0){
|
else if(strcmp($tipo, "preimpresion")==0){
|
||||||
|
|
||||||
$builder->join("lg_tarifa_preimpresion t2", "t1.tarifa_id = t2.id", "left");
|
$builder->join("lg_tarifa_preimpresion t2", "t1.tarifa_id = t2.id", "left");
|
||||||
$builder->where("is_servicio_preimpresion", 1);
|
$builder->where("t1.is_servicio_preimpresion", 1);
|
||||||
$builder->where("is_servicio_encuadernacion", 0);
|
$builder->where("t1.is_servicio_encuadernacion", 0);
|
||||||
$builder->where("is_servicio_acabado", 0);
|
$builder->where("t1.is_servicio_acabado", 0);
|
||||||
$builder->where("is_servicio_manipulado", 0);
|
$builder->where("t1.is_servicio_manipulado", 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$where = "t1.solapas IS NULL OR t1.solapas='" . $solapas . "'";
|
$where = "(t1.solapas IS NULL OR t1.solapas='" . $solapas . "')";
|
||||||
$builder->where($where);
|
$builder->where($where);
|
||||||
|
|
||||||
$builder->where("t2.is_deleted", 0);
|
$builder->where("t2.is_deleted", 0);
|
||||||
|
|||||||
@ -877,8 +877,10 @@
|
|||||||
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
<?= csrf_token() ?? "token" ?> : <?= csrf_token() ?>v
|
||||||
};
|
};
|
||||||
|
|
||||||
if(tipo != null)
|
if(tipo != null){
|
||||||
datos['tipo'] = tipo;
|
datos['tipo'] = tipo;
|
||||||
|
datos['tipo_impresion_id'] = <?php echo $tipo_impresion_id; ?>;
|
||||||
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@ -1095,6 +1097,7 @@
|
|||||||
if(tipo != null){
|
if(tipo != null){
|
||||||
datos['tipo'] = tipo;
|
datos['tipo'] = tipo;
|
||||||
datos['solapas'] = $('#solapas').is(':checked')?1:0;
|
datos['solapas'] = $('#solapas').is(':checked')?1:0;
|
||||||
|
datos['tipo_impresion_id'] = <?php echo $tipo_impresion_id; ?>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user