Even more ready for pilot test

This commit is contained in:
Rick Falkvinge
2018-05-05 16:02:31 +02:00
parent cbef359a42
commit d9cf6067d0
3 changed files with 53 additions and 68 deletions
+18 -45
View File
@@ -1761,42 +1761,6 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to Different banks have different means of obtaining the BGMAX format file. On SEB, you go to &lt;strong&gt;Payments&lt;/strong&gt; and &lt;strong&gt;File communications&lt;/strong&gt; to see a list of files to retrieve. Other banks will vary. In any case, upload them here..
/// </summary>
internal static string UploadBankFiles_DownloadInstructions_BankgiroSEFile {
get {
return ResourceManager.GetString("UploadBankFiles_DownloadInstructions_BankgiroSEFile", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Log on to PayPal. Go to &lt;strong&gt;Your Account&lt;/strong&gt;, and under the &lt;strong&gt;History&lt;/strong&gt; menu, select &lt;strong&gt;Download History&lt;/strong&gt;. Select &lt;strong&gt;Custom Date Range&lt;/strong&gt;, enter the range since last download (as indicated) plus some overlap, and most importantly, select &lt;strong&gt;Tab Delimited - All Activity&lt;/strong&gt;. Click &lt;strong&gt;Download&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Some time will pass before you get a mail from PayPal saying that the file is ready for download. It will be named &lt;em&gt;download.txt&lt;/em&gt;. Uplo [rest of string was truncated]&quot;;.
/// </summary>
internal static string UploadBankFiles_DownloadInstructions_PaypalFile {
get {
return ResourceManager.GetString("UploadBankFiles_DownloadInstructions_PaypalFile", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Log on to Payson. Go to the &lt;strong&gt;History&lt;/strong&gt; tab, and click &lt;strong&gt;Export history&lt;/strong&gt;. The downloaded file will be named &lt;em&gt;Payson_Export_[date].xls&lt;/em&gt;. Upload this file..
/// </summary>
internal static string UploadBankFiles_DownloadInstructions_PaysonFile {
get {
return ResourceManager.GetString("UploadBankFiles_DownloadInstructions_PaysonFile", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Open SEB&apos;s internet bank. Go to &lt;strong&gt;your account&lt;/strong&gt;, and enter the date span you wish to download in the search box. Press &lt;strong&gt;filter&lt;/strong&gt;. After that, click the link to &lt;strong&gt;save the account history&lt;/strong&gt;. A popup will appear. Choose &lt;strong&gt;csv&lt;/strong&gt; and &lt;strong&gt;tab separated&lt;/strong&gt;, then &lt;strong&gt;save&lt;/strong&gt;. The downloaded file will be named &lt;em&gt;Kontohändelser.csv&lt;/em&gt;. Upload this file..
/// </summary>
internal static string UploadBankFiles_DownloadInstructions_SebAccountFile {
get {
return ResourceManager.GetString("UploadBankFiles_DownloadInstructions_SebAccountFile", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;p&gt;The file contained {0:N0} transactions. &lt;strong&gt;{1:N0} transactions&lt;/strong&gt; have been successfully imported into the &lt;em&gt;{2}&lt;/em&gt; bookkeeping account. ({3:N0} transactions were duplicates.)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;However, the bank balance does not match the records in Swarmops.&lt;/strong&gt; This is usually due to missing transactions. Please upload a transaction list with a larger time span to make sure that Swarmops sees all transactions.&lt;/p&gt;&lt;p&gt;Swarmops&apos;s bookkeeping account is currently &lt;strong&gt;not in sync&lt;/strong [rest of string was truncated]&quot;;.
/// </summary>
@@ -1860,15 +1824,6 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to As this was the first upload to this automated account, the initial balance of {0} {1:N2} going into the year {2} has been detected and set..
/// </summary>
internal static string UploadBankFiles_FirstUploadBalanceSet {
get {
return ResourceManager.GetString("UploadBankFiles_FirstUploadBalanceSet", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Error on importing file.
/// </summary>
@@ -2022,6 +1977,24 @@ namespace Resources.Pages {
}
}
/// <summary>
/// Looks up a localized string similar to As this was the first upload to this automated account, the initial balance of &lt;strong&gt;{0} {1:N2}&lt;/strong&gt; going into the year {2} has been detected and set .
/// </summary>
internal static string UploadBankFiles_ResultsInitialBalanceSet {
get {
return ResourceManager.GetString("UploadBankFiles_ResultsInitialBalanceSet", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to (which was accounted for with &lt;strong&gt;{0} {1:N2}&lt;/strong&gt; in the presentation currency).
/// </summary>
internal static string UploadBankFiles_ResultsInitialBalanceSetForeignCurrency {
get {
return ResourceManager.GetString("UploadBankFiles_ResultsInitialBalanceSetForeignCurrency", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to &lt;br/&gt;&lt;p&gt;The payments file was &lt;strong&gt;successfully imported.&lt;/strong&gt; {1:N0} payment(s) in {0:N0} group(s), totalling {3} {2:N2}, were imported.&lt;/p&gt;.
/// </summary>
+7 -16
View File
@@ -241,19 +241,6 @@
<value>Bank Download Instructions</value>
<comment>Header above instructions for generation of the bank file type selected.</comment>
</data>
<data name="UploadBankFiles_DownloadInstructions_BankgiroSEFile" xml:space="preserve">
<value>Different banks have different means of obtaining the BGMAX format file. On SEB, you go to &lt;strong&gt;Payments&lt;/strong&gt; and &lt;strong&gt;File communications&lt;/strong&gt; to see a list of files to retrieve. Other banks will vary. In any case, upload them here.</value>
</data>
<data name="UploadBankFiles_DownloadInstructions_PaypalFile" xml:space="preserve">
<value>Log on to PayPal. Go to &lt;strong&gt;Your Account&lt;/strong&gt;, and under the &lt;strong&gt;History&lt;/strong&gt; menu, select &lt;strong&gt;Download History&lt;/strong&gt;. Select &lt;strong&gt;Custom Date Range&lt;/strong&gt;, enter the range since last download (as indicated) plus some overlap, and most importantly, select &lt;strong&gt;Tab Delimited - All Activity&lt;/strong&gt;. Click &lt;strong&gt;Download&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;Some time will pass before you get a mail from PayPal saying that the file is ready for download. It will be named &lt;em&gt;download.txt&lt;/em&gt;. Upload this file.</value>
</data>
<data name="UploadBankFiles_DownloadInstructions_PaysonFile" xml:space="preserve">
<value>Log on to Payson. Go to the &lt;strong&gt;History&lt;/strong&gt; tab, and click &lt;strong&gt;Export history&lt;/strong&gt;. The downloaded file will be named &lt;em&gt;Payson_Export_[date].xls&lt;/em&gt;. Upload this file.</value>
</data>
<data name="UploadBankFiles_DownloadInstructions_SebAccountFile" xml:space="preserve">
<value>Open SEB's internet bank. Go to &lt;strong&gt;your account&lt;/strong&gt;, and enter the date span you wish to download in the search box. Press &lt;strong&gt;filter&lt;/strong&gt;. After that, click the link to &lt;strong&gt;save the account history&lt;/strong&gt;. A popup will appear. Choose &lt;strong&gt;csv&lt;/strong&gt; and &lt;strong&gt;tab separated&lt;/strong&gt;, then &lt;strong&gt;save&lt;/strong&gt;. The downloaded file will be named &lt;em&gt;Kontohändelser.csv&lt;/em&gt;. Upload this file.</value>
<comment>Only translate to languages where SEB is active.</comment>
</data>
<data name="UploadBankFiles_ErrorBalance" xml:space="preserve">
<value>&lt;p&gt;The file contained {0:N0} transactions. &lt;strong&gt;{1:N0} transactions&lt;/strong&gt; have been successfully imported into the &lt;em&gt;{2}&lt;/em&gt; bookkeeping account. ({3:N0} transactions were duplicates.)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;However, the bank balance does not match the records in Swarmops.&lt;/strong&gt; This is usually due to missing transactions. Please upload a transaction list with a larger time span to make sure that Swarmops sees all transactions.&lt;/p&gt;&lt;p&gt;Swarmops's bookkeeping account is currently &lt;strong&gt;not in sync&lt;/strong&gt; with that of the bank.&lt;/p&gt;</value>
<comment>Displayed when import successful, but end balance out of sync. Assumes plural along all pasted numbers.</comment>
@@ -983,8 +970,12 @@
<data name="UploadBankFiles_Error_NoAutomationProfiles" xml:space="preserve">
<value>There are no asset accounts set up for automation, so no accounts support data upload at this time. Returning to Dashboard.</value>
</data>
<data name="UploadBankFiles_FirstUploadBalanceSet" xml:space="preserve">
<value>As this was the first upload to this automated account, the initial balance of {0} {1:N2} going into the year {2} has been detected and set.</value>
<comment>{0} is currency, {1} is amount, {2} is the first accounting year</comment>
<data name="UploadBankFiles_ResultsInitialBalanceSet" xml:space="preserve">
<value>As this was the first upload to this automated account, the initial balance of &lt;strong&gt;{0} {1:N2}&lt;/strong&gt; going into the year {2} has been detected and set </value>
<comment>{1} {2:N2} is the currency and amount, like USD 2,151.00.</comment>
</data>
<data name="UploadBankFiles_ResultsInitialBalanceSetForeignCurrency" xml:space="preserve">
<value>(which was accounted for with &lt;strong&gt;{0} {1:N2}&lt;/strong&gt; in the presentation currency)</value>
<comment>{0} {1:N2} is a currency and amount, which is how an initial bank balance in a foreign currency was entered into the ledgers after converting to the organization's accounting currency</comment>
</data>
</root>
+28 -7
View File
@@ -283,6 +283,8 @@ namespace Swarmops.Site.Pages.Ledgers
[WebMethod]
public static ReportedImportResults GetReportedImportResults (string guid)
{
AuthenticationData authData = GetAuthenticationDataAndCulture();
ReportedImportResults results = new ReportedImportResults();
ImportResultsCategory category = (ImportResultsCategory) GuidCache.Get (guid + "-Result");
ImportResults resultDetail = GuidCache.Get (guid + "-ResultDetails") as ImportResults;
@@ -297,7 +299,26 @@ namespace Swarmops.Site.Pages.Ledgers
resultDetail.TransactionsImported, resultDetail.DuplicateTransactions,
resultDetail.EarliestTransaction, resultDetail.LatestTransaction);
// if (resultDetail.)
if (resultDetail.InitialBalanceCents != 0)
{
html += "<p>" +
String.Format(Resources.Pages.Ledgers.UploadBankFiles_ResultsInitialBalanceSet,
Currency.FromCode(resultDetail.InitialBalanceCurrencyCode).DisplayCode,
resultDetail.InitialBalanceCents/100.0);
if (resultDetail.CurrencyCode != resultDetail.InitialBalanceCurrencyCode)
{
// nonpresentation currency
html +=
String.Format(
Resources.Pages.Ledgers.UploadBankFiles_ResultsInitialBalanceSetForeignCurrency,
Currency.FromCode(resultDetail.CurrencyCode).DisplayCode,
resultDetail.BalanceMismatchCents);
}
html += ".</p>";
}
break;
case ImportResultsCategory.Questionable:
@@ -372,7 +393,7 @@ namespace Swarmops.Site.Pages.Ledgers
ImportResults results = ProcessImportedData (externalData, (ProcessThreadArguments) args);
GuidCache.Set (guid + "-ResultDetails", results);
if (results.AccountBalanceMatchesBank)
if (results.AccountBalanceMatchesBank || results.InitialBalanceCents != 0)
{
GuidCache.Set (guid + "-Result", ImportResultsCategory.Good);
}
@@ -789,11 +810,11 @@ namespace Swarmops.Site.Pages.Ledgers
if (autosetInitialBalance)
{
Int64 newInitialBalanceCents = result.BalanceMismatchCents - importedCentsTotal;
Int64 newInitialBalanceCents = result.BalanceMismatchCents;
assetAccount.InitialBalanceCents = new Money(newInitialBalanceCents, accountCurrency);
result.InitialBalanceCents = (newInitialBalanceCents/100.0).ToString("N2");
result.InitialBalanceCurrency = accountCurrency.DisplayCode;
result.InitialBalanceCents = newInitialBalanceCents;
result.InitialBalanceCurrencyCode = accountCurrency.Code;
}
}
@@ -1029,8 +1050,8 @@ namespace Swarmops.Site.Pages.Ledgers
public DateTime EarliestTransaction;
public DateTime LatestTransaction;
public int TransactionsImported;
public string InitialBalanceCents;
public string InitialBalanceCurrency;
public Int64 InitialBalanceCents;
public string InitialBalanceCurrencyCode;
public ImportResults()
{