<?php use_helper( 'UrlFunctions' ); ?>
<?php use_helper( 'UtilFunctions' ); ?>
<?php use_helper( 'IncludePartial' ); ?>

<div class="card" class="mb-2" style="margin-top: 5px;">

    <table id="example" class="table table-striped table-bordered" style="width:100%">
        <thead>
            <tr>
                <th width="2%" style="text-align: center;"> # </th>
                <th style="text-align: center;">Medio Pago</th>
                <th style="text-align: center;">Nro Doc</th>
                <th style="text-align: center;">Fecha Doc</th>
                <th style="text-align: center;">Estado</th>
                <th style="text-align: center;">T/C</th>
                <th style="text-align: center;">Aplicar</th>
                <th style="text-align: center;">Monto <?=$s_PrfMonedaOrd?></th>
                
            </tr>
        </thead>
        <tbody>
            <?php $f_TotalAcumulado = 0 ?>
            <?php foreach ( $a_FCO_DocRecibo as $key => $o_FCO_DocReciboBN ) { ?>
                <?php
                $s_Prfx = GSS_MonedaMastFN::getSiglaxId( $o_FCO_DocReciboBN->getIdMoneda() );
                if( $VTA_OrdenBN->getMonedaCod() == "LO" )
                {
                    //moneda local
                    $f_MontoSelect = $o_FCO_DocReciboBN->getMontoMN();
                }
                else
                {
                    //moneda extrangera
                    $f_MontoSelect = $o_FCO_DocReciboBN->getMontoME();
                }
                $f_TotalAcumulado = $f_TotalAcumulado + $f_MontoSelect;
                ?>
                <tr>
                    <td align="center"><?=$key+1?></td>
                    <td align="center" nowrap=""><?=$o_FCO_DocReciboBN->getObjectTipoPago()->getNombre()?></td>
                    <td align="center"><?=$o_FCO_DocReciboBN->getReciboNumero()?></td>
                    <td align="center"><?=substr( $o_FCO_DocReciboBN->getReciboFecha(), 0, 10 )?></td>
                    <td align="center"><?=$o_FCO_DocReciboBN->getFlujoEstadoDesc()?></td>
                    <td align="center"><?=$o_FCO_DocReciboBN->getTipoCambio()?></td>
                    <td align="center"><?=$s_Prfx." ".$o_FCO_DocReciboBN->getMonto()?></td>
                    <td align="center"><?=$f_MontoSelect?></td>
                </tr>    
            <?php } ?>
        </tbody>
        <tfoot>
            <tr >
                <th style="text-align: right;" colspan="6">&nbsp;</th>
                <th style="text-align: right;" class="border border-secondary" style="border-color: #6c757d!important;"><b>TOTAL <?=$s_PrfMonedaOrd?></th>
                <th style="text-align:center" class="border border-secondary" style="border-color: #6c757d!important;"><?=round( $f_TotalAcumulado, 2 )?></b></th>
            </tr>
        </tfoot>
    </table>
</div>

<script type="text/javascript">
$('#example').DataTable
(
    {
        language: { "url": "//cdn.datatables.net/plug-ins/9dcbecd42ad/i18n/Spanish.json" },
        responsive: { details: true },
        searching: false,
        info:     false,
        lengthChange: false,
        //paging:   false,
        dom: 'lrtip'
    }
);
</script>