
<table style="margin-bottom: 0;" class="table table-sm table-bordered table-hover" id="">
    <thead >
    <tr class="table-primary">
        <th width="1%"  style="text-align: center" ><b>No</b></th>
        <th width="8%" style="text-align: center" ><b>C&oacute;digo</b></th>
        <th width="35%" align=""><b>Descripci&oacute;n</b></th>
        <th width="8%" style="text-align: center" ><b>Cantidad</b></th>
        <th width="8%" style="text-align: center" ><b>Precio Prov</b></th>
        <th width="8%" style="text-align: center" ><b>Total Prov</b></th>
        <th width="4%" style="" ><b>&nbsp;</b></th>
        <th width="8%" style="text-align: center" ><b>Costo Dolares</b></th>
        <th width="8%" style="text-align: center" ><b>Costo Soles</b></th>
    </tr>
    </thead>
    <tbody>
    <?php foreach ( $a_COM_OrdenCompraDetalle as $i_Key => $o_COM_OrdenCompraDetalleBN ){ ?>
    <tr>
        <th style="text-align: center;" scope="row"><?=( $i_Key + 1 )?></th>
        <td align="center"><?=$o_COM_OrdenCompraDetalleBN->getIdItem()?></td>
        <td  align="" id=""><?=$o_COM_OrdenCompraDetalleBN->getDescripcion()?></td>
        <td align="center"><?=number_format( $o_COM_OrdenCompraDetalleBN->getCantidadPedida(), 2 )?></td>
        <td align="right"><?=number_format( $o_COM_OrdenCompraDetalleBN->getPrecioUnitario(), 2 )?></td>
        <td align="right"><?=number_format( $o_COM_OrdenCompraDetalleBN->getSubTotal(), 2 )?></td>
        <td align="center">&nbsp;</td>

        <?php if( $o_COM_OrdenCompraDetalleBN->getEstado() != COM_OrdenCompraCabeceraBN::ORDEN_COMPRA_COMPLETADO ){ ?>
            <?php if( $CalcularCosto ){ ?>
        <td align="center"><?=number_format( $o_COM_OrdenCompraDetalleBN->getPrecioUnitario() * ( 1 + $DivisionTotal ), 2 ) ?></td>
        <td align="center"><?=number_format( ( $o_COM_OrdenCompraDetalleBN->getPrecioUnitario() * ( 1 + $DivisionTotal ) ) * $TipoCambio, 2 ) ?></td>
            <?php }else{ ?>
        <td align="center">&nbsp;</td>
        <td align="center">&nbsp;</td>
            <?php } ?>
        <?php }else{ ?>
        <td align="center"><?=number_format( $o_COM_OrdenCompraDetalleBN->getPrecioUnitario() * ( 1 + $DivisionTotal ), 2 ) ?></td>
        <td align="center"><?=number_format( ( $o_COM_OrdenCompraDetalleBN->getPrecioUnitario() * ( 1 + $DivisionTotal ) ) * $TipoCambio, 2 ) ?></td>
        <?php } ?>

    </tr>
    <?php } ?>
    </tbody>
</table>

<div class="dropdown-divider"></div>

<div class="form-row mx-0">
    <div class="col-md-2 mb-1">
        <label class="col-form-label" for="">Total</label>
        <input type="text" class="form-control text-center" name="TotalSeguro" id="TotalSeguro" value="<?=number_format( $SumaTotalGastos, 2 )?>" autocomplete="off" onblur="" onfocus="this.select()" readonly >
    </div>
    <div class="col-md-2 mb-1">
        <label class="col-form-label" for="">Porcentaje Costeo</label>
        <input type="text" class="form-control text-center" name="TotalSeguro" id="TotalSeguro" value="<?=number_format( $PorcentajeTotal, 2 )?> %" autocomplete="off" onblur="" onfocus="this.select()" readonly >
    </div>
    <?php if( $o_COM_OrdenCompraDetalleBN->getEstado() != COM_OrdenCompraCabeceraBN::ORDEN_COMPRA_COMPLETADO ){ ?>
    <div class="col-md-8 mb-1 text-right">
        <button type="button" class="btn btn-primary btn-sm" onclick="buscarGridCosteoImport( 1 );">CALCULAR COSTO</button>
    </div>
    <?php } ?>
</div>