From 27ace68b1d6958db3f3b66f25afdbda7aaf72bfa Mon Sep 17 00:00:00 2001 From: Aldarien Date: Tue, 8 Mar 2022 10:57:28 -0300 Subject: [PATCH 1/4] FIX: cuando UF = 0 --- incoviba/modelos/src/old/Venta/Pago.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/incoviba/modelos/src/old/Venta/Pago.php b/incoviba/modelos/src/old/Venta/Pago.php index a14b6b3..9b2d4ed 100644 --- a/incoviba/modelos/src/old/Venta/Pago.php +++ b/incoviba/modelos/src/old/Venta/Pago.php @@ -80,6 +80,9 @@ class Pago extends Model if ($uf == 1 and method_exists($this->fuente()[0]->obj, 'uf')) { $uf = $this->fuente()[0]->obj->uf(); } + if ($uf == 0) { + $uf = 1; + } $valor /= $uf; if ($this->asociado() and $this->asociado == 0) { $valor += $this->asociado()->valor('ufs'); From 2f369c4e5e610e3b5b4402d92cc317fa8c099d65 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Tue, 8 Mar 2022 10:58:38 -0300 Subject: [PATCH 2/4] =?UTF-8?q?Se=20agregar=20Resciliacion=20y=20el=20n?= =?UTF-8?q?=C2=B0=20de=20departamento=20al=20inicio=20de=20la=20linea=20FI?= =?UTF-8?q?X:=20acumulado=20no=20pagado?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Service/Informe/Contabilidad/Resumen.php | 27 +++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/app/Service/Informe/Contabilidad/Resumen.php b/app/Service/Informe/Contabilidad/Resumen.php index e13a7f8..8911cc0 100644 --- a/app/Service/Informe/Contabilidad/Resumen.php +++ b/app/Service/Informe/Contabilidad/Resumen.php @@ -68,7 +68,7 @@ class Resumen $cuotas = $venta->pie()->cuotas('fecha', $up_to); $ly = $this->startOfYear($up_to); $older = array_reduce($cuotas, function($sum, $item) use ($ly) { - if ($item->pago()->estado()->tipo()->active != 1 || strtolower($item->pago()->estado()->tipo()->descripcion) != 'no pagado') { + if ($item->pago()->estado()->tipo()->active != 1 or strtolower($item->pago()->estado()->tipo()->descripcion) == 'no pagado') { return $sum; } if ($item->pago()->fecha() >= $ly) { @@ -119,6 +119,13 @@ class Resumen } return [$this->extractValueDate($venta->subsidio()->pago(), 'Ahorro'), $this->extractValueDate($venta->subsidio()->subsidio(), 'Subsidio')]; } + protected function getResciliacion(Venta $venta, DateTimeInterface $up_to) + { + if ($venta->resciliacion == null) { + return $this->defaultValueDate($up_to, 'Resciliacion'); + } + return $this->extractValueDate($venta->resciliacion()->pago(), 'Resciliacion'); + } protected function getPagos(Venta $venta, DateTimeInterface $up_to) { $pagos = []; @@ -133,6 +140,13 @@ class Resumen }); } + protected function buildLine(Venta $venta, $pago) + { + if ($pago->valor > 0) { + return ['', $venta->unidad->descripcion(), $pago->fecha->format('d/m/Y'), $pago->glosa, '', $pago->valor, $pago->estado]; + } + return ['', $venta->unidad->descripcion(), $pago->fecha->format('d/m/Y'), $pago->glosa, -$pago->valor, '', $pago->estado]; + } protected function buildLibro(Venta $venta, DateTimeInterface $up_to) { $pagos = $this->getPagos($venta, $up_to); @@ -143,16 +157,15 @@ class Resumen $debe = 0; $haber = 0; foreach ($pagos as $pago) { + $output []= $this->buildLine($venta, $pago); if ($pago->valor > 0) { - $output []= ['', $pago->fecha->format('d/m/Y'), $pago->glosa, '', $pago->valor, $pago->estado]; $debe += $pago->valor; } else { - $output []= ['', $pago->fecha->format('d/m/Y'), $pago->glosa, -$pago->valor, '', $pago->estado]; $haber -= $pago->valor; } } - $output []= ['', '', 'Total', $haber, $debe]; + $output []= ['', '', '', 'Total', $haber, $debe]; return $output; } @@ -163,15 +176,15 @@ class Resumen $output = ["Libro Mayor {$ventas[0]->proyecto()->descripcion}", '']; foreach ($ventas as $venta) { - $output = array_merge($output, $this->buildLibro($venta, $up_to), [''], ['']); + $output = array_merge($output, $this->buildLibro($venta, $up_to)); } $filename = "Contabilidad - Resumen - {$ventas[0]->proyecto()->descripcion} - {$up_to->format('Y-m-d')}.xlsx"; $informe = new Informe(); $informe->createSpreadsheet() ->addArray($output) - ->formatColumn('C') - ->formatColumn('D') + ->formatColumn('E') + ->formatColumn('F') ->send($filename); } } From d1473eaac4df13d9ac2e711330b8ba5869378d92 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Tue, 8 Mar 2022 11:00:36 -0300 Subject: [PATCH 3/4] FIX: connection timeout --- nginx.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/nginx.conf b/nginx.conf index 8482eb6..42bb089 100644 --- a/nginx.conf +++ b/nginx.conf @@ -20,6 +20,7 @@ server { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_index index.php; + fastcgi_read_timeout 3600; fastcgi_pass php:9000; } } From f29bc8f05f7ddc273e9e72be4daf2adc044c6e74 Mon Sep 17 00:00:00 2001 From: Aldarien Date: Tue, 8 Mar 2022 11:02:23 -0300 Subject: [PATCH 4/4] FIX --- app/Service/Informe/Contabilidad/Resumen.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Service/Informe/Contabilidad/Resumen.php b/app/Service/Informe/Contabilidad/Resumen.php index 8911cc0..e20266a 100644 --- a/app/Service/Informe/Contabilidad/Resumen.php +++ b/app/Service/Informe/Contabilidad/Resumen.php @@ -143,9 +143,9 @@ class Resumen protected function buildLine(Venta $venta, $pago) { if ($pago->valor > 0) { - return ['', $venta->unidad->descripcion(), $pago->fecha->format('d/m/Y'), $pago->glosa, '', $pago->valor, $pago->estado]; + return ['', $venta->unidad()->descripcion, $pago->fecha->format('d/m/Y'), $pago->glosa, '', $pago->valor, $pago->estado]; } - return ['', $venta->unidad->descripcion(), $pago->fecha->format('d/m/Y'), $pago->glosa, -$pago->valor, '', $pago->estado]; + return ['', $venta->unidad()->descripcion, $pago->fecha->format('d/m/Y'), $pago->glosa, -$pago->valor, '', $pago->estado]; } protected function buildLibro(Venta $venta, DateTimeInterface $up_to) {