Agregando calculo de fondo

This commit is contained in:
2025-01-12 13:00:21 -03:00
parent e3fb7259b9
commit 7bb61017de
10 changed files with 204 additions and 37 deletions

View File

@@ -28,26 +28,6 @@ class Edit extends Component
unset($this->totalIngresos);
}
/*
private void fillResumen() {
long totalEfectivo = efectivo.getTotal();
long totalDocumentos = repos.documento.getTotalOfTurno(state.getTurno());
long totalIngresos = repos.ingreso.getTotalOfTurno(state.getTurno());
long totalEgresos = repos.egreso.getTotalTurno(state.getTurno());
long rendido = totalDocumentos + totalEfectivo + totalEgresos;
long diferencia = rendido - totalIngresos;
view.setResumenEfectivo(totalEfectivo);
view.setResumenDocumentos(totalDocumentos);
view.setResumenEgreso(totalEgresos);
view.setResumenRendido(rendido);
view.setResumenDebeRendir(totalIngresos);
view.setResumenDiferencia(diferencia);
}
*/
#[Computed]
public function totalEfectivo()
{
@@ -59,6 +39,7 @@ class Edit extends Component
{
return $this->turno->egresos()->sum('valor');
}
#[Computed]
public function totalDocumentos()
{
@@ -77,12 +58,14 @@ class Edit extends Component
}
#[Computed]
public function debeRendir() {
public function debeRendir()
{
return $this->turno->ingresos()->sum('total');
}
#[Computed]
public function diferencia() {
public function diferencia()
{
return $this->rendido - $this->debeRendir;
}