<div class="content-container" ng-controller="EditFinancialActivityMappingController">
    <ul class="breadcrumb">
        <li><a href="#/accounting">{{'label.anchor.accounting' | translate}}</a></li>
        <li><a href="#/financialactivityaccountmappings">{{'label.anchor.financialactivity.accountmappings' | translate}}</a></li>
        <li><a href="#/viewfinancialactivitymapping/{{mapping.id}}">{{'label.anchor.viewfinancialmapping' | translate}}</a></li>
        <li class="active">{{'label.anchor.editfinancialmapping' | translate}}</li>
    </ul>
    <div class="card">
        <div class="content">
            <div class="toolbar">
                <h4>{{'label.heading.edit.financial.activity.mapping' | translate}}</h4>
            </div>
            <br/>
            <form name="editfinancialmappingform" novalidate="" class="form-horizontal" rc-submit="submit()">
                <api-validate></api-validate>
                <fieldset>
                    <div class="form-group">
                        <label class="control-label col-sm-2">{{'label.input.financial.activity.type' | translate}}<span
                                class="required">*</span></label>

                        <div class="col-sm-3">
                            <select id="financialActivityId" ng-model="formData.financialActivityId" class="form-control"
                                    ng-options="activityOption.id as activityOption.name  | translate for activityOption in financialActivityOptions"
                                    value="{{activityOption.id}}"
                                    ng-change="updateActivityOptions(formData.financialActivityId)">
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="control-label col-sm-2">{{'label.input.account' | translate}}<span
                                class="required">*</span></label>

                        <div class="col-sm-3">
                            <select chosen="accountOptions" id="glAccountId" ng-model="formData.glAccountId"
                                    class="form-control"
                                    ng-options="account.id as (account.name +'('+ account.glCode +')') for account in accountOptions"
                                    value="{{account.id}}">
                            </select>
                        </div>
                    </div>

                    <div class="col-md-offset-2">
                        <a id="cancel" href="#/viewfinancialactivitymapping/{{mapping.id}}" class="btn btn-default">{{'label.button.cancel'
                            | translate}}</a>
                        <button id="save" type="submit" class="btn btn-primary" has-permission='UPDATE_FINANCIALACTIVITYACCOUNT'>
                            {{'label.button.save' | translate}}
                        </button>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
</div>