FIX: Cartolas with empty values
This commit is contained in:
@ -127,6 +127,9 @@ class Cartolas extends Controller
|
||||
$output['errors'] []= ['filename' => $file->getClientFilename(), 'error' => $errors[$file->getError()]];
|
||||
continue;
|
||||
}
|
||||
if (empty($body['cuenta_id'])) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
$output['movimientos'] = array_merge($output['movimientos'], $cartolaService->import($body['cuenta_id'][$i], $file));
|
||||
} catch (Read $exception) {
|
||||
|
||||
@ -28,6 +28,9 @@ class Detalle extends Ideal\Repository
|
||||
->register('centro_costo_id', (new Implement\Repository\Mapper())
|
||||
->setProperty('centroCosto')
|
||||
->setFunction(function(array $data) {
|
||||
if (empty($data['centro_costo_id'])) {
|
||||
return null;
|
||||
}
|
||||
return $this->centroCostoRepository->fetchById($data['centro_costo_id']);
|
||||
})
|
||||
->setDefault(null));
|
||||
|
||||
Reference in New Issue
Block a user