Eliminar desistimiento y loading en editar desistimiento
This commit is contained in:
@ -3,6 +3,7 @@ namespace Incoviba\Service\Venta;
|
||||
|
||||
use DateTimeInterface;
|
||||
use DateTimeImmutable;
|
||||
use Incoviba\Common\Implement\Exception\EmptyResult;
|
||||
use Incoviba\Service\Money;
|
||||
use PDOException;
|
||||
use Incoviba\Repository;
|
||||
@ -66,8 +67,11 @@ class Pago
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function getById(int $pago_id): Model\Venta\Pago
|
||||
public function getById(?int $pago_id): ?Model\Venta\Pago
|
||||
{
|
||||
if ($pago_id === null) {
|
||||
return null;
|
||||
}
|
||||
$pago = $this->pagoRepository->fetchById($pago_id);
|
||||
return $this->process($pago);
|
||||
}
|
||||
@ -118,6 +122,15 @@ class Pago
|
||||
$pago->currentEstado = $estado;
|
||||
return $pago;
|
||||
}
|
||||
public function delete(Model\Venta\Pago $pago): bool
|
||||
{
|
||||
try {
|
||||
$this->pagoRepository->remove($pago);
|
||||
return true;
|
||||
} catch (EmptyResult|PDOException) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected function process($pago): Model\Venta\Pago
|
||||
{
|
||||
|
Reference in New Issue
Block a user