True
True
@@ -597,6 +602,10 @@
+
+ ResXFileCodeGenerator
+ Logic.Financial.VatReport.Designer.cs
+
diff --git a/Logic/Resources/Logic.Financial.VatReport.Designer.cs b/Logic/Resources/Logic.Financial.VatReport.Designer.cs
new file mode 100644
index 00000000..3f675068
--- /dev/null
+++ b/Logic/Resources/Logic.Financial.VatReport.Designer.cs
@@ -0,0 +1,90 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Swarmops.Logic.Resources {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Logic_Financial_VatReport {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Logic_Financial_VatReport() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Swarmops.Logic.Resources.Logic.Financial.VatReport", typeof(Logic_Financial_VatReport).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to VAT report {0}.
+ ///
+ internal static string Description_FullYear {
+ get {
+ return ResourceManager.GetString("Description_FullYear", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to VAT report for {0:yyyy} {0:MMM}-{1:MMM}.
+ ///
+ internal static string Description_Months {
+ get {
+ return ResourceManager.GetString("Description_Months", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to VAT report for {0:MMMM} {0:yyyy}.
+ ///
+ internal static string Description_SingleMonth {
+ get {
+ return ResourceManager.GetString("Description_SingleMonth", resourceCulture);
+ }
+ }
+ }
+}
diff --git a/Logic/Resources/Logic.Financial.VatReport.resx b/Logic/Resources/Logic.Financial.VatReport.resx
new file mode 100644
index 00000000..ba89f587
--- /dev/null
+++ b/Logic/Resources/Logic.Financial.VatReport.resx
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ VAT report {0}
+
+
+ VAT report for {0:yyyy} {0:MMM}-{1:MMM}
+
+
+ VAT report for {0:MMMM} {0:yyyy}
+
+
\ No newline at end of file
diff --git a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx
index 30aeeb05..c78b0d5e 100644
--- a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx
+++ b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx
@@ -37,7 +37,12 @@
function onFixTransaction(newTransactionId) {
transactionId = newTransactionId;
$('span#spanModalTransactionId').text("<%=Resources.Global.Global_LoadingPlaceholder%>");
- SwarmopsJS.formatInteger(transactionId, function (result) { $('span#spanModalTransactionId').text(result); });
+ SwarmopsJS.ajaxCall(
+ '/Pages/v5/Ledgers/BalanceTransactions.aspx/GetTransactionDisplayIdentity',
+ { transactionId: transactionId },
+ function(result) {
+ $('span#spanModalTransactionId').text(result);
+ });
$('input:radio[name="TxOptions"]').prop('checked', false);
$('div.radioOption').hide();
<%= this.DialogTx.ClientID %>_open();
@@ -96,6 +101,16 @@
}
+ if (data.OpenVatReportData != null && data.OpenVatReportData.length > 0) {
+ $('#divVatReport').show();
+ <%=this.DropOpenVatReports.ClientID%>_loadData(data.OpenVatReportData);
+ <%=this.DropOpenVatReports.ClientID%>_text("<%=Resources.Global.Global_SelectOne%>");
+ } else {
+ $('#divVatReport').hide();
+ <%=this.DropOpenVatReports.ClientID%>_loadData({});
+ <%=this.DropOpenVatReports.ClientID%>_text("<%=Resources.Global.Global_NoMatch%>");
+ }
+
});
}
@@ -161,6 +176,21 @@
}
}
+
+ function onMatchVatReport() {
+ var vatReportId = <%=this.DropOpenVatReports.ClientID%>_val();
+
+ if (vatReportId > 0) {
+ <%= this.DialogTx.ClientID %>_close();
+ SwarmopsJS.ajaxCall(
+ "/Pages/v5/Ledgers/BalanceTransactions.aspx/MatchTransactionOpenVatReport",
+ { transactionId: transactionId, vatReportId: vatReportId },
+ function () {
+ $('#gridTransactions').datagrid('reload');
+ });
+
+ } }
+
var buttonBalanceValue = SwarmopsJS.unescape('<%=this.Localized_ButtonBalance%>');
var buttonPayoutValue = SwarmopsJS.unescape('<%=this.Localized_ButtonPayout%>');
var buttonPayoutForeignValue = SwarmopsJS.unescape('<%=this.Localized_ButtonPayoutForeign%>');
@@ -260,6 +290,18 @@
+
diff --git a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.cs b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.cs
index c8ae03d4..87d218a3 100644
--- a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.cs
+++ b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.cs
@@ -62,7 +62,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
public string DifferingAmount { get; set; }
public DropdownOptions OpenPayoutData { get; set; }
public DropdownOptions OpenOutboundInvoiceData { get; set; }
- public DropdownOptions OpenVatReports { get; set; }
+ public DropdownOption[] OpenVatReportData { get; set; }
}
[Serializable]
@@ -112,7 +112,6 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
if (transaction.Rows.AmountCentsTotal > 0)
{
result.OpenOutboundInvoiceData = GetOpenOutboundInvoiceData(transaction);
- result.OpenVatReports = null; // TODO
}
else
{
@@ -121,6 +120,8 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
result.OpenPayoutData = GetOpenPayoutData(transaction);
}
+ result.OpenVatReportData = GetOpenVatReportData(transaction);
+
return result;
}
@@ -256,6 +257,34 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
return false;
}
+
+
+ private static DropdownOption[] GetOpenVatReportData(FinancialTransaction transaction)
+ {
+ VatReports vatReports = VatReports.ForOrganization(transaction.Organization);
+ List matches = new List();
+ Int64 txDiffCents = transaction.Rows.AmountCentsTotal; // is zero on a healthy tx
+
+ foreach (VatReport report in vatReports)
+ {
+ Int64 vatDiffCents = report.VatInboundCents - report.VatOutboundCents; // produces positive value for surplus; same as tx on match
+
+ if (vatDiffCents == txDiffCents)
+ {
+ matches.Add(new DropdownOption
+ {
+ id = report.Identity.ToString(CultureInfo.InvariantCulture),
+ @group = Resources.Pages.Ledgers.BalanceTransactions_ExactMatches,
+ text = report.Description
+ });
+ }
+ }
+
+ return matches.ToArray();
+ }
+
+
+
[WebMethod]
public static void BalanceTransactionManually(int transactionId, int accountId)
{
@@ -421,6 +450,16 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
}
+
+ [WebMethod]
+ public static string GetTransactionDisplayIdentity(int transactionId)
+ {
+ FinancialTransaction tx = FinancialTransaction.FromIdentity(transactionId);
+ return tx.OrganizationSequenceId.ToString("N0");
+ }
+
+
+
// ---- Localized resources ----
diff --git a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.designer.cs b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.designer.cs
index 61976048..733dc180 100644
--- a/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.designer.cs
+++ b/Site/Pages/v5/Ledgers/BalanceTransactions.aspx.designer.cs
@@ -210,6 +210,33 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers {
///
protected global::System.Web.UI.WebControls.Label LabelDescribeOutboundInvoice;
+ ///
+ /// LabelRadioVatReport control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label LabelRadioVatReport;
+
+ ///
+ /// DropOpenVatReports control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::Swarmops.Frontend.Controls.Base.DropDown DropOpenVatReports;
+
+ ///
+ /// LabelDescrribeVatReport control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label LabelDescrribeVatReport;
+
///
/// LabelRadioExistingPayment control.
///