mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadido calculo de formas rot y merma automatica para rot
This commit is contained in:
102
ci4/app/Models/Clientes/ClientePlantillaPreciosLineasModel.php
Executable file
102
ci4/app/Models/Clientes/ClientePlantillaPreciosLineasModel.php
Executable file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Clientes;
|
||||
|
||||
class ClientePlantillaPreciosLineasModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "cliente_plantilla_precios_linea";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
|
||||
protected $allowedFields = [
|
||||
"plantilla_id",
|
||||
"tipo",
|
||||
"tipo_maquina",
|
||||
"tipo_impresion",
|
||||
"tiempo_min",
|
||||
"tiempo_max",
|
||||
"precio_hora",
|
||||
"margen",
|
||||
"is_deleted",
|
||||
"deleted_at",
|
||||
"created_at",
|
||||
"updated_at"];
|
||||
|
||||
protected $returnType = "App\Entities\Clientes\ClientePlantillaPreciosLineasEntity";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
protected $createdField = "created_at";
|
||||
|
||||
protected $updatedField = "updated_at";
|
||||
|
||||
public static $labelField = "plantilla_id";
|
||||
|
||||
protected $validationRules = [
|
||||
"plantilla_id" => [
|
||||
"label" => "ClientePrecios.plantilla_id",
|
||||
"rules" => "required",
|
||||
],
|
||||
"tipo" => [
|
||||
"label" => "ClientePrecios.tipo",
|
||||
"rules" => "required|in_list[interior,cubierta,sobrecubierta]",
|
||||
],
|
||||
"tipo_maquina" => [
|
||||
"label" => "ClientePrecios.tipo_maquina",
|
||||
"rules" => "required|in_list[toner,inkjet]",
|
||||
],
|
||||
"tipo_impresion" => [
|
||||
"label" => "ClientePrecios.tipo_impresion",
|
||||
"rules" => "required|in_list[negro,color,negrohq,colorhq]",
|
||||
],
|
||||
"tiempo_min" => [
|
||||
"label" => "ClientePrecios.tiempo_min",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"tiempo_max" => [
|
||||
"label" => "ClientePrecios.tiempo_max",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"margen" => [
|
||||
"label" => "ClientePrecios.margen",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"plantilla_id" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
|
||||
],
|
||||
"tipo" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tipo_maquina" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tipo_impresion" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tiempo_min" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tiempo_max" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"margen" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
44
ci4/app/Models/Clientes/ClientePlantillaPreciosModel.php
Executable file
44
ci4/app/Models/Clientes/ClientePlantillaPreciosModel.php
Executable file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Clientes;
|
||||
|
||||
class ClientePlantillaPreciosModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "cliente_plantilla_precios";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
|
||||
protected $allowedFields = ["nombre", "is_deleted", "deleted_at", "created_at", "updated_at"];
|
||||
protected $returnType = "App\Entities\Clientes\ClientePlantillaPreciosEntity";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
protected $createdField = "created_at";
|
||||
|
||||
protected $updatedField = "updated_at";
|
||||
|
||||
public static $labelField = "nombre";
|
||||
|
||||
protected $validationRules = [
|
||||
"nombre" => [
|
||||
"label" => "ClientePrecios.nombre",
|
||||
"rules" => "trim|max_length[100]",
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"nombre" => [
|
||||
"max_length" => "ClientePrecios.validation.max_length",
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
104
ci4/app/Models/Clientes/ClientePreciosModel.php
Executable file
104
ci4/app/Models/Clientes/ClientePreciosModel.php
Executable file
@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Clientes;
|
||||
|
||||
class ClientePlantillaPreciosLineasModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "cliente_precios";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
|
||||
protected $allowedFields = [
|
||||
"cliente_id",
|
||||
"tipo",
|
||||
"tipo_maquina",
|
||||
"tipo_impresion",
|
||||
"tiempo_min",
|
||||
"tiempo_max",
|
||||
"precio_hora",
|
||||
"margen",
|
||||
"is_deleted",
|
||||
"deleted_at",
|
||||
"created_at",
|
||||
"updated_at",
|
||||
"user_created_id",
|
||||
"user_updated_id"];
|
||||
|
||||
protected $returnType = "App\Entities\Clientes\ClientePreciosEntity";
|
||||
|
||||
protected $useTimestamps = true;
|
||||
protected $useSoftDeletes = false;
|
||||
|
||||
protected $createdField = "created_at";
|
||||
|
||||
protected $updatedField = "updated_at";
|
||||
|
||||
public static $labelField = "cliente_id";
|
||||
|
||||
protected $validationRules = [
|
||||
"cliente_id" => [
|
||||
"label" => "ClientePrecios.cliente_id",
|
||||
"rules" => "required",
|
||||
],
|
||||
"tipo" => [
|
||||
"label" => "ClientePrecios.tipo",
|
||||
"rules" => "required|in_list[interior,cubierta,sobrecubierta]",
|
||||
],
|
||||
"tipo_maquina" => [
|
||||
"label" => "ClientePrecios.tipo_maquina",
|
||||
"rules" => "required|in_list[toner,inkjet]",
|
||||
],
|
||||
"tipo_impresion" => [
|
||||
"label" => "ClientePrecios.tipo_impresion",
|
||||
"rules" => "required|in_list[negro,color,negrohq,colorhq]",
|
||||
],
|
||||
"tiempo_min" => [
|
||||
"label" => "ClientePrecios.tiempo_min",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"tiempo_max" => [
|
||||
"label" => "ClientePrecios.tiempo_max",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
"margen" => [
|
||||
"label" => "ClientePrecios.margen",
|
||||
"rules" => "required|decimal",
|
||||
],
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
||||
protected $validationMessages = [
|
||||
"cliente_id" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
|
||||
],
|
||||
"tipo" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tipo_maquina" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tipo_impresion" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tiempo_min" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"tiempo_max" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
"margen" => [
|
||||
"required" => "ClientePrecios.validation.required",
|
||||
],
|
||||
];
|
||||
|
||||
|
||||
}
|
||||
38
ci4/app/Models/Configuracion/TipoPresupuestoModel.php
Executable file
38
ci4/app/Models/Configuracion/TipoPresupuestoModel.php
Executable file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace App\Models\Configuracion;
|
||||
|
||||
class TipoPresupuestoModel extends \App\Models\GoBaseModel
|
||||
{
|
||||
protected $table = "tipos_presupuestos";
|
||||
|
||||
/**
|
||||
* Whether primary key uses auto increment.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAutoIncrement = true;
|
||||
|
||||
protected $allowedFields = ["codigo", "is_cosido", "is_deleted", 'deleted_at', 'updated_at', 'created_at'];
|
||||
protected $returnType = "App\Entities\Configuracion\TipoPresupuestoEntity";
|
||||
|
||||
public static $labelField = "codigo";
|
||||
|
||||
|
||||
public function get_isCosido(int $id){
|
||||
|
||||
$builder = $this->db
|
||||
->table($this->table . " t1")
|
||||
->select("t1.is_cosido AS is_cosido")
|
||||
->where('t1.id', $id)
|
||||
->where('t1.is_deleted', 0);
|
||||
|
||||
$result = $builder->get()->getResultObject();
|
||||
if(count($result)>0){
|
||||
return $result[0]->is_cosido;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user