<?php use_helper( 'UrlFunctions' ); ?>
<?php use_helper( 'IncludePartial' ); ?>
<?php use_helper( 'UtilFunctions' ); ?>
<style>
body {font-size:60%} 
.header { background-color: #E1E1E1; color: #444444; font-family: Arial,Helvetica,sans-serif; font-size: 11px; font-weight: bold; }
.pager { background-color: #F4F4F4; background-image: none; border-bottom: thin solid #999999; }
.backgAviso{ background-color: #F4F4BC }
</style>
<style>
.grid
{
    border: 1px solid #77d5f7;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 5px;
}
.grid th 
{
    border-color: #77d5f7;
    background-color: #0a7db1;
    font-weight: normal;
    font-size: 11px;
    font-family: Verdana,Arial,sans-serif;
    height: 24px;
    padding: 0 2px;
    border-bottom: 1px solid #77d5f7;
}
.grid td 
{
    border-left: 0 none;
    border-right-color: #77d5f7;
    border-right-style: solid;
    border-right-width: 1px;
    border-bottom-color: #77d5f7;
    border-bottom-style: solid;
    border-bottom-width: 1px;
    padding: 0 2px;
    /*white-space: pre;*/
    height: 22px;
    /*border: 1px solid #77d5f7;*/
}
</style>
<table width="100%" style="background-color: #ffffff;" class="marco" cellpadding="0" cellspacing="0">
    <tr>
        <td width="2%">&nbsp;</td>
        <td width="12%"><label class="label req">Proveedor:</label></td>
        <td width="20%"><label class="labelData"><?=$o_ALM_OrdenGuiaFacturaBN->getProveedorDes();?> </label></td>
        <td width="15%"><label class="label req">RUC Proveedor:</label></td>
        <td width="20%"><label class="labelData"><?=$o_ALM_OrdenGuiaFacturaBN->getRUCProveedor();?></label></td>
        <td width="15%"><label class="label req">Sucursal:</label></td>
        <td><label class="labelData"><?=$o_ALM_OrdenGuiaFacturaBN->getSucursalDesc();?> </label></td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td><label class="label req">Nro Factura:</label></td>
        <td><label class="labelData"><b><?=$o_ALM_OrdenGuiaFacturaBN->getSerieFacturaConcat();?></b></label></td>
        <td><label class="label req">Nro Guia:</label></td>
        <td><label class="labelData"><b><?=$o_ALM_OrdenGuiaFacturaBN->getSerieGuiaConcat()?></b></label></td>
        <td><label class="label req">Fecha Factura:</label></td>
        <td><label class="labelData"><?=$o_ALM_OrdenGuiaFacturaBN->getFechaFactura();?></label></td>
    </tr>
</table>
<br>
<table class="grid" cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="border-bottom: 1px solid #999999;">
    <tr>
        <th width="2%"  align="center" class="header"><b>No</b></th>
        <th width="10%" align="center" class="header"><b>C&oacute;digo</b></th>
        <th width="30%" align=""       class="header"><b>Descripci&oacute;n</b></th>
        <th width="5%" align="center" class="header"><b>Cantidad</b></th>
        <th width="5%" align="center" class="header"><b>Precio Sin IGV</b></th>
        <th width="5%" align="center" class="header"><b>Total</b></th>
    </tr>
    <?php foreach ( $a_COM_OrdenCompraDetalle as $i_Key => $o_COM_OrdenCompraDetalleBN ){ ?>
    <tr>
        <td align="center"><?=( $i_Key + 1 )?></td>
        <td align="center"><?=$o_COM_OrdenCompraDetalleBN->getIdItem()?></td>
        <td ><?=$o_COM_OrdenCompraDetalleBN->getDescripcionItem()?></td>
        <td align="center"><?=$o_COM_OrdenCompraDetalleBN->getCantidadRecibida()?></td>
        <td align="center"><?=number_format( $o_COM_OrdenCompraDetalleBN->getPrecioUnitarioIGV(), 2 )?></td>
        <td align="center"><?=number_format( $o_COM_OrdenCompraDetalleBN->getSubtotal(), 2 )?></td>
    </tr>
    <?php } ?>
    <tr>
        <td align="right" colspan="5"><label class="labelData"><b>SUB TOTAL</b></label></td>
        <td align="center"><?=number_format( $f_SumaSubTotal, 2 )?></td>
    </tr>
    <tr>
        <td align="right" colspan="5"><label class="labelData"><b>IGV <?=GSS_ParametroMastFN::getTextoIgvActual()?></b></label></td>
        <td align="center"><?=number_format( $f_SumaIGV, 2 )?></td>
    </tr>
    <tr>
        <td align="right" colspan="5"><label class="labelData"><b>TOTAL</b></label></td>
        <td align="center"><?=number_format( $f_SumaTotal, 2 )?></td>
    </tr>
</table>
<?php if( !$b_Imprimir ){ ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>
        <td align="center">
            <input type="button" class="button" value="Imprimir" onclick="window.open( '<?=buildUrl( 'asoguias/view', 'print=1&IdConcat='.$s_IdConcat )?>', '_BLANK' )"/>
        </td>
    </tr>
</table>
<?php } ?>