Total pesos en forma pago y detalle cuotas
This commit is contained in:
@ -19,31 +19,96 @@
|
|||||||
<th>Fecha ISO</th>
|
<th>Fecha ISO</th>
|
||||||
<th>Banco</th>
|
<th>Banco</th>
|
||||||
<th>Identificador</th>
|
<th>Identificador</th>
|
||||||
<th>Valor</th>
|
<th class="right aligned">Valor</th>
|
||||||
|
<th class="right aligned">Valor UF</th>
|
||||||
|
<th>Estado</th>
|
||||||
|
<th>Fecha Estado</th>
|
||||||
|
<th>Fecha Estado ISO</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>@php $now = new DateTimeImmutable(); @endphp
|
||||||
@foreach ($venta->formaPago()->pie->cuotas() as $cuota)
|
@foreach ($venta->formaPago()->pie->cuotas() as $cuota)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{$cuota->numero}}</td>
|
<td>{{$cuota->numero}}</td>
|
||||||
<td>
|
<td>{{$cuota->pago->fecha->format('d-m-Y')}}</td>
|
||||||
{{$cuota->pago->fecha->format('d-m-Y')}}
|
<td>{{$cuota->pago->fecha->format('Y-m-d')}}</td>
|
||||||
|
<td>{{$cuota->pago->banco->nombre}}</td>
|
||||||
|
<td>{{$cuota->pago->identificador}}</td>
|
||||||
|
<td class="right aligned">{{$format->pesos($cuota->pago->valor)}}</td>
|
||||||
|
<td class="right aligned">
|
||||||
|
@if ($cuota->pago->currentEstado->fecha <= $now)
|
||||||
|
{{$format->ufs($cuota->pago->valor())}}
|
||||||
|
@endif
|
||||||
</td>
|
</td>
|
||||||
|
<td
|
||||||
|
@if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'abonado')
|
||||||
|
class="green"
|
||||||
|
@elseif ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'depositado')
|
||||||
|
class="yellow"
|
||||||
|
@elseif ($cuota->pago->currentEstado->tipoEstadoPago->active !== 1)
|
||||||
|
class="red"
|
||||||
|
@endif
|
||||||
|
>{{ucwords($cuota->pago->currentEstado->tipoEstadoPago->descripcion)}}</td>
|
||||||
<td>
|
<td>
|
||||||
{{$cuota->pago->fecha->format('Y-m-d')}}
|
@if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'abonado')
|
||||||
</td>
|
{{$cuota->pago->currentEstado->fecha->format('d-m-Y')}}
|
||||||
<td>
|
@else
|
||||||
{{$cuota->pago->banco->nombre}}
|
<div class="ui action input">
|
||||||
</td>
|
<div class="ui calendar fecha_estado" data-date="{{$cuota->pago->currentEstado->fecha->format('Y-m-d')}}">
|
||||||
<td>
|
<div class="ui icon input">
|
||||||
{{$cuota->pago->identificador}}
|
<i class="calendar icon"></i>
|
||||||
</td>
|
<input type="text" name="fecha_estado" />
|
||||||
<td>
|
</div>
|
||||||
{{$format->pesos($cuota->pago->valor)}}
|
</div>
|
||||||
|
<button class="ui green basic icon button" id="accept_estado" data-pago="{{$cuota->pago->id}}">
|
||||||
|
<i class="check icon"></i>
|
||||||
|
</button>
|
||||||
|
@if ($cuota->pago->currentEstado->tipoEstadoPago->descripcion === 'depositado')
|
||||||
|
<button class="ui red basic icon button" id="reject_estado" data-pago="{{$cuota->pago->id}}">
|
||||||
|
<i class="remove icon"></i>
|
||||||
|
</button>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
</td>
|
</td>
|
||||||
|
<td>{{$cuota->pago->currentEstado->fecha->format('Y-m-d')}}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<th colspan="5">TOTAL</th>
|
||||||
|
<th class="right aligned">
|
||||||
|
{{$format->pesos(array_reduce($venta->formaPago()->pie->cuotas(),
|
||||||
|
function(float $sum, Incoviba\Model\Venta\Cuota $cuota) {
|
||||||
|
return $sum + $cuota->pago->valor;
|
||||||
|
}, 0))}}
|
||||||
|
</th>
|
||||||
|
<th class="right aligned">
|
||||||
|
{{$format->ufs(array_reduce($venta->formaPago()->pie->cuotas(),
|
||||||
|
function(float $sum, Incoviba\Model\Venta\Cuota $cuota) {
|
||||||
|
return $sum + $cuota->pago->valor();
|
||||||
|
}, 0))}}
|
||||||
|
</th>
|
||||||
|
<th colspan="3"></th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="5">TOTAL PAGADO</th>
|
||||||
|
<th class="right aligned">
|
||||||
|
{{$format->pesos(array_reduce($venta->formaPago()->pie->cuotas(true),
|
||||||
|
function(float $sum, Incoviba\Model\Venta\Cuota $cuota) {
|
||||||
|
return $sum + $cuota->pago->valor;
|
||||||
|
}, 0))}}
|
||||||
|
</th>
|
||||||
|
<th class="right aligned">
|
||||||
|
{{$format->ufs(array_reduce($venta->formaPago()->pie->cuotas(true),
|
||||||
|
function(float $sum, Incoviba\Model\Venta\Cuota $cuota) {
|
||||||
|
return $sum + $cuota->pago->valor();
|
||||||
|
}, 0))}}
|
||||||
|
</th>
|
||||||
|
<th colspan="3"></th>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
@ -53,6 +118,13 @@
|
|||||||
@push('page_scripts')
|
@push('page_scripts')
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
|
$('.fecha_estado').calendar({
|
||||||
|
type: 'date',
|
||||||
|
formatter: {
|
||||||
|
date: 'DD-MM-YYYY'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
new DataTable('#cuotas', {
|
new DataTable('#cuotas', {
|
||||||
language: {
|
language: {
|
||||||
info: 'Mostrando página _PAGE_ de _PAGES_',
|
info: 'Mostrando página _PAGE_ de _PAGES_',
|
||||||
@ -63,10 +135,23 @@
|
|||||||
search: 'Buscar: '
|
search: 'Buscar: '
|
||||||
},
|
},
|
||||||
columnDefs: [
|
columnDefs: [
|
||||||
|
{
|
||||||
|
target: 1,
|
||||||
|
orderData: [2]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
target: 2,
|
target: 2,
|
||||||
visible: false,
|
visible: false,
|
||||||
searchable: false
|
searchable: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
target: 8,
|
||||||
|
orderData: [9]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
target: 9,
|
||||||
|
visible: false,
|
||||||
|
searchable: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
order: [
|
order: [
|
||||||
|
@ -12,8 +12,11 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="right aligned">
|
<td class="right aligned">
|
||||||
<strong>
|
<strong>
|
||||||
{{$format->pesos($formaPago->total('pesos'))}}
|
{{$format->pesos($formaPago->total('pesos') - (($formaPago->bonoPie) ? $formaPago->bonoPie->pago->valor : 0))}}
|
||||||
</strong>
|
</strong>
|
||||||
|
@if ($formaPago->bonoPie)
|
||||||
|
<sup>*</sup>
|
||||||
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td class="right aligned" >
|
<td class="right aligned" >
|
||||||
@if (abs($venta->saldo() / $venta->valor) > 0.01)
|
@if (abs($venta->saldo() / $venta->valor) > 0.01)
|
||||||
@ -26,3 +29,13 @@
|
|||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@if ($formaPago->bonoPie)
|
||||||
|
<tr>
|
||||||
|
<td colspan="6">
|
||||||
|
<span class="ui small text">
|
||||||
|
<sup>*</sup>
|
||||||
|
Total en pesos no incluye Promociones como Bono Pie
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endif
|
||||||
|
Reference in New Issue
Block a user