diff --git a/Logic/Financial/ExternalBankData.cs b/Logic/Financial/ExternalBankData.cs index 9be25068..83a3e6db 100644 --- a/Logic/Financial/ExternalBankData.cs +++ b/Logic/Financial/ExternalBankData.cs @@ -131,10 +131,21 @@ namespace Swarmops.Logic.Financial ExternalBankDataRecord newRecord = new ExternalBankDataRecord(); - if (fieldNameLookup.ContainsKey (ExternalBankDataFieldName.Description)) + if (fieldNameLookup.ContainsKey (ExternalBankDataFieldName.DescriptionPrimary)) { newRecord.Description = - StripQuotes (lineFields[fieldNameLookup[ExternalBankDataFieldName.Description]]); + StripQuotes (lineFields[fieldNameLookup[ExternalBankDataFieldName.DescriptionPrimary]]); + } + + // If primary description is empty, try to apply a secondary description + + if (String.IsNullOrEmpty(newRecord.Description)) + { + if (fieldNameLookup.ContainsKey(ExternalBankDataFieldName.DescriptionSecondary)) + { + newRecord.Description = + StripQuotes(lineFields[fieldNameLookup[ExternalBankDataFieldName.DescriptionSecondary]]); + } } if (fieldNameLookup.ContainsKey (ExternalBankDataFieldName.AccountBalance)) diff --git a/Logic/Financial/ExternalBankDataProfile.cs b/Logic/Financial/ExternalBankDataProfile.cs index 8337956e..332d40e7 100644 --- a/Logic/Financial/ExternalBankDataProfile.cs +++ b/Logic/Financial/ExternalBankDataProfile.cs @@ -74,7 +74,7 @@ namespace Swarmops.Logic.Financial result.Culture = "sv-SE"; result.FieldNames[ExternalBankDataFieldName.Date] = "Bokföringsdatum"; - result.FieldNames[ExternalBankDataFieldName.Description] = "Text/mottagare"; + result.FieldNames[ExternalBankDataFieldName.DescriptionPrimary] = "Text/mottagare"; result.FieldNames[ExternalBankDataFieldName.TransactionNet] = "Belopp"; result.FieldNames[ExternalBankDataFieldName.AccountBalance] = "Saldo"; result.FieldNames[ExternalBankDataFieldName.NotUniqueId] = "Verifikationsnummer"; @@ -98,7 +98,7 @@ namespace Swarmops.Logic.Financial result.FieldNames[ExternalBankDataFieldName.Date] = "Date"; result.FieldNames[ExternalBankDataFieldName.Time] = "Time"; result.FieldNames[ExternalBankDataFieldName.TimeZone] = "Time Zone"; - result.FieldNames[ExternalBankDataFieldName.Description] = "Name"; + result.FieldNames[ExternalBankDataFieldName.DescriptionPrimary] = "Name"; result.FieldNames[ExternalBankDataFieldName.Currency] = "Currency"; result.FieldNames[ExternalBankDataFieldName.TransactionGross] = "Gross"; result.FieldNames[ExternalBankDataFieldName.TransactionFee] = "Fee"; @@ -125,7 +125,8 @@ namespace Swarmops.Logic.Financial result.InitialReplacements = ";|\t| €|"; result.FieldNames[ExternalBankDataFieldName.Date] = "Buchungstag"; - result.FieldNames[ExternalBankDataFieldName.Description] = "Buchungsdetails"; + result.FieldNames[ExternalBankDataFieldName.DescriptionPrimary] = "Buchungsdetails"; + result.FieldNames[ExternalBankDataFieldName.DescriptionSecondary] = "Umsatzart"; result.FieldNames[ExternalBankDataFieldName.TransactionNet] = "Betrag (€)"; result.FieldNames[ExternalBankDataFieldName.AccountBalance] = "Saldo (€)"; @@ -150,7 +151,8 @@ namespace Swarmops.Logic.Financial TransactionGross, TransactionFee, TransactionNet, - Description, + DescriptionPrimary, + DescriptionSecondary, UniqueId, NotUniqueId, Date, diff --git a/Logic/Financial/VatReport.cs b/Logic/Financial/VatReport.cs index d59e04ce..83f308b6 100644 --- a/Logic/Financial/VatReport.cs +++ b/Logic/Financial/VatReport.cs @@ -260,7 +260,7 @@ namespace Swarmops.Logic.Financial } } - public new int OpenTransactionId + private new int OpenTransactionId { get { @@ -283,7 +283,7 @@ namespace Swarmops.Logic.Financial set { this.OpenTransactionId = value.Identity; } } - public new int CloseTransactionId + private new int CloseTransactionId { get { return base.CloseTransactionId; } set @@ -305,6 +305,7 @@ namespace Swarmops.Logic.Financial if (value != null) { this.CloseTransactionId = value.Identity; + value.Dependency = this; this.Open = false; } else