diff --git a/Logic/Financial/InboundInvoice.cs b/Logic/Financial/InboundInvoice.cs index dc17f4f4..1c1ac679 100644 --- a/Logic/Financial/InboundInvoice.cs +++ b/Logic/Financial/InboundInvoice.cs @@ -191,7 +191,7 @@ namespace Swarmops.Logic.Financial } } - public static InboundInvoice Create (Organization organization, DateTime dueDate, Int64 amountCents, + public static InboundInvoice Create (Organization organization, DateTime issuedDate, DateTime dueDate, Int64 amountCents, Int64 vatCents, FinancialAccount budget, string supplier, string description, string payToAccount, string ocr, string invoiceReference, Person creatingPerson) { @@ -210,7 +210,7 @@ namespace Swarmops.Logic.Financial // Create a corresponding financial transaction with rows FinancialTransaction transaction = - FinancialTransaction.Create (organization.Identity, DateTime.UtcNow, + FinancialTransaction.Create (organization.Identity, issuedDate == DateTime.Today? DateTime.UtcNow: issuedDate.AddHours(12), "Invoice #" + newInvoice.OrganizationSequenceId + " from " + supplier); transaction.AddRow (organization.FinancialAccounts.DebtsInboundInvoices, -amountCents, creatingPerson); diff --git a/Site/Controls/v5/Base/DateTextBox.ascx.cs b/Site/Controls/v5/Base/DateTextBox.ascx.cs index 9325216b..940fd0dd 100644 --- a/Site/Controls/v5/Base/DateTextBox.ascx.cs +++ b/Site/Controls/v5/Base/DateTextBox.ascx.cs @@ -42,7 +42,7 @@ namespace Swarmops.Frontend.Controls.Base set { this.InterpretedDate.Value = value.ToString(CultureInfo.InvariantCulture); - this.TextInput.Text = value.ToString("YYYY MMM dd"); + this.TextInput.Text = value.ToString("yyyy MMM dd"); } } diff --git a/Site/Pages/v5/Financial/CreateInboundInvoice.aspx b/Site/Pages/v5/Financial/CreateInboundInvoice.aspx index 84b806d0..f2fccbbd 100644 --- a/Site/Pages/v5/Financial/CreateInboundInvoice.aspx +++ b/Site/Pages/v5/Financial/CreateInboundInvoice.aspx @@ -147,7 +147,6 @@
-
@@ -170,11 +169,11 @@
-
+



-
+


<%# Eval("TagSetLocalizedName") %>
diff --git a/Site/Pages/v5/Financial/CreateInboundInvoice.aspx.cs b/Site/Pages/v5/Financial/CreateInboundInvoice.aspx.cs index 594be31b..dbfc1b0d 100644 --- a/Site/Pages/v5/Financial/CreateInboundInvoice.aspx.cs +++ b/Site/Pages/v5/Financial/CreateInboundInvoice.aspx.cs @@ -113,10 +113,10 @@ namespace Swarmops.Frontend.Pages.v5.Financial private void Localize() { - this.LabelInvoiceDate.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, + this.LabelDateInvoiceIssued.Text = LocalizedStrings.Get(LocDomain.PagesFinancial, "CreateInboundInvoice_InvoiceDate"); this.LabelSupplier.Text = LocalizedStrings.Get(LocDomain.Global, "Financial_Supplier"); - this.LabelDueDate.Text = this.LabelInvoiceDate.Text = LocalizedStrings.Get(LocDomain.Global, "Financial_DueDate"); + this.LabelDateInvoiceDue.Text = LocalizedStrings.Get(LocDomain.Global, "Financial_DueDate"); this.LabelAmount.Text = string.Format (LocalizedStrings.Get(LocDomain.PagesFinancial, "CreateInboundInvoice_Amount"), CurrentOrganization.Currency.Code); this.LabelVat.Text = string.Format(LocalizedStrings.Get(LocDomain.PagesFinancial, "CreateInboundInvoice_AmountVat"), @@ -143,9 +143,9 @@ namespace Swarmops.Frontend.Pages.v5.Financial string description = this.TextPurpose.Text; + DateTime issuedDate = this.DateInvoiceIssued.Value; DateTime dueDate = this.DateInvoiceDue.Value; - FinancialAccount budget = this.ComboBudgets.SelectedAccount; // sanity check @@ -165,7 +165,7 @@ namespace Swarmops.Frontend.Pages.v5.Financial throw new InvalidOperationException ("No documents uploaded"); } - InboundInvoice invoice = InboundInvoice.Create (CurrentOrganization, dueDate, amountCents, amountVatCents, budget, + InboundInvoice invoice = InboundInvoice.Create (CurrentOrganization, issuedDate, dueDate, amountCents, amountVatCents, budget, this.TextSupplier.Text, this.TextPurpose.Text, this.TextAccount.Text, string.Empty, this.TextReference.Text, CurrentUser); diff --git a/Site/Pages/v5/Financial/CreateInboundInvoice.aspx.designer.cs b/Site/Pages/v5/Financial/CreateInboundInvoice.aspx.designer.cs index 08ce610f..5e638e95 100644 --- a/Site/Pages/v5/Financial/CreateInboundInvoice.aspx.designer.cs +++ b/Site/Pages/v5/Financial/CreateInboundInvoice.aspx.designer.cs @@ -57,15 +57,6 @@ namespace Swarmops.Frontend.Pages.v5.Financial { /// protected global::Swarmops.Frontend.Controls.Base.DateTextBox DateInvoiceIssued; - /// - /// TextInvoiceDate control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox TextInvoiceDate; - /// /// TextSupplier control. /// @@ -166,13 +157,13 @@ namespace Swarmops.Frontend.Pages.v5.Financial { protected global::System.Web.UI.WebControls.Button ButtonCreate; /// - /// LabelInvoiceDate control. + /// LabelDateInvoiceIssued control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Label LabelInvoiceDate; + protected global::System.Web.UI.WebControls.Label LabelDateInvoiceIssued; /// /// LabelSupplier control. @@ -202,13 +193,13 @@ namespace Swarmops.Frontend.Pages.v5.Financial { protected global::System.Web.UI.WebControls.Label LabelVat; /// - /// LabelDueDate control. + /// LabelDateInvoiceDue control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Label LabelDueDate; + protected global::System.Web.UI.WebControls.Label LabelDateInvoiceDue; /// /// LabelPurpose control.