Removed hardcoding of bank profile
This commit is contained in:
@@ -187,8 +187,23 @@ namespace Swarmops.Logic.Financial
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ExternalBankDataProfile ExternalBankDataProfile
|
||||
{
|
||||
get
|
||||
{
|
||||
ExternalBankDataProfile oldProfile = ExternalBankDataProfileOldHack;
|
||||
ExternalBankDataProfile newProfile = AutomationProfile.BankDataProfile;
|
||||
|
||||
if (oldProfile != null && newProfile != oldProfile)
|
||||
{
|
||||
throw new InvalidOperationException("Defensive programming for crucial part");
|
||||
}
|
||||
|
||||
return newProfile;
|
||||
}
|
||||
}
|
||||
|
||||
private ExternalBankDataProfile ExternalBankDataProfileOldHack
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
@@ -263,6 +263,15 @@ namespace Swarmops.Site.Pages.Ledgers
|
||||
};
|
||||
}
|
||||
|
||||
if (profile.Currency == null) // uses presentation currency
|
||||
{
|
||||
return new AjaxCallResult
|
||||
{
|
||||
Success = true,
|
||||
DisplayMessage = profile.Name
|
||||
};
|
||||
}
|
||||
|
||||
return new AjaxCallResult
|
||||
{
|
||||
Success = true,
|
||||
|
||||
Reference in New Issue
Block a user