terminando servicios manipulados y preimpresion

This commit is contained in:
2023-12-04 20:50:58 +01:00
parent 76c815212f
commit ab6763aeaa
329 changed files with 811 additions and 59359 deletions

View File

@ -14,7 +14,7 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
protected $allowedFields = [
"nombre",
"precio_pagina",
"precio",
"precio_min",
"importe_fijo",
"margen",
@ -39,7 +39,7 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
"label" => "Tarifapreimpresion.nombre",
"rules" => "trim|required|max_length[255]",
],
"precio_pagina" => [
"precio" => [
"label" => "Tarifapreimpresion.precio",
"rules" => "required|decimal",
],
@ -62,7 +62,7 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
"max_length" => "Tarifapreimpresion.validation.nombre.max_length",
"required" => "Tarifapreimpresion.validation.nombre.required",
],
"precio_pagina" => [
"precio" => [
"decimal" => "Tarifapreimpresion.validation.precio.decimal",
"required" => "Tarifapreimpresion.validation.precio.required",
],
@ -96,5 +96,35 @@ class TarifapreimpresionModel extends \App\Models\GoBaseModel
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
}
public function getTarifaPresupuestoPreimpresion($tarifa_id){
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.id AS tarifa_preimpresion_id, t1.nombre AS tarifa_preimpresion_nombre, t1.precio AS precio, t1.margen AS margen"
)
->where("t1.is_deleted", 0);
//->where("t1.mostrar_en_presupuesto", 1)
$builder->where('t1.id =', $tarifa_id);
return $builder->get()->getResultObject();
}
public function getNombreTarifaPreimpresion($id=-1)
{
/*
Todos los servicios de encuadernacion activas que se pueden usar en presupuestos
*/
$builder = $this->db
->table($this->table . " t1")
->select(
"t1.nombre AS nombre"
)
->where("t1.id", $id)
->where("t1.is_deleted", 0);
return $builder->orderBy("t1.nombre", "asc")->get()->getResultObject();
}
}