<div class="blade-content __medium-wide">
    <div class="blade-inner">
        <div class="inner-block">
            <div class="order-status" ng-if="blade.currentEntity.status">
                <div class="status" ng-bind="blade.currentEntity.status | settingTranslate:'Order.Status'"></div>
                <div class="reason" ng-bind="blade.currentEntity.cancelReason" ng-if="blade.currentEntity.isCancelled"></div>
            </div>
            <form name="formScope" class="form" ng-controller="virtoCommerce.orderModule.customerOrderDetailController">
                <fieldset ng-disabled="blade.isLocked">
                    <va-metaform registered-inputs="blade.metaFields" blade="blade" column-count="2" ng-init="setForm(formScope)"></va-metaform>
                </fieldset>
            </form>

            <va-widget-container group="customerOrderDetailWidgets" blade="blade" gridster-opts="{columns: 4}" ng-disabled="blade.isLocked"></va-widget-container>
        </div>
    </div>
</div>

<script type="text/ng-template" id="order-employeeSelector.html">
    <div class="form-input">
        <ui-scroll-drop-down data="blade.fetchEmployees(criteria)"
                             ng-model="blade.customerOrder.employeeId"
                             on-select="blade.customerOrder.employeeName = item.name"
                             on-remove="blade.customerOrder.employeeName = undefined"
                             placeholder="'orders.blades.customerOrder-detail.placeholders.employee'"
                             disabled="blade.isLocked">
        </ui-scroll-drop-down>
    </div>
</script>

<script type="text/ng-template" id="statusSelector.html">
    <va-setting-value-select blade="blade"
                             label="'orders.blades.customerOrder-detail.labels.status' | translate"
                             placeholder="'orders.blades.customerOrder-detail.placeholders.status' | translate"
                             setting="'Order.Status'"
                             ng-model="blade.currentEntity.status"
                             disabled="blade.isLocked"></va-setting-value-select>
</script>

<script type="text/ng-template" id="customerSelector.html">
    <div class="form-input">
        <label class="form-label" style="height:27px;">
            <a href="" ng-click="blade.openCustomerDetails()">{{ blade.currentEntity.customerName }}</a>
        </label>
    </div>
</script>

<script type="text/ng-template" id="organizationSelector.html">
  <div class="form-input">
    <label class="form-label" style="height:27px;">
      <a href="" ng-click="blade.openOrganizationDetails()">{{ blade.currentEntity.organizationName }}</a>
    </label>
  </div>
</script>

<script type="text/ng-template" id="discountAmount.html">
    <div class="form-input __currency">
        <span class="currency">{{blade.currentEntity.currency}}</span>
        <input money mask-money="!blade.isVisiblePrices" required ng-model="blade.currentEntity.discountAmount" ng-model-options="{ updateOn: 'blur' }" ng-change="blade.recalculate()" id="discountAmount" focus-on="discountAmount">
    </div>
</script>
<script type="text/ng-template" id="discountAmountWithTax.html">
    <div class="form-input __currency">
        <span class="currency">{{blade.currentEntity.currency}}</span>
        <input money mask-money="!blade.isVisiblePrices" required ng-model="blade.currentEntity.discountAmountWithTax" ng-model-options="{ updateOn: 'blur' }" ng-change="blade.recalculate()" id="discountAmountWithTax" focus-on="discountAmountWithTax">
    </div>
</script>

<script type="text/ng-template" id="storeSelector.html">
    <div class="form-input">
        <va-store-selector required ng-model="blade.currentEntity.storeId" placeholder="'orders.blades.customerOrder-detail.placeholders.store'" disabled="blade.isLocked"></va-store-selector>
    </div>
</script>
