diff --git a/app/resources/views/ventas/pies/cuotas.blade.php b/app/resources/views/ventas/pies/cuotas.blade.php
index a00a072..83f132f 100644
--- a/app/resources/views/ventas/pies/cuotas.blade.php
+++ b/app/resources/views/ventas/pies/cuotas.blade.php
@@ -13,6 +13,13 @@
return "base}/venta/{$venta->id}\">{$venta->propiedad()->departamentos()[0]->descripcion}";
}, $asociadas)) !!}
+ @if ($venta->formaPago()->pie->asociado !== null)
+
@@ -113,13 +120,13 @@
TOTAL |
- {{$format->pesos($total_pesos = array_reduce($venta->formaPago()->pie->cuotas(),
- function(float $sum, Incoviba\Model\Venta\Cuota $cuota) {
+ {{$format->pesos($total_pesos = array_reduce($venta->formaPago()->pie->cuotas(vigentes: true),
+ function(int $sum, Incoviba\Model\Venta\Cuota $cuota) {
return $sum + $cuota->pago->valor;
}, 0))}}
|
- {{$format->ufs($total = array_reduce($venta->formaPago()->pie->cuotas(),
+ {{$format->ufs($total = array_reduce($venta->formaPago()->pie->cuotas(vigentes: true),
function(float $sum, Incoviba\Model\Venta\Cuota $cuota) use ($now, $uf_venta) {
return $sum + (($cuota->pago->fecha > $now or $cuota->pago->uf === null) ?
$cuota->pago->valor / $uf_venta :
@@ -131,13 +138,13 @@
|
TOTAL PAGADO |
- {{$format->pesos($pagado_pesos = array_reduce($venta->formaPago()->pie->cuotas(true),
+ {{$format->pesos($pagado_pesos = array_reduce($venta->formaPago()->pie->cuotas(pagadas: true, vigentes: true),
function(int $sum, Incoviba\Model\Venta\Cuota $cuota) {
return $sum + $cuota->pago->valor;
}, 0))}}
|
- {{$format->ufs($pagado = array_reduce($venta->formaPago()->pie->cuotas(true),
+ {{$format->ufs($pagado = array_reduce($venta->formaPago()->pie->cuotas(pagadas: true, vigentes: true),
function(float $sum, Incoviba\Model\Venta\Cuota $cuota) {
return $sum + $cuota->pago->valor();
}, 0.0))}}
@@ -156,12 +163,15 @@
{{$format->ufs($total - $pagado)}}
|
- {{$format->number(($total > 0) ? ($total - $pagado) / $total * 100 : 0, 2)}}%
+ {{$format->percent(($total > 0) ? ($total - $pagado) / $total * 100 : 0, 2)}}*
|
|
+
+ * Porcentaje calculado sobre el valor de la venta
+
@endsection
@include('layout.head.styles.datatables')
@@ -303,13 +313,26 @@
columnDefs: [
{
target: 1,
- orderData: [2]
+ orderData: [2],
+ className: 'dt-center'
},
{
target: 2,
visible: false,
searchable: false
},
+ {
+ target: 3,
+ className: 'dt-center'
+ },
+ {
+ targets: [5, 6],
+ className: 'dt-right'
+ },
+ {
+ target: 7,
+ className: 'dt-center'
+ },
{
target: 8,
orderData: [9]
diff --git a/app/resources/views/ventas/show/forma_pago/pie.blade.php b/app/resources/views/ventas/show/forma_pago/pie.blade.php
index f399a04..6f3df32 100644
--- a/app/resources/views/ventas/show/forma_pago/pie.blade.php
+++ b/app/resources/views/ventas/show/forma_pago/pie.blade.php
@@ -14,7 +14,7 @@
Cuotas |
- {{count($pie->cuotas(true))}}/{{$pie->cuotas}}
+ {{count($pie->cuotas(true, true))}}/{{$pie->cuotas}}
@if (count($pie->cuotas(vigentes: true)) < $pie->cuotas)
|