From 58830780c18669e0ffa5f9bf33094dddade55168 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 12 May 2021 20:02:29 +0000 Subject: [PATCH] --- server/AyaNova/biz/ContractBiz.cs | 4 ++-- server/AyaNova/util/AySchema.cs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/AyaNova/biz/ContractBiz.cs b/server/AyaNova/biz/ContractBiz.cs index 75ca37c2..f293d61c 100644 --- a/server/AyaNova/biz/ContractBiz.cs +++ b/server/AyaNova/biz/ContractBiz.cs @@ -466,7 +466,7 @@ MULTIPLE discount / markup ITEMS AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("HeadOffice")); if (await ct.Unit.AnyAsync(m => m.ContractId == inObj.Id)) AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Unit")); - if (await ct.WorkOrder.AnyAsync(m => m.ContractId == inObj.Id)) + if (await ct.WorkOrder.AnyAsync(m => m.ContractId == inObj.Id)) AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("WorkOrder")); } @@ -523,7 +523,7 @@ MULTIPLE discount / markup ITEMS UserTranslationId, CurrentUserRoles); if (preTrans == null) - await TranslationBiz.GetSubsetStaticAsync( + preTrans = await TranslationBiz.GetSubsetStaticAsync( new List { "TimeSpanDays", "TimeSpanHours", "TimeSpanMinutes", "TimeSpanSeconds" }, UserTranslationId); diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index 28be37e4..d8bcd7dd 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -25,13 +25,13 @@ namespace AyaNova.Util internal const long EXPECTED_COLUMN_COUNT = 943; internal const long EXPECTED_INDEX_COUNT = 141; internal const long EXPECTED_CHECK_CONSTRAINTS = 435; - internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 116; + internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 115; internal const long EXPECTED_VIEWS = 6; internal const long EXPECTED_ROUTINES = 2; //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!! - ///////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// C943:I141:CC435:FC115:V6:R2 /* @@ -758,11 +758,11 @@ $BODY$ LANGUAGE PLPGSQL STABLE"); //WORKORDER await ExecQueryAsync("CREATE TABLE aworkorder (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, serial BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, " + "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, customerid BIGINT NOT NULL REFERENCES acustomer (id), " - + "projectid BIGINT REFERENCES aproject, contractid BIGINT NULL REFERENCES acontract, internalreferencenumber text, customerreferencenumber text, customercontactname text, " + + "projectid BIGINT REFERENCES aproject, contractid BIGINT NULL, internalreferencenumber text, customerreferencenumber text, customercontactname text, " + "servicedate TIMESTAMP, completebydate TIMESTAMP, invoicenumber TEXT, customersignature TEXT, customersignaturename TEXT, customersignaturecaptured TIMESTAMP, " + "techsignature TEXT, techsignaturename TEXT, techsignaturecaptured TIMESTAMP, durationtocompleted INTERVAL NOT NULL, onsite BOOL NOT NULL, contract TEXT, " + "postaddress TEXT, postcity TEXT, postregion TEXT, postcountry TEXT, postcode TEXT, address TEXT, city TEXT, region TEXT, country TEXT, latitude DECIMAL(9,6), longitude DECIMAL(9,6) " - + ")"); + + ")");//note deliberately not referencing contract here as it's not tied to it, just needs to keep track of it in case user selects alternate then triggers recalc await ExecQueryAsync("CREATE TABLE aworkorderstate (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderid BIGINT NOT NULL REFERENCES aworkorder (id), " + "workorderstatusid BIGINT NOT NULL REFERENCES aworkorderstatus (id), created TIMESTAMP NOT NULL, userid BIGINT NOT NULL REFERENCES auser (id)"