FIX: Edit Pago sin "valor"
This commit is contained in:
@ -68,12 +68,12 @@ class Credito extends Ideal\Service
|
|||||||
$data['valor'] = $this->valorService->clean($data['valor']);
|
$data['valor'] = $this->valorService->clean($data['valor']);
|
||||||
$valorPago = round($data['valor'] * $uf);
|
$valorPago = round($data['valor'] * $uf);
|
||||||
}
|
}
|
||||||
$filteredData = array_intersect_key($data, array_fill_keys([
|
$filteredData = array_intersect_key($data, array_flip([
|
||||||
'fecha',
|
'fecha',
|
||||||
'uf',
|
'uf',
|
||||||
'valor',
|
'valor',
|
||||||
'banco'
|
'banco'
|
||||||
], 0));
|
]));
|
||||||
$filteredDataPago = $filteredData;
|
$filteredDataPago = $filteredData;
|
||||||
if (isset($valorPago)) {
|
if (isset($valorPago)) {
|
||||||
$filteredDataPago['valor'] = $valorPago;
|
$filteredDataPago['valor'] = $valorPago;
|
||||||
|
@ -153,7 +153,9 @@ class Pago
|
|||||||
$data['uf'] = $this->ufService->get(new DateTimeImmutable($data['fecha']));
|
$data['uf'] = $this->ufService->get(new DateTimeImmutable($data['fecha']));
|
||||||
}
|
}
|
||||||
$filteredData = $this->pagoRepository->filterData($data);
|
$filteredData = $this->pagoRepository->filterData($data);
|
||||||
$filteredData['valor'] = round($this->valorService->clean($filteredData['valor']));
|
if (array_key_exists('valor', $filteredData)) {
|
||||||
|
$filteredData['valor'] = round($this->valorService->clean($filteredData['valor']));
|
||||||
|
}
|
||||||
$pago = $this->pagoRepository->edit($pago, $filteredData);
|
$pago = $this->pagoRepository->edit($pago, $filteredData);
|
||||||
$pago->currentEstado = $this->estadoPagoRepository->fetchCurrentByPago($pago->id);
|
$pago->currentEstado = $this->estadoPagoRepository->fetchCurrentByPago($pago->id);
|
||||||
return $pago;
|
return $pago;
|
||||||
|
Reference in New Issue
Block a user