From 3e484ab26ba499ea97354317fc0500270d41318f Mon Sep 17 00:00:00 2001 From: Tomek Melissa Date: Mon, 17 Feb 2020 19:50:14 +0100 Subject: [PATCH] Fix #99 --- Job.Import/Import.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Job.Import/Import.cs b/Job.Import/Import.cs index 6035cba..7607bea 100644 --- a/Job.Import/Import.cs +++ b/Job.Import/Import.cs @@ -277,11 +277,11 @@ namespace RecurringIntegrationsScheduler.Job { //Now send import request var targetLegalEntity = _settings.Company; - if (_settings.GetLegalEntityFromSubfolder) + if (_settings.MultiCompanyImport &&_settings.GetLegalEntityFromSubfolder) { targetLegalEntity = new FileInfo(dataMessage.FullPath).Directory.Name; } - if (_settings.GetLegalEntityFromFilename) + if (_settings.MultiCompanyImport &&_settings.GetLegalEntityFromFilename) { String[] separator = { _settings.FilenameSeparator }; var tokenList = dataMessage.Name.Split(separator, 10, StringSplitOptions.RemoveEmptyEntries); @@ -293,7 +293,6 @@ namespace RecurringIntegrationsScheduler.Job Log.ErrorFormat(CultureInfo.InvariantCulture, string.Format(Resources.Job_0_Target_legal_entity_is_not_valid_1, _context.JobDetail.Key, targetLegalEntity)); } - if(string.IsNullOrEmpty(targetLegalEntity)) { throw new Exception(string.Format(Resources.Job_0_Unable_to_get_target_legal_entity_name, _context.JobDetail.Key));