<div ng-controller="auxCentroCustosController" ng-init="carregarGuardados();">
    <div class="modal-header">
        <h4>Centro de Custos</h4>
        <h5>Contas inválidas</h5>
    </div>
    <div class="modal-body">
        <div class="row">
            <div class="col-md-4">
                <div class="input-group">
                    <span class="input-group-addon">Ano Letivo</span>
                    <select class="form-control"
                            ng-change="selAnoLetivo(selectedAnoLetivo); carregarGuardados();"
                            ng-model="selectedAnoLetivo"
                            ng-options="e.descricao for e in lstAnosLetivos"></select>
                </div>
            </div>

        </div>

        <div class="row">
            <br />
        </div>

        <div style="min-height:200px">
            <br />
            <div style="overflow: auto; height:250px;">
                <table class="table table-bordered table-striped">
                    <tr ng-repeat="item in lstExistentes" ng-click="selRow(item)" ng-class="{info:item==selectedRow}">
                        <td>{{item.CodNivel5}}</td>
                        <td>{{item.Nivel2}}</td>
                        <td>{{item.Nivel3}}</td>
                        <td>{{item.Nivel4}}</td>
                    </tr>
                </table>
            </div>


        </div>
        <br />
        <div ng-show="tipout=='Inovar'">
            <div class="row" ng-show="false">
                <div class="col-md-4">
                    <div class="input-group">
                        <span class="input-group-addon">Ano Económico (Correção)</span>
                        <input type="text" class="form-control" placeholder="" aria-describedby="basic-addon2" ng-model="anoEconomico">
                    </div>
                </div>
            </div>
            <br />
            <div class="row">
                <div class="col-md-4">
                    <div class="input-group">
                        <span class="input-group-addon">Conta</span>
                        <input type="text" class="form-control" placeholder="" aria-describedby="basic-addon2" ng-model="selectedRow.CodNivel5">
                    </div>
                </div>
                <div class="col-md-4">
                    <div class="input-group">
                        <span class="input-group-addon">Substituir por</span>
                        <input type="text" class="form-control" placeholder="" aria-describedby="basic-addon2" ng-model="contaNovaSubstituir">
                    </div>
                </div>
                <div class="col-md-4">
                    <button class="btn btn-warning" ng-click="substituirContaLocal()" ng-disabled="emExecucao==true">Substituir</button>
                </div>
            </div>
        </div>

        <br />
        <div class="alert alert-warning" role="alert">
            <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
            As alterações serão aplicadas a todos os bens de forma a que não fiquem com contas repetidas
        </div>
        <div ng-show="emExecucao==true">
            <label style="font-size:8pt">Por Favor Aguarde... </label><img src="images/preloader.gif" width="32" style="margin-left:30px; margin-right:30px" />
        </div>

    </div>

    <div class="modal-footer">
        <!--<button class="btn btn-primary" ng-click="guardaDados()" ng-disabled="emExecucao==true">Gravar</button>-->
        <button class="btn btn-warning" ng-click="ok()" ng-disabled="emExecucao==true">Fechar</button>
    </div>
</div>

