case 4341

This commit is contained in:
2022-12-13 22:17:39 +00:00
parent b74cc584b3
commit b090c1040d
22 changed files with 65 additions and 38 deletions

View File

@@ -172,7 +172,7 @@ namespace AyaNova.Api.Controllers
return Ok(ApiOkResponse.Response(new
{
customerpost = new PostalAddressRecord(cust.Name, cust.PostAddress, cust.PostCity, cust.PostRegion, cust.PostCountry, cust.PostCode),
customerphys = new AddressRecord(cust.Name, cust.Address, cust.City, cust.Region, cust.Country, cust.Latitude, cust.Longitude),
customerphys = new AddressRecord(cust.Name, cust.Address, cust.City, cust.Region, cust.Country, cust.AddressPostal, cust.Latitude, cust.Longitude),
headofficepost = (head != null ? new PostalAddressRecord(head.Name, head.PostAddress, head.PostCity, head.PostRegion, head.PostCountry, head.PostCode) : new PostalAddressRecord("", "", "", "", "", ""))
}));
}

View File

@@ -174,7 +174,7 @@ namespace AyaNova.Api.Controllers
return Ok(ApiOkResponse.Response(new
{
unit = new AddressRecord(unt.Serial, unt.Address, unt.City, unt.Region, unt.Country, unt.Latitude, unt.Longitude)
unit = new AddressRecord(unt.Serial, unt.Address, unt.City, unt.Region, unt.Country, unt.AddressPostal, unt.Latitude, unt.Longitude)
}));
}

View File

@@ -249,6 +249,7 @@ namespace AyaNova.Biz
.AddText(obj.City)
.AddText(obj.Region)
.AddText(obj.Country)
.AddText(obj.AddressPostal)
.AddCustomFields(obj.CustomFields);
}

View File

@@ -218,7 +218,8 @@ namespace AyaNova.Biz
.AddText(obj.Address)
.AddText(obj.City)
.AddText(obj.Region)
.AddText(obj.Country)
.AddText(obj.Country)
.AddText(obj.AddressPostal)
.AddCustomFields(obj.CustomFields);
}

View File

@@ -652,6 +652,7 @@ namespace AyaNova.Biz
.AddText(obj.City)
.AddText(obj.Region)
.AddText(obj.Country)
.AddText(obj.AddressPostal)
.AddText(obj.Wiki)
.AddText(obj.Tags)
.AddCustomFields(obj.CustomFields);

View File

@@ -632,6 +632,7 @@ namespace AyaNova.Biz
.AddText(obj.City)
.AddText(obj.Region)
.AddText(obj.Country)
.AddText(obj.AddressPostal)
.AddText(obj.Wiki)
.AddText(obj.Tags)
.AddCustomFields(obj.CustomFields);

View File

@@ -667,9 +667,9 @@ namespace AyaNova.Biz
sLatitude = ServerGlobalBizSettings.Cache.Latitude.ToString();
if (ServerGlobalBizSettings.Cache.Longitude != null)
sLongitude = ServerGlobalBizSettings.Cache.Longitude.ToString();
var serverMeta = $"{{ayApiUrl:`{apiUrl}`, HasSmallLogo:{HasSmallLogo}, HasMediumLogo:{HasMediumLogo}, HasLargeLogo:{HasLargeLogo},CompanyName: `{AyaNova.Core.License.ActiveKey.RegisteredTo}`,CompanyWebAddress:`{ServerGlobalBizSettings.Cache.WebAddress}`,CompanyEmailAddress:`{ServerGlobalBizSettings.Cache.EmailAddress}`,CompanyPhone1:`{ServerGlobalBizSettings.Cache.Phone1}`,CompanyPhone2:`{ServerGlobalBizSettings.Cache.Phone2}`,HasPostalAddress:{HasPostalAddress},CompanyPostAddress:`{ServerGlobalBizSettings.Cache.PostAddress}`,CompanyPostCity:`{ServerGlobalBizSettings.Cache.PostCity}`,CompanyPostRegion:`{ServerGlobalBizSettings.Cache.PostRegion}`,CompanyPostCountry:`{ServerGlobalBizSettings.Cache.PostCountry}`,CompanyPostCode:`{ServerGlobalBizSettings.Cache.PostCode}`,HasStreetAddress:{HasStreetAddress},CompanyAddress:`{ServerGlobalBizSettings.Cache.Address}`,CompanyCity:`{ServerGlobalBizSettings.Cache.City}`,CompanyRegion:`{ServerGlobalBizSettings.Cache.Region}`,CompanyCountry:`{ServerGlobalBizSettings.Cache.Country}`,CompanyLatitude:{sLatitude},CompanyLongitude:{sLongitude}}}";
var serverMeta = $"{{ayApiUrl:`{apiUrl}`, HasSmallLogo:{HasSmallLogo}, HasMediumLogo:{HasMediumLogo}, HasLargeLogo:{HasLargeLogo},CompanyName: `{AyaNova.Core.License.ActiveKey.RegisteredTo}`,CompanyWebAddress:`{ServerGlobalBizSettings.Cache.WebAddress}`,CompanyEmailAddress:`{ServerGlobalBizSettings.Cache.EmailAddress}`,CompanyPhone1:`{ServerGlobalBizSettings.Cache.Phone1}`,CompanyPhone2:`{ServerGlobalBizSettings.Cache.Phone2}`,HasPostalAddress:{HasPostalAddress},CompanyPostAddress:`{ServerGlobalBizSettings.Cache.PostAddress}`,CompanyPostCity:`{ServerGlobalBizSettings.Cache.PostCity}`,CompanyPostRegion:`{ServerGlobalBizSettings.Cache.PostRegion}`,CompanyPostCountry:`{ServerGlobalBizSettings.Cache.PostCountry}`,CompanyPostCode:`{ServerGlobalBizSettings.Cache.PostCode}`,HasStreetAddress:{HasStreetAddress},CompanyAddress:`{ServerGlobalBizSettings.Cache.Address}`,CompanyCity:`{ServerGlobalBizSettings.Cache.City}`,CompanyRegion:`{ServerGlobalBizSettings.Cache.Region}`,CompanyCountry:`{ServerGlobalBizSettings.Cache.Country}`,CompanyAddressPostal:`{ServerGlobalBizSettings.Cache.AddressPostal}`,CompanyLatitude:{sLatitude},CompanyLongitude:{sLongitude}}}";
log.LogDebug($"Preparing page: adding Report meta data");

View File

@@ -225,6 +225,7 @@ namespace AyaNova.Biz
.AddText(obj.City)
.AddText(obj.Region)
.AddText(obj.Country)
.AddText(obj.AddressPostal)
.AddCustomFields(obj.CustomFields);
}

View File

@@ -243,6 +243,7 @@ namespace AyaNova.Biz
.AddText(obj.City)
.AddText(obj.Region)
.AddText(obj.Country)
.AddText(obj.AddressPostal)
.AddCustomFields(obj.CustomFields);
}

View File

@@ -195,7 +195,7 @@ namespace AyaNova.Biz
//https://docs.microsoft.com/en-us/ef/core/querying/related-data
//docs say this will not query twice but will recognize the duplicate woitem bit which is required for multiple grandchild collections
return await ct.WorkOrder.AsSplitQuery().AsNoTracking()
.Include(s => s.States.OrderBy(item=> item.Id))
.Include(s => s.States.OrderBy(item => item.Id))
.Include(w => w.Items.OrderBy(item => item.Sequence))
.ThenInclude(wi => wi.Expenses)
.Include(w => w.Items)
@@ -782,6 +782,7 @@ namespace AyaNova.Biz
.AddText(obj.City)
.AddText(obj.Region)
.AddText(obj.Country)
.AddText(obj.AddressPostal)
.AddText(obj.Wiki)
.AddText(obj.Tags)
.AddCustomFields(obj.CustomFields);
@@ -1759,7 +1760,7 @@ namespace AyaNova.Biz
wo.DurationToCompleted = TimeSpan.Zero;
wo.LastStatusId = newObject.WorkOrderStatusId;
await ct.SaveChangesAsync();
newObject.NewWOConcurrency = wo.Concurrency;
newObject.NewWOConcurrency = wo.Concurrency;
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, AyaType.WorkOrderStatus, AyaEvent.Created), ct);
await transaction.CommitAsync();
await StateHandlePotentialNotificationEvent(AyaEvent.Created, newObject);

View File

@@ -63,6 +63,7 @@ namespace AyaNova.Models
public string City { get; set; }
public string Region { get; set; }
public string Country { get; set; }
public string AddressPostal { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }

View File

@@ -59,6 +59,7 @@ namespace AyaNova.Models
public string City { get; set; }
public string Region { get; set; }
public string Country { get; set; }
public string AddressPostal { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }

View File

@@ -51,6 +51,7 @@ namespace AyaNova.Models
public string City { get; set; }
public string Region { get; set; }
public string Country { get; set; }
public string AddressPostal { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }

View File

@@ -91,6 +91,7 @@ namespace AyaNova.Models
public string City { get; set; }
public string Region { get; set; }
public string Country { get; set; }
public string AddressPostal { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }

View File

@@ -84,6 +84,7 @@ namespace AyaNova.Models
public string City { get; set; }
public string Region { get; set; }
public string Country { get; set; }
public string AddressPostal { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }

View File

@@ -76,7 +76,8 @@ namespace AyaNova.Models
public string Address { get; set; }
public string City { get; set; }
public string Region { get; set; }
public string Country { get; set; }
public string Country { get; set; }
public string AddressPostal { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }

View File

@@ -48,6 +48,7 @@ namespace AyaNova.Models
public string City { get; set; }
public string Region { get; set; }
public string Country { get; set; }
public string AddressPostal { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }

View File

@@ -82,6 +82,7 @@ namespace AyaNova.Models
public string City { get; set; }
public string Region { get; set; }
public string Country { get; set; }
public string AddressPostal { get; set; }
public decimal? Latitude { get; set; }
public decimal? Longitude { get; set; }

View File

@@ -2,7 +2,7 @@
namespace AyaNova.Models
{
//physical
public record AddressRecord(string Name, string Address, string City, string Region, string Country, decimal? Latitude, decimal? Longitude);
public record AddressRecord(string Name, string Address, string City, string Region, string Country, string AddressPostal, decimal? Latitude, decimal? Longitude);
//postal
public record PostalAddressRecord(string Name, string PostAddress, string PostCity, string PostRegion, string PostCountry, string PostCode);
}

View File

@@ -20,7 +20,7 @@ namespace AyaNova.Util
/////////// CHANGE THIS ON NEW SCHEMA UPDATE ////////////////////
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 13;
private const int DESIRED_SCHEMA_LEVEL = 14;
internal const long EXPECTED_COLUMN_COUNT = 1380;
internal const long EXPECTED_INDEX_COUNT = 160;
@@ -1722,6 +1722,38 @@ CREATE OR REPLACE VIEW public.viewpartinventorylist
}
//////////////////////////////////////////////////
//
// case 4341
//
if (currentSchema < 14)
{
LogUpdateMessage(log);
await ExecQueryAsync("ALTER TABLE aglobalbizsettings ADD COLUMN postcodestreet TEXT;");
await ExecQueryAsync("ALTER TABLE acustomer ADD COLUMN postcodestreet TEXT;");
await ExecQueryAsync("ALTER TABLE aheadoffice ADD COLUMN postcodestreet TEXT;");
await ExecQueryAsync("ALTER TABLE avendor ADD COLUMN postcodestreet TEXT;");
await ExecQueryAsync("ALTER TABLE aunit ADD COLUMN postcodestreet TEXT;");
await ExecQueryAsync("ALTER TABLE aworkorder ADD COLUMN postcodestreet TEXT;");
await ExecQueryAsync("ALTER TABLE aquote ADD COLUMN postcodestreet TEXT;");
await ExecQueryAsync("ALTER TABLE apm ADD COLUMN postcodestreet TEXT;");
//english translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'AddressPostal', 'Postal / ZIP code' FROM atranslation t where t.baselanguage = 'en'");
//spanish translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'AddressPostal', 'Código postal' FROM atranslation t where t.baselanguage = 'es'");
//french translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'AddressPostal', 'Code postal' FROM atranslation t where t.baselanguage = 'fr'");
//german translations
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'AddressPostal', 'Postleitzahl' FROM atranslation t where t.baselanguage = 'de'");
await SetSchemaLevelAsync(++currentSchema);
}
//#########################################

View File

@@ -1775,7 +1775,7 @@ namespace AyaNova.Util
gbiz.PostCity = gbiz.City;
gbiz.PostRegion = gbiz.Region;
gbiz.PostCountry = gbiz.Country;
gbiz.PostCode = Fake.Address.ZipCode();
gbiz.AddressPostal = gbiz.PostCode = Fake.Address.ZipCode();
gbiz.Phone1 = Fake.Phone.PhoneNumber();
gbiz.Phone2 = Fake.Phone.PhoneNumber();
gbiz.WebAddress = Fake.Internet.Protocol() + "://example." + Fake.Internet.DomainSuffix();
@@ -1965,7 +1965,7 @@ namespace AyaNova.Util
o.PostCity = o.City;
o.PostRegion = o.Region;
o.PostCountry = o.Country;
o.PostCode = Fake.Address.ZipCode();
o.AddressPostal = o.PostCode = Fake.Address.ZipCode();
o.Phone1 = Fake.Phone.PhoneNumber();
o.Phone2 = Fake.Phone.PhoneNumber();
@@ -2049,7 +2049,7 @@ namespace AyaNova.Util
o.PostCity = o.City;
o.PostRegion = o.Region;
o.PostCountry = o.Country;
o.PostCode = Fake.Address.ZipCode();
o.AddressPostal = o.PostCode = Fake.Address.ZipCode();
o.Phone1 = Fake.Phone.PhoneNumber();
o.Phone2 = Fake.Phone.PhoneNumber();
@@ -2995,7 +2995,7 @@ namespace AyaNova.Util
o.City = cust.City;
o.Region = cust.Region;
o.Country = cust.Country;
o.AddressPostal = cust.PostCode;
if (cust.BillHeadOffice && cust.HeadOfficeId != null)
{
@@ -3004,7 +3004,7 @@ namespace AyaNova.Util
o.PostCity = head.PostCity;
o.PostRegion = head.PostRegion;
o.PostCountry = head.PostCountry;
o.PostCode = head.PostCode;
}
else
{
@@ -3013,7 +3013,6 @@ namespace AyaNova.Util
o.PostCity = cust.PostCity;
o.PostRegion = cust.PostRegion;
o.PostCountry = cust.PostCountry;
o.PostCode = cust.PostCode;
}
}
@@ -3475,7 +3474,7 @@ namespace AyaNova.Util
o.City = cust.City;
o.Region = cust.Region;
o.Country = cust.Country;
o.AddressPostal = cust.PostCode;
if (cust.BillHeadOffice && cust.HeadOfficeId != null)
{