Update: Support Ajax and Form Post for Finance
This commit is contained in:
@@ -121,6 +121,17 @@ namespace Disco.BI.Extensions
|
||||
{
|
||||
return d.ToBinary();
|
||||
}
|
||||
public static string ToJavascriptDateTime(this DateTime d)
|
||||
{
|
||||
return d.ToString("yyyy/MM/dd hh:mm tt");
|
||||
}
|
||||
public static string ToJavascriptDateTime(this DateTime? d)
|
||||
{
|
||||
if (d.HasValue)
|
||||
return d.Value.ToString("yyyy/MM/dd hh:mm tt");
|
||||
else
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Image Extensions
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyFileVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyVersion("1.2.0326.1428")]
|
||||
[assembly: AssemblyFileVersion("1.2.0326.1428")]
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0319.1533")]
|
||||
[assembly: AssemblyFileVersion("1.2.0319.1533")]
|
||||
[assembly: AssemblyVersion("1.2.0326.1427")]
|
||||
[assembly: AssemblyFileVersion("1.2.0326.1427")]
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0319.1533")]
|
||||
[assembly: AssemblyFileVersion("1.2.0319.1533")]
|
||||
[assembly: AssemblyVersion("1.2.0326.1427")]
|
||||
[assembly: AssemblyFileVersion("1.2.0326.1427")]
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyFileVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyVersion("1.2.0326.1428")]
|
||||
[assembly: AssemblyFileVersion("1.2.0326.1428")]
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyFileVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyVersion("1.2.0326.1428")]
|
||||
[assembly: AssemblyFileVersion("1.2.0326.1428")]
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyFileVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyVersion("1.2.0326.1428")]
|
||||
[assembly: AssemblyFileVersion("1.2.0326.1428")]
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_BuildAction="ReBuild" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="True" BuildVersion_StartDate="2001/1/1" />
|
||||
<UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_UseGlobalSettings="True" BuildVersion_DetectChanges="False" BuildVersion_BuildAction="ReBuild" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyFileVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyVersion("1.2.0326.1428")]
|
||||
[assembly: AssemblyFileVersion("1.2.0326.1428")]
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
@using System.Web.Mvc
|
||||
@using System.Web.Mvc.Html;
|
||||
@using Disco.Web.Extensions;
|
||||
@helper FriendlyDate(DateTime d)
|
||||
@helper FriendlyDate(DateTime d, string ElementId = null)
|
||||
{
|
||||
<span title="@d.ToFullDateTime()" data-discodatetime="@d.ToSortableDateTime()" class="date nowrap">@d.ToFuzzy()</span>
|
||||
<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime()" data-discodatetime="@d.ToSortableDateTime()" data-datetimeformatted="@d.ToJavascriptDateTime()" class="date nowrap">@d.ToFuzzy()</span>
|
||||
}
|
||||
@helper FriendlyDate(DateTime? d, string NullValue = "N/A")
|
||||
@helper FriendlyDate(DateTime? d, string NullValue = "N/A", string ElementId = null)
|
||||
{
|
||||
<span title="@d.ToFullDateTime(NullValue)" data-discodatetime="@d.ToSortableDateTime()" class="date nowrap">@d.ToFuzzy(NullValue)</span>
|
||||
<span @(ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)))title="@d.ToFullDateTime(NullValue)" data-discodatetime="@d.ToSortableDateTime()" data-datetimeformatted="@d.ToJavascriptDateTime()" class="date nowrap">@d.ToFuzzy(NullValue)</span>
|
||||
}
|
||||
@helper RadioButtonList(string id, List<System.Web.Mvc.SelectListItem> items, int columns = 1)
|
||||
{
|
||||
|
||||
@@ -60,11 +60,11 @@ namespace Disco.Web
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.4.0")]
|
||||
public class CommonHelpers : System.Web.WebPages.HelperPage
|
||||
{
|
||||
|
||||
public static System.Web.WebPages.HelperResult FriendlyDate(DateTime d)
|
||||
public static System.Web.WebPages.HelperResult FriendlyDate(DateTime d, string ElementId = null)
|
||||
{
|
||||
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
@@ -76,12 +76,22 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteralTo(@__razor_helper_writer, " <span title=\"");
|
||||
WriteLiteralTo(@__razor_helper_writer, " <span ");
|
||||
|
||||
|
||||
|
||||
#line 10 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToFullDateTime());
|
||||
WriteTo(@__razor_helper_writer, ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteralTo(@__razor_helper_writer, "title=\"");
|
||||
|
||||
|
||||
|
||||
#line 10 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToFullDateTime());
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -91,7 +101,17 @@ WriteLiteralTo(@__razor_helper_writer, "\" data-discodatetime=\"");
|
||||
|
||||
|
||||
#line 10 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToSortableDateTime());
|
||||
WriteTo(@__razor_helper_writer, d.ToSortableDateTime());
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteralTo(@__razor_helper_writer, "\" data-datetimeformatted=\"");
|
||||
|
||||
|
||||
|
||||
#line 10 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToJavascriptDateTime());
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -101,7 +121,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" class=\"date nowrap\">");
|
||||
|
||||
|
||||
#line 10 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToFuzzy());
|
||||
WriteTo(@__razor_helper_writer, d.ToFuzzy());
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -120,7 +140,7 @@ WriteLiteralTo(@__razor_helper_writer, "</span>\r\n");
|
||||
}
|
||||
|
||||
|
||||
public static System.Web.WebPages.HelperResult FriendlyDate(DateTime? d, string NullValue = "N/A")
|
||||
public static System.Web.WebPages.HelperResult FriendlyDate(DateTime? d, string NullValue = "N/A", string ElementId = null)
|
||||
{
|
||||
return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
|
||||
@@ -132,12 +152,22 @@ return new System.Web.WebPages.HelperResult(__razor_helper_writer => {
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteralTo(@__razor_helper_writer, " <span title=\"");
|
||||
WriteLiteralTo(@__razor_helper_writer, " <span ");
|
||||
|
||||
|
||||
|
||||
#line 14 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToFullDateTime(NullValue));
|
||||
WriteTo(@__razor_helper_writer, ElementId == null ? null : new HtmlString(string.Format("id=\"{0}\" ", ElementId)));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteralTo(@__razor_helper_writer, "title=\"");
|
||||
|
||||
|
||||
|
||||
#line 14 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToFullDateTime(NullValue));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -147,7 +177,17 @@ WriteLiteralTo(@__razor_helper_writer, "\" data-discodatetime=\"");
|
||||
|
||||
|
||||
#line 14 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToSortableDateTime());
|
||||
WriteTo(@__razor_helper_writer, d.ToSortableDateTime());
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
WriteLiteralTo(@__razor_helper_writer, "\" data-datetimeformatted=\"");
|
||||
|
||||
|
||||
|
||||
#line 14 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToJavascriptDateTime());
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -157,7 +197,7 @@ WriteLiteralTo(@__razor_helper_writer, "\" class=\"date nowrap\">");
|
||||
|
||||
|
||||
#line 14 "..\..\App_Code\CommonHelpers.cshtml"
|
||||
WriteTo(@__razor_helper_writer, d.ToFuzzy(NullValue));
|
||||
WriteTo(@__razor_helper_writer, d.ToFuzzy(NullValue));
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
@@ -56,6 +56,14 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
const string pWarrantyExternalReference = "warrantyexternalreference";
|
||||
const string pWarrantyExternalCompletedDate = "warrantyexternalcompleteddate";
|
||||
|
||||
const string pJobDetailsTabResources = "jobDetailTab-Resources";
|
||||
const string pJobDetailsTabComponents = "jobDetailTab-Components";
|
||||
const string pJobDetailsTabNonWarrantyFinance = "jobDetailTab-NonWarrantyFinance";
|
||||
const string pJobDetailsTabNonWarrantyRepairs = "jobDetailTab-NonWarrantyRepairs";
|
||||
const string pJobDetailsTabNonWarrantyInsurance = "jobDetailTab-NonWarrantyInsurance";
|
||||
const string pJobDetailsTabWarranty = "jobDetailTab-Warranty";
|
||||
const string pJobDetailsTabFlags = "jobDetailTab-Flags";
|
||||
|
||||
#endregion
|
||||
|
||||
public virtual ActionResult Update(int id, string key, string value = null, Nullable<bool> redirect = null)
|
||||
@@ -71,6 +79,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
var job = dbContext.Jobs.Find(id);
|
||||
|
||||
object resultData = null;
|
||||
string resultUrlFragment = null;
|
||||
|
||||
if (job != null)
|
||||
{
|
||||
@@ -84,105 +93,139 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
break;
|
||||
case pFlags:
|
||||
UpdateFlags(job, value);
|
||||
resultUrlFragment = pJobDetailsTabFlags;
|
||||
break;
|
||||
case pNonWarrantyAccountingChargeRequired:
|
||||
resultData = UpdateNonWarrantyAccountingChargeRequired(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
|
||||
break;
|
||||
case pNonWarrantyAccountingChargeAdded:
|
||||
resultData = UpdateNonWarrantyAccountingChargeAdded(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
|
||||
break;
|
||||
case pNonWarrantyAccountingChargePaid:
|
||||
resultData = UpdateNonWarrantyAccountingChargePaid(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
|
||||
break;
|
||||
case pNonWarrantyPurchaseOrderRaised:
|
||||
resultData = UpdateNonWarrantyPurchaseOrderRaised(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
|
||||
break;
|
||||
case pNonWarrantyPurchaseOrderReference:
|
||||
UpdateNonWarrantyPurchaseOrderReference(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
|
||||
break;
|
||||
case pNonWarrantyPurchaseOrderSent:
|
||||
resultData = UpdateNonWarrantyPurchaseOrderSent(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
|
||||
break;
|
||||
case pNonWarrantyInvoiceReceived:
|
||||
resultData = UpdateNonWarrantyInvoiceReceived(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyFinance;
|
||||
break;
|
||||
case pNonWarrantyRepairerName:
|
||||
UpdateNonWarrantyRepairerName(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyRepairs;
|
||||
break;
|
||||
case pNonWarrantyRepairerLoggedDate:
|
||||
UpdateNonWarrantyRepairerLoggedDate(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyRepairs;
|
||||
break;
|
||||
case pNonWarrantyRepairerReference:
|
||||
UpdateNonWarrantyRepairerReference(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyRepairs;
|
||||
break;
|
||||
case pNonWarrantyRepairerCompletedDate:
|
||||
UpdateNonWarrantyRepairerCompletedDate(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyRepairs;
|
||||
break;
|
||||
case pNonWarrantyIsInsuranceClaim:
|
||||
UpdateNonWarrantyIsInsuranceClaim(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceLossOrDamageDate:
|
||||
UpdateInsuranceLossOrDamageDate(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceEventLocation:
|
||||
UpdateInsuranceEventLocation(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceDescription:
|
||||
UpdateInsuranceDescription(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceThirdPartyCaused:
|
||||
UpdateInsuranceThirdPartyCaused(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceThirdPartyCausedName:
|
||||
UpdateInsuranceThirdPartyCausedName(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceThirdPartyCausedWhy:
|
||||
UpdateInsuranceThirdPartyCausedWhy(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceWitnessesNamesAddresses:
|
||||
UpdateInsuranceWitnessesNamesAddresses(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceBurglaryTheftMethodOfEntry:
|
||||
UpdateInsuranceBurglaryTheftMethodOfEntry(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsurancePropertyLastSeenDate:
|
||||
UpdateInsurancePropertyLastSeenDate(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsurancePoliceNotified:
|
||||
UpdateInsurancePoliceNotified(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsurancePoliceNotifiedStation:
|
||||
UpdateInsurancePoliceNotifiedStation(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsurancePoliceNotifiedDate:
|
||||
UpdateInsurancePoliceNotifiedDate(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsurancePoliceNotifiedCrimeReportNo:
|
||||
UpdateInsurancePoliceNotifiedCrimeReportNo(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceRecoverReduceAction:
|
||||
UpdateInsuranceRecoverReduceAction(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceOtherInterestedParties:
|
||||
UpdateInsuranceOtherInterestedParties(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceDateOfPurchase:
|
||||
UpdateInsuranceDateOfPurchase(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pInsuranceClaimFormSentDate:
|
||||
resultData = UpdateInsuranceClaimFormSentDate(job, value);
|
||||
resultUrlFragment = pJobDetailsTabNonWarrantyInsurance;
|
||||
break;
|
||||
case pWarrantyExternalName:
|
||||
UpdateWarrantyExternalName(job, value);
|
||||
resultUrlFragment = pJobDetailsTabWarranty;
|
||||
break;
|
||||
case pWarrantyExternalLoggedDate:
|
||||
UpdateWarrantyExternalLoggedDate(job, value);
|
||||
resultUrlFragment = pJobDetailsTabWarranty;
|
||||
break;
|
||||
case pWarrantyExternalReference:
|
||||
UpdateWarrantyExternalReference(job, value);
|
||||
resultUrlFragment = pJobDetailsTabWarranty;
|
||||
break;
|
||||
case pWarrantyExternalCompletedDate:
|
||||
UpdateWarrantyExternalCompletedDate(job, value);
|
||||
resultUrlFragment = pJobDetailsTabWarranty;
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Invalid Update Key");
|
||||
@@ -193,7 +236,8 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
throw new Exception("Invalid Job Id");
|
||||
}
|
||||
if (redirect.HasValue && redirect.Value)
|
||||
return RedirectToAction(MVC.Job.Show(job.Id));
|
||||
return this.RedirectToAction(MVC.Job.Show(job.Id), resultUrlFragment);
|
||||
//return RedirectToAction(MVC.Job.Show(job.Id));
|
||||
else
|
||||
{
|
||||
if (resultData != null)
|
||||
@@ -539,7 +583,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
Id = job.Id,
|
||||
Result = "OK",
|
||||
UserDescription = DiscoApplication.CurrentUser.ToString()
|
||||
};
|
||||
}.SetDateTime(job.JobMetaNonWarranty.AccountingChargeRequiredDate);
|
||||
}
|
||||
private Models.Job._DateChangeModel UpdateNonWarrantyAccountingChargeAdded(Job job, string AccountingChargeAddedDate)
|
||||
{
|
||||
@@ -574,7 +618,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
Id = job.Id,
|
||||
Result = "OK",
|
||||
UserDescription = DiscoApplication.CurrentUser.ToString()
|
||||
};
|
||||
}.SetDateTime(job.JobMetaNonWarranty.AccountingChargeAddedDate);
|
||||
}
|
||||
private Models.Job._DateChangeModel UpdateNonWarrantyAccountingChargePaid(Job job, string AccountingChargePaidDate)
|
||||
{
|
||||
@@ -609,7 +653,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
Id = job.Id,
|
||||
Result = "OK",
|
||||
UserDescription = DiscoApplication.CurrentUser.ToString()
|
||||
};
|
||||
}.SetDateTime(job.JobMetaNonWarranty.AccountingChargePaidDate);
|
||||
}
|
||||
private Models.Job._DateChangeModel UpdateNonWarrantyPurchaseOrderRaised(Job job, string PurchaseOrderRaisedDate)
|
||||
{
|
||||
@@ -643,7 +687,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
Id = job.Id,
|
||||
Result = "OK",
|
||||
UserDescription = DiscoApplication.CurrentUser.ToString()
|
||||
};
|
||||
}.SetDateTime(job.JobMetaNonWarranty.PurchaseOrderRaisedDate);
|
||||
}
|
||||
private void UpdateNonWarrantyPurchaseOrderReference(Job job, string PurchaseOrderReference)
|
||||
{
|
||||
@@ -686,7 +730,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
Id = job.Id,
|
||||
Result = "OK",
|
||||
UserDescription = DiscoApplication.CurrentUser.ToString()
|
||||
};
|
||||
}.SetDateTime(job.JobMetaNonWarranty.PurchaseOrderSentDate);
|
||||
}
|
||||
private Models.Job._DateChangeModel UpdateNonWarrantyInvoiceReceived(Job job, string InvoiceReceivedDate)
|
||||
{
|
||||
@@ -720,7 +764,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
Id = job.Id,
|
||||
Result = "OK",
|
||||
UserDescription = DiscoApplication.CurrentUser.ToString()
|
||||
};
|
||||
}.SetDateTime(job.JobMetaNonWarranty.InvoiceReceivedDate);
|
||||
}
|
||||
|
||||
private void UpdateNonWarrantyRepairerName(Job job, string RepairerName)
|
||||
@@ -869,7 +913,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
Id = job.Id,
|
||||
Result = "OK",
|
||||
UserDescription = DiscoApplication.CurrentUser.ToString()
|
||||
};
|
||||
}.SetDateTime(job.JobMetaInsurance.ClaimFormSentDate);
|
||||
}
|
||||
|
||||
private void UpdateInsuranceDateOfPurchase(Job job, string DateOfPurchase)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Disco.BI.Extensions;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Job
|
||||
{
|
||||
@@ -10,5 +11,19 @@ namespace Disco.Web.Areas.API.Models.Job
|
||||
public int Id { get; set; }
|
||||
public string Result { get; set; }
|
||||
public string UserDescription { get; set; }
|
||||
public string DateTimeFull { get; set; }
|
||||
public string DateTimeFriendly { get; set; }
|
||||
public string DateTimeJavascript { get; set; }
|
||||
public long DateTimeSortable { get; set; }
|
||||
|
||||
public _DateChangeModel SetDateTime(DateTime? date)
|
||||
{
|
||||
this.DateTimeFriendly = date.ToFuzzy(null);
|
||||
this.DateTimeJavascript = date.ToJavascriptDateTime();
|
||||
this.DateTimeSortable = date.ToSortableDateTime();
|
||||
this.DateTimeFull = date.ToFullDateTime(null);
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
/*#source /ClientSource/Style/jQueryUI/jquery-ui.css */
|
||||
/*! jQuery UI - v1.10.1 - 2013-02-18
|
||||
/*! jQuery UI - v1.10.1 - 2013-02-18
|
||||
* http://jqueryui.com
|
||||
* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
|
||||
* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px
|
||||
@@ -1175,7 +1174,6 @@ body .ui-tooltip {
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
/*#source /ClientSource/Style/Site.css */
|
||||
.tableData {
|
||||
border: solid 1px #e8eef4;
|
||||
border-collapse: collapse;
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,5 +1,4 @@
|
||||
/*#source /ClientSource/Style/Timeline/graphics.css */
|
||||
div.simileAjax-bubble-container {
|
||||
div.simileAjax-bubble-container {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
border: none;
|
||||
@@ -171,7 +170,6 @@ div.simileAjax-bubble-close {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAB1UlEQVQ4y72Tu4saURjFhW23TRvIH7BtIH9AIKW1iCBiQE3hAyG6qIgBRXwERWRQUSMpdH2gDoiigvgMTCHiA8VH5btJFQgsnL13IGlmk2VZdouvmGHO73zn3DsiAKKnjOhZAIPB4E2/3//U7Xa/tdttptVqfWw2m68eBBDhBRFek/k1mUywWq2wWCwwHA5Rr9d/1mo1yX8BvV4vOJ1Osd/vcT6fcTqdcDwecTgcsFwuQQzAsqzxXkCn03nHcRwvoh/P5/O/YvqezmazQSaT+Z1KpV4LACRnlK5LRePxGOQZo9GIFyYSCVQqFdBYpVIJ4XD4swBASvpBHajjH9d0Oo1YLIZiscj3QLZENpuF2+2+EQBIQdx6vebz73Y7kPYRCARgs9kQiUTQaDR4UDQahdVqFQLIit/pitvtFgQGu93OC30+H8RiMSwWC+LxOFwuFwwGwxcBoFwufyBHhdlshkKhgGAwyOemK+t0OphMJh6m0WhuVSrV1b3HmEwm2Vwuh2q1inw+D9I2GIaB3++H0+mEVquFXC7/+s97EAqFLj0eD0udaH6v1wuHwwGj0QilUgmpVMpIJJKLB6+y2Wx+r9frb9RqNadQKDiZTEaFb1/uZ3rM3AHRX/GLx8FvpQAAAABJRU5ErkJggg==) /*images/close-button.png*/ no-repeat;
|
||||
}
|
||||
|
||||
/*#source /ClientSource/Style/Timeline/timeline-bundle.css */
|
||||
|
||||
|
||||
/*------------------- Horizontal / Vertical lines ----------------*/
|
||||
@@ -402,7 +400,6 @@ div.simileAjax-bubble-close {
|
||||
}
|
||||
|
||||
|
||||
/*#source /ClientSource/Style/Timeline/disco.timelineextensions.css */
|
||||
.timeline-container {
|
||||
border: 1px solid #aaa;
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -173,6 +173,7 @@
|
||||
<Compile Include="Controllers\InitialConfigController.cs" />
|
||||
<Compile Include="Controllers\PluginWebHandlerController.cs" />
|
||||
<Compile Include="Controllers\UpdateController.cs" />
|
||||
<Compile Include="Extensions\ControllerExtensions.cs" />
|
||||
<Compile Include="Extensions\HtmlExtensions.cs" />
|
||||
<Compile Include="App_Start\AppConfig.cs" />
|
||||
<Compile Include="App_Start\BundleConfig.cs" />
|
||||
@@ -1837,7 +1838,7 @@
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
<UserProperties BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="True" BuildVersion_BuildAction="ReBuild" BuildVersion_StartDate="2001/1/1" />
|
||||
<UserProperties BuildVersion_StartDate="2001/1/1" BuildVersion_BuildAction="ReBuild" BuildVersion_UseGlobalSettings="True" BuildVersion_DetectChanges="False" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace Disco.Web.Extensions
|
||||
{
|
||||
public static class ControllerExtensions
|
||||
{
|
||||
|
||||
public static ActionResult RedirectToAction(this Controller controller, ActionResult result, string urlFragment)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(urlFragment))
|
||||
{
|
||||
var url = UrlHelper.GenerateUrl(null, null, null, callInfo.RouteValueDictionary, RouteTable.Routes, controller.HttpContext.Request.RequestContext, false);
|
||||
|
||||
url = string.Concat(url, "#", urlFragment);
|
||||
|
||||
return new RedirectResult(url, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return new RedirectToRouteResult(callInfo.RouteValueDictionary);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace Disco.Web
|
||||
|
||||
public static MvcHtmlString ToMultilineString(this string s)
|
||||
{
|
||||
return new MvcHtmlString(HttpUtility.HtmlEncode(s).Replace("\n", "<br />").Replace(Environment.NewLine, "<br />"));
|
||||
return new MvcHtmlString(HttpUtility.HtmlEncode(s).Replace(Environment.NewLine, "<br />").Replace("\n", "<br />").Replace("\r", "<br />"));
|
||||
}
|
||||
|
||||
public static List<Tuple<string, ActionResult>> ToBreadcrumb(this HtmlHelper htmlHelper, string title1, ActionResult link1, string title2 = null, ActionResult link2 = null, string title3 = null, ActionResult link3 = null, string title4 = null, ActionResult link4 = null, string title5 = null, ActionResult link5 = null)
|
||||
|
||||
@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyFileVersion("1.2.0319.1534")]
|
||||
[assembly: AssemblyVersion("1.2.0326.1428")]
|
||||
[assembly: AssemblyFileVersion("1.2.0326.1428")]
|
||||
|
||||
@@ -1,96 +1,43 @@
|
||||
@model Disco.Web.Models.Job.ShowModel
|
||||
<table id="jobNonWarrantyFinance">
|
||||
<tr>
|
||||
<th style="width: 200px;">
|
||||
Accounting Charge Required
|
||||
<th style="width: 200px;">Accounting Charge Required
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeRequiredDate)
|
||||
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredDate, "Not Required", "Job_JobMetaNonWarranty_AccountingChargeRequiredDate")
|
||||
<span id="Job_JobMetaNonWarranty_AccountingChargeRequiredUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUser.ToString()))</span>
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredDate'),
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredUser'),
|
||||
'Not Required',
|
||||
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeRequired(Model.Job.Id, null)))',
|
||||
'AccountingChargeRequiredDate',
|
||||
@(Model.Job.OpenedDate.ToJavascriptDate())
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 200px;">
|
||||
Accounting Charge Added
|
||||
<th style="width: 200px;">Accounting Charge Added
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeAddedDate)
|
||||
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeAddedDate, "Not Added", "Job_JobMetaNonWarranty_AccountingChargeAddedDate")
|
||||
<span id="Job_JobMetaNonWarranty_AccountingChargeAddedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeAddedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeAddedUser.ToString()))</span>
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargeAddedDate'),
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargeAddedUser'),
|
||||
'Not Added',
|
||||
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeAdded(Model.Job.Id, null)))',
|
||||
'AccountingChargeAddedDate',
|
||||
@(Model.Job.OpenedDate.ToJavascriptDate())
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 200px;">
|
||||
Accounting Charge Paid
|
||||
<th style="width: 200px;">Accounting Charge Paid
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargePaidDate)
|
||||
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargePaidDate, "Not Paid", "Job_JobMetaNonWarranty_AccountingChargePaidDate")
|
||||
<span id="Job_JobMetaNonWarranty_AccountingChargePaidUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargePaidUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargePaidUser.ToString()))</span>
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargePaidDate'),
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargePaidUser'),
|
||||
'Not Paid',
|
||||
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargePaid(Model.Job.Id, null)))',
|
||||
'AccountingChargePaidDate',
|
||||
@(Model.Job.OpenedDate.ToJavascriptDate())
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 200px;">
|
||||
Purchase Order Raised
|
||||
<th style="width: 200px;">Purchase Order Raised
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate)
|
||||
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate, "Not Raised", "Job_JobMetaNonWarranty_PurchaseOrderRaisedDate")
|
||||
<span id="Job_JobMetaNonWarranty_PurchaseOrderRaisedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUser.ToString()))</span>
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedDate'),
|
||||
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedUser'),
|
||||
'Not Raised',
|
||||
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderRaised(Model.Job.Id, null)))',
|
||||
'PurchaseOrderRaisedDate',
|
||||
@(Model.Job.OpenedDate.ToJavascriptDate())
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
Purchase Order Reference
|
||||
<th>Purchase Order Reference
|
||||
</th>
|
||||
<td>
|
||||
@Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference)
|
||||
@@ -138,47 +85,165 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 200px;">
|
||||
Purchase Order Sent
|
||||
<th style="width: 200px;">Purchase Order Sent
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderSentDate)
|
||||
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderSentDate, "Not Sent", "Job_JobMetaNonWarranty_PurchaseOrderSentDate")
|
||||
<span id="Job_JobMetaNonWarranty_PurchaseOrderSentUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderSentUser.ToString()))</span>
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_PurchaseOrderSentDate'),
|
||||
$('#Job_JobMetaNonWarranty_PurchaseOrderSentUser'),
|
||||
'Not Sent',
|
||||
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderSent(Model.Job.Id, null)))',
|
||||
'PurchaseOrderSentDate',
|
||||
@(Model.Job.OpenedDate.ToJavascriptDate())
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 200px;">
|
||||
Invoice Received
|
||||
<th style="width: 200px;">Invoice Received
|
||||
</th>
|
||||
<td>
|
||||
@Html.EditorFor(m => m.Job.JobMetaNonWarranty.InvoiceReceivedDate)
|
||||
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.InvoiceReceivedDate, "Not Received", "Job_JobMetaNonWarranty_InvoiceReceivedDate")
|
||||
<span id="Job_JobMetaNonWarranty_InvoiceReceivedUser">@(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.InvoiceReceivedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.InvoiceReceivedUser.ToString()))</span>
|
||||
@AjaxHelpers.AjaxLoader()
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_InvoiceReceivedDate'),
|
||||
$('#Job_JobMetaNonWarranty_InvoiceReceivedUser'),
|
||||
'Not Received',
|
||||
'@(Url.Action(MVC.API.Job.UpdateNonWarrantyInvoiceReceived(Model.Job.Id, null)))',
|
||||
'InvoiceReceivedDate',
|
||||
@(Model.Job.OpenedDate.ToJavascriptDate())
|
||||
);
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<script>
|
||||
(function(){
|
||||
var baseUpdateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
|
||||
|
||||
var dialog, dialogForm, dialogHeader, dialogDateBox, dialogDatePropertyNameBox;
|
||||
var friendlyName, dateField, userField, updatePropertyName, notSetDisplay, minDate, useAjax;
|
||||
|
||||
function dateDialogGet(){
|
||||
if (!dialog){
|
||||
dialog = $('<div>').attr({'class': 'dialog'})
|
||||
dialogForm = $('<form>').attr({'action': baseUpdateUrl, 'method': 'post'}).appendTo(dialog);
|
||||
var dialogBody = $('<p>').appendTo(dialogForm);
|
||||
dialogHeader = $('<h3>').attr('autofocus', 'autofocus').appendTo(dialogBody);
|
||||
dialogDatePropertyNameBox = $('<input>').attr({'type': 'hidden', 'name': 'key'}).appendTo(dialogBody);
|
||||
dialogDateBox = $('<input>').attr({'type': 'datetime', 'name': 'value'}).css({'display': 'block', 'margin-top': 15, 'margin-left': 'auto', 'margin-right': 'auto' }).appendTo(dialogBody);
|
||||
$('<input>').attr({'type': 'hidden', 'name': 'redirect'}).val('true').appendTo(dialogBody);
|
||||
|
||||
dialog.dialog({
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false,
|
||||
buttons: {
|
||||
"Update": dateDialogUpdate,
|
||||
Cancel: function () {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
},
|
||||
open: function(){
|
||||
dialog.dialog('widget').find('.ui-dialog-buttonpane :tabbable:first').focus();
|
||||
}
|
||||
});
|
||||
dialogDateBox.datetimepicker({
|
||||
defaultDate: new Date(),
|
||||
ampm: true,
|
||||
changeYear: true,
|
||||
changeMonth: true,
|
||||
dateFormat: 'yy/mm/dd',
|
||||
});
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
||||
function dateDialogUpdate(){
|
||||
var dateValue = dialogDateBox.val();
|
||||
|
||||
if (useAjax){
|
||||
// Use Ajax
|
||||
var $dateField, $userField;
|
||||
$dateField = $('#' + dateField);
|
||||
if (userField)
|
||||
$userField = $('#' + userField);
|
||||
|
||||
dialog.dialog("close");
|
||||
|
||||
var $ajaxLoading = ($userField ? $userField.next('.ajaxLoading') : $dateField.next('.ajaxLoading')).show();
|
||||
|
||||
var data = {
|
||||
key: updatePropertyName,
|
||||
value: dateValue
|
||||
};
|
||||
$.getJSON(baseUpdateUrl, data, function (response, result) {
|
||||
if (result != 'success' || response.Result != 'OK') {
|
||||
alert('Unable to change ' + friendlyName + ' Date:\n' + response);
|
||||
$ajaxLoading.hide();
|
||||
} else {
|
||||
if (response.DateTimeFull){
|
||||
$dateField.attr('data-datetimeformatted', response.DateTimeJavascript)
|
||||
.attr('data-discodatetime', response.DateTimeSortable)
|
||||
.attr('title', response.DateTimeFull)
|
||||
.text(response.DateTimeFriendly);
|
||||
}else{
|
||||
$dateField.attr('data-datetimeformatted', '')
|
||||
.attr('data-discodatetime', '-1')
|
||||
.attr('title', notSetDisplay)
|
||||
.text(notSetDisplay);
|
||||
}
|
||||
if ($userField)
|
||||
$userField.text('by ' + response.UserDescription);
|
||||
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
|
||||
}
|
||||
})
|
||||
}else{
|
||||
// Post Form & Redirect
|
||||
dialog.dialog("disable");
|
||||
dialog.dialog("option", "buttons", null);
|
||||
|
||||
dialogDatePropertyNameBox.val(updatePropertyName);
|
||||
|
||||
dialogForm.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function dateDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax){
|
||||
friendlyName = FriendlyName;
|
||||
dateField = DateField;
|
||||
userField = UserField;
|
||||
updatePropertyName = UpdatePropertyName;
|
||||
notSetDisplay = NotSetDisplay;
|
||||
minDate = MinDate;
|
||||
useAjax = UseAjax;
|
||||
|
||||
var d = dateDialogGet();
|
||||
|
||||
d.dialog('option', 'title', friendlyName);
|
||||
dialogHeader.text(friendlyName + ' Date');
|
||||
|
||||
var dfVal = $('#' + DateField).attr('data-datetimeformatted');
|
||||
|
||||
if (dfVal)
|
||||
dialogDateBox.datetimepicker('setDate', new Date(dfVal));
|
||||
else
|
||||
dialogDateBox.datetimepicker('setDate', new Date());
|
||||
|
||||
if (MinDate)
|
||||
dialogDateBox.datetimepicker('option', 'minDate', MinDate);
|
||||
else
|
||||
dialogDateBox.datetimepicker('option', 'minDate', null);
|
||||
|
||||
d.dialog('open');
|
||||
}
|
||||
|
||||
function dateDialogCreateUpdater(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax){
|
||||
$('<a>').attr({href: '#', 'class': 'button small', style: 'margin-right: 5px;'}).text('Update').click(function(event){
|
||||
event.preventDefault();
|
||||
dateDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDisplay, MinDate, UseAjax);
|
||||
}).insertBefore('#' + DateField);
|
||||
}
|
||||
|
||||
if (!document.DiscoFunctions)
|
||||
document.DiscoFunctions = {};
|
||||
if (!document.DiscoFunctions.DateDialogCreateUpdater)
|
||||
document.DiscoFunctions.DateDialogCreateUpdater = dateDialogCreateUpdater;
|
||||
})();
|
||||
$(function(){
|
||||
var jobOpenDate = '@(Model.Job.OpenedDate.ToJavascriptDateTime())';
|
||||
|
||||
document.DiscoFunctions.DateDialogCreateUpdater('Accounting Charge Required', 'Job_JobMetaNonWarranty_AccountingChargeRequiredDate', 'Job_JobMetaNonWarranty_AccountingChargeRequiredUser', 'NonWarrantyAccountingChargeRequired', 'Not Required', jobOpenDate, false);
|
||||
document.DiscoFunctions.DateDialogCreateUpdater('Accounting Charge Added', 'Job_JobMetaNonWarranty_AccountingChargeAddedDate', 'Job_JobMetaNonWarranty_AccountingChargeAddedUser', 'NonWarrantyAccountingChargeAdded', 'Not Added', jobOpenDate, false);
|
||||
document.DiscoFunctions.DateDialogCreateUpdater('Accounting Charge Paid', 'Job_JobMetaNonWarranty_AccountingChargePaidDate', 'Job_JobMetaNonWarranty_AccountingChargePaidUser', 'NonWarrantyAccountingChargePaid', 'Not Paid', jobOpenDate, false);
|
||||
document.DiscoFunctions.DateDialogCreateUpdater('Purchase Order Raised', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedDate', 'Job_JobMetaNonWarranty_PurchaseOrderRaisedUser', 'NonWarrantyPurchaseOrderRaised', 'Not Raised', jobOpenDate, true);
|
||||
document.DiscoFunctions.DateDialogCreateUpdater('Purchase Order Sent', 'Job_JobMetaNonWarranty_PurchaseOrderSentDate', 'Job_JobMetaNonWarranty_PurchaseOrderSentUser', 'NonWarrantyPurchaseOrderSent', 'Not Sent', jobOpenDate, true);
|
||||
document.DiscoFunctions.DateDialogCreateUpdater('Invoice Received', 'Job_JobMetaNonWarranty_InvoiceReceivedDate', 'Job_JobMetaNonWarranty_InvoiceReceivedUser', 'NonWarrantyInvoiceReceived', 'Not Received', jobOpenDate, true);
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace Disco.Web.Views.Job.JobParts
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.4.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/JobParts/NonWarrantyFinance.cshtml")]
|
||||
public class NonWarrantyFinance : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
|
||||
public partial class NonWarrantyFinance : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
|
||||
{
|
||||
public NonWarrantyFinance()
|
||||
{
|
||||
@@ -48,13 +48,13 @@ WriteLiteral(">\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 200px;\"");
|
||||
|
||||
WriteLiteral(">\r\n Accounting Charge Required\r\n </th>\r\n <td>\r\n");
|
||||
WriteLiteral(">Accounting Charge Required\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 8 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeRequiredDate));
|
||||
#line 7 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredDate, "Not Required", "Job_JobMetaNonWarranty_AccountingChargeRequiredDate"));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -66,7 +66,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargeRequiredUser\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 9 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 8 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeRequiredUser.ToString()));
|
||||
|
||||
|
||||
@@ -77,54 +77,23 @@ WriteLiteral("</span>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 10 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 9 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredDate'),
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargeRequiredUser'),
|
||||
'Not Required',
|
||||
'");
|
||||
|
||||
|
||||
#line 17 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeRequired(Model.Job.Id, null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'AccountingChargeRequiredDate\',\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 19 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Model.Job.OpenedDate.ToJavascriptDate());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
|
||||
" </td>\r\n </tr>\r\n <tr>\r\n <th");
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 200px;\"");
|
||||
|
||||
WriteLiteral(">\r\n Accounting Charge Added\r\n </th>\r\n <td>\r\n");
|
||||
WriteLiteral(">Accounting Charge Added\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 30 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargeAddedDate));
|
||||
#line 16 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargeAddedDate, "Not Added", "Job_JobMetaNonWarranty_AccountingChargeAddedDate"));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -136,7 +105,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargeAddedUser\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 31 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 17 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargeAddedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargeAddedUser.ToString()));
|
||||
|
||||
|
||||
@@ -147,54 +116,23 @@ WriteLiteral("</span>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 32 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 18 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargeAddedDate'),
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargeAddedUser'),
|
||||
'Not Added',
|
||||
'");
|
||||
|
||||
|
||||
#line 39 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargeAdded(Model.Job.Id, null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'AccountingChargeAddedDate\',\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 41 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Model.Job.OpenedDate.ToJavascriptDate());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
|
||||
" </td>\r\n </tr>\r\n <tr>\r\n <th");
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 200px;\"");
|
||||
|
||||
WriteLiteral(">\r\n Accounting Charge Paid\r\n </th>\r\n <td>\r\n");
|
||||
WriteLiteral(">Accounting Charge Paid\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 52 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.AccountingChargePaidDate));
|
||||
#line 25 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.AccountingChargePaidDate, "Not Paid", "Job_JobMetaNonWarranty_AccountingChargePaidDate"));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -206,7 +144,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_AccountingChargePaidUser\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 53 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 26 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.AccountingChargePaidUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.AccountingChargePaidUser.ToString()));
|
||||
|
||||
|
||||
@@ -217,54 +155,23 @@ WriteLiteral("</span>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 54 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 27 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargePaidDate'),
|
||||
$('#Job_JobMetaNonWarranty_AccountingChargePaidUser'),
|
||||
'Not Paid',
|
||||
'");
|
||||
|
||||
|
||||
#line 61 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyAccountingChargePaid(Model.Job.Id, null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'AccountingChargePaidDate\',\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 63 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Model.Job.OpenedDate.ToJavascriptDate());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
|
||||
" </td>\r\n </tr>\r\n <tr>\r\n <th");
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 200px;\"");
|
||||
|
||||
WriteLiteral(">\r\n Purchase Order Raised\r\n </th>\r\n <td>\r\n");
|
||||
WriteLiteral(">Purchase Order Raised\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 74 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate));
|
||||
#line 34 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedDate, "Not Raised", "Job_JobMetaNonWarranty_PurchaseOrderRaisedDate"));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -276,7 +183,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_PurchaseOrderRaisedUser\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 75 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 35 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderRaisedUser.ToString()));
|
||||
|
||||
|
||||
@@ -287,50 +194,19 @@ WriteLiteral("</span>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 76 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 36 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedDate'),
|
||||
$('#Job_JobMetaNonWarranty_PurchaseOrderRaisedUser'),
|
||||
'Not Raised',
|
||||
'");
|
||||
|
||||
|
||||
#line 83 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderRaised(Model.Job.Id, null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'PurchaseOrderRaisedDate\',\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 85 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Model.Job.OpenedDate.ToJavascriptDate());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
|
||||
" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n Purchase Order Reference\r" +
|
||||
"\n </th>\r\n <td>\r\n");
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Purchase Order Reference\r\n " +
|
||||
" </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 96 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 43 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Html.TextBoxFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderReference));
|
||||
|
||||
|
||||
@@ -341,7 +217,7 @@ WriteLiteral("\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 97 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 44 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(AjaxHelpers.AjaxSave());
|
||||
|
||||
|
||||
@@ -352,7 +228,7 @@ WriteLiteral("\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 98 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 45 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
@@ -385,7 +261,7 @@ WriteLiteral(@">
|
||||
url: '");
|
||||
|
||||
|
||||
#line 119 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 66 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderReference(Model.Job.Id, null)));
|
||||
|
||||
|
||||
@@ -417,13 +293,13 @@ WriteLiteral(@"',
|
||||
|
||||
WriteLiteral(" style=\"width: 200px;\"");
|
||||
|
||||
WriteLiteral(">\r\n Purchase Order Sent\r\n </th>\r\n <td>\r\n");
|
||||
WriteLiteral(">Purchase Order Sent\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 145 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.PurchaseOrderSentDate));
|
||||
#line 91 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.PurchaseOrderSentDate, "Not Sent", "Job_JobMetaNonWarranty_PurchaseOrderSentDate"));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -435,7 +311,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_PurchaseOrderSentUser\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 146 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 92 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.PurchaseOrderSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.PurchaseOrderSentUser.ToString()));
|
||||
|
||||
|
||||
@@ -446,54 +322,23 @@ WriteLiteral("</span>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 147 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 93 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_PurchaseOrderSentDate'),
|
||||
$('#Job_JobMetaNonWarranty_PurchaseOrderSentUser'),
|
||||
'Not Sent',
|
||||
'");
|
||||
|
||||
|
||||
#line 154 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyPurchaseOrderSent(Model.Job.Id, null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'PurchaseOrderSentDate\',\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 156 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Model.Job.OpenedDate.ToJavascriptDate());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
|
||||
" </td>\r\n </tr>\r\n <tr>\r\n <th");
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 200px;\"");
|
||||
|
||||
WriteLiteral(">\r\n Invoice Received\r\n </th>\r\n <td>\r\n");
|
||||
WriteLiteral(">Invoice Received\r\n </th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 167 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.InvoiceReceivedDate));
|
||||
#line 100 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.InvoiceReceivedDate, "Not Received", "Job_JobMetaNonWarranty_InvoiceReceivedDate"));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -505,7 +350,7 @@ WriteLiteral(" id=\"Job_JobMetaNonWarranty_InvoiceReceivedUser\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 168 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 101 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(string.IsNullOrEmpty(Model.Job.JobMetaNonWarranty.InvoiceReceivedUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaNonWarranty.InvoiceReceivedUser.ToString()));
|
||||
|
||||
|
||||
@@ -516,44 +361,125 @@ WriteLiteral("</span>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 169 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
#line 102 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(AjaxHelpers.AjaxLoader());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <script");
|
||||
|
||||
WriteLiteral(" type=\"text/javascript\"");
|
||||
|
||||
WriteLiteral(@">
|
||||
$(function () {
|
||||
document.DiscoFunctions.DateChangeUserHelper(
|
||||
$('#Job_JobMetaNonWarranty_InvoiceReceivedDate'),
|
||||
$('#Job_JobMetaNonWarranty_InvoiceReceivedUser'),
|
||||
'Not Received',
|
||||
'");
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n (function(){\r\n var bas" +
|
||||
"eUpdateUrl = \'");
|
||||
|
||||
|
||||
#line 176 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyInvoiceReceived(Model.Job.Id, null)));
|
||||
#line 108 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n \'InvoiceReceivedDate\',\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
WriteLiteral("\';\r\n\r\n var dialog, dialogForm, dialogHeader, dialogDateBox, dialogDateProp" +
|
||||
"ertyNameBox;\r\n var friendlyName, dateField, userField, updatePropertyName" +
|
||||
", notSetDisplay, minDate, useAjax;\r\n\r\n function dateDialogGet(){\r\n " +
|
||||
" if (!dialog){\r\n dialog = $(\'<div>\').attr({\'class\': \'dialog\'}" +
|
||||
")\r\n dialogForm = $(\'<form>\').attr({\'action\': baseUpdateUrl, \'meth" +
|
||||
"od\': \'post\'}).appendTo(dialog);\r\n var dialogBody = $(\'<p>\').appen" +
|
||||
"dTo(dialogForm);\r\n dialogHeader = $(\'<h3>\').attr(\'autofocus\', \'au" +
|
||||
"tofocus\').appendTo(dialogBody);\r\n dialogDatePropertyNameBox = $(\'" +
|
||||
"<input>\').attr({\'type\': \'hidden\', \'name\': \'key\'}).appendTo(dialogBody);\r\n " +
|
||||
" dialogDateBox = $(\'<input>\').attr({\'type\': \'datetime\', \'name\': \'value\'}" +
|
||||
").css({\'display\': \'block\', \'margin-top\': 15, \'margin-left\': \'auto\', \'margin-righ" +
|
||||
"t\': \'auto\' }).appendTo(dialogBody);\r\n $(\'<input>\').attr({\'type\': " +
|
||||
"\'hidden\', \'name\': \'redirect\'}).val(\'true\').appendTo(dialogBody);\r\n\r\n " +
|
||||
" dialog.dialog({\r\n resizable: false,\r\n " +
|
||||
"modal: true,\r\n autoOpen: false,\r\n buttons:" +
|
||||
" {\r\n \"Update\": dateDialogUpdate,\r\n " +
|
||||
" Cancel: function () {\r\n $(this).dialog(\"close\");\r\n " +
|
||||
" }\r\n },\r\n open: funct" +
|
||||
"ion(){\r\n dialog.dialog(\'widget\').find(\'.ui-dialog-buttonp" +
|
||||
"ane :tabbable:first\').focus();\r\n }\r\n });\r\n " +
|
||||
" dialogDateBox.datetimepicker({\r\n defaultDate: new" +
|
||||
" Date(),\r\n ampm: true,\r\n changeYear: true," +
|
||||
"\r\n changeMonth: true,\r\n dateFormat: \'yy/mm" +
|
||||
"/dd\',\r\n });\r\n }\r\n return dialog;\r\n }" +
|
||||
"\r\n\r\n function dateDialogUpdate(){\r\n var dateValue = dialogDate" +
|
||||
"Box.val();\r\n\r\n if (useAjax){\r\n // Use Ajax\r\n " +
|
||||
" var $dateField, $userField;\r\n $dateField = $(\'#\' + dateFiel" +
|
||||
"d);\r\n if (userField)\r\n $userField = $(\'#\' + us" +
|
||||
"erField);\r\n\r\n dialog.dialog(\"close\");\r\n\r\n var $aja" +
|
||||
"xLoading = ($userField ? $userField.next(\'.ajaxLoading\') : $dateField.next(\'.aja" +
|
||||
"xLoading\')).show();\r\n\r\n var data = {\r\n key: up" +
|
||||
"datePropertyName,\r\n value: dateValue\r\n };\r\n " +
|
||||
" $.getJSON(baseUpdateUrl, data, function (response, result) {\r\n " +
|
||||
" if (result != \'success\' || response.Result != \'OK\') {\r\n " +
|
||||
" alert(\'Unable to change \' + friendlyName + \' Date:\\n\' + response);" +
|
||||
"\r\n $ajaxLoading.hide();\r\n } else {\r\n " +
|
||||
" if (response.DateTimeFull){\r\n $" +
|
||||
"dateField.attr(\'data-datetimeformatted\', response.DateTimeJavascript)\r\n " +
|
||||
" .attr(\'data-discodatetime\', response.DateTimeSortable)\r\n " +
|
||||
" .attr(\'title\', response.DateTimeFull)\r\n " +
|
||||
" .text(response.DateTimeFriendly);\r\n " +
|
||||
" }else{\r\n $dateField.attr(\'data-datetimeformatted\', \'" +
|
||||
"\')\r\n .attr(\'data-discodatetime\', \'-1\')\r\n " +
|
||||
" .attr(\'title\', notSetDisplay)\r\n " +
|
||||
" .text(notSetDisplay);\r\n }\r\n " +
|
||||
"if ($userField)\r\n $userField.text(\'by \' + response.Us" +
|
||||
"erDescription);\r\n $ajaxLoading.hide().next(\'.ajaxOk\').sho" +
|
||||
"w().delay(\'fast\').fadeOut(\'slow\');\r\n }\r\n })\r\n " +
|
||||
" }else{\r\n // Post Form & Redirect\r\n dial" +
|
||||
"og.dialog(\"disable\");\r\n dialog.dialog(\"option\", \"buttons\", null);" +
|
||||
"\r\n\r\n dialogDatePropertyNameBox.val(updatePropertyName);\r\n\r\n " +
|
||||
" dialogForm.submit();\r\n }\r\n }\r\n\r\n function dat" +
|
||||
"eDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSetDispla" +
|
||||
"y, MinDate, UseAjax){\r\n friendlyName = FriendlyName;\r\n dat" +
|
||||
"eField = DateField;\r\n userField = UserField;\r\n updatePrope" +
|
||||
"rtyName = UpdatePropertyName;\r\n notSetDisplay = NotSetDisplay;\r\n " +
|
||||
" minDate = MinDate;\r\n useAjax = UseAjax;\r\n\r\n var d =" +
|
||||
" dateDialogGet();\r\n\r\n d.dialog(\'option\', \'title\', friendlyName);\r\n " +
|
||||
" dialogHeader.text(friendlyName + \' Date\');\r\n\r\n var dfVal = $" +
|
||||
"(\'#\' + DateField).attr(\'data-datetimeformatted\');\r\n\r\n if (dfVal)\r\n " +
|
||||
" dialogDateBox.datetimepicker(\'setDate\', new Date(dfVal));\r\n " +
|
||||
" else\r\n dialogDateBox.datetimepicker(\'setDate\', new Date());\r\n" +
|
||||
"\r\n if (MinDate)\r\n dialogDateBox.datetimepicker(\'option" +
|
||||
"\', \'minDate\', MinDate);\r\n else\r\n dialogDateBox.datetim" +
|
||||
"epicker(\'option\', \'minDate\', null);\r\n\r\n d.dialog(\'open\');\r\n }\r" +
|
||||
"\n\r\n function dateDialogCreateUpdater(FriendlyName, DateField, UserField, " +
|
||||
"UpdatePropertyName, NotSetDisplay, MinDate, UseAjax){\r\n $(\'<a>\').attr" +
|
||||
"({href: \'#\', \'class\': \'button small\', style: \'margin-right: 5px;\'}).text(\'Update" +
|
||||
"\').click(function(event){\r\n event.preventDefault();\r\n " +
|
||||
" dateDialogOpen(FriendlyName, DateField, UserField, UpdatePropertyName, NotSe" +
|
||||
"tDisplay, MinDate, UseAjax);\r\n }).insertBefore(\'#\' + DateField);\r\n " +
|
||||
" }\r\n\r\n if (!document.DiscoFunctions)\r\n document.DiscoFunct" +
|
||||
"ions = {};\r\n if (!document.DiscoFunctions.DateDialogCreateUpdater)\r\n " +
|
||||
" document.DiscoFunctions.DateDialogCreateUpdater = dateDialogCreateUpdater" +
|
||||
";\r\n })();\r\n $(function(){\r\n var jobOpenDate = \'");
|
||||
|
||||
|
||||
#line 178 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Model.Job.OpenedDate.ToJavascriptDate());
|
||||
#line 240 "..\..\Views\Job\JobParts\NonWarrantyFinance.cshtml"
|
||||
Write(Model.Job.OpenedDate.ToJavascriptDateTime());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n );\r\n });\r\n </script>\r\n " +
|
||||
" </td>\r\n </tr>\r\n</table>\r\n");
|
||||
WriteLiteral("\';\r\n\r\n document.DiscoFunctions.DateDialogCreateUpdater(\'Accounting Charge " +
|
||||
"Required\', \'Job_JobMetaNonWarranty_AccountingChargeRequiredDate\', \'Job_JobMetaNo" +
|
||||
"nWarranty_AccountingChargeRequiredUser\', \'NonWarrantyAccountingChargeRequired\', " +
|
||||
"\'Not Required\', jobOpenDate, false);\r\n document.DiscoFunctions.DateDialog" +
|
||||
"CreateUpdater(\'Accounting Charge Added\', \'Job_JobMetaNonWarranty_AccountingCharg" +
|
||||
"eAddedDate\', \'Job_JobMetaNonWarranty_AccountingChargeAddedUser\', \'NonWarrantyAcc" +
|
||||
"ountingChargeAdded\', \'Not Added\', jobOpenDate, false);\r\n document.DiscoFu" +
|
||||
"nctions.DateDialogCreateUpdater(\'Accounting Charge Paid\', \'Job_JobMetaNonWarrant" +
|
||||
"y_AccountingChargePaidDate\', \'Job_JobMetaNonWarranty_AccountingChargePaidUser\', " +
|
||||
"\'NonWarrantyAccountingChargePaid\', \'Not Paid\', jobOpenDate, false);\r\n doc" +
|
||||
"ument.DiscoFunctions.DateDialogCreateUpdater(\'Purchase Order Raised\', \'Job_JobMe" +
|
||||
"taNonWarranty_PurchaseOrderRaisedDate\', \'Job_JobMetaNonWarranty_PurchaseOrderRai" +
|
||||
"sedUser\', \'NonWarrantyPurchaseOrderRaised\', \'Not Raised\', jobOpenDate, true);\r\n " +
|
||||
" document.DiscoFunctions.DateDialogCreateUpdater(\'Purchase Order Sent\', \'J" +
|
||||
"ob_JobMetaNonWarranty_PurchaseOrderSentDate\', \'Job_JobMetaNonWarranty_PurchaseOr" +
|
||||
"derSentUser\', \'NonWarrantyPurchaseOrderSent\', \'Not Sent\', jobOpenDate, true);\r\n " +
|
||||
" document.DiscoFunctions.DateDialogCreateUpdater(\'Invoice Received\', \'Job_" +
|
||||
"JobMetaNonWarranty_InvoiceReceivedDate\', \'Job_JobMetaNonWarranty_InvoiceReceived" +
|
||||
"User\', \'NonWarrantyInvoiceReceived\', \'Not Received\', jobOpenDate, true);\r\n })" +
|
||||
";\r\n</script>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@
|
||||
}
|
||||
@if (Model.Job.CanInsuranceClaimFormSent())
|
||||
{
|
||||
@Html.ActionLinkSmallButton("Insurance Claim Form Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimFormSent_Button", "alert")
|
||||
@Html.ActionLinkSmallButton("Insurance Claim Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimSent_Button", "alert")
|
||||
}
|
||||
@if (Model.Job.CanLogRepair())
|
||||
{
|
||||
|
||||
@@ -1740,14 +1740,14 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
|
||||
#line 524 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
Write(Html.ActionLinkSmallButton("Insurance Claim Form Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimFormSent_Button", "alert"));
|
||||
Write(Html.ActionLinkSmallButton("Insurance Claim Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimSent_Button", "alert"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 524 "..\..\Views\Job\JobParts\_Subject.cshtml"
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ namespace Disco.Web.Views.Job
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.0.0")]
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "1.5.4.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/Show.cshtml")]
|
||||
public class Show : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
|
||||
public partial class Show : System.Web.Mvc.WebViewPage<Disco.Web.Models.Job.ShowModel>
|
||||
{
|
||||
public Show()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user