diff --git a/devdocs/todo.txt b/devdocs/todo.txt index baadaa34..ca174d15 100644 --- a/devdocs/todo.txt +++ b/devdocs/todo.txt @@ -1,23 +1,4 @@ -New laptop research -=-=-=-=-=-=-=-=-=-=- - -- NEED: need ability to quickly be back up and running if stolen or lost or broken, this is a huge consideration to factor in wherever possible -- Time saved with faster computer more than makes up for the purchase cost, even 80 seconds a day lost over 3 years is the price of a new laptop in lost productivity and wages etc -- 3 year replacement cycle or faster if slowing down production is recommended -- Security is an important consideration, newer laptops that can run latest OS are more secure and this is a real consideration for me as I'm using it to manage everything -- Must support and use biometric security, I might be travelling / homeless and need a secure computer -- MULTI APP RUNNING AT ONCE; I used a *lot* of open windows and multiple things running at once, i'm getting by with 12gb of ram but is that enough and will windows 11 eat up more ram? -- Lowest bloatware and easily removed bloatware -- anti theft options, find my pc options? -- Most important aspects: Processor speed, Ram, storage speed. Secondary: security features, portability, battery life, keyboard, Tertiary: display (will use monitor most of time) - - -New phone research -=-=-=-=-=-=-=-=-=- - -- Security!!! New phone = more secure with latest OS if it can't run latest os it's insecure by definition; older phone could be a huge security risk -- Must use biometric security as good as possible -- anti theft / find my phone options? - +LAST DOCUMENTATION LEFT OFF AT +HeadOffices seems to be done whatever is next below diff --git a/server/AyaNova/Controllers/CustomerController.cs b/server/AyaNova/Controllers/CustomerController.cs index b7b1bae2..206a8ca9 100644 --- a/server/AyaNova/Controllers/CustomerController.cs +++ b/server/AyaNova/Controllers/CustomerController.cs @@ -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("", "", "", "", "", "")) })); } diff --git a/server/AyaNova/Controllers/UnitController.cs b/server/AyaNova/Controllers/UnitController.cs index b2402492..aed995a7 100644 --- a/server/AyaNova/Controllers/UnitController.cs +++ b/server/AyaNova/Controllers/UnitController.cs @@ -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) })); } diff --git a/server/AyaNova/biz/CustomerBiz.cs b/server/AyaNova/biz/CustomerBiz.cs index df36e0fd..28b30870 100644 --- a/server/AyaNova/biz/CustomerBiz.cs +++ b/server/AyaNova/biz/CustomerBiz.cs @@ -249,6 +249,7 @@ namespace AyaNova.Biz .AddText(obj.City) .AddText(obj.Region) .AddText(obj.Country) + .AddText(obj.AddressPostal) .AddCustomFields(obj.CustomFields); } diff --git a/server/AyaNova/biz/HeadOfficeBiz.cs b/server/AyaNova/biz/HeadOfficeBiz.cs index a9c808f1..80d927e4 100644 --- a/server/AyaNova/biz/HeadOfficeBiz.cs +++ b/server/AyaNova/biz/HeadOfficeBiz.cs @@ -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); } diff --git a/server/AyaNova/biz/PMBiz.cs b/server/AyaNova/biz/PMBiz.cs index f8aa332e..71ae0d12 100644 --- a/server/AyaNova/biz/PMBiz.cs +++ b/server/AyaNova/biz/PMBiz.cs @@ -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); diff --git a/server/AyaNova/biz/QuoteBiz.cs b/server/AyaNova/biz/QuoteBiz.cs index 69d8fc23..c004a040 100644 --- a/server/AyaNova/biz/QuoteBiz.cs +++ b/server/AyaNova/biz/QuoteBiz.cs @@ -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); diff --git a/server/AyaNova/biz/ReportBiz.cs b/server/AyaNova/biz/ReportBiz.cs index 021b11db..749713e3 100644 --- a/server/AyaNova/biz/ReportBiz.cs +++ b/server/AyaNova/biz/ReportBiz.cs @@ -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"); diff --git a/server/AyaNova/biz/UnitBiz.cs b/server/AyaNova/biz/UnitBiz.cs index 320bdd1a..4e320cca 100644 --- a/server/AyaNova/biz/UnitBiz.cs +++ b/server/AyaNova/biz/UnitBiz.cs @@ -225,6 +225,7 @@ namespace AyaNova.Biz .AddText(obj.City) .AddText(obj.Region) .AddText(obj.Country) + .AddText(obj.AddressPostal) .AddCustomFields(obj.CustomFields); } diff --git a/server/AyaNova/biz/VendorBiz.cs b/server/AyaNova/biz/VendorBiz.cs index eb35342d..8eed32ee 100644 --- a/server/AyaNova/biz/VendorBiz.cs +++ b/server/AyaNova/biz/VendorBiz.cs @@ -243,6 +243,7 @@ namespace AyaNova.Biz .AddText(obj.City) .AddText(obj.Region) .AddText(obj.Country) + .AddText(obj.AddressPostal) .AddCustomFields(obj.CustomFields); } diff --git a/server/AyaNova/biz/WorkOrderBiz.cs b/server/AyaNova/biz/WorkOrderBiz.cs index 2edd2d64..c59a2c25 100644 --- a/server/AyaNova/biz/WorkOrderBiz.cs +++ b/server/AyaNova/biz/WorkOrderBiz.cs @@ -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); diff --git a/server/AyaNova/models/Customer.cs b/server/AyaNova/models/Customer.cs index 1f3c33ab..6e222b7f 100644 --- a/server/AyaNova/models/Customer.cs +++ b/server/AyaNova/models/Customer.cs @@ -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; } diff --git a/server/AyaNova/models/GlobalBizSettings.cs b/server/AyaNova/models/GlobalBizSettings.cs index 2cab492c..6d454d92 100644 --- a/server/AyaNova/models/GlobalBizSettings.cs +++ b/server/AyaNova/models/GlobalBizSettings.cs @@ -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; } diff --git a/server/AyaNova/models/HeadOffice.cs b/server/AyaNova/models/HeadOffice.cs index 9126cbac..4bda31b8 100644 --- a/server/AyaNova/models/HeadOffice.cs +++ b/server/AyaNova/models/HeadOffice.cs @@ -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; } diff --git a/server/AyaNova/models/PM.cs b/server/AyaNova/models/PM.cs index acb215d3..05269656 100644 --- a/server/AyaNova/models/PM.cs +++ b/server/AyaNova/models/PM.cs @@ -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; } diff --git a/server/AyaNova/models/Quote.cs b/server/AyaNova/models/Quote.cs index 93048d21..26980b1e 100644 --- a/server/AyaNova/models/Quote.cs +++ b/server/AyaNova/models/Quote.cs @@ -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; } diff --git a/server/AyaNova/models/Unit.cs b/server/AyaNova/models/Unit.cs index 6e437252..628f2691 100644 --- a/server/AyaNova/models/Unit.cs +++ b/server/AyaNova/models/Unit.cs @@ -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; } diff --git a/server/AyaNova/models/Vendor.cs b/server/AyaNova/models/Vendor.cs index b43a1312..c3906ea0 100644 --- a/server/AyaNova/models/Vendor.cs +++ b/server/AyaNova/models/Vendor.cs @@ -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; } diff --git a/server/AyaNova/models/WorkOrder.cs b/server/AyaNova/models/WorkOrder.cs index 29fc252d..a72c0151 100644 --- a/server/AyaNova/models/WorkOrder.cs +++ b/server/AyaNova/models/WorkOrder.cs @@ -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; } diff --git a/server/AyaNova/models/dto/AddressRecord.cs b/server/AyaNova/models/dto/AddressRecord.cs index d17bfc1e..008e3520 100644 --- a/server/AyaNova/models/dto/AddressRecord.cs +++ b/server/AyaNova/models/dto/AddressRecord.cs @@ -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); } diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 129bbc59..925cfbcc 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -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); + + } + //######################################### diff --git a/server/AyaNova/util/Seeder.cs b/server/AyaNova/util/Seeder.cs index 2ec958f6..929059a4 100644 --- a/server/AyaNova/util/Seeder.cs +++ b/server/AyaNova/util/Seeder.cs @@ -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) {