
<div class="col-md-14" ng-controller="ViewCashiersForTellerController">
    <div class="col-md-12">
    <ul class="breadcrumb">
        <li><a href="#/organization">{{'label.anchor.organization' | translate}}</a></li>
        <li><a href="#/tellers">{{'label.anchor.tellers' | translate}}</a></li>
        <li class="active">{{'label.anchor.cashiers' | translate}}</li>
    </ul>
    </div>

    <div class="col-md-12">
        {{'label.heading.cashmgmt.officeName' | translate}} : {{cashiersForTeller.officeName}} | 
        {{'label.heading.cashmgmt.tellerName' | translate }} : {{cashiersForTeller.tellerName}}
        <a href="#/tellers/{{cashiersForTeller.tellerId}}/createCashierForTeller" class="btn btn-primary pull-right" has-permission='CREATE_CASHIERS_FOR_TELLER'><i class="icon-plus icon-white"></i>
            {{'label.button.createcashier'| translate}}</a>
    </div>
    <div class="col-md-12">
    	<input ng-autofocus="true" ng-model="filterText" type="text" class="form-control span marginbottom0px"
           placeholder="{{'label.input.filterbynameexternalid' | translate}}">
        <table class="table">
            <thead>
            <tr class="graybg">
                <th>{{'label.heading.cashmgmt.tellerCashiers.period' | translate}}</th>
                <th>{{'label.heading.cashmgmt.tellerCashiers.cashierName' | translate}}</th>
                <th>{{'label.heading.cashmgmt.tellerCashiers.fullDayOrTime' | translate}}</th>
                <th colspan="3">{{'label.heading.cashmgmt.tellerCashiers.actions' | translate}}</th>
            </tr>
            </thead>
            <tbody>
            <tr class="pointer-main" ng-repeat="cashier in cashiersForTeller.cashiers | orderBy:'cashier.startDate':reverse | filter:filterText">
                <td class="pointer" data-ng-click="transactions(cashiersForTeller.tellerId, cashier.id)">
                    <div ng-if="compare(cashier.startDate,cashier.endDate)">
                        {{cashier.startDate | DateFormat}}
                    </div>
                    <div ng-if="!compare(cashier.startDate,cashier.endDate)">
                        {{cashier.startDate | DateFormat}} - {{cashier.endDate | DateFormat}}
                    </div>
                </td>  
                <td class="pointer" data-ng-click="transactions(cashiersForTeller.tellerId, cashier.id)">{{cashier.staffName}}</td>
                <td class="pointer" data-ng-click="transactions(cashiersForTeller.tellerId, cashier.id)">
                    <div ng-if="cashier.isFullDay == true">
                        {{'label.cashmgmt.cashier.isFullDay' | translate}}
                    </div>
                    <div ng-if="cashier.isFullDay == false">
                        {{cashier.startTime}} - {{cashier.endTime}}
                    </div>
                    
                </td>
                <td class="pointer">

                    <button id="transaction" tooltip="{{'label.button.viewtransaction' | translate}}"class="btn btn-info" has-permission='ALLOCATECASHIER_TELLER'
                            data-ng-click="transactions(cashiersForTeller.tellerId, cashier.id)">
                        <i class="icon-list-ol icon-small" data-ng-click=""></i>
                    </button>
                    
                    <button id="allocate" tooltip="{{'label.button.allocatecash' | translate}}" class="btn btn-success" has-permission='ALLOCATECASHIER_TELLER'
                            data-ng-click="allocate(cashiersForTeller.tellerId, cashier.id)">
                        <i class="icon-level-down icon-small">{{'label.cashmgmt.icontext.allocate' | translate}}</i>
                    </button>
                    <button id="settle" tooltip="{{'label.button.settlecash' | translate}}" class="btn btn-warning" has-permission='SETTLECASHIER_TELLER'
                            data-ng-click="settle(cashiersForTeller.tellerId, cashier.id)">
                        <i class="icon-level-up icon-small">{{'label.cashmgmt.icontext.settle' | translate}}</i>
                    </button>
                    <button id="view" tooltip="{{'label.button.view' | translate}}" class="btn btn-info"
                            ng-click="routeToView(cashiersForTeller.tellerId, cashier.id)">
                        <i class="icon-eye-open icon-small"></i>
                    </button>
                    <button id="delete" tooltip="{{'label.button.delete' | translate}}" class="btn btn-danger" has-permission='DELETECASHIER_TELLER'
                            ng-click="delete(cashiersForTeller.tellerId, cashier.id)">
                        <i class="icon-trash icon-small"></i>
                    </button>

                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
