diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php index ac209861..dde98be6 100755 --- a/ci4/app/Language/es/Presupuestos.php +++ b/ci4/app/Language/es/Presupuestos.php @@ -395,6 +395,7 @@ return [ 'gramaje_interior' => 'Seleccione el gramaje', 'pais' => 'Debe seleccionar un país', 'integer_greatherThan_0' => 'Número entero > 0 requerido', + 'greater_than_0' => 'El campo {field} debe ser mayor que 0', 'tirada_no_valida' => "Tirada no valida", 'sin_gramaje' => "Seleccione gramaje", 'tipo_cubierta' => 'Seleccione tipo de cubierta', diff --git a/ci4/app/Models/Presupuestos/PresupuestoModel.php b/ci4/app/Models/Presupuestos/PresupuestoModel.php index dc594bae..69c2a034 100755 --- a/ci4/app/Models/Presupuestos/PresupuestoModel.php +++ b/ci4/app/Models/Presupuestos/PresupuestoModel.php @@ -151,6 +151,14 @@ class PresupuestoModel extends \App\Models\BaseModel public static $labelField = "titulo"; protected $validationRulesAdd = [ + "tirada" => [ + "label" => "Presupuestos.tirada", + "rules" => "required|integer|greater_than[0]", + ], + "paginas" => [ + "label" => "Presupuestos.paginas", + "rules" => "required|integer|greater_than[0]", + ], "autor" => [ "label" => "Presupuestos.autor", "rules" => "trim|max_length[150]", @@ -190,6 +198,12 @@ class PresupuestoModel extends \App\Models\BaseModel ]; protected $validationMessagesAdd = [ + "tirada" => [ + "greater_than" => "Presupuestos.validation.greater_than_0", + ], + "paginas" => [ + "greater_than" => "Presupuestos.validation.greater_than_0", + ], "autor" => [ "max_length" => "Presupuestos.validation.max_length", "required" => "Presupuestos.validation.requerido",