mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadido margen a tarifas impresion
This commit is contained in:
@ -234,6 +234,13 @@ class Maquinastarifasimpresion extends \App\Controllers\GoBaseResourceController
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required'))
|
||||
),
|
||||
Field::inst('margen')
|
||||
->validator('Validate::numeric', array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.precio.decimal'))
|
||||
)
|
||||
->validator('Validate::notEmpty', array(
|
||||
'message' => lang('MaquinasTarifasImpresions.validation.tipo.required'))
|
||||
),
|
||||
Field::inst('maquina_id'),
|
||||
Field::inst('user_created_id'),
|
||||
Field::inst('created_at'),
|
||||
@ -260,9 +267,11 @@ class Maquinastarifasimpresion extends \App\Controllers\GoBaseResourceController
|
||||
'uso' => $values['uso'],
|
||||
'is_deleted' => 0));
|
||||
|
||||
$id = $builder->get()->getFirstRow()->id;
|
||||
|
||||
// No se pueden duplicar valores al crear o al editar
|
||||
if ($builder->countAllResults() >= 1) {
|
||||
if (($action === Editor::ACTION_EDIT && $builder->get()->getFirstRow()->id != $pkey)
|
||||
if (($action === Editor::ACTION_EDIT && $id != $pkey)
|
||||
|| $action === Editor::ACTION_CREATE) {
|
||||
|
||||
return lang('MaquinasTarifasImpresions.validation.duplicated_uso_tipo');
|
||||
|
||||
Reference in New Issue
Block a user