<?php
class ListAlmResumenAction extends wtActions 
{
    public function execute()
    {
        $this->s_IdItem = $this->getRequestParameter( 'IdIem' );
        
        $this->IdCompania = myUser::getUser()->getIdBusiness();
        
        $this->GlobalAccess = myUser::getUser()->hasGlobalAccess();
        
        $o_ALM_AlmacenMastFN = new ALM_AlmacenMastFN();
        $o_ALM_AlmacenMastFN->setIdCompania( $this->IdCompania );
        $o_ALM_AlmacenMastFN->addOrderBy( ALM_AlmacenMastFN::DescripcionLocal );
        
        $this->opt_seleccione = $this->GlobalAccess;
        if( !$this->GlobalAccess )
        {
            $s_IdAlmacen = GSS_SucursalFN::recuperarIdAlmacen( myUser::getUser()->getIdSucursal() );
            $o_ALM_AlmacenMastFN->setIdAlmacen( $s_IdAlmacen );
        }
        $this->a_ALM_AlmacenMast = $o_ALM_AlmacenMastFN->select();
        
        $this->FechaInicio = date( "Y-m" )."-01";
        $this->FechaFin = UtilDate::getFechaFinMes( date( "Y"), date( "m" ) );
    }
}