FIX: Venta nueva no se ingresaba
This commit is contained in:
@ -22,7 +22,7 @@ class Propietario extends Ideal\Repository
|
||||
|
||||
public function create(?array $data = null): Define\Model
|
||||
{
|
||||
$map = (new Implement\Repository\MapperParser(['dv', 'nombres']))
|
||||
$map = (new Implement\Repository\MapperParser(['rut', 'dv', 'nombres']))
|
||||
->register('apellido_paterno', (new Implement\Repository\Mapper())
|
||||
->setProperty('apellidos')
|
||||
->setFunction(function($data) {
|
||||
@ -64,8 +64,8 @@ class Propietario extends Ideal\Repository
|
||||
public function save(Define\Model $model): Define\Model
|
||||
{
|
||||
$model->rut = $this->saveNew(
|
||||
['dv', 'nombres', 'apellido_paterno', 'apellido_materno', 'direccion', 'otro', 'representante'],
|
||||
[$model->dv, $model->nombres, $model->apellidos['paterno'], $model->apellidos['materno'], $model->datos->direccion->id, $model->otro->rut ?? 0, $model->representante->rut ?? 0]
|
||||
['rut', 'dv', 'nombres', 'apellido_paterno', 'apellido_materno', 'direccion', 'otro', 'representante'],
|
||||
[$model->rut, $model->dv, $model->nombres, $model->apellidos['paterno'], $model->apellidos['materno'], $model->datos->direccion->id, $model->otro->rut ?? 0, $model->representante->rut ?? 0]
|
||||
);
|
||||
return $model;
|
||||
}
|
||||
|
Reference in New Issue
Block a user