|
@@ -183,24 +183,29 @@ public abstract class MYOBPosterEngine<TPostable, TSettings> :
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(globalSettings.CompanyFileUserID.IsNullOrWhiteSpace())
|
|
|
+ if(!globalSettings.NoCredentials && globalSettings.CompanyFileUserID.IsNullOrWhiteSpace())
|
|
|
{
|
|
|
var credentials = new MYOBCompanyFileCredentials
|
|
|
{
|
|
|
UserID = globalSettings.CompanyFileUserID,
|
|
|
Password = globalSettings.CompanyFilePassword,
|
|
|
+ NoCredentials = globalSettings.NoCredentials
|
|
|
};
|
|
|
if (DynamicGridUtils.EditObject(credentials, customiseGrid: grid =>
|
|
|
{
|
|
|
grid.OnValidate += (grid, items, errors) =>
|
|
|
{
|
|
|
- if(items.Any(x => x.UserID.IsNullOrWhiteSpace()))
|
|
|
+ var item = items.FirstOrDefault();
|
|
|
+ if (item is null) return;
|
|
|
+
|
|
|
+ if(!item.NoCredentials && item.UserID.IsNullOrWhiteSpace())
|
|
|
{
|
|
|
errors.Add("[UserID] cannot be blank");
|
|
|
}
|
|
|
};
|
|
|
}))
|
|
|
{
|
|
|
+ globalSettings.NoCredentials = credentials.NoCredentials;
|
|
|
globalSettings.CompanyFileUserID = credentials.UserID;
|
|
|
globalSettings.CompanyFilePassword = credentials.Password;
|
|
|
|