292 lines
12 KiB
Plaintext
292 lines
12 KiB
Plaintext
@using EnVisage.Code
|
|
@model EnVisage.Models.ExpenditureCategoryModel
|
|
@{
|
|
ViewBag.Title = Model.Id != Guid.Empty ? "Edit " + Model.Name : "Add New Expenditure Category";
|
|
}
|
|
|
|
@section scripts
|
|
{
|
|
<script type="text/javascript">
|
|
emulateNavUrl = "/ExpenditureCategory";
|
|
</script>
|
|
|
|
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
init.push(function () {
|
|
|
|
@if (Model.Id != Guid.Empty)
|
|
{
|
|
<text>
|
|
StartEdit('ExpenditureCategory', '@Model.Id', "#btnDelete", "#btnsave", "erorMsgPlaceholder");
|
|
</text>
|
|
}
|
|
$(".datepicker").datepicker();
|
|
|
|
$('#btnsave').click(function () {
|
|
if ($(this).parents('form').valid())
|
|
blockUI();
|
|
});
|
|
});
|
|
</script>
|
|
|
|
|
|
}
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
if ('@Model.Id' != '@Guid.Empty') {
|
|
init.push(function () {
|
|
//loadRateList('@Model.Id');
|
|
|
|
if ('@Model.UseType' == "Fee") {
|
|
//loadFeeCalculationList('@Model.Id');
|
|
}
|
|
|
|
if ('@Model.UseType' == "Calculated") {
|
|
//loadCalculatesCategoryList('@Model.Id');
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
@*function loadRate(id) {
|
|
var url = "@Url.Action("LoadRate")?expenditureCategory=@Model.Id";
|
|
if (id != null)
|
|
url += "&rateId=" + id;
|
|
$('#rateTable').load(url, null, function () { $(".datepicker").datepicker(); });
|
|
}*@
|
|
|
|
@*function loadRateList(id) {
|
|
|
|
$('#rateTable').load("@Url.Action("LoadRateList")?expenditureCategoryId=" + id);
|
|
}*@
|
|
|
|
@*function loadDeleteRate(id) {
|
|
|
|
$('#rateTable').load("@Url.Action("DeleteRate")?rateId=" + id);
|
|
}*@
|
|
|
|
|
|
function loadFeeCalculation(id) {
|
|
var url = "@Url.Action("LoadFeeCalculation")?expenditureCategory=@Model.Id";
|
|
if (id != null)
|
|
url += "&rateId=" + id;
|
|
$('#feeCalculation').load(url);
|
|
|
|
@*$('#feeCalculation').load("@Url.Action("LoadFeeCalculation")?feeCalculationId=" + id + "&expenditureCategory=" + '@Model.Id');*@
|
|
}
|
|
|
|
function loadFeeCalculationList(id) {
|
|
|
|
$('#feeCalculation').load("@Url.Action("LoadFeeCalculationList")?expenditureCategoryId=" + id);
|
|
}
|
|
|
|
function loadDeleteFeeCalculation(id) {
|
|
|
|
$('#feeCalculation').load("@Url.Action("DeleteFeeCalculation")?feeCalculationId=" + id);
|
|
}
|
|
|
|
function loadCalculatesCategory(id) {
|
|
|
|
var url = "@Url.Action("LoadCalculatesCategory")?expenditureCategory=@Model.Id";
|
|
if (id != null)
|
|
url += "&rateId=" + id;
|
|
$('#calculatesCategories').load(url, null, function () { $(".datepicker").datepicker(); });
|
|
@*$('#calculatesCategories').load("@Url.Action("LoadCalculatesCategory")?calculatesCategoryId=" + id + "&expenditureCategory=" + '@Model.Id');*@
|
|
}
|
|
|
|
@* function loadCalculatesCategoryList(id) {
|
|
|
|
$('#calculatesCategories').load("@Url.Action("LoadCalculatesCategoryList")?expenditureCategoryId=" + id);
|
|
}
|
|
|
|
function loadDeleteCalculatesCategory(id) {
|
|
|
|
$('#calculatesCategories').load("@Url.Action("DeleteCalculatesCategory")?calculatesCategoryId=" + id);
|
|
}*@
|
|
|
|
|
|
</script>
|
|
|
|
<div id="erorMsgPlaceholder"></div>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-sm-12">
|
|
<ul id="uidemo-tabs-default-demo" class="nav nav-tabs">
|
|
<li class="active">
|
|
<a href="#general" data-toggle="tab">General<span class="badge badge-primary"></span></a>
|
|
</li>
|
|
@if (Model.UseType == EnVisage.Models.ExpenditureCategoryModel.UseTypes.Calculated && Model.Id != Guid.Empty)
|
|
{
|
|
|
|
<li>
|
|
<a href="#calculatesCategories" data-toggle="tab">Calculates Categories <span class=" badge badge-primary"></span></a>
|
|
</li>
|
|
|
|
}
|
|
else
|
|
{
|
|
<li class="disabled disabledTab">
|
|
<a> Calculates Categories<span class="badge badge-primary"></span></a>
|
|
</li>
|
|
}
|
|
|
|
@if (Model.UseType == EnVisage.Models.ExpenditureCategoryModel.UseTypes.Fee && Model.Id != Guid.Empty)
|
|
{
|
|
<li>
|
|
<a href="#feeCalculation" data-toggle="tab">Fee Calculation <span class="badge badge-primary"></span></a>
|
|
</li>
|
|
}
|
|
else
|
|
{
|
|
<li class="disabled disabledTab">
|
|
<a>Fee Calculation <span class="badge badge-primary"></span></a>
|
|
</li>
|
|
}
|
|
|
|
@if (Model.Id == Guid.Empty)
|
|
{
|
|
<li class="disabled disabledTab">
|
|
<a>Rate<span class="badge badge-primary"></span></a>
|
|
</li>
|
|
}
|
|
else
|
|
{
|
|
<li>
|
|
<a href="#rateTable" data-toggle="tab">Rate<span class="badge badge-primary"></span></a>
|
|
</li>
|
|
}
|
|
|
|
</ul>
|
|
|
|
<div class="tab-content tab-content-bordered">
|
|
<div class="tab-pane fade in active" id="general">
|
|
@using (Html.BeginForm())
|
|
{
|
|
@Html.AntiForgeryToken()
|
|
|
|
if (Model.Id != Guid.Empty)
|
|
{
|
|
@Html.HiddenFor(t => t.ExpenditureId)
|
|
@Html.HiddenFor(t => t.UseType)
|
|
}
|
|
<div class="form-horizontal">
|
|
@Html.ValidationSummary(true)
|
|
@Html.HiddenFor(model => model.Id)
|
|
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.ExpenditureId, "Expenditure", new { @class = "control-label col-sm-2 disabled" })
|
|
<div class="col-sm-10">
|
|
@if (Model.Id == Guid.Empty)
|
|
{
|
|
@Html.DropDownListFor(model => model.ExpenditureId, Utils.GetExpenditures(), new { @class = "form-control" })
|
|
}
|
|
else
|
|
{
|
|
@Html.DropDownListFor(model => model.ExpenditureId, Utils.GetExpenditures(), new { @class = "form-control disabled", @disabled = "disabled" })
|
|
}
|
|
@Html.ValidationMessageFor(model => model.ExpenditureId)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.GLId, "GL Account Name", new { @class = "control-label col-sm-2" })
|
|
<div class="col-sm-10">
|
|
@Html.DropDownListFor(model => model.GLId, Utils.GetGLAccounts(), new { @class = "form-control disabled" })
|
|
@Html.ValidationMessageFor(model => model.GLId)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.UOMId, new { @class = "control-label col-sm-2" })
|
|
<div class="col-sm-10">
|
|
@Html.DropDownListFor(model => model.UOMId, Utils.GetUnitsOfMeasure(), new { @class = "form-control disabled" })
|
|
@Html.ValidationMessageFor(model => model.UOMId)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.CreditId, new { @class = "control-label col-sm-2" })
|
|
<div class="col-sm-10">
|
|
@Html.DropDownListFor(model => model.CreditId, Utils.GetCreditDepartments(), new { @class = "form-control disabled" })
|
|
@Html.ValidationMessageFor(model => model.CreditId)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.Type, "Category Type", new { @class = "control-label col-sm-2" })
|
|
<div class="col-sm-10">
|
|
@Html.DropDownListFor(model => model.Type, Utils.GetCategoryTypes(), new { @class = "form-control disabled" })
|
|
@Html.ValidationMessageFor(model => model.Type)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.UseType, "Usage", new { @class = "control-label col-sm-2" })
|
|
<div class="col-sm-10">
|
|
@if (Model.Id == Guid.Empty)
|
|
{
|
|
@Html.DropDownListFor(model => model.UseType, Utils.GetUseTypes(), new { @class = "form-control" })
|
|
}
|
|
else
|
|
{
|
|
@Html.DropDownListFor(model => model.UseType, Utils.GetUseTypes(), new { @class = "form-control", @disabled = "disabled" })
|
|
}
|
|
@Html.ValidationMessageFor(model => model.UseType)
|
|
</div>
|
|
</div>
|
|
|
|
@* <div class="form-group">
|
|
@Html.LabelFor(model => model.CGEFX, "CGEFX", new { @class = "control-label col-sm-2" })
|
|
<div class="col-sm-10">
|
|
@Html.DropDownListFor(model => model.CGEFX, Utils.GetCGEFX(), new { @class = "form-control disabled" })
|
|
@Html.ValidationMessageFor(model => model.CGEFX)
|
|
</div>
|
|
</div>*@
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.SystemAttributeOne, "System Attribute One", new { @class = "control-label col-sm-2" })
|
|
<div class="col-sm-10">
|
|
@Html.DropDownListFor(model => model.SystemAttributeOne, Utils.GetSystemAttributeOne(), new { @class = "form-control disabled" })
|
|
@Html.ValidationMessageFor(model => model.SystemAttributeOne)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
@Html.LabelFor(model => model.WksSubjectToFee, new { @class = "control-label col-md-2" })
|
|
<div class="col-md-10">
|
|
@Html.TextBoxFor(model => model.WksSubjectToFee)
|
|
@Html.ValidationMessageFor(model => model.WksSubjectToFee)
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="col-md-offset-2 col-md-10">
|
|
<a class="btn btn-primary" href="@Url.Action("Index", "ExpenditureCategory")"><i class="fa fa-backward"></i> Back to list</a>
|
|
<button type="submit" class="btn btn-success" id="btnsave"><i class="fa fa-save"></i> Save</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="tab-pane fade" id="calculatesCategories">
|
|
@{ Html.RenderPartial("_calculatesContainer", Model.CalculatesCategories);}
|
|
</div>
|
|
<div class="tab-pane fade" id="feeCalculation">
|
|
@{ Html.RenderPartial("_feesContainer", Model.Fees);}
|
|
</div>
|
|
<div class="tab-pane fade" id="rateTable">
|
|
@{ Html.RenderPartial("_ratesContainer", Model.Rates);}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|