@using EnVisage.Code @using EnVisage.Code.HtmlHelpers @using EnVisage.Models @using EnVisage.Code.Cache @model ScenarioDetailModel @{ // need to init angular header controller var json = Newtonsoft.Json.JsonConvert.SerializeObject(new { id = Model.Id, name = Model.Name, parentId = Model.ParentId, templateId = Model.TemplateId.Equals(Guid.Empty) ? (Guid?)null : Model.TemplateId, startDate = (Model.StartDate ?? DateTime.Today).ToString("MM/dd/yyyy"), endDate = (Model.EndDate ?? DateTime.Today).ToString("MM/dd/yyyy"), growthScenario = Model.GrowthScenario, expense = Model.TDDirectCosts, revenue = Model.ProjectedRevenue, useLMMargin = Model.UseLMMargin, grossMargin = Model.GrossMargin ?? 0, lmMargin = Model.LMMargin ?? 0, isActiveScenario = Model.IsActiveScenario, duration = Model.Duration, dateForStartOfChanges = Model.DateForStartOfChanges.HasValue ? Model.DateForStartOfChanges.Value.ToString("MM/dd/yyyy") : string.Empty, activeTab = Model.ActiveTab }); } @{ ViewBag.Title = ((!string.IsNullOrEmpty(Model.PartName)) ? Model.PartName + ": " : "") + Model.ProjectName + " " + "Scenario Details"; } @section stylesheets { } @section Scripts { @Scripts.Render("~/bundles/angular-app-modules") }
@Html.HiddenFor(t => t.Id) @Html.HiddenFor(t => t.ParentId) @Html.HiddenFor(t => t.BackUrl) @Html.HiddenFor(t => t.BackName)
Scenario Information @Html.CheckBoxFor(model => model.IsActiveScenario, new { @class = "form-control", @ng_model = "changedData.isActiveScenario", @ng_change = "modelChanged()" })
@Html.LabelFor(model => model.ProjectName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.ProjectName, new { @class = "form-control", @disabled = "disabled" })
@if (!string.IsNullOrWhiteSpace(Model.PartName)) {
@Html.LabelFor(model => model.PartName, new { @class = "control-label" }) @Html.TextBoxFor(model => model.PartName, new { @class = "form-control", @disabled = "disabled" })
}
@Html.LabelFor(model => model.Name, new { @class = "control-label" }) @Html.TextBoxFor(model => model.Name, new { @class = "form-control", @ng_model = "changedData.name", @ng_change = "modelChanged()" }) @Html.ValidationMessageFor(model => model.Name)
@* env-716 start *@
@Html.TextBoxFor(x => x.StartDate, "{0:MM/dd/yyyy}", new { @class = "form-control", @ng_model = "changedData.startDate", @ng_change = string.Format("refreshDuration('{0}')", Url.Action("CalculateScenarioDuration", "Scenarios")) })
To
@Html.TextBoxFor(x => x.EndDate, "{0:MM/dd/yyyy}", new { @class = "form-control", @ng_model = "changedData.endDate", @ng_change = string.Format("refreshDuration('{0}')", Url.Action("CalculateScenarioDuration", "Scenarios")) })
@*
@Html.TextBoxFor(x => x.StartDate, "{0:MM/dd/yyyy}", new { @class = "form-control", @ng_model = "changedData.startDate", @ng_change = string.Format("refreshDuration('{0}')", Url.Action("CalculateScenarioDuration", "Scenarios")) }) to @Html.TextBoxFor(x => x.EndDate, "{0:MM/dd/yyyy}", new { @class = "form-control", @ng_model = "changedData.endDate", @ng_change = string.Format("refreshDuration('{0}')", Url.Action("CalculateScenarioDuration", "Scenarios")) })
env-716 end *@ @Html.ValidationMessageFor(model => model.StartDate) @Html.ValidationMessageFor(model => model.EndDate) @if (Model.ProjectDeadline.HasValue) { (@Html.LabelFor(x => x.ProjectDeadline) @Html.DisplayFor(x => x.ProjectDeadline)) }
@Html.LabelFor(x => x.TemplateId, new { @class = "control-label" }) @Html.ValidationMessageFor(x => x.TemplateId)
@Html.LabelFor(x => x.Duration, new { @class = "control-label" }) @Html.TextBoxFor(x => x.Duration, new { @disabled = "disabled", @class = "form-control", @ng_model = "changedData.duration" })
Financials
@Html.LabelFor(x => x.DateForStartOfChanges, new { @class = "control-label" }) @Html.EditorFor(x => x.DateForStartOfChanges, new { htmlAttributes = new { @class = "form-control date", @ng_model = "changedData.dateForStartOfChanges", @ng_change = "modelChanged()", @ng_disabled = "!isFinancialAdjusted()" } }) @Html.ValidationMessageFor(x => x.DateForStartOfChanges)
@* Expenditures will be here *@
@if (Model.IsRevenueGenerating) {
Revenue
@Html.LabelFor(x => x.ProjectedRevenue, new { @class = "control-label" })
$ @Html.EditorFor(model => model.ProjectedRevenue, new { htmlAttributes = new { @class = "form-control", @ng_model = "changedData.revenue", @ng_change = "projectedRevenueChanged(changedData.revenue)", @ng_disabled = "!isFinancialAdjusted()" } })
(${{changedData.oldRevenue}}) @Html.ValidationMessageFor(model => model.ProjectedRevenue)
@Html.LabelFor(x => x.RevenueAfterCost, new { @class = "control-label" })
$ @Html.TextBoxFor(x => x.RevenueAfterCost, "{0:0}", new { @disabled = "disabled", @class = "form-control" })
@Html.LabelFor(x => x.ActualRevenueAfterCost, new { @class = "control-label" })
$ @Html.TextBoxFor(x => x.ActualRevenueAfterCost, "{0:0}", new { @disabled = "disabled", @class = "form-control" })
% @Html.TextBoxFor(x => x.GrossMargin, new { @class = "form-control", @ng_model = "changedData.grossMargin", @ng_change = "marginChanged(changedData.grossMargin)", @ng_disabled = "!isFinancialAdjusted()", @ng_show = "!changedData.useLMMargin" }) @Html.TextBoxFor(x => x.LMMargin, new { @class = "form-control", @ng_model = "changedData.lmMargin", @ng_change = "marginChanged(changedData.lmMargin)", @ng_disabled = "!isFinancialAdjusted()", @ng_show = "changedData.useLMMargin" }) @Html.CheckBoxFor(x => x.UseLMMargin, new { @class = "form-control", @ng_model = "changedData.useLMMargin", @ng_change = "marginTypeChanged(changedData.useLMMargin)" }) @(Model.UseLMMargin ? "L&M" : "Gross")
({{changedData.oldGrossMargin}}%) ({{changedData.oldLMMargin}}%)
% @Html.TextBoxFor(x => x.CalculatedGrossMargin, new { @class = "form-control", @disabled = "disabled", @ng_show = "!changedData.useLMMargin" }) @Html.TextBoxFor(x => x.CalculatedGrossMarginLM, new { @class = "form-control", @disabled = "disabled", @ng_show = "changedData.useLMMargin" })
% @Html.TextBoxFor(x => x.CalculatedGrossMarginActuals, new { @class = "form-control", @disabled = "disabled", @ng_show = "!changedData.useLMMargin" }) @Html.TextBoxFor(x => x.CalculatedGrossMarginLMActuals, new { @class = "form-control", @disabled = "disabled", @ng_show = "changedData.useLMMargin" })
}
Expenses
@Html.LabelFor(x => x.TDDirectCosts, new { @class = "control-label" })
$ @Html.TextBoxFor(model => model.TDDirectCosts, new { @class = "form-control", @ng_model = "changedData.expense", @ng_change = "modelChanged()", @ng_disabled = Model.IsRevenueGenerating ? "true" : "!isFinancialAdjusted()" })
(${{changedData.oldExpense}}) @Html.ValidationMessageFor(model => model.TDDirectCosts)
@Html.LabelFor(x => x.BUDirectCosts, new { @class = "control-label" })
$ @Html.TextBoxFor(x => x.BUDirectCosts, new { @disabled = "disabled", @class = "form-control" })
@Html.LabelFor(x => x.ActualLabor, new { @class = "control-label" })
$ @Html.TextBoxFor(x => x.ActualLabor, new { @disabled = "disabled", @class = "form-control" })
@Html.LabelFor(x => x.LaborMaterialsSplit, new { @class = "control-label" })
% @Html.TextBoxFor(model => model.LaborMaterialsSplit, new { @class = "form-control", @disabled = "disabled" })
@Html.LabelFor(x => x.ActualLaborMaterialsSplit, new { @class = "control-label" })
% @Html.TextBoxFor(x => x.ActualLaborMaterialsSplit, new { @disabled = "disabled", @class = "form-control" })
@Html.LabelFor(x => x.ActualMaterials, new { @class = "control-label" })
$ @Html.TextBoxFor(x => x.ActualMaterials, new { @disabled = "disabled", @class = "form-control" })
Cost Savings
@Html.EditorFor(x => x.CostSaving)
@Html.Partial("_finInfoChart")
@Html.ValidationSummary(false, "The Scenario could not be saved due to the following errors:", new { id = "header-val-summary" })
@* SA. ENV-707. For the following line HREF and button title where corrected to use backUrl and backName parameters *@ Back to @Model.BackName @* Adjust Margin*@
@{ var user = (new UsersCache()).Value.FirstOrDefault(x => x.Id == new Guid(User.Identity.GetID())); var detailsModel = (new ScenarioDetailsCalendarModel(Model, user, ScenarioDetailsCalendarModel.ScenarioCalendarOpener.Details)); Html.RenderPartial("_scenarioCalendar", detailsModel); }
@Html.Partial("_rates", Model.RatesModel)
@Html.Partial("_notes", Model.Id)