Converted part of File Expense to new loc; added expense date
This commit is contained in:
+199
-192
File diff suppressed because it is too large
Load Diff
@@ -753,4 +753,8 @@
|
||||
<value>Payment is late</value>
|
||||
<comment>"Late" in this context means "after its due date".</comment>
|
||||
</data>
|
||||
<data name="FileExpenseClaim_DateIncurred" xml:space="preserve">
|
||||
<value>Date of Expense</value>
|
||||
<comment>Refers to the date of when the expense happened, not to the filing date of the receipt</comment>
|
||||
</data>
|
||||
</root>
|
||||
@@ -2,6 +2,7 @@
|
||||
<%@ Register src="~/Controls/v5/Base/FileUpload.ascx" tagname="FileUpload" tagprefix="Swarmops5" %>
|
||||
<%@ Register TagPrefix="Swarmops5" TagName="ComboBudgets" Src="~/Controls/v5/Financial/ComboBudgets.ascx" %>
|
||||
<%@ Register TagPrefix="Swarmops5" TagName="Currency" Src="~/Controls/v5/Financial/CurrencyTextBox.ascx" %>
|
||||
<%@ Register TagPrefix="Swarmops5" TagName="DateTextBox" Src="~/Controls/v5/Base/DateTextBox.ascx" %>
|
||||
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="PlaceHolderHead" Runat="Server">
|
||||
<Swarmops5:ExternalScripts ID="ScriptFancyBox" Package="FancyBox" runat="server"/>
|
||||
@@ -423,6 +424,7 @@
|
||||
<h2><asp:Label runat="server" ID="BoxTitle" /></h2>
|
||||
<asp:HiddenField ID="HiddenTagSetIdentifiers" runat="server"/>
|
||||
<div class="data-entry-fields">
|
||||
<Swarmops5:DateTextBox runat="server" ID="DateExpenseIncurred"/>
|
||||
<Swarmops5:Currency runat="server" ID="CurrencyAmount" />
|
||||
<span class="ifVatEnabled"><Swarmops5:Currency runat="server" ID="CurrencyVat" /></span>
|
||||
<div class="stacked-input-control"><asp:TextBox runat="server" ID="TextPurpose" /></div>
|
||||
@@ -444,6 +446,7 @@
|
||||
<asp:Button ID="ButtonRequest" runat="server" CssClass="button-accent-color suppress-input-focus" OnClientClick="return validateFields();" OnClick="ButtonRequest_Click" Text="Request"/>
|
||||
</div>
|
||||
<div class="data-entry-labels">
|
||||
<asp:Label runat="server" ID="LabelExpenseDate" /><br/>
|
||||
<asp:Label runat="server" ID="LabelAmount" /><br/>
|
||||
<span class="ifVatEnabled"><asp:Label runat="server" ID="LabelVat"/><br/></span>
|
||||
<asp:Label runat="server" ID="LabelPurpose" /><br/>
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Web;
|
||||
using System.Web.Services;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Swarmops.Interface.Support;
|
||||
using Swarmops.Localization;
|
||||
using Swarmops.Logic.Cache;
|
||||
using Swarmops.Logic.Financial;
|
||||
using Swarmops.Logic.Security;
|
||||
@@ -119,9 +120,9 @@ namespace Swarmops.Frontend.Pages.v5.Financial
|
||||
return;
|
||||
}
|
||||
|
||||
this.BoxTitle.Text = PageTitle = Resources.Pages.Financial.FileExpenseClaim_PageTitle;
|
||||
this.BoxTitle.Text = PageTitle = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_PageTitle");
|
||||
PageIcon = "iconshock-moneyback";
|
||||
InfoBoxLiteral = Resources.Pages.Financial.FileExpenseClaim_Info;
|
||||
InfoBoxLiteral = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_Info");
|
||||
|
||||
PageAccessRequired = new Access (CurrentOrganization, AccessAspect.Participant, AccessType.Write);
|
||||
|
||||
@@ -145,20 +146,21 @@ namespace Swarmops.Frontend.Pages.v5.Financial
|
||||
{
|
||||
/* Main tab */
|
||||
|
||||
this.LabelAmount.Text = string.Format (Resources.Pages.Financial.FileExpenseClaim_Amount,
|
||||
this.LabelExpenseDate.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_DateIncurred");
|
||||
this.LabelAmount.Text = string.Format (LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_Amount"),
|
||||
CurrentOrganization.Currency.DisplayCode);
|
||||
this.LabelPurpose.Text = Resources.Pages.Financial.FileExpenseClaim_Description;
|
||||
this.LabelBudget.Text = Resources.Pages.Financial.FileExpenseClaim_Budget;
|
||||
this.LabelHeaderBankDetails.Text = Resources.Pages.Financial.FileExpenseClaim_HeaderBankDetails;
|
||||
this.LabelBankName.Text = Resources.Pages.Financial.FileExpenseClaim_BankName;
|
||||
this.LabelBankClearing.Text = Resources.Pages.Financial.FileExpenseClaim_BankClearing;
|
||||
this.LabelBankAccount.Text = Resources.Pages.Financial.FileExpenseClaim_BankAccount;
|
||||
this.LabelHeaderImageFiles.Text = Resources.Pages.Financial.FileExpenseClaim_HeaderReceiptImages;
|
||||
this.LabelImageFiles.Text = Resources.Pages.Financial.FileExpenseClaim_UploadRecieptImages;
|
||||
this.LabelVat.Text = string.Format(Resources.Pages.Financial.FileExpenseClaim_Vat,
|
||||
this.LabelPurpose.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_Description");
|
||||
this.LabelBudget.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_Budget");
|
||||
this.LabelHeaderBankDetails.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_HeaderBankDetails");
|
||||
this.LabelBankName.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_BankName");
|
||||
this.LabelBankClearing.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_BankClearing");
|
||||
this.LabelBankAccount.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_BankAccount");
|
||||
this.LabelHeaderImageFiles.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_HeaderReceiptImages");
|
||||
this.LabelImageFiles.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_UploadRecieptImages");
|
||||
this.LabelVat.Text = string.Format(LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_Vat"),
|
||||
CurrentOrganization.Currency.DisplayCode);
|
||||
|
||||
this.ButtonRequest.Text = Resources.Pages.Financial.FileExpenseClaim_ButtonRequest;
|
||||
this.ButtonRequest.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "FileExpenseClaim_ButtonRequest");
|
||||
|
||||
/* Expensify tab */
|
||||
|
||||
@@ -954,6 +956,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
|
||||
// The data has been validated client-side already. We'll throw unfriendly exceptions if invalid data is passed here.
|
||||
// People who choose to disable JavaScript and then submit bad input almost deserve to be hurt.
|
||||
|
||||
DateTime expenseDate = this.DateExpenseIncurred.Value;
|
||||
Int64 amountCents = this.CurrencyAmount.Cents;
|
||||
Int64 vatCents = this.CurrencyVat.Cents;
|
||||
|
||||
@@ -983,7 +986,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial
|
||||
throw new InvalidOperationException ("No documents uploaded");
|
||||
}
|
||||
|
||||
ExpenseClaim claim = ExpenseClaim.Create (CurrentUser, CurrentOrganization, budget, DateTime.UtcNow,
|
||||
ExpenseClaim claim = ExpenseClaim.Create (CurrentUser, CurrentOrganization, budget, expenseDate,
|
||||
description, amountCents, vatCents);
|
||||
|
||||
foreach (int tagSetId in this._tagSetIds)
|
||||
|
||||
@@ -39,6 +39,15 @@ namespace Swarmops.Frontend.Pages.v5.Financial {
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.HiddenField HiddenTagSetIdentifiers;
|
||||
|
||||
/// <summary>
|
||||
/// DateExpenseIncurred control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::Swarmops.Frontend.Controls.Base.DateTextBox DateExpenseIncurred;
|
||||
|
||||
/// <summary>
|
||||
/// CurrencyAmount control.
|
||||
/// </summary>
|
||||
@@ -129,6 +138,15 @@ namespace Swarmops.Frontend.Pages.v5.Financial {
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Button ButtonRequest;
|
||||
|
||||
/// <summary>
|
||||
/// LabelExpenseDate control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label LabelExpenseDate;
|
||||
|
||||
/// <summary>
|
||||
/// LabelAmount control.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user