@model MrCMS.Web.Apps.Ecommerce.Entities.Orders.Order
@{
    ViewBag.Title = "Edit Order Details";
}

<div class="row">
    <div class="col-lg-12">
        <fieldset>
            <legend>Order - #@Model.Id

                <span class="pull-right btn-group">
                    <a href="/Admin/Apps/Ecommerce/Order" class="btn btn-default">Back</a>
                    @if (!Model.IsCancelled)
                    {
                        @Html.ActionLink("Cancel Order", "Cancel", "Order", new { id = Model.Id }, new { @class = "btn btn-danger", data_toggle = "fb-modal" })
                    }
                    @Html.ActionLink("Delete", "Delete", "Order", new { id = Model.Id }, new { @class = "btn btn-danger", data_toggle = "fb-modal" })
                    <a href="@Url.Action("Create", "OrderInvoice", new { id = Model.Id })" class="btn btn-success">Invoice (PDF)</a>
                </span>

            </legend>
        </fieldset>
    </div>
</div>

@if (Model.IsCancelled)
{
    <div class="alert alert-danger">
        This order has been cancelled.
    </div>
}

@{Html.RenderPartial("OrderDetails", Model); }
@{Html.RenderPartial("OrderLines", Model);}
@{Html.RenderAction("Details","OrderRewardPoints", new{order=Model});}
@{Html.RenderPartial("OrderNotes", Model);}
