Implement movimientos cuotas

This commit is contained in:
2024-01-08 21:24:34 -03:00
parent d225011ae9
commit 6393a1fced
4 changed files with 222 additions and 36 deletions

View File

@ -67,6 +67,22 @@ class Pago
return false;
}
}
public function anular(Model\Venta\Pago $pago, DateTimeInterface $fecha): bool
{
$tipo_estado = $this->tipoEstadoPagoRepository->fetchByDescripcion('anulado');
$data = [
'pago' => $pago->id,
'estado' => $tipo_estado->id,
'fecha' => $fecha->format('Y-m-d')
];
try {
$estado = $this->estadoPagoRepository->create($data);
$this->estadoPagoRepository->save($estado);
return true;
} catch (PDOException) {
return false;
}
}
public function getById(?int $pago_id): ?Model\Venta\Pago
{
if ($pago_id === null) {