Added 'empty set' response to Unbalanced

This commit is contained in:
Rick Falkvinge
2020-01-02 21:32:00 +01:00
parent 111afec77e
commit 3778f0f8e1
3 changed files with 44 additions and 6 deletions
+22 -4
View File
@@ -861,6 +861,15 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to There are no unbalanced transactions. Yay!.
/// </summary>
internal static string BalanceTransactions_NoUnbalancedTransactions {
get {
return ResourceManager.GetString("BalanceTransactions_NoUnbalancedTransactions", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Amount Within 1% Tolerance.
/// </summary>
@@ -1178,7 +1187,7 @@ namespace Resources.Pages {
}
/// <summary>
/// Looks up a localized string similar to External Account Data and Match Accounts.
/// Looks up a localized string similar to External Account Data and Account Matching.
/// </summary>
internal static string EndOfMonth_Header_ExternalData {
get {
@@ -1196,11 +1205,11 @@ namespace Resources.Pages {
}
/// <summary>
/// Looks up a localized string similar to Send Reports to Accountants, Shareholders, etc..
/// Looks up a localized string similar to Quarterly Reports.
/// </summary>
internal static string EndOfMonth_Header_SendReports {
internal static string EndOfMonth_Header_QuarterlyReports {
get {
return ResourceManager.GetString("EndOfMonth_Header_SendReports", resourceCulture);
return ResourceManager.GetString("EndOfMonth_Header_QuarterlyReports", resourceCulture);
}
}
@@ -1240,6 +1249,15 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to Send Reports to Accountants, Shareholders, etc..
/// </summary>
internal static string EndOfMonth_SendReports {
get {
return ResourceManager.GetString("EndOfMonth_SendReports", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;strong&gt;SKIP BANK STATEMENT?&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;Bank statements are typically needed for audit verification of the internal records. The only valid reason to skip a month&apos;s statement is that the account wasn&apos;t opened yet, in which case you skip the months before the account was opened and no statements therefore exist.&lt;br/&gt;&lt;br/&gt;You won&apos;t be asked again to upload this particular statement if you skip it now..
/// </summary>
+9 -2
View File
@@ -997,14 +997,14 @@
<comment>This is the header for closing of ledgers and generation of annual reports at the end-of-month routine</comment>
</data>
<data name="EndOfMonth_Header_ExternalData" xml:space="preserve">
<value>External Account Data and Match Accounts</value>
<value>External Account Data and Account Matching</value>
<comment>This is the header for uploading bank statements and resolving unmatched transactions at end-of-month.</comment>
</data>
<data name="EndOfMonth_Header_PayrollTaxes" xml:space="preserve">
<value>Payroll And Taxes</value>
<comment>This is the header for all tax reports and payroll processing for the end-of-month (start-of-next-month) routine.</comment>
</data>
<data name="EndOfMonth_Header_SendReports" xml:space="preserve">
<data name="EndOfMonth_SendReports" xml:space="preserve">
<value>Send Reports to Accountants, Shareholders, etc.</value>
<comment>This is the header for all items that send reports to external people at the end-of-month routine.</comment>
</data>
@@ -1075,12 +1075,19 @@ This can happen after bitcoin splits (&amp;quot;forks&amp;quot;) or similar even
<value>Inspect Bitcoin Cash Hotwallet For</value>
<comment>This is followed by a year and month dropdown</comment>
</data>
<data name="BalanceTransactions_NoUnbalancedTransactions" xml:space="preserve">
<value>There are no unbalanced transactions. Yay!</value>
</data>
<data name="EndOfMonth_Error_Body_BankTransactionFileFormat" xml:space="preserve">
<value>The transaction file could not be processed. Is it the right file? For the right bank? Please try again.&lt;br/&gt;&lt;br/&gt;If the error persists, try getting a fresh transaction file.</value>
</data>
<data name="EndOfMonth_Error_Header_BankTransactionFile" xml:space="preserve">
<value>FILE COULD NOT BE IMPORTED</value>
</data>
<data name="EndOfMonth_Header_QuarterlyReports" xml:space="preserve">
<value>Quarterly Reports</value>
<comment>Presented in April, July, and October. Not in January (those are annual reports).</comment>
</data>
<data name="EndOfMonth_Warning_Header_BankTransactionFile" xml:space="preserve">
<value>PROBLEM WITH TRANSACTION FILE</value>
</data>
@@ -17,6 +17,19 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
if (
CurrentAuthority.HasAccess (new Access (CurrentOrganization, AccessAspect.BookkeepingDetails, AccessType.Read)))
{
if (unbalancedTransactions.Count == 0)
{
if (rows.Count == 0)
{
// If there are no transactions in this time period, say so
Response.Output.WriteLine("[{\"description\":\"" +
JsonSanitize(Resources.Pages.Ledgers.BalanceTransactions_NoUnbalancedTransactions) + "\"}]");
Response.End();
return;
}
}
foreach (FinancialTransaction transaction in unbalancedTransactions)
{
string accountName = string.Empty;