<?php
/* Busqueda de registros de la tabla ALM_OrdenGuiaFactura redefinidos por el usuario. */
class ALM_OrdenGuiaFacturaFN extends BaseALM_OrdenGuiaFacturaFN
{
    public static function recuperarFiltroSerie()
    {
        $s_Sql = "SELECT SerieFactura FROM ALM_OrdenGuiaFactura GROUP BY SerieFactura HAVING SerieFactura IS NOT NULL;";
        $o_ResultSet = Conexion::getConexion()->prepareStatement( $s_Sql )->executeQuery();
        $a_Series = array();
        while( $o_ResultSet->next() ) 
        {
            $a_SQLRow = $o_ResultSet->getRow();
            $a_Series[] = $a_SQLRow['SerieFactura'];
        }
        return $a_Series;
    }
    
    public static function recuperarFiltroSerieGuia()
    {
        $s_Where = "";
        if( myUser::getUser()->getIdSucursal() )
        {
            $s_Where = " AND IdSucursal='".myUser::getUser()->getIdSucursal()."' ";
        }
        $s_Sql = "
                SELECT SerieGuia
                FROM ALM_OrdenGuiaFactura
                WHERE 1=1 $s_Where
                GROUP BY SerieGuia;
        ";
        $o_ResultSet = Conexion::getConexion()->prepareStatement( $s_Sql )->executeQuery();
        $a_Series = array();
        while( $o_ResultSet->next() ) 
        {
            $a_SQLRow = $o_ResultSet->getRow();
            $a_Series[$a_SQLRow['SerieGuia']] = $a_SQLRow['SerieGuia'];
        }
        return $a_Series;
    }
}
?>