<div ng-controller="cadastroController">

    <div class="modal-header">
        <h3>SNC-AP ({{selected.item.AnoStr}})</h3>
        <p align="right">
            <div class="input-group">
                <input type="text" class="form-control" placeholder="Procurar..." ng-model="procurar_class">
                <span class="input-group-addon">
                    <span class="glyphicon glyphicon-search"></span>
                </span>

            </div>
        </p>
    </div>
    <div ng-controller="PlanoContasCtrl">
        <div class="modal-body" ng-init="carregarPlanoSNC(selected.item.Pk_Inventario,selected.item.AnoStr)" style="height:340px; overflow:auto">
            <table class="table table-bordered table-striped">
                <thead>
                    <tr>
                        <th>Descrição</th>
                        <th style="width:70px">Vida</th>
                        <!--<th ng-show="root_usaProgContabilidade()===false" style="width:30px; text-align:right">
                            <button ng-click="modalEditaConta(null, selected.item.AnoStr, carregarPlanoSNC, [selected.item.Pk_Inventario,selected.item.AnoStr])"
                                    type="button"
                                    ng-show="root_usaProgContabilidade()===false"
                                    class="btn btn-primary btn-xs">
                                <span class="glyphicon glyphicon-plus"></span>
                            </button>
                        </th>-->
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="cl in lstPlanosSNC | filter:procurar_class"
                        ng-click="selContaSNC(cl); selected.item.ContaSNC = cl.ContaSNC;"
                        ng-class="{info:cl.ContaSNC==selected.item.ContaSNC}">
                        <td>{{cl.ContaSNC+' '+cl.Descricao}}</td>

                        <td>
                            {{cl.VidaUtilControlo}}
                        </td>
                        <!--<td ng-show="root_usaProgContabilidade()===false">
                            <button ng-click="modalEditaConta(cl, cl.AnoEconomico)"
                                    type="button"
                                    ng-show="root_usaProgContabilidade()===false"
                                    class="btn btn-default btn-xs">
                                <span class="glyphicon glyphicon-pencil"></span>
                            </button>
                        </td>-->
                    </tr>
                </tbody>
            </table>

        </div>
        <div class="modal-footer">
            <!--<div class="alert alert-warning" role="alert" ng-show="root_usaProgContabilidade()===false">
                <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
                Ao importar, todas as contas existentes no ano serão apagadas e substituidas pelas novas
            </div>-->
            
            <img src="images/preloader.gif" width="32" ng-hide="itemsLoaded==true" style="margin-left:30px; margin-right:30px" />
            <!--<input id="btUpload" type="file"
                   ng-file-select="onFileContasPlanoExcel($files, selected.item.AnoStr, carregarPlanoSNC, [selected.item.Pk_Inventario,selected.item.AnoStr])" style="display:none">
            <button class="btn btn-default" onclick="document.getElementById('btUpload').click()"
                    ng-show="root_usaProgContabilidade()===false" ng-disabled="estaGravar==true">
                Importar
            </button>-->
            <button class="btn btn-primary" ng-click="ok()" ng-disabled="estaGravar==true">Aplicar conta</button>
            <button class="btn btn-warning" ng-click="cancel()" ng-disabled="estaGravar==true">Fechar</button>
        </div>
    </div>
</div>